@clickview/lite 0.23.0-rc.2 → 0.23.0-rc.3
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/bundles.json +1 -1
- package/dist/languages/en.json +1 -1
- package/dist/scripts/1354-d6d6781693-lite.chunk.js +2 -0
- package/dist/scripts/{1924-6b2a7d2e30-lite.chunk.js → 1924-ac80bc2a14-lite.chunk.js} +1 -1
- package/dist/scripts/7318-c6ae302a32-lite.chunk.js +2 -0
- package/dist/scripts/{9686-f8a4d6223a-lite.chunk.js → 9686-9942352281-lite.chunk.js} +1 -1
- package/dist/scripts/{bundle-2abbbd4709.min.js → bundle-bc26a9c803.min.js} +2 -2
- package/package.json +2 -2
- package/dist/scripts/2281-5f9df566c5-lite.chunk.js +0 -2
- package/dist/scripts/7318-b73e12f5a8-lite.chunk.js +0 -2
- /package/dist/scripts/{2281-5f9df566c5-lite.chunk.js.LICENSE.txt → 1354-d6d6781693-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{7318-b73e12f5a8-lite.chunk.js.LICENSE.txt → 7318-c6ae302a32-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-2abbbd4709.min.js.LICENSE.txt → bundle-bc26a9c803.min.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9686],{99686:(e,t,r)=>{r.r(t),r.d(t,{EditClipTimepointsView:()=>ke});var n=r(1024),i=r.n(n),o=r(20354),a=r(81886),u=r(23481),c=r(47812),l=r(39151),s=r(497),f=r(69591),p=r(24967);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==d(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===d(i)?i:String(i)),n)}var i}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},h.apply(this,arguments)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(n);if(i){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"buildCSSClass",value:function(){return"cv-clip-timepoint-handle ".concat(h(v(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,t,r){return h(v(a.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},t),{className:this.buildCSSClass(),innerHTML:'<svg viewBox="0 0 5 14" pointer-events="none"><g id="Clips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Clip-2" transform="translate(-835.000000, -632.000000)" fill="#FFFFFF"><g id="Video-Copy" transform="translate(275.000000, 96.000000)"><g id="Handles" transform="translate(560.000000, 536.000000)"><circle id="Oval" cx="1" cy="1" r="1"></circle><circle id="Oval-Copy-2" cx="1" cy="5" r="1"></circle><circle id="Oval-Copy-4" cx="1" cy="9" r="1"></circle><circle id="Oval-Copy-8" cx="1" cy="13" r="1"></circle><circle id="Oval-Copy" cx="4" cy="1" r="1"></circle><circle id="Oval-Copy-3" cx="4" cy="5" r="1"></circle><circle id="Oval-Copy-5" cx="4" cy="9" r="1"></circle><circle id="Oval-Copy-9" cx="4" cy="13" r="1"></circle></g></g></g></g></svg>'}),r)}},{key:"isEventTarget",value:function(e){return this.el().contains(e.target)}}])&&y(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===g(i)?i:String(i)),n)}var i}function w(){return w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},w.apply(this,arguments)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(i){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).dragStartActive=!1,r.dragEndActive=!1,r.dragSliderActive=!1,r.dragSliderCurrentPosition=null,r.minDuration=Math.min(e.duration(),r.options_.minDuration),r.setStartTime(t.startTime,!1),r.setEndTime(t.endTime,!1),r.startHandle=new b(r.player(),t),r.startHandle.addClass("cv-clip-start-handle"),r.addChild(r.startHandle),r.endHandle=new b(r.player(),t),r.endHandle.addClass("cv-clip-end-handle"),r.addChild(r.endHandle),r.on(r.player(),"update:clip:start:time",(function(e){var t=e.time;return r.setStartTime(t)})),r.on(r.player(),"update:clip:end:time",(function(e){var t=e.time;return r.setEndTime(t)})),r.bindListeners(),r.update(),r}return t=a,r=[{key:"createEl",value:function(){return w(O(a.prototype),"createEl",this).call(this,"div",{className:"cv-clip-timepoint-selector"},{})}},{key:"update",value:function(){var e=this;this.options_.onChangeStartTime(this.startTime),this.options_.onChangeEndTime(this.endTime),this.requestAnimationFrame((function(){e.setStartOffset(),e.setWidth()}))}},{key:"setStartTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var r=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,n=this.player().duration()-this.minDuration;if(e>n&&(e=n),e<0&&(e=0),this.startTime=e,this.endTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof r?this.startTime+r:this.startTime+this.minDuration;this.setEndTime(i)}this.player().currentTime(this.startTime),t&&this.update()}}},{key:"setEndTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var r=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,n=this.minDuration;if(e<n&&(e=n),e>this.player().duration()&&(e=this.player().duration()),this.endTime=e,this.startTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof r?this.endTime-r:this.endTime-this.minDuration;this.setStartTime(i)}t&&this.update()}}},{key:"bindListeners",value:function(){var e=this;this.onTimeupdate=this.onTimeupdate.bind(this),this.player().on("timeupdate",this.onTimeupdate),this.on("mousedown",this.dragStart),this.on("touchstart",this.dragStart),this.player().on("dispose",(function(){e.player().off("timeupdate",e.onTimeupdate),e.off("mousedown",e.dragStart),e.off("touchstart",e.dragStart)}))}},{key:"hasStartTime",value:function(){return"number"==typeof this.startTime}},{key:"hasEndTime",value:function(){return"number"==typeof this.endTime}},{key:"onTimeupdate",value:function(){var e=this.player().currentTime();e>this.endTime&&e<this.endTime+.5&&this.player().pause()}},{key:"dragStart",value:function(e){this.startHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragStartActive=!0),this.endHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragEndActive=!0),e.target===this.el()&&(e.stopImmediatePropagation(),this.dragSliderActive=!0,this.dragSliderCurrentPosition=this.getPosition(e));var t=this.el().ownerDocument;this.on(t,"mousemove",this.drag),this.on(t,"mouseup",this.dragEnd),this.on(t,"touchmove",this.drag),this.on(t,"touchend",this.dragEnd),this.drag(e)}},{key:"dragEnd",value:function(){this.dragStartActive=!1,this.dragEndActive=!1,this.dragSliderActive=!1,this.dragSliderCurrentPosition=null;var e=this.el().ownerDocument;this.off(e,"mousemove",this.drag),this.off(e,"mouseup",this.dragEnd),this.off(e,"touchmove",this.drag),this.off(e,"touchend",this.dragEnd)}},{key:"drag",value:function(e){if((this.dragStartActive||this.dragEndActive||this.dragSliderActive)&&p.Z.dom.isSingleLeftClick(e)){var t=this.getPosition(e),r=t*this.player().duration();this.dragStartActive&&this.handleStartHandleDrag(r),this.dragEndActive&&this.handleEndHandleDrag(r),this.dragSliderActive&&this.handleSliderDrag(t)}}},{key:"handleStartHandleDrag",value:function(e){this.setStartTime(e)}},{key:"handleEndHandleDrag",value:function(e){this.setEndTime(e)}},{key:"handleSliderDrag",value:function(e){var t=(e-this.dragSliderCurrentPosition)*this.player().duration(),r=this.startTime+t,n=this.endTime+t;r<=0||n>=this.player().duration()||(this.dragSliderCurrentPosition=e,this.setStartTime(r),this.setEndTime(n))}},{key:"getPosition",value:function(e){return p.Z.dom.getPointerPosition(this.el_.parentNode,e).x}},{key:"setStartOffset",value:function(){this.el_.style.marginLeft="".concat(this.getPercentage(this.startTime),"%")}},{key:"setWidth",value:function(){this.el_.style.width="".concat(this.getPercentage(this.endTime-this.startTime),"%")}},{key:"getPercentage",value:function(e){return+(e/this.player().duration()*100).toFixed(4)}}],r&&T(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==E(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===E(i)?i:String(i)),n)}var i}function j(){return j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=k(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},j.apply(this,arguments)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(n);if(i){var r=k(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).seekBar_=t.seekBar,r.playProgressBar_=t.playProgressBar,r.bindListeners(),r.player_.one("dispose",(function(){r.unbindListeners()})),r}return t=a,(r=[{key:"createEl",value:function(e,t,r){return j(k(a.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},t),{className:"cv-create-clip-progress-indicator"}),r)}},{key:"bindListeners",value:function(){this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown)}},{key:"unbindListeners",value:function(){var e=this.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp)}},{key:"handleMouseDown",value:function(e){if(p.Z.dom.isSingleLeftClick(e)){e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||p.Z.browser.IS_CHROME||e.preventDefault(),this.player_.scrubbing(!0),this.videoWasPlaying_=!this.player_.paused(),this.player_.pause(),p.Z.dom.blockTextSelection();var t=this.el_.ownerDocument;this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e),this.player_.addClass("cv-hide-mouse-time")}}},{key:"handleMouseMove",value:function(e){if(p.Z.dom.isSingleLeftClick(e)){var t=p.Z.dom.getPointerPosition(this.seekBar_.el_,e).x*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.playProgressBar_.update()}}},{key:"handleMouseUp",value:function(e){p.Z.dom.unblockTextSelection();var t=this.el_.ownerDocument;this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),null==e||e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying_&&this.player_.play(),this.seekBar_.update(),this.player_.removeClass("cv-hide-mouse-time")}}])&&C(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==D(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===D(i)?i:String(i)),n)}var i}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}p.Z.registerComponent("CreateClipProgressIndicator",R);var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(n);if(i){var r=A(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).addClass("cv-create-clip-seek-bar"),r}return t=a,(r=[{key:"initialize",value:function(e){var t=new P(this.player(),e);this.addChild(t);var r=this.getChild("playProgressBar"),n=new R(this.player_,{seekBar:this,playProgressBar:r});r.addChild(n)}}])&&B(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("SeekBar"));function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function I(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==M(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===M(i)?i:String(i)),n)}var i}function L(){return L="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=F(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},L.apply(this,arguments)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function Z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}N.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},p.Z.browser.IS_IOS||p.Z.browser.IS_ANDROID||N.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),p.Z.registerComponent("CreateClipSeekBar",N);var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(n);if(i){var r=F(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Z(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).options=t,r.initCreateClipSeekBar=r.initCreateClipSeekBar.bind(Z(r)),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initCreateClipSeekBar)})),r}return t=a,(r=[{key:"initCreateClipSeekBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");if(t){var r=!isNaN(this.options.startTime)&&this.options.startTime>=0?this.options.startTime:0,n=!isNaN(this.options.endTime)&&this.options.endTime<=this.player.duration()?this.options.endTime:this.player.duration(),i=Math.min(this.options.minDuration||5,this.player.duration());t.initialize({startTime:r,endTime:n,minDuration:i,onChangeStartTime:this.options.onChangeStartTime,onChangeEndTime:this.options.onChangeEndTime})}}},{key:"dispose",value:function(){this.player.off("loadedmetadata",this.initCreateClipSeekBar),L(F(a.prototype),"dispose",this).call(this)}}])&&I(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getPlugin("plugin"));function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function K(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==U(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===U(i)?i:String(i)),n)}var i}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=G(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},z.apply(this,arguments)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}p.Z.registerPlugin("createClipPlugin",V);var Q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=G(n);if(i){var r=G(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,e,Object.assign(Object.assign({},t),{playbackRates:null,enableLocalCache:!1}))}return t=a,(r=[{key:"getPlayerClassName",value:function(){return"cv-create-clip-player"}},{key:"configurePlugins",value:function(){var e=this.options,t=e.startTime,r=e.endTime,n=e.minDuration,i=e.onChangeStartTime,o=e.onChangeEndTime;this.player.createClipPlugin({startTime:t,endTime:r,minDuration:n,onChangeStartTime:i,onChangeEndTime:o})}},{key:"getPlayerOptions",value:function(){var e=z(G(a.prototype),"getPlayerOptions",this).call(this);return e.inactivityTimeout=0,e}},{key:"getSeekBarName",value:function(){return"CreateClipSeekBar"}},{key:"getAnalyticsPlayerType",value:function(){return"create-clip-player"}}])&&K(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.r),$=r(63816);function q(e){var t=e.onReady,r=e.onDispose,n=i().useRef(),o=i().useRef();return i().useEffect((function(){var i;if(null===(i=o.current)||void 0===i||i.dispose(),n)return o.current=new Q(n.current,e),t&&o.current.ready((function(){t((0,$.G)(o.current))})),r&&o.current.one("dispose",r),function(){var e;null===(e=o.current)||void 0===e||e.dispose()}}),[e.viewKey]),i().useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:start:time",time:e.startTime})}),[e.startTime]),i().useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:end:time",time:e.endTime})}),[e.endTime]),i().createElement("div",{ref:n})}var J=r(93264),Y=r(83345),X=r(95047);const ee={container:"xvpu6",timeInput:"vW_eV",controlsContainer:"A8cSJ",arrowContainer:"lFyGP",downArrow:"kuLky",upArrow:"_zBG5"};function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=38,ie=40,oe=/[^0-9]/g,ae=/^0+/,ue=":",ce="00:00",le=6;function se(e){var t=function(e){var t=function(e){return J.T.ToDisplayDuration(1e3*e)},r=te(n.useState(t(e.value)),2),i=r[0],o=r[1];return n.useEffect((function(){o(t(e.value))}),[e.value]),[i,o]}(e),r=te(t,2),i=r[0],o=r[1];function a(){c(X.k.convertDurationToSeconds(i)+1)}function u(){c(X.k.convertDurationToSeconds(i)-1)}function c(t){t<0||e.maxValue&&t>e.maxValue||e.setTime(t)}return n.createElement("div",{className:"position-relative ".concat(ee.container)},n.createElement("input",{className:"form-control form-control".concat("md"===e.formSize?"-md":"-lg"," ").concat(e.hasError?"is-invalid":""," text-center ").concat(ee.timeInput," ").concat(e.hideButtons&&"px-2"),value:i,onChange:function(t){if(e.allowKeyboardInput){var r=function(e){var t=e.trim().replace(oe,"").replace(ae,"").slice(0,le);if(!t)return ce;for(var r=t.split(""),n=[],i=r.length-1;i>=0;i--){var o=n.indexOf(ue);(-1===o&&2===n.length||2===o)&&n.unshift(ue),n.unshift(r[i])}return 1!==n.length&&1!==n.indexOf(ue)||n.unshift("0"),2===n.length&&n.unshift("00",ue),n.join("")}(t.target.value);if(r){var n=X.k.convertDurationToSeconds(r);e.maxValue&&n>e.maxValue||o(r)}}},onBlur:function(){e.allowKeyboardInput&&c(X.k.convertDurationToSeconds(i))},onKeyDown:function(e){e.keyCode===ne&&a(),e.keyCode===ie&&u()},disabled:e.disabled}),!e.hideButtons&&n.createElement("div",{className:ee.controlsContainer},n.createElement("div",{className:ee.arrowContainer,onClick:a},n.createElement("div",{className:ee.upArrow})),n.createElement("div",{className:ee.arrowContainer,onClick:u},n.createElement("div",{className:ee.downArrow}))))}se.defaultProps={allowKeyboardInput:!0,size:"lg"};var fe="shared.clipTimeForm",pe=u.T.encloseNamespace(fe);function de(e){if(isNaN(e.startTime)||isNaN(e.endTime))return n.createElement(n.Fragment,null);var t=Math.floor(e.endTime)-Math.floor(e.startTime);return n.createElement("div",{className:"px-3"},n.createElement("form",{className:"form-inline justify-content-center pb-4"},n.createElement("div",{className:"form-group"},n.createElement(se,{value:e.startTime,setTime:e.setStartTime})),n.createElement("span",{className:"px-2"},"-"),n.createElement("div",{className:"form-group mr-2"},n.createElement(se,{value:e.endTime,setTime:e.setEndTime})),n.createElement("span",null,n.createElement("strong",null,n.createElement(Y.x,{namespace:fe,phrase:"duration"}))," ",J.T.ToDisplayDuration(1e3*t))),n.createElement("div",{className:"d-flex justify-content-end"},n.createElement("button",{className:"btn btn-link",onClick:e.onCancel},pe("cancel")),n.createElement("button",{className:"btn btn-dark",onClick:e.onSubmit},pe("next"))))}var ye=r(97291),he=r(14070),me=r(43012),ve=r(1575),be=r(89476),ge=r(60051),Te=r(28400),we=r(68677);function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Pe="edit-clip-timepoints",Ee="shared.editClipTimepoints",Ce=u.T.encloseNamespace(Ee),je=30,_e=5;function ke(e){var t,r,i,f=n.useRef(),p=e.startTime||0,d=Se(n.useState(p),2),y=d[0],h=d[1],m=Se(n.useState(p+je),2),v=m[0],b=m[1],g=o.a.useBasicFetch(l.L.config()),T=o.a.useBasicFetch(!!e.id&&me.e.clip(e.id)),w=(null===(r=null===(t=T.data)||void 0===t?void 0:t._parentVideo)||void 0===r?void 0:r.id)||e.videoId,S=o.a.useBasicFetch(!!w&&c.k.createViewKey(w,ge.f.MasterObject)),O=o.a.useBasicFetch(!!w&&ve.R.video(w)),P=(0,be.f)();return(0,we.M)({title:e.id?null===(i=T.data)||void 0===i?void 0:i.name:Ce("pageTitle")}),n.useEffect((function(){P.lock({id:Pe,title:u.T.getPhrase(Ee,"navLockTitle"),text:u.T.getPhrase(Ee,"navLockBody")})}),[]),n.useEffect((function(){T.data&&(h(T.data.startTime),b(T.data.endTime))}),[T.data]),e.id||e.videoId?n.createElement("div",{className:"px-3"},!!g.data&&!!S.data&&!!O.data&&(!e.id||!!T.data)&&n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"mb-3"},n.createElement(q,{onReady:function(e){f.current=e},playerApi:new URL(g.data.playerApiUrl),viewKey:S.data.viewKey,startTime:y,endTime:v,onChangeStartTime:h,onChangeEndTime:b,minDuration:_e,autoplay:!0})),n.createElement(de,{startTime:y,endTime:v,setStartTime:h,setEndTime:b,onSubmit:function(){var t="";y>v&&(t=Ce("startTimeGreaterThanEndTime")),v-y<_e&&(t=Ce("tooShort",{minDuration:_e})),t?function(e){s.M.render(n.createElement("p",null,e),{title:Ce("errorHeading"),cancelButtonProps:{variant:"link",text:Ce("close")}})}(t):(P.unlock(Pe),a.Q.AppLinkHelper.trigger({application:ye.O.CLIPS,action:e.id?he.e.Clips.EDIT_CLIP_DETAILS:he.e.Clips.CREATE_CLIP_DETAILS,args:e.id?[e.id]:[e.videoId],params:{startTime:y,endTime:v,isCopying:e.isCopying}}))},onCancel:function(){var e,t,r,n,i=null!==(t=null===(e=f.current)||void 0===e?void 0:e.currentTime())&&void 0!==t?t:0;a.Q.AppLinkHelper.trigger({application:ye.O.VIDEOS,action:he.e.Videos.PLAY_VIDEO,args:[null===(r=O.data)||void 0===r?void 0:r.id,Te.m.slugify(null===(n=O.data)||void 0===n?void 0:n.name)],params:{t:i}})}}))):n.createElement(n.Fragment,null)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9686],{99686:(e,t,r)=>{r.r(t),r.d(t,{EditClipTimepointsView:()=>ke});var n=r(1024),i=r.n(n),o=r(20354),a=r(81886),u=r(23481),c=r(47812),l=r(39151),s=r(497),f=r(69591),p=r(93861);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==d(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===d(i)?i:String(i)),n)}var i}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},h.apply(this,arguments)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(n);if(i){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(r=[{key:"buildCSSClass",value:function(){return"cv-clip-timepoint-handle ".concat(h(v(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,t,r){return h(v(a.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},t),{className:this.buildCSSClass(),innerHTML:'<svg viewBox="0 0 5 14" pointer-events="none"><g id="Clips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Clip-2" transform="translate(-835.000000, -632.000000)" fill="#FFFFFF"><g id="Video-Copy" transform="translate(275.000000, 96.000000)"><g id="Handles" transform="translate(560.000000, 536.000000)"><circle id="Oval" cx="1" cy="1" r="1"></circle><circle id="Oval-Copy-2" cx="1" cy="5" r="1"></circle><circle id="Oval-Copy-4" cx="1" cy="9" r="1"></circle><circle id="Oval-Copy-8" cx="1" cy="13" r="1"></circle><circle id="Oval-Copy" cx="4" cy="1" r="1"></circle><circle id="Oval-Copy-3" cx="4" cy="5" r="1"></circle><circle id="Oval-Copy-5" cx="4" cy="9" r="1"></circle><circle id="Oval-Copy-9" cx="4" cy="13" r="1"></circle></g></g></g></g></svg>'}),r)}},{key:"isEventTarget",value:function(e){return this.el().contains(e.target)}}])&&y(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===g(i)?i:String(i)),n)}var i}function w(){return w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},w.apply(this,arguments)}function S(e,t){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},S(e,t)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(i){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).dragStartActive=!1,r.dragEndActive=!1,r.dragSliderActive=!1,r.dragSliderCurrentPosition=null,r.minDuration=Math.min(e.duration(),r.options_.minDuration),r.setStartTime(t.startTime,!1),r.setEndTime(t.endTime,!1),r.startHandle=new b(r.player(),t),r.startHandle.addClass("cv-clip-start-handle"),r.addChild(r.startHandle),r.endHandle=new b(r.player(),t),r.endHandle.addClass("cv-clip-end-handle"),r.addChild(r.endHandle),r.on(r.player(),"update:clip:start:time",(function(e){var t=e.time;return r.setStartTime(t)})),r.on(r.player(),"update:clip:end:time",(function(e){var t=e.time;return r.setEndTime(t)})),r.bindListeners(),r.update(),r}return t=a,r=[{key:"createEl",value:function(){return w(O(a.prototype),"createEl",this).call(this,"div",{className:"cv-clip-timepoint-selector"},{})}},{key:"update",value:function(){var e=this;this.options_.onChangeStartTime(this.startTime),this.options_.onChangeEndTime(this.endTime),this.requestAnimationFrame((function(){e.setStartOffset(),e.setWidth()}))}},{key:"setStartTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var r=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,n=this.player().duration()-this.minDuration;if(e>n&&(e=n),e<0&&(e=0),this.startTime=e,this.endTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof r?this.startTime+r:this.startTime+this.minDuration;this.setEndTime(i)}this.player().currentTime(this.startTime),t&&this.update()}}},{key:"setEndTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var r=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,n=this.minDuration;if(e<n&&(e=n),e>this.player().duration()&&(e=this.player().duration()),this.endTime=e,this.startTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof r?this.endTime-r:this.endTime-this.minDuration;this.setStartTime(i)}t&&this.update()}}},{key:"bindListeners",value:function(){var e=this;this.onTimeupdate=this.onTimeupdate.bind(this),this.player().on("timeupdate",this.onTimeupdate),this.on("mousedown",this.dragStart),this.on("touchstart",this.dragStart),this.player().on("dispose",(function(){e.player().off("timeupdate",e.onTimeupdate),e.off("mousedown",e.dragStart),e.off("touchstart",e.dragStart)}))}},{key:"hasStartTime",value:function(){return"number"==typeof this.startTime}},{key:"hasEndTime",value:function(){return"number"==typeof this.endTime}},{key:"onTimeupdate",value:function(){var e=this.player().currentTime();e>this.endTime&&e<this.endTime+.5&&this.player().pause()}},{key:"dragStart",value:function(e){this.startHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragStartActive=!0),this.endHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragEndActive=!0),e.target===this.el()&&(e.stopImmediatePropagation(),this.dragSliderActive=!0,this.dragSliderCurrentPosition=this.getPosition(e));var t=this.el().ownerDocument;this.on(t,"mousemove",this.drag),this.on(t,"mouseup",this.dragEnd),this.on(t,"touchmove",this.drag),this.on(t,"touchend",this.dragEnd),this.drag(e)}},{key:"dragEnd",value:function(){this.dragStartActive=!1,this.dragEndActive=!1,this.dragSliderActive=!1,this.dragSliderCurrentPosition=null;var e=this.el().ownerDocument;this.off(e,"mousemove",this.drag),this.off(e,"mouseup",this.dragEnd),this.off(e,"touchmove",this.drag),this.off(e,"touchend",this.dragEnd)}},{key:"drag",value:function(e){if((this.dragStartActive||this.dragEndActive||this.dragSliderActive)&&p.Z.dom.isSingleLeftClick(e)){var t=this.getPosition(e),r=t*this.player().duration();this.dragStartActive&&this.handleStartHandleDrag(r),this.dragEndActive&&this.handleEndHandleDrag(r),this.dragSliderActive&&this.handleSliderDrag(t)}}},{key:"handleStartHandleDrag",value:function(e){this.setStartTime(e)}},{key:"handleEndHandleDrag",value:function(e){this.setEndTime(e)}},{key:"handleSliderDrag",value:function(e){var t=(e-this.dragSliderCurrentPosition)*this.player().duration(),r=this.startTime+t,n=this.endTime+t;r<=0||n>=this.player().duration()||(this.dragSliderCurrentPosition=e,this.setStartTime(r),this.setEndTime(n))}},{key:"getPosition",value:function(e){return p.Z.dom.getPointerPosition(this.el_.parentNode,e).x}},{key:"setStartOffset",value:function(){this.el_.style.marginLeft="".concat(this.getPercentage(this.startTime),"%")}},{key:"setWidth",value:function(){this.el_.style.width="".concat(this.getPercentage(this.endTime-this.startTime),"%")}},{key:"getPercentage",value:function(e){return+(e/this.player().duration()*100).toFixed(4)}}],r&&T(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==E(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===E(i)?i:String(i)),n)}var i}function j(){return j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=k(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},j.apply(this,arguments)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(n);if(i){var r=k(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).seekBar_=t.seekBar,r.playProgressBar_=t.playProgressBar,r.bindListeners(),r.player_.one("dispose",(function(){r.unbindListeners()})),r}return t=a,(r=[{key:"createEl",value:function(e,t,r){return j(k(a.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},t),{className:"cv-create-clip-progress-indicator"}),r)}},{key:"bindListeners",value:function(){this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown)}},{key:"unbindListeners",value:function(){var e=this.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp)}},{key:"handleMouseDown",value:function(e){if(p.Z.dom.isSingleLeftClick(e)){e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||p.Z.browser.IS_CHROME||e.preventDefault(),this.player_.scrubbing(!0),this.videoWasPlaying_=!this.player_.paused(),this.player_.pause(),p.Z.dom.blockTextSelection();var t=this.el_.ownerDocument;this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e),this.player_.addClass("cv-hide-mouse-time")}}},{key:"handleMouseMove",value:function(e){if(p.Z.dom.isSingleLeftClick(e)){var t=p.Z.dom.getPointerPosition(this.seekBar_.el_,e).x*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.playProgressBar_.update()}}},{key:"handleMouseUp",value:function(e){p.Z.dom.unblockTextSelection();var t=this.el_.ownerDocument;this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),null==e||e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying_&&this.player_.play(),this.seekBar_.update(),this.player_.removeClass("cv-hide-mouse-time")}}])&&C(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("Component"));function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==D(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===D(i)?i:String(i)),n)}var i}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}p.Z.registerComponent("CreateClipProgressIndicator",R);var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(n);if(i){var r=A(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).addClass("cv-create-clip-seek-bar"),r}return t=a,(r=[{key:"initialize",value:function(e){var t=new P(this.player(),e);this.addChild(t);var r=this.getChild("playProgressBar"),n=new R(this.player_,{seekBar:this,playProgressBar:r});r.addChild(n)}}])&&B(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getComponent("SeekBar"));function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function I(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==M(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===M(i)?i:String(i)),n)}var i}function L(){return L="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=F(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},L.apply(this,arguments)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function Z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}N.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},p.Z.browser.IS_IOS||p.Z.browser.IS_ANDROID||N.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),p.Z.registerComponent("CreateClipSeekBar",N);var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(n);if(i){var r=F(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Z(e)}(this,e)});function a(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=o.call(this,e,t)).options=t,r.initCreateClipSeekBar=r.initCreateClipSeekBar.bind(Z(r)),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initCreateClipSeekBar)})),r}return t=a,(r=[{key:"initCreateClipSeekBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");if(t){var r=!isNaN(this.options.startTime)&&this.options.startTime>=0?this.options.startTime:0,n=!isNaN(this.options.endTime)&&this.options.endTime<=this.player.duration()?this.options.endTime:this.player.duration(),i=Math.min(this.options.minDuration||5,this.player.duration());t.initialize({startTime:r,endTime:n,minDuration:i,onChangeStartTime:this.options.onChangeStartTime,onChangeEndTime:this.options.onChangeEndTime})}}},{key:"dispose",value:function(){this.player.off("loadedmetadata",this.initCreateClipSeekBar),L(F(a.prototype),"dispose",this).call(this)}}])&&I(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(p.Z.getPlugin("plugin"));function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function K(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==U(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===U(i)?i:String(i)),n)}var i}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=G(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},z.apply(this,arguments)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}p.Z.registerPlugin("createClipPlugin",V);var Q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(a,e);var t,r,n,i,o=(n=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=G(n);if(i){var r=G(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,e,Object.assign(Object.assign({},t),{playbackRates:null,enableLocalCache:!1}))}return t=a,(r=[{key:"getPlayerClassName",value:function(){return"cv-create-clip-player"}},{key:"configurePlugins",value:function(){var e=this.options,t=e.startTime,r=e.endTime,n=e.minDuration,i=e.onChangeStartTime,o=e.onChangeEndTime;this.player.createClipPlugin({startTime:t,endTime:r,minDuration:n,onChangeStartTime:i,onChangeEndTime:o})}},{key:"getPlayerOptions",value:function(){var e=z(G(a.prototype),"getPlayerOptions",this).call(this);return e.inactivityTimeout=0,e}},{key:"getSeekBarName",value:function(){return"CreateClipSeekBar"}},{key:"getAnalyticsPlayerType",value:function(){return"create-clip-player"}}])&&K(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(f.r),$=r(63816);function q(e){var t=e.onReady,r=e.onDispose,n=i().useRef(),o=i().useRef();return i().useEffect((function(){var i;if(null===(i=o.current)||void 0===i||i.dispose(),n)return o.current=new Q(n.current,e),t&&o.current.ready((function(){t((0,$.G)(o.current))})),r&&o.current.one("dispose",r),function(){var e;null===(e=o.current)||void 0===e||e.dispose()}}),[e.viewKey]),i().useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:start:time",time:e.startTime})}),[e.startTime]),i().useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:end:time",time:e.endTime})}),[e.endTime]),i().createElement("div",{ref:n})}var J=r(93264),Y=r(83345),X=r(95047);const ee={container:"xvpu6",timeInput:"vW_eV",controlsContainer:"A8cSJ",arrowContainer:"lFyGP",downArrow:"kuLky",upArrow:"_zBG5"};function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=38,ie=40,oe=/[^0-9]/g,ae=/^0+/,ue=":",ce="00:00",le=6;function se(e){var t=function(e){var t=function(e){return J.T.ToDisplayDuration(1e3*e)},r=te(n.useState(t(e.value)),2),i=r[0],o=r[1];return n.useEffect((function(){o(t(e.value))}),[e.value]),[i,o]}(e),r=te(t,2),i=r[0],o=r[1];function a(){c(X.k.convertDurationToSeconds(i)+1)}function u(){c(X.k.convertDurationToSeconds(i)-1)}function c(t){t<0||e.maxValue&&t>e.maxValue||e.setTime(t)}return n.createElement("div",{className:"position-relative ".concat(ee.container)},n.createElement("input",{className:"form-control form-control".concat("md"===e.formSize?"-md":"-lg"," ").concat(e.hasError?"is-invalid":""," text-center ").concat(ee.timeInput," ").concat(e.hideButtons&&"px-2"),value:i,onChange:function(t){if(e.allowKeyboardInput){var r=function(e){var t=e.trim().replace(oe,"").replace(ae,"").slice(0,le);if(!t)return ce;for(var r=t.split(""),n=[],i=r.length-1;i>=0;i--){var o=n.indexOf(ue);(-1===o&&2===n.length||2===o)&&n.unshift(ue),n.unshift(r[i])}return 1!==n.length&&1!==n.indexOf(ue)||n.unshift("0"),2===n.length&&n.unshift("00",ue),n.join("")}(t.target.value);if(r){var n=X.k.convertDurationToSeconds(r);e.maxValue&&n>e.maxValue||o(r)}}},onBlur:function(){e.allowKeyboardInput&&c(X.k.convertDurationToSeconds(i))},onKeyDown:function(e){e.keyCode===ne&&a(),e.keyCode===ie&&u()},disabled:e.disabled}),!e.hideButtons&&n.createElement("div",{className:ee.controlsContainer},n.createElement("div",{className:ee.arrowContainer,onClick:a},n.createElement("div",{className:ee.upArrow})),n.createElement("div",{className:ee.arrowContainer,onClick:u},n.createElement("div",{className:ee.downArrow}))))}se.defaultProps={allowKeyboardInput:!0,size:"lg"};var fe="shared.clipTimeForm",pe=u.T.encloseNamespace(fe);function de(e){if(isNaN(e.startTime)||isNaN(e.endTime))return n.createElement(n.Fragment,null);var t=Math.floor(e.endTime)-Math.floor(e.startTime);return n.createElement("div",{className:"px-3"},n.createElement("form",{className:"form-inline justify-content-center pb-4"},n.createElement("div",{className:"form-group"},n.createElement(se,{value:e.startTime,setTime:e.setStartTime})),n.createElement("span",{className:"px-2"},"-"),n.createElement("div",{className:"form-group mr-2"},n.createElement(se,{value:e.endTime,setTime:e.setEndTime})),n.createElement("span",null,n.createElement("strong",null,n.createElement(Y.x,{namespace:fe,phrase:"duration"}))," ",J.T.ToDisplayDuration(1e3*t))),n.createElement("div",{className:"d-flex justify-content-end"},n.createElement("button",{className:"btn btn-link",onClick:e.onCancel},pe("cancel")),n.createElement("button",{className:"btn btn-dark",onClick:e.onSubmit},pe("next"))))}var ye=r(97291),he=r(14070),me=r(43012),ve=r(1575),be=r(89476),ge=r(60051),Te=r(28400),we=r(68677);function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,u=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Pe="edit-clip-timepoints",Ee="shared.editClipTimepoints",Ce=u.T.encloseNamespace(Ee),je=30,_e=5;function ke(e){var t,r,i,f=n.useRef(),p=e.startTime||0,d=Se(n.useState(p),2),y=d[0],h=d[1],m=Se(n.useState(p+je),2),v=m[0],b=m[1],g=o.a.useBasicFetch(l.L.config()),T=o.a.useBasicFetch(!!e.id&&me.e.clip(e.id)),w=(null===(r=null===(t=T.data)||void 0===t?void 0:t._parentVideo)||void 0===r?void 0:r.id)||e.videoId,S=o.a.useBasicFetch(!!w&&c.k.createViewKey(w,ge.f.MasterObject)),O=o.a.useBasicFetch(!!w&&ve.R.video(w)),P=(0,be.f)();return(0,we.M)({title:e.id?null===(i=T.data)||void 0===i?void 0:i.name:Ce("pageTitle")}),n.useEffect((function(){P.lock({id:Pe,title:u.T.getPhrase(Ee,"navLockTitle"),text:u.T.getPhrase(Ee,"navLockBody")})}),[]),n.useEffect((function(){T.data&&(h(T.data.startTime),b(T.data.endTime))}),[T.data]),e.id||e.videoId?n.createElement("div",{className:"px-3"},!!g.data&&!!S.data&&!!O.data&&(!e.id||!!T.data)&&n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"mb-3"},n.createElement(q,{onReady:function(e){f.current=e},playerApi:new URL(g.data.playerApiUrl),viewKey:S.data.viewKey,startTime:y,endTime:v,onChangeStartTime:h,onChangeEndTime:b,minDuration:_e,autoplay:!0})),n.createElement(de,{startTime:y,endTime:v,setStartTime:h,setEndTime:b,onSubmit:function(){var t="";y>v&&(t=Ce("startTimeGreaterThanEndTime")),v-y<_e&&(t=Ce("tooShort",{minDuration:_e})),t?function(e){s.M.render(n.createElement("p",null,e),{title:Ce("errorHeading"),cancelButtonProps:{variant:"link",text:Ce("close")}})}(t):(P.unlock(Pe),a.Q.AppLinkHelper.trigger({application:ye.O.CLIPS,action:e.id?he.e.Clips.EDIT_CLIP_DETAILS:he.e.Clips.CREATE_CLIP_DETAILS,args:e.id?[e.id]:[e.videoId],params:{startTime:y,endTime:v,isCopying:e.isCopying}}))},onCancel:function(){var e,t,r,n,i=null!==(t=null===(e=f.current)||void 0===e?void 0:e.currentTime())&&void 0!==t?t:0;a.Q.AppLinkHelper.trigger({application:ye.O.VIDEOS,action:he.e.Videos.PLAY_VIDEO,args:[null===(r=O.data)||void 0===r?void 0:r.id,Te.m.slugify(null===(n=O.data)||void 0===n?void 0:n.name)],params:{t:i}})}}))):n.createElement(n.Fragment,null)}}}]);
|