@ezuikit/player-theme 2.1.0-beta.1 → 2.1.0-beta.11
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/constant.js +5 -2
- package/dist/index.js +659 -367
- package/dist/index.mjs +659 -367
- package/dist/index.umd.js +943 -915
- package/dist/style.css +3 -2
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +68 -44
- package/package.json +11 -4
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.1.0-beta.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @ezuikit/player-theme v2.1.0-beta.11
|
|
3
|
+
* Copyright (c) 2026-01-16 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -488,6 +488,7 @@
|
|
|
488
488
|
/** 控件开始录制 */ recordingChange: 'recordingChange',
|
|
489
489
|
/** 对讲状态变化 */ talkingChange: 'talkingChange',
|
|
490
490
|
/** 麦克风音量变化 */ talkVolumeChange: 'talkVolumeChange',
|
|
491
|
+
/** 语音广播状态变化 */ broadcastChange: 'broadcastChange',
|
|
491
492
|
/** 动态切换日志配置 */ setLoggerOptions: 'setLoggerOptions',
|
|
492
493
|
records: 'records',
|
|
493
494
|
ptzSpeedChange: 'ptzSpeedChange',
|
|
@@ -531,6 +532,8 @@
|
|
|
531
532
|
/** 开始对讲 */ talkingChange: 'Control.talkingChange',
|
|
532
533
|
/** 对讲错误, 一般是麦克风权限被拒绝 */ talkError: 'Control.talkError',
|
|
533
534
|
/** 对讲控件销毁 */ talkDestroy: 'Control.talkDestroy',
|
|
535
|
+
/** 语音广播状态变化 */ broadcastChange: 'Control.broadcastChange',
|
|
536
|
+
/** 语音广播控件销毁 */ broadcastDestroy: 'Control.broadcastDestroy',
|
|
534
537
|
/** 缩放比例改变 */ zoomChange: 'Control.zoomChange',
|
|
535
538
|
/** 音量调节面板 展示隐藏变换 */ zoomPanelOpenChange: 'Control.zoomPanelOpenChange',
|
|
536
539
|
/** 缩放控件销毁 */ zoomDestroy: 'Control.zoomDestroy',
|
|
@@ -582,7 +585,7 @@
|
|
|
582
585
|
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
583
586
|
return Constructor;
|
|
584
587
|
}
|
|
585
|
-
function _inherits$
|
|
588
|
+
function _inherits$s(subClass, superClass) {
|
|
586
589
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
587
590
|
throw new TypeError("Super expression must either be null or a function");
|
|
588
591
|
}
|
|
@@ -593,14 +596,14 @@
|
|
|
593
596
|
configurable: true
|
|
594
597
|
}
|
|
595
598
|
});
|
|
596
|
-
if (superClass) _set_prototype_of$
|
|
599
|
+
if (superClass) _set_prototype_of$s(subClass, superClass);
|
|
597
600
|
}
|
|
598
|
-
function _set_prototype_of$
|
|
599
|
-
_set_prototype_of$
|
|
601
|
+
function _set_prototype_of$s(o, p) {
|
|
602
|
+
_set_prototype_of$s = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
600
603
|
o.__proto__ = p;
|
|
601
604
|
return o;
|
|
602
605
|
};
|
|
603
|
-
return _set_prototype_of$
|
|
606
|
+
return _set_prototype_of$s(o, p);
|
|
604
607
|
}
|
|
605
608
|
/**
|
|
606
609
|
* 控件基类
|
|
@@ -614,7 +617,7 @@
|
|
|
614
617
|
* const myControl = new MyControl({})
|
|
615
618
|
* ```
|
|
616
619
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
617
|
-
_inherits$
|
|
620
|
+
_inherits$s(Control, EventEmitter);
|
|
618
621
|
function Control(options) {
|
|
619
622
|
var _this;
|
|
620
623
|
var _this___options;
|
|
@@ -789,8 +792,8 @@
|
|
|
789
792
|
return Control;
|
|
790
793
|
}(EventEmitter);
|
|
791
794
|
|
|
792
|
-
function _extends$
|
|
793
|
-
_extends$
|
|
795
|
+
function _extends$r() {
|
|
796
|
+
_extends$r = Object.assign || function(target) {
|
|
794
797
|
for(var i = 1; i < arguments.length; i++){
|
|
795
798
|
var source = arguments[i];
|
|
796
799
|
for(var key in source){
|
|
@@ -801,9 +804,9 @@
|
|
|
801
804
|
}
|
|
802
805
|
return target;
|
|
803
806
|
};
|
|
804
|
-
return _extends$
|
|
807
|
+
return _extends$r.apply(this, arguments);
|
|
805
808
|
}
|
|
806
|
-
function _inherits$
|
|
809
|
+
function _inherits$r(subClass, superClass) {
|
|
807
810
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
808
811
|
throw new TypeError("Super expression must either be null or a function");
|
|
809
812
|
}
|
|
@@ -814,25 +817,25 @@
|
|
|
814
817
|
configurable: true
|
|
815
818
|
}
|
|
816
819
|
});
|
|
817
|
-
if (superClass) _set_prototype_of$
|
|
820
|
+
if (superClass) _set_prototype_of$r(subClass, superClass);
|
|
818
821
|
}
|
|
819
|
-
function _set_prototype_of$
|
|
820
|
-
_set_prototype_of$
|
|
822
|
+
function _set_prototype_of$r(o, p) {
|
|
823
|
+
_set_prototype_of$r = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
821
824
|
o.__proto__ = p;
|
|
822
825
|
return o;
|
|
823
826
|
};
|
|
824
|
-
return _set_prototype_of$
|
|
827
|
+
return _set_prototype_of$r(o, p);
|
|
825
828
|
}
|
|
826
829
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
827
830
|
/**
|
|
828
831
|
* 加载动画控件
|
|
829
832
|
* @category Control
|
|
830
833
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
831
|
-
_inherits$
|
|
834
|
+
_inherits$r(Loading, Control);
|
|
832
835
|
function Loading(options) {
|
|
833
836
|
if (options === void 0) options = {};
|
|
834
837
|
var _this;
|
|
835
|
-
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$
|
|
838
|
+
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$r({}, options, {
|
|
836
839
|
tagName: 'div',
|
|
837
840
|
controlType: 'block',
|
|
838
841
|
classNameSuffix: 'loading'
|
|
@@ -870,8 +873,8 @@
|
|
|
870
873
|
return Loading;
|
|
871
874
|
}(Control);
|
|
872
875
|
|
|
873
|
-
function _extends$
|
|
874
|
-
_extends$
|
|
876
|
+
function _extends$q() {
|
|
877
|
+
_extends$q = Object.assign || function(target) {
|
|
875
878
|
for(var i = 1; i < arguments.length; i++){
|
|
876
879
|
var source = arguments[i];
|
|
877
880
|
for(var key in source){
|
|
@@ -882,9 +885,9 @@
|
|
|
882
885
|
}
|
|
883
886
|
return target;
|
|
884
887
|
};
|
|
885
|
-
return _extends$
|
|
888
|
+
return _extends$q.apply(this, arguments);
|
|
886
889
|
}
|
|
887
|
-
function _inherits$
|
|
890
|
+
function _inherits$q(subClass, superClass) {
|
|
888
891
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
889
892
|
throw new TypeError("Super expression must either be null or a function");
|
|
890
893
|
}
|
|
@@ -895,14 +898,14 @@
|
|
|
895
898
|
configurable: true
|
|
896
899
|
}
|
|
897
900
|
});
|
|
898
|
-
if (superClass) _set_prototype_of$
|
|
901
|
+
if (superClass) _set_prototype_of$q(subClass, superClass);
|
|
899
902
|
}
|
|
900
|
-
function _set_prototype_of$
|
|
901
|
-
_set_prototype_of$
|
|
903
|
+
function _set_prototype_of$q(o, p) {
|
|
904
|
+
_set_prototype_of$q = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
902
905
|
o.__proto__ = p;
|
|
903
906
|
return o;
|
|
904
907
|
};
|
|
905
|
-
return _set_prototype_of$
|
|
908
|
+
return _set_prototype_of$q(o, p);
|
|
906
909
|
}
|
|
907
910
|
// 不放在服务器上 是因为有可能http加载失败
|
|
908
911
|
// prettier-ignore
|
|
@@ -914,11 +917,11 @@
|
|
|
914
917
|
* 封面控件
|
|
915
918
|
* @category Control
|
|
916
919
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
917
|
-
_inherits$
|
|
920
|
+
_inherits$q(Poster, Control);
|
|
918
921
|
function Poster(options) {
|
|
919
922
|
if (options === void 0) options = {};
|
|
920
923
|
var _this;
|
|
921
|
-
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$
|
|
924
|
+
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$q({}, options, {
|
|
922
925
|
tagName: 'div',
|
|
923
926
|
controlType: 'block',
|
|
924
927
|
classNameSuffix: 'poster'
|
|
@@ -1013,6 +1016,7 @@
|
|
|
1013
1016
|
talkGrowth: function(prefix) {
|
|
1014
1017
|
return '<svg width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="talk-growth">\n <g fill="currentColor" stroke="currentColor">\n <path stroke="none" d="M9.22313 18.9543C9.6588 18.9543 10.0189 19.2133 10.0759 19.5494L10.0837 19.6428L10.0837 21.7847C10.0837 22.1649 9.69841 22.4732 9.22313 22.4732C8.78745 22.4732 8.42739 22.2142 8.37041 21.8781L8.36255 21.7847L8.36255 19.6428C8.36255 19.2626 8.74784 18.9543 9.22313 18.9543Z" fill-rule="evenodd" />\n <path d="M16.5323 11.3779L16.5323 11.5872C16.5323 15.7472 13.1599 19.1197 8.99981 19.1197C4.83971 19.1197 1.46729 15.7472 1.46729 11.5872L1.46729 11.4335" fill-rule="evenodd" fill="none" stroke-width="1.5" />\n <path stroke="none" d="M4.07861 6.12978C4.07861 3.589 6.30476 1.5293 9.05085 1.5293C11.7969 1.5293 14.0231 3.589 14.0231 6.12978L14.0231 12.075C14.0231 14.6158 11.7969 16.6755 9.05085 16.6755C6.30476 16.6755 4.07861 14.6158 4.07861 12.075L4.07861 6.12978ZM5.57861 12.075L5.57861 6.12978C5.57861 5.94083 5.597 5.75561 5.63376 5.57412C5.67605 5.36539 5.74265 5.16158 5.83357 4.9627C5.86625 4.8912 5.90164 4.82121 5.93974 4.75272C6.09781 4.4685 6.30245 4.21019 6.55365 3.97777C6.64206 3.89597 6.73424 3.81921 6.83019 3.7475C7.0816 3.55959 7.3589 3.40632 7.66207 3.28767C7.79552 3.23545 7.93107 3.19114 8.06871 3.15475C8.38503 3.07111 8.71241 3.0293 9.05085 3.0293C9.38929 3.0293 9.71668 3.07112 10.033 3.15475C10.1706 3.19114 10.3062 3.23545 10.4396 3.28767C10.7428 3.40632 11.0201 3.55959 11.2715 3.74749C11.3675 3.81921 11.4596 3.89596 11.548 3.97777C11.7993 4.2102 12.0039 4.46853 12.162 4.75276C12.2001 4.82124 12.2354 4.89122 12.2681 4.9627C12.359 5.16157 12.4256 5.36536 12.4679 5.57407C12.5047 5.75558 12.5231 5.94082 12.5231 6.12978L12.5231 12.075C12.5231 12.264 12.5047 12.4492 12.4679 12.6307C12.4256 12.8394 12.359 13.0432 12.2681 13.2421C12.2355 13.3136 12.2001 13.3835 12.162 13.452C12.0039 13.7362 11.7993 13.9946 11.548 14.227C11.4596 14.3088 11.3675 14.3856 11.2715 14.4573C11.0201 14.6452 10.7428 14.7985 10.4396 14.9171C10.3062 14.9693 10.1706 15.0136 10.033 15.05C9.71667 15.1337 9.38929 15.1755 9.05085 15.1755C8.71241 15.1755 8.38503 15.1337 8.06871 15.05C7.93107 15.0136 7.79552 14.9693 7.66207 14.9171C7.3589 14.7985 7.0816 14.6452 6.83019 14.4573C6.73424 14.3856 6.64206 14.3088 6.55365 14.227C6.30244 13.9946 6.09779 13.7363 5.93972 13.452C5.90163 13.3836 5.86625 13.3136 5.83357 13.2421C5.74265 13.0432 5.67605 12.8394 5.63377 12.6307C5.597 12.4492 5.57861 12.264 5.57861 12.075Z" fill-rule="evenodd" />\n </g>\n <g class="' + prefix + '-icon-talk-growth-dot">\n <path class="' + prefix + '-icon-talk-growth-dot1" d="M19.1333 6.40039L22.8667 6.40039" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="' + prefix + '-icon-talk-growth-dot2" d="M19.1333 10.1338L21.9331 10.1338" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="' + prefix + '-icon-talk-growth-dot3" d="M19.1333 13.8672L20.9995 13.8672" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="' + prefix + '-icon-talk-growth-dot4" d="M19.1333 17.6001L20.0669 17.6001" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n </g>\n </svg>';
|
|
1015
1018
|
},
|
|
1019
|
+
/** 语音广播 */ broadcast: '\n <svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" stroke="none" focusable="false" aria-hidden="true" data-icon="broadcast">\n <g>\n <path id="矢量 1" d="m8.52109,6.76609l6.17823,-2.91335c0.2485,-0.11718 0.5027,-0.19531 0.7627,-0.2351c0.2034,-0.03077 0.4104,-0.03809 0.6211,-0.02173c0.2092,0.01636 0.4116,0.05493 0.6069,0.11621c0.2278,0.07129 0.4461,0.1731 0.6548,0.30542c0.2087,0.13232 0.394,0.28638 0.5557,0.46216l0.0002,0l0,0c0.1384,0.15064 0.2598,0.31714 0.3638,0.49951c0.1047,0.18335 0.1865,0.37354 0.2451,0.57081c0.0752,0.25219 0.1128,0.51562 0.1128,0.79004l0,10.64651c0,0.2744 -0.0376,0.5379 -0.1128,0.7901l0,0c-0.0586,0.197 -0.1404,0.3874 -0.2451,0.5708c-0.104,0.1823 -0.2254,0.3488 -0.364,0.4995c-0.1617,0.1758 -0.347,0.3298 -0.5557,0.4621c-0.2087,0.1324 -0.427,0.2342 -0.6548,0.3054c-0.1953,0.0611 -0.3977,0.0999 -0.6069,0.1163c-0.2107,0.0163 -0.4175,0.009 -0.6209,-0.0218c-0.2602,-0.0398 -0.5144,-0.1181 -0.7629,-0.2351l-5.45044,-2.5703l0,2.759c0,0.1036 -0.01831,0.1995 -0.05494,0.2879c-0.03662,0.0886 -0.09155,0.1692 -0.16479,0.2424c-0.14624,0.1465 -0.32324,0.2197 -0.53027,0.2197l-2,0c-0.14209,0 -0.27344,-0.0373 -0.39429,-0.112c-0.12085,-0.0745 -0.21289,-0.1756 -0.27661,-0.3025l-1.99268,-3.9856c-0.06225,-0.0234 -0.12402,-0.0481 -0.18555,-0.074c-0.26953,-0.114 -0.52417,-0.2502 -0.7644,-0.4084c-0.26636,-0.1758 -0.51489,-0.3789 -0.74512,-0.6094c-0.23047,-0.2302 -0.43359,-0.4788 -0.60937,-0.7451c-0.1582,-0.2403 -0.29444,-0.4949 -0.40845,-0.7644c-0.11328,-0.2679 -0.20068,-0.5413 -0.26245,-0.8206l0,0c-0.07398,-0.3347 -0.11108,-0.6775 -0.11108,-1.0286c0,-0.351 0.0371,-0.6938 0.11108,-1.0285c0.06177,-0.2793 0.14917,-0.5528 0.26245,-0.8206c0.11401,-0.26953 0.25025,-0.52417 0.40845,-0.7644c0.17578,-0.26636 0.3789,-0.5149 0.60937,-0.74512c0.23023,-0.23047 0.47876,-0.4336 0.74512,-0.60938l0,0c0.24023,-0.1582 0.49487,-0.29444 0.7644,-0.40845c0.26783,-0.11328 0.54126,-0.20068 0.82056,-0.26245l0,0l0,0l0,0c0.33472,-0.07398 0.67749,-0.11109 1.02857,-0.11109l2.93872,0c0.02636,-0.0166 0.05444,-0.03198 0.08349,-0.04589zm0.72876,8.47948l6.08937,2.8716c0.1287,0.0606 0.2598,0.0987 0.3935,0.114c0.0772,0.0088 0.1551,0.0103 0.2337,0.0042c0.0857,-0.0068 0.1687,-0.0217 0.2495,-0.0452c0.1133,-0.0329 0.2219,-0.0822 0.3257,-0.1479c0.104,-0.0659 0.1948,-0.1431 0.2729,-0.2317c0.0554,-0.063 0.1045,-0.1318 0.147,-0.2063c0.0393,-0.0686 0.0713,-0.1397 0.0962,-0.2131c0.043,-0.1277 0.0647,-0.2625 0.0647,-0.4046l0,-10.64651c0,-0.14209 -0.0217,-0.2771 -0.0647,-0.40454c-0.0249,-0.07349 -0.0569,-0.14454 -0.0962,-0.21314c-0.0425,-0.07471 -0.0916,-0.14331 -0.147,-0.2063c-0.0781,-0.08862 -0.1689,-0.16577 -0.2729,-0.23169c-0.1038,-0.06567 -0.2124,-0.11523 -0.3257,-0.14795c-0.0808,-0.02344 -0.1638,-0.03833 -0.2495,-0.04517c-0.0786,-0.0061 -0.1565,-0.00463 -0.2337,0.00415c-0.1337,0.01539 -0.2648,0.05347 -0.3935,0.11402l-6.09034,2.87208l0.00097,7.16405zm13.58447,-7.9121l-2,1c-0.3757,0.18775 -0.8184,0.04029 -1.0063,-0.33545c-0.0552,-0.11035 -0.0813,-0.22656 -0.0813,-0.34033c0,-0.27344 0.1516,-0.53321 0.4167,-0.66602l2,-1c0.3757,-0.18775 0.8186,-0.04004 1.0064,0.33545c0.0551,0.11035 0.0813,0.22656 0.0813,0.34033c0,0.27368 -0.1514,0.53345 -0.4168,0.66602zm-15.08544,8.9785l-2.08667,0l1.30029,2.6006l0.78638,0l0,-2.6006zm0,-7.99998l-2.25,0c-0.24976,0 -0.49317,0.02734 -0.73023,0.08179c-0.18188,0.04174 -0.36011,0.09961 -0.53467,0.17334c-0.17944,0.07593 -0.34961,0.1665 -0.51049,0.27124c-0.18702,0.12231 -0.36133,0.26416 -0.52271,0.42554c-0.16138,0.16137 -0.30322,0.33569 -0.42554,0.52267c-0.10473,0.1609 -0.19531,0.3311 -0.27124,0.5105c-0.07373,0.1746 -0.13159,0.3528 -0.17334,0.5347c-0.05444,0.2371 -0.08178,0.4805 -0.08178,0.7302c0,0.2498 0.02734,0.4932 0.08178,0.7303c0.04175,0.1818 0.09961,0.3601 0.17334,0.5346c0.07593,0.1795 0.16651,0.3496 0.27124,0.5105c0.12232,0.187 0.26416,0.3614 0.42554,0.5227c0.16138,0.1614 0.33569,0.3033 0.52271,0.4256c0.16088,0.1047 0.33105,0.1953 0.51049,0.2712c0.17456,0.0737 0.35279,0.1316 0.53467,0.1734c0.23706,0.0544 0.48047,0.0817 0.73023,0.0817l2.25097,0l-0.00097,-6.49998zm12.75004,2.60058l2,0c0.4199,0 0.75,0.3301 0.75,0.75c0,0.4199 -0.3301,0.75 -0.75,0.75l-2,0c-0.42,0 -0.75,-0.3301 -0.75,-0.75c0,-0.4199 0.33,-0.75 0.75,-0.75zm0.3354,4.0791l2,1c0.2654,0.1326 0.4168,0.3924 0.4168,0.6661c0,0.1137 -0.0262,0.2299 -0.0813,0.3403c-0.1878,0.3755 -0.6307,0.5232 -1.0064,0.3354l-2,-1c-0.2651,-0.1328 -0.4167,-0.3925 -0.4167,-0.666c0,-0.1138 0.0261,-0.23 0.0813,-0.3403c0.1879,-0.3758 0.6306,-0.5232 1.0063,-0.3355z" fill-rule="evenodd"/>\n </g>\n</svg>',
|
|
1016
1020
|
/** 相机/截图 */ capturePicture: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="capture-picture">\n <path d="M6.94 7.51C7.34 7.51 7.7 7.28 7.86 6.91L8.43 5.6C8.59 5.23 8.95 5 9.35 5L14.69 5C15.04 5 15.37 5.18 15.55 5.49L16.45 7.02C16.63 7.33 16.96 7.51 17.31 7.51L18.5 7.51C19.6 7.51 20.5 8.41 20.5 9.51L20.5 17C20.5 18.1 19.6 19 18.5 19L5.5 19C4.39 19 3.5 18.1 3.5 17L3.5 9.51C3.5 8.41 4.39 7.51 5.5 7.51L6.94 7.51Z" stroke-width="1.5"/>\n <circle cx="12" cy="12.525146" r="3.068097" stroke-width="1.5"/>\n </svg>',
|
|
1017
1021
|
/** 电子放大 */ zoom: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="zoom">\n <ellipse cx="10.914795" cy="11.25" rx="8.004043" ry="8.25" stroke-width="1.5"/>\n <path d="M14.31 11.04L8.05 11.14" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M11.13 14.22L11.23 7.95" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M16.45 17.83L19.36 20.83" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',
|
|
1018
1022
|
/** 隐私遮蔽 */ privacyMasking: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="privacy-masking">\n <path d="M12 19C11.15 19 10.31 18.82 9.49 18.5" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M20.88 12.46C18.98 15.96 15.49 19 11.99 19" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M19.07 8.92C19.76 9.72 20.38 10.61 20.88 11.53C21.03 11.82 21.03 12.17 20.88 12.46" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M5 19L19 5" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M9.77 14.22C8.54 12.99 8.54 11 9.77 9.77C11 8.54 12.99 8.54 14.22 9.77" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M17.04 6.95C15.49 5.75 13.74 5 12 5C8.5 5 5.01 8.03 3.11 11.53C2.96 11.82 2.96 12.17 3.11 12.46C4.06 14.21 5.41 15.84 6.95 17.04" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',
|
|
@@ -1097,6 +1101,10 @@
|
|
|
1097
1101
|
if (attr === void 0) attr = {};
|
|
1098
1102
|
return createIcon(Icons.talk, 'talk', attr);
|
|
1099
1103
|
},
|
|
1104
|
+
broadcast: function(attr) {
|
|
1105
|
+
if (attr === void 0) attr = {};
|
|
1106
|
+
return createIcon(Icons.broadcast, 'broadcast', attr);
|
|
1107
|
+
},
|
|
1100
1108
|
talkGrowth: function(attr) {
|
|
1101
1109
|
if (attr === void 0) attr = {};
|
|
1102
1110
|
return createIcon(Icons.talkGrowth(PREFIX_CLASS), 'talk-growth', attr);
|
|
@@ -1175,8 +1183,8 @@
|
|
|
1175
1183
|
}
|
|
1176
1184
|
};
|
|
1177
1185
|
|
|
1178
|
-
function _extends$
|
|
1179
|
-
_extends$
|
|
1186
|
+
function _extends$p() {
|
|
1187
|
+
_extends$p = Object.assign || function(target) {
|
|
1180
1188
|
for(var i = 1; i < arguments.length; i++){
|
|
1181
1189
|
var source = arguments[i];
|
|
1182
1190
|
for(var key in source){
|
|
@@ -1187,9 +1195,9 @@
|
|
|
1187
1195
|
}
|
|
1188
1196
|
return target;
|
|
1189
1197
|
};
|
|
1190
|
-
return _extends$
|
|
1198
|
+
return _extends$p.apply(this, arguments);
|
|
1191
1199
|
}
|
|
1192
|
-
function _inherits$
|
|
1200
|
+
function _inherits$p(subClass, superClass) {
|
|
1193
1201
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1194
1202
|
throw new TypeError("Super expression must either be null or a function");
|
|
1195
1203
|
}
|
|
@@ -1200,25 +1208,25 @@
|
|
|
1200
1208
|
configurable: true
|
|
1201
1209
|
}
|
|
1202
1210
|
});
|
|
1203
|
-
if (superClass) _set_prototype_of$
|
|
1211
|
+
if (superClass) _set_prototype_of$p(subClass, superClass);
|
|
1204
1212
|
}
|
|
1205
|
-
function _set_prototype_of$
|
|
1206
|
-
_set_prototype_of$
|
|
1213
|
+
function _set_prototype_of$p(o, p) {
|
|
1214
|
+
_set_prototype_of$p = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1207
1215
|
o.__proto__ = p;
|
|
1208
1216
|
return o;
|
|
1209
1217
|
};
|
|
1210
|
-
return _set_prototype_of$
|
|
1218
|
+
return _set_prototype_of$p(o, p);
|
|
1211
1219
|
}
|
|
1212
1220
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
1213
1221
|
/**
|
|
1214
1222
|
* 消息控件
|
|
1215
1223
|
* @category Control
|
|
1216
1224
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
1217
|
-
_inherits$
|
|
1225
|
+
_inherits$p(Message, Control);
|
|
1218
1226
|
function Message(options) {
|
|
1219
1227
|
if (options === void 0) options = {};
|
|
1220
1228
|
var _this;
|
|
1221
|
-
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$
|
|
1229
|
+
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$p({}, options, {
|
|
1222
1230
|
tagName: 'div',
|
|
1223
1231
|
controlType: 'block'
|
|
1224
1232
|
}))) || this;
|
|
@@ -1371,8 +1379,8 @@
|
|
|
1371
1379
|
if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
|
|
1372
1380
|
return Constructor;
|
|
1373
1381
|
}
|
|
1374
|
-
function _extends$
|
|
1375
|
-
_extends$
|
|
1382
|
+
function _extends$o() {
|
|
1383
|
+
_extends$o = Object.assign || function(target) {
|
|
1376
1384
|
for(var i = 1; i < arguments.length; i++){
|
|
1377
1385
|
var source = arguments[i];
|
|
1378
1386
|
for(var key in source){
|
|
@@ -1383,9 +1391,9 @@
|
|
|
1383
1391
|
}
|
|
1384
1392
|
return target;
|
|
1385
1393
|
};
|
|
1386
|
-
return _extends$
|
|
1394
|
+
return _extends$o.apply(this, arguments);
|
|
1387
1395
|
}
|
|
1388
|
-
function _inherits$
|
|
1396
|
+
function _inherits$o(subClass, superClass) {
|
|
1389
1397
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1390
1398
|
throw new TypeError("Super expression must either be null or a function");
|
|
1391
1399
|
}
|
|
@@ -1396,23 +1404,23 @@
|
|
|
1396
1404
|
configurable: true
|
|
1397
1405
|
}
|
|
1398
1406
|
});
|
|
1399
|
-
if (superClass) _set_prototype_of$
|
|
1407
|
+
if (superClass) _set_prototype_of$o(subClass, superClass);
|
|
1400
1408
|
}
|
|
1401
|
-
function _set_prototype_of$
|
|
1402
|
-
_set_prototype_of$
|
|
1409
|
+
function _set_prototype_of$o(o, p) {
|
|
1410
|
+
_set_prototype_of$o = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1403
1411
|
o.__proto__ = p;
|
|
1404
1412
|
return o;
|
|
1405
1413
|
};
|
|
1406
|
-
return _set_prototype_of$
|
|
1414
|
+
return _set_prototype_of$o(o, p);
|
|
1407
1415
|
}
|
|
1408
1416
|
/**
|
|
1409
1417
|
* 播放/暂停控件
|
|
1410
1418
|
* @category Control
|
|
1411
1419
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1412
|
-
_inherits$
|
|
1420
|
+
_inherits$o(Play, Control);
|
|
1413
1421
|
function Play(options) {
|
|
1414
1422
|
var _this;
|
|
1415
|
-
_this = Control.call(this, _extends$
|
|
1423
|
+
_this = Control.call(this, _extends$o({}, options, {
|
|
1416
1424
|
tagName: 'span',
|
|
1417
1425
|
controlType: 'button',
|
|
1418
1426
|
classNameSuffix: 'play'
|
|
@@ -1473,12 +1481,12 @@
|
|
|
1473
1481
|
* LICENSE file in the root directory of this source tree.
|
|
1474
1482
|
*/
|
|
1475
1483
|
|
|
1476
|
-
var dist$
|
|
1477
|
-
var hasRequiredDist$
|
|
1484
|
+
var dist$8;
|
|
1485
|
+
var hasRequiredDist$8;
|
|
1478
1486
|
|
|
1479
|
-
function requireDist$
|
|
1480
|
-
if (hasRequiredDist$
|
|
1481
|
-
hasRequiredDist$
|
|
1487
|
+
function requireDist$8 () {
|
|
1488
|
+
if (hasRequiredDist$8) return dist$8;
|
|
1489
|
+
hasRequiredDist$8 = 1;
|
|
1482
1490
|
|
|
1483
1491
|
function _array_like_to_array(arr, len) {
|
|
1484
1492
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -2055,31 +2063,31 @@
|
|
|
2055
2063
|
*/
|
|
2056
2064
|
Picker.VERSION = '1.1.7';
|
|
2057
2065
|
|
|
2058
|
-
dist$
|
|
2059
|
-
return dist$
|
|
2066
|
+
dist$8 = Picker;
|
|
2067
|
+
return dist$8;
|
|
2060
2068
|
}
|
|
2061
2069
|
|
|
2062
|
-
var distExports$7 = requireDist$
|
|
2070
|
+
var distExports$7 = requireDist$8();
|
|
2063
2071
|
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$7);
|
|
2064
2072
|
|
|
2065
|
-
var delegate$
|
|
2073
|
+
var delegate$2 = {exports: {}};
|
|
2066
2074
|
|
|
2067
2075
|
/*
|
|
2068
2076
|
* delegate.js v4.0.2
|
|
2069
2077
|
* Copyright (c) 2025-12-16
|
|
2070
2078
|
* Released under the MIT License.
|
|
2071
2079
|
*/
|
|
2072
|
-
var delegate$
|
|
2080
|
+
var delegate$1 = delegate$2.exports;
|
|
2073
2081
|
|
|
2074
|
-
var hasRequiredDelegate
|
|
2082
|
+
var hasRequiredDelegate;
|
|
2075
2083
|
|
|
2076
|
-
function requireDelegate
|
|
2077
|
-
if (hasRequiredDelegate
|
|
2078
|
-
hasRequiredDelegate
|
|
2084
|
+
function requireDelegate () {
|
|
2085
|
+
if (hasRequiredDelegate) return delegate$2.exports;
|
|
2086
|
+
hasRequiredDelegate = 1;
|
|
2079
2087
|
(function (module, exports) {
|
|
2080
2088
|
(function (global, factory) {
|
|
2081
2089
|
module.exports = factory() ;
|
|
2082
|
-
})(delegate$
|
|
2090
|
+
})(delegate$1, (function () {
|
|
2083
2091
|
var DOCUMENT_NODE_TYPE = 9;
|
|
2084
2092
|
/**
|
|
2085
2093
|
* A polyfill for Element.matches()
|
|
@@ -2194,12 +2202,12 @@
|
|
|
2194
2202
|
return delegate;
|
|
2195
2203
|
|
|
2196
2204
|
}));
|
|
2197
|
-
} (delegate$
|
|
2198
|
-
return delegate$
|
|
2205
|
+
} (delegate$2));
|
|
2206
|
+
return delegate$2.exports;
|
|
2199
2207
|
}
|
|
2200
2208
|
|
|
2201
|
-
var delegateExports = requireDelegate
|
|
2202
|
-
var delegate
|
|
2209
|
+
var delegateExports = requireDelegate();
|
|
2210
|
+
var delegate = /*@__PURE__*/getDefaultExportFromCjs(delegateExports);
|
|
2203
2211
|
|
|
2204
2212
|
var cjs;
|
|
2205
2213
|
var hasRequiredCjs;
|
|
@@ -2345,7 +2353,7 @@
|
|
|
2345
2353
|
var cjsExports = requireCjs();
|
|
2346
2354
|
var deepmerge = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
|
|
2347
2355
|
|
|
2348
|
-
var dist$
|
|
2356
|
+
var dist$7 = {};
|
|
2349
2357
|
|
|
2350
2358
|
/*
|
|
2351
2359
|
* @ezuikit/utils-tools v2.0.1
|
|
@@ -2354,16 +2362,16 @@
|
|
|
2354
2362
|
* Released under the MIT License.
|
|
2355
2363
|
*/
|
|
2356
2364
|
|
|
2357
|
-
var hasRequiredDist$
|
|
2365
|
+
var hasRequiredDist$7;
|
|
2358
2366
|
|
|
2359
|
-
function requireDist$
|
|
2360
|
-
if (hasRequiredDist$
|
|
2361
|
-
hasRequiredDist$
|
|
2362
|
-
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(str+"T00:00:00"):/^\d{8}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T00:00:00")):/^\d{14}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T"+str.slice(8,10)+":"+str.slice(10,12)+":"+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$
|
|
2363
|
-
return dist$
|
|
2367
|
+
function requireDist$7 () {
|
|
2368
|
+
if (hasRequiredDist$7) return dist$7;
|
|
2369
|
+
hasRequiredDist$7 = 1;
|
|
2370
|
+
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(str+"T00:00:00"):/^\d{8}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T00:00:00")):/^\d{14}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T"+str.slice(8,10)+":"+str.slice(10,12)+":"+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$7.DateTime=DateTime,dist$7.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce((function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)}),0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter((function(item){return !/^vc=\d?/.test(item)})).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$7.getQuery=getQuery,dist$7.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$7.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$7.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$7.parseEzopenUrl=parseEzopenUrl,dist$7.pick=function(obj,keys){return Object.entries(obj).reduce((function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc}),{})},dist$7.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce((function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"}),"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
2371
|
+
return dist$7;
|
|
2364
2372
|
}
|
|
2365
2373
|
|
|
2366
|
-
var distExports$6 = requireDist$
|
|
2374
|
+
var distExports$6 = requireDist$7();
|
|
2367
2375
|
|
|
2368
2376
|
/**
|
|
2369
2377
|
* 节流函数
|
|
@@ -2760,7 +2768,7 @@
|
|
|
2760
2768
|
var _this = this;
|
|
2761
2769
|
var mousedownName = window.PointerEvent ? 'pointerdown' : 'mousedown';
|
|
2762
2770
|
// prettier-ignore
|
|
2763
|
-
this._delegateSliderMouseDown = delegate
|
|
2771
|
+
this._delegateSliderMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider", mousedownName, function(e) {
|
|
2764
2772
|
var // 垂直方向Y轴是反的,所以用高度减去点击位置
|
|
2765
2773
|
_this_options_onProgressClick, _this_options;
|
|
2766
2774
|
e.stopPropagation();
|
|
@@ -2785,7 +2793,7 @@
|
|
|
2785
2793
|
_this.percent = percent;
|
|
2786
2794
|
});
|
|
2787
2795
|
// prettier-ignore
|
|
2788
|
-
this._delegateSliderHandleMouseDown = delegate
|
|
2796
|
+
this._delegateSliderHandleMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider-handle", mousedownName, function(e) {
|
|
2789
2797
|
e.stopPropagation();
|
|
2790
2798
|
if (!_this.options.draggable) {
|
|
2791
2799
|
return;
|
|
@@ -2825,7 +2833,7 @@
|
|
|
2825
2833
|
// plug
|
|
2826
2834
|
if (this.options.showPlus) {
|
|
2827
2835
|
var clickName = window.PointerEvent ? 'pointerdown' : 'click';
|
|
2828
|
-
this._delegatePlusClick = delegate
|
|
2836
|
+
this._delegatePlusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-plus", clickName, function(e) {
|
|
2829
2837
|
e.stopPropagation();
|
|
2830
2838
|
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2831
2839
|
return;
|
|
@@ -2843,7 +2851,7 @@
|
|
|
2843
2851
|
if (this.options.showMinus) {
|
|
2844
2852
|
var clickName1 = window.PointerEvent ? 'pointerdown' : 'click';
|
|
2845
2853
|
// prettier-ignore
|
|
2846
|
-
this._delegateMinusClick = delegate
|
|
2854
|
+
this._delegateMinusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-minus", clickName1, function(e) {
|
|
2847
2855
|
e.stopPropagation();
|
|
2848
2856
|
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2849
2857
|
return;
|
|
@@ -2863,7 +2871,7 @@
|
|
|
2863
2871
|
'touchmove',
|
|
2864
2872
|
'dblclick'
|
|
2865
2873
|
].forEach(function(name) {
|
|
2866
|
-
delegate
|
|
2874
|
+
delegate(_this.$container, "." + PREFIX_CLASS + "-progress", name, function(e) {
|
|
2867
2875
|
e.stopPropagation();
|
|
2868
2876
|
e.preventDefault(); // 阻止默认的触摸行为
|
|
2869
2877
|
});
|
|
@@ -2930,8 +2938,8 @@
|
|
|
2930
2938
|
if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
|
|
2931
2939
|
return Constructor;
|
|
2932
2940
|
}
|
|
2933
|
-
function _extends$
|
|
2934
|
-
_extends$
|
|
2941
|
+
function _extends$n() {
|
|
2942
|
+
_extends$n = Object.assign || function(target) {
|
|
2935
2943
|
for(var i = 1; i < arguments.length; i++){
|
|
2936
2944
|
var source = arguments[i];
|
|
2937
2945
|
for(var key in source){
|
|
@@ -2942,9 +2950,9 @@
|
|
|
2942
2950
|
}
|
|
2943
2951
|
return target;
|
|
2944
2952
|
};
|
|
2945
|
-
return _extends$
|
|
2953
|
+
return _extends$n.apply(this, arguments);
|
|
2946
2954
|
}
|
|
2947
|
-
function _inherits$
|
|
2955
|
+
function _inherits$n(subClass, superClass) {
|
|
2948
2956
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
2949
2957
|
throw new TypeError("Super expression must either be null or a function");
|
|
2950
2958
|
}
|
|
@@ -2955,14 +2963,14 @@
|
|
|
2955
2963
|
configurable: true
|
|
2956
2964
|
}
|
|
2957
2965
|
});
|
|
2958
|
-
if (superClass) _set_prototype_of$
|
|
2966
|
+
if (superClass) _set_prototype_of$n(subClass, superClass);
|
|
2959
2967
|
}
|
|
2960
|
-
function _set_prototype_of$
|
|
2961
|
-
_set_prototype_of$
|
|
2968
|
+
function _set_prototype_of$n(o, p) {
|
|
2969
|
+
_set_prototype_of$n = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
2962
2970
|
o.__proto__ = p;
|
|
2963
2971
|
return o;
|
|
2964
2972
|
};
|
|
2965
|
-
return _set_prototype_of$
|
|
2973
|
+
return _set_prototype_of$n(o, p);
|
|
2966
2974
|
}
|
|
2967
2975
|
var VOLUME_DEFAULT_OPTIONS = {
|
|
2968
2976
|
volume: 0.8,
|
|
@@ -2976,12 +2984,12 @@
|
|
|
2976
2984
|
* 音量调节控件
|
|
2977
2985
|
* @category Control
|
|
2978
2986
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
2979
|
-
_inherits$
|
|
2987
|
+
_inherits$n(Volume, Control);
|
|
2980
2988
|
function Volume(options) {
|
|
2981
2989
|
if (options === void 0) options = {};
|
|
2982
2990
|
var _this;
|
|
2983
2991
|
var _this__options_props, _this__options_props1, _this__options_props2, _this__options_props3;
|
|
2984
|
-
_this = Control.call(this, _extends$
|
|
2992
|
+
_this = Control.call(this, _extends$n({}, options, {
|
|
2985
2993
|
tagName: 'span',
|
|
2986
2994
|
classNameSuffix: 'volume',
|
|
2987
2995
|
controlType: 'button'
|
|
@@ -3115,7 +3123,7 @@
|
|
|
3115
3123
|
var _this = this;
|
|
3116
3124
|
// 这里不要用 click 事件,因为拖动音量大小时鼠标移动到图标上会触发 click
|
|
3117
3125
|
// prettier-ignore
|
|
3118
|
-
delegate
|
|
3126
|
+
delegate(this.$container, "." + PREFIX_CLASS + "-control-volume", "mousedown", function() {
|
|
3119
3127
|
if (!_this.$container.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
3120
3128
|
_this._toggleMute();
|
|
3121
3129
|
}
|
|
@@ -3160,7 +3168,10 @@
|
|
|
3160
3168
|
if (this._lastVolume !== _volume) {
|
|
3161
3169
|
this._volume = _volume;
|
|
3162
3170
|
this._lastVolume = this._volume;
|
|
3163
|
-
if (this._progress)
|
|
3171
|
+
if (this._progress) {
|
|
3172
|
+
// 静音时进度条为 0
|
|
3173
|
+
this._progress.value = this._muted ? 0 : _volume;
|
|
3174
|
+
}
|
|
3164
3175
|
this._options.onChange == null ? void 0 : this._options.onChange.call(this._options, _volume, this._muted);
|
|
3165
3176
|
this.emit(EVENTS.control.volumechange, _volume, this._muted);
|
|
3166
3177
|
}
|
|
@@ -3393,7 +3404,7 @@
|
|
|
3393
3404
|
var screenfullExports = requireScreenfull();
|
|
3394
3405
|
var screenfull = /*@__PURE__*/getDefaultExportFromCjs(screenfullExports);
|
|
3395
3406
|
|
|
3396
|
-
function asyncGeneratorStep$
|
|
3407
|
+
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3397
3408
|
try {
|
|
3398
3409
|
var info = gen[key](arg);
|
|
3399
3410
|
var value = info.value;
|
|
@@ -3407,22 +3418,22 @@
|
|
|
3407
3418
|
Promise.resolve(value).then(_next, _throw);
|
|
3408
3419
|
}
|
|
3409
3420
|
}
|
|
3410
|
-
function _async_to_generator$
|
|
3421
|
+
function _async_to_generator$6(fn) {
|
|
3411
3422
|
return function() {
|
|
3412
3423
|
var self = this, args = arguments;
|
|
3413
3424
|
return new Promise(function(resolve, reject) {
|
|
3414
3425
|
var gen = fn.apply(self, args);
|
|
3415
3426
|
function _next(value) {
|
|
3416
|
-
asyncGeneratorStep$
|
|
3427
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
3417
3428
|
}
|
|
3418
3429
|
function _throw(err) {
|
|
3419
|
-
asyncGeneratorStep$
|
|
3430
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3420
3431
|
}
|
|
3421
3432
|
_next(undefined);
|
|
3422
3433
|
});
|
|
3423
3434
|
};
|
|
3424
3435
|
}
|
|
3425
|
-
function _ts_generator$
|
|
3436
|
+
function _ts_generator$6(thisArg, body) {
|
|
3426
3437
|
var f, y, t, _ = {
|
|
3427
3438
|
label: 0,
|
|
3428
3439
|
sent: function() {
|
|
@@ -3636,8 +3647,8 @@
|
|
|
3636
3647
|
* 全屏
|
|
3637
3648
|
* @returns Promise<void>
|
|
3638
3649
|
*/ _proto.fullscreen = function fullscreen() {
|
|
3639
|
-
return _async_to_generator$
|
|
3640
|
-
return _ts_generator$
|
|
3650
|
+
return _async_to_generator$6(function() {
|
|
3651
|
+
return _ts_generator$6(this, function(_state) {
|
|
3641
3652
|
switch(_state.label){
|
|
3642
3653
|
case 0:
|
|
3643
3654
|
if (!Utils.isMobile) return [
|
|
@@ -3672,8 +3683,8 @@
|
|
|
3672
3683
|
* 退出全屏
|
|
3673
3684
|
* @returns Promise<void>
|
|
3674
3685
|
*/ _proto.exitFullscreen = function exitFullscreen() {
|
|
3675
|
-
return _async_to_generator$
|
|
3676
|
-
return _ts_generator$
|
|
3686
|
+
return _async_to_generator$6(function() {
|
|
3687
|
+
return _ts_generator$6(this, function(_state) {
|
|
3677
3688
|
switch(_state.label){
|
|
3678
3689
|
case 0:
|
|
3679
3690
|
if (!Utils.isMobile) return [
|
|
@@ -3712,8 +3723,8 @@
|
|
|
3712
3723
|
* 全屏切换
|
|
3713
3724
|
* @returns Promise<void>
|
|
3714
3725
|
*/ _proto.toggle = function toggle() {
|
|
3715
|
-
return _async_to_generator$
|
|
3716
|
-
return _ts_generator$
|
|
3726
|
+
return _async_to_generator$6(function() {
|
|
3727
|
+
return _ts_generator$6(this, function(_state) {
|
|
3717
3728
|
switch(_state.label){
|
|
3718
3729
|
case 0:
|
|
3719
3730
|
if (!Utils.isMobile) return [
|
|
@@ -3836,8 +3847,8 @@
|
|
|
3836
3847
|
return Fullscreen;
|
|
3837
3848
|
}();
|
|
3838
3849
|
|
|
3839
|
-
function _extends$
|
|
3840
|
-
_extends$
|
|
3850
|
+
function _extends$m() {
|
|
3851
|
+
_extends$m = Object.assign || function(target) {
|
|
3841
3852
|
for(var i = 1; i < arguments.length; i++){
|
|
3842
3853
|
var source = arguments[i];
|
|
3843
3854
|
for(var key in source){
|
|
@@ -3848,9 +3859,9 @@
|
|
|
3848
3859
|
}
|
|
3849
3860
|
return target;
|
|
3850
3861
|
};
|
|
3851
|
-
return _extends$
|
|
3862
|
+
return _extends$m.apply(this, arguments);
|
|
3852
3863
|
}
|
|
3853
|
-
function _inherits$
|
|
3864
|
+
function _inherits$m(subClass, superClass) {
|
|
3854
3865
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3855
3866
|
throw new TypeError("Super expression must either be null or a function");
|
|
3856
3867
|
}
|
|
@@ -3861,24 +3872,24 @@
|
|
|
3861
3872
|
configurable: true
|
|
3862
3873
|
}
|
|
3863
3874
|
});
|
|
3864
|
-
if (superClass) _set_prototype_of$
|
|
3875
|
+
if (superClass) _set_prototype_of$m(subClass, superClass);
|
|
3865
3876
|
}
|
|
3866
|
-
function _set_prototype_of$
|
|
3867
|
-
_set_prototype_of$
|
|
3877
|
+
function _set_prototype_of$m(o, p) {
|
|
3878
|
+
_set_prototype_of$m = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3868
3879
|
o.__proto__ = p;
|
|
3869
3880
|
return o;
|
|
3870
3881
|
};
|
|
3871
|
-
return _set_prototype_of$
|
|
3882
|
+
return _set_prototype_of$m(o, p);
|
|
3872
3883
|
}
|
|
3873
3884
|
/**
|
|
3874
3885
|
* 全屏控件
|
|
3875
3886
|
* @category Control
|
|
3876
3887
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
3877
|
-
_inherits$
|
|
3888
|
+
_inherits$m(Fullscreen, Control);
|
|
3878
3889
|
function Fullscreen(options) {
|
|
3879
3890
|
var _this;
|
|
3880
3891
|
var _options_props, _this_options;
|
|
3881
|
-
_this = Control.call(this, _extends$
|
|
3892
|
+
_this = Control.call(this, _extends$m({
|
|
3882
3893
|
tagName: 'span',
|
|
3883
3894
|
classNameSuffix: 'fullscreen',
|
|
3884
3895
|
controlType: 'button'
|
|
@@ -3943,8 +3954,8 @@
|
|
|
3943
3954
|
return Fullscreen;
|
|
3944
3955
|
}(Control);
|
|
3945
3956
|
|
|
3946
|
-
function _extends$
|
|
3947
|
-
_extends$
|
|
3957
|
+
function _extends$l() {
|
|
3958
|
+
_extends$l = Object.assign || function(target) {
|
|
3948
3959
|
for(var i = 1; i < arguments.length; i++){
|
|
3949
3960
|
var source = arguments[i];
|
|
3950
3961
|
for(var key in source){
|
|
@@ -3955,9 +3966,9 @@
|
|
|
3955
3966
|
}
|
|
3956
3967
|
return target;
|
|
3957
3968
|
};
|
|
3958
|
-
return _extends$
|
|
3969
|
+
return _extends$l.apply(this, arguments);
|
|
3959
3970
|
}
|
|
3960
|
-
function _inherits$
|
|
3971
|
+
function _inherits$l(subClass, superClass) {
|
|
3961
3972
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3962
3973
|
throw new TypeError("Super expression must either be null or a function");
|
|
3963
3974
|
}
|
|
@@ -3968,24 +3979,24 @@
|
|
|
3968
3979
|
configurable: true
|
|
3969
3980
|
}
|
|
3970
3981
|
});
|
|
3971
|
-
if (superClass) _set_prototype_of$
|
|
3982
|
+
if (superClass) _set_prototype_of$l(subClass, superClass);
|
|
3972
3983
|
}
|
|
3973
|
-
function _set_prototype_of$
|
|
3974
|
-
_set_prototype_of$
|
|
3984
|
+
function _set_prototype_of$l(o, p) {
|
|
3985
|
+
_set_prototype_of$l = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3975
3986
|
o.__proto__ = p;
|
|
3976
3987
|
return o;
|
|
3977
3988
|
};
|
|
3978
|
-
return _set_prototype_of$
|
|
3989
|
+
return _set_prototype_of$l(o, p);
|
|
3979
3990
|
}
|
|
3980
3991
|
/**
|
|
3981
3992
|
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
3982
3993
|
* @category Control
|
|
3983
3994
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
3984
|
-
_inherits$
|
|
3995
|
+
_inherits$l(Rec, Control);
|
|
3985
3996
|
function Rec(options) {
|
|
3986
3997
|
var _this;
|
|
3987
3998
|
var _options_props;
|
|
3988
|
-
_this = Control.call(this, _extends$
|
|
3999
|
+
_this = Control.call(this, _extends$l({}, options, {
|
|
3989
4000
|
tagName: 'div',
|
|
3990
4001
|
controlType: 'block',
|
|
3991
4002
|
classNameSuffix: 'rec'
|
|
@@ -4058,7 +4069,7 @@
|
|
|
4058
4069
|
};
|
|
4059
4070
|
_proto._onClickIcon = function _onClickIcon() {
|
|
4060
4071
|
var _this = this;
|
|
4061
|
-
this._delegation = delegate
|
|
4072
|
+
this._delegation = delegate(this.$container, "." + PREFIX_CLASS + "-icon", 'click', function(e) {
|
|
4062
4073
|
var target = e.delegateTarget;
|
|
4063
4074
|
if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
4064
4075
|
var type = target.getAttribute('data-type');
|
|
@@ -4077,13 +4088,13 @@
|
|
|
4077
4088
|
return Rec;
|
|
4078
4089
|
}(Control);
|
|
4079
4090
|
|
|
4080
|
-
var dist$
|
|
4091
|
+
var dist$6 = {exports: {}};
|
|
4081
4092
|
|
|
4082
|
-
var hasRequiredDist$
|
|
4093
|
+
var hasRequiredDist$6;
|
|
4083
4094
|
|
|
4084
|
-
function requireDist$
|
|
4085
|
-
if (hasRequiredDist$
|
|
4086
|
-
hasRequiredDist$
|
|
4095
|
+
function requireDist$6 () {
|
|
4096
|
+
if (hasRequiredDist$6) return dist$6.exports;
|
|
4097
|
+
hasRequiredDist$6 = 1;
|
|
4087
4098
|
|
|
4088
4099
|
var deepmerge = requireCjs();
|
|
4089
4100
|
|
|
@@ -4155,19 +4166,19 @@
|
|
|
4155
4166
|
} ]), I18n;
|
|
4156
4167
|
}();
|
|
4157
4168
|
|
|
4158
|
-
I18n.VERSION = "2.0.0", dist$
|
|
4159
|
-
return dist$
|
|
4169
|
+
I18n.VERSION = "2.0.0", dist$6.exports = I18n;
|
|
4170
|
+
return dist$6.exports;
|
|
4160
4171
|
}
|
|
4161
4172
|
|
|
4162
|
-
var distExports$5 = requireDist$
|
|
4173
|
+
var distExports$5 = requireDist$6();
|
|
4163
4174
|
var I18n = /*@__PURE__*/getDefaultExportFromCjs(distExports$5);
|
|
4164
4175
|
|
|
4165
|
-
var dist$
|
|
4166
|
-
var hasRequiredDist$
|
|
4176
|
+
var dist$5;
|
|
4177
|
+
var hasRequiredDist$5;
|
|
4167
4178
|
|
|
4168
|
-
function requireDist$
|
|
4169
|
-
if (hasRequiredDist$
|
|
4170
|
-
hasRequiredDist$
|
|
4179
|
+
function requireDist$5 () {
|
|
4180
|
+
if (hasRequiredDist$5) return dist$5;
|
|
4181
|
+
hasRequiredDist$5 = 1;
|
|
4171
4182
|
|
|
4172
4183
|
var _$LoggerStyle$_ = {
|
|
4173
4184
|
info: "",
|
|
@@ -4232,7 +4243,7 @@
|
|
|
4232
4243
|
|
|
4233
4244
|
var __$list$__ = [ "info", "log", "warn", "error" ];
|
|
4234
4245
|
|
|
4235
|
-
dist$
|
|
4246
|
+
dist$5 = function(options) {
|
|
4236
4247
|
var logger = new LoggerCls(options);
|
|
4237
4248
|
return new Proxy(logger, {
|
|
4238
4249
|
get: function(target, prop) {
|
|
@@ -4251,10 +4262,10 @@
|
|
|
4251
4262
|
}
|
|
4252
4263
|
});
|
|
4253
4264
|
};
|
|
4254
|
-
return dist$
|
|
4265
|
+
return dist$5;
|
|
4255
4266
|
}
|
|
4256
4267
|
|
|
4257
|
-
var distExports$4 = requireDist$
|
|
4268
|
+
var distExports$4 = requireDist$5();
|
|
4258
4269
|
var Logger = /*@__PURE__*/getDefaultExportFromCjs(distExports$4);
|
|
4259
4270
|
|
|
4260
4271
|
var zh = {
|
|
@@ -4440,6 +4451,7 @@
|
|
|
4440
4451
|
BTN_RECORDVIDEO: '录屏',
|
|
4441
4452
|
BTN_CAPTURE: '截图',
|
|
4442
4453
|
BTN_TALK: '对讲',
|
|
4454
|
+
BTN_BROADCAST: '语音广播',
|
|
4443
4455
|
BTN_ZOOM: '电子放大',
|
|
4444
4456
|
BTN_3D_ZOOM: '3D定位',
|
|
4445
4457
|
BTN_PTZ: '云台控制',
|
|
@@ -4710,6 +4722,7 @@
|
|
|
4710
4722
|
BTN_RECORDVIDEO: 'Screen recording',
|
|
4711
4723
|
BTN_CAPTURE: 'Screenshot',
|
|
4712
4724
|
BTN_TALK: 'Intercom',
|
|
4725
|
+
BTN_BROADCAST: 'Voice broadcast',
|
|
4713
4726
|
BTN_ZOOM: 'Electronic zoom',
|
|
4714
4727
|
BTN_3D_ZOOM: '3D positioning',
|
|
4715
4728
|
BTN_PTZ: 'PTZ control',
|
|
@@ -4896,6 +4909,11 @@
|
|
|
4896
4909
|
part: 'left',
|
|
4897
4910
|
isrender: 1
|
|
4898
4911
|
},
|
|
4912
|
+
{
|
|
4913
|
+
iconId: 'broadcast',
|
|
4914
|
+
part: 'left',
|
|
4915
|
+
isrender: 1
|
|
4916
|
+
},
|
|
4899
4917
|
{
|
|
4900
4918
|
iconId: 'zoom',
|
|
4901
4919
|
part: 'left',
|
|
@@ -5082,6 +5100,12 @@
|
|
|
5082
5100
|
defaultActive: 0,
|
|
5083
5101
|
isrender: 1
|
|
5084
5102
|
},
|
|
5103
|
+
{
|
|
5104
|
+
iconId: 'broadcast',
|
|
5105
|
+
part: 'left',
|
|
5106
|
+
defaultActive: 0,
|
|
5107
|
+
isrender: 1
|
|
5108
|
+
},
|
|
5085
5109
|
{
|
|
5086
5110
|
iconId: 'zoom',
|
|
5087
5111
|
part: 'left',
|
|
@@ -5337,7 +5361,7 @@
|
|
|
5337
5361
|
voice: voice
|
|
5338
5362
|
};
|
|
5339
5363
|
|
|
5340
|
-
function _inherits$
|
|
5364
|
+
function _inherits$k(subClass, superClass) {
|
|
5341
5365
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5342
5366
|
throw new TypeError("Super expression must either be null or a function");
|
|
5343
5367
|
}
|
|
@@ -5348,23 +5372,23 @@
|
|
|
5348
5372
|
configurable: true
|
|
5349
5373
|
}
|
|
5350
5374
|
});
|
|
5351
|
-
if (superClass) _set_prototype_of$
|
|
5375
|
+
if (superClass) _set_prototype_of$k(subClass, superClass);
|
|
5352
5376
|
}
|
|
5353
|
-
function _set_prototype_of$
|
|
5354
|
-
_set_prototype_of$
|
|
5377
|
+
function _set_prototype_of$k(o, p) {
|
|
5378
|
+
_set_prototype_of$k = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5355
5379
|
o.__proto__ = p;
|
|
5356
5380
|
return o;
|
|
5357
5381
|
};
|
|
5358
|
-
return _set_prototype_of$
|
|
5382
|
+
return _set_prototype_of$k(o, p);
|
|
5359
5383
|
}
|
|
5360
5384
|
/**
|
|
5361
5385
|
* 截图控件
|
|
5362
5386
|
* @category Content
|
|
5363
5387
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
5364
|
-
_inherits$
|
|
5388
|
+
_inherits$k(Content, EventEmitter);
|
|
5365
5389
|
function Content(options) {
|
|
5366
5390
|
var _this;
|
|
5367
|
-
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
5391
|
+
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
5368
5392
|
_this.options = options;
|
|
5369
5393
|
_this._scaleMode = options.scaleMode || 0;
|
|
5370
5394
|
_this.$wrapper = document.createElement('div');
|
|
@@ -5380,11 +5404,12 @@
|
|
|
5380
5404
|
$popupContainer.appendChild(_this.$wrapper);
|
|
5381
5405
|
}
|
|
5382
5406
|
_this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
|
|
5383
|
-
_this.
|
|
5384
|
-
});
|
|
5385
|
-
_this.on(EVENTS.resize, function() {
|
|
5386
|
-
_this._rerender();
|
|
5407
|
+
_this.rerender(originWidth, originHeight);
|
|
5387
5408
|
});
|
|
5409
|
+
// prettier-ignore
|
|
5410
|
+
_this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
|
|
5411
|
+
_this.rerender();
|
|
5412
|
+
}, 20));
|
|
5388
5413
|
return _this;
|
|
5389
5414
|
}
|
|
5390
5415
|
var _proto = Content.prototype;
|
|
@@ -5393,7 +5418,7 @@
|
|
|
5393
5418
|
* @param {number} originWidth 画面宽度
|
|
5394
5419
|
* @param {number} originHeight 画面高度
|
|
5395
5420
|
* @returns {void}
|
|
5396
|
-
*/ _proto.
|
|
5421
|
+
*/ _proto.rerender = function rerender(originWidth, originHeight) {
|
|
5397
5422
|
if (originWidth === void 0) originWidth = 0;
|
|
5398
5423
|
if (originHeight === void 0) originHeight = 0;
|
|
5399
5424
|
var width = this.$wrapper.clientWidth;
|
|
@@ -5417,6 +5442,7 @@
|
|
|
5417
5442
|
if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
|
|
5418
5443
|
objectFill = 'cover';
|
|
5419
5444
|
}
|
|
5445
|
+
//
|
|
5420
5446
|
if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
|
|
5421
5447
|
var left = (width - this._originWidth) / 2;
|
|
5422
5448
|
var top = (height - this._originHeight) / 2;
|
|
@@ -5446,10 +5472,15 @@
|
|
|
5446
5472
|
_proto.setScaleMode = function setScaleMode(scaleMode) {
|
|
5447
5473
|
if (scaleMode === void 0) scaleMode = 0;
|
|
5448
5474
|
this._scaleMode = scaleMode;
|
|
5449
|
-
this.
|
|
5475
|
+
this.rerender();
|
|
5450
5476
|
};
|
|
5451
5477
|
_proto.destroy = function destroy() {
|
|
5452
5478
|
var _this_$wrapper;
|
|
5479
|
+
if (this._cleanUpResizeObserver) {
|
|
5480
|
+
this._cleanUpResizeObserver.unobserve();
|
|
5481
|
+
// this._cleanUpResizeObserver.disconnect();
|
|
5482
|
+
this._cleanUpResizeObserver = null;
|
|
5483
|
+
}
|
|
5453
5484
|
if (this.$video) {
|
|
5454
5485
|
this.$video.remove();
|
|
5455
5486
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -5469,8 +5500,8 @@
|
|
|
5469
5500
|
return Content;
|
|
5470
5501
|
}(EventEmitter);
|
|
5471
5502
|
|
|
5472
|
-
function _extends$
|
|
5473
|
-
_extends$
|
|
5503
|
+
function _extends$k() {
|
|
5504
|
+
_extends$k = Object.assign || function(target) {
|
|
5474
5505
|
for(var i = 1; i < arguments.length; i++){
|
|
5475
5506
|
var source = arguments[i];
|
|
5476
5507
|
for(var key in source){
|
|
@@ -5481,9 +5512,9 @@
|
|
|
5481
5512
|
}
|
|
5482
5513
|
return target;
|
|
5483
5514
|
};
|
|
5484
|
-
return _extends$
|
|
5515
|
+
return _extends$k.apply(this, arguments);
|
|
5485
5516
|
}
|
|
5486
|
-
function _inherits$
|
|
5517
|
+
function _inherits$j(subClass, superClass) {
|
|
5487
5518
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5488
5519
|
throw new TypeError("Super expression must either be null or a function");
|
|
5489
5520
|
}
|
|
@@ -5494,23 +5525,23 @@
|
|
|
5494
5525
|
configurable: true
|
|
5495
5526
|
}
|
|
5496
5527
|
});
|
|
5497
|
-
if (superClass) _set_prototype_of$
|
|
5528
|
+
if (superClass) _set_prototype_of$j(subClass, superClass);
|
|
5498
5529
|
}
|
|
5499
|
-
function _set_prototype_of$
|
|
5500
|
-
_set_prototype_of$
|
|
5530
|
+
function _set_prototype_of$j(o, p) {
|
|
5531
|
+
_set_prototype_of$j = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5501
5532
|
o.__proto__ = p;
|
|
5502
5533
|
return o;
|
|
5503
5534
|
};
|
|
5504
|
-
return _set_prototype_of$
|
|
5535
|
+
return _set_prototype_of$j(o, p);
|
|
5505
5536
|
}
|
|
5506
5537
|
/**
|
|
5507
5538
|
* 更多控件
|
|
5508
5539
|
* @category Control
|
|
5509
5540
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
5510
|
-
_inherits$
|
|
5541
|
+
_inherits$j(More, Control);
|
|
5511
5542
|
function More(options) {
|
|
5512
5543
|
var _this;
|
|
5513
|
-
_this = Control.call(this, _extends$
|
|
5544
|
+
_this = Control.call(this, _extends$k({}, options, {
|
|
5514
5545
|
tagName: 'span',
|
|
5515
5546
|
controlType: 'button',
|
|
5516
5547
|
classNameSuffix: 'more'
|
|
@@ -5554,11 +5585,13 @@
|
|
|
5554
5585
|
/**
|
|
5555
5586
|
* 添加
|
|
5556
5587
|
* @param control
|
|
5557
|
-
*/ _proto.add = function add(key, part, control) {
|
|
5588
|
+
*/ _proto.add = function add(key, part, control, props) {
|
|
5558
5589
|
this.list.unshift({
|
|
5559
5590
|
part: part,
|
|
5560
5591
|
key: key,
|
|
5561
|
-
control: control
|
|
5592
|
+
control: control,
|
|
5593
|
+
width: props.width,
|
|
5594
|
+
height: props.height
|
|
5562
5595
|
});
|
|
5563
5596
|
};
|
|
5564
5597
|
/**
|
|
@@ -5704,6 +5737,16 @@
|
|
|
5704
5737
|
(_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls.talkControl) == null ? void 0 : (_theme_controls_talkControl_emit = _theme_controls_talkControl.emit) == null ? void 0 : _theme_controls_talkControl_emit.call(_theme_controls_talkControl, EVENTS.talkVolumeChange, value);
|
|
5705
5738
|
});
|
|
5706
5739
|
// =======================================================
|
|
5740
|
+
// 语音广播
|
|
5741
|
+
// =======================================================
|
|
5742
|
+
theme.on(EVENTS.broadcastChange, function(active) {
|
|
5743
|
+
var _theme_controls, _theme_controls_broadcastControl, _theme_controls1;
|
|
5744
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.broadcastControl) && active !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_broadcastControl = _theme_controls1.broadcastControl) == null ? void 0 : _theme_controls_broadcastControl.active)) {
|
|
5745
|
+
var _theme_controls_broadcastControl1, _theme_controls2;
|
|
5746
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_broadcastControl1 = _theme_controls2.broadcastControl) == null ? void 0 : _theme_controls_broadcastControl1.emit(EVENTS.broadcastChange, active);
|
|
5747
|
+
}
|
|
5748
|
+
});
|
|
5749
|
+
// =======================================================
|
|
5707
5750
|
// 录制
|
|
5708
5751
|
// =======================================================
|
|
5709
5752
|
theme.on(EVENTS.recordingChange, function(recording) {
|
|
@@ -5799,7 +5842,7 @@
|
|
|
5799
5842
|
*
|
|
5800
5843
|
* @param theme - Theme
|
|
5801
5844
|
*/ function _controlEventemitter(theme) {
|
|
5802
|
-
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14;
|
|
5845
|
+
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14, _theme_controls15;
|
|
5803
5846
|
// Controls
|
|
5804
5847
|
if (theme._recFooter) {
|
|
5805
5848
|
theme._recFooter.on(EVENTS.theme.recFooterDestroy, function() {
|
|
@@ -5892,8 +5935,17 @@
|
|
|
5892
5935
|
theme.emit(EVENTS.control.talkDestroy);
|
|
5893
5936
|
});
|
|
5894
5937
|
}
|
|
5938
|
+
// 语音广播控件
|
|
5939
|
+
if ((_theme_controls5 = theme.controls) == null ? void 0 : _theme_controls5.broadcastControl) {
|
|
5940
|
+
theme.controls.broadcastControl.on(EVENTS.control.broadcastChange, function(active) {
|
|
5941
|
+
theme.emit(EVENTS.control.broadcastChange, active);
|
|
5942
|
+
});
|
|
5943
|
+
theme.controls.broadcastControl.on(EVENTS.control.broadcastDestroy, function() {
|
|
5944
|
+
theme.emit(EVENTS.control.broadcastDestroy);
|
|
5945
|
+
});
|
|
5946
|
+
}
|
|
5895
5947
|
// 缩放控件
|
|
5896
|
-
if ((
|
|
5948
|
+
if ((_theme_controls6 = theme.controls) == null ? void 0 : _theme_controls6.zoomControl) {
|
|
5897
5949
|
theme.controls.zoomControl.on(EVENTS.control.zoomChange, function(value, _percent, _range) {
|
|
5898
5950
|
if (theme.zoom !== value) {
|
|
5899
5951
|
theme.zoom = value;
|
|
@@ -5915,7 +5967,7 @@
|
|
|
5915
5967
|
});
|
|
5916
5968
|
}
|
|
5917
5969
|
// 清晰度控件
|
|
5918
|
-
if ((
|
|
5970
|
+
if ((_theme_controls7 = theme.controls) == null ? void 0 : _theme_controls7.definitionControl) {
|
|
5919
5971
|
theme.controls.definitionControl.on(EVENTS.control.definitionPanelOpenChange, function(open, definition, item) {
|
|
5920
5972
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, definition);
|
|
5921
5973
|
theme.emit(EVENTS.control.definitionPanelOpenChange, open, definition, item);
|
|
@@ -5928,7 +5980,7 @@
|
|
|
5928
5980
|
});
|
|
5929
5981
|
}
|
|
5930
5982
|
// 倍速控件
|
|
5931
|
-
if ((
|
|
5983
|
+
if ((_theme_controls8 = theme.controls) == null ? void 0 : _theme_controls8.speedControl) {
|
|
5932
5984
|
theme.controls.speedControl.on(EVENTS.control.speedPanelOpenChange, function(open, speed, item) {
|
|
5933
5985
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, speed);
|
|
5934
5986
|
theme.emit(EVENTS.control.speedPanelOpenChange, open, speed, item);
|
|
@@ -5941,7 +5993,7 @@
|
|
|
5941
5993
|
});
|
|
5942
5994
|
}
|
|
5943
5995
|
// 截图控件
|
|
5944
|
-
if ((
|
|
5996
|
+
if ((_theme_controls9 = theme.controls) == null ? void 0 : _theme_controls9.capturePictureControl) {
|
|
5945
5997
|
theme.controls.capturePictureControl.on(EVENTS.control.capturePicture, function(options) {
|
|
5946
5998
|
theme.emit(EVENTS.control.capturePicture, options);
|
|
5947
5999
|
});
|
|
@@ -5950,25 +6002,25 @@
|
|
|
5950
6002
|
});
|
|
5951
6003
|
}
|
|
5952
6004
|
// 全屏控件
|
|
5953
|
-
if ((
|
|
6005
|
+
if ((_theme_controls10 = theme.controls) == null ? void 0 : _theme_controls10.fullscreenControl) {
|
|
5954
6006
|
theme.controls.fullscreenControl.on(EVENTS.control.fullscreenDestroy, function() {
|
|
5955
6007
|
theme.emit(EVENTS.control.fullscreenDestroy);
|
|
5956
6008
|
});
|
|
5957
6009
|
}
|
|
5958
6010
|
// 全局全屏控件
|
|
5959
|
-
if ((
|
|
6011
|
+
if ((_theme_controls11 = theme.controls) == null ? void 0 : _theme_controls11.globalFullscreenControl) {
|
|
5960
6012
|
theme.controls.globalFullscreenControl.on(EVENTS.control.globalFullscreenDestroy, function() {
|
|
5961
6013
|
theme.emit(EVENTS.control.globalFullscreenDestroy);
|
|
5962
6014
|
});
|
|
5963
6015
|
}
|
|
5964
6016
|
// 设备信息控件
|
|
5965
|
-
if ((
|
|
6017
|
+
if ((_theme_controls12 = theme.controls) == null ? void 0 : _theme_controls12.deviceControl) {
|
|
5966
6018
|
theme.controls.deviceControl.on(EVENTS.control.deviceDestroy, function() {
|
|
5967
6019
|
theme.emit(EVENTS.control.deviceDestroy);
|
|
5968
6020
|
});
|
|
5969
6021
|
}
|
|
5970
6022
|
// 回放类型切换控件
|
|
5971
|
-
if ((
|
|
6023
|
+
if ((_theme_controls13 = theme.controls) == null ? void 0 : _theme_controls13.recControl) {
|
|
5972
6024
|
// prettier-ignore
|
|
5973
6025
|
theme.controls.recControl.on(EVENTS.control.recTypeChange, function(type) {
|
|
5974
6026
|
if (theme.recType !== type) {
|
|
@@ -5989,7 +6041,7 @@
|
|
|
5989
6041
|
});
|
|
5990
6042
|
}
|
|
5991
6043
|
// 时间轴控件
|
|
5992
|
-
if ((
|
|
6044
|
+
if ((_theme_controls14 = theme.controls) == null ? void 0 : _theme_controls14.timeLineControl) {
|
|
5993
6045
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineChange, function(date) {
|
|
5994
6046
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
5995
6047
|
});
|
|
@@ -6006,7 +6058,7 @@
|
|
|
6006
6058
|
});
|
|
6007
6059
|
}
|
|
6008
6060
|
// 日历控件
|
|
6009
|
-
if ((
|
|
6061
|
+
if ((_theme_controls15 = theme.controls) == null ? void 0 : _theme_controls15.dateControl) {
|
|
6010
6062
|
theme.controls.dateControl.on(EVENTS.control.datePanelOpenChange, function(open, date) {
|
|
6011
6063
|
theme.emit(EVENTS.control.datePanelOpenChange, open, date);
|
|
6012
6064
|
});
|
|
@@ -6017,12 +6069,6 @@
|
|
|
6017
6069
|
theme.emit(EVENTS.control.recDestroy);
|
|
6018
6070
|
});
|
|
6019
6071
|
}
|
|
6020
|
-
// content
|
|
6021
|
-
if (theme.contentControl) {
|
|
6022
|
-
theme.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
6023
|
-
theme.emit(EVENTS.control.contentRerender, info);
|
|
6024
|
-
});
|
|
6025
|
-
}
|
|
6026
6072
|
}
|
|
6027
6073
|
var ignoreList = [
|
|
6028
6074
|
EVENTS.getOSDTime,
|
|
@@ -6107,8 +6153,8 @@
|
|
|
6107
6153
|
if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
|
|
6108
6154
|
return Constructor;
|
|
6109
6155
|
}
|
|
6110
|
-
function _extends$
|
|
6111
|
-
_extends$
|
|
6156
|
+
function _extends$j() {
|
|
6157
|
+
_extends$j = Object.assign || function(target) {
|
|
6112
6158
|
for(var i = 1; i < arguments.length; i++){
|
|
6113
6159
|
var source = arguments[i];
|
|
6114
6160
|
for(var key in source){
|
|
@@ -6119,9 +6165,9 @@
|
|
|
6119
6165
|
}
|
|
6120
6166
|
return target;
|
|
6121
6167
|
};
|
|
6122
|
-
return _extends$
|
|
6168
|
+
return _extends$j.apply(this, arguments);
|
|
6123
6169
|
}
|
|
6124
|
-
function _inherits$
|
|
6170
|
+
function _inherits$i(subClass, superClass) {
|
|
6125
6171
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6126
6172
|
throw new TypeError("Super expression must either be null or a function");
|
|
6127
6173
|
}
|
|
@@ -6132,14 +6178,14 @@
|
|
|
6132
6178
|
configurable: true
|
|
6133
6179
|
}
|
|
6134
6180
|
});
|
|
6135
|
-
if (superClass) _set_prototype_of$
|
|
6181
|
+
if (superClass) _set_prototype_of$i(subClass, superClass);
|
|
6136
6182
|
}
|
|
6137
|
-
function _set_prototype_of$
|
|
6138
|
-
_set_prototype_of$
|
|
6183
|
+
function _set_prototype_of$i(o, p) {
|
|
6184
|
+
_set_prototype_of$i = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6139
6185
|
o.__proto__ = p;
|
|
6140
6186
|
return o;
|
|
6141
6187
|
};
|
|
6142
|
-
return _set_prototype_of$
|
|
6188
|
+
return _set_prototype_of$i(o, p);
|
|
6143
6189
|
}
|
|
6144
6190
|
var ZOOM_DEFAULT_OPTIONS = {
|
|
6145
6191
|
open: false,
|
|
@@ -6149,10 +6195,10 @@
|
|
|
6149
6195
|
* 电子放大控件
|
|
6150
6196
|
* @category Control
|
|
6151
6197
|
*/ var Zoom$1 = /*#__PURE__*/ function(Control) {
|
|
6152
|
-
_inherits$
|
|
6198
|
+
_inherits$i(Zoom, Control);
|
|
6153
6199
|
function Zoom(options) {
|
|
6154
6200
|
var _this;
|
|
6155
|
-
_this = Control.call(this, _extends$
|
|
6201
|
+
_this = Control.call(this, _extends$j({}, options, {
|
|
6156
6202
|
tagName: 'span',
|
|
6157
6203
|
controlType: 'button',
|
|
6158
6204
|
classNameSuffix: 'zoom'
|
|
@@ -6286,12 +6332,12 @@
|
|
|
6286
6332
|
* Released under the MIT License.
|
|
6287
6333
|
*/
|
|
6288
6334
|
|
|
6289
|
-
var dist$
|
|
6290
|
-
var hasRequiredDist$
|
|
6335
|
+
var dist$4;
|
|
6336
|
+
var hasRequiredDist$4;
|
|
6291
6337
|
|
|
6292
|
-
function requireDist$
|
|
6293
|
-
if (hasRequiredDist$
|
|
6294
|
-
hasRequiredDist$
|
|
6338
|
+
function requireDist$4 () {
|
|
6339
|
+
if (hasRequiredDist$4) return dist$4;
|
|
6340
|
+
hasRequiredDist$4 = 1;
|
|
6295
6341
|
|
|
6296
6342
|
/**
|
|
6297
6343
|
* Zoom position
|
|
@@ -6998,15 +7044,15 @@
|
|
|
6998
7044
|
}();
|
|
6999
7045
|
Zoom.VERSION = '0.0.2';
|
|
7000
7046
|
|
|
7001
|
-
dist$
|
|
7002
|
-
return dist$
|
|
7047
|
+
dist$4 = Zoom;
|
|
7048
|
+
return dist$4;
|
|
7003
7049
|
}
|
|
7004
7050
|
|
|
7005
|
-
var distExports$3 = requireDist$
|
|
7051
|
+
var distExports$3 = requireDist$4();
|
|
7006
7052
|
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$3);
|
|
7007
7053
|
|
|
7008
|
-
function _extends$
|
|
7009
|
-
_extends$
|
|
7054
|
+
function _extends$i() {
|
|
7055
|
+
_extends$i = Object.assign || function(target) {
|
|
7010
7056
|
for(var i = 1; i < arguments.length; i++){
|
|
7011
7057
|
var source = arguments[i];
|
|
7012
7058
|
for(var key in source){
|
|
@@ -7017,10 +7063,10 @@
|
|
|
7017
7063
|
}
|
|
7018
7064
|
return target;
|
|
7019
7065
|
};
|
|
7020
|
-
return _extends$
|
|
7066
|
+
return _extends$i.apply(this, arguments);
|
|
7021
7067
|
}
|
|
7022
7068
|
function __zoom(theme, container, options) {
|
|
7023
|
-
theme.zoomUtil = new Zoom(container, _extends$
|
|
7069
|
+
theme.zoomUtil = new Zoom(container, _extends$i({}, options || {}, {
|
|
7024
7070
|
min: 1,
|
|
7025
7071
|
onChange: function(zoom, reset) {
|
|
7026
7072
|
if (zoom !== theme._zoom) {
|
|
@@ -7038,7 +7084,7 @@
|
|
|
7038
7084
|
}));
|
|
7039
7085
|
}
|
|
7040
7086
|
|
|
7041
|
-
function asyncGeneratorStep$
|
|
7087
|
+
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7042
7088
|
try {
|
|
7043
7089
|
var info = gen[key](arg);
|
|
7044
7090
|
var value = info.value;
|
|
@@ -7052,22 +7098,22 @@
|
|
|
7052
7098
|
Promise.resolve(value).then(_next, _throw);
|
|
7053
7099
|
}
|
|
7054
7100
|
}
|
|
7055
|
-
function _async_to_generator$
|
|
7101
|
+
function _async_to_generator$5(fn) {
|
|
7056
7102
|
return function() {
|
|
7057
7103
|
var self = this, args = arguments;
|
|
7058
7104
|
return new Promise(function(resolve, reject) {
|
|
7059
7105
|
var gen = fn.apply(self, args);
|
|
7060
7106
|
function _next(value) {
|
|
7061
|
-
asyncGeneratorStep$
|
|
7107
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
7062
7108
|
}
|
|
7063
7109
|
function _throw(err) {
|
|
7064
|
-
asyncGeneratorStep$
|
|
7110
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7065
7111
|
}
|
|
7066
7112
|
_next(undefined);
|
|
7067
7113
|
});
|
|
7068
7114
|
};
|
|
7069
7115
|
}
|
|
7070
|
-
function _ts_generator$
|
|
7116
|
+
function _ts_generator$5(thisArg, body) {
|
|
7071
7117
|
var f, y, t, _ = {
|
|
7072
7118
|
label: 0,
|
|
7073
7119
|
sent: function() {
|
|
@@ -7159,9 +7205,9 @@
|
|
|
7159
7205
|
}
|
|
7160
7206
|
}
|
|
7161
7207
|
function getThemeDataByTemplate(theme, id) {
|
|
7162
|
-
return _async_to_generator$
|
|
7208
|
+
return _async_to_generator$5(function() {
|
|
7163
7209
|
var _theme_options_token_httpToken, _theme_options_token, url;
|
|
7164
|
-
return _ts_generator$
|
|
7210
|
+
return _ts_generator$5(this, function(_state) {
|
|
7165
7211
|
switch(_state.label){
|
|
7166
7212
|
case 0:
|
|
7167
7213
|
url = theme.options.env.domain + "/api/service/media/template/getDetail?accessToken=" + (theme.options.accessToken || ((_theme_options_token = theme.options.token) == null ? void 0 : (_theme_options_token_httpToken = _theme_options_token.httpToken) == null ? void 0 : _theme_options_token_httpToken.url)) + "&id=" + id;
|
|
@@ -7170,8 +7216,8 @@
|
|
|
7170
7216
|
fetch(url, {
|
|
7171
7217
|
method: 'GET'
|
|
7172
7218
|
}).then(function(response) {
|
|
7173
|
-
return _async_to_generator$
|
|
7174
|
-
return _ts_generator$
|
|
7219
|
+
return _async_to_generator$5(function() {
|
|
7220
|
+
return _ts_generator$5(this, function(_state) {
|
|
7175
7221
|
switch(_state.label){
|
|
7176
7222
|
case 0:
|
|
7177
7223
|
return [
|
|
@@ -7216,7 +7262,7 @@
|
|
|
7216
7262
|
})();
|
|
7217
7263
|
}
|
|
7218
7264
|
|
|
7219
|
-
function asyncGeneratorStep$
|
|
7265
|
+
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7220
7266
|
try {
|
|
7221
7267
|
var info = gen[key](arg);
|
|
7222
7268
|
var value = info.value;
|
|
@@ -7230,23 +7276,23 @@
|
|
|
7230
7276
|
Promise.resolve(value).then(_next, _throw);
|
|
7231
7277
|
}
|
|
7232
7278
|
}
|
|
7233
|
-
function _async_to_generator$
|
|
7279
|
+
function _async_to_generator$4(fn) {
|
|
7234
7280
|
return function() {
|
|
7235
7281
|
var self = this, args = arguments;
|
|
7236
7282
|
return new Promise(function(resolve, reject) {
|
|
7237
7283
|
var gen = fn.apply(self, args);
|
|
7238
7284
|
function _next(value) {
|
|
7239
|
-
asyncGeneratorStep$
|
|
7285
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
|
|
7240
7286
|
}
|
|
7241
7287
|
function _throw(err) {
|
|
7242
|
-
asyncGeneratorStep$
|
|
7288
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7243
7289
|
}
|
|
7244
7290
|
_next(undefined);
|
|
7245
7291
|
});
|
|
7246
7292
|
};
|
|
7247
7293
|
}
|
|
7248
|
-
function _extends$
|
|
7249
|
-
_extends$
|
|
7294
|
+
function _extends$h() {
|
|
7295
|
+
_extends$h = Object.assign || function(target) {
|
|
7250
7296
|
for(var i = 1; i < arguments.length; i++){
|
|
7251
7297
|
var source = arguments[i];
|
|
7252
7298
|
for(var key in source){
|
|
@@ -7257,9 +7303,9 @@
|
|
|
7257
7303
|
}
|
|
7258
7304
|
return target;
|
|
7259
7305
|
};
|
|
7260
|
-
return _extends$
|
|
7306
|
+
return _extends$h.apply(this, arguments);
|
|
7261
7307
|
}
|
|
7262
|
-
function _ts_generator$
|
|
7308
|
+
function _ts_generator$4(thisArg, body) {
|
|
7263
7309
|
var f, y, t, _ = {
|
|
7264
7310
|
label: 0,
|
|
7265
7311
|
sent: function() {
|
|
@@ -7385,7 +7431,7 @@
|
|
|
7385
7431
|
}
|
|
7386
7432
|
if (item.isrender === 1 && REC_GROUP.includes(item.iconId)) {
|
|
7387
7433
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7388
|
-
recControls.push(recControls[0] ? _extends$
|
|
7434
|
+
recControls.push(recControls[0] ? _extends$h({}, item, {
|
|
7389
7435
|
part: recControls[0].part
|
|
7390
7436
|
}) : item);
|
|
7391
7437
|
return false;
|
|
@@ -7408,7 +7454,7 @@
|
|
|
7408
7454
|
}
|
|
7409
7455
|
if (item.isrender === 1 && REC_GROUP.includes(item.iconId)) {
|
|
7410
7456
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7411
|
-
recControls.push(recControls[0] ? _extends$
|
|
7457
|
+
recControls.push(recControls[0] ? _extends$h({}, item, {
|
|
7412
7458
|
part: recControls[0].part
|
|
7413
7459
|
}) : item);
|
|
7414
7460
|
return false;
|
|
@@ -7470,9 +7516,9 @@
|
|
|
7470
7516
|
* @param data
|
|
7471
7517
|
* @returns
|
|
7472
7518
|
*/ function getThemeData(theme, data) {
|
|
7473
|
-
return _async_to_generator$
|
|
7519
|
+
return _async_to_generator$4(function() {
|
|
7474
7520
|
var themeData, _theme_logger, template;
|
|
7475
|
-
return _ts_generator$
|
|
7521
|
+
return _ts_generator$4(this, function(_state) {
|
|
7476
7522
|
switch(_state.label){
|
|
7477
7523
|
case 0:
|
|
7478
7524
|
themeData = data;
|
|
@@ -7663,8 +7709,8 @@
|
|
|
7663
7709
|
return Component;
|
|
7664
7710
|
}();
|
|
7665
7711
|
|
|
7666
|
-
function _extends$
|
|
7667
|
-
_extends$
|
|
7712
|
+
function _extends$g() {
|
|
7713
|
+
_extends$g = Object.assign || function(target) {
|
|
7668
7714
|
for(var i = 1; i < arguments.length; i++){
|
|
7669
7715
|
var source = arguments[i];
|
|
7670
7716
|
for(var key in source){
|
|
@@ -7675,9 +7721,9 @@
|
|
|
7675
7721
|
}
|
|
7676
7722
|
return target;
|
|
7677
7723
|
};
|
|
7678
|
-
return _extends$
|
|
7724
|
+
return _extends$g.apply(this, arguments);
|
|
7679
7725
|
}
|
|
7680
|
-
function _inherits$
|
|
7726
|
+
function _inherits$h(subClass, superClass) {
|
|
7681
7727
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7682
7728
|
throw new TypeError("Super expression must either be null or a function");
|
|
7683
7729
|
}
|
|
@@ -7688,28 +7734,28 @@
|
|
|
7688
7734
|
configurable: true
|
|
7689
7735
|
}
|
|
7690
7736
|
});
|
|
7691
|
-
if (superClass) _set_prototype_of$
|
|
7737
|
+
if (superClass) _set_prototype_of$h(subClass, superClass);
|
|
7692
7738
|
}
|
|
7693
|
-
function _set_prototype_of$
|
|
7694
|
-
_set_prototype_of$
|
|
7739
|
+
function _set_prototype_of$h(o, p) {
|
|
7740
|
+
_set_prototype_of$h = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7695
7741
|
o.__proto__ = p;
|
|
7696
7742
|
return o;
|
|
7697
7743
|
};
|
|
7698
|
-
return _set_prototype_of$
|
|
7744
|
+
return _set_prototype_of$h(o, p);
|
|
7699
7745
|
}
|
|
7700
7746
|
var Footer = /*#__PURE__*/ function(Component) {
|
|
7701
|
-
_inherits$
|
|
7747
|
+
_inherits$h(Footer, Component);
|
|
7702
7748
|
function Footer(options) {
|
|
7703
7749
|
if (options === void 0) options = {};
|
|
7704
|
-
return Component.call(this, _extends$
|
|
7750
|
+
return Component.call(this, _extends$g({}, options, {
|
|
7705
7751
|
cType: 'footer'
|
|
7706
7752
|
})) || this;
|
|
7707
7753
|
}
|
|
7708
7754
|
return Footer;
|
|
7709
7755
|
}(Component);
|
|
7710
7756
|
|
|
7711
|
-
function _extends$
|
|
7712
|
-
_extends$
|
|
7757
|
+
function _extends$f() {
|
|
7758
|
+
_extends$f = Object.assign || function(target) {
|
|
7713
7759
|
for(var i = 1; i < arguments.length; i++){
|
|
7714
7760
|
var source = arguments[i];
|
|
7715
7761
|
for(var key in source){
|
|
@@ -7720,9 +7766,9 @@
|
|
|
7720
7766
|
}
|
|
7721
7767
|
return target;
|
|
7722
7768
|
};
|
|
7723
|
-
return _extends$
|
|
7769
|
+
return _extends$f.apply(this, arguments);
|
|
7724
7770
|
}
|
|
7725
|
-
function _inherits$
|
|
7771
|
+
function _inherits$g(subClass, superClass) {
|
|
7726
7772
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7727
7773
|
throw new TypeError("Super expression must either be null or a function");
|
|
7728
7774
|
}
|
|
@@ -7733,20 +7779,20 @@
|
|
|
7733
7779
|
configurable: true
|
|
7734
7780
|
}
|
|
7735
7781
|
});
|
|
7736
|
-
if (superClass) _set_prototype_of$
|
|
7782
|
+
if (superClass) _set_prototype_of$g(subClass, superClass);
|
|
7737
7783
|
}
|
|
7738
|
-
function _set_prototype_of$
|
|
7739
|
-
_set_prototype_of$
|
|
7784
|
+
function _set_prototype_of$g(o, p) {
|
|
7785
|
+
_set_prototype_of$g = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7740
7786
|
o.__proto__ = p;
|
|
7741
7787
|
return o;
|
|
7742
7788
|
};
|
|
7743
|
-
return _set_prototype_of$
|
|
7789
|
+
return _set_prototype_of$g(o, p);
|
|
7744
7790
|
}
|
|
7745
7791
|
var Header = /*#__PURE__*/ function(Component) {
|
|
7746
|
-
_inherits$
|
|
7792
|
+
_inherits$g(Header, Component);
|
|
7747
7793
|
function Header(options) {
|
|
7748
7794
|
if (options === void 0) options = {};
|
|
7749
|
-
return Component.call(this, _extends$
|
|
7795
|
+
return Component.call(this, _extends$f({}, options, {
|
|
7750
7796
|
cType: 'header'
|
|
7751
7797
|
})) || this;
|
|
7752
7798
|
}
|
|
@@ -7912,8 +7958,8 @@
|
|
|
7912
7958
|
};
|
|
7913
7959
|
}
|
|
7914
7960
|
|
|
7915
|
-
function _extends$
|
|
7916
|
-
_extends$
|
|
7961
|
+
function _extends$e() {
|
|
7962
|
+
_extends$e = Object.assign || function(target) {
|
|
7917
7963
|
for(var i = 1; i < arguments.length; i++){
|
|
7918
7964
|
var source = arguments[i];
|
|
7919
7965
|
for(var key in source){
|
|
@@ -7924,9 +7970,9 @@
|
|
|
7924
7970
|
}
|
|
7925
7971
|
return target;
|
|
7926
7972
|
};
|
|
7927
|
-
return _extends$
|
|
7973
|
+
return _extends$e.apply(this, arguments);
|
|
7928
7974
|
}
|
|
7929
|
-
function _inherits$
|
|
7975
|
+
function _inherits$f(subClass, superClass) {
|
|
7930
7976
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7931
7977
|
throw new TypeError("Super expression must either be null or a function");
|
|
7932
7978
|
}
|
|
@@ -7937,23 +7983,23 @@
|
|
|
7937
7983
|
configurable: true
|
|
7938
7984
|
}
|
|
7939
7985
|
});
|
|
7940
|
-
if (superClass) _set_prototype_of$
|
|
7986
|
+
if (superClass) _set_prototype_of$f(subClass, superClass);
|
|
7941
7987
|
}
|
|
7942
|
-
function _set_prototype_of$
|
|
7943
|
-
_set_prototype_of$
|
|
7988
|
+
function _set_prototype_of$f(o, p) {
|
|
7989
|
+
_set_prototype_of$f = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7944
7990
|
o.__proto__ = p;
|
|
7945
7991
|
return o;
|
|
7946
7992
|
};
|
|
7947
|
-
return _set_prototype_of$
|
|
7993
|
+
return _set_prototype_of$f(o, p);
|
|
7948
7994
|
}
|
|
7949
7995
|
/**
|
|
7950
7996
|
* 全局全屏
|
|
7951
7997
|
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
7952
7998
|
* @category Control
|
|
7953
7999
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
7954
|
-
_inherits$
|
|
8000
|
+
_inherits$f(GlobalFullscreen, Fullscreen);
|
|
7955
8001
|
function GlobalFullscreen(options) {
|
|
7956
|
-
return Fullscreen.call(this, _extends$
|
|
8002
|
+
return Fullscreen.call(this, _extends$e({}, options, {
|
|
7957
8003
|
controlType: 'button',
|
|
7958
8004
|
classNameSuffix: 'global-fullscreen'
|
|
7959
8005
|
})) || this;
|
|
@@ -7984,8 +8030,8 @@
|
|
|
7984
8030
|
return GlobalFullscreen;
|
|
7985
8031
|
}(Fullscreen);
|
|
7986
8032
|
|
|
7987
|
-
function _extends$
|
|
7988
|
-
_extends$
|
|
8033
|
+
function _extends$d() {
|
|
8034
|
+
_extends$d = Object.assign || function(target) {
|
|
7989
8035
|
for(var i = 1; i < arguments.length; i++){
|
|
7990
8036
|
var source = arguments[i];
|
|
7991
8037
|
for(var key in source){
|
|
@@ -7996,9 +8042,9 @@
|
|
|
7996
8042
|
}
|
|
7997
8043
|
return target;
|
|
7998
8044
|
};
|
|
7999
|
-
return _extends$
|
|
8045
|
+
return _extends$d.apply(this, arguments);
|
|
8000
8046
|
}
|
|
8001
|
-
function _inherits$
|
|
8047
|
+
function _inherits$e(subClass, superClass) {
|
|
8002
8048
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
8003
8049
|
throw new TypeError("Super expression must either be null or a function");
|
|
8004
8050
|
}
|
|
@@ -8009,23 +8055,23 @@
|
|
|
8009
8055
|
configurable: true
|
|
8010
8056
|
}
|
|
8011
8057
|
});
|
|
8012
|
-
if (superClass) _set_prototype_of$
|
|
8058
|
+
if (superClass) _set_prototype_of$e(subClass, superClass);
|
|
8013
8059
|
}
|
|
8014
|
-
function _set_prototype_of$
|
|
8015
|
-
_set_prototype_of$
|
|
8060
|
+
function _set_prototype_of$e(o, p) {
|
|
8061
|
+
_set_prototype_of$e = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8016
8062
|
o.__proto__ = p;
|
|
8017
8063
|
return o;
|
|
8018
8064
|
};
|
|
8019
|
-
return _set_prototype_of$
|
|
8065
|
+
return _set_prototype_of$e(o, p);
|
|
8020
8066
|
}
|
|
8021
8067
|
/**
|
|
8022
8068
|
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
8023
8069
|
* @category Control
|
|
8024
8070
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
8025
|
-
_inherits$
|
|
8071
|
+
_inherits$e(CapturePicture, Control);
|
|
8026
8072
|
function CapturePicture(options) {
|
|
8027
8073
|
var _this;
|
|
8028
|
-
_this = Control.call(this, _extends$
|
|
8074
|
+
_this = Control.call(this, _extends$d({}, options, {
|
|
8029
8075
|
tagName: 'span',
|
|
8030
8076
|
classNameSuffix: 'capture-picture'
|
|
8031
8077
|
})) || this, _this._timer = null;
|
|
@@ -8078,7 +8124,7 @@
|
|
|
8078
8124
|
return CapturePicture;
|
|
8079
8125
|
}(Control);
|
|
8080
8126
|
|
|
8081
|
-
var dist$
|
|
8127
|
+
var dist$3 = {};
|
|
8082
8128
|
|
|
8083
8129
|
/*
|
|
8084
8130
|
* @ezuikit/control-ptz v0.0.1
|
|
@@ -8086,14 +8132,14 @@
|
|
|
8086
8132
|
* Released under the MIT License.
|
|
8087
8133
|
*/
|
|
8088
8134
|
|
|
8089
|
-
var hasRequiredDist$
|
|
8135
|
+
var hasRequiredDist$3;
|
|
8090
8136
|
|
|
8091
|
-
function requireDist$
|
|
8092
|
-
if (hasRequiredDist$
|
|
8093
|
-
hasRequiredDist$
|
|
8137
|
+
function requireDist$3 () {
|
|
8138
|
+
if (hasRequiredDist$3) return dist$3;
|
|
8139
|
+
hasRequiredDist$3 = 1;
|
|
8094
8140
|
|
|
8095
8141
|
var deepmerge = requireCjs();
|
|
8096
|
-
var utilsTools = requireDist$
|
|
8142
|
+
var utilsTools = requireDist$7();
|
|
8097
8143
|
|
|
8098
8144
|
var en_US = {
|
|
8099
8145
|
GET_PTZ_STATUS: 'Get current PTZ status',
|
|
@@ -9013,13 +9059,13 @@
|
|
|
9013
9059
|
return Ptz;
|
|
9014
9060
|
}(BasePtz);
|
|
9015
9061
|
|
|
9016
|
-
dist$
|
|
9017
|
-
dist$
|
|
9018
|
-
dist$
|
|
9019
|
-
return dist$
|
|
9062
|
+
dist$3.BasePtz = BasePtz;
|
|
9063
|
+
dist$3.MobilePtz = MobilePtz;
|
|
9064
|
+
dist$3.Ptz = Ptz;
|
|
9065
|
+
return dist$3;
|
|
9020
9066
|
}
|
|
9021
9067
|
|
|
9022
|
-
var distExports$2 = requireDist$
|
|
9068
|
+
var distExports$2 = requireDist$3();
|
|
9023
9069
|
|
|
9024
9070
|
function _defineProperties$4(target, props) {
|
|
9025
9071
|
for(var i = 0; i < props.length; i++){
|
|
@@ -9034,8 +9080,8 @@
|
|
|
9034
9080
|
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
9035
9081
|
return Constructor;
|
|
9036
9082
|
}
|
|
9037
|
-
function _extends$
|
|
9038
|
-
_extends$
|
|
9083
|
+
function _extends$c() {
|
|
9084
|
+
_extends$c = Object.assign || function(target) {
|
|
9039
9085
|
for(var i = 1; i < arguments.length; i++){
|
|
9040
9086
|
var source = arguments[i];
|
|
9041
9087
|
for(var key in source){
|
|
@@ -9046,9 +9092,9 @@
|
|
|
9046
9092
|
}
|
|
9047
9093
|
return target;
|
|
9048
9094
|
};
|
|
9049
|
-
return _extends$
|
|
9095
|
+
return _extends$c.apply(this, arguments);
|
|
9050
9096
|
}
|
|
9051
|
-
function _inherits$
|
|
9097
|
+
function _inherits$d(subClass, superClass) {
|
|
9052
9098
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9053
9099
|
throw new TypeError("Super expression must either be null or a function");
|
|
9054
9100
|
}
|
|
@@ -9059,23 +9105,23 @@
|
|
|
9059
9105
|
configurable: true
|
|
9060
9106
|
}
|
|
9061
9107
|
});
|
|
9062
|
-
if (superClass) _set_prototype_of$
|
|
9108
|
+
if (superClass) _set_prototype_of$d(subClass, superClass);
|
|
9063
9109
|
}
|
|
9064
|
-
function _set_prototype_of$
|
|
9065
|
-
_set_prototype_of$
|
|
9110
|
+
function _set_prototype_of$d(o, p) {
|
|
9111
|
+
_set_prototype_of$d = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9066
9112
|
o.__proto__ = p;
|
|
9067
9113
|
return o;
|
|
9068
9114
|
};
|
|
9069
|
-
return _set_prototype_of$
|
|
9115
|
+
return _set_prototype_of$d(o, p);
|
|
9070
9116
|
}
|
|
9071
9117
|
/**
|
|
9072
9118
|
* 云台控件
|
|
9073
9119
|
* @category Control
|
|
9074
9120
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
9075
|
-
_inherits$
|
|
9121
|
+
_inherits$d(Ptz, Control);
|
|
9076
9122
|
function Ptz(options) {
|
|
9077
9123
|
var _this;
|
|
9078
|
-
_this = Control.call(this, _extends$
|
|
9124
|
+
_this = Control.call(this, _extends$c({}, options, {
|
|
9079
9125
|
tagName: 'span',
|
|
9080
9126
|
controlType: 'button',
|
|
9081
9127
|
classNameSuffix: 'ptz'
|
|
@@ -9118,7 +9164,7 @@
|
|
|
9118
9164
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
9119
9165
|
this.$panel.appendChild(this.$turntable);
|
|
9120
9166
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9121
|
-
this._ptzControl = new distExports$2.Ptz(this.$turntable, _extends$
|
|
9167
|
+
this._ptzControl = new distExports$2.Ptz(this.$turntable, _extends$c({}, this._options, {
|
|
9122
9168
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9123
9169
|
onDirection: this._onDirection.bind(this)
|
|
9124
9170
|
}));
|
|
@@ -9127,7 +9173,7 @@
|
|
|
9127
9173
|
};
|
|
9128
9174
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
9129
9175
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9130
|
-
if (!this._ptzControl1) this._ptzControl1 = new distExports$2.MobilePtz($container, _extends$
|
|
9176
|
+
if (!this._ptzControl1) this._ptzControl1 = new distExports$2.MobilePtz($container, _extends$c({}, this._options, {
|
|
9131
9177
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9132
9178
|
onDirection: this._onDirection.bind(this)
|
|
9133
9179
|
}));
|
|
@@ -9230,8 +9276,8 @@
|
|
|
9230
9276
|
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
9231
9277
|
return Constructor;
|
|
9232
9278
|
}
|
|
9233
|
-
function _extends$
|
|
9234
|
-
_extends$
|
|
9279
|
+
function _extends$b() {
|
|
9280
|
+
_extends$b = Object.assign || function(target) {
|
|
9235
9281
|
for(var i = 1; i < arguments.length; i++){
|
|
9236
9282
|
var source = arguments[i];
|
|
9237
9283
|
for(var key in source){
|
|
@@ -9242,9 +9288,9 @@
|
|
|
9242
9288
|
}
|
|
9243
9289
|
return target;
|
|
9244
9290
|
};
|
|
9245
|
-
return _extends$
|
|
9291
|
+
return _extends$b.apply(this, arguments);
|
|
9246
9292
|
}
|
|
9247
|
-
function _inherits$
|
|
9293
|
+
function _inherits$c(subClass, superClass) {
|
|
9248
9294
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9249
9295
|
throw new TypeError("Super expression must either be null or a function");
|
|
9250
9296
|
}
|
|
@@ -9255,14 +9301,14 @@
|
|
|
9255
9301
|
configurable: true
|
|
9256
9302
|
}
|
|
9257
9303
|
});
|
|
9258
|
-
if (superClass) _set_prototype_of$
|
|
9304
|
+
if (superClass) _set_prototype_of$c(subClass, superClass);
|
|
9259
9305
|
}
|
|
9260
|
-
function _set_prototype_of$
|
|
9261
|
-
_set_prototype_of$
|
|
9306
|
+
function _set_prototype_of$c(o, p) {
|
|
9307
|
+
_set_prototype_of$c = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9262
9308
|
o.__proto__ = p;
|
|
9263
9309
|
return o;
|
|
9264
9310
|
};
|
|
9265
|
-
return _set_prototype_of$
|
|
9311
|
+
return _set_prototype_of$c(o, p);
|
|
9266
9312
|
}
|
|
9267
9313
|
var RECORD_DEFAULT_OPTIONS = {
|
|
9268
9314
|
maxDuration: 3600
|
|
@@ -9276,10 +9322,10 @@
|
|
|
9276
9322
|
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
9277
9323
|
* @category Control
|
|
9278
9324
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
9279
|
-
_inherits$
|
|
9325
|
+
_inherits$c(Record, Control);
|
|
9280
9326
|
function Record(options) {
|
|
9281
9327
|
var _this;
|
|
9282
|
-
_this = Control.call(this, _extends$
|
|
9328
|
+
_this = Control.call(this, _extends$b({}, options, {
|
|
9283
9329
|
tagName: 'span',
|
|
9284
9330
|
controlType: 'button',
|
|
9285
9331
|
classNameSuffix: 'record'
|
|
@@ -9378,7 +9424,7 @@
|
|
|
9378
9424
|
return Record;
|
|
9379
9425
|
}(Control);
|
|
9380
9426
|
|
|
9381
|
-
function asyncGeneratorStep$
|
|
9427
|
+
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9382
9428
|
try {
|
|
9383
9429
|
var info = gen[key](arg);
|
|
9384
9430
|
var value = info.value;
|
|
@@ -9392,16 +9438,16 @@
|
|
|
9392
9438
|
Promise.resolve(value).then(_next, _throw);
|
|
9393
9439
|
}
|
|
9394
9440
|
}
|
|
9395
|
-
function _async_to_generator$
|
|
9441
|
+
function _async_to_generator$3(fn) {
|
|
9396
9442
|
return function() {
|
|
9397
9443
|
var self = this, args = arguments;
|
|
9398
9444
|
return new Promise(function(resolve, reject) {
|
|
9399
9445
|
var gen = fn.apply(self, args);
|
|
9400
9446
|
function _next(value) {
|
|
9401
|
-
asyncGeneratorStep$
|
|
9447
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
9402
9448
|
}
|
|
9403
9449
|
function _throw(err) {
|
|
9404
|
-
asyncGeneratorStep$
|
|
9450
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9405
9451
|
}
|
|
9406
9452
|
_next(undefined);
|
|
9407
9453
|
});
|
|
@@ -9420,8 +9466,8 @@
|
|
|
9420
9466
|
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
9421
9467
|
return Constructor;
|
|
9422
9468
|
}
|
|
9423
|
-
function _extends$
|
|
9424
|
-
_extends$
|
|
9469
|
+
function _extends$a() {
|
|
9470
|
+
_extends$a = Object.assign || function(target) {
|
|
9425
9471
|
for(var i = 1; i < arguments.length; i++){
|
|
9426
9472
|
var source = arguments[i];
|
|
9427
9473
|
for(var key in source){
|
|
@@ -9432,9 +9478,9 @@
|
|
|
9432
9478
|
}
|
|
9433
9479
|
return target;
|
|
9434
9480
|
};
|
|
9435
|
-
return _extends$
|
|
9481
|
+
return _extends$a.apply(this, arguments);
|
|
9436
9482
|
}
|
|
9437
|
-
function _inherits$
|
|
9483
|
+
function _inherits$b(subClass, superClass) {
|
|
9438
9484
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9439
9485
|
throw new TypeError("Super expression must either be null or a function");
|
|
9440
9486
|
}
|
|
@@ -9445,16 +9491,16 @@
|
|
|
9445
9491
|
configurable: true
|
|
9446
9492
|
}
|
|
9447
9493
|
});
|
|
9448
|
-
if (superClass) _set_prototype_of$
|
|
9494
|
+
if (superClass) _set_prototype_of$b(subClass, superClass);
|
|
9449
9495
|
}
|
|
9450
|
-
function _set_prototype_of$
|
|
9451
|
-
_set_prototype_of$
|
|
9496
|
+
function _set_prototype_of$b(o, p) {
|
|
9497
|
+
_set_prototype_of$b = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9452
9498
|
o.__proto__ = p;
|
|
9453
9499
|
return o;
|
|
9454
9500
|
};
|
|
9455
|
-
return _set_prototype_of$
|
|
9501
|
+
return _set_prototype_of$b(o, p);
|
|
9456
9502
|
}
|
|
9457
|
-
function _ts_generator$
|
|
9503
|
+
function _ts_generator$3(thisArg, body) {
|
|
9458
9504
|
var f, y, t, _ = {
|
|
9459
9505
|
label: 0,
|
|
9460
9506
|
sent: function() {
|
|
@@ -9554,10 +9600,10 @@
|
|
|
9554
9600
|
*
|
|
9555
9601
|
* @category Control
|
|
9556
9602
|
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
9557
|
-
_inherits$
|
|
9603
|
+
_inherits$b(Talk, Control);
|
|
9558
9604
|
function Talk(options) {
|
|
9559
9605
|
var _this;
|
|
9560
|
-
_this = Control.call(this, _extends$
|
|
9606
|
+
_this = Control.call(this, _extends$a({}, options, {
|
|
9561
9607
|
tagName: 'span',
|
|
9562
9608
|
controlType: 'button',
|
|
9563
9609
|
classNameSuffix: 'talk'
|
|
@@ -9609,8 +9655,8 @@
|
|
|
9609
9655
|
var _this = this, _superprop_get__onControlClick = function() {
|
|
9610
9656
|
return Control.prototype._onControlClick;
|
|
9611
9657
|
};
|
|
9612
|
-
return _async_to_generator$
|
|
9613
|
-
return _ts_generator$
|
|
9658
|
+
return _async_to_generator$3(function() {
|
|
9659
|
+
return _ts_generator$3(this, function(_state) {
|
|
9614
9660
|
_superprop_get__onControlClick().call(_this, e);
|
|
9615
9661
|
this.active = !this.active;
|
|
9616
9662
|
this.emit(EVENTS.control.talkingChange, this.active);
|
|
@@ -9661,21 +9707,37 @@
|
|
|
9661
9707
|
return Talk;
|
|
9662
9708
|
}(Control);
|
|
9663
9709
|
|
|
9664
|
-
function
|
|
9665
|
-
|
|
9666
|
-
var
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9710
|
+
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9711
|
+
try {
|
|
9712
|
+
var info = gen[key](arg);
|
|
9713
|
+
var value = info.value;
|
|
9714
|
+
} catch (error) {
|
|
9715
|
+
reject(error);
|
|
9716
|
+
return;
|
|
9717
|
+
}
|
|
9718
|
+
if (info.done) {
|
|
9719
|
+
resolve(value);
|
|
9720
|
+
} else {
|
|
9721
|
+
Promise.resolve(value).then(_next, _throw);
|
|
9671
9722
|
}
|
|
9672
9723
|
}
|
|
9673
|
-
function
|
|
9674
|
-
|
|
9675
|
-
|
|
9724
|
+
function _async_to_generator$2(fn) {
|
|
9725
|
+
return function() {
|
|
9726
|
+
var self = this, args = arguments;
|
|
9727
|
+
return new Promise(function(resolve, reject) {
|
|
9728
|
+
var gen = fn.apply(self, args);
|
|
9729
|
+
function _next(value) {
|
|
9730
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
9731
|
+
}
|
|
9732
|
+
function _throw(err) {
|
|
9733
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9734
|
+
}
|
|
9735
|
+
_next(undefined);
|
|
9736
|
+
});
|
|
9737
|
+
};
|
|
9676
9738
|
}
|
|
9677
|
-
function _extends$
|
|
9678
|
-
_extends$
|
|
9739
|
+
function _extends$9() {
|
|
9740
|
+
_extends$9 = Object.assign || function(target) {
|
|
9679
9741
|
for(var i = 1; i < arguments.length; i++){
|
|
9680
9742
|
var source = arguments[i];
|
|
9681
9743
|
for(var key in source){
|
|
@@ -9686,9 +9748,9 @@
|
|
|
9686
9748
|
}
|
|
9687
9749
|
return target;
|
|
9688
9750
|
};
|
|
9689
|
-
return _extends$
|
|
9751
|
+
return _extends$9.apply(this, arguments);
|
|
9690
9752
|
}
|
|
9691
|
-
function _inherits$
|
|
9753
|
+
function _inherits$a(subClass, superClass) {
|
|
9692
9754
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9693
9755
|
throw new TypeError("Super expression must either be null or a function");
|
|
9694
9756
|
}
|
|
@@ -9699,60 +9761,269 @@
|
|
|
9699
9761
|
configurable: true
|
|
9700
9762
|
}
|
|
9701
9763
|
});
|
|
9702
|
-
if (superClass) _set_prototype_of$
|
|
9764
|
+
if (superClass) _set_prototype_of$a(subClass, superClass);
|
|
9703
9765
|
}
|
|
9704
|
-
function _set_prototype_of$
|
|
9705
|
-
_set_prototype_of$
|
|
9766
|
+
function _set_prototype_of$a(o, p) {
|
|
9767
|
+
_set_prototype_of$a = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9706
9768
|
o.__proto__ = p;
|
|
9707
9769
|
return o;
|
|
9708
9770
|
};
|
|
9709
|
-
return _set_prototype_of$
|
|
9771
|
+
return _set_prototype_of$a(o, p);
|
|
9710
9772
|
}
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
label:
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9773
|
+
function _ts_generator$2(thisArg, body) {
|
|
9774
|
+
var f, y, t, _ = {
|
|
9775
|
+
label: 0,
|
|
9776
|
+
sent: function() {
|
|
9777
|
+
if (t[0] & 1) throw t[1];
|
|
9778
|
+
return t[1];
|
|
9779
|
+
},
|
|
9780
|
+
trys: [],
|
|
9781
|
+
ops: []
|
|
9782
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
9783
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
9784
|
+
return this;
|
|
9785
|
+
}), g;
|
|
9786
|
+
function verb(n) {
|
|
9787
|
+
return function(v) {
|
|
9788
|
+
return step([
|
|
9789
|
+
n,
|
|
9790
|
+
v
|
|
9791
|
+
]);
|
|
9792
|
+
};
|
|
9793
|
+
}
|
|
9794
|
+
function step(op) {
|
|
9795
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
9796
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
9797
|
+
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;
|
|
9798
|
+
if (y = 0, t) op = [
|
|
9799
|
+
op[0] & 2,
|
|
9800
|
+
t.value
|
|
9801
|
+
];
|
|
9802
|
+
switch(op[0]){
|
|
9803
|
+
case 0:
|
|
9804
|
+
case 1:
|
|
9805
|
+
t = op;
|
|
9806
|
+
break;
|
|
9807
|
+
case 4:
|
|
9808
|
+
_.label++;
|
|
9809
|
+
return {
|
|
9810
|
+
value: op[1],
|
|
9811
|
+
done: false
|
|
9812
|
+
};
|
|
9813
|
+
case 5:
|
|
9814
|
+
_.label++;
|
|
9815
|
+
y = op[1];
|
|
9816
|
+
op = [
|
|
9817
|
+
0
|
|
9818
|
+
];
|
|
9819
|
+
continue;
|
|
9820
|
+
case 7:
|
|
9821
|
+
op = _.ops.pop();
|
|
9822
|
+
_.trys.pop();
|
|
9823
|
+
continue;
|
|
9824
|
+
default:
|
|
9825
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
9826
|
+
_ = 0;
|
|
9827
|
+
continue;
|
|
9828
|
+
}
|
|
9829
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
9830
|
+
_.label = op[1];
|
|
9831
|
+
break;
|
|
9832
|
+
}
|
|
9833
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
9834
|
+
_.label = t[1];
|
|
9835
|
+
t = op;
|
|
9836
|
+
break;
|
|
9837
|
+
}
|
|
9838
|
+
if (t && _.label < t[2]) {
|
|
9839
|
+
_.label = t[2];
|
|
9840
|
+
_.ops.push(op);
|
|
9841
|
+
break;
|
|
9842
|
+
}
|
|
9843
|
+
if (t[2]) _.ops.pop();
|
|
9844
|
+
_.trys.pop();
|
|
9845
|
+
continue;
|
|
9846
|
+
}
|
|
9847
|
+
op = body.call(thisArg, _);
|
|
9848
|
+
} catch (e) {
|
|
9849
|
+
op = [
|
|
9850
|
+
6,
|
|
9851
|
+
e
|
|
9852
|
+
];
|
|
9853
|
+
y = 0;
|
|
9854
|
+
} finally{
|
|
9855
|
+
f = t = 0;
|
|
9856
|
+
}
|
|
9857
|
+
if (op[0] & 5) throw op[1];
|
|
9858
|
+
return {
|
|
9859
|
+
value: op[0] ? op[1] : void 0,
|
|
9860
|
+
done: true
|
|
9861
|
+
};
|
|
9862
|
+
}
|
|
9863
|
+
}
|
|
9864
|
+
/**
|
|
9865
|
+
* 语音广播控件
|
|
9866
|
+
*
|
|
9867
|
+
* 用于触发语音广播功能的按钮控件
|
|
9868
|
+
*
|
|
9869
|
+
* @category Control
|
|
9870
|
+
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
9871
|
+
_inherits$a(Broadcast, Control);
|
|
9872
|
+
function Broadcast(options) {
|
|
9873
|
+
var _this;
|
|
9874
|
+
_this = Control.call(this, _extends$9({}, options, {
|
|
9875
|
+
tagName: 'span',
|
|
9876
|
+
controlType: 'button',
|
|
9877
|
+
classNameSuffix: 'broadcast'
|
|
9878
|
+
})) || this;
|
|
9879
|
+
_this._options = options;
|
|
9880
|
+
_this._render();
|
|
9881
|
+
_this.on(EVENTS.broadcastChange, function(active) {
|
|
9882
|
+
if (_this.active !== active) {
|
|
9883
|
+
_this.active = active;
|
|
9884
|
+
_this._render();
|
|
9885
|
+
}
|
|
9886
|
+
});
|
|
9887
|
+
return _this;
|
|
9888
|
+
}
|
|
9889
|
+
var _proto = Broadcast.prototype;
|
|
9890
|
+
_proto._render = function _render() {
|
|
9891
|
+
var _this_locale;
|
|
9892
|
+
this.$container.innerHTML = IconComponents.broadcast({
|
|
9893
|
+
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_BROADCAST
|
|
9894
|
+
});
|
|
9895
|
+
};
|
|
9896
|
+
_proto.reset = function reset(hide) {
|
|
9897
|
+
if (this.active) {
|
|
9898
|
+
this.active = false;
|
|
9899
|
+
this._render();
|
|
9900
|
+
this.emit(EVENTS.control.broadcastChange, false);
|
|
9901
|
+
Control.prototype.reset.call(this, hide);
|
|
9902
|
+
}
|
|
9903
|
+
};
|
|
9904
|
+
/**
|
|
9905
|
+
* 销毁语音广播控件
|
|
9906
|
+
*/ _proto.destroy = function destroy() {
|
|
9907
|
+
if (this.active) {
|
|
9908
|
+
this.reset();
|
|
9909
|
+
}
|
|
9910
|
+
Control.prototype.destroy.call(this);
|
|
9911
|
+
};
|
|
9912
|
+
/**
|
|
9913
|
+
* 点击 Control 会触发
|
|
9914
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9915
|
+
var _this = this, _superprop_get__onControlClick = function() {
|
|
9916
|
+
return Control.prototype._onControlClick;
|
|
9917
|
+
};
|
|
9918
|
+
return _async_to_generator$2(function() {
|
|
9919
|
+
var _this__options_onChange, _this__options;
|
|
9920
|
+
return _ts_generator$2(this, function(_state) {
|
|
9921
|
+
_superprop_get__onControlClick().call(_this, e);
|
|
9922
|
+
this.active = !this.active;
|
|
9923
|
+
this.emit(EVENTS.control.broadcastChange, this.active);
|
|
9924
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, this.active);
|
|
9925
|
+
this._render();
|
|
9926
|
+
return [
|
|
9927
|
+
2
|
|
9928
|
+
];
|
|
9929
|
+
});
|
|
9930
|
+
}).call(this);
|
|
9931
|
+
};
|
|
9932
|
+
return Broadcast;
|
|
9933
|
+
}(Control);
|
|
9934
|
+
|
|
9935
|
+
function _defineProperties$1(target, props) {
|
|
9936
|
+
for(var i = 0; i < props.length; i++){
|
|
9937
|
+
var descriptor = props[i];
|
|
9938
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
9939
|
+
descriptor.configurable = true;
|
|
9940
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
9941
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9942
|
+
}
|
|
9943
|
+
}
|
|
9944
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
9945
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
9946
|
+
return Constructor;
|
|
9947
|
+
}
|
|
9948
|
+
function _extends$8() {
|
|
9949
|
+
_extends$8 = Object.assign || function(target) {
|
|
9950
|
+
for(var i = 1; i < arguments.length; i++){
|
|
9951
|
+
var source = arguments[i];
|
|
9952
|
+
for(var key in source){
|
|
9953
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9954
|
+
target[key] = source[key];
|
|
9955
|
+
}
|
|
9956
|
+
}
|
|
9957
|
+
}
|
|
9958
|
+
return target;
|
|
9959
|
+
};
|
|
9960
|
+
return _extends$8.apply(this, arguments);
|
|
9961
|
+
}
|
|
9962
|
+
function _inherits$9(subClass, superClass) {
|
|
9963
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
9964
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
9965
|
+
}
|
|
9966
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
9967
|
+
constructor: {
|
|
9968
|
+
value: subClass,
|
|
9969
|
+
writable: true,
|
|
9970
|
+
configurable: true
|
|
9971
|
+
}
|
|
9972
|
+
});
|
|
9973
|
+
if (superClass) _set_prototype_of$9(subClass, superClass);
|
|
9974
|
+
}
|
|
9975
|
+
function _set_prototype_of$9(o, p) {
|
|
9976
|
+
_set_prototype_of$9 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9977
|
+
o.__proto__ = p;
|
|
9978
|
+
return o;
|
|
9979
|
+
};
|
|
9980
|
+
return _set_prototype_of$9(o, p);
|
|
9981
|
+
}
|
|
9982
|
+
var SELECT_DEFAULT_OPTIONS = {
|
|
9983
|
+
fieldNames: {
|
|
9984
|
+
label: 'label',
|
|
9985
|
+
value: 'value'
|
|
9986
|
+
},
|
|
9987
|
+
renderLabel: function(label) {
|
|
9988
|
+
return "<span>" + (label || '') + "</span>";
|
|
9989
|
+
},
|
|
9990
|
+
onChange: function() {},
|
|
9991
|
+
onOpenChange: function() {}
|
|
9992
|
+
};
|
|
9993
|
+
/**
|
|
9994
|
+
* 选择器切换 (支持PC/Mobile)
|
|
9995
|
+
* @category Control
|
|
9996
|
+
* @example
|
|
9997
|
+
* ```ts
|
|
9998
|
+
* new Select({
|
|
9999
|
+
* title: '清晰度',
|
|
10000
|
+
* list: [
|
|
10001
|
+
* {
|
|
10002
|
+
* label: '高清',
|
|
10003
|
+
* value: 'hd',
|
|
10004
|
+
* streamTypeIn: 1,
|
|
10005
|
+
* },
|
|
10006
|
+
* {
|
|
10007
|
+
* label: '超清',
|
|
10008
|
+
* value: 'super',
|
|
10009
|
+
* streamTypeIn: 2,
|
|
10010
|
+
* }
|
|
10011
|
+
* ],
|
|
10012
|
+
* value: 'hd',
|
|
10013
|
+
* onChange: (value, item) => {
|
|
10014
|
+
* console.log('选择了', value, item);
|
|
10015
|
+
* }
|
|
10016
|
+
* })
|
|
10017
|
+
*
|
|
10018
|
+
* // 如果想扩展 Select 组件,可以继承 Select 组件
|
|
10019
|
+
* // 例如清晰度切换组件
|
|
10020
|
+
* class Definition extends Select {
|
|
10021
|
+
* options: DefinitionOptions;
|
|
10022
|
+
* constructor(options: DefinitionOptions) {
|
|
10023
|
+
* super({
|
|
10024
|
+
* ...options,
|
|
10025
|
+
* fieldNames: { label: 'name', value: 'level',},
|
|
10026
|
+
* title: options?.locale?.definition,
|
|
9756
10027
|
* controlType: 'button',
|
|
9757
10028
|
* classNameSuffix: 'definition',
|
|
9758
10029
|
* onChange: (value: SelectItem['value'], item) => {
|
|
@@ -9881,7 +10152,7 @@
|
|
|
9881
10152
|
var _this__options_fieldNames;
|
|
9882
10153
|
var _this__options_fieldNames_value;
|
|
9883
10154
|
var valueKey = (_this__options_fieldNames_value = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _this__options_fieldNames_value : 'value';
|
|
9884
|
-
this._delegationOption = delegate
|
|
10155
|
+
this._delegationOption = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-option", 'click', function(e) {
|
|
9885
10156
|
var target = e.delegateTarget;
|
|
9886
10157
|
e.stopPropagation();
|
|
9887
10158
|
if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
@@ -9896,11 +10167,11 @@
|
|
|
9896
10167
|
}
|
|
9897
10168
|
}
|
|
9898
10169
|
});
|
|
9899
|
-
this._delegationClose = delegate
|
|
10170
|
+
this._delegationClose = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-close", 'click', function(e) {
|
|
9900
10171
|
e.stopPropagation();
|
|
9901
10172
|
_this._picker.open = false;
|
|
9902
10173
|
});
|
|
9903
|
-
this._delegationCancel = delegate
|
|
10174
|
+
this._delegationCancel = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-cancel", 'click', function(e) {
|
|
9904
10175
|
e.stopPropagation();
|
|
9905
10176
|
_this._picker.open = false;
|
|
9906
10177
|
});
|
|
@@ -10127,288 +10398,152 @@
|
|
|
10127
10398
|
|
|
10128
10399
|
function _assert_this_initialized(self) {
|
|
10129
10400
|
if (self === void 0) {
|
|
10130
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10131
|
-
}
|
|
10132
|
-
return self;
|
|
10133
|
-
}
|
|
10134
|
-
function _extends$6() {
|
|
10135
|
-
_extends$6 = Object.assign || function(target) {
|
|
10136
|
-
for(var i = 1; i < arguments.length; i++){
|
|
10137
|
-
var source = arguments[i];
|
|
10138
|
-
for(var key in source){
|
|
10139
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10140
|
-
target[key] = source[key];
|
|
10141
|
-
}
|
|
10142
|
-
}
|
|
10143
|
-
}
|
|
10144
|
-
return target;
|
|
10145
|
-
};
|
|
10146
|
-
return _extends$6.apply(this, arguments);
|
|
10147
|
-
}
|
|
10148
|
-
function _inherits$7(subClass, superClass) {
|
|
10149
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
10150
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
10151
|
-
}
|
|
10152
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
10153
|
-
constructor: {
|
|
10154
|
-
value: subClass,
|
|
10155
|
-
writable: true,
|
|
10156
|
-
configurable: true
|
|
10157
|
-
}
|
|
10158
|
-
});
|
|
10159
|
-
if (superClass) _set_prototype_of$7(subClass, superClass);
|
|
10160
|
-
}
|
|
10161
|
-
function _set_prototype_of$7(o, p) {
|
|
10162
|
-
_set_prototype_of$7 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10163
|
-
o.__proto__ = p;
|
|
10164
|
-
return o;
|
|
10165
|
-
};
|
|
10166
|
-
return _set_prototype_of$7(o, p);
|
|
10167
|
-
}
|
|
10168
|
-
// 支持的倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
10169
|
-
var SUPPORT_SPEED = [
|
|
10170
|
-
0.5,
|
|
10171
|
-
1,
|
|
10172
|
-
2,
|
|
10173
|
-
4,
|
|
10174
|
-
8,
|
|
10175
|
-
16
|
|
10176
|
-
]; // 8, 16
|
|
10177
|
-
var SPEED_DEFAULT_OPTIONS = {
|
|
10178
|
-
/**
|
|
10179
|
-
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
10180
|
-
* 暂时不支持初始化时设置倍速
|
|
10181
|
-
*/ // value: 1, // 对应list 中的 value
|
|
10182
|
-
// 这里不要设置多语言, 比较麻烦
|
|
10183
|
-
/**
|
|
10184
|
-
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
10185
|
-
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
10186
|
-
return {
|
|
10187
|
-
label: "" + speed + "x",
|
|
10188
|
-
value: speed
|
|
10189
|
-
};
|
|
10190
|
-
})
|
|
10191
|
-
};
|
|
10192
|
-
/**
|
|
10193
|
-
* 倍速切换控件, 不支持动态切换倍速列表
|
|
10194
|
-
*
|
|
10195
|
-
* 注意:
|
|
10196
|
-
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
10197
|
-
* 2. 标准流不支持;
|
|
10198
|
-
* @category Control
|
|
10199
|
-
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
10200
|
-
_inherits$7(Speed, Select);
|
|
10201
|
-
function Speed(options) {
|
|
10202
|
-
var _this;
|
|
10203
|
-
var _options_locales_options_language, _options_locales;
|
|
10204
|
-
_this = Select.call(this, _extends$6({}, SPEED_DEFAULT_OPTIONS, options, {
|
|
10205
|
-
value: (options.props.speed || 1) + '',
|
|
10206
|
-
classNameSuffix: 'speed',
|
|
10207
|
-
controlType: 'button',
|
|
10208
|
-
title: options == null ? void 0 : (_options_locales = options.locales) == null ? void 0 : (_options_locales_options_language = _options_locales[options.language]) == null ? void 0 : _options_locales_options_language.BTN_SPEED,
|
|
10209
|
-
onChange: function(value, item) {
|
|
10210
|
-
var _options_onChange;
|
|
10211
|
-
value = +value;
|
|
10212
|
-
options == null ? void 0 : (_options_onChange = options.onChange) == null ? void 0 : _options_onChange.call(options, value, item);
|
|
10213
|
-
_assert_this_initialized(_this).emit(EVENTS.control.speedChange, value, item);
|
|
10214
|
-
},
|
|
10215
|
-
onOpenChange: function(open, value, item) {
|
|
10216
|
-
var _options_onOpenChange;
|
|
10217
|
-
value = +value;
|
|
10218
|
-
options == null ? void 0 : (_options_onOpenChange = options.onOpenChange) == null ? void 0 : _options_onOpenChange.call(options, open, value, item);
|
|
10219
|
-
_assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
|
|
10220
|
-
}
|
|
10221
|
-
})) || this;
|
|
10222
|
-
_this._filterSpeedList(options.list, options.props.recType);
|
|
10223
|
-
_this.on(EVENTS.speedChange, function(speed) {
|
|
10224
|
-
if (_this.value !== speed + '') _this.value = speed + '';
|
|
10225
|
-
});
|
|
10226
|
-
_this.on(EVENTS.control.recTypeChange, function(type) {
|
|
10227
|
-
_this._filterSpeedList(options.list, type);
|
|
10228
|
-
});
|
|
10229
|
-
return _this;
|
|
10230
|
-
}
|
|
10231
|
-
var _proto = Speed.prototype;
|
|
10232
|
-
/**
|
|
10233
|
-
* 滤掉本地回放不支持的倍速
|
|
10234
|
-
* @param optionsList 初始化配置倍速列表
|
|
10235
|
-
* @param type 回放类型
|
|
10236
|
-
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
|
|
10237
|
-
if (!optionsList) {
|
|
10238
|
-
// 非用户自定义
|
|
10239
|
-
if (type === 'rec') {
|
|
10240
|
-
// 本地回放 不支持 8 16 32 倍速
|
|
10241
|
-
var list = this.list.filter(function(item) {
|
|
10242
|
-
return (item == null ? void 0 : item.value) && +item.value < 8;
|
|
10243
|
-
});
|
|
10244
|
-
this.updateOptions(list);
|
|
10245
|
-
} else {
|
|
10246
|
-
// 云端回放 支持 8 16 32 倍速
|
|
10247
|
-
this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
|
|
10248
|
-
}
|
|
10249
|
-
}
|
|
10250
|
-
};
|
|
10251
|
-
_proto.reset = function reset(hide) {
|
|
10252
|
-
this.value = 1 + '';
|
|
10253
|
-
Select.prototype.reset.call(this, hide);
|
|
10254
|
-
};
|
|
10255
|
-
return Speed;
|
|
10256
|
-
}(Select);
|
|
10257
|
-
|
|
10258
|
-
var dist$3 = {};
|
|
10259
|
-
|
|
10260
|
-
var delegate$1 = {exports: {}};
|
|
10261
|
-
|
|
10262
|
-
/*
|
|
10263
|
-
* delegate.js v4.0.1
|
|
10264
|
-
* Copyright (c) 2025-11-23
|
|
10265
|
-
* Released under the MIT License.
|
|
10266
|
-
*/
|
|
10267
|
-
var delegate = delegate$1.exports;
|
|
10268
|
-
|
|
10269
|
-
var hasRequiredDelegate;
|
|
10270
|
-
|
|
10271
|
-
function requireDelegate () {
|
|
10272
|
-
if (hasRequiredDelegate) return delegate$1.exports;
|
|
10273
|
-
hasRequiredDelegate = 1;
|
|
10274
|
-
(function (module, exports) {
|
|
10275
|
-
(function (global, factory) {
|
|
10276
|
-
module.exports = factory() ;
|
|
10277
|
-
})(delegate, (function () {
|
|
10278
|
-
var DOCUMENT_NODE_TYPE = 9;
|
|
10279
|
-
/**
|
|
10280
|
-
* A polyfill for Element.matches()
|
|
10281
|
-
*/ if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
10282
|
-
var proto = Element.prototype;
|
|
10283
|
-
proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
|
|
10284
|
-
}
|
|
10285
|
-
/**
|
|
10286
|
-
* Finds the closest parent that matches a selector.
|
|
10287
|
-
*
|
|
10288
|
-
* @param {Element} element
|
|
10289
|
-
* @param {string} selector
|
|
10290
|
-
* @return {Element}
|
|
10291
|
-
*/ function closest(element, selector) {
|
|
10292
|
-
while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
|
|
10293
|
-
if (typeof element.matches === "function" && element.matches(selector)) {
|
|
10294
|
-
return element;
|
|
10295
|
-
}
|
|
10296
|
-
element = element.parentNode;
|
|
10297
|
-
}
|
|
10298
|
-
return null;
|
|
10299
|
-
}
|
|
10300
|
-
/**
|
|
10301
|
-
* Finds the closest parent that matches a selector.
|
|
10302
|
-
*
|
|
10303
|
-
* @param {Element} element
|
|
10304
|
-
* @param {string} selector
|
|
10305
|
-
* @return {Element}
|
|
10306
|
-
*/ function closestNative(element, selector) {
|
|
10307
|
-
return element && element.closest(selector);
|
|
10308
|
-
}
|
|
10309
|
-
var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
|
|
10310
|
-
|
|
10311
|
-
/**
|
|
10312
|
-
* Delegates event to a selector.
|
|
10313
|
-
*
|
|
10314
|
-
* @param {Element} element
|
|
10315
|
-
* @param {string} selector
|
|
10316
|
-
* @param {string} type
|
|
10317
|
-
* @param {Function} callback
|
|
10318
|
-
* @param {boolean} useCapture
|
|
10319
|
-
* @return {Object}
|
|
10320
|
-
*/ // prettier-ignore
|
|
10321
|
-
function _delegate(element, selector, type, callback, useCapture) {
|
|
10322
|
-
// prettier-ignore
|
|
10323
|
-
var listenerFn = listener.apply(this, arguments);
|
|
10324
|
-
element.addEventListener(type, listenerFn, useCapture);
|
|
10325
|
-
return {
|
|
10326
|
-
destroy: function destroy() {
|
|
10327
|
-
element.removeEventListener(type, listenerFn, useCapture);
|
|
10328
|
-
}
|
|
10329
|
-
};
|
|
10330
|
-
}
|
|
10331
|
-
/**
|
|
10332
|
-
* Delegates event to a selector.
|
|
10333
|
-
*
|
|
10334
|
-
* @param {Element|string|Array} [elements]
|
|
10335
|
-
* @param {string | Element} selector
|
|
10336
|
-
* @param {string} type
|
|
10337
|
-
* @param {Function} callback
|
|
10338
|
-
* @param {boolean} useCapture
|
|
10339
|
-
* @return {Object}
|
|
10340
|
-
* @example
|
|
10341
|
-
* ```ts
|
|
10342
|
-
* const delegation = delegate(document.body, 'a', 'click', function (e) {})
|
|
10343
|
-
* // destroy (removeEventListener)
|
|
10344
|
-
* delegation.destroy();
|
|
10345
|
-
*
|
|
10346
|
-
* const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
|
|
10347
|
-
* // destroy (removeEventListener)
|
|
10348
|
-
* delegation1.destroy();
|
|
10349
|
-
* ```
|
|
10350
|
-
*/ // prettier-ignore
|
|
10351
|
-
function delegate(elements, selector, type, callback, useCapture) {
|
|
10352
|
-
// Handle the regular Element usage
|
|
10353
|
-
if (typeof elements.addEventListener === "function") {
|
|
10354
|
-
return _delegate.apply(null, arguments);
|
|
10355
|
-
}
|
|
10356
|
-
// Handle Element-less usage, it defaults to global delegation
|
|
10357
|
-
if (typeof type === "function") {
|
|
10358
|
-
// Use `document` as the first parameter, then apply arguments
|
|
10359
|
-
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|
10360
|
-
return _delegate.bind(null, document).apply(null, arguments);
|
|
10361
|
-
}
|
|
10362
|
-
// Handle Selector-based usage
|
|
10363
|
-
if (typeof elements === "string") {
|
|
10364
|
-
elements = document.querySelectorAll(elements);
|
|
10365
|
-
}
|
|
10366
|
-
// Handle Array-like based usage
|
|
10367
|
-
return Array.prototype.map.call(elements, function(element) {
|
|
10368
|
-
return _delegate(element, selector, type, callback, useCapture);
|
|
10369
|
-
});
|
|
10370
|
-
}
|
|
10371
|
-
/**
|
|
10372
|
-
* Finds closest match and invokes callback.
|
|
10373
|
-
*
|
|
10374
|
-
* @param {Element} element
|
|
10375
|
-
* @param {string} selector
|
|
10376
|
-
* @param {string} type
|
|
10377
|
-
* @param {Function} callback
|
|
10378
|
-
* @return {Function}
|
|
10379
|
-
*/ // prettier-ignore
|
|
10380
|
-
function listener(element, selector, type, callback) {
|
|
10381
|
-
return function(e) {
|
|
10382
|
-
e.delegateTarget = closest$1(e.target, selector);
|
|
10383
|
-
if (e.delegateTarget) {
|
|
10384
|
-
callback.call(element, e);
|
|
10385
|
-
}
|
|
10386
|
-
};
|
|
10387
|
-
}
|
|
10388
|
-
|
|
10389
|
-
return delegate;
|
|
10390
|
-
|
|
10391
|
-
}));
|
|
10392
|
-
} (delegate$1));
|
|
10393
|
-
return delegate$1.exports;
|
|
10401
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10402
|
+
}
|
|
10403
|
+
return self;
|
|
10404
|
+
}
|
|
10405
|
+
function _extends$6() {
|
|
10406
|
+
_extends$6 = Object.assign || function(target) {
|
|
10407
|
+
for(var i = 1; i < arguments.length; i++){
|
|
10408
|
+
var source = arguments[i];
|
|
10409
|
+
for(var key in source){
|
|
10410
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10411
|
+
target[key] = source[key];
|
|
10412
|
+
}
|
|
10413
|
+
}
|
|
10414
|
+
}
|
|
10415
|
+
return target;
|
|
10416
|
+
};
|
|
10417
|
+
return _extends$6.apply(this, arguments);
|
|
10418
|
+
}
|
|
10419
|
+
function _inherits$7(subClass, superClass) {
|
|
10420
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
10421
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
10422
|
+
}
|
|
10423
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
10424
|
+
constructor: {
|
|
10425
|
+
value: subClass,
|
|
10426
|
+
writable: true,
|
|
10427
|
+
configurable: true
|
|
10428
|
+
}
|
|
10429
|
+
});
|
|
10430
|
+
if (superClass) _set_prototype_of$7(subClass, superClass);
|
|
10431
|
+
}
|
|
10432
|
+
function _set_prototype_of$7(o, p) {
|
|
10433
|
+
_set_prototype_of$7 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10434
|
+
o.__proto__ = p;
|
|
10435
|
+
return o;
|
|
10436
|
+
};
|
|
10437
|
+
return _set_prototype_of$7(o, p);
|
|
10394
10438
|
}
|
|
10439
|
+
// 支持的倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
10440
|
+
var SUPPORT_SPEED = [
|
|
10441
|
+
0.5,
|
|
10442
|
+
1,
|
|
10443
|
+
2,
|
|
10444
|
+
4,
|
|
10445
|
+
8,
|
|
10446
|
+
16
|
|
10447
|
+
]; // 8, 16
|
|
10448
|
+
var SPEED_DEFAULT_OPTIONS = {
|
|
10449
|
+
/**
|
|
10450
|
+
* 默认倍速 1, 如果传入的值不在列表中会使用 1 倍速,可能会没有选中
|
|
10451
|
+
* 暂时不支持初始化时设置倍速
|
|
10452
|
+
*/ // value: 1, // 对应list 中的 value
|
|
10453
|
+
// 这里不要设置多语言, 比较麻烦
|
|
10454
|
+
/**
|
|
10455
|
+
* 倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
10456
|
+
*/ list: SUPPORT_SPEED.reverse().map(function(speed) {
|
|
10457
|
+
return {
|
|
10458
|
+
label: "" + speed + "x",
|
|
10459
|
+
value: speed
|
|
10460
|
+
};
|
|
10461
|
+
})
|
|
10462
|
+
};
|
|
10463
|
+
/**
|
|
10464
|
+
* 倍速切换控件, 不支持动态切换倍速列表
|
|
10465
|
+
*
|
|
10466
|
+
* 注意:
|
|
10467
|
+
* 1. 本地回放倍速需要设备本身支持才可以, 如果不支持切换后的倍数不会生效, 云端回放(云存储,云录制)倍速都是支持, 需要是 2 的指数,不能小于 0.5, 最大 16 倍;
|
|
10468
|
+
* 2. 标准流不支持;
|
|
10469
|
+
* @category Control
|
|
10470
|
+
*/ var Speed = /*#__PURE__*/ function(Select) {
|
|
10471
|
+
_inherits$7(Speed, Select);
|
|
10472
|
+
function Speed(options) {
|
|
10473
|
+
var _this;
|
|
10474
|
+
var _options_locales_options_language, _options_locales;
|
|
10475
|
+
_this = Select.call(this, _extends$6({}, SPEED_DEFAULT_OPTIONS, options, {
|
|
10476
|
+
value: (options.props.speed || 1) + '',
|
|
10477
|
+
classNameSuffix: 'speed',
|
|
10478
|
+
controlType: 'button',
|
|
10479
|
+
title: options == null ? void 0 : (_options_locales = options.locales) == null ? void 0 : (_options_locales_options_language = _options_locales[options.language]) == null ? void 0 : _options_locales_options_language.BTN_SPEED,
|
|
10480
|
+
onChange: function(value, item) {
|
|
10481
|
+
var _options_onChange;
|
|
10482
|
+
value = +value;
|
|
10483
|
+
options == null ? void 0 : (_options_onChange = options.onChange) == null ? void 0 : _options_onChange.call(options, value, item);
|
|
10484
|
+
_assert_this_initialized(_this).emit(EVENTS.control.speedChange, value, item);
|
|
10485
|
+
},
|
|
10486
|
+
onOpenChange: function(open, value, item) {
|
|
10487
|
+
var _options_onOpenChange;
|
|
10488
|
+
value = +value;
|
|
10489
|
+
options == null ? void 0 : (_options_onOpenChange = options.onOpenChange) == null ? void 0 : _options_onOpenChange.call(options, open, value, item);
|
|
10490
|
+
_assert_this_initialized(_this).emit(EVENTS.control.speedPanelOpenChange, open, value, item);
|
|
10491
|
+
}
|
|
10492
|
+
})) || this;
|
|
10493
|
+
_this._filterSpeedList(options.list, options.props.recType);
|
|
10494
|
+
_this.on(EVENTS.speedChange, function(speed) {
|
|
10495
|
+
if (_this.value !== speed + '') _this.value = speed + '';
|
|
10496
|
+
});
|
|
10497
|
+
_this.on(EVENTS.control.recTypeChange, function(type) {
|
|
10498
|
+
_this._filterSpeedList(options.list, type);
|
|
10499
|
+
});
|
|
10500
|
+
return _this;
|
|
10501
|
+
}
|
|
10502
|
+
var _proto = Speed.prototype;
|
|
10503
|
+
/**
|
|
10504
|
+
* 滤掉本地回放不支持的倍速
|
|
10505
|
+
* @param optionsList 初始化配置倍速列表
|
|
10506
|
+
* @param type 回放类型
|
|
10507
|
+
*/ _proto._filterSpeedList = function _filterSpeedList(optionsList, type) {
|
|
10508
|
+
if (!optionsList) {
|
|
10509
|
+
// 非用户自定义
|
|
10510
|
+
if (type === 'rec') {
|
|
10511
|
+
// 本地回放 不支持 8 16 32 倍速
|
|
10512
|
+
var list = this.list.filter(function(item) {
|
|
10513
|
+
return (item == null ? void 0 : item.value) && +item.value < 8;
|
|
10514
|
+
});
|
|
10515
|
+
this.updateOptions(list);
|
|
10516
|
+
} else {
|
|
10517
|
+
// 云端回放 支持 8 16 32 倍速
|
|
10518
|
+
this.updateOptions(SPEED_DEFAULT_OPTIONS.list);
|
|
10519
|
+
}
|
|
10520
|
+
}
|
|
10521
|
+
};
|
|
10522
|
+
_proto.reset = function reset(hide) {
|
|
10523
|
+
this.value = 1 + '';
|
|
10524
|
+
Select.prototype.reset.call(this, hide);
|
|
10525
|
+
};
|
|
10526
|
+
return Speed;
|
|
10527
|
+
}(Select);
|
|
10528
|
+
|
|
10529
|
+
var dist$2 = {};
|
|
10395
10530
|
|
|
10396
10531
|
/*
|
|
10397
|
-
* @ezuikit/control-date-picker v1.0.
|
|
10398
|
-
* Copyright (c) 2025-12-
|
|
10532
|
+
* @ezuikit/control-date-picker v1.0.4
|
|
10533
|
+
* Copyright (c) 2025-12-31 Ezviz-OpenBiz
|
|
10399
10534
|
* Released under the MIT License.
|
|
10400
10535
|
*/
|
|
10401
10536
|
|
|
10402
|
-
var hasRequiredDist$
|
|
10537
|
+
var hasRequiredDist$2;
|
|
10403
10538
|
|
|
10404
|
-
function requireDist$
|
|
10405
|
-
if (hasRequiredDist$
|
|
10406
|
-
hasRequiredDist$
|
|
10407
|
-
var delegate=requireDelegate(),utilsTools=requireDist$8(),deepmerge=requireCjs(),Picker=requireDist$9(),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;
|
|
10408
|
-
return dist$
|
|
10539
|
+
function requireDist$2 () {
|
|
10540
|
+
if (hasRequiredDist$2) return dist$2;
|
|
10541
|
+
hasRequiredDist$2 = 1;
|
|
10542
|
+
var delegate=requireDelegate(),utilsTools=requireDist$7(),deepmerge=requireCjs(),Picker=requireDist$8(),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$2.Calendar=Calendar,dist$2.DatePicker=DatePicker,dist$2.Header=Header,dist$2.Month=Month,dist$2.Year=Year;
|
|
10543
|
+
return dist$2;
|
|
10409
10544
|
}
|
|
10410
10545
|
|
|
10411
|
-
var distExports$1 = requireDist$
|
|
10546
|
+
var distExports$1 = requireDist$2();
|
|
10412
10547
|
|
|
10413
10548
|
function _extends$5() {
|
|
10414
10549
|
_extends$5 = Object.assign || function(target) {
|
|
@@ -10495,7 +10630,7 @@
|
|
|
10495
10630
|
],
|
|
10496
10631
|
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
10497
10632
|
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
10498
|
-
current:
|
|
10633
|
+
current: distExports$6.DateTime.toDate(this._value),
|
|
10499
10634
|
placement: 'tr',
|
|
10500
10635
|
triggerClose: true,
|
|
10501
10636
|
disabledDate: function(date) {
|
|
@@ -10568,7 +10703,7 @@
|
|
|
10568
10703
|
return DatePickerControl;
|
|
10569
10704
|
}(Control);
|
|
10570
10705
|
|
|
10571
|
-
var dist$
|
|
10706
|
+
var dist$1 = {};
|
|
10572
10707
|
|
|
10573
10708
|
/**
|
|
10574
10709
|
* drag scroll support move and touch
|
|
@@ -10580,12 +10715,12 @@
|
|
|
10580
10715
|
* LICENSE file in the root directory of this source tree.
|
|
10581
10716
|
*/
|
|
10582
10717
|
|
|
10583
|
-
var dist
|
|
10584
|
-
var hasRequiredDist$
|
|
10718
|
+
var dist;
|
|
10719
|
+
var hasRequiredDist$1;
|
|
10585
10720
|
|
|
10586
|
-
function requireDist$
|
|
10587
|
-
if (hasRequiredDist$
|
|
10588
|
-
hasRequiredDist$
|
|
10721
|
+
function requireDist$1 () {
|
|
10722
|
+
if (hasRequiredDist$1) return dist;
|
|
10723
|
+
hasRequiredDist$1 = 1;
|
|
10589
10724
|
|
|
10590
10725
|
/**
|
|
10591
10726
|
* 拖拽滚动状态
|
|
@@ -11020,151 +11155,23 @@
|
|
|
11020
11155
|
return DragScroll;
|
|
11021
11156
|
}();
|
|
11022
11157
|
|
|
11023
|
-
dist
|
|
11024
|
-
return dist$1;
|
|
11025
|
-
}
|
|
11026
|
-
|
|
11027
|
-
/*
|
|
11028
|
-
* delegate.js v4.0.0
|
|
11029
|
-
* Copyright (c) 2025-11-09
|
|
11030
|
-
* Released under the MIT License.
|
|
11031
|
-
*/
|
|
11032
|
-
|
|
11033
|
-
var dist;
|
|
11034
|
-
var hasRequiredDist$1;
|
|
11035
|
-
|
|
11036
|
-
function requireDist$1 () {
|
|
11037
|
-
if (hasRequiredDist$1) return dist;
|
|
11038
|
-
hasRequiredDist$1 = 1;
|
|
11039
|
-
|
|
11040
|
-
const DOCUMENT_NODE_TYPE = 9;
|
|
11041
|
-
/**
|
|
11042
|
-
* A polyfill for Element.matches()
|
|
11043
|
-
*/ if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
11044
|
-
const proto = Element.prototype;
|
|
11045
|
-
proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
|
|
11046
|
-
}
|
|
11047
|
-
/**
|
|
11048
|
-
* Finds the closest parent that matches a selector.
|
|
11049
|
-
*
|
|
11050
|
-
* @param {Element} element
|
|
11051
|
-
* @param {string} selector
|
|
11052
|
-
* @return {Element}
|
|
11053
|
-
*/ function closest(element, selector) {
|
|
11054
|
-
while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
|
|
11055
|
-
if (typeof element.matches === "function" && element.matches(selector)) {
|
|
11056
|
-
return element;
|
|
11057
|
-
}
|
|
11058
|
-
element = element.parentNode;
|
|
11059
|
-
}
|
|
11060
|
-
return null;
|
|
11061
|
-
}
|
|
11062
|
-
/**
|
|
11063
|
-
* Finds the closest parent that matches a selector.
|
|
11064
|
-
*
|
|
11065
|
-
* @param {Element} element
|
|
11066
|
-
* @param {string} selector
|
|
11067
|
-
* @return {Element}
|
|
11068
|
-
*/ function closestNative(element, selector) {
|
|
11069
|
-
return element && element.closest(selector);
|
|
11070
|
-
}
|
|
11071
|
-
var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
|
|
11072
|
-
|
|
11073
|
-
/**
|
|
11074
|
-
* Delegates event to a selector.
|
|
11075
|
-
*
|
|
11076
|
-
* @param {Element} element
|
|
11077
|
-
* @param {string} selector
|
|
11078
|
-
* @param {string} type
|
|
11079
|
-
* @param {Function} callback
|
|
11080
|
-
* @param {boolean} useCapture
|
|
11081
|
-
* @return {Object}
|
|
11082
|
-
*/ // prettier-ignore
|
|
11083
|
-
function _delegate(element, selector, type, callback, useCapture) {
|
|
11084
|
-
// prettier-ignore
|
|
11085
|
-
const listenerFn = listener.apply(this, arguments);
|
|
11086
|
-
element.addEventListener(type, listenerFn, useCapture);
|
|
11087
|
-
return {
|
|
11088
|
-
destroy: function() {
|
|
11089
|
-
element.removeEventListener(type, listenerFn, useCapture);
|
|
11090
|
-
}
|
|
11091
|
-
};
|
|
11092
|
-
}
|
|
11093
|
-
/**
|
|
11094
|
-
* Delegates event to a selector.
|
|
11095
|
-
*
|
|
11096
|
-
* @param {Element|string|Array} [elements]
|
|
11097
|
-
* @param {string | Element} selector
|
|
11098
|
-
* @param {string} type
|
|
11099
|
-
* @param {Function} callback
|
|
11100
|
-
* @param {boolean} useCapture
|
|
11101
|
-
* @return {Object}
|
|
11102
|
-
* @example
|
|
11103
|
-
* ```ts
|
|
11104
|
-
* const delegation = delegate(document.body, 'a', 'click', function (e) {})
|
|
11105
|
-
* // destroy (removeEventListener)
|
|
11106
|
-
* delegation.destroy();
|
|
11107
|
-
*
|
|
11108
|
-
* const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
|
|
11109
|
-
* // destroy (removeEventListener)
|
|
11110
|
-
* delegation1.destroy();
|
|
11111
|
-
* ```
|
|
11112
|
-
*/ // prettier-ignore
|
|
11113
|
-
function delegate(elements, selector, type, callback, useCapture) {
|
|
11114
|
-
// Handle the regular Element usage
|
|
11115
|
-
if (typeof elements.addEventListener === "function") {
|
|
11116
|
-
return _delegate.apply(null, arguments);
|
|
11117
|
-
}
|
|
11118
|
-
// Handle Element-less usage, it defaults to global delegation
|
|
11119
|
-
if (typeof type === "function") {
|
|
11120
|
-
// Use `document` as the first parameter, then apply arguments
|
|
11121
|
-
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|
11122
|
-
return _delegate.bind(null, document).apply(null, arguments);
|
|
11123
|
-
}
|
|
11124
|
-
// Handle Selector-based usage
|
|
11125
|
-
if (typeof elements === "string") {
|
|
11126
|
-
elements = document.querySelectorAll(elements);
|
|
11127
|
-
}
|
|
11128
|
-
// Handle Array-like based usage
|
|
11129
|
-
return Array.prototype.map.call(elements, function(element) {
|
|
11130
|
-
return _delegate(element, selector, type, callback, useCapture);
|
|
11131
|
-
});
|
|
11132
|
-
}
|
|
11133
|
-
/**
|
|
11134
|
-
* Finds closest match and invokes callback.
|
|
11135
|
-
*
|
|
11136
|
-
* @param {Element} element
|
|
11137
|
-
* @param {string} selector
|
|
11138
|
-
* @param {string} type
|
|
11139
|
-
* @param {Function} callback
|
|
11140
|
-
* @return {Function}
|
|
11141
|
-
*/ // prettier-ignore
|
|
11142
|
-
function listener(element, selector, type, callback) {
|
|
11143
|
-
return function(e) {
|
|
11144
|
-
e.delegateTarget = closest$1(e.target, selector);
|
|
11145
|
-
if (e.delegateTarget) {
|
|
11146
|
-
callback.call(element, e);
|
|
11147
|
-
}
|
|
11148
|
-
};
|
|
11149
|
-
}
|
|
11150
|
-
|
|
11151
|
-
dist = delegate;
|
|
11158
|
+
dist = DragScroll;
|
|
11152
11159
|
return dist;
|
|
11153
11160
|
}
|
|
11154
11161
|
|
|
11155
11162
|
/*
|
|
11156
|
-
* @ezuikit/control-time-line v1.0.
|
|
11157
|
-
* Copyright (c) 2025-12-
|
|
11163
|
+
* @ezuikit/control-time-line v1.0.6
|
|
11164
|
+
* Copyright (c) 2025-12-31 Ezviz-OpenBiz
|
|
11158
11165
|
* Released under the MIT License.
|
|
11159
11166
|
*/
|
|
11160
11167
|
|
|
11161
11168
|
var hasRequiredDist;
|
|
11162
11169
|
|
|
11163
11170
|
function requireDist () {
|
|
11164
|
-
if (hasRequiredDist) return dist$
|
|
11171
|
+
if (hasRequiredDist) return dist$1;
|
|
11165
11172
|
hasRequiredDist = 1;
|
|
11166
|
-
var deepmerge=requireCjs(),I18n=requireDist$7(),Picker=requireDist$9(),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小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();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)}ImageLazyLoader.isSupported="IntersectionObserver"in window;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._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_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._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_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;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(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._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=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;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,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 data-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),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(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.options.showCoverFold&&(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._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),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__imageLazyLoaderPicker,_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" data-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)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){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.setAttribute("data-error","true"),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;
|
|
11167
|
-
return dist$
|
|
11173
|
+
var deepmerge=requireCjs(),I18n=requireDist$6(),Picker=requireDist$8(),utilsTools=requireDist$7(),DragScroll=requireDist$1(),delegate=requireDelegate(),_$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.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.tranTimeToString=function(start,end){var _DateTime_toDate,_DateTime_toDate1,secondNum=Math.floor((null==(_DateTime_toDate=utilsTools.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=utilsTools.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?utilsTools.DateTime.fillZero(minute)+"'":"0'")+utilsTools.DateTime.fillZero(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小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();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)}ImageLazyLoader.isSupported="IntersectionObserver"in window;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._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_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._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_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:utilsTools.DateTime.format(record.startTime,"HH:mm:ss"),endTime:utilsTools.DateTime.format(record.endTime,"HH:mm:ss")})});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:utilsTools.DateTime.format(this.current||(new Date).getTime(),"HH:mm:ss")}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:utilsTools.DateTime.format(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(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._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=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(utilsTools.DateTime.format((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+"T"+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;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,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 data-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"}):""+utilsTools.DateTime.format(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),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(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.options.showCoverFold&&(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._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),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=utilsTools.DateTime.format(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(utilsTools.DateTime.format(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__imageLazyLoaderPicker,_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="'+utilsTools.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+utilsTools.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+utilsTools.DateTime.format(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" data-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)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){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.setAttribute("data-error","true"),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,utilsTools.DateTime.fillZero(Math.floor(second/3600))+":"+utilsTools.DateTime.fillZero(Math.floor(second%3600/60))+":"+utilsTools.DateTime.fillZero(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function isOverlap(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)}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:utilsTools.DateTime.toDate(time)});},_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(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*curScaleTime),"YYYY-MM-DD")).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(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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&&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$1.BaseTimeLine=BaseTimeLine,dist$1.MobileTimeLine=MobileTimeLine,dist$1.TimeLine=TimeLine;
|
|
11174
|
+
return dist$1;
|
|
11168
11175
|
}
|
|
11169
11176
|
|
|
11170
11177
|
var distExports = requireDist();
|
|
@@ -11407,6 +11414,7 @@
|
|
|
11407
11414
|
ptz: Ptz,
|
|
11408
11415
|
record: Record,
|
|
11409
11416
|
talk: Talk,
|
|
11417
|
+
broadcast: Broadcast,
|
|
11410
11418
|
zoom: Zoom$1,
|
|
11411
11419
|
definition: Definition,
|
|
11412
11420
|
fullscreen: Fullscreen,
|
|
@@ -12565,13 +12573,16 @@
|
|
|
12565
12573
|
_this.playing = true;
|
|
12566
12574
|
}
|
|
12567
12575
|
_this._initClassName();
|
|
12568
|
-
// 画布需要渲染在 this.contentControl.$
|
|
12576
|
+
// 画布需要渲染在 this.contentControl.$content 内
|
|
12569
12577
|
_this.contentControl = new Content({
|
|
12570
12578
|
getContainer: function() {
|
|
12571
12579
|
return _this.$container;
|
|
12572
12580
|
},
|
|
12573
12581
|
scaleMode: _this.scaleMode
|
|
12574
12582
|
});
|
|
12583
|
+
_this.contentControl.on(EVENTS.control.contentRerender, function(info) {
|
|
12584
|
+
_this.emit(EVENTS.control.contentRerender, info);
|
|
12585
|
+
});
|
|
12575
12586
|
// zoom utils
|
|
12576
12587
|
__zoom(_this, _this.contentControl.$content, _extends({}, _this.options.zoomOptions || {}, {
|
|
12577
12588
|
onTap: function() {
|
|
@@ -13122,138 +13133,153 @@
|
|
|
13122
13133
|
* 尺寸变化结束时 进行判断,为了节省开销
|
|
13123
13134
|
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
13124
13135
|
*/ _proto._footerMoreControlShow = function _footerMoreControlShow() {
|
|
13136
|
+
this._displayMore();
|
|
13137
|
+
};
|
|
13138
|
+
_proto._displayMore = function _displayMore() {
|
|
13125
13139
|
var _this = this;
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
13155
|
-
}
|
|
13156
|
-
});
|
|
13157
|
-
}
|
|
13158
|
-
//
|
|
13159
|
-
var list = (((_this__themeData = _this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
13160
|
-
var _this__footerMoreControl;
|
|
13161
|
-
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
13162
|
-
var _this_controls;
|
|
13163
|
-
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
13164
|
-
});
|
|
13165
|
-
return index === -1;
|
|
13166
|
-
});
|
|
13167
|
-
if (list.length <= 0) {
|
|
13168
|
-
return;
|
|
13169
|
-
}
|
|
13170
|
-
if (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
13171
|
-
// 为什么是两个, 因为More 也占用一个位置
|
|
13172
|
-
var popList = [
|
|
13173
|
-
list.pop(),
|
|
13174
|
-
list.pop()
|
|
13175
|
-
];
|
|
13176
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
13177
|
-
var item = _step.value;
|
|
13178
|
-
if (item) {
|
|
13179
|
-
var _this_controls_key_resetPopupContainer, _this_controls_key, _this_controls, _this_controls1, _this__footerMoreControl2;
|
|
13180
|
-
var key = "" + item.iconId + "Control";
|
|
13181
|
-
(_this_controls = _this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key, _this._footerMoreControl.$panel, 'prepend');
|
|
13182
|
-
(_this__footerMoreControl2 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls1 = _this.controls) == null ? void 0 : _this_controls1[key]);
|
|
13183
|
-
}
|
|
13140
|
+
if (this._footer) {
|
|
13141
|
+
var _this__footer_$left, _this__footer_$right;
|
|
13142
|
+
// 判断 footer 的控件是否能放置的下, 否则隐藏暂时 more 按钮
|
|
13143
|
+
var leftWidth = ((_this__footer_$left = this._footer.$left) == null ? void 0 : _this__footer_$left.clientWidth) || 0;
|
|
13144
|
+
var rightWidth = ((_this__footer_$right = this._footer.$right) == null ? void 0 : _this__footer_$right.clientWidth) || 0;
|
|
13145
|
+
// 当footer 中 left 和 right 宽度之和大于 footer 宽度,则 footer more 显示
|
|
13146
|
+
var collapseControl = this._width - leftWidth - rightWidth < 16; // 收拢控件到 More 中
|
|
13147
|
+
if (collapseControl) {
|
|
13148
|
+
var _this__footer, _this__themeData_footer, _this__themeData, _this__footerMoreControl_list, _this__footerMoreControl, _this__footerMoreControl_list1, _this__footerMoreControl1;
|
|
13149
|
+
if (!this._footerMoreControl && ((_this__footer = this._footer) == null ? void 0 : _this__footer.$right)) {
|
|
13150
|
+
this._footerMoreControl = new More({
|
|
13151
|
+
language: this.options.language,
|
|
13152
|
+
locales: this.i18n.translations,
|
|
13153
|
+
rootContainer: this.$container,
|
|
13154
|
+
getPopupContainer: function() {
|
|
13155
|
+
var _this__footer;
|
|
13156
|
+
return (_this__footer = _this._footer) == null ? void 0 : _this__footer.$right;
|
|
13157
|
+
},
|
|
13158
|
+
placement: 'tr',
|
|
13159
|
+
controls: this.controls,
|
|
13160
|
+
open: false,
|
|
13161
|
+
offset: [
|
|
13162
|
+
0,
|
|
13163
|
+
-8
|
|
13164
|
+
],
|
|
13165
|
+
wrapClassName: "" + PREFIX_CLASS + "-footer-more",
|
|
13166
|
+
onOpenChange: function(open) {
|
|
13167
|
+
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
13184
13168
|
}
|
|
13185
|
-
}
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13169
|
+
});
|
|
13170
|
+
}
|
|
13171
|
+
//
|
|
13172
|
+
var list = (((_this__themeData = this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
13173
|
+
var _this__footerMoreControl;
|
|
13174
|
+
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
13175
|
+
var _this_controls;
|
|
13176
|
+
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
13177
|
+
});
|
|
13178
|
+
return index === -1;
|
|
13179
|
+
});
|
|
13180
|
+
if (list.length <= 0) return;
|
|
13181
|
+
if (((_this__footerMoreControl = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
13182
|
+
// 为什么是两个, 因为More 也占用一个位置
|
|
13183
|
+
var popList = [
|
|
13184
|
+
list.pop(),
|
|
13185
|
+
list.pop()
|
|
13186
|
+
];
|
|
13187
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
13188
|
+
var item = _step.value;
|
|
13189
|
+
if (item) {
|
|
13190
|
+
var _this_controls_key_$container, _this_controls_key, _this_controls, _this_controls_key_$container1, _this_controls_key1, _this_controls1, _this_controls_key_resetPopupContainer, _this_controls_key2, _this_controls2, _this_controls3, _this__footerMoreControl2;
|
|
13191
|
+
var key = "" + item.iconId + "Control";
|
|
13192
|
+
var width = ((_this_controls = this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_$container = _this_controls_key.$container) == null ? void 0 : _this_controls_key_$container.clientWidth) || 0;
|
|
13193
|
+
var height = ((_this_controls1 = this.controls) == null ? void 0 : (_this_controls_key1 = _this_controls1[key]) == null ? void 0 : (_this_controls_key_$container1 = _this_controls_key1.$container) == null ? void 0 : _this_controls_key_$container1.clientHeight) || 0;
|
|
13194
|
+
(_this_controls2 = this.controls) == null ? void 0 : (_this_controls_key2 = _this_controls2[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key2.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key2, this._footerMoreControl.$panel, 'prepend');
|
|
13195
|
+
(_this__footerMoreControl2 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls3 = this.controls) == null ? void 0 : _this_controls3[key], {
|
|
13196
|
+
width: width,
|
|
13197
|
+
height: height
|
|
13198
|
+
});
|
|
13194
13199
|
}
|
|
13195
13200
|
}
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13201
|
+
} else if (this._footerMoreControl) {
|
|
13202
|
+
var item1 = list.pop();
|
|
13203
|
+
if (item1) {
|
|
13204
|
+
var _this_controls_key_$container2, _this_controls_key3, _this_controls4, _this_controls_key_$container3, _this_controls_key4, _this_controls5, _this_controls_key_resetPopupContainer1, _this_controls_key5, _this_controls6, _this_controls7, _this__footerMoreControl3;
|
|
13205
|
+
var key1 = "" + item1.iconId + "Control";
|
|
13206
|
+
var width1 = ((_this_controls4 = this.controls) == null ? void 0 : (_this_controls_key3 = _this_controls4[key1]) == null ? void 0 : (_this_controls_key_$container2 = _this_controls_key3.$container) == null ? void 0 : _this_controls_key_$container2.clientWidth) || 0;
|
|
13207
|
+
var height1 = ((_this_controls5 = this.controls) == null ? void 0 : (_this_controls_key4 = _this_controls5[key1]) == null ? void 0 : (_this_controls_key_$container3 = _this_controls_key4.$container) == null ? void 0 : _this_controls_key_$container3.clientHeight) || 0;
|
|
13208
|
+
(_this_controls6 = this.controls) == null ? void 0 : (_this_controls_key5 = _this_controls6[key1]) == null ? void 0 : (_this_controls_key_resetPopupContainer1 = _this_controls_key5.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer1.call(_this_controls_key5, this._footerMoreControl.$panel, 'prepend');
|
|
13209
|
+
(_this__footerMoreControl3 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl3.add(key1, item1.part, (_this_controls7 = this.controls) == null ? void 0 : _this_controls7[key1], {
|
|
13210
|
+
width: width1,
|
|
13211
|
+
height: height1
|
|
13212
|
+
});
|
|
13213
|
+
} else {
|
|
13214
|
+
return;
|
|
13203
13215
|
}
|
|
13204
|
-
}
|
|
13205
|
-
|
|
13216
|
+
}
|
|
13217
|
+
// prettier-ignore
|
|
13218
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl1 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list1 = _this__footerMoreControl1.list) == null ? void 0 : _this__footerMoreControl_list1.map(function(item) {
|
|
13219
|
+
return item.key;
|
|
13220
|
+
}));
|
|
13221
|
+
if (this._footerMoreControl) {
|
|
13222
|
+
// 防止 More 不存在导致死循环
|
|
13223
|
+
this._displayMore();
|
|
13224
|
+
}
|
|
13225
|
+
} else {
|
|
13226
|
+
var _this__footerMoreControl_list2, _this__footerMoreControl5, _this__footerMoreControl_list3, _this__footerMoreControl6;
|
|
13227
|
+
var offset = 50;
|
|
13228
|
+
// if (this._footerMoreControl?.list?.length && this._footerMoreControl?.list?.length > 2) {
|
|
13229
|
+
// offset = 16;
|
|
13230
|
+
// }
|
|
13231
|
+
if ((_this__footerMoreControl5 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list2 = _this__footerMoreControl5.list) == null ? void 0 : _this__footerMoreControl_list2.length) {
|
|
13232
|
+
offset = offset + this._footerMoreControl.list[0].width || 0;
|
|
13233
|
+
}
|
|
13234
|
+
if (((_this__footerMoreControl6 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list3 = _this__footerMoreControl6.list) == null ? void 0 : _this__footerMoreControl_list3.length) && this._width - leftWidth - rightWidth > offset) {
|
|
13235
|
+
var _this__footerMoreControl7, _this__footerMoreControl_list4, _this__footerMoreControl8, _this__footerMoreControl_list5, _this__footerMoreControl9;
|
|
13206
13236
|
// 110 是为了保住个别控件的宽度超出已知的值, 如英文下 按钮的宽度
|
|
13207
13237
|
// 从 More 中一次移除一个控件到 header/footer 中
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
var
|
|
13212
|
-
if (item2) {
|
|
13213
|
-
var
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
var
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
var _item_control_resetPopupContainer2, _item_control2;
|
|
13224
|
-
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, _this._footer.$right, 'before', _this._footerMoreControl.$container);
|
|
13225
|
-
}
|
|
13238
|
+
//
|
|
13239
|
+
var item2 = (_this__footerMoreControl7 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl7.list.shift();
|
|
13240
|
+
if (item2) {
|
|
13241
|
+
var _this__footerMoreControl10;
|
|
13242
|
+
if (item2.part === 'left') {
|
|
13243
|
+
var _item_control_resetPopupContainer, _item_control;
|
|
13244
|
+
(_item_control = item2.control) == null ? void 0 : (_item_control_resetPopupContainer = _item_control.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer.call(_item_control, this._footer.$left, 'append');
|
|
13245
|
+
} else if (item2.part === 'right') {
|
|
13246
|
+
var _this__footerMoreControl_list6, _this__footerMoreControl11;
|
|
13247
|
+
if (((_this__footerMoreControl11 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list6 = _this__footerMoreControl11.list) == null ? void 0 : _this__footerMoreControl_list6.length) === 0) {
|
|
13248
|
+
var _item_control_resetPopupContainer1, _item_control1;
|
|
13249
|
+
(_item_control1 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer1 = _item_control1.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer1.call(_item_control1, this._footer.$right, 'append');
|
|
13250
|
+
} else {
|
|
13251
|
+
var _item_control_resetPopupContainer2, _item_control2;
|
|
13252
|
+
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, this._footer.$right, 'before', this._footerMoreControl.$container);
|
|
13226
13253
|
}
|
|
13227
|
-
(_this__footerMoreControl8 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl8.remove(item2.control);
|
|
13228
13254
|
}
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
(
|
|
13255
|
+
(_this__footerMoreControl10 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl10.remove(item2.control);
|
|
13256
|
+
}
|
|
13257
|
+
if (((_this__footerMoreControl8 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list4 = _this__footerMoreControl8.list) == null ? void 0 : _this__footerMoreControl_list4.length) === 1) {
|
|
13258
|
+
var _this__footerMoreControl12, _this__footerMoreControl_destroy, _this__footerMoreControl13;
|
|
13259
|
+
// 最后一个, 移除 More
|
|
13260
|
+
var item11 = (_this__footerMoreControl12 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl12.list.shift();
|
|
13261
|
+
if (item11) {
|
|
13262
|
+
var _this__footerMoreControl14;
|
|
13263
|
+
if (item11.part === 'left') {
|
|
13264
|
+
var _item1_control_resetPopupContainer, _item1_control;
|
|
13265
|
+
(_item1_control = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer = _item1_control.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer.call(_item1_control, this._footer.$left, 'append');
|
|
13266
|
+
} else if (item11.part === 'right') {
|
|
13267
|
+
var _item1_control_resetPopupContainer1, _item1_control1;
|
|
13268
|
+
(_item1_control1 = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer1 = _item1_control1.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer1.call(_item1_control1, this._footer.$right, 'append');
|
|
13243
13269
|
}
|
|
13244
|
-
(
|
|
13245
|
-
_this._footerMoreControl = null;
|
|
13270
|
+
(_this__footerMoreControl14 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl14.remove(item11.control);
|
|
13246
13271
|
}
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
return item.key;
|
|
13250
|
-
}));
|
|
13251
|
-
displayMore();
|
|
13272
|
+
(_this__footerMoreControl13 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_destroy = _this__footerMoreControl13.destroy) == null ? void 0 : _this__footerMoreControl_destroy.call(_this__footerMoreControl13);
|
|
13273
|
+
this._footerMoreControl = null;
|
|
13252
13274
|
}
|
|
13275
|
+
// prettier-ignore
|
|
13276
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl9 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list5 = _this__footerMoreControl9.list) == null ? void 0 : _this__footerMoreControl_list5.map(function(item) {
|
|
13277
|
+
return item.key;
|
|
13278
|
+
}));
|
|
13279
|
+
this._displayMore();
|
|
13253
13280
|
}
|
|
13254
13281
|
}
|
|
13255
|
-
}
|
|
13256
|
-
displayMore();
|
|
13282
|
+
}
|
|
13257
13283
|
};
|
|
13258
13284
|
/**
|
|
13259
13285
|
* 移除事件
|
|
@@ -13331,6 +13357,7 @@
|
|
|
13331
13357
|
[
|
|
13332
13358
|
'ptz',
|
|
13333
13359
|
'talk',
|
|
13360
|
+
'broadcast',
|
|
13334
13361
|
'record',
|
|
13335
13362
|
'speed'
|
|
13336
13363
|
].forEach(function(key) {
|
|
@@ -13408,6 +13435,7 @@
|
|
|
13408
13435
|
[
|
|
13409
13436
|
'ptz',
|
|
13410
13437
|
'talk',
|
|
13438
|
+
'broadcast',
|
|
13411
13439
|
'record'
|
|
13412
13440
|
].forEach(function(key) {
|
|
13413
13441
|
var _this_controls;
|
|
@@ -13768,7 +13796,7 @@
|
|
|
13768
13796
|
zh: zh,
|
|
13769
13797
|
en: en
|
|
13770
13798
|
};
|
|
13771
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.
|
|
13799
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.11';
|
|
13772
13800
|
|
|
13773
13801
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13774
13802
|
|