@ezuikit/player-theme 2.0.2-beta.5 → 2.0.2-beta.7

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
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.0.2-beta.5
3
- * Copyright (c) 2025-12-09 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.0.2-beta.7
3
+ * Copyright (c) 2025-12-10 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  (function (global, factory) {
@@ -391,7 +391,8 @@
391
391
  'speed',
392
392
  'urlInfo',
393
393
  'videoLevelList',
394
- 'videoLevel'
394
+ 'videoLevel',
395
+ 'recMonth'
395
396
  ];
396
397
  /**
397
398
  * 当移动端 picker 控件打开时需要关闭动画(定时器)
@@ -537,8 +538,9 @@
537
538
  /** 全局全屏控件销毁 */ globalFullscreenDestroy: 'Control.globalFullscreenDestroy',
538
539
  /** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
539
540
  /** 日期改变 */ dateChange: 'Control.dateChange',
541
+ /** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
540
542
  /** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
541
- /** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
543
+ /** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
542
544
  /** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
543
545
  /** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
544
546
  /** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
@@ -549,7 +551,7 @@
549
551
  /** 加载控件销毁 */ loadingDestroy: 'Control.loadingDestroy',
550
552
  /** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
551
553
  /** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
552
- contentRerender: 'Control.contentRerender'
554
+ /** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
553
555
  },
554
556
  /**
555
557
  * 主题控件相关
@@ -1472,8 +1474,8 @@
1472
1474
  /**
1473
1475
  * picker component for js framework, support mobile and pc
1474
1476
  *
1475
- * @skax/picker v1.1.5
1476
- * Copyright (c) 2025-11-15 ShineShao <xiaoshaoqq@gmail.com>
1477
+ * @skax/picker v1.1.7
1478
+ * Copyright (c) 2025-12-08 ShineShao <xiaoshaoqq@gmail.com>
1477
1479
  *
1478
1480
  * This source code is licensed under the MIT license found in the
1479
1481
  * LICENSE file in the root directory of this source tree.
@@ -1617,7 +1619,8 @@
1617
1619
  trigger: 'click',
1618
1620
  mouseLeaveDelay: 0.1,
1619
1621
  mouseEnterDelay: 0.1,
1620
- isMobile: false
1622
+ isMobile: false,
1623
+ triggerClose: false
1621
1624
  };
1622
1625
  /**
1623
1626
  * Picker 弹窗, 支持 PC 和移动端
@@ -1673,6 +1676,7 @@
1673
1676
  (_this__$popupContainer1 = this._$popupContainer) == null ? void 0 : _this__$popupContainer1.appendChild(this.$wrapperContent);
1674
1677
  this._onContentClick = this._onContentClick.bind(this);
1675
1678
  this._onShow = this._onShow.bind(this);
1679
+ this._onContainerClick = this._onContainerClick.bind(this);
1676
1680
  this._onWrapperShow = this._onWrapperShow.bind(this);
1677
1681
  this._onHide = this._onHide.bind(this);
1678
1682
  this._onDocumentClick = this._onDocumentClick.bind(this);
@@ -1755,7 +1759,7 @@
1755
1759
  var _this_$wrapperContent, _this_$container_removeEventListener, _this_$container, _this_$container_removeEventListener1, _this_$container1;
1756
1760
  (_this_$wrapperContent = this.$wrapperContent) == null ? void 0 : _this_$wrapperContent.removeEventListener('click', this._onContentClick);
1757
1761
  (_this_$container = this.$container) == null ? void 0 : (_this_$container_removeEventListener = _this_$container.removeEventListener) == null ? void 0 : _this_$container_removeEventListener.call(_this_$container, 'click', this._onContentClick);
1758
- if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_removeEventListener1 = _this_$container1.removeEventListener) == null ? void 0 : _this_$container_removeEventListener1.call(_this_$container1, 'click', this._onShow);
1762
+ if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_removeEventListener1 = _this_$container1.removeEventListener) == null ? void 0 : _this_$container_removeEventListener1.call(_this_$container1, 'click', this._onContainerClick);
1759
1763
  if (this._options.trigger === 'hover') {
1760
1764
  var _this_$container_removeEventListener2, _this_$container2, _this_$container_removeEventListener3, _this_$container3, _this_$container_removeEventListener4, _this_$container4,
1761
1765
  // prettier-ignore
@@ -1794,14 +1798,14 @@
1794
1798
  var $popupContainerRect = this._$popupContainer.getBoundingClientRect();
1795
1799
  // 容器的坐标 - 挂载的容器的坐标差
1796
1800
  // prettier-ignore
1797
- var containerLeft = $containerRect.left - $popupContainerRect.left;
1798
- var containerRight = -($containerRect.right - $popupContainerRect.right);
1801
+ var containerLeft = Math.ceil($containerRect.left) - Math.ceil($popupContainerRect.left);
1802
+ var containerRight = -(Math.ceil($containerRect.right) - Math.ceil($popupContainerRect.right));
1799
1803
  // prettier-ignore
1800
- var containerTop = $containerRect.y - $popupContainerRect.y;
1801
- var left = containerLeft + ($containerRect.width - $wrapperContentRect.width) / 2;
1804
+ var containerTop = Math.ceil($containerRect.y) - Math.ceil($popupContainerRect.y);
1805
+ var left = containerLeft + (Math.ceil($containerRect.width) - Math.ceil($wrapperContentRect.width)) / 2;
1802
1806
  var right;
1803
- var top = containerTop - $wrapperContentRect.height;
1804
- var bottom = containerTop + $containerRect.height;
1807
+ var top = containerTop - Math.ceil($wrapperContentRect.height);
1808
+ var bottom = containerTop + Math.ceil($containerRect.height);
1805
1809
  if (/^t/.test(this._options.placement)) {
1806
1810
  var _this__options_offset, _this__options_offset1, _this__options_offset2;
1807
1811
  switch (this._options.placement) {
@@ -1877,7 +1881,7 @@
1877
1881
  this.$wrapperContent.addEventListener('click', this._onContentClick);
1878
1882
  (_this_$container = this.$container) == null ? void 0 : (_this_$container_addEventListener = _this_$container.addEventListener) == null ? void 0 : _this_$container_addEventListener.call(_this_$container, 'click', this._onContentClick);
1879
1883
  //
1880
- if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_addEventListener1 = _this_$container1.addEventListener) == null ? void 0 : _this_$container_addEventListener1.call(_this_$container1, 'click', this._onShow);
1884
+ if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_addEventListener1 = _this_$container1.addEventListener) == null ? void 0 : _this_$container_addEventListener1.call(_this_$container1, 'click', this._onContainerClick);
1881
1885
  if (this._options.trigger === 'hover') {
1882
1886
  var _this_$container_addEventListener2, _this_$container2, _this_$container_addEventListener3, _this_$container3, _this_$container_addEventListener4, _this_$container4;
1883
1887
  (_this_$container2 = this.$container) == null ? void 0 : (_this_$container_addEventListener2 = _this_$container2.addEventListener) == null ? void 0 : _this_$container_addEventListener2.call(_this_$container2, 'mouseenter', this._onShow);
@@ -1902,6 +1906,23 @@
1902
1906
  pickerProvider.closeOther(e);
1903
1907
  };
1904
1908
  /**
1909
+ * $container click event
1910
+ * @param event - 鼠标点击事件
1911
+ * @returns
1912
+ */
1913
+ _proto._onContainerClick = function _onContainerClick(event) {
1914
+ var _this_$wrapperContent_contains, _this_$wrapperContent;
1915
+ if (this._disabled) return;
1916
+ // wrapper contain
1917
+ var contain = ((_this_$wrapperContent = this.$wrapperContent) == null ? void 0 : (_this_$wrapperContent_contains = _this_$wrapperContent.contains) == null ? void 0 : _this_$wrapperContent_contains.call(_this_$wrapperContent, event.target)) || this.$wrapperContent === event.target;
1918
+ // open 状态下触发关闭
1919
+ if (this._options.triggerClose && this._options.trigger === 'click' && !contain) {
1920
+ this.open = !this.open;
1921
+ } else {
1922
+ this.open = true;
1923
+ }
1924
+ };
1925
+ /**
1905
1926
  * 显示事件
1906
1927
  */
1907
1928
  _proto._onShow = function _onShow() {
@@ -2040,7 +2061,7 @@
2040
2061
  * Picker.VERSION; // 输出版本号
2041
2062
  * ```
2042
2063
  */
2043
- Picker.VERSION = '1.1.5';
2064
+ Picker.VERSION = '1.1.7';
2044
2065
 
2045
2066
  dist$a = Picker;
2046
2067
  return dist$a;
@@ -5672,11 +5693,11 @@
5672
5693
  // 对讲
5673
5694
  // =======================================================
5674
5695
  theme.on(EVENTS.talkingChange, function(talking) {
5675
- var _theme_controls_talkControl, _theme_controls;
5696
+ var _theme_controls, _theme_controls_talkControl, _theme_controls1;
5676
5697
  theme._talking = talking;
5677
- if (talking !== ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
5678
- var _theme_controls_talkControl1, _theme_controls1;
5679
- (_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
5698
+ if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.talkControl) && talking !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
5699
+ var _theme_controls_talkControl1, _theme_controls2;
5700
+ (_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
5680
5701
  }
5681
5702
  });
5682
5703
  theme.on(EVENTS.talkVolumeChange, function(value) {
@@ -5687,9 +5708,9 @@
5687
5708
  // 录制
5688
5709
  // =======================================================
5689
5710
  theme.on(EVENTS.recordingChange, function(recording) {
5690
- var _theme_controls_recordControl, _theme_controls;
5711
+ var _theme_controls, _theme_controls_recordControl, _theme_controls1;
5691
5712
  theme._recording = recording;
5692
- if (recording !== ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_recordControl = _theme_controls.recordControl) == null ? void 0 : _theme_controls_recordControl.active)) theme.controls.recordControl.active = recording;
5713
+ if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.recordControl) && recording !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_recordControl = _theme_controls1.recordControl) == null ? void 0 : _theme_controls_recordControl.active)) theme.controls.recordControl.active = recording;
5693
5714
  });
5694
5715
  // =======================================================
5695
5716
  // 清晰度
@@ -5706,14 +5727,14 @@
5706
5727
  // 放大
5707
5728
  // =======================================================
5708
5729
  theme.on(EVENTS.zoomingChange, function(zooming) {
5709
- var _theme_controls_zoomControl1, _theme_controls1;
5710
- if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
5730
+ var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
5731
+ if (((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1.zoomControl) && ((_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls2.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
5711
5732
  theme.controls.zoomControl.active = zooming;
5712
5733
  }
5713
5734
  });
5714
5735
  theme.on(EVENTS.zoomChange, function(zoom) {
5715
- var _theme_controls_zoomControl, _theme_controls;
5716
- if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
5736
+ var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
5737
+ if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.zoomControl) && ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
5717
5738
  theme.controls.zoomControl.value = zoom;
5718
5739
  }
5719
5740
  });
@@ -5739,31 +5760,40 @@
5739
5760
  // 全屏
5740
5761
  // =======================================================
5741
5762
  theme == null ? void 0 : theme.on(EVENTS.fullscreenChange, function(info) {
5742
- if ([
5743
- 0,
5744
- 180
5745
- ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
5746
- var // 代表移动端播放内容节点被旋转了 90度
5747
- _theme_zoomUtil_setTransform, _theme_zoomUtil;
5748
- (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
5749
- } else {
5750
- var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
5751
- (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
5763
+ if (theme.zoomUtil) {
5764
+ if ([
5765
+ 0,
5766
+ 180
5767
+ ].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
5768
+ var // 代表移动端播放内容节点被旋转了 90度
5769
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
5770
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
5771
+ } else {
5772
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
5773
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
5774
+ }
5752
5775
  }
5753
5776
  });
5754
5777
  theme == null ? void 0 : theme.on(EVENTS.orientationChange, function(angle) {
5755
- if ([
5756
- 0,
5757
- 180
5758
- ].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
5759
- var // 代表移动端播放内容节点被旋转了 90度
5760
- _theme_zoomUtil_setTransform, _theme_zoomUtil;
5761
- (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
5762
- } else {
5763
- var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
5764
- (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
5778
+ if (theme.zoomUtil) {
5779
+ if ([
5780
+ 0,
5781
+ 180
5782
+ ].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
5783
+ var // 代表移动端播放内容节点被旋转了 90度
5784
+ _theme_zoomUtil_setTransform, _theme_zoomUtil;
5785
+ (_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
5786
+ } else {
5787
+ var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
5788
+ (_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
5789
+ }
5765
5790
  }
5766
5791
  });
5792
+ // 日期选择器
5793
+ theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
5794
+ var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
5795
+ (_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_emit = _theme_controls_dateControl.emit) == null ? void 0 : _theme_controls_dateControl_emit.call(_theme_controls_dateControl, EVENTS.control.dateMonthChange, dates);
5796
+ });
5767
5797
  }
5768
5798
  /**
5769
5799
  * 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
@@ -5965,10 +5995,10 @@
5965
5995
  theme.emit(EVENTS.control.timeLineChange, date);
5966
5996
  });
5967
5997
  theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
5968
- var _theme_controls_dateControl;
5969
- if ((_theme_controls_dateControl = theme.controls.dateControl) == null ? void 0 : _theme_controls_dateControl.dataPickerUtil) {
5970
- var _theme_controls_dateControl_dataPickerUtil, _theme_controls_dateControl1;
5971
- (_theme_controls_dateControl1 = theme.controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_dataPickerUtil = _theme_controls_dateControl1.dataPickerUtil) == null ? void 0 : _theme_controls_dateControl_dataPickerUtil.hide();
5998
+ var _theme_controls_dateControl, _theme_controls;
5999
+ if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
6000
+ var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
6001
+ (_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (_theme_controls_dateControl_datePicker = _theme_controls_dateControl1.datePicker) == null ? void 0 : _theme_controls_dateControl_datePicker.hide();
5972
6002
  }
5973
6003
  theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
5974
6004
  });
@@ -10208,27 +10238,35 @@
10208
10238
  _assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
10209
10239
  }
10210
10240
  })) || this;
10241
+ _this._filterSpeedList(options.list, options.props.recType);
10211
10242
  _this.on(EVENTS.speedChange, function(speed) {
10212
10243
  if (_this.value !== speed + '') _this.value = speed + '';
10213
10244
  });
10214
10245
  _this.on(EVENTS.control.recTypeChange, function(type) {
10215
- if (!(options == null ? void 0 : options.list)) {
10216
- // 非用户自定义
10217
- if (type === 'rec') {
10218
- // 本地回放 不支持 8 16 32 倍速
10219
- var list = _this.list.filter(function(item) {
10220
- return (item == null ? void 0 : item.value) && +item.value < 8;
10221
- });
10222
- _this.updateOptions(list);
10223
- } else {
10224
- // 云端回放 支持 8 16 32 倍速
10225
- _this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
10226
- }
10227
- }
10246
+ _this._filterSpeedList(options.list, type);
10228
10247
  });
10229
10248
  return _this;
10230
10249
  }
10231
10250
  var _proto = Speed.prototype;
10251
+ /**
10252
+ * 滤掉本地回放不支持的倍速
10253
+ * @param optionsList 初始化配置倍速列表
10254
+ * @param type 回放类型
10255
+ */ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
10256
+ if (!optionsList) {
10257
+ // 非用户自定义
10258
+ if (type === 'rec') {
10259
+ // 本地回放 不支持 8 16 32 倍速
10260
+ var list = this.list.filter(function(item) {
10261
+ return (item == null ? void 0 : item.value) && +item.value < 8;
10262
+ });
10263
+ this.updateOptions(list);
10264
+ } else {
10265
+ // 云端回放 支持 8 16 32 倍速
10266
+ this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
10267
+ }
10268
+ }
10269
+ };
10232
10270
  _proto.reset = function reset(hide) {
10233
10271
  this.value = 1 + '';
10234
10272
  Select.prototype.reset.call(this, hide);
@@ -10236,540 +10274,24 @@
10236
10274
  return Speed;
10237
10275
  }(Select);
10238
10276
 
10277
+ var dist$3 = {};
10278
+
10239
10279
  /*
10240
- * @ezuikit/control-date-picker v0.0.1-alpha.2
10241
- * Copyright (c) 2025-11-12 Ezviz-OpenBiz
10280
+ * @ezuikit/control-date-picker v1.0.3
10281
+ * Copyright (c) 2025-12-08 Ezviz-OpenBiz
10242
10282
  * Released under the MIT License.
10243
10283
  */
10244
10284
 
10245
- var dist$3;
10246
10285
  var hasRequiredDist$3;
10247
10286
 
10248
10287
  function requireDist$3 () {
10249
10288
  if (hasRequiredDist$3) return dist$3;
10250
10289
  hasRequiredDist$3 = 1;
10251
-
10252
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10253
- try {
10254
- var info = gen[key](arg);
10255
- var value = info.value;
10256
- } catch (error) {
10257
- reject(error);
10258
- return;
10259
- }
10260
- if (info.done) {
10261
- resolve(value);
10262
- } else {
10263
- Promise.resolve(value).then(_next, _throw);
10264
- }
10265
- }
10266
- function _async_to_generator(fn) {
10267
- return function() {
10268
- var self = this, args = arguments;
10269
- return new Promise(function(resolve, reject) {
10270
- var gen = fn.apply(self, args);
10271
- function _next(value) {
10272
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10273
- }
10274
- function _throw(err) {
10275
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10276
- }
10277
- _next(undefined);
10278
- });
10279
- };
10280
- }
10281
- function _ts_generator(thisArg, body) {
10282
- var f, y, t, _ = {
10283
- label: 0,
10284
- sent: function() {
10285
- if (t[0] & 1) throw t[1];
10286
- return t[1];
10287
- },
10288
- trys: [],
10289
- ops: []
10290
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
10291
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
10292
- return this;
10293
- }), g;
10294
- function verb(n) {
10295
- return function(v) {
10296
- return step([
10297
- n,
10298
- v
10299
- ]);
10300
- };
10301
- }
10302
- function step(op) {
10303
- if (f) throw new TypeError("Generator is already executing.");
10304
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
10305
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
10306
- if (y = 0, t) op = [
10307
- op[0] & 2,
10308
- t.value
10309
- ];
10310
- switch(op[0]){
10311
- case 0:
10312
- case 1:
10313
- t = op;
10314
- break;
10315
- case 4:
10316
- _.label++;
10317
- return {
10318
- value: op[1],
10319
- done: false
10320
- };
10321
- case 5:
10322
- _.label++;
10323
- y = op[1];
10324
- op = [
10325
- 0
10326
- ];
10327
- continue;
10328
- case 7:
10329
- op = _.ops.pop();
10330
- _.trys.pop();
10331
- continue;
10332
- default:
10333
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
10334
- _ = 0;
10335
- continue;
10336
- }
10337
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
10338
- _.label = op[1];
10339
- break;
10340
- }
10341
- if (op[0] === 6 && _.label < t[1]) {
10342
- _.label = t[1];
10343
- t = op;
10344
- break;
10345
- }
10346
- if (t && _.label < t[2]) {
10347
- _.label = t[2];
10348
- _.ops.push(op);
10349
- break;
10350
- }
10351
- if (t[2]) _.ops.pop();
10352
- _.trys.pop();
10353
- continue;
10354
- }
10355
- op = body.call(thisArg, _);
10356
- } catch (e) {
10357
- op = [
10358
- 6,
10359
- e
10360
- ];
10361
- y = 0;
10362
- } finally{
10363
- f = t = 0;
10364
- }
10365
- if (op[0] & 5) throw op[1];
10366
- return {
10367
- value: op[0] ? op[1] : void 0,
10368
- done: true
10369
- };
10370
- }
10371
- }
10372
- var AppendJS = /*#__PURE__*/ function() {
10373
- function AppendJS() {}
10374
- AppendJS.loadScript = function loadScript(src) {
10375
- return _async_to_generator(function() {
10376
- return _ts_generator(this, function(_state) {
10377
- switch(_state.label){
10378
- case 0:
10379
- return [
10380
- 4,
10381
- new Promise(function(resolve, reject) {
10382
- if (AppendJS.LoadedScr.includes(src)) {
10383
- return resolve(src);
10384
- }
10385
- if (AppendJS.LoadingScrQueue[src]) {
10386
- return AppendJS.LoadingScrQueue[src].push(resolve);
10387
- } else {
10388
- AppendJS.LoadingScrQueue[src] = [
10389
- resolve
10390
- ];
10391
- }
10392
- var link;
10393
- if (src.includes('.js')) {
10394
- link = document.createElement('script');
10395
- link.src = src;
10396
- link.async = true;
10397
- } else if (src.includes('.css')) {
10398
- link = document.createElement('link');
10399
- link.rel = 'stylesheet';
10400
- link.href = src;
10401
- }
10402
- link.onload = function() {
10403
- AppendJS.LoadedScr.push(src);
10404
- AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
10405
- return resolve(src);
10406
- });
10407
- AppendJS.LoadingScrQueue[src] = [];
10408
- };
10409
- link.onerror = function() {
10410
- return reject(new Error('Failed to load ' + src));
10411
- };
10412
- document.head.appendChild(link);
10413
- })
10414
- ];
10415
- case 1:
10416
- return [
10417
- 2,
10418
- _state.sent()
10419
- ];
10420
- }
10421
- });
10422
- })();
10423
- };
10424
- AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
10425
- return _async_to_generator(function() {
10426
- return _ts_generator(this, function(_state) {
10427
- switch(_state.label){
10428
- case 0:
10429
- return [
10430
- 4,
10431
- Promise.all(srcArr.map(AppendJS.loadScript))
10432
- ];
10433
- case 1:
10434
- return [
10435
- 2,
10436
- _state.sent()
10437
- ];
10438
- }
10439
- });
10440
- })();
10441
- };
10442
- AppendJS.remove = function remove(src) {
10443
- src.forEach(function(item) {
10444
- var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
10445
- if (link) {
10446
- link.remove();
10447
- }
10448
- });
10449
- };
10450
- AppendJS.clear = function clear() {
10451
- AppendJS.remove(AppendJS.LoadedScr);
10452
- };
10453
- return AppendJS;
10454
- }();
10455
- /** 已经加载完的js/css */ AppendJS.LoadedScr = [];
10456
- /** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
10457
-
10458
- function _defineProperties(target, props) {
10459
- for(var i = 0; i < props.length; i++){
10460
- var descriptor = props[i];
10461
- descriptor.enumerable = descriptor.enumerable || false;
10462
- descriptor.configurable = true;
10463
- if ("value" in descriptor) descriptor.writable = true;
10464
- Object.defineProperty(target, descriptor.key, descriptor);
10465
- }
10466
- }
10467
- function _create_class(Constructor, protoProps, staticProps) {
10468
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10469
- return Constructor;
10470
- }
10471
- var DEFAULT_OPTIONS = {
10472
- staticPath: '.',
10473
- place: 'top-right',
10474
- language: 'zh-CN',
10475
- current: new Date(),
10476
- maxDate: new Date()
10477
- };
10478
- /**
10479
- * 日期选择器
10480
- */ var DatePicker = /*#__PURE__*/ function() {
10481
- function DatePicker(container, options) {
10482
- var _this = this;
10483
- this._open = false;
10484
- this._change = true;
10485
- this.$container = container;
10486
- this.options = Object.assign({}, DEFAULT_OPTIONS, options);
10487
- this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
10488
- if (this.options.current) {
10489
- this._date = this.options.current;
10490
- }
10491
- this._init();
10492
- this.$container.addEventListener('click', function() {
10493
- if (_this._open) _this.hide();
10494
- else _this.show();
10495
- });
10496
- document.body.addEventListener('click', function(e) {
10497
- if (!_this.$container.contains(e.target)) {
10498
- _this.hide();
10499
- }
10500
- });
10501
- }
10502
- var _proto = DatePicker.prototype;
10503
- _proto._init = function _init() {
10504
- var _this = this;
10505
- // 因为挂载在行内,需要父标签设置 position: relative;
10506
- this.$container.style.cssText += ";position: relative;";
10507
- this.$container.classList.add("datepicker-inline-" + this.options.place);
10508
- AppendJS.loadScriptsBatch([
10509
- "" + this.options.staticPath + "/rec/jquery.min.js",
10510
- "" + this.options.staticPath + "/rec/datepicker.min.css"
10511
- ]).then(function() {
10512
- AppendJS.loadScriptsBatch([
10513
- "" + _this.options.staticPath + "/rec/datepicker.js"
10514
- ]).then(function() {
10515
- AppendJS.loadScriptsBatch([
10516
- "" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
10517
- "" + _this.options.staticPath + "/rec/datepicker.en-US.js"
10518
- ]).then(function() {
10519
- window.$(_this.$container).datepicker({
10520
- date: _this.options.current,
10521
- language: _this.options.language,
10522
- endDate: _this.options.maxDate,
10523
- inline: true
10524
- });
10525
- _this.hide();
10526
- window.$(_this.$container).on('pick.datepicker', function(e) {
10527
- var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
10528
- if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
10529
- _this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
10530
- } else if (e.view === 'month' && (((_this__date1 = _this._date) == null ? void 0 : _this__date1.getMonth()) !== e.date.getMonth() || ((_this__date2 = _this._date) == null ? void 0 : _this__date2.getFullYear()) !== e.date.getFullYear())) {
10531
- _this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
10532
- } else if ([
10533
- 'day',
10534
- 'pick'
10535
- ].includes(e.view || e.type) && (((_this__date3 = _this._date) == null ? void 0 : _this__date3.getDate()) !== e.date.getDate() || ((_this__date4 = _this._date) == null ? void 0 : _this__date4.getMonth()) !== e.date.getMonth() || ((_this__date5 = _this._date) == null ? void 0 : _this__date5.getFullYear()) !== e.date.getFullYear())) {
10536
- if (_this._change) {
10537
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
10538
- }
10539
- _this._date = new Date(e.date.getTime());
10540
- }
10541
- if (e.view === 'day') _this.hide();
10542
- _this._change = true;
10543
- });
10544
- });
10545
- });
10546
- });
10547
- };
10548
- /**
10549
- * 设置日期, change = true 时触发 onChange 事件
10550
- *
10551
- * @param date 设置的日期
10552
- * @param change 是否触发 onChange 事件
10553
- */ _proto.setDate = function setDate(date, change) {
10554
- if (change === void 0) change = true;
10555
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10556
- if ($datepicker) {
10557
- this._change = change;
10558
- window.$(this.$container).datepicker('setDate', date);
10559
- }
10560
- };
10561
- /**
10562
- * 隐藏面板, 会触发 onPanelChange 事件
10563
- */ _proto.hide = function hide() {
10564
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10565
- if ($datepicker) {
10566
- if (this._open) {
10567
- this._open = false;
10568
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
10569
- }
10570
- $datepicker.classList.add('datepicker-hide');
10571
- }
10572
- };
10573
- /**
10574
- * 显示面板, 会触发 onPanelChange 事件
10575
- */ _proto.show = function show() {
10576
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10577
- if ($datepicker) {
10578
- var _window_$_datepicker, _window_$;
10579
- if (!this._open) {
10580
- this._open = true;
10581
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
10582
- }
10583
- if (this._date) this.setDate(this._date, false);
10584
- (_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
10585
- if (this.options.place === 'bottom-left') {
10586
- $datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
10587
- } else {
10588
- $datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
10589
- }
10590
- $datepicker.classList.remove('datepicker-hide');
10591
- }
10592
- };
10593
- /**
10594
- * 销毁
10595
- */ _proto.destroy = function destroy() {
10596
- this.hide();
10597
- this._date = undefined;
10598
- window.$(this.$container).datepicker('destroy');
10599
- // AppendJS.remove([
10600
- // `${this.options.staticPath}/rec/jquery.min.js`,
10601
- // `${this.options.staticPath}/rec/datepicker.min.css`,
10602
- // `${this.options.staticPath}/rec/datepicker.js`,
10603
- // `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
10604
- // `${this.options.staticPath}/rec/datepicker.en-US.js`,
10605
- // ]);
10606
- };
10607
- _create_class(DatePicker, [
10608
- {
10609
- key: "date",
10610
- get: /**
10611
- * 获取日期
10612
- */ function get() {
10613
- return this._date;
10614
- }
10615
- }
10616
- ]);
10617
- return DatePicker;
10618
- }();
10619
-
10620
- dist$3 = DatePicker;
10290
+ var delegate=requireDelegate(),utilsTools=requireDist$9(),deepmerge=requireCjs(),Picker=requireDist$a(),Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){ void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day));}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return '<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:false}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners();}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""));},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html;}},_proto.destroy=function(){this.$header&&this.$header.remove();},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options);}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options);}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options);}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options);}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault());}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault());}));},Header}();function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$2.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:true},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:false}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container);}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh;}else this.locale=this.options.locales.zh;},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null;},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale;},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return (_this=Container.call(this,container,_extends$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,false),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,false),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$3(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?utilsTools.DateTime.toDate(date):date,(!this._current||utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,utilsTools.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=utilsTools.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected");}this._setRenderCurrent(this._current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto.updateBadges=function(badges){this._updateBadges(badges);},_proto._updateBadges=function(badges,rerender){ void 0===rerender&&(rerender=true),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return utilsTools.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&utilsTools.DateTime.format(this._renderCurrent,"YYYY-MM")!==utilsTools.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,utilsTools.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault();});},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return "<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body);},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=utilsTools.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return "<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(utilsTools.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return '<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("");}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=utilsTools.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$2(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=utilsTools.DateTime.toDate(d));var current=d;this._current&&utilsTools.DateTime.format(current,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,utilsTools.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&utilsTools.DateTime.format(date,"YYYY")!==utilsTools.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=utilsTools.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected");}this._setHeader();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent);},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>";}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=utilsTools.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+utilsTools.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,utilsTools.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled");}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return "<tr>\n "+month.map(function(m,i){return '<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(utilsTools.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled();},_create_class$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){ void 0===change&&(change=true);var left,right,_year="number"==typeof year?utilsTools.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&utilsTools.DateTime.format(_year,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault();});},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return "<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return +y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(utilsTools.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(utilsTools.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:false}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:false}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges));},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this);},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=true),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change);},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top");},_proto.hide=function(){this.open=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,false)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode);},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===utilsTools.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk);}})));},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM")===utilsTools.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk);},onYear:this._onYear.bind(this)})));},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY")===utilsTools.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk);}})));},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide();},_proto._onClose=function(){this.hide();},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,true);},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode();},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode());},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode();},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode();},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode);},_create_class(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);dist$3.Calendar=Calendar,dist$3.DatePicker=DatePicker,dist$3.Header=Header,dist$3.Month=Month,dist$3.Year=Year;
10621
10291
  return dist$3;
