Home-AssistantConfig/config/www/community/frigate-hass-card/timeline-6aa9e747.js

183 lines
626 KiB
JavaScript
Raw Normal View History

2024-04-24 04:21:06 +00:00
import{dt as t,du as e,d8 as n,dv as o,dw as s,ca as r,dx as a,bl as l,bn as h,s as d,dn as c,y as u,bk as p,cP as m,cS as f,d1 as g,bj as v,cO as y,bm as b,dy as w,c2 as _,l as x,cp as k,cq as D,b$ as C,dz as S,cU as T,dA as E,d5 as M,cc as O,cd as I,dB as A,d7 as P,d4 as N,c5 as F,bQ as R,cn as L,c0 as j,dC as Y,cM as H}from"./card-555679fd.js";import{s as z}from"./index-52dee8bb.js";import{c as B}from"./_commonjsHelpers-1789f0cf.js";var W={exports:{}};!function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}W.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((i=n[o])===e||i.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}();var G=W.exports;
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */function V(){return V=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},V.apply(this,arguments)}function U(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function $(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var q,X="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign,K=["","webkit","Moz","MS","ms","o"],Z="undefined"==typeof document?{style:{}}:document.createElement("div"),Q="function",J=Math.round,tt=Math.abs,et=Date.now;function it(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<K.length;){if((n=(i=K[s])?i+o:e)in t)return n;s++}}q="undefined"==typeof window?{}:window;var nt=it(Z.style,"touchAction"),ot=void 0!==nt;var st="compute",rt="auto",at="manipulation",lt="none",ht="pan-x",dt="pan-y",ct=function(){if(!ot)return!1;var t={},e=q.CSS&&q.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return t[i]=!e||q.CSS.supports("touch-action",i)})),t}(),ut="ontouchstart"in q,pt=void 0!==it(q,"PointerEvent"),mt=ut&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ft="touch",gt="mouse",vt=25,yt=1,bt=2,wt=4,_t=8,xt=1,kt=2,Dt=4,Ct=8,St=16,Tt=kt|Dt,Et=Ct|St,Mt=Tt|Et,Ot=["x","y"],It=["clientX","clientY"];function At(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function Pt(t,e){return typeof t===Q?t.apply(e&&e[0]||void 0,e):t}function Nt(t,e){return t.indexOf(e)>-1}var Ft=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===st&&(t=this.compute()),ot&&this.manager.element.style&&ct[t]&&(this.manager.element.style[nt]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return At(this.manager.recognizers,(function(e){Pt(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Nt(t,lt))return lt;var e=Nt(t,ht),i=Nt(t,dt);return e&&i?lt:e||i?e?ht:dt:Nt(t,at)?at:rt}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Nt(n,lt)&&!ct[lt],s=Nt(n,dt)&&!ct[dt],r=Nt(n,ht)&&!ct[ht];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&i&Tt||r&&i&Et?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Rt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Lt(t){var e=t.length;if(1===e)return{x:J(t[0].clientX),y:J(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:J(i/e),y:J(n/e)}}function jt(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:J(t.pointers[i].clientX),clientY:J(t.pointers[i].clientY)},i++;return{timeStamp:et(),pointers:e,center:Lt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Yt(t,e,i){i||(i=Ot);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function Ht(t,e,i){i||(i=Ot);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function zt(t,e){return t===e?xt:tt(t)>=tt(e)?t<0?kt:Dt:e<0?Ct:St}function Bt(t,e,i){return{x:e/t||0,y:i/t||0}}function Wt(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=jt(e)),o>1&&!i.firstMultiple?i.firstMultiple=jt(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Lt(n);e.timeStamp=et(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Ht(a,l),e.distance=Yt(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta
/**
* vis-util
* https://github.com/visjs/vis-util
*
* utilitie collection for visjs
*
* @version 5.0.3
* @date 2022-03-04T18:53:16.725Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
const Je=Symbol("DELETE");function ti(t,...e){return ei({},t,...e)}function ei(...t){const e=ii(...t);return oi(e),e}function ii(...t){if(t.length<2)return t[0];if(t.length>2)return ii(ei(t[0],t[1]),...t.slice(2));const e=t[0],i=t[1];for(const t of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,t)&&(i[t]===Je?delete e[t]:null===e[t]||null===i[t]||"object"!=typeof e[t]||"object"!=typeof i[t]||Array.isArray(e[t])||Array.isArray(i[t])?e[t]=ni(i[t]):e[t]=ii(e[t],i[t]));return e}function ni(t){return Array.isArray(t)?t.map((t=>ni(t))):"object"==typeof t&&null!==t?ii({},t):t}function oi(t){for(const e of Object.keys(t))t[e]===Je?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&oi(t[e])}const si="undefined"!=typeof window?window.Hammer||Qe:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function ri(t){this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const e=si(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push((()=>{e.destroy()}));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{e.on(t,(t=>{t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}G(ri.prototype),ri.current=null,ri.prototype.destroy=function(){this.deactivate();for(const t of this._cleanupQueue.splice(0).reverse())t()},ri.prototype.activate=function(){ri.current&&ri.current.deactivate(),ri.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},ri.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},ri.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const ai=/^\/?Date\((-?\d+)/i,li=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hi=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,di=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,ci=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function ui(t){return t instanceof Number||"number"==typeof t}function pi(t){return t instanceof String||"string"==typeof t}function mi(t){return"object"==typeof t&&null!==t}function fi(t,e,i,n){let o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}const gi=Object.assign;function vi(t,e,i=!1,n=!1){for(const o in e)(Object.prototype.hasOwnProperty.call(e,o)||!0===i)&&("object"==typeof e[o]&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?void 0===t[o]?t[o]=vi({},e[o],i):"object"==typeof t[o]&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?vi(t[o],e[o],i):fi(t,e,o,n):Array.isArray(e[o])?t[o]=e[o].slice():fi(t,e,o,n));return t}function yi(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function bi(t,e){return[...t,e]}function wi(t){return t.slice()}const _i=Object.values;const xi={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"
//! moment.js
i.version="2.29.4",n($i),i.fn=ds,i.min=Zi,i.max=Qi,i.now=Ji,i.utc=p,i.unix=cs,i.months=ys,i.isDate=d,i.locale=pi,i.invalid=v,i.duration=Mn,i.isMoment=x,i.weekdays=ws,i.parseZone=us,i.localeData=gi,i.isDuration=rn,i.monthsShort=bs,i.weekdaysMin=xs,i.defineLocale=mi,i.updateLocale=fi,i.locales=vi,i.weekdaysShort=_s,i.normalizeUnits=it,i.relativeTimeRounding=sr,i.relativeTimeThreshold=rr,i.calendarFormat=Bn,i.prototype=ds,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}();var Mn=En.exports,On={exports:{}},In={},An={exports:{}},Pn={};function Nn(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid
/**
* vis-timeline and vis-graph2d
* https://visjs.github.io/vis-timeline/
*
* Create a fully customizable, interactive timeline with items and ranges.
*
* @version 7.7.0
* @date 2022-07-10T21:34:08.601Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
var No="undefined"!=typeof window&&window.moment||Mn;function Fo(t){if(!t)return!1;let e=t.idProp??t._idProp;return!!e&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}(t,e.getDataSet())}(e,t)}const Ro=/^\/?Date\((-?\d+)/i,Lo=/^\d+$/;function jo(t,e){let i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return pi(t)&&!isNaN(Date.parse(t))?Mn(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":try{return jo(t,"Moment").toDate()}catch(i){throw i instanceof TypeError?new TypeError("Cannot convert object of type "+yi(t)+" to type "+e):i}case"Moment":if(ui(t))return Mn(t);if(t instanceof Date)return Mn(t.valueOf());if(Mn.isMoment(t))return Mn(t);if(pi(t))return i=Ro.exec(t),i?Mn(Number(i[1])):(i=Lo.exec(t),Mn(i?Number(t):t));throw new TypeError("Cannot convert object of type "+yi(t)+" to type "+e);case"ISODate":if(ui(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(Mn.isMoment(t))return t.toDate().toISOString();if(pi(t))return i=Ro.exec(t),i?new Date(Number(i[1])).toISOString():Mn(t).format();throw new Error("Cannot convert object of type "+yi(t)+" to type ISODate");case"ASPDate":if(ui(t))return"/Date("+t+")/";if(t instanceof Date||Mn.isMoment(t))return"/Date("+t.valueOf()+")/";if(pi(t)){let e;return i=Ro.exec(t),e=i?new Date(Number(i[1])).valueOf():new Date(t).valueOf(),"/Date("+e+")/"}throw new Error("Cannot convert object of type "+yi(t)+" to type ASPDate");default:throw new Error(`Unknown type ${e}`)}}}function Yo(t,e={start:"Date",end:"Date"}){const i=t._idProp,n=new Dn({fieldId:i}),o=(s=t,new bn(s)).map((t=>Object.keys(t).reduce(((i,n)=>(i[n]=jo(t[n],e[n]),i)),{}))).to(n);
/**
* vis-data
* http://visjs.org/
*
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
*
* @version 7.1.4
* @date 2022-03-15T15:23:59.245Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
var s;return o.all().start(),{add:(...e)=>t.getDataSet().add(...e),remove:(...e)=>t.getDataSet().remove(...e),update:(...e)=>t.getDataSet().update(...e),updateOnly:(...e)=>t.getDataSet().updateOnly(...e),clear:(...e)=>t.getDataSet().clear(...e),forEach:n.forEach.bind(n),get:n.get.bind(n),getIds:n.getIds.bind(n),off:n.off.bind(n),on:n.on.bind(n),get length(){return n.length},idProp:i,type:e,rawDS:t,coercedDS:n,dispose:()=>o.stop()}}const Ho=t=>{const e=new Ao.FilterXSS(t);return t=>e.process(t)},zo=t=>t;let Bo=Ho();const Wo={...Ki,convert:jo,setupXSSProtection:t=>{t&&(!0===t.disabled?(Bo=zo,console.warn("You disabled XSS protection for vis-Timeline. I sure hope you know what you're doing!")):t.filterOptions&&(Bo=Ho(t.filterOptions)))}};Object.defineProperty(Wo,"xss",{get:function(){return Bo}});class Go{constructor(t,e){this.options=null,this.props=null}setOptions(t){t&&Wo.extend(this.options,t)}redraw(){return!1}destroy(){}_isResized(){const t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t}}function Vo(t,e,i){if(i&&!Array.isArray(i))return Vo(t,e,[i]);if(e.hiddenDates=[],i&&1==Array.isArray(i)){for(let n=0;n<i.length;n++)if(void 0===i[n].repeat){const o={};o.start=t(i[n].start).toDate().valueOf(),o.end=t(i[n].end).toDate().valueOf(),e.hiddenDates.push(o)}e.hiddenDates.sort(((t,e)=>t.start-e.start))}}function Uo(t,e,i){if(i&&!Array.isArray(i))return Uo(t,e,[i]);if(i&&void 0!==e.domProps.centerContainer.width){Vo(t,e,i);const n=t(e.range.start),o=t(e.range.end),s=(e.range.end-e.range.start)/e.domProps.centerContainer.width;for(let r=0;r<i.length;r++)if(void 0!==i[r].repeat){const a=t(i[r].start);let l=t(i[r].end);if("Invalid Date"==a._d)throw new Error(`Supplied start date is not valid: ${i[r].start}`);if("Invalid Date"==l._d)throw new Error(`Supplied end date is not valid: ${i[r].end}`);if(l-a>=4*s){let t=0;const s=o.clone();switch(i[r].repeat){case"daily":a.day()!=l.day()&&(t=1),a.dayOfYear(n.dayOfYear()),a.year(n.year()),a.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-t,"days"),s.add(1,"weeks");break;case"weekly":{const t=l.diff(a,"days"),e=a.day();a.date(n.date()),a.month(n.month()),a.year(n.year()),l=a.clone(),a.day(e),l.day(e),l.add(t,"days"),a.subtract(1,"weeks"),l.subtract(1,"weeks"),s.add(1,"weeks");break}case"monthly":a.month()!=l.month()&&(t=1),a.month(n.month()),a.year(n.year()),a.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(t,"months"),s.add(1,"months");break;case"yearly":a.year()!=l.year()&&(t=1),a.year(n.year()),a.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(t,"years"),s.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[r].repeat)}for(;a<s;)switch(e.hiddenDates.push({start:a.valueOf(),end:l.valueOf()}),i[r].repeat){case"daily":a.add(1,"days"),l.add(1,"days");break;case"weekly":a.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":a.add(1,"months"),l.add(1,"months");break;case"yearly":a.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[r].repeat)}e.hiddenDates.push({start:a.valueOf(),end:l.valueOf()})}}!function(t){const e=t.hiddenDates,i=[];for(var n=0;n<e.length;n++)for(let t=0;t<e.length;t++)n!=t&&1!=e[t].remove&&1!=e[n].remove&&(e[t].start>=e[n].start&&e[t].end<=e[n].end?e[t].remove=!0:e[t].start>=e[n].start&&e[t].start<=e[n].end?(e[n].end=e[t].end,e[t].remove=!0):e[t].end>=e[n].start&&e[t].end<=e[n].end&&(e[n].start=e[t].start,e[t].remove=!0));for(n=0;n<e.length;n++)!0!==e[n].remove&&i.push(e[n]);t.hiddenDates=i,t.hiddenDates.sort(((t,e)=>t.start-e.start))}(e);const r=Jo(e.range.start,e.hiddenDates),a=Jo(e.range.end,e.hiddenDates);let l=e.range.start,h=e.range.end;1==r.hidden&&(l=1==e.range.startToFront?r.startDate-1:r.endDate+1),1==a.hidden&&(h=1==e.range.endToFront?a.startDate-1:a.endDate+1),1!=r.hidden&&1
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */function Ef(){return Ef=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Ef.apply(this,arguments)}function Mf(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Of(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}Sf="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var If,Af=Sf,Pf=["","webkit","Moz","MS","ms","o"],Nf="undefined"==typeof document?{style:{}}:document.createElement("div"),Ff=Math.round,Rf=Math.abs,Lf=Date.now;function jf(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<Pf.length;){if((n=(i=Pf[s])?i+o:e)in t)return n;s++}}If="undefined"==typeof window?{}:window;var Yf=jf(Nf.style,"touchAction"),Hf=void 0!==Yf,zf="compute",Bf="auto",Wf="manipulation",Gf="none",Vf="pan-x",Uf="pan-y",$f=function(){if(!Hf)return!1;var t={},e=If.CSS&&If.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return t[i]=!e||If.CSS.supports("touch-action",i)})),t}(),qf="ontouchstart"in If,Xf=void 0!==jf(If,"PointerEvent"),Kf=qf&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Zf="touch",Qf="mouse",Jf=16,tg=24,eg=["x","y"],ig=["clientX","clientY"];function ng(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function og(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function sg(t,e){return t.indexOf(e)>-1}var rg=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===zf&&(t=this.compute()),Hf&&this.manager.element.style&&$f[t]&&(this.manager.element.style[Yf]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return ng(this.manager.recognizers,(function(e){og(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(sg(t,Gf))return Gf;var e=sg(t,Vf),i=sg(t,Uf);return e&&i?Gf:e||i?e?Vf:Uf:sg(t,Wf)?Wf:Bf}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=sg(n,Gf)&&!$f.none,s=sg(n,Uf)&&!$f["pan-y"],r=sg(n,Vf)&&!$f["pan-x"];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&6&i||r&&i&tg?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function ag(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function lg(t){var e=t.length;if(1===e)return{x:Ff(t[0].clientX),y:Ff(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:Ff(i/e),y:Ff(n/e)}}function hg(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:Ff(t.pointers[i].clientX),clientY:Ff(t.pointers[i].clientY)},i++;return{timeStamp:Lf(),pointers:e,center:lg(e),deltaX:t.deltaX,deltaY:t.deltaY}}function dg(t,e,i){i||(i=eg);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function cg(t,e,i){i||(i=eg);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function ug(t,e){return t===e?1:Rf(t)>=Rf(e)?t<0?2:4:e<0?8:Jf}function pg(t,e,i){return{x:e/t||0,y:i/t||0}}function mg(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=hg(e)),o>1&&!i.firstMultiple?i.firstMultiple=hg(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=lg(n);e.timeStamp=Lf(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=cg(a,l),e.distance=dg(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};1!==e.eventTyp
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Br(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}var Wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Gr={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Vr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ur=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},$r=function(t){return!0===t?1:0};function qr(t,e){var i;return function(){var n=this,o=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(n,o)}),e)}}var Xr=function(t){return t instanceof Array?t:[t]};function Kr(t,e,i){if(!0===i)return t.classList.add(e);t.classList.remove(e)}function Zr(t,e,i){var n=window.document.createElement(t);return e=e||"",i=i||"",n.className=e,void 0!==i&&(n.textContent=i),n}function Qr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Jr(t,e){return e(t)?t:t.parentNode?Jr(t.parentNode,e):void 0}function ta(t,e){var i=Zr("div","numInputWrapper"),n=Zr("input","numInput "+t),o=Zr("span","arrowUp"),s=Zr("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var r in e)n.setAttribute(r,e[r]);return i.appendChild(n),i.appendChild(o),i.appendChild(s),i}function ea(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}
:host {
width: fit-content;
display: block;
cursor: pointer;
background: #fff;
color: #000;
overflow: hidden;
}
::slotted(*) {
cursor: pointer;
}
input {
width: 100%;
height: 100%;
font-size: inherit;
cursor: pointer;
background: inherit;
box-sizing: border-box;
outline: none;
color: inherit;
border: none;
}
`]}firstUpdated(){this._hasSlottedElement=this.checkForSlottedElement()}updated(){this.init()}getToday(){const t=new Date;return`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`}checkForSlottedElement(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=e?e.assignedNodes().filter(this.removeTextNodes):[];return null!=e&&i&&i.length>0}getSlottedElement(){var t;if(!this._hasSlottedElement)return;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=null==e?void 0:e.assignedNodes().filter(this.removeTextNodes);return!i||i.length<1?void 0:i[0]}removeTextNodes(t){return"#text"!==t.nodeName}async init(){const t=new ka(this.theme);await t.initStyles(),this.locale&&await async function(t){const e=Da+"/"+t+".js";await import(e)}(this.locale),await this.initializeComponent()}async getOptions(){let t={altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,allowInput:this.allowInput,ariaDateFormat:this.ariaDateFormat,clickOpens:this.clickOpens,dateFormat:this.dateFormat,defaultDate:this.defaultToToday?this.getToday():this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableTime:this.enableTime,enableSeconds:this.enableSeconds,formatDate:this.formatDateFn,hourIncrement:this.hourIncrement,inline:this.inline,maxDate:this.maxDate,minDate:this.minDate,minuteIncrement:this.minuteIncrement,mode:this.mode,nextArrow:this.nextArrow,prevArrow:this.prevArrow,noCalendar:this.noCalendar,onChange:this.onChange,onClose:this.onClose,onOpen:this.onOpen,onReady:this.onReady,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,onValueUpdate:this.onValueUpdate,parseDate:this.parseDateFn,position:this.position,shorthandCurrentMonth:this.shorthandCurrentMonth,showMonths:this.showMonths,static:this.static,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,locale:this.locale,plugins:[]};return t=await async function(t,e){if(t.weekSelect){const t=(await import(Ca+"/esm/plugins/weekSelect/weekSelect.js")).default;e={...e,plugins:[...e.plugins,t()],onChange:function(){const t=this.selectedDates[0]?this.config.getWeek(this.selectedDates[0]):null;this.input.value=t}}}if(t.monthSelect){const i=(await import(Ca+"/esm/plugins/monthSelect/index.js")).default;e={...e,plugins:[...e.plugins,i({shorthand:!1,dateFormat:t.dateFormat,altFormat:t.altFormat})]};const n=document.createElement("link");n.rel="stylesheet",n.href=Ca+"/plugins/monthSelect/style.css",document.head.appendChild(n)}return e}(this,t),Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),t}async initializeComponent(){var t;let e;if(this._instance&&Object.prototype.hasOwnProperty.call(this,"destroy")&&this._instance.destroy(),e=this._hasSlottedElement?this.findInputField():null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("input"),e){this._inputElement=e,flatpickr.l10ns.default.firstDayOfWeek=this.firstDayOfWeek;const t=await this.getOptions();this._instance=flatpickr(e,t)}}findInputField(){let t=null;if(t=this.querySelector("input"),t)return t;const e=this.getSlottedElement();return void 0!==typeof e&&(t=this.searchWebComponentForInputElement(e)),t||null}searchWebComponentForInputElement(t){let e=this.getInputFieldInElement(t);if(e)return e;const i=this.getWebComponentsInsideElement(t);for(let t=0;t<i.length&&(e=this.searchWebComponentForInputElement(i[t]),!e);t++);return e}getInputFieldInElement(t){let e=null;return e=t.shadowRoot?t.shadowRoot.querySelector("input"):t.querySelector("input"),e}getWebComponentsInsideElement(t){return t.shadowRoot?[...Array.from(t.querySelectorAll("*")),...Array.from(t.shadowRoot.querySelectorAll("*"))].filter((t=>t.shadowRoot)):Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot))}changeMonth(t,e=!0){this._instance&&this._instance.changeMonth(t,e)}clear(){this._instance&&this._instance.clear()}close(){this._instance&&this._instance.close()}destroy(){this._instance&&this._instance.destroy()}formatDate(t,e){return this._insta
${this._hasSlottedElement?u``:u`<input class="lit-flatpickr flatpickr flatpickr-input" placeholder=${this.placeholder} />`}
<slot></slot>
`}};Br([l({type:String})],Sa.prototype,"placeholder",void 0),Br([l({type:String})],Sa.prototype,"altFormat",void 0),Br([l({type:Boolean})],Sa.prototype,"altInput",void 0),Br([l({type:String})],Sa.prototype,"altInputClass",void 0),Br([l({type:Boolean})],Sa.prototype,"allowInput",void 0),Br([l({type:String})],Sa.prototype,"ariaDateFormat",void 0),Br([l({type:Boolean})],Sa.prototype,"clickOpens",void 0),Br([l({type:String})],Sa.prototype,"dateFormat",void 0),Br([l({type:Object})],Sa.prototype,"defaultDate",void 0),Br([l({type:Number})],Sa.prototype,"defaultHour",void 0),Br([l({type:Number})],Sa.prototype,"defaultMinute",void 0),Br([l({type:Array})],Sa.prototype,"disable",void 0),Br([l({type:Boolean})],Sa.prototype,"disableMobile",void 0),Br([l({type:Array})],Sa.prototype,"enable",void 0),Br([l({type:Boolean})],Sa.prototype,"enableTime",void 0),Br([l({type:Boolean})],Sa.prototype,"enableSeconds",void 0),Br([l({type:Function})],Sa.prototype,"formatDateFn",void 0),Br([l({type:Number})],Sa.prototype,"hourIncrement",void 0),Br([l({type:Number})],Sa.prototype,"minuteIncrement",void 0),Br([l({type:Boolean})],Sa.prototype,"inline",void 0),Br([l({type:String})],Sa.prototype,"maxDate",void 0),Br([l({type:String})],Sa.prototype,"minDate",void 0),Br([l({type:String})],Sa.prototype,"mode",void 0),Br([l({type:String})],Sa.prototype,"nextArrow",void 0),Br([l({type:String})],Sa.prototype,"prevArrow",void 0),Br([l({type:Boolean})],Sa.prototype,"noCalendar",void 0),Br([l({type:Function})],Sa.prototype,"onChange",void 0),Br([l({type:Function})],Sa.prototype,"onClose",void 0),Br([l({type:Function})],Sa.prototype,"onOpen",void 0),Br([l({type:Function})],Sa.prototype,"onReady",void 0),Br([l({type:Function})],Sa.prototype,"onMonthChange",void 0),Br([l({type:Function})],Sa.prototype,"onYearChange",void 0),Br([l({type:Function})],Sa.prototype,"onValueUpdate",void 0),Br([l({type:Function})],Sa.prototype,"parseDateFn",void 0),Br([l({type:String})],Sa.prototype,"position",void 0),Br([l({type:Boolean})],Sa.prototype,"shorthandCurrentMonth",void 0),Br([l({type:Number})],Sa.prototype,"showMonths",void 0),Br([l({type:Boolean})],Sa.prototype,"static",void 0),Br([l({type:Boolean})],Sa.prototype,"time_24hr",void 0),Br([l({type:Boolean})],Sa.prototype,"weekNumbers",void 0),Br([l({type:Boolean})],Sa.prototype,"wrap",void 0),Br([l({type:String})],Sa.prototype,"theme",void 0),Br([l({type:Number})],Sa.prototype,"firstDayOfWeek",void 0),Br([l({type:String})],Sa.prototype,"locale",void 0),Br([l({type:Boolean,attribute:"default-to-today"})],Sa.prototype,"defaultToToday",void 0),Br([l({type:Boolean,attribute:"week-select"})],Sa.prototype,"weekSelect",void 0),Br([l({type:Boolean,attribute:"month-select"})],Sa.prototype,"monthSelect",void 0),Br([l({type:Boolean,attribute:"confirm-date"})],Sa.prototype,"confirmDate",void 0),Br([l({type:Boolean})],Sa.prototype,"_hasSlottedElement",void 0),Sa=Br([h("lit-flatpickr")],Sa);let Ta=class extends d{constructor(){super(...arguments),this._refInput=m()}open(){this._refInput.value?.open()}render(){return u` <lit-flatpickr
${f(this._refInput)}
.onChange=${t=>{t.length&&g(this,"date-picker:change",{date:t[0]})}}
></lit-flatpickr>`}static get styles(){return v("lit-flatpickr {\n visibility: hidden;\n width: 0px;\n height: 0px;\n}")}};Ta=p([h("frigate-card-date-picker")],Ta);class Ea extends CustomEvent{}const Ma="target_bar";let Oa=class extends d{constructor(){super(...arguments),this.details=!1}render(){if(!this.item)return u``;const t={item:this.item};return this.dispatchEvent(new Ea("frigate-card:timeline:thumbnail-data-request",{composed:!0,bubbles:!0,detail:t})),t.hass&&t.cameraManager&&t.cameraConfig&&t.media&&t.view?u` <frigate-card-thumbnail
.hass=${t.hass}
.cameraManager=${t.cameraManager}
.media=${t.media}
.view=${t.view}
?details=${this.details}
>
</frigate-card-thumbnail>`:u``}};p([l({attribute:!0})],Oa.prototype,"item",void 0),p([l({attribute:!0,type:Boolean})],Oa.prototype,"details",void 0),Oa=p([h("frigate-card-timeline-thumbnail")],Oa);let Ia=class extends d{constructor(){super(...arguments),this.mini=!1,this._panBehavior="seek",this._targetBarVisible=!1,this._refDatePicker=m(),this._refTimeline=m(),this._timelineSource=null,this._pointerHeld=null,this._ignoreClick=!1,this._isHoverableDevice=w(),this._throttledSetViewDuringRangeChange=_(this._setViewDuringRangeChange.bind(this),100)}_getTooltip(t){return this._isHoverableDevice?`\n <frigate-card-timeline-thumbnail\n item='${t.id}'\n ${this.thumbnailConfig?.show_details?"details":""}\n >\n </frigate-card-timeline-thumbnail>`:""}_handleThumbnailDataRequest(t){const e=t.detail.item,i=this._timelineSource?.dataset.get(e)?.media,n=i?this.cameraManager?.getStore().getCameraConfigForMedia(i)??void 0:void 0;t.detail.hass=this.hass,t.detail.cameraConfig=n,t.detail.cameraManager=this.cameraManager,t.detail.media=i,t.detail.view=this.view}render(){const t=this._getTimelineCameraIDs();if(!(this.hass&&this.view&&this.timelineConfig&&t))return;const e=this.cameraManager?.getAggregateCameraCapabilities(t),i="pan"===this._panBehavior?x("timeline.pan_behavior.pan"):"seek"===this._panBehavior?x("timeline.pan_behavior.seek"):x("timeline.pan_behavior.seek-in-media"),n="pan"===this._panBehavior?"mdi:pan-horizontal":"seek"===this._panBehavior?"mdi:filmstrip":"mdi:lock";return u` ${e?.supportsTimeline?u` <div
@frigate-card:timeline:thumbnail-data-request=${this._handleThumbnailDataRequest.bind(this)}
class="timeline"
${f(this._refTimeline)}
>
<div class="timeline-tools">
${this._shouldSupportSeeking()?u` <ha-icon
.icon=${n}
@click=${()=>{this._panBehavior="pan"===this._panBehavior?"seek":"seek"===this._panBehavior?"seek-in-media":"pan"}}
aria-label="${i}"
title="${i}"
>
</ha-icon>`:""}
<ha-icon
.icon=${"mdi:calendar-search"}
aria-label="${x("timeline.select_date")}"
title="${x("timeline.select_date")}"
@click=${()=>{this._refDatePicker.value?.open()}}
>
</ha-icon>
<frigate-card-date-picker
${f(this._refDatePicker)}
@frigate-card:date-picker:change=${t=>{this._timeline?.setWindow(k(t.detail.date),D(t.detail.date))}}
>
</frigate-card-date-picker>
</div>
</div>`:""}`}_getTimelineCameraIDs(){return this.cameraIDs??this.cameraManager?.getStore().getVisibleCameraIDs()??null}_timelineRangeChangeHandler(t){if(this._pointerHeld&&(this._ignoreClick=!0),this._shouldSupportSeeking()&&this._timeline&&t.byUser&&"wheel"!==t.event.type&&"pinchin"!==t.event.additionalEvent&&"pinchout"!==t.event.additionalEvent){const e=this._pointerHeld?.window?r(t.start,{seconds:(this._pointerHeld.time.getTime()-this._pointerHeld.window.start.getTime())/1e3}):t.end;this._pointerHeld&&this._setTargetBarAppropriately(e),this._throttledSetViewDuringRangeChange(e,t)}}_shouldSupportSeeking(){return this.mini}_setTargetBarAppropriately(t){if(!this._timeline)return;if(this._shouldSupportSeeking()&&("seek"===this._panBehavior||"seek-in-media"===this._panBehavior&&this._timeline.getSelection().some((e=>{const i=this._timelineSource?.dataset?.get(e);return i&&i.start&&i.end&&t.getTime()>=i.start&&t.getTime()<=i.end})))){this._targetBarVisible?this._timeline?.setCustomTime(t,Ma):(this._timeline?.addCustomTime(t,Ma),this._targetBarVisible=!0);const e=this._timeline.getWindow(),i=(t.getTime()-e.start.getTime())/(e.end.getTime()-e.start.getTime());this.setAttribute("target-bar-marker-direction",i<.25?"right":i>.75?"left":"center"),this._timeline?.setCustomTimeMarker?.(C(t,!0),Ma)}else this._removeTargetBar()}_removeTargetBar(){this.removeAttribute("target-bar-direction"),this._targetBarVisible&&(this._timeline?.removeCustomTime(Ma),this._targetBarVisible=!1)}async _setViewDuringRangeChange(t,e){const i=this.view?.queryResults,n=i?.getResults();if(!(n&&i&&this._timeline&&this.view&&this.hass&&this.cameraManager&&"pan"!==this._panBehavior))return;const o=this._shouldSupportSeeking(),s="seek-in-media"===this._panBehavior?null:i.clone().resetSelectedResult().selectBestResult((e=>S(e,t))),r=this.mini?t>=new Date?"live":"media":this.view.view;this.view.evolve({view:r,...s&&s.hasSelectedResult()&&{queryResults:s}}).mergeInContext({...o&&{mediaViewer:{seek:t}},...this._getTimelineContext({start:e.start,end:e.end})}).dispatchChangeEvent(this)}async _timelineClickHandler(t){(this._ignoreClick||t.what&&["item","background","group-label","axis"].includes(t.what))&&T(t.event);const e=this._getTimelineCameraIDs();if(this._ignoreClick||!this.hass||!this._timeline||!this.view||!this.cameraManager||!this.cardWideConfig||!e||!t.what)return;let i=null,n="close";if(this.timelineConfig?.show_recordings&&["background","group-label"].includes(t.what)){const e=t.group?new Set([String(t.group)]):this._getTimelineCameraIDs(),n=e?E(this.cameraManager,this.cardWideConfig,e):null;n&&(i=await M(this,this.hass,this.cameraManager,this.view,n,{targetView:"recording",targetTime:"background"===t.what?t.time:this._timeline.getWindow().end,select:"time"}))}else if(this.timelineConfig?.show_recordings&&"axis"===t.what){const n=E(this.cameraManager,this.cardWideConfig,e,{start:O(t.time),end:I(t.time)});n&&(i=await M(this,this.hass,this.cameraManager,this.view,n,{targetView:"recording",targetTime:t.time,select:"time"}))}else if(t.item&&"item"===t.what){const e=this.view.queryResults?.clone().resetSelectedResult().selectResultIfFound((e=>e.getID()===t.item));if(e&&e.hasSelectedResult())i=this.view.evolve({queryResults:e,view:"play"===this.itemClickAction?"media":this.view.view});else{const e=await this._createViewWithEventMediaQuery(this._createEventMediaQuerys(),{selectedItem:t.item,targetView:"media"});e?.queryResults?.hasResults()&&(i=e)}i?.queryResults?.hasResults()&&i.mergeInContext({mediaViewer:{seek:t.time}}),i?.mergeInContext(this._getTimelineContext()),"select"===this.itemClickAction&&i&&(n="open")}i&&i.dispatchChangeEvent(this),g(this,`thumbnails:${n}`),this._ignoreClick=!1}_getPrefetchWindow(t){const e=A(t.end,t.start);return{start:z(t.start,{seconds:e}),end:r(t.end,{seconds:e})}}async _timelineRangeChangedHandler(t){if(!t.byUser)return;if(this._removeTargetBar(),!this.hass)return;const e=this._getPrefetchWindow(t);if(await(this._timelineSource?.refresh(this.hass,e)),this._timeline&&this.view&&!P.areRecordingQueries(this.view.query)){
<frigate-card-timeline-core
.hass=${this.hass}
.view=${this.view}
.timelineConfig=${this.timelineConfig}
.thumbnailConfig=${this.timelineConfig.controls.thumbnails}
.cameraManager=${this.cameraManager}
.cardWideConfig=${this.cardWideConfig}
.itemClickAction=${"none"===this.timelineConfig.controls.thumbnails.mode?"play":"select"}
>
</frigate-card-timeline-core>
`:u``}static get styles(){return v(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};p([l({attribute:!1})],Aa.prototype,"hass",void 0),p([l({attribute:!1})],Aa.prototype,"view",void 0),p([l({attribute:!1})],Aa.prototype,"timelineConfig",void 0),p([l({attribute:!1})],Aa.prototype,"cameraManager",void 0),p([l({attribute:!1})],Aa.prototype,"cardWideConfig",void 0),Aa=p([h("frigate-card-timeline")],Aa);export{Aa as FrigateCardTimeline};