10622
10292
  }
10623
10293
 
10624
10294
  var distExports$1 = requireDist$3();
10625
- var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
10626
-
10627
- /**
10628
- * @description 时间操作
10629
- */ var DateTime = /*#__PURE__*/ function() {
10630
- function DateTime() {}
10631
- /**
10632
- * @description 时间格式化
10633
- * @param {Date | number | string} date
10634
- * @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
10635
- * @param {number} timeZone 时区偏移量 默认 0
10636
- */ DateTime.formate = function formate(date, formatType, timeZone) {
10637
- if (timeZone === void 0) timeZone = 0;
10638
- var dateTime = date;
10639
- if (typeof date === 'string') {
10640
- dateTime = DateTime.strToDate(date);
10641
- } else if (typeof date === 'number') {
10642
- dateTime = new Date(date);
10643
- }
10644
- dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
10645
- var year = dateTime.getFullYear();
10646
- var month = String(dateTime.getMonth() + 1).padStart(2, '0');
10647
- var day = String(dateTime.getDate()).padStart(2, '0');
10648
- var hours = String(dateTime.getHours()).padStart(2, '0');
10649
- var minutes = String(dateTime.getMinutes()).padStart(2, '0');
10650
- var seconds = String(dateTime.getSeconds()).padStart(2, '0');
10651
- switch(formatType){
10652
- case 'YYYY-MM-DD hh:mm:ss':
10653
- return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
10654
- case 'YYYYMMDDhhmmss':
10655
- return "" + year + month + day + hours + minutes + seconds;
10656
- case 'YYYY/MM/DD hh:mm:ss':
10657
- return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
10658
- case 'YYYYMMDDThhmmssZ':
10659
- return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
10660
- case 'YYYY/MM/DD':
10661
- return year + "/" + month + "/" + day;
10662
- case 'YYYYMMDD':
10663
- return "" + year + month + day;
10664
- case 'YYYY-MM-DD':
10665
- return year + "-" + month + "-" + day;
10666
- case 'YYYY':
10667
- return "" + year;
10668
- case 'MM':
10669
- return "" + month;
10670
- case 'DD':
10671
- return "" + day;
10672
- case 'hh:mm:ss':
10673
- return hours + ":" + minutes + ":" + seconds;
10674
- case 'hh':
10675
- return "" + hours;
10676
- case 'mm':
10677
- return "" + minutes;
10678
- case 'ss':
10679
- return "" + seconds;
10680
- default:
10681
- throw new Error('Unsupported format type');
10682
- }
10683
- };
10684
- /**
10685
- * @description 对比两个时间的差值
10686
- * @param {Date | string | number} date1
10687
- * @param {Date | string | number} date2
10688
- * @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
10689
- */ DateTime.diff = function diff(date1, date2, diffType) {
10690
- /** @type {Date} */ var dateTime1 = date1;
10691
- if (typeof date1 === 'string') {
10692
- dateTime1 = DateTime.strToDate(date1);
10693
- } else if (typeof date1 === 'number') {
10694
- dateTime1 = new Date(date1);
10695
- }
10696
- /** @type {Date} */ var dateTime2 = date2;
10697
- if (typeof date2 === 'string') {
10698
- dateTime1 = DateTime.strToDate(date2);
10699
- } else if (typeof date2 === 'number') {
10700
- dateTime1 = new Date(date2);
10701
- }
10702
- var diffSecond = dateTime1.getTime() - dateTime2.getTime();
10703
- // diff
10704
- switch(diffType){
10705
- case 'year':
10706
- return dateTime1.getFullYear() - dateTime2.getFullYear();
10707
- case 'month':
10708
- // 计算总月份差
10709
- // eslint-disable-next-line no-case-declarations
10710
- var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
10711
- // 如果结束日的日期小于开始日的日期,则减去一个月
10712
- if (dateTime1.getDate() < dateTime2.getDate()) {
10713
- months--;
10714
- }
10715
- return months;
10716
- case 'day':
10717
- return diffSecond / 60 / 60 / 24;
10718
- case 'hour':
10719
- return diffSecond / 60 / 60;
10720
- case 'minute':
10721
- return diffSecond / 60;
10722
- case 'second':
10723
- return diffSecond;
10724
- default:
10725
- throw new Error('Unsupported diff type');
10726
- }
10727
- };
10728
- DateTime.now = function now() {
10729
- return Date.now();
10730
- };
10731
- /**
10732
- *
10733
- * @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
10734
- * @example
10735
- * DateTime.strToDate("2025/04/10 10:10:10") // Date
10736
- * DateTime.strToDate("2025-04-10 10:10:10") // Date
10737
- * DateTime.strToDate("20250410101010") // Date
10738
- * DateTime.strToDate("20250410T101010Z") // Date
10739
- */ DateTime.strToDate = function strToDate(str) {
10740
- var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
10741
- // 兼容
10742
- if ((str + '').length === 10) {
10743
- // 时间戳 秒
10744
- return new Date(+str);
10745
- } else if ((str + '').length === 13) {
10746
- // 时间戳 毫秒
10747
- return new Date(+str);
10748
- }
10749
- var year = time.slice(0, 4);
10750
- var month = time.slice(4, 6);
10751
- var day = time.slice(6, 8);
10752
- var hour = time.slice(8, 10);
10753
- var minute = time.slice(10, 12);
10754
- var second = time.slice(12, 14);
10755
- return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
10756
- };
10757
- /**
10758
- * @description 补充十位
10759
- * @param {number} num
10760
- * @returns {string}
10761
- * @example
10762
- * DateTime.padStart(1) // "01"
10763
- * DateTime.padStart(33) // "33"
10764
- */ DateTime.padStart = function padStart(num) {
10765
- if (num < 10) {
10766
- return '0' + num;
10767
- } else {
10768
- return num + '';
10769
- }
10770
- };
10771
- return DateTime;
10772
- }();
10773
10295
 
10774
10296
  function _extends$5() {
10775
10297
  _extends$5 = Object.assign || function(target) {
@@ -10813,20 +10335,29 @@
10813
10335
  function DatePickerControl(options) {
10814
10336
  var _this;
10815
10337
  var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
10816
- _this = Control.call(this, _extends$5({}, options, {
10338
+ _this = Control.call(this, _extends$5({
10339
+ maxDate: new Date()
10340
+ }, options, {
10817
10341
  tagName: 'span',
10818
10342
  controlType: 'button',
10819
10343
  classNameSuffix: 'date'
10820
10344
  })) || this;
10821
10345
  _this.options = options;
10822
- _this._value = DateTime.formate(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
10346
+ _this._value = distExports$6.DateTime.format(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
10823
10347
  _this._render();
10348
+ // 日期上的点
10349
+ _this.on(EVENTS.control.dateMonthChange, function(dates) {
10350
+ var _this_datePicker_updateBadges, _this_datePicker;
10351
+ (_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
10352
+ });
10824
10353
  return _this;
10825
10354
  }
10826
10355
  var _proto = DatePickerControl.prototype;
10827
10356
  _proto._render = function _render() {
10828
10357
  var _this = this;
10829
- if (distExports$6.isMobile()) {
10358
+ var _this_options_props;
10359
+ var isMobile1 = distExports$6.isMobile();
10360
+ if (isMobile1) {
10830
10361
  var _this_locale;
10831
10362
  this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
10832
10363
  } else {
@@ -10835,25 +10366,45 @@
10835
10366
  title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
10836
10367
  });
10837
10368
  }
10838
- this.dataPickerUtil = new DatePickerUtil(this.$container, {
10839
- staticPath: this.options.staticPath,
10840
- language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
10369
+ this.datePicker = new distExports$1.DatePicker(this.$container, {
10370
+ isMobile: isMobile1,
10371
+ getPopupContainer: function() {
10372
+ return _this.$container;
10373
+ },
10374
+ mode: 'date',
10375
+ offset: [
10376
+ 0,
10377
+ -10
10378
+ ],
10379
+ badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
10380
+ language: this.options.language === 'zh' ? 'zh' : 'en',
10841
10381
  current: new Date(this._value + ' 00:00:00'),
10842
- maxDate: this.options.maxDate || new Date(),
10843
- place: distExports$6.isMobile() ? 'bottom-left' : 'top-right',
10844
- onChange: function(date) {
10845
- if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
10846
- _this._value = DateTime.formate(date, 'YYYY-MM-DD');
10847
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
10382
+ placement: 'tr',
10383
+ triggerClose: true,
10384
+ disabledDate: function(date) {
10385
+ return date.getTime() > (_this.options.maxDate || new Date()).getTime();
10386
+ },
10387
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10388
+ onOk: function(date, _mode) {
10389
+ if (date && _this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
10390
+ _this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
10391
+ _this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
10848
10392
  _this.emit(EVENTS.control.dateChange, date);
10849
10393
  if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
10850
10394
  _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
10851
10395
  }
10852
10396
  }
10853
10397
  },
10854
- onPanelChange: function(open, date) {
10855
- _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, date);
10856
- _this.emit(EVENTS.control.datePanelOpenChange, open, date);
10398
+ onChange: function(date, mode) {
10399
+ if (date && _this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
10400
+ _this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
10401
+ _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
10402
+ _this.emit(EVENTS.control.dateChange, date);
10403
+ }
10404
+ },
10405
+ onOpenChange: function(open) {
10406
+ _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
10407
+ _this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
10857
10408
  }
10858
10409
  });
10859
10410
  };
@@ -10863,28 +10414,27 @@
10863
10414
  * @param change 是否触发 onChange 事件
10864
10415
  */ _proto.setDate = function setDate(date, change) {
10865
10416
  if (change === void 0) change = true;
10866
- var _this_dataPickerUtil;
10867
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.setDate(date, change);
10868
- if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
10869
- this._value = DateTime.formate(date, 'YYYY-MM-DD');
10417
+ var _this_datePicker;
10418
+ (_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
10419
+ if (date && !change && this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD')) {
10420
+ this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
10870
10421
  if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
10871
10422
  this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
10872
10423
  }
10873
10424
  }
10874
10425
  };
10875
10426
  _proto.reset = function reset() {
10876
- var _this_dataPickerUtil;
10877
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
10427
+ if (this.datePicker) this.datePicker.open = false;
10878
10428
  Control.prototype.reset.call(this);
10879
10429
  };
10880
10430
  /**
10881
10431
  * 销毁控件
10882
10432
  * @override
10883
10433
  */ _proto.destroy = function destroy() {
10884
- if (this.dataPickerUtil) {
10885
- this.dataPickerUtil.destroy();
10434
+ if (this.datePicker) {
10435
+ this.datePicker.destroy();
10886
10436
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10887
- this.dataPickerUtil = null;
10437
+ this.datePicker = null;
10888
10438
  }
10889
10439
  Control.prototype.destroy.call(this);
10890
10440
  };
@@ -10894,6 +10444,7 @@
10894
10444
  };
10895
10445
  /**
10896
10446
  * 点击 Control 会触发
10447
+ * @overload super._onControlClick(e: Event)
10897
10448
  */ _proto._onControlClick = function _onControlClick(e) {
10898
10449
  Control.prototype._onControlClick.call(this, e);
10899
10450
  };
@@ -10905,8 +10456,8 @@
10905
10456
  /**
10906
10457
  * drag scroll support move and touch
10907
10458
  *
10908
- * @skax/drag-scroll v1.1.1
10909
- * Copyright (c) 2025-11-16 ShineShao <xiaoshaoqq@gmail.com>
10459
+ * @skax/drag-scroll v1.1.2
10460
+ * Copyright (c) 2025-11-22 ShineShao <xiaoshaoqq@gmail.com>
10910
10461
  *
10911
10462
  * This source code is licensed under the MIT license found in the
10912
10463
  * LICENSE file in the root directory of this source tree.
@@ -11104,8 +10655,8 @@
11104
10655
  this._addEventListeners();
11105
10656
  // 初始化滚动条
11106
10657
  this._updateScrollbar();
11107
- // 初始化动画
11108
- this._animationId = requestAnimationFrame(this._animate.bind(this));
10658
+ // 弹性动画
10659
+ // this._animationId = requestAnimationFrame(this._animate.bind(this));
11109
10660
  };
11110
10661
  // ----------- 事件处理 ----------- //
11111
10662
  /**
@@ -11485,8 +11036,8 @@
11485
11036
  }
11486
11037
 
11487
11038
  /*
11488
- * @ezuikit/control-time-line v1.0.2
11489
- * Copyright (c) 2025-11-16 Ezviz-OpenBiz
11039
+ * @ezuikit/control-time-line v1.0.4
11040
+ * Copyright (c) 2025-12-08 Ezviz-OpenBiz
11490
11041
  * Released under the MIT License.
11491
11042
  */
11492
11043
 
@@ -11495,7 +11046,7 @@
11495
11046
  function requireDist () {
11496
11047
  if (hasRequiredDist) return dist$2;
11497
11048
  hasRequiredDist = 1;
11498
- var deepmerge=requireCjs(),I18n=requireDist$8(),Picker=requireDist$a(),DragScroll=requireDist$2(),delegate=requireDist$1(),_$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(left=this.options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new I18n(deepmerge(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _proto=BaseTimeLine.prototype;return _proto.setReadOnly=function(readOnly){this.readOnly=readOnly;},_proto.update=function(current){this._current=current;},_proto.updateTimeSections=function(timeSections){timeSections&&Array.isArray(timeSections)&&(this._timeSections=timeSections);},_proto.resize=function(width,height){this._resize(width,height);},_proto._resize=function(width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),this.$container&&(this.$container.style.cssText+=cssText),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight);},_proto.setTimeWidth=function(timeWidth){[0,1,2,3,4,5].includes(timeWidth)&&(this._timeWidth=timeWidth);},_proto.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{key:"current",get:function(){return this._current},set:function(current){this._current=current;}},{key:"readOnly",get:function(){return this._readOnly},set:function(readOnly){this._readOnly!==readOnly&&(this._readOnly=readOnly,this.$container.style.cursor=readOnly?"not-allowed":"pointer");}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return TimeLineUtil.toDate=function(time){var left,right,date=null;return "string"==typeof time&&time.includes(":")?date=new Date(time):"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||13!==(time+"").length?(left=time,date=(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?time:new Date):date=new Date(+time):date=new Date(1e3*+time),date},TimeLineUtil.formatDateToHHmmss=function(time){var date=TimeLineUtil.toDate(time);if(date){var h=date.getHours(),m=date.getMinutes(),s=date.getSeconds();return (h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}return "00:00:00"},TimeLineUtil.subTime=function(m){return +m>9?m+"":"0"+m},TimeLineUtil.tranTime=function(time,fmt){ void 0===fmt&&(fmt="YYYY-MM-DD HH:mm:ss");var newDate=TimeLineUtil.toDate(time);return newDate?"YYYY-MM-DD"===fmt?newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate()):"HH:mm:ss"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH"===fmt?TimeLineUtil.subTime(newDate.getHours()):"mm:ss"===fmt?TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH:mm"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes()):"YYYYMMDDTHHmmssZ"===fmt?newDate.getFullYear()+""+TimeLineUtil.subTime(newDate.getMonth()+1)+TimeLineUtil.subTime(newDate.getDate())+"T"+TimeLineUtil.subTime(newDate.getHours())+TimeLineUtil.subTime(newDate.getMinutes())+TimeLineUtil.subTime(newDate.getSeconds())+"Z":newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate())+" "+TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):""},TimeLineUtil.timeToSecond=function(time){var e=time.split(":");return 60*Number(e[0])*60+60*Number(e[1])+(Number(e[2])||0)},TimeLineUtil.minuteToTime=function(minute){var hour=Math.floor(minute/60),m=minute%60;return (hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},TimeLineUtil.timeToMinute=function(time){var e=time.split(":");return 60*Number(e[0])+Number(e[1])},TimeLineUtil.isOverlap=function(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)},TimeLineUtil.tranTimeToString=function(start,end){var _TimeLineUtil_toDate,_TimeLineUtil_toDate1,secondNum=Math.floor((null==(_TimeLineUtil_toDate=TimeLineUtil.toDate(end))?void 0:_TimeLineUtil_toDate.getTime())-(null==(_TimeLineUtil_toDate1=TimeLineUtil.toDate(start))?void 0:_TimeLineUtil_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?TimeLineUtil.subTime(minute)+"'":"0'")+TimeLineUtil.subTime(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__tip='<svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__close='\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n ',_$TIMELINE_ICONS$__pause='<svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n ',_$TIMELINE_ICONS$__picture='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',TIME_WIDTH=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],MOBILE_TIME_WIDTH=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]];function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._plusClick=_this._plusClick.bind(_this),_this._minusClick=_this._minusClick.bind(_this),_this._onPickerClose=_this._onPickerClose.bind(_this),_this._onClickItem=_this._onClickItem.bind(_this),_this._onClickCoverFold=_this._onClickCoverFold.bind(_this),_this._onImageError=_this._onImageError.bind(_this),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1({},record,{startTime:TimeLineUtil.formatDateToHHmmss(record.startTime),endTime:TimeLineUtil.formatDateToHHmmss(record.endTime)})});if(list.length>0){ void 0===defaultIndex&&(defaultIndex=list.length-1);var current=this.state.current;this._setState({availTimeLine:list,start:list[defaultIndex].startTime,end:list[defaultIndex].endTime,current:null===current?list[defaultIndex].startTime:current}),this._matchTimeDot();}else this._setState({availTimeLine:[],current:TimeLineUtil.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:TimeLineUtil.tranTime(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll,_this__picker_$body_querySelectorAll,_this__picker_$body;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null;}catch(error){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null;}catch(error){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null;}catch(error){}this._picker&&(this._imageRemoveErrorEvent((null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelectorAll=_this__picker_$body.querySelectorAll)?void 0:_this__picker_$body_querySelectorAll.call(_this__picker_$body,"img"))||[]),this._picker.destroy(),this._picker=null);this._removeEventListener(),null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.destroy(),this._dragScroll=null,BaseTimeLine.prototype.destroy.call(this);},_proto._setState=function(obj){var _this=this;Object.keys(obj).forEach(function(key){var _this__dragScroll,_this_timeSections_;"current"===key&&obj[key]?(_this._setCurrentDOM(obj[key]),_this.state.current===obj[key]||(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.isDragging)||(_this.state[key]=obj[key],_this.current=new Date(TimeLineUtil.tranTime((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+obj[key]),null==_this.options.onChange||_this.options.onChange.call(_this.options,_this.current))):_this.state[key]=obj[key];});},_proto._setCurrentDOM=function(time){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=time);},_proto._matchTimeDot=function(){for(var scaleWidth=this._scaleWidth,timeArr=[],minute=TimeLineUtil.timeToMinute("24:00:00"),i=minute=Math.floor(minute/scaleWidth)*scaleWidth;i>=0;){var marginTop=0,marginBottom=0;i==minute&&(marginTop=70),0==i&&(marginBottom=this.$container.clientHeight-70);var time=TimeLineUtil.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:[],coverArr:this._filterTimeSectionsByTime(time)}),i-=scaleWidth;}this._setState({timeArr:timeArr}),this._matchRecTimeDot();},_proto._matchRecTimeDot=function(){var _this_state=this.state,availTimeLine=_this_state.availTimeLine,timeArr=_this_state.timeArr,scaleWidth=this._scaleWidth,len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else {for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(var i=0;i<len;i++){var stAvailPercent,etAvailPercent,temp=availTimeLine[i],st=TimeLineUtil.timeToSecond(temp.startTime),et=TimeLineUtil.timeToSecond(temp.endTime),stMinute=Math.floor(st/(60*scaleWidth))*scaleWidth;stAvailPercent=(st-60*stMinute)/scaleWidth;var etMinute=Math.floor(et/(60*scaleWidth))*scaleWidth;etAvailPercent=(et-60*etMinute)/scaleWidth;for(var j1=0;j1<timeArr.length;j1++)if(timeArr[j1].id==stMinute&&timeArr[j1].id==etMinute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j1].recArr.push({height:height,top:top});}else timeArr[j1].id==stMinute?timeArr[j1].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j1].id==etMinute?timeArr[j1].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j1].id>stMinute&&timeArr[j1].id<etMinute&&timeArr[j1].recArr.push({height:60,top:0});}}this._setState({timeArr:timeArr}),this._renderDateLine();},_proto._renderDateLine=function(){var _this=this,timeArr=this.state.timeArr,container=this._$itemList;this._imageRemoveErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]),container.innerHTML="",timeArr.forEach(function(item,index){var timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","ez-time-line-time-scale-area"),item.marginTop&&(timeItemDOM.style.cssText+="margin-top: "+item.marginTop+"px;"),item.marginBottom&&(timeItemDOM.style.cssText+="margin-bottom: "+item.marginBottom+"px;"),timeItemDOM.style.cssText+="border-right-color: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&(timeItemHtml+='\n <div class="ez-time-line-time-cover-fold '+(item.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+item.current+'">\n '+(item.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img src="'+_this._setImageScr(item.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(item.coverArr.length>1?_this.i18n.t("foldTitle",{len:item.coverArr.length,unit:"videos"}):""+TimeLineUtil.tranTime(item.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===item.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+TimeLineUtil.tranTimeToString(item.coverArr[0].startTime,item.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause">'+_$TIMELINE_ICONS$__pause+"</span>\n </div>\n </div>"),item.recArr.forEach(function(i){timeItemHtml+='<div class="ez-time-line-time-unavail"\n style="height: '+i.height+"px;background-color:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),_this._imageErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]);}),this._currentOffsetH();},_proto._currentOffsetH=function(){var current=this.state.current;if(current){var _this__dragScroll,y=(86400-TimeLineUtil.timeToSecond(current)||0)/this._scaleWidth;null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y+60,false);}},_proto._render=function(){var _this=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar:true,onChange:function(state){var result=_this._offsetYToTime(state.y);result[1]!==_this.state.current&&_this._setCurrentDOM(result[0]>=86400?"23:59:59":result[1]);},onDragStart:function(e){_this._moveStartX=e.clientX,_this._moveStartY=e.clientY,null==_this.options.onDragStart||_this.options.onDragStart.call(_this.options,_this.state.current);},onDragging:function(){null==_this.options.onDragging||_this.options.onDragging.call(_this.options,_this.state.current);},onDragEnd:function(){var _this__dragScroll,result=_this._offsetYToTime(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.currentY);result[1]!==_this.state.current&&_this._setState({current:result[0]>=86400?"23:59:59":result[1]}),null==_this.options.onDragEnd||_this.options.onDragEnd.call(_this.options,_this.state.current);}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else {var height=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+height+"px";}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this._picker=new Picker(null,{isMobile:true,wrapClassName:"ez-time-line-picker",onOpenChange:function(isOpen){var _this_options_onPickerOpenChange,_this_options;null==(_this_options=_this.options)||null==(_this_options_onPickerOpenChange=_this_options.onPickerOpenChange)||_this_options_onPickerOpenChange.call(_this_options,isOpen);}}),this._addEventListener();},_proto._addEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.addEventListener("click",this._plusClick,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_proto._removeEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1,_this__picker_$body_querySelector,_this__picker_$body;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.removeEventListener("click",this._plusClick),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.removeEventListener("click",this._minusClick));this._picker&&(null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelector=_this__picker_$body.querySelector(".ez-time-line-picker-close"))||_this__picker_$body_querySelector.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach(function(delegation){delegation.destroy();}),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach(function(delegation){delegation.destroy();}),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach(function(delegation){delegation.destroy();}),this._delegateCoverFold=null));},_proto._plusClick=function(){var timeWidth=this.timeWidth+1;timeWidth>0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(timeWidth);},_proto._minusClick=function(){var timeWidth=this.timeWidth-1;timeWidth>=0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(Math.floor(timeWidth));},_proto._timeSectionsToGroupsByHour=function(list){var obj={};return list.forEach(function(item,index){var hour=TimeLineUtil.tranTime(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(TimeLineUtil.tranTime(item.startTime,"HH:mm:ss"));return _$start>=startSecond&&_$start<endSecond})},_proto._renderPickerContent=function(start){var _this__picker_innerHTML,_this__picker,_this__picker1,_this__picker2,_this=this,list=this._filterTimeSectionsByTime(start),hourGroups=this._timeSectionsToGroupsByHour(list);(null==(_this__picker=this._picker)||null==(_this__picker_innerHTML=_this__picker.innerHTML)||_this__picker_innerHTML.call(_this__picker,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">'+_$TIMELINE_ICONS$__close+"</span>\n "+this.i18n.t("title",{len:list.length,unit:list.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(hourGroups).reverse().map(function(key){return '<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+key+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+hourGroups[key].reverse().map(function(item){return '<div class="ez-time-line-picker-item-content"\n data-start="'+TimeLineUtil.tranTime(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+TimeLineUtil.tranTime(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+TimeLineUtil.tranTime(item.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+TimeLineUtil.tranTimeToString(item.startTime,item.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" src="'+_this._setImageScr(item.coverPic)+'"/>\n </div>'}).join("")+"\n </div>\n </div>"}).join("")+"\n </div>\n </div>\n </div>\n </div>"),null==(_this__picker1=this._picker)?void 0:_this__picker1.$body)&&this._imageErrorEvent((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]);},_proto._imageErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.hasAttribute("data-error")||img.addEventListener("error",_this._onImageError);});},_proto._imageRemoveErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.removeEventListener("error",_this._onImageError);});},_proto._onImageError=function(e){var img=e.target;if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_proto._onClickItem=function(e){var _e_delegateTarget_getAttribute,_e_delegateTarget,index=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_getAttribute=_e_delegateTarget.getAttribute)?void 0:_e_delegateTarget_getAttribute.call(_e_delegateTarget,"data-index");this._picker&&(this._picker.open=false),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+index]);},_proto._onClickCoverFold=function(e){var _e_delegateTarget_parentElement_getAttribute,_e_delegateTarget_parentElement,_e_delegateTarget;e.preventDefault();var time=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_parentElement=_e_delegateTarget.parentElement)||null==(_e_delegateTarget_parentElement_getAttribute=_e_delegateTarget_parentElement.getAttribute)?void 0:_e_delegateTarget_parentElement_getAttribute.call(_e_delegateTarget_parentElement,"data-time"),moveX=Math.abs(this._moveStartX-e.clientX),moveY=Math.abs(this._moveStartY-e.clientY);this._picker&&time&&!(moveX>=1||moveY>=1)&&(this._renderPickerContent(time),this._picker.open=true);},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},_proto._offsetYToTime=function(offsetY){var _this__dragScroll,y=offsetY;offsetY<60&&(y=60,null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y));var second=86400-Math.floor((y-60)*this._scaleWidth);return [second,TimeLineUtil.subTime(Math.floor(second/3600))+":"+TimeLineUtil.subTime(Math.floor(second%3600/60))+":"+TimeLineUtil.subTime(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:new Date(TimeLineUtil.tranTime(time,"YYYY-MM-DD HH:mm:ss"))});},_proto._update=function(options){var left,right,_this__$canvas;(void 0===options&&(options={}),(null==options?void 0:options.current)&&(left=options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)&&(this.current=options.current),(null==options?void 0:options.timeSections)&&BaseTimeLine.prototype.updateTimeSections.call(this,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*curScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime)),x,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x,padding,x,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),leftLastScaleTime-=this._timeWidthArray[0];}for(var x1=rightLastScaleTimeX;x1<=this.width*this.options.dpr;x1+=spacing){0===(rightLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime)),x1,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x1,padding,x1,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),rightLastScaleTime+=this._timeWidthArray[0];}this._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&TimeLineUtil.isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,false),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_proto._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0);},_proto._moveUpdateFun=function(x){var mouseOffset=this._mousePosition-x;if(0!==mouseOffset){if(this._oldTime){var currentTime=this._oldTime.getTime()+1e3*parseInt(mouseOffset/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(currentTime)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(currentTime));}this._moved=true;}},_create_class(TimeLine,[{key:"_curScaleSpacing",get:function(){var _this__timeWidthArray,_this__timeWidthArray1;return Math.floor((null==(_this__timeWidthArray=this._timeWidthArray)?void 0:_this__timeWidthArray[1])-(null==(_this__timeWidthArray1=this._timeWidthArray)?void 0:_this__timeWidthArray1[1])*+(this.timeWidth%1/2).toFixed(2))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH,dist$2.BaseTimeLine=BaseTimeLine,dist$2.MobileTimeLine=MobileTimeLine,dist$2.TimeLine=TimeLine;
11049
+ var deepmerge=requireCjs(),I18n=requireDist$8(),Picker=requireDist$a(),DragScroll=requireDist$2(),delegate=requireDist$1(),_$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(left=this.options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new I18n(deepmerge(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _proto=BaseTimeLine.prototype;return _proto.setReadOnly=function(readOnly){this.readOnly=readOnly;},_proto.update=function(current){this._current=current;},_proto.updateTimeSections=function(timeSections){timeSections&&Array.isArray(timeSections)&&(this._timeSections=timeSections);},_proto.resize=function(width,height){this._resize(width,height);},_proto._resize=function(width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),this.$container&&(this.$container.style.cssText+=cssText),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight);},_proto.setTimeWidth=function(timeWidth){[0,1,2,3,4,5].includes(timeWidth)&&(this._timeWidth=timeWidth);},_proto.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{key:"current",get:function(){return this._current},set:function(current){this._current=current;}},{key:"readOnly",get:function(){return this._readOnly},set:function(readOnly){this._readOnly!==readOnly&&(this._readOnly=readOnly,this.$container.style.cursor=readOnly?"not-allowed":"pointer");}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return TimeLineUtil.toDate=function(time){var left,right,date=null;return "string"==typeof time&&time.includes(":")?date=new Date(time):"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||13!==(time+"").length?(left=time,date=(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?time:new Date):date=new Date(+time):date=new Date(1e3*+time),date},TimeLineUtil.formatDateToHHmmss=function(time){var date=TimeLineUtil.toDate(time);if(date){var h=date.getHours(),m=date.getMinutes(),s=date.getSeconds();return (h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}return "00:00:00"},TimeLineUtil.subTime=function(m){return +m>9?m+"":"0"+m},TimeLineUtil.tranTime=function(time,fmt){ void 0===fmt&&(fmt="YYYY-MM-DD HH:mm:ss");var newDate=TimeLineUtil.toDate(time);return newDate?"YYYY-MM-DD"===fmt?newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate()):"HH:mm:ss"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH"===fmt?TimeLineUtil.subTime(newDate.getHours()):"mm:ss"===fmt?TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH:mm"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes()):"YYYYMMDDTHHmmssZ"===fmt?newDate.getFullYear()+""+TimeLineUtil.subTime(newDate.getMonth()+1)+TimeLineUtil.subTime(newDate.getDate())+"T"+TimeLineUtil.subTime(newDate.getHours())+TimeLineUtil.subTime(newDate.getMinutes())+TimeLineUtil.subTime(newDate.getSeconds())+"Z":newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate())+" "+TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):""},TimeLineUtil.timeToSecond=function(time){var e=time.split(":");return 60*Number(e[0])*60+60*Number(e[1])+(Number(e[2])||0)},TimeLineUtil.minuteToTime=function(minute){var hour=Math.floor(minute/60),m=minute%60;return (hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},TimeLineUtil.timeToMinute=function(time){var e=time.split(":");return 60*Number(e[0])+Number(e[1])},TimeLineUtil.isOverlap=function(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)},TimeLineUtil.tranTimeToString=function(start,end){var _TimeLineUtil_toDate,_TimeLineUtil_toDate1,secondNum=Math.floor((null==(_TimeLineUtil_toDate=TimeLineUtil.toDate(end))?void 0:_TimeLineUtil_toDate.getTime())-(null==(_TimeLineUtil_toDate1=TimeLineUtil.toDate(start))?void 0:_TimeLineUtil_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?TimeLineUtil.subTime(minute)+"'":"0'")+TimeLineUtil.subTime(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__tip='<svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__close='\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n ',_$TIMELINE_ICONS$__pause='<svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n ',_$TIMELINE_ICONS$__picture='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',TIME_WIDTH=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],MOBILE_TIME_WIDTH=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]];function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true,showCoverFold:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._plusClick=_this._plusClick.bind(_this),_this._minusClick=_this._minusClick.bind(_this),_this._onPickerClose=_this._onPickerClose.bind(_this),_this._onClickItem=_this._onClickItem.bind(_this),_this._onClickCoverFold=_this._onClickCoverFold.bind(_this),_this._onImageError=_this._onImageError.bind(_this),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1({},record,{startTime:TimeLineUtil.formatDateToHHmmss(record.startTime),endTime:TimeLineUtil.formatDateToHHmmss(record.endTime)})});if(list.length>0){ void 0===defaultIndex&&(defaultIndex=list.length-1);var current=this.state.current;this._setState({availTimeLine:list,start:list[defaultIndex].startTime,end:list[defaultIndex].endTime,current:null===current?list[defaultIndex].startTime:current}),this._matchTimeDot();}else this._setState({availTimeLine:[],current:TimeLineUtil.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:TimeLineUtil.tranTime(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll,_this__picker_$body_querySelectorAll,_this__picker_$body;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null;}catch(error){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null;}catch(error){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null;}catch(error){}this._picker&&(this._imageRemoveErrorEvent((null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelectorAll=_this__picker_$body.querySelectorAll)?void 0:_this__picker_$body_querySelectorAll.call(_this__picker_$body,"img"))||[]),this._picker.destroy(),this._picker=null);this._removeEventListener(),null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.destroy(),this._dragScroll=null,BaseTimeLine.prototype.destroy.call(this);},_proto._setState=function(obj){var _this=this;Object.keys(obj).forEach(function(key){var _this__dragScroll,_this_timeSections_;"current"===key&&obj[key]?(_this._setCurrentDOM(obj[key]),_this.state.current===obj[key]||(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.isDragging)||(_this.state[key]=obj[key],_this.current=new Date(TimeLineUtil.tranTime((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+obj[key]),null==_this.options.onChange||_this.options.onChange.call(_this.options,_this.current))):_this.state[key]=obj[key];});},_proto._setCurrentDOM=function(time){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=time);},_proto._matchTimeDot=function(){for(var scaleWidth=this._scaleWidth,timeArr=[],minute=TimeLineUtil.timeToMinute("24:00:00"),i=minute=Math.floor(minute/scaleWidth)*scaleWidth;i>=0;){var marginTop=0,marginBottom=0;i==minute&&(marginTop=70),0==i&&(marginBottom=this.$container.clientHeight-70);var time=TimeLineUtil.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:[],coverArr:this._filterTimeSectionsByTime(time)}),i-=scaleWidth;}this._setState({timeArr:timeArr}),this._matchRecTimeDot();},_proto._matchRecTimeDot=function(){var _this_state=this.state,availTimeLine=_this_state.availTimeLine,timeArr=_this_state.timeArr,scaleWidth=this._scaleWidth,len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else {for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(var i=0;i<len;i++){var stAvailPercent,etAvailPercent,temp=availTimeLine[i],st=TimeLineUtil.timeToSecond(temp.startTime),et=TimeLineUtil.timeToSecond(temp.endTime),stMinute=Math.floor(st/(60*scaleWidth))*scaleWidth;stAvailPercent=(st-60*stMinute)/scaleWidth;var etMinute=Math.floor(et/(60*scaleWidth))*scaleWidth;etAvailPercent=(et-60*etMinute)/scaleWidth;for(var j1=0;j1<timeArr.length;j1++)if(timeArr[j1].id==stMinute&&timeArr[j1].id==etMinute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j1].recArr.push({height:height,top:top});}else timeArr[j1].id==stMinute?timeArr[j1].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j1].id==etMinute?timeArr[j1].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j1].id>stMinute&&timeArr[j1].id<etMinute&&timeArr[j1].recArr.push({height:60,top:0});}}this._setState({timeArr:timeArr}),this._renderDateLine();},_proto._renderDateLine=function(){var _this=this,timeArr=this.state.timeArr,container=this._$itemList;this._imageRemoveErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]),container.innerHTML="",timeArr.forEach(function(item,index){var timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","ez-time-line-time-scale-area"),item.marginTop&&(timeItemDOM.style.cssText+="margin-top: "+item.marginTop+"px;"),item.marginBottom&&(timeItemDOM.style.cssText+="margin-bottom: "+item.marginBottom+"px;"),timeItemDOM.style.cssText+="border-right-color: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&_this.options.showCoverFold&&(timeItemHtml+='\n <div class="ez-time-line-time-cover-fold '+(item.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+item.current+'">\n '+(item.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img src="'+_this._setImageScr(item.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(item.coverArr.length>1?_this.i18n.t("foldTitle",{len:item.coverArr.length,unit:"videos"}):""+TimeLineUtil.tranTime(item.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===item.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+TimeLineUtil.tranTimeToString(item.coverArr[0].startTime,item.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause">'+_$TIMELINE_ICONS$__pause+"</span>\n </div>\n </div>"),item.recArr.forEach(function(i){timeItemHtml+='<div class="ez-time-line-time-unavail"\n style="height: '+i.height+"px;background-color:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),_this._imageErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]);}),this._currentOffsetH();},_proto._currentOffsetH=function(){var current=this.state.current;if(current){var _this__dragScroll,y=(86400-TimeLineUtil.timeToSecond(current)||0)/this._scaleWidth;null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y+60,false);}},_proto._render=function(){var _this=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar:true,onChange:function(state){var result=_this._offsetYToTime(state.y);result[1]!==_this.state.current&&_this._setCurrentDOM(result[0]>=86400?"23:59:59":result[1]);},onDragStart:function(e){_this._moveStartX=e.clientX,_this._moveStartY=e.clientY,null==_this.options.onDragStart||_this.options.onDragStart.call(_this.options,_this.state.current);},onDragging:function(){null==_this.options.onDragging||_this.options.onDragging.call(_this.options,_this.state.current);},onDragEnd:function(){var _this__dragScroll,result=_this._offsetYToTime(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.currentY);result[1]!==_this.state.current&&_this._setState({current:result[0]>=86400?"23:59:59":result[1]}),null==_this.options.onDragEnd||_this.options.onDragEnd.call(_this.options,_this.state.current);}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else {var height=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+height+"px";}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this._picker=new Picker(null,{isMobile:true,wrapClassName:"ez-time-line-picker",onOpenChange:function(isOpen){var _this_options_onPickerOpenChange,_this_options;null==(_this_options=_this.options)||null==(_this_options_onPickerOpenChange=_this_options.onPickerOpenChange)||_this_options_onPickerOpenChange.call(_this_options,isOpen);}}),this._addEventListener();},_proto._addEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.addEventListener("click",this._plusClick,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_proto._removeEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1,_this__picker_$body_querySelector,_this__picker_$body;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.removeEventListener("click",this._plusClick),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.removeEventListener("click",this._minusClick));this._picker&&(null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelector=_this__picker_$body.querySelector(".ez-time-line-picker-close"))||_this__picker_$body_querySelector.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach(function(delegation){delegation.destroy();}),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach(function(delegation){delegation.destroy();}),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach(function(delegation){delegation.destroy();}),this._delegateCoverFold=null));},_proto._plusClick=function(){var timeWidth=this.timeWidth+1;timeWidth>0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(timeWidth);},_proto._minusClick=function(){var timeWidth=this.timeWidth-1;timeWidth>=0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(Math.floor(timeWidth));},_proto._timeSectionsToGroupsByHour=function(list){var obj={};return list.forEach(function(item,index){var hour=TimeLineUtil.tranTime(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(TimeLineUtil.tranTime(item.startTime,"HH:mm:ss"));return _$start>=startSecond&&_$start<endSecond})},_proto._renderPickerContent=function(start){var _this__picker_innerHTML,_this__picker,_this__picker1,_this__picker2,_this=this,list=this._filterTimeSectionsByTime(start),hourGroups=this._timeSectionsToGroupsByHour(list);(null==(_this__picker=this._picker)||null==(_this__picker_innerHTML=_this__picker.innerHTML)||_this__picker_innerHTML.call(_this__picker,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">'+_$TIMELINE_ICONS$__close+"</span>\n "+this.i18n.t("title",{len:list.length,unit:list.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(hourGroups).reverse().map(function(key){return '<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+key+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+hourGroups[key].reverse().map(function(item){return '<div class="ez-time-line-picker-item-content"\n data-start="'+TimeLineUtil.tranTime(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+TimeLineUtil.tranTime(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+TimeLineUtil.tranTime(item.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+TimeLineUtil.tranTimeToString(item.startTime,item.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" src="'+_this._setImageScr(item.coverPic)+'"/>\n </div>'}).join("")+"\n </div>\n </div>"}).join("")+"\n </div>\n </div>\n </div>\n </div>"),null==(_this__picker1=this._picker)?void 0:_this__picker1.$body)&&this._imageErrorEvent((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]);},_proto._imageErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.hasAttribute("data-error")||img.addEventListener("error",_this._onImageError);});},_proto._imageRemoveErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.removeEventListener("error",_this._onImageError);});},_proto._onImageError=function(e){var img=e.target;if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_proto._onClickItem=function(e){var _e_delegateTarget_getAttribute,_e_delegateTarget,index=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_getAttribute=_e_delegateTarget.getAttribute)?void 0:_e_delegateTarget_getAttribute.call(_e_delegateTarget,"data-index");this._picker&&(this._picker.open=false),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+index]);},_proto._onClickCoverFold=function(e){var _e_delegateTarget_parentElement_getAttribute,_e_delegateTarget_parentElement,_e_delegateTarget;e.preventDefault();var time=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_parentElement=_e_delegateTarget.parentElement)||null==(_e_delegateTarget_parentElement_getAttribute=_e_delegateTarget_parentElement.getAttribute)?void 0:_e_delegateTarget_parentElement_getAttribute.call(_e_delegateTarget_parentElement,"data-time"),moveX=Math.abs(this._moveStartX-e.clientX),moveY=Math.abs(this._moveStartY-e.clientY);this._picker&&time&&!(moveX>=1||moveY>=1)&&(this._renderPickerContent(time),this._picker.open=true);},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},_proto._offsetYToTime=function(offsetY){var _this__dragScroll,y=offsetY;offsetY<60&&(y=60,null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y));var second=86400-Math.floor((y-60)*this._scaleWidth);return [second,TimeLineUtil.subTime(Math.floor(second/3600))+":"+TimeLineUtil.subTime(Math.floor(second%3600/60))+":"+TimeLineUtil.subTime(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:new Date(TimeLineUtil.tranTime(time,"YYYY-MM-DD HH:mm:ss"))});},_proto._update=function(options){var left,right,_this__$canvas;(void 0===options&&(options={}),(null==options?void 0:options.current)&&(left=options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)&&(this.current=options.current),(null==options?void 0:options.timeSections)&&BaseTimeLine.prototype.updateTimeSections.call(this,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*curScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime)),x,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x,padding,x,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),leftLastScaleTime-=this._timeWidthArray[0];}for(var x1=rightLastScaleTimeX;x1<=this.width*this.options.dpr;x1+=spacing){0===(rightLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime)),x1,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x1,padding,x1,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),rightLastScaleTime+=this._timeWidthArray[0];}this._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&TimeLineUtil.isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,false),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_proto._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0);},_proto._moveUpdateFun=function(x){var mouseOffset=this._mousePosition-x;if(0!==mouseOffset){if(this._oldTime){var currentTime=this._oldTime.getTime()+1e3*parseInt(mouseOffset/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(currentTime)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(currentTime));}this._moved=true;}},_create_class(TimeLine,[{key:"_curScaleSpacing",get:function(){var _this__timeWidthArray,_this__timeWidthArray1;return Math.floor((null==(_this__timeWidthArray=this._timeWidthArray)?void 0:_this__timeWidthArray[1])-(null==(_this__timeWidthArray1=this._timeWidthArray)?void 0:_this__timeWidthArray1[1])*+(this.timeWidth%1/2).toFixed(2))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH,dist$2.BaseTimeLine=BaseTimeLine,dist$2.MobileTimeLine=MobileTimeLine,dist$2.TimeLine=TimeLine;
11499
11050
  return dist$2;
11500
11051
  }
11501
11052
 
@@ -12567,8 +12118,7 @@
12567
12118
  return container;
12568
12119
  },
12569
12120
  language: theme.options.language,
12570
- locales: theme.i18n.translations,
12571
- staticPath: theme.options.staticPath
12121
+ locales: theme.i18n.translations
12572
12122
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
12573
12123
  props: props
12574
12124
  }));
@@ -12867,7 +12417,18 @@
12867
12417
  */ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
12868
12418
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
12869
12419
  * @private
12870
- */ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
12420
+ */ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
12421
+ // * 记录回放的月份
12422
+ // *
12423
+ // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
12424
+ // *
12425
+ // * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
12426
+ // * @private
12427
+ // */
12428
+ // _recMonthObj: Record<string, string[]> = {};
12429
+ /**
12430
+ * 录像回放的月份列表 @private
12431
+ */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
12871
12432
  _this._initOptions(options);
12872
12433
  if (_this.options.type === 'ezopen') {
12873
12434
  var _this_urlInfo_searchParams, _this_urlInfo;
@@ -12877,7 +12438,7 @@
12877
12438
  }
12878
12439
  if (_this.urlInfo.type === 'rec') {
12879
12440
  var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
12880
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.strToDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : DateTime.strToDate(DateTime.formate(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
12441
+ _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? distExports$6.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : distExports$6.DateTime.toDate(distExports$6.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
12881
12442
  }
12882
12443
  }
12883
12444
  _this._getRecType(_this.options.url);
@@ -13124,6 +12685,7 @@
13124
12685
  this._themeData = null;
13125
12686
  if (this.i18n) this.i18n = null;
13126
12687
  this.recType = '';
12688
+ this.recMonth = []; // 清空数据
13127
12689
  this.emit(EVENTS.theme.destroyed);
13128
12690
  this.removeAllListeners();
13129
12691
  if (this.logger) this.logger = null;
@@ -14089,7 +13651,7 @@
14089
13651
  zh: zh,
14090
13652
  en: en
14091
13653
  };
14092
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.5';
13654
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.7';
14093
13655
 
14094
13656
  // 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
14095
13657