diff --git a/dist/dnm-react-video-cut.es.js b/dist/dnm-react-video-cut.es.js index d44edeb..dc075b9 100644 --- a/dist/dnm-react-video-cut.es.js +++ b/dist/dnm-react-video-cut.es.js @@ -30041,7 +30041,7 @@ DnmVideoCut.propTypes = { minDuration: PropTypes.number, muted: PropTypes.bool, onMuteChange: PropTypes.func, - playerCursorWidth: PropTypes.oneOfType([PropTypes.func, PropTypes["int"]]) + playerCursorWidth: PropTypes.oneOfType([PropTypes.func, PropTypes.number]) }; DnmVideoCut.defaultProps = { catalogue: { diff --git a/dist/dnm-react-video-cut.es.min.js b/dist/dnm-react-video-cut.es.min.js index 7019cf7..25ae1b4 100644 --- a/dist/dnm-react-video-cut.es.min.js +++ b/dist/dnm-react-video-cut.es.min.js @@ -28,4 +28,4 @@ var qo=Object.getOwnPropertySymbols,Xo=Object.prototype.hasOwnProperty,Go=Object * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var $b,Yb=Array.prototype,Kb=Object.prototype.hasOwnProperty,qb=Ks?Ks.iterator:void 0,Xb=Math.max,Gb=Math.min,Zb=function(e){return function(t,n,r){if(null==r){var o=fc(n),i=o&&_f(n),a=i&&i.length&&Xv(n,i);(a?a.length:o)||(r=n,n=t,t=this)}return e(t,n,r)}}(tm);ol.after=Tb.after,ol.ary=Tb.ary,ol.assign=Fb.assign,ol.assignIn=Fb.assignIn,ol.assignInWith=Fb.assignInWith,ol.assignWith=Fb.assignWith,ol.at=Fb.at,ol.before=Tb.before,ol.bind=Tb.bind,ol.bindAll=Bb.bindAll,ol.bindKey=Tb.bindKey,ol.castArray=Db.castArray,ol.chain=Wb.chain,ol.chunk=Cb.chunk,ol.compact=Cb.compact,ol.concat=Cb.concat,ol.cond=Bb.cond,ol.conforms=Bb.conforms,ol.constant=Bb.constant,ol.countBy=Pb.countBy,ol.create=Fb.create,ol.curry=Tb.curry,ol.curryRight=Tb.curryRight,ol.debounce=Tb.debounce,ol.defaults=Fb.defaults,ol.defaultsDeep=Fb.defaultsDeep,ol.defer=Tb.defer,ol.delay=Tb.delay,ol.difference=Cb.difference,ol.differenceBy=Cb.differenceBy,ol.differenceWith=Cb.differenceWith,ol.drop=Cb.drop,ol.dropRight=Cb.dropRight,ol.dropRightWhile=Cb.dropRightWhile,ol.dropWhile=Cb.dropWhile,ol.fill=Cb.fill,ol.filter=Pb.filter,ol.flatMap=Pb.flatMap,ol.flatMapDeep=Pb.flatMapDeep,ol.flatMapDepth=Pb.flatMapDepth,ol.flatten=Cb.flatten,ol.flattenDeep=Cb.flattenDeep,ol.flattenDepth=Cb.flattenDepth,ol.flip=Tb.flip,ol.flow=Bb.flow,ol.flowRight=Bb.flowRight,ol.fromPairs=Cb.fromPairs,ol.functions=Fb.functions,ol.functionsIn=Fb.functionsIn,ol.groupBy=Pb.groupBy,ol.initial=Cb.initial,ol.intersection=Cb.intersection,ol.intersectionBy=Cb.intersectionBy,ol.intersectionWith=Cb.intersectionWith,ol.invert=Fb.invert,ol.invertBy=Fb.invertBy,ol.invokeMap=Pb.invokeMap,ol.iteratee=Bb.iteratee,ol.keyBy=Pb.keyBy,ol.keys=_f,ol.keysIn=Fb.keysIn,ol.map=Pb.map,ol.mapKeys=Fb.mapKeys,ol.mapValues=Fb.mapValues,ol.matches=Bb.matches,ol.matchesProperty=Bb.matchesProperty,ol.memoize=Tb.memoize,ol.merge=Fb.merge,ol.mergeWith=Fb.mergeWith,ol.method=Bb.method,ol.methodOf=Bb.methodOf,ol.mixin=Zb,ol.negate=rm,ol.nthArg=Bb.nthArg,ol.omit=Fb.omit,ol.omitBy=Fb.omitBy,ol.once=Tb.once,ol.orderBy=Pb.orderBy,ol.over=Bb.over,ol.overArgs=Tb.overArgs,ol.overEvery=Bb.overEvery,ol.overSome=Bb.overSome,ol.partial=Tb.partial,ol.partialRight=Tb.partialRight,ol.partition=Pb.partition,ol.pick=Fb.pick,ol.pickBy=Fb.pickBy,ol.property=Bb.property,ol.propertyOf=Bb.propertyOf,ol.pull=Cb.pull,ol.pullAll=Cb.pullAll,ol.pullAllBy=Cb.pullAllBy,ol.pullAllWith=Cb.pullAllWith,ol.pullAt=Cb.pullAt,ol.range=Bb.range,ol.rangeRight=Bb.rangeRight,ol.rearg=Tb.rearg,ol.reject=Pb.reject,ol.remove=Cb.remove,ol.rest=Tb.rest,ol.reverse=Cb.reverse,ol.sampleSize=Pb.sampleSize,ol.set=Fb.set,ol.setWith=Fb.setWith,ol.shuffle=Pb.shuffle,ol.slice=Cb.slice,ol.sortBy=Pb.sortBy,ol.sortedUniq=Cb.sortedUniq,ol.sortedUniqBy=Cb.sortedUniqBy,ol.split=Vb.split,ol.spread=Tb.spread,ol.tail=Cb.tail,ol.take=Cb.take,ol.takeRight=Cb.takeRight,ol.takeRightWhile=Cb.takeRightWhile,ol.takeWhile=Cb.takeWhile,ol.tap=Wb.tap,ol.throttle=Tb.throttle,ol.thru=Gg,ol.toArray=Db.toArray,ol.toPairs=Fb.toPairs,ol.toPairsIn=Fb.toPairsIn,ol.toPath=Bb.toPath,ol.toPlainObject=Db.toPlainObject,ol.transform=Fb.transform,ol.unary=Tb.unary,ol.union=Cb.union,ol.unionBy=Cb.unionBy,ol.unionWith=Cb.unionWith,ol.uniq=Cb.uniq,ol.uniqBy=Cb.uniqBy,ol.uniqWith=Cb.uniqWith,ol.unset=Fb.unset,ol.unzip=Cb.unzip,ol.unzipWith=Cb.unzipWith,ol.update=Fb.update,ol.updateWith=Fb.updateWith,ol.values=Fb.values,ol.valuesIn=Fb.valuesIn,ol.without=Cb.without,ol.words=Vb.words,ol.wrap=Tb.wrap,ol.xor=Cb.xor,ol.xorBy=Cb.xorBy,ol.xorWith=Cb.xorWith,ol.zip=Cb.zip,ol.zipObject=Cb.zipObject,ol.zipObjectDeep=Cb.zipObjectDeep,ol.zipWith=Cb.zipWith,ol.entries=Fb.toPairs,ol.entriesIn=Fb.toPairsIn,ol.extend=Fb.assignIn,ol.extendWith=Fb.assignInWith,Zb(ol,ol),ol.add=Nb.add,ol.attempt=Bb.attempt,ol.camelCase=Vb.camelCase,ol.capitalize=Vb.capitalize,ol.ceil=Nb.ceil,ol.clamp=Rb,ol.clone=Db.clone,ol.cloneDeep=Db.cloneDeep,ol.cloneDeepWith=Db.cloneDeepWith,ol.cloneWith=Db.cloneWith,ol.conformsTo=Db.conformsTo,ol.deburr=Vb.deburr,ol.defaultTo=Bb.defaultTo,ol.divide=Nb.divide,ol.endsWith=Vb.endsWith,ol.eq=Db.eq,ol.escape=Vb.escape,ol.escapeRegExp=Vb.escapeRegExp,ol.every=Pb.every,ol.find=Pb.find,ol.findIndex=Cb.findIndex,ol.findKey=Fb.findKey,ol.findLast=Pb.findLast,ol.findLastIndex=Cb.findLastIndex,ol.findLastKey=Fb.findLastKey,ol.floor=Nb.floor,ol.forEach=Pb.forEach,ol.forEachRight=Pb.forEachRight,ol.forIn=Fb.forIn,ol.forInRight=Fb.forInRight,ol.forOwn=Fb.forOwn,ol.forOwnRight=Fb.forOwnRight,ol.get=Fb.get,ol.gt=Db.gt,ol.gte=Db.gte,ol.has=Fb.has,ol.hasIn=Fb.hasIn,ol.head=Cb.head,ol.identity=_c,ol.includes=Pb.includes,ol.indexOf=Cb.indexOf,ol.inRange=Lb,ol.invoke=Fb.invoke,ol.isArguments=Db.isArguments,ol.isArray=ic,ol.isArrayBuffer=Db.isArrayBuffer,ol.isArrayLike=Db.isArrayLike,ol.isArrayLikeObject=Db.isArrayLikeObject,ol.isBoolean=Db.isBoolean,ol.isBuffer=Db.isBuffer,ol.isDate=Db.isDate,ol.isElement=Db.isElement,ol.isEmpty=Db.isEmpty,ol.isEqual=Db.isEqual,ol.isEqualWith=Db.isEqualWith,ol.isError=Db.isError,ol.isFinite=Db.isFinite,ol.isFunction=Db.isFunction,ol.isInteger=Db.isInteger,ol.isLength=Db.isLength,ol.isMap=Db.isMap,ol.isMatch=Db.isMatch,ol.isMatchWith=Db.isMatchWith,ol.isNaN=Db.isNaN,ol.isNative=Db.isNative,ol.isNil=Db.isNil,ol.isNull=Db.isNull,ol.isNumber=Db.isNumber,ol.isObject=fc,ol.isObjectLike=Db.isObjectLike,ol.isPlainObject=Db.isPlainObject,ol.isRegExp=Db.isRegExp,ol.isSafeInteger=Db.isSafeInteger,ol.isSet=Db.isSet,ol.isString=Db.isString,ol.isSymbol=Db.isSymbol,ol.isTypedArray=Db.isTypedArray,ol.isUndefined=Db.isUndefined,ol.isWeakMap=Db.isWeakMap,ol.isWeakSet=Db.isWeakSet,ol.join=Cb.join,ol.kebabCase=Vb.kebabCase,ol.last=sv,ol.lastIndexOf=Cb.lastIndexOf,ol.lowerCase=Vb.lowerCase,ol.lowerFirst=Vb.lowerFirst,ol.lt=Db.lt,ol.lte=Db.lte,ol.max=Nb.max,ol.maxBy=Nb.maxBy,ol.mean=Nb.mean,ol.meanBy=Nb.meanBy,ol.min=Nb.min,ol.minBy=Nb.minBy,ol.stubArray=Bb.stubArray,ol.stubFalse=Bb.stubFalse,ol.stubObject=Bb.stubObject,ol.stubString=Bb.stubString,ol.stubTrue=Bb.stubTrue,ol.multiply=Nb.multiply,ol.nth=Cb.nth,ol.noop=Bb.noop,ol.now=Ab,ol.pad=Vb.pad,ol.padEnd=Vb.padEnd,ol.padStart=Vb.padStart,ol.parseInt=Vb.parseInt,ol.random=Ib,ol.reduce=Pb.reduce,ol.reduceRight=Pb.reduceRight,ol.repeat=Vb.repeat,ol.replace=Vb.replace,ol.result=Fb.result,ol.round=Nb.round,ol.sample=Pb.sample,ol.size=Pb.size,ol.snakeCase=Vb.snakeCase,ol.some=Pb.some,ol.sortedIndex=Cb.sortedIndex,ol.sortedIndexBy=Cb.sortedIndexBy,ol.sortedIndexOf=Cb.sortedIndexOf,ol.sortedLastIndex=Cb.sortedLastIndex,ol.sortedLastIndexBy=Cb.sortedLastIndexBy,ol.sortedLastIndexOf=Cb.sortedLastIndexOf,ol.startCase=Vb.startCase,ol.startsWith=Vb.startsWith,ol.subtract=Nb.subtract,ol.sum=Nb.sum,ol.sumBy=Nb.sumBy,ol.template=Vb.template,ol.times=Bb.times,ol.toFinite=Db.toFinite,ol.toInteger=bc,ol.toLength=Db.toLength,ol.toLower=Vb.toLower,ol.toNumber=Db.toNumber,ol.toSafeInteger=Db.toSafeInteger,ol.toString=Db.toString,ol.toUpper=Vb.toUpper,ol.trim=Vb.trim,ol.trimEnd=Vb.trimEnd,ol.trimStart=Vb.trimStart,ol.truncate=Vb.truncate,ol.unescape=Vb.unescape,ol.uniqueId=Bb.uniqueId,ol.upperCase=Vb.upperCase,ol.upperFirst=Vb.upperFirst,ol.each=Pb.forEach,ol.eachRight=Pb.forEachRight,ol.first=Cb.head,Zb(ol,($b={},Th(ol,(function(e,t){Kb.call(ol.prototype,t)||($b[t]=e)})),$b),{chain:!1}),ol.VERSION="4.17.20",(ol.templateSettings=Vb.templateSettings).imports._=ol,vl(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){ol[e].placeholder=ol})),vl(["drop","take"],(function(e,t){qc.prototype[e]=function(n){n=void 0===n?1:Xb(bc(n),0);var r=this.__filtered__&&!t?new qc(this):this.clone();return r.__filtered__?r.__takeCount__=Gb(n,r.__takeCount__):r.__views__.push({size:Gb(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},qc.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),vl(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qc.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:kh(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),vl(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qc.prototype[e]=function(){return this[n](1).value()[0]}})),vl(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qc.prototype[e]=function(){return this.__filtered__?new qc(this):this[n](1)}})),qc.prototype.compact=function(){return this.filter(_c)},qc.prototype.find=function(e){return this.filter(e).head()},qc.prototype.findLast=function(e){return this.reverse().find(e)},qc.prototype.invokeMap=Bl((function(e,t){return"function"==typeof e?new qc(this):this.map((function(n){return Sy(n,e,t)}))})),qc.prototype.reject=function(e){return this.filter(rm(kh(e)))},qc.prototype.slice=function(e,t){e=bc(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qc(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=bc(t))<0?n.dropRight(-t):n.take(t-e)),n)},qc.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qc.prototype.toArray=function(){return this.take(4294967295)},Th(qc.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=ol[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(ol.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof qc,s=a[0],c=u||ic(t),l=function(e){var t=o.apply(ol,Jf([e],a));return r&&f?t[0]:t};c&&n&&"function"==typeof s&&1!=s.length&&(u=c=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&c){t=h?t:new qc(this);var v=e.apply(t,a);return v.__actions__.push({func:Gg,args:[l],thisArg:void 0}),new el(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),vl(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Yb[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);ol.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(ic(o)?o:[],e)}return this[n]((function(n){return t.apply(ic(n)?n:[],e)}))}})),Th(qc.prototype,(function(e,t){var n=ol[t];if(n){var r=n.name+"";Kb.call(Zc,r)||(Zc[r]=[]),Zc[r].push({name:t,func:n})}})),Zc[Cl(void 0,2).name]=[{name:"wrapper",func:void 0}],qc.prototype.clone=function(){var e=new qc(this.__wrapped__);return e.__actions__=tl(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=tl(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=tl(this.__views__),e},qc.prototype.reverse=function(){if(this.__filtered__){var e=new qc(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qc.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ic(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r1&&void 0!==arguments[1]&&arguments[1],n=r.props.forceDragging;if(r.active||n||!0===t){var o,i;e.preventDefault(),"touchmove"===e.type?(o=e.touches[0].clientX-r.initialX,i=e.touches[0].clientY-r.initialY):(o=e.clientX-r.initialX,i=e.clientY-r.initialY);var a=!1,u=5,s=50,c=r.getContainerDimensions(),l=c.containerWidth,f=c.containerHeight,p=r.getAxis(),d=p.xAxis,h=p.yAxis;o>l?(d&&o+u>l&&(a=!0),o=l):o<0&&(d&&o<-u&&(a=!0),o=0),i>f?(h&&i+s>f&&(a=!0),i=f):i<0&&(h&&i<-s&&(a=!0),i=0),!0===a&&r.handleDragEnd(),r.updateState({xRatio:o/l,yRatio:i/f})}})),y(O(r),"handleDragEnd",(function(e){r.active=!1;var t=r.props.onDragEnd;t&&t(),(new Date).getTime()-r.lastMouseDown<300&&r.handleDrag(e,!0)})),y(O(r),"_handleWindowResize",(function(){var e=r.state.render_key;r.updateState({render_key:e})})),y(O(r),"getContainerDimensions",(function(){var e=0,t=0;if(r.container){var n=["paddingLeft","paddingRight","paddingTop","paddingBottom"].map((function(e){return Math.round(getComputedStyle(r.container)[e].replace("px","")||0)}));e=r.container.clientWidth-(n[0]+n[1])-r.draggableRef.current.clientWidth,t=r.container.clientHeight-(n[2]+n[3])-r.draggableRef.current.clientHeight}return{containerWidth:e,containerHeight:t}})),y(O(r),"getCurrentPositionWithPercent",(function(){var e=r.getCurrentPosition(),t=e.xRatio,n=e.yRatio,o=r.getContainerDimensions();return{currentX:t*o.containerWidth,currentY:n*o.containerHeight}})),y(O(r),"getAxis",(function(){var e=r.props.axis;return{xAxis:"y"!==e,yAxis:"x"!==e}})),y(O(r),"getCurrentPosition",(function(){var e=r.props.position;if(e){var t=e.xRatio,n=e.yRatio;return g({xRatio:t,yRatio:n},r.calculateCurrentPositionFromRatios(t,n))}return r.state})),y(O(r),"calculateCurrentPositionFromRatios",(function(e,t){var n=r.getContainerDimensions();return{currentX:e*n.containerWidth,currentY:t*n.containerHeight}})),y(O(r),"updateState",(function(e){r.lastMove=(new Date).getTime();var t=r.props,n=t.position,o=t.onDrag;n?o(g({},n,{},e)):r.setState(e)})),r.state={xRatio:0,yRatio:0,render_key:0},r.active=!1,r.initialX=0,r.initialY=0,r.ghostContainerDimensions=r.getContainerDimensions(),r.draggableRef=e.createRef(),r.handleWindowResize=Xg(r._handleWindowResize,200),r}return b(n,e.Component),v(n,[{key:"componentDidMount",value:function(){var e=this.props.onMount;this.container=l.findDOMNode(this).parentNode,this.container.addEventListener("touchstart",this.handleDragStart,!1),this.container.addEventListener("touchend",this.handleDragEnd,!1),this.container.addEventListener("touchmove",this.handleDrag,!1),this.container.addEventListener("mousedown",this.handleDragStart,!1),this.container.addEventListener("mouseup",this.handleDragEnd,!1),this.container.addEventListener("mousemove",this.handleDrag,!1),window.addEventListener("resize",this.handleWindowResize,!1),e&&e(this)}},{key:"componentDidUpdate",value:function(){var e=this.ghostContainerDimensions,t=e.containerWidth,n=e.containerHeight;this.ghostContainerDimensions=this.getContainerDimensions(),t===this.ghostContainerDimensions.containerWidth&&n===this.ghostContainerDimensions.containerHeight||this._handleWindowResize()}},{key:"componentWillUnmount",value:function(){this.container.removeEventListener("touchstart",this.handleDragStart),this.container.removeEventListener("touchend",this.handleDragEnd),this.container.removeEventListener("touchmove",this.handleDrag),this.container.removeEventListener("mousedown",this.handleDragStart),this.container.removeEventListener("mouseup",this.handleDragEnd),this.container.removeEventListener("mousemove",this.handleDrag),window.removeEventListener("resize",this.handleWindowResize,!1)}},{key:"render",value:function(){var t=this.getCurrentPosition(),n=t.currentX,r=t.currentY,o=this.props.className,i=this.getAxis(),a=i.xAxis,u=i.yAxis;return e.createElement("div",{ref:this.draggableRef,style:{transform:"translate3d(".concat(a?n:0,"px, ").concat(u?r:0,"px, 0)")},className:"react-draggable ".concat(o||"")},this.props.children)}}]),n}();Jb.propTypes={className:p.string,axis:p.oneOf(["x","y"]),position:p.shape({xRatio:p.number,yRatio:p.number}),onDragStart:p.func,onDrag:p.func,onDragEnd:p.func,draggableWidth:p.number,draggableHeight:p.number};var Qb=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 448 512"},e.createElement("path",{fill:"currentColor",d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}))}}]),n}(),e_=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 448 512"},e.createElement("path",{fill:"currentColor",d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))}}]),n}(),t_=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 512 512"},e.createElement("path",{fill:"currentColor",d:"M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"}))}}]),n}();function n_(){var e=E(["",""]);return n_=function(){return e},e}var r_=Li.Range,o_=function(t){function n(t){var r;return d(this,n),y(O(r=x(this,_(n).call(this,t))),"componentWillUnmount",(function(){window.removeEventListener("keydown",r.handleKeyPress)})),y(O(r),"getAcceptedDuration",(function(){var e=r.props,t=e.minDuration,n=e.maxDuration,o=r.state.videoDuration,i=parseFloat(t)||0;i<0&&(i=0);var a=parseFloat(n)||o;return a>o&&(a=o),i>a?{min:a,max:i}:{min:i,max:a}})),y(O(r),"getFormatedValues",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"in";e||(e=r.props.inPoint),t||(t=r.props.outPoint);var o=r.getAcceptedDuration(),i=o.min,a=o.max,u=r.state.videoDuration,s=e||0,c=t||u,l=function(e){c-s>a?"in"===e?c=s+a:s=c-a:c-su&&(c=u,l("out")),{inValue:s,outValue:c}})),y(O(r),"toggleVideoAutoPlay",(function(e){var t=r.videoRef.current;t&&(t.paused?(r.playVideo(),r.monitorAutoplay(e)):r.pauseVideo())})),y(O(r),"monitorAutoplay",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=r.videoRef.current;if(t&&!t.paused){if(!0===e){var n=r.getFormatedValues(),o=n.inValue,i=n.outValue,a=t.currentTime;(ai)&&(t.currentTime=o)}r.updatePlayCursorPosition(null,!0),setTimeout((function(){return r.monitorAutoplay(e)}),100)}})),y(O(r),"playVideo",(function(){var e=r.videoRef.current;e&&e.play(),r.setState({isPlaying:!0})})),y(O(r),"pauseVideo",(function(){var e=r.videoRef.current;e&&e.pause(),r.setState({isPlaying:!1})})),y(O(r),"updatePlayerVolume",(function(){var e=r.props.muted,t=r.videoRef.current;t&&(t.volume=e?0:.5)})),y(O(r),"scrollToCursor",(function(){var e=r.state,t=e.playCursorPosition,n=(e.zoomFactor,e.forceCursorDragging),o=t.xRatio,i=t.yRatio,a=r.draggableApi.calculateCurrentPositionFromRatios(o,i).currentX,u=r.scrollable.current,s=u.scrollLeft,c=u.clientWidth;(n||as+c)&&(r.scrollable.current.scrollLeft=a)})),y(O(r),"updatePlayCursorPosition",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e){var n=r.videoRef.current,o=r.state.videoDuration;e=n&&o?n.currentTime/o:0}var i={xRatio:e,yRatio:0};r.setState({playCursorPosition:i},(function(){!0===t&&r.scrollToCursor()}))})),y(O(r),"handleVideoPlayerError",(function(e){var t=e.target.error;if(t&&4===t.code){var n=r.props.onNotSupportedVideoLoad;n&&n(t.message)}})),y(O(r),"handleDraggableApiMount",(function(e){return r.draggableApi=e})),y(O(r),"handleKeyPress",(function(e){32===e.keyCode&&(e.preventDefault(),r.toggleVideoAutoPlay())})),y(O(r),"handleLoadedData",(function(){var e=r.props.onVideoLoadedData,t=r.videoRef.current;if(t){var n=r.props.inPoint;void 0!==n&&r.seekVideoTo(n),r.updatePlayerVolume(),r.setState({videoDuration:t.duration},(function(){return r.updatePlayCursorPosition()})),e&&e(t)}})),y(O(r),"handleRangeChange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.state.rangeDisabled;if(!n||t){var o=r.props,i=o.onRangeChange,a=o.outPoint,u=e[1]!==a?"out":"in",s=r.getFormatedValues(e[0],e[1],u),c=s.inValue,l=s.outValue;i([c,l])}})),y(O(r),"handleBeforeRangeChange",(function(e,t){r.pauseVideo(),r.setState({isEditing:!0})})),y(O(r),"handleAfterRangeChange",(function(){var e=r.state,t=e.playCursorPosition,n=e.videoDuration;r.seekVideoTo(t.xRatio*n),r.setState({isEditing:!1})})),y(O(r),"handleFreePlayClick",(function(){r.toggleVideoAutoPlay(!1)})),y(O(r),"handlePlayCursorDrag",(function(e){var t=e.xRatio,n=r.state.videoDuration;r.seekVideoTo(n*t),r.setState({playCursorPosition:e})})),y(O(r),"handleZoomFactorDragStart",(function(){return r.setState({forceCursorDragging:!0})})),y(O(r),"handleZoomFactorDragEnd",(function(){return r.setState({forceCursorDragging:!1})})),y(O(r),"handleZoomFactorChange",(function(e){r.state.zoomFactor;r.setState({zoomFactor:e},r.scrollToCursor)})),y(O(r),"handleContainerMouseDown",(function(e){e.stopPropagation();var t=e.target;t.classList.contains("rc-slider-handle")||t.classList.contains("dnm-video-cut-playing-cursor")?r.setState({rangeDisabled:!1,forceCursorDragging:!1}):r.setState({rangeDisabled:!0,forceCursorDragging:!0})})),y(O(r),"handleContainerMouseUp",(function(){return r.setState({rangeDisabled:!0,forceCursorDragging:!1})})),y(O(r),"handleMuteChange",(function(e){var t=r.props.onMuteChange;t&&t(!e.target.checked)})),r.state={videoDuration:0,isEditing:!1,isPlaying:!1,rangeDisabled:!0,forceCursorDragging:!1,forceScrollToCursor:!1,zoomFactor:[0],playCursorPosition:{xRatio:0,yRatio:0}},r.videoRef=e.createRef(),r.scrollable=e.createRef(),r.draggable=e.createRef(),r.draggableApi=null,r.seekVideoTo=Xg(r._seekVideoTo,50),r}return b(n,e.Component),v(n,[{key:"componentDidMount",value:function(){window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentDidUpdate",value:function(e,t){var n=this.state,r=n.videoDuration,o=n.isEditing,i=this.props,a=i.inPoint,u=i.outPoint,s=i.src,c=i.muted;if(isNaN(r)||r===t.videoDuration||this.handleRangeChange([a,u],!0),s!==e.src&&this.pauseVideo(),o&&(e.inPoint!==a||e.outPoint!==u)){var l;if(e.inPoint!==a&&e.outPoint!==u){var f=this.getAcceptedDuration(),p=f.min,d=f.max;l=Math.abs(u-a-p)a?a:u}else l=e.outPoint!==u?u:a;this.seekVideoTo(l)}c!==e.muted&&this.updatePlayerVolume()}},{key:"_seekVideoTo",value:function(e){if(!isNaN(e)){var t=this.videoRef.current;t&&(t.currentTime=e)}}},{key:"render",value:function(){var e=this.getFormatedValues(),t=e.inValue,n=e.outValue,r=this.state,o=r.videoDuration,i=r.isEditing,a=r.playCursorPosition,u=r.isPlaying,s=r.forceCursorDragging,c=r.zoomFactor,l=this.props,f=l.src,p=l.catalogue,d=l.classes,h=l.playerCursorWidth,v=l.muted,y=l.onMuteChange;return Lt("div",{css:Wt(n_(),zs)},Lt("div",{className:"dnm-video-cut-root ".concat(d.root||""," ").concat(i?"is-editing":""," ").concat(u?"is-playing":"is-paused")},Lt("video",{className:"dnm-video-cut-player ".concat(d.player||""),src:"".concat(f),ref:this.videoRef,loop:!0,muted:v,controls:!1,onLoadedData:this.handleLoadedData,onLoad:this.handleVideoLoad,onError:this.handleVideoPlayerError}),Lt("div",null,Lt("div",{className:"dnm-video-cut-play-icon",onClick:this.handleFreePlayClick},Lt(u?e_:Qb,null)),Lt("div",{className:"dnm-video-cut-progress-scrollable-parent",ref:this.scrollable},Lt("div",{className:"dnm-video-cut-progress-container",style:{width:"calc(".concat(c[0]+100,"% - 20px)")},onTouchStart:this.handleContainerMouseDown,onTouchEnd:this.handleContainerMouseUp,onMouseDown:this.handleContainerMouseDown,onMouseUp:this.handleContainerMouseUp},Lt(Jb,{className:"dnm-video-cut-playing-cursor-draggable-item",axis:"x",forceDragging:s,onMount:this.handleDraggableApiMount,onDrag:this.handlePlayCursorDrag,onDragStart:this.pauseVideo,position:a,draggableWidth:h,rerenderKey:c[0]},Lt("div",{className:"dnm-video-cut-playing-cursor",ref:this.draggable})),Lt(r_,{className:"dnm-video-cut-range ".concat(d.range||""),min:0,max:o||0,step:.05,value:[t,n],onChange:this.handleRangeChange,onBeforeChange:this.handleBeforeRangeChange,onAfterChange:this.handleAfterRangeChange}))),Lt("div",{className:"dnm-video-cut-tools"},Lt("div",{className:"dnm-video-cut-mute"},y&&Lt("label",{className:"dnm-video-cut-checkbox-container"},p.unmute,Lt("input",{type:"checkbox",checked:!v,onChange:this.handleMuteChange}),Lt("span",{className:"dnm-video-cut-checkmark"}))),Lt("div",{className:"dnm-video-cut-zoom"},Lt(r_,{className:"dnm-video-cut-zoom-range ".concat(d.zoomRange||""),min:0,max:900,step:.05,value:c,onBeforeChange:this.handleZoomFactorDragStart,onAfterChange:this.handleZoomFactorDragEnd,onChange:this.handleZoomFactorChange}),Lt("div",{className:"dnm-video-cut-zoom-icon"},Lt(t_,null))),Lt("div",{className:"clearfix"})))))}}]),n}();o_.propTypes={catalogue:p.object,classes:p.shape({root:p.string,player:p.string,range:p.string}),onRangeChange:p.func.isRequired,onNotSupportedVideoLoad:p.func,onVideoLoadedData:p.func,src:p.string.isRequired,inPoint:p.number,outPoint:p.number,draggableWidth:p.number,maxDuration:p.number,minDuration:p.number,muted:p.bool,onMuteChange:p.func,playerCursorWidth:p.oneOfType([p.func,p.int])},o_.defaultProps={catalogue:{unmute:"Enable sound"},classes:{},onRangeChange:function(e){return null},onNotSupportedVideoLoad:function(e){return null},onVideoLoadedData:function(e){return null},inPoint:0,outPoint:0,draggableWidth:null,maxDuration:0,minDuration:0,muted:!1,playerCursorWidth:14};export default o_; +var $b,Yb=Array.prototype,Kb=Object.prototype.hasOwnProperty,qb=Ks?Ks.iterator:void 0,Xb=Math.max,Gb=Math.min,Zb=function(e){return function(t,n,r){if(null==r){var o=fc(n),i=o&&_f(n),a=i&&i.length&&Xv(n,i);(a?a.length:o)||(r=n,n=t,t=this)}return e(t,n,r)}}(tm);ol.after=Tb.after,ol.ary=Tb.ary,ol.assign=Fb.assign,ol.assignIn=Fb.assignIn,ol.assignInWith=Fb.assignInWith,ol.assignWith=Fb.assignWith,ol.at=Fb.at,ol.before=Tb.before,ol.bind=Tb.bind,ol.bindAll=Bb.bindAll,ol.bindKey=Tb.bindKey,ol.castArray=Db.castArray,ol.chain=Wb.chain,ol.chunk=Cb.chunk,ol.compact=Cb.compact,ol.concat=Cb.concat,ol.cond=Bb.cond,ol.conforms=Bb.conforms,ol.constant=Bb.constant,ol.countBy=Pb.countBy,ol.create=Fb.create,ol.curry=Tb.curry,ol.curryRight=Tb.curryRight,ol.debounce=Tb.debounce,ol.defaults=Fb.defaults,ol.defaultsDeep=Fb.defaultsDeep,ol.defer=Tb.defer,ol.delay=Tb.delay,ol.difference=Cb.difference,ol.differenceBy=Cb.differenceBy,ol.differenceWith=Cb.differenceWith,ol.drop=Cb.drop,ol.dropRight=Cb.dropRight,ol.dropRightWhile=Cb.dropRightWhile,ol.dropWhile=Cb.dropWhile,ol.fill=Cb.fill,ol.filter=Pb.filter,ol.flatMap=Pb.flatMap,ol.flatMapDeep=Pb.flatMapDeep,ol.flatMapDepth=Pb.flatMapDepth,ol.flatten=Cb.flatten,ol.flattenDeep=Cb.flattenDeep,ol.flattenDepth=Cb.flattenDepth,ol.flip=Tb.flip,ol.flow=Bb.flow,ol.flowRight=Bb.flowRight,ol.fromPairs=Cb.fromPairs,ol.functions=Fb.functions,ol.functionsIn=Fb.functionsIn,ol.groupBy=Pb.groupBy,ol.initial=Cb.initial,ol.intersection=Cb.intersection,ol.intersectionBy=Cb.intersectionBy,ol.intersectionWith=Cb.intersectionWith,ol.invert=Fb.invert,ol.invertBy=Fb.invertBy,ol.invokeMap=Pb.invokeMap,ol.iteratee=Bb.iteratee,ol.keyBy=Pb.keyBy,ol.keys=_f,ol.keysIn=Fb.keysIn,ol.map=Pb.map,ol.mapKeys=Fb.mapKeys,ol.mapValues=Fb.mapValues,ol.matches=Bb.matches,ol.matchesProperty=Bb.matchesProperty,ol.memoize=Tb.memoize,ol.merge=Fb.merge,ol.mergeWith=Fb.mergeWith,ol.method=Bb.method,ol.methodOf=Bb.methodOf,ol.mixin=Zb,ol.negate=rm,ol.nthArg=Bb.nthArg,ol.omit=Fb.omit,ol.omitBy=Fb.omitBy,ol.once=Tb.once,ol.orderBy=Pb.orderBy,ol.over=Bb.over,ol.overArgs=Tb.overArgs,ol.overEvery=Bb.overEvery,ol.overSome=Bb.overSome,ol.partial=Tb.partial,ol.partialRight=Tb.partialRight,ol.partition=Pb.partition,ol.pick=Fb.pick,ol.pickBy=Fb.pickBy,ol.property=Bb.property,ol.propertyOf=Bb.propertyOf,ol.pull=Cb.pull,ol.pullAll=Cb.pullAll,ol.pullAllBy=Cb.pullAllBy,ol.pullAllWith=Cb.pullAllWith,ol.pullAt=Cb.pullAt,ol.range=Bb.range,ol.rangeRight=Bb.rangeRight,ol.rearg=Tb.rearg,ol.reject=Pb.reject,ol.remove=Cb.remove,ol.rest=Tb.rest,ol.reverse=Cb.reverse,ol.sampleSize=Pb.sampleSize,ol.set=Fb.set,ol.setWith=Fb.setWith,ol.shuffle=Pb.shuffle,ol.slice=Cb.slice,ol.sortBy=Pb.sortBy,ol.sortedUniq=Cb.sortedUniq,ol.sortedUniqBy=Cb.sortedUniqBy,ol.split=Vb.split,ol.spread=Tb.spread,ol.tail=Cb.tail,ol.take=Cb.take,ol.takeRight=Cb.takeRight,ol.takeRightWhile=Cb.takeRightWhile,ol.takeWhile=Cb.takeWhile,ol.tap=Wb.tap,ol.throttle=Tb.throttle,ol.thru=Gg,ol.toArray=Db.toArray,ol.toPairs=Fb.toPairs,ol.toPairsIn=Fb.toPairsIn,ol.toPath=Bb.toPath,ol.toPlainObject=Db.toPlainObject,ol.transform=Fb.transform,ol.unary=Tb.unary,ol.union=Cb.union,ol.unionBy=Cb.unionBy,ol.unionWith=Cb.unionWith,ol.uniq=Cb.uniq,ol.uniqBy=Cb.uniqBy,ol.uniqWith=Cb.uniqWith,ol.unset=Fb.unset,ol.unzip=Cb.unzip,ol.unzipWith=Cb.unzipWith,ol.update=Fb.update,ol.updateWith=Fb.updateWith,ol.values=Fb.values,ol.valuesIn=Fb.valuesIn,ol.without=Cb.without,ol.words=Vb.words,ol.wrap=Tb.wrap,ol.xor=Cb.xor,ol.xorBy=Cb.xorBy,ol.xorWith=Cb.xorWith,ol.zip=Cb.zip,ol.zipObject=Cb.zipObject,ol.zipObjectDeep=Cb.zipObjectDeep,ol.zipWith=Cb.zipWith,ol.entries=Fb.toPairs,ol.entriesIn=Fb.toPairsIn,ol.extend=Fb.assignIn,ol.extendWith=Fb.assignInWith,Zb(ol,ol),ol.add=Nb.add,ol.attempt=Bb.attempt,ol.camelCase=Vb.camelCase,ol.capitalize=Vb.capitalize,ol.ceil=Nb.ceil,ol.clamp=Rb,ol.clone=Db.clone,ol.cloneDeep=Db.cloneDeep,ol.cloneDeepWith=Db.cloneDeepWith,ol.cloneWith=Db.cloneWith,ol.conformsTo=Db.conformsTo,ol.deburr=Vb.deburr,ol.defaultTo=Bb.defaultTo,ol.divide=Nb.divide,ol.endsWith=Vb.endsWith,ol.eq=Db.eq,ol.escape=Vb.escape,ol.escapeRegExp=Vb.escapeRegExp,ol.every=Pb.every,ol.find=Pb.find,ol.findIndex=Cb.findIndex,ol.findKey=Fb.findKey,ol.findLast=Pb.findLast,ol.findLastIndex=Cb.findLastIndex,ol.findLastKey=Fb.findLastKey,ol.floor=Nb.floor,ol.forEach=Pb.forEach,ol.forEachRight=Pb.forEachRight,ol.forIn=Fb.forIn,ol.forInRight=Fb.forInRight,ol.forOwn=Fb.forOwn,ol.forOwnRight=Fb.forOwnRight,ol.get=Fb.get,ol.gt=Db.gt,ol.gte=Db.gte,ol.has=Fb.has,ol.hasIn=Fb.hasIn,ol.head=Cb.head,ol.identity=_c,ol.includes=Pb.includes,ol.indexOf=Cb.indexOf,ol.inRange=Lb,ol.invoke=Fb.invoke,ol.isArguments=Db.isArguments,ol.isArray=ic,ol.isArrayBuffer=Db.isArrayBuffer,ol.isArrayLike=Db.isArrayLike,ol.isArrayLikeObject=Db.isArrayLikeObject,ol.isBoolean=Db.isBoolean,ol.isBuffer=Db.isBuffer,ol.isDate=Db.isDate,ol.isElement=Db.isElement,ol.isEmpty=Db.isEmpty,ol.isEqual=Db.isEqual,ol.isEqualWith=Db.isEqualWith,ol.isError=Db.isError,ol.isFinite=Db.isFinite,ol.isFunction=Db.isFunction,ol.isInteger=Db.isInteger,ol.isLength=Db.isLength,ol.isMap=Db.isMap,ol.isMatch=Db.isMatch,ol.isMatchWith=Db.isMatchWith,ol.isNaN=Db.isNaN,ol.isNative=Db.isNative,ol.isNil=Db.isNil,ol.isNull=Db.isNull,ol.isNumber=Db.isNumber,ol.isObject=fc,ol.isObjectLike=Db.isObjectLike,ol.isPlainObject=Db.isPlainObject,ol.isRegExp=Db.isRegExp,ol.isSafeInteger=Db.isSafeInteger,ol.isSet=Db.isSet,ol.isString=Db.isString,ol.isSymbol=Db.isSymbol,ol.isTypedArray=Db.isTypedArray,ol.isUndefined=Db.isUndefined,ol.isWeakMap=Db.isWeakMap,ol.isWeakSet=Db.isWeakSet,ol.join=Cb.join,ol.kebabCase=Vb.kebabCase,ol.last=sv,ol.lastIndexOf=Cb.lastIndexOf,ol.lowerCase=Vb.lowerCase,ol.lowerFirst=Vb.lowerFirst,ol.lt=Db.lt,ol.lte=Db.lte,ol.max=Nb.max,ol.maxBy=Nb.maxBy,ol.mean=Nb.mean,ol.meanBy=Nb.meanBy,ol.min=Nb.min,ol.minBy=Nb.minBy,ol.stubArray=Bb.stubArray,ol.stubFalse=Bb.stubFalse,ol.stubObject=Bb.stubObject,ol.stubString=Bb.stubString,ol.stubTrue=Bb.stubTrue,ol.multiply=Nb.multiply,ol.nth=Cb.nth,ol.noop=Bb.noop,ol.now=Ab,ol.pad=Vb.pad,ol.padEnd=Vb.padEnd,ol.padStart=Vb.padStart,ol.parseInt=Vb.parseInt,ol.random=Ib,ol.reduce=Pb.reduce,ol.reduceRight=Pb.reduceRight,ol.repeat=Vb.repeat,ol.replace=Vb.replace,ol.result=Fb.result,ol.round=Nb.round,ol.sample=Pb.sample,ol.size=Pb.size,ol.snakeCase=Vb.snakeCase,ol.some=Pb.some,ol.sortedIndex=Cb.sortedIndex,ol.sortedIndexBy=Cb.sortedIndexBy,ol.sortedIndexOf=Cb.sortedIndexOf,ol.sortedLastIndex=Cb.sortedLastIndex,ol.sortedLastIndexBy=Cb.sortedLastIndexBy,ol.sortedLastIndexOf=Cb.sortedLastIndexOf,ol.startCase=Vb.startCase,ol.startsWith=Vb.startsWith,ol.subtract=Nb.subtract,ol.sum=Nb.sum,ol.sumBy=Nb.sumBy,ol.template=Vb.template,ol.times=Bb.times,ol.toFinite=Db.toFinite,ol.toInteger=bc,ol.toLength=Db.toLength,ol.toLower=Vb.toLower,ol.toNumber=Db.toNumber,ol.toSafeInteger=Db.toSafeInteger,ol.toString=Db.toString,ol.toUpper=Vb.toUpper,ol.trim=Vb.trim,ol.trimEnd=Vb.trimEnd,ol.trimStart=Vb.trimStart,ol.truncate=Vb.truncate,ol.unescape=Vb.unescape,ol.uniqueId=Bb.uniqueId,ol.upperCase=Vb.upperCase,ol.upperFirst=Vb.upperFirst,ol.each=Pb.forEach,ol.eachRight=Pb.forEachRight,ol.first=Cb.head,Zb(ol,($b={},Th(ol,(function(e,t){Kb.call(ol.prototype,t)||($b[t]=e)})),$b),{chain:!1}),ol.VERSION="4.17.20",(ol.templateSettings=Vb.templateSettings).imports._=ol,vl(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){ol[e].placeholder=ol})),vl(["drop","take"],(function(e,t){qc.prototype[e]=function(n){n=void 0===n?1:Xb(bc(n),0);var r=this.__filtered__&&!t?new qc(this):this.clone();return r.__filtered__?r.__takeCount__=Gb(n,r.__takeCount__):r.__views__.push({size:Gb(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},qc.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),vl(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qc.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:kh(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),vl(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qc.prototype[e]=function(){return this[n](1).value()[0]}})),vl(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qc.prototype[e]=function(){return this.__filtered__?new qc(this):this[n](1)}})),qc.prototype.compact=function(){return this.filter(_c)},qc.prototype.find=function(e){return this.filter(e).head()},qc.prototype.findLast=function(e){return this.reverse().find(e)},qc.prototype.invokeMap=Bl((function(e,t){return"function"==typeof e?new qc(this):this.map((function(n){return Sy(n,e,t)}))})),qc.prototype.reject=function(e){return this.filter(rm(kh(e)))},qc.prototype.slice=function(e,t){e=bc(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qc(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=bc(t))<0?n.dropRight(-t):n.take(t-e)),n)},qc.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qc.prototype.toArray=function(){return this.take(4294967295)},Th(qc.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=ol[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(ol.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof qc,s=a[0],c=u||ic(t),l=function(e){var t=o.apply(ol,Jf([e],a));return r&&f?t[0]:t};c&&n&&"function"==typeof s&&1!=s.length&&(u=c=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&c){t=h?t:new qc(this);var v=e.apply(t,a);return v.__actions__.push({func:Gg,args:[l],thisArg:void 0}),new el(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),vl(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Yb[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);ol.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(ic(o)?o:[],e)}return this[n]((function(n){return t.apply(ic(n)?n:[],e)}))}})),Th(qc.prototype,(function(e,t){var n=ol[t];if(n){var r=n.name+"";Kb.call(Zc,r)||(Zc[r]=[]),Zc[r].push({name:t,func:n})}})),Zc[Cl(void 0,2).name]=[{name:"wrapper",func:void 0}],qc.prototype.clone=function(){var e=new qc(this.__wrapped__);return e.__actions__=tl(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=tl(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=tl(this.__views__),e},qc.prototype.reverse=function(){if(this.__filtered__){var e=new qc(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qc.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ic(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r1&&void 0!==arguments[1]&&arguments[1],n=r.props.forceDragging;if(r.active||n||!0===t){var o,i;e.preventDefault(),"touchmove"===e.type?(o=e.touches[0].clientX-r.initialX,i=e.touches[0].clientY-r.initialY):(o=e.clientX-r.initialX,i=e.clientY-r.initialY);var a=!1,u=5,s=50,c=r.getContainerDimensions(),l=c.containerWidth,f=c.containerHeight,p=r.getAxis(),d=p.xAxis,h=p.yAxis;o>l?(d&&o+u>l&&(a=!0),o=l):o<0&&(d&&o<-u&&(a=!0),o=0),i>f?(h&&i+s>f&&(a=!0),i=f):i<0&&(h&&i<-s&&(a=!0),i=0),!0===a&&r.handleDragEnd(),r.updateState({xRatio:o/l,yRatio:i/f})}})),y(O(r),"handleDragEnd",(function(e){r.active=!1;var t=r.props.onDragEnd;t&&t(),(new Date).getTime()-r.lastMouseDown<300&&r.handleDrag(e,!0)})),y(O(r),"_handleWindowResize",(function(){var e=r.state.render_key;r.updateState({render_key:e})})),y(O(r),"getContainerDimensions",(function(){var e=0,t=0;if(r.container){var n=["paddingLeft","paddingRight","paddingTop","paddingBottom"].map((function(e){return Math.round(getComputedStyle(r.container)[e].replace("px","")||0)}));e=r.container.clientWidth-(n[0]+n[1])-r.draggableRef.current.clientWidth,t=r.container.clientHeight-(n[2]+n[3])-r.draggableRef.current.clientHeight}return{containerWidth:e,containerHeight:t}})),y(O(r),"getCurrentPositionWithPercent",(function(){var e=r.getCurrentPosition(),t=e.xRatio,n=e.yRatio,o=r.getContainerDimensions();return{currentX:t*o.containerWidth,currentY:n*o.containerHeight}})),y(O(r),"getAxis",(function(){var e=r.props.axis;return{xAxis:"y"!==e,yAxis:"x"!==e}})),y(O(r),"getCurrentPosition",(function(){var e=r.props.position;if(e){var t=e.xRatio,n=e.yRatio;return g({xRatio:t,yRatio:n},r.calculateCurrentPositionFromRatios(t,n))}return r.state})),y(O(r),"calculateCurrentPositionFromRatios",(function(e,t){var n=r.getContainerDimensions();return{currentX:e*n.containerWidth,currentY:t*n.containerHeight}})),y(O(r),"updateState",(function(e){r.lastMove=(new Date).getTime();var t=r.props,n=t.position,o=t.onDrag;n?o(g({},n,{},e)):r.setState(e)})),r.state={xRatio:0,yRatio:0,render_key:0},r.active=!1,r.initialX=0,r.initialY=0,r.ghostContainerDimensions=r.getContainerDimensions(),r.draggableRef=e.createRef(),r.handleWindowResize=Xg(r._handleWindowResize,200),r}return b(n,e.Component),v(n,[{key:"componentDidMount",value:function(){var e=this.props.onMount;this.container=l.findDOMNode(this).parentNode,this.container.addEventListener("touchstart",this.handleDragStart,!1),this.container.addEventListener("touchend",this.handleDragEnd,!1),this.container.addEventListener("touchmove",this.handleDrag,!1),this.container.addEventListener("mousedown",this.handleDragStart,!1),this.container.addEventListener("mouseup",this.handleDragEnd,!1),this.container.addEventListener("mousemove",this.handleDrag,!1),window.addEventListener("resize",this.handleWindowResize,!1),e&&e(this)}},{key:"componentDidUpdate",value:function(){var e=this.ghostContainerDimensions,t=e.containerWidth,n=e.containerHeight;this.ghostContainerDimensions=this.getContainerDimensions(),t===this.ghostContainerDimensions.containerWidth&&n===this.ghostContainerDimensions.containerHeight||this._handleWindowResize()}},{key:"componentWillUnmount",value:function(){this.container.removeEventListener("touchstart",this.handleDragStart),this.container.removeEventListener("touchend",this.handleDragEnd),this.container.removeEventListener("touchmove",this.handleDrag),this.container.removeEventListener("mousedown",this.handleDragStart),this.container.removeEventListener("mouseup",this.handleDragEnd),this.container.removeEventListener("mousemove",this.handleDrag),window.removeEventListener("resize",this.handleWindowResize,!1)}},{key:"render",value:function(){var t=this.getCurrentPosition(),n=t.currentX,r=t.currentY,o=this.props.className,i=this.getAxis(),a=i.xAxis,u=i.yAxis;return e.createElement("div",{ref:this.draggableRef,style:{transform:"translate3d(".concat(a?n:0,"px, ").concat(u?r:0,"px, 0)")},className:"react-draggable ".concat(o||"")},this.props.children)}}]),n}();Jb.propTypes={className:p.string,axis:p.oneOf(["x","y"]),position:p.shape({xRatio:p.number,yRatio:p.number}),onDragStart:p.func,onDrag:p.func,onDragEnd:p.func,draggableWidth:p.number,draggableHeight:p.number};var Qb=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 448 512"},e.createElement("path",{fill:"currentColor",d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}))}}]),n}(),e_=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 448 512"},e.createElement("path",{fill:"currentColor",d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))}}]),n}(),t_=function(t){function n(){return d(this,n),x(this,_(n).apply(this,arguments))}return b(n,e.Component),v(n,[{key:"render",value:function(){return e.createElement("svg",{viewBox:"0 0 512 512"},e.createElement("path",{fill:"currentColor",d:"M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"}))}}]),n}();function n_(){var e=E(["",""]);return n_=function(){return e},e}var r_=Li.Range,o_=function(t){function n(t){var r;return d(this,n),y(O(r=x(this,_(n).call(this,t))),"componentWillUnmount",(function(){window.removeEventListener("keydown",r.handleKeyPress)})),y(O(r),"getAcceptedDuration",(function(){var e=r.props,t=e.minDuration,n=e.maxDuration,o=r.state.videoDuration,i=parseFloat(t)||0;i<0&&(i=0);var a=parseFloat(n)||o;return a>o&&(a=o),i>a?{min:a,max:i}:{min:i,max:a}})),y(O(r),"getFormatedValues",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"in";e||(e=r.props.inPoint),t||(t=r.props.outPoint);var o=r.getAcceptedDuration(),i=o.min,a=o.max,u=r.state.videoDuration,s=e||0,c=t||u,l=function(e){c-s>a?"in"===e?c=s+a:s=c-a:c-su&&(c=u,l("out")),{inValue:s,outValue:c}})),y(O(r),"toggleVideoAutoPlay",(function(e){var t=r.videoRef.current;t&&(t.paused?(r.playVideo(),r.monitorAutoplay(e)):r.pauseVideo())})),y(O(r),"monitorAutoplay",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=r.videoRef.current;if(t&&!t.paused){if(!0===e){var n=r.getFormatedValues(),o=n.inValue,i=n.outValue,a=t.currentTime;(ai)&&(t.currentTime=o)}r.updatePlayCursorPosition(null,!0),setTimeout((function(){return r.monitorAutoplay(e)}),100)}})),y(O(r),"playVideo",(function(){var e=r.videoRef.current;e&&e.play(),r.setState({isPlaying:!0})})),y(O(r),"pauseVideo",(function(){var e=r.videoRef.current;e&&e.pause(),r.setState({isPlaying:!1})})),y(O(r),"updatePlayerVolume",(function(){var e=r.props.muted,t=r.videoRef.current;t&&(t.volume=e?0:.5)})),y(O(r),"scrollToCursor",(function(){var e=r.state,t=e.playCursorPosition,n=(e.zoomFactor,e.forceCursorDragging),o=t.xRatio,i=t.yRatio,a=r.draggableApi.calculateCurrentPositionFromRatios(o,i).currentX,u=r.scrollable.current,s=u.scrollLeft,c=u.clientWidth;(n||as+c)&&(r.scrollable.current.scrollLeft=a)})),y(O(r),"updatePlayCursorPosition",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e){var n=r.videoRef.current,o=r.state.videoDuration;e=n&&o?n.currentTime/o:0}var i={xRatio:e,yRatio:0};r.setState({playCursorPosition:i},(function(){!0===t&&r.scrollToCursor()}))})),y(O(r),"handleVideoPlayerError",(function(e){var t=e.target.error;if(t&&4===t.code){var n=r.props.onNotSupportedVideoLoad;n&&n(t.message)}})),y(O(r),"handleDraggableApiMount",(function(e){return r.draggableApi=e})),y(O(r),"handleKeyPress",(function(e){32===e.keyCode&&(e.preventDefault(),r.toggleVideoAutoPlay())})),y(O(r),"handleLoadedData",(function(){var e=r.props.onVideoLoadedData,t=r.videoRef.current;if(t){var n=r.props.inPoint;void 0!==n&&r.seekVideoTo(n),r.updatePlayerVolume(),r.setState({videoDuration:t.duration},(function(){return r.updatePlayCursorPosition()})),e&&e(t)}})),y(O(r),"handleRangeChange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.state.rangeDisabled;if(!n||t){var o=r.props,i=o.onRangeChange,a=o.outPoint,u=e[1]!==a?"out":"in",s=r.getFormatedValues(e[0],e[1],u),c=s.inValue,l=s.outValue;i([c,l])}})),y(O(r),"handleBeforeRangeChange",(function(e,t){r.pauseVideo(),r.setState({isEditing:!0})})),y(O(r),"handleAfterRangeChange",(function(){var e=r.state,t=e.playCursorPosition,n=e.videoDuration;r.seekVideoTo(t.xRatio*n),r.setState({isEditing:!1})})),y(O(r),"handleFreePlayClick",(function(){r.toggleVideoAutoPlay(!1)})),y(O(r),"handlePlayCursorDrag",(function(e){var t=e.xRatio,n=r.state.videoDuration;r.seekVideoTo(n*t),r.setState({playCursorPosition:e})})),y(O(r),"handleZoomFactorDragStart",(function(){return r.setState({forceCursorDragging:!0})})),y(O(r),"handleZoomFactorDragEnd",(function(){return r.setState({forceCursorDragging:!1})})),y(O(r),"handleZoomFactorChange",(function(e){r.state.zoomFactor;r.setState({zoomFactor:e},r.scrollToCursor)})),y(O(r),"handleContainerMouseDown",(function(e){e.stopPropagation();var t=e.target;t.classList.contains("rc-slider-handle")||t.classList.contains("dnm-video-cut-playing-cursor")?r.setState({rangeDisabled:!1,forceCursorDragging:!1}):r.setState({rangeDisabled:!0,forceCursorDragging:!0})})),y(O(r),"handleContainerMouseUp",(function(){return r.setState({rangeDisabled:!0,forceCursorDragging:!1})})),y(O(r),"handleMuteChange",(function(e){var t=r.props.onMuteChange;t&&t(!e.target.checked)})),r.state={videoDuration:0,isEditing:!1,isPlaying:!1,rangeDisabled:!0,forceCursorDragging:!1,forceScrollToCursor:!1,zoomFactor:[0],playCursorPosition:{xRatio:0,yRatio:0}},r.videoRef=e.createRef(),r.scrollable=e.createRef(),r.draggable=e.createRef(),r.draggableApi=null,r.seekVideoTo=Xg(r._seekVideoTo,50),r}return b(n,e.Component),v(n,[{key:"componentDidMount",value:function(){window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentDidUpdate",value:function(e,t){var n=this.state,r=n.videoDuration,o=n.isEditing,i=this.props,a=i.inPoint,u=i.outPoint,s=i.src,c=i.muted;if(isNaN(r)||r===t.videoDuration||this.handleRangeChange([a,u],!0),s!==e.src&&this.pauseVideo(),o&&(e.inPoint!==a||e.outPoint!==u)){var l;if(e.inPoint!==a&&e.outPoint!==u){var f=this.getAcceptedDuration(),p=f.min,d=f.max;l=Math.abs(u-a-p)a?a:u}else l=e.outPoint!==u?u:a;this.seekVideoTo(l)}c!==e.muted&&this.updatePlayerVolume()}},{key:"_seekVideoTo",value:function(e){if(!isNaN(e)){var t=this.videoRef.current;t&&(t.currentTime=e)}}},{key:"render",value:function(){var e=this.getFormatedValues(),t=e.inValue,n=e.outValue,r=this.state,o=r.videoDuration,i=r.isEditing,a=r.playCursorPosition,u=r.isPlaying,s=r.forceCursorDragging,c=r.zoomFactor,l=this.props,f=l.src,p=l.catalogue,d=l.classes,h=l.playerCursorWidth,v=l.muted,y=l.onMuteChange;return Lt("div",{css:Wt(n_(),zs)},Lt("div",{className:"dnm-video-cut-root ".concat(d.root||""," ").concat(i?"is-editing":""," ").concat(u?"is-playing":"is-paused")},Lt("video",{className:"dnm-video-cut-player ".concat(d.player||""),src:"".concat(f),ref:this.videoRef,loop:!0,muted:v,controls:!1,onLoadedData:this.handleLoadedData,onLoad:this.handleVideoLoad,onError:this.handleVideoPlayerError}),Lt("div",null,Lt("div",{className:"dnm-video-cut-play-icon",onClick:this.handleFreePlayClick},Lt(u?e_:Qb,null)),Lt("div",{className:"dnm-video-cut-progress-scrollable-parent",ref:this.scrollable},Lt("div",{className:"dnm-video-cut-progress-container",style:{width:"calc(".concat(c[0]+100,"% - 20px)")},onTouchStart:this.handleContainerMouseDown,onTouchEnd:this.handleContainerMouseUp,onMouseDown:this.handleContainerMouseDown,onMouseUp:this.handleContainerMouseUp},Lt(Jb,{className:"dnm-video-cut-playing-cursor-draggable-item",axis:"x",forceDragging:s,onMount:this.handleDraggableApiMount,onDrag:this.handlePlayCursorDrag,onDragStart:this.pauseVideo,position:a,draggableWidth:h,rerenderKey:c[0]},Lt("div",{className:"dnm-video-cut-playing-cursor",ref:this.draggable})),Lt(r_,{className:"dnm-video-cut-range ".concat(d.range||""),min:0,max:o||0,step:.05,value:[t,n],onChange:this.handleRangeChange,onBeforeChange:this.handleBeforeRangeChange,onAfterChange:this.handleAfterRangeChange}))),Lt("div",{className:"dnm-video-cut-tools"},Lt("div",{className:"dnm-video-cut-mute"},y&&Lt("label",{className:"dnm-video-cut-checkbox-container"},p.unmute,Lt("input",{type:"checkbox",checked:!v,onChange:this.handleMuteChange}),Lt("span",{className:"dnm-video-cut-checkmark"}))),Lt("div",{className:"dnm-video-cut-zoom"},Lt(r_,{className:"dnm-video-cut-zoom-range ".concat(d.zoomRange||""),min:0,max:900,step:.05,value:c,onBeforeChange:this.handleZoomFactorDragStart,onAfterChange:this.handleZoomFactorDragEnd,onChange:this.handleZoomFactorChange}),Lt("div",{className:"dnm-video-cut-zoom-icon"},Lt(t_,null))),Lt("div",{className:"clearfix"})))))}}]),n}();o_.propTypes={catalogue:p.object,classes:p.shape({root:p.string,player:p.string,range:p.string}),onRangeChange:p.func.isRequired,onNotSupportedVideoLoad:p.func,onVideoLoadedData:p.func,src:p.string.isRequired,inPoint:p.number,outPoint:p.number,draggableWidth:p.number,maxDuration:p.number,minDuration:p.number,muted:p.bool,onMuteChange:p.func,playerCursorWidth:p.oneOfType([p.func,p.number])},o_.defaultProps={catalogue:{unmute:"Enable sound"},classes:{},onRangeChange:function(e){return null},onNotSupportedVideoLoad:function(e){return null},onVideoLoadedData:function(e){return null},inPoint:0,outPoint:0,draggableWidth:null,maxDuration:0,minDuration:0,muted:!1,playerCursorWidth:14};export default o_; diff --git a/dist/dnm-react-video-cut.umd.js b/dist/dnm-react-video-cut.umd.js index 4a453b5..53b87a0 100644 --- a/dist/dnm-react-video-cut.umd.js +++ b/dist/dnm-react-video-cut.umd.js @@ -30059,7 +30059,7 @@ minDuration: PropTypes.number, muted: PropTypes.bool, onMuteChange: PropTypes.func, - playerCursorWidth: PropTypes.oneOfType([PropTypes.func, PropTypes["int"]]) + playerCursorWidth: PropTypes.oneOfType([PropTypes.func, PropTypes.number]) }; DnmVideoCut.defaultProps = { catalogue: { diff --git a/dist/dnm-react-video-cut.umd.min.js b/dist/dnm-react-video-cut.umd.min.js index dd160b9..73ecaa7 100644 --- a/dist/dnm-react-video-cut.umd.min.js +++ b/dist/dnm-react-video-cut.umd.min.js @@ -29,4 +29,4 @@ var zo=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,$o=Object * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var y_,m_=4294967295,g_=Array.prototype,b_=Object.prototype.hasOwnProperty,__=Ys?Ys.iterator:void 0,w_=Math.max,O_=Math.min,x_=function(e){return function(t,n,r){if(null==r){var o=lc(n),i=o&&xf(n),a=i&&i.length&&yy(n,i);(a?a.length:o)||(r=n,n=t,t=this)}return e(t,n,r)}}(xm);ol.after=r_.after,ol.ary=r_.ary,ol.assign=c_.assign,ol.assignIn=c_.assignIn,ol.assignInWith=c_.assignInWith,ol.assignWith=c_.assignWith,ol.at=c_.at,ol.before=r_.before,ol.bind=r_.bind,ol.bindAll=p_.bindAll,ol.bindKey=r_.bindKey,ol.castArray=o_.castArray,ol.chain=l_.chain,ol.chunk=e_.chunk,ol.compact=e_.compact,ol.concat=e_.concat,ol.cond=p_.cond,ol.conforms=p_.conforms,ol.constant=p_.constant,ol.countBy=t_.countBy,ol.create=c_.create,ol.curry=r_.curry,ol.curryRight=r_.curryRight,ol.debounce=r_.debounce,ol.defaults=c_.defaults,ol.defaultsDeep=c_.defaultsDeep,ol.defer=r_.defer,ol.delay=r_.delay,ol.difference=e_.difference,ol.differenceBy=e_.differenceBy,ol.differenceWith=e_.differenceWith,ol.drop=e_.drop,ol.dropRight=e_.dropRight,ol.dropRightWhile=e_.dropRightWhile,ol.dropWhile=e_.dropWhile,ol.fill=e_.fill,ol.filter=t_.filter,ol.flatMap=t_.flatMap,ol.flatMapDeep=t_.flatMapDeep,ol.flatMapDepth=t_.flatMapDepth,ol.flatten=e_.flatten,ol.flattenDeep=e_.flattenDeep,ol.flattenDepth=e_.flattenDepth,ol.flip=r_.flip,ol.flow=p_.flow,ol.flowRight=p_.flowRight,ol.fromPairs=e_.fromPairs,ol.functions=c_.functions,ol.functionsIn=c_.functionsIn,ol.groupBy=t_.groupBy,ol.initial=e_.initial,ol.intersection=e_.intersection,ol.intersectionBy=e_.intersectionBy,ol.intersectionWith=e_.intersectionWith,ol.invert=c_.invert,ol.invertBy=c_.invertBy,ol.invokeMap=t_.invokeMap,ol.iteratee=p_.iteratee,ol.keyBy=t_.keyBy,ol.keys=xf,ol.keysIn=c_.keysIn,ol.map=t_.map,ol.mapKeys=c_.mapKeys,ol.mapValues=c_.mapValues,ol.matches=p_.matches,ol.matchesProperty=p_.matchesProperty,ol.memoize=r_.memoize,ol.merge=c_.merge,ol.mergeWith=c_.mergeWith,ol.method=p_.method,ol.methodOf=p_.methodOf,ol.mixin=x_,ol.negate=Sm,ol.nthArg=p_.nthArg,ol.omit=c_.omit,ol.omitBy=c_.omitBy,ol.once=r_.once,ol.orderBy=t_.orderBy,ol.over=p_.over,ol.overArgs=r_.overArgs,ol.overEvery=p_.overEvery,ol.overSome=p_.overSome,ol.partial=r_.partial,ol.partialRight=r_.partialRight,ol.partition=t_.partition,ol.pick=c_.pick,ol.pickBy=c_.pickBy,ol.property=p_.property,ol.propertyOf=p_.propertyOf,ol.pull=e_.pull,ol.pullAll=e_.pullAll,ol.pullAllBy=e_.pullAllBy,ol.pullAllWith=e_.pullAllWith,ol.pullAt=e_.pullAt,ol.range=p_.range,ol.rangeRight=p_.rangeRight,ol.rearg=r_.rearg,ol.reject=t_.reject,ol.remove=e_.remove,ol.rest=r_.rest,ol.reverse=e_.reverse,ol.sampleSize=t_.sampleSize,ol.set=c_.set,ol.setWith=c_.setWith,ol.shuffle=t_.shuffle,ol.slice=e_.slice,ol.sortBy=t_.sortBy,ol.sortedUniq=e_.sortedUniq,ol.sortedUniqBy=e_.sortedUniqBy,ol.split=f_.split,ol.spread=r_.spread,ol.tail=e_.tail,ol.take=e_.take,ol.takeRight=e_.takeRight,ol.takeRightWhile=e_.takeRightWhile,ol.takeWhile=e_.takeWhile,ol.tap=l_.tap,ol.throttle=r_.throttle,ol.thru=bb,ol.toArray=o_.toArray,ol.toPairs=c_.toPairs,ol.toPairsIn=c_.toPairsIn,ol.toPath=p_.toPath,ol.toPlainObject=o_.toPlainObject,ol.transform=c_.transform,ol.unary=r_.unary,ol.union=e_.union,ol.unionBy=e_.unionBy,ol.unionWith=e_.unionWith,ol.uniq=e_.uniq,ol.uniqBy=e_.uniqBy,ol.uniqWith=e_.uniqWith,ol.unset=c_.unset,ol.unzip=e_.unzip,ol.unzipWith=e_.unzipWith,ol.update=c_.update,ol.updateWith=c_.updateWith,ol.values=c_.values,ol.valuesIn=c_.valuesIn,ol.without=e_.without,ol.words=f_.words,ol.wrap=r_.wrap,ol.xor=e_.xor,ol.xorBy=e_.xorBy,ol.xorWith=e_.xorWith,ol.zip=e_.zip,ol.zipObject=e_.zipObject,ol.zipObjectDeep=e_.zipObjectDeep,ol.zipWith=e_.zipWith,ol.entries=c_.toPairs,ol.entriesIn=c_.toPairsIn,ol.extend=c_.assignIn,ol.extendWith=c_.assignInWith,x_(ol,ol),ol.add=i_.add,ol.attempt=p_.attempt,ol.camelCase=f_.camelCase,ol.capitalize=f_.capitalize,ol.ceil=i_.ceil,ol.clamp=a_,ol.clone=o_.clone,ol.cloneDeep=o_.cloneDeep,ol.cloneDeepWith=o_.cloneDeepWith,ol.cloneWith=o_.cloneWith,ol.conformsTo=o_.conformsTo,ol.deburr=f_.deburr,ol.defaultTo=p_.defaultTo,ol.divide=i_.divide,ol.endsWith=f_.endsWith,ol.eq=o_.eq,ol.escape=f_.escape,ol.escapeRegExp=f_.escapeRegExp,ol.every=t_.every,ol.find=t_.find,ol.findIndex=e_.findIndex,ol.findKey=c_.findKey,ol.findLast=t_.findLast,ol.findLastIndex=e_.findLastIndex,ol.findLastKey=c_.findLastKey,ol.floor=i_.floor,ol.forEach=t_.forEach,ol.forEachRight=t_.forEachRight,ol.forIn=c_.forIn,ol.forInRight=c_.forInRight,ol.forOwn=c_.forOwn,ol.forOwnRight=c_.forOwnRight,ol.get=c_.get,ol.gt=o_.gt,ol.gte=o_.gte,ol.has=c_.has,ol.hasIn=c_.hasIn,ol.head=e_.head,ol.identity=_c,ol.includes=t_.includes,ol.indexOf=e_.indexOf,ol.inRange=u_,ol.invoke=c_.invoke,ol.isArguments=o_.isArguments,ol.isArray=oc,ol.isArrayBuffer=o_.isArrayBuffer,ol.isArrayLike=o_.isArrayLike,ol.isArrayLikeObject=o_.isArrayLikeObject,ol.isBoolean=o_.isBoolean,ol.isBuffer=o_.isBuffer,ol.isDate=o_.isDate,ol.isElement=o_.isElement,ol.isEmpty=o_.isEmpty,ol.isEqual=o_.isEqual,ol.isEqualWith=o_.isEqualWith,ol.isError=o_.isError,ol.isFinite=o_.isFinite,ol.isFunction=o_.isFunction,ol.isInteger=o_.isInteger,ol.isLength=o_.isLength,ol.isMap=o_.isMap,ol.isMatch=o_.isMatch,ol.isMatchWith=o_.isMatchWith,ol.isNaN=o_.isNaN,ol.isNative=o_.isNative,ol.isNil=o_.isNil,ol.isNull=o_.isNull,ol.isNumber=o_.isNumber,ol.isObject=lc,ol.isObjectLike=o_.isObjectLike,ol.isPlainObject=o_.isPlainObject,ol.isRegExp=o_.isRegExp,ol.isSafeInteger=o_.isSafeInteger,ol.isSet=o_.isSet,ol.isString=o_.isString,ol.isSymbol=o_.isSymbol,ol.isTypedArray=o_.isTypedArray,ol.isUndefined=o_.isUndefined,ol.isWeakMap=o_.isWeakMap,ol.isWeakSet=o_.isWeakSet,ol.join=e_.join,ol.kebabCase=f_.kebabCase,ol.last=Mv,ol.lastIndexOf=e_.lastIndexOf,ol.lowerCase=f_.lowerCase,ol.lowerFirst=f_.lowerFirst,ol.lt=o_.lt,ol.lte=o_.lte,ol.max=i_.max,ol.maxBy=i_.maxBy,ol.mean=i_.mean,ol.meanBy=i_.meanBy,ol.min=i_.min,ol.minBy=i_.minBy,ol.stubArray=p_.stubArray,ol.stubFalse=p_.stubFalse,ol.stubObject=p_.stubObject,ol.stubString=p_.stubString,ol.stubTrue=p_.stubTrue,ol.multiply=i_.multiply,ol.nth=e_.nth,ol.noop=p_.noop,ol.now=n_,ol.pad=f_.pad,ol.padEnd=f_.padEnd,ol.padStart=f_.padStart,ol.parseInt=f_.parseInt,ol.random=s_,ol.reduce=t_.reduce,ol.reduceRight=t_.reduceRight,ol.repeat=f_.repeat,ol.replace=f_.replace,ol.result=c_.result,ol.round=i_.round,ol.sample=t_.sample,ol.size=t_.size,ol.snakeCase=f_.snakeCase,ol.some=t_.some,ol.sortedIndex=e_.sortedIndex,ol.sortedIndexBy=e_.sortedIndexBy,ol.sortedIndexOf=e_.sortedIndexOf,ol.sortedLastIndex=e_.sortedLastIndex,ol.sortedLastIndexBy=e_.sortedLastIndexBy,ol.sortedLastIndexOf=e_.sortedLastIndexOf,ol.startCase=f_.startCase,ol.startsWith=f_.startsWith,ol.subtract=i_.subtract,ol.sum=i_.sum,ol.sumBy=i_.sumBy,ol.template=f_.template,ol.times=p_.times,ol.toFinite=o_.toFinite,ol.toInteger=bc,ol.toLength=o_.toLength,ol.toLower=f_.toLower,ol.toNumber=o_.toNumber,ol.toSafeInteger=o_.toSafeInteger,ol.toString=o_.toString,ol.toUpper=f_.toUpper,ol.trim=f_.trim,ol.trimEnd=f_.trimEnd,ol.trimStart=f_.trimStart,ol.truncate=f_.truncate,ol.unescape=f_.unescape,ol.uniqueId=p_.uniqueId,ol.upperCase=f_.upperCase,ol.upperFirst=f_.upperFirst,ol.each=t_.forEach,ol.eachRight=t_.forEachRight,ol.first=e_.head,x_(ol,(y_={},Qh(ol,(function(e,t){b_.call(ol.prototype,t)||(y_[t]=e)})),y_),{chain:!1}),ol.VERSION="4.17.20",(ol.templateSettings=f_.templateSettings).imports._=ol,vl(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){ol[e].placeholder=ol})),vl(["drop","take"],(function(e,t){Kc.prototype[e]=function(n){n=void 0===n?1:w_(bc(n),0);var r=this.__filtered__&&!t?new Kc(this):this.clone();return r.__filtered__?r.__takeCount__=O_(n,r.__takeCount__):r.__views__.push({size:O_(n,m_),type:e+(r.__dir__<0?"Right":"")}),r},Kc.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),vl(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Kc.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Kh(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),vl(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Kc.prototype[e]=function(){return this[n](1).value()[0]}})),vl(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Kc.prototype[e]=function(){return this.__filtered__?new Kc(this):this[n](1)}})),Kc.prototype.compact=function(){return this.filter(_c)},Kc.prototype.find=function(e){return this.filter(e).head()},Kc.prototype.findLast=function(e){return this.reverse().find(e)},Kc.prototype.invokeMap=Hl((function(e,t){return"function"==typeof e?new Kc(this):this.map((function(n){return Yy(n,e,t)}))})),Kc.prototype.reject=function(e){return this.filter(Sm(Kh(e)))},Kc.prototype.slice=function(e,t){e=bc(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Kc(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=bc(t))<0?n.dropRight(-t):n.take(t-e)),n)},Kc.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Kc.prototype.toArray=function(){return this.take(m_)},Qh(Kc.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=ol[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(ol.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Kc,s=a[0],c=u||oc(t),l=function(e){var t=o.apply(ol,tp([e],a));return r&&f?t[0]:t};c&&n&&"function"==typeof s&&1!=s.length&&(u=c=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&c){t=h?t:new Kc(this);var v=e.apply(t,a);return v.__actions__.push({func:bb,args:[l],thisArg:void 0}),new el(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),vl(["pop","push","shift","sort","splice","unshift"],(function(e){var t=g_[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);ol.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(oc(o)?o:[],e)}return this[n]((function(n){return t.apply(oc(n)?n:[],e)}))}})),Qh(Kc.prototype,(function(e,t){var n=ol[t];if(n){var r=n.name+"";b_.call(Zc,r)||(Zc[r]=[]),Zc[r].push({name:t,func:n})}})),Zc[Pl(void 0,2).name]=[{name:"wrapper",func:void 0}],Kc.prototype.clone=function(){var e=new Kc(this.__wrapped__);return e.__actions__=tl(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=tl(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=tl(this.__views__),e},Kc.prototype.reverse=function(){if(this.__filtered__){var e=new Kc(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Kc.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=oc(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r1&&void 0!==arguments[1]&&arguments[1],r=n.props.forceDragging;if(n.active||r||!0===t){var o,i;e.preventDefault(),"touchmove"===e.type?(o=e.touches[0].clientX-n.initialX,i=e.touches[0].clientY-n.initialY):(o=e.clientX-n.initialX,i=e.clientY-n.initialY);var a=!1,u=5,s=50,c=n.getContainerDimensions(),l=c.containerWidth,f=c.containerHeight,p=n.getAxis(),d=p.xAxis,h=p.yAxis;o>l?(d&&o+u>l&&(a=!0),o=l):o<0&&(d&&o<-u&&(a=!0),o=0),i>f?(h&&i+s>f&&(a=!0),i=f):i<0&&(h&&i<-s&&(a=!0),i=0),!0===a&&n.handleDragEnd(),n.updateState({xRatio:o/l,yRatio:i/f})}})),s(h(n),"handleDragEnd",(function(e){n.active=!1;var t=n.props.onDragEnd;t&&t(),(new Date).getTime()-n.lastMouseDown<300&&n.handleDrag(e,!0)})),s(h(n),"_handleWindowResize",(function(){var e=n.state.render_key;n.updateState({render_key:e})})),s(h(n),"getContainerDimensions",(function(){var e=0,t=0;if(n.container){var r=["paddingLeft","paddingRight","paddingTop","paddingBottom"].map((function(e){return Math.round(getComputedStyle(n.container)[e].replace("px","")||0)}));e=n.container.clientWidth-(r[0]+r[1])-n.draggableRef.current.clientWidth,t=n.container.clientHeight-(r[2]+r[3])-n.draggableRef.current.clientHeight}return{containerWidth:e,containerHeight:t}})),s(h(n),"getCurrentPositionWithPercent",(function(){var e=n.getCurrentPosition(),t=e.xRatio,r=e.yRatio,o=n.getContainerDimensions();return{currentX:t*o.containerWidth,currentY:r*o.containerHeight}})),s(h(n),"getAxis",(function(){var e=n.props.axis;return{xAxis:"y"!==e,yAxis:"x"!==e}})),s(h(n),"getCurrentPosition",(function(){var e=n.props.position;if(e){var t=e.xRatio,r=e.yRatio;return l({xRatio:t,yRatio:r},n.calculateCurrentPositionFromRatios(t,r))}return n.state})),s(h(n),"calculateCurrentPositionFromRatios",(function(e,t){var r=n.getContainerDimensions();return{currentX:e*r.containerWidth,currentY:t*r.containerHeight}})),s(h(n),"updateState",(function(e){n.lastMove=(new Date).getTime();var t=n.props,r=t.position,o=t.onDrag;r?o(l({},r,{},e)):n.setState(e)})),n.state={xRatio:0,yRatio:0,render_key:0},n.active=!1,n.initialX=0,n.initialY=0,n.ghostContainerDimensions=n.getContainerDimensions(),n.draggableRef=r.createRef(),n.handleWindowResize=gb(n._handleWindowResize,200),n}return f(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this.props.onMount;this.container=o.findDOMNode(this).parentNode,this.container.addEventListener("touchstart",this.handleDragStart,!1),this.container.addEventListener("touchend",this.handleDragEnd,!1),this.container.addEventListener("touchmove",this.handleDrag,!1),this.container.addEventListener("mousedown",this.handleDragStart,!1),this.container.addEventListener("mouseup",this.handleDragEnd,!1),this.container.addEventListener("mousemove",this.handleDrag,!1),window.addEventListener("resize",this.handleWindowResize,!1),e&&e(this)}},{key:"componentDidUpdate",value:function(){var e=this.ghostContainerDimensions,t=e.containerWidth,n=e.containerHeight;this.ghostContainerDimensions=this.getContainerDimensions(),t===this.ghostContainerDimensions.containerWidth&&n===this.ghostContainerDimensions.containerHeight||this._handleWindowResize()}},{key:"componentWillUnmount",value:function(){this.container.removeEventListener("touchstart",this.handleDragStart),this.container.removeEventListener("touchend",this.handleDragEnd),this.container.removeEventListener("touchmove",this.handleDrag),this.container.removeEventListener("mousedown",this.handleDragStart),this.container.removeEventListener("mouseup",this.handleDragEnd),this.container.removeEventListener("mousemove",this.handleDrag),window.removeEventListener("resize",this.handleWindowResize,!1)}},{key:"render",value:function(){var e=this.getCurrentPosition(),t=e.currentX,n=e.currentY,o=this.props.className,i=this.getAxis(),a=i.xAxis,u=i.yAxis;return r.createElement("div",{ref:this.draggableRef,style:{transform:"translate3d(".concat(a?t:0,"px, ").concat(u?n:0,"px, 0)")},className:"react-draggable ".concat(o||"")},this.props.children)}}]),t}(r.Component);E_.propTypes={className:n.string,axis:n.oneOf(["x","y"]),position:n.shape({xRatio:n.number,yRatio:n.number}),onDragStart:n.func,onDrag:n.func,onDragEnd:n.func,draggableWidth:n.number,draggableHeight:n.number};var S_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 448 512"},r.createElement("path",{fill:"currentColor",d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}))}}]),t}(r.Component),k_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 448 512"},r.createElement("path",{fill:"currentColor",d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))}}]),t}(r.Component),j_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("path",{fill:"currentColor",d:"M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"}))}}]),t}(r.Component);function C_(){var e=y(["",""]);return C_=function(){return e},e}var M_=Ai.Range,P_=function(e){function t(e){var n;return i(this,t),s(h(n=v(this,p(t).call(this,e))),"componentWillUnmount",(function(){window.removeEventListener("keydown",n.handleKeyPress)})),s(h(n),"getAcceptedDuration",(function(){var e=n.props,t=e.minDuration,r=e.maxDuration,o=n.state.videoDuration,i=parseFloat(t)||0;i<0&&(i=0);var a=parseFloat(r)||o;return a>o&&(a=o),i>a?{min:a,max:i}:{min:i,max:a}})),s(h(n),"getFormatedValues",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"in";e||(e=n.props.inPoint),t||(t=n.props.outPoint);var o=n.getAcceptedDuration(),i=o.min,a=o.max,u=n.state.videoDuration,s=e||0,c=t||u,l=function(e){c-s>a?"in"===e?c=s+a:s=c-a:c-su&&(c=u,l("out")),{inValue:s,outValue:c}})),s(h(n),"toggleVideoAutoPlay",(function(e){var t=n.videoRef.current;t&&(t.paused?(n.playVideo(),n.monitorAutoplay(e)):n.pauseVideo())})),s(h(n),"monitorAutoplay",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=n.videoRef.current;if(t&&!t.paused){if(!0===e){var r=n.getFormatedValues(),o=r.inValue,i=r.outValue,a=t.currentTime;(ai)&&(t.currentTime=o)}n.updatePlayCursorPosition(null,!0),setTimeout((function(){return n.monitorAutoplay(e)}),100)}})),s(h(n),"playVideo",(function(){var e=n.videoRef.current;e&&e.play(),n.setState({isPlaying:!0})})),s(h(n),"pauseVideo",(function(){var e=n.videoRef.current;e&&e.pause(),n.setState({isPlaying:!1})})),s(h(n),"updatePlayerVolume",(function(){var e=n.props.muted,t=n.videoRef.current;t&&(t.volume=e?0:.5)})),s(h(n),"scrollToCursor",(function(){var e=n.state,t=e.playCursorPosition,r=(e.zoomFactor,e.forceCursorDragging),o=t.xRatio,i=t.yRatio,a=n.draggableApi.calculateCurrentPositionFromRatios(o,i).currentX,u=n.scrollable.current,s=u.scrollLeft,c=u.clientWidth;(r||as+c)&&(n.scrollable.current.scrollLeft=a)})),s(h(n),"updatePlayCursorPosition",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e){var r=n.videoRef.current,o=n.state.videoDuration;e=r&&o?r.currentTime/o:0}var i={xRatio:e,yRatio:0};n.setState({playCursorPosition:i},(function(){!0===t&&n.scrollToCursor()}))})),s(h(n),"handleVideoPlayerError",(function(e){var t=e.target.error;if(t&&4===t.code){var r=n.props.onNotSupportedVideoLoad;r&&r(t.message)}})),s(h(n),"handleDraggableApiMount",(function(e){return n.draggableApi=e})),s(h(n),"handleKeyPress",(function(e){32===e.keyCode&&(e.preventDefault(),n.toggleVideoAutoPlay())})),s(h(n),"handleLoadedData",(function(){var e=n.props.onVideoLoadedData,t=n.videoRef.current;if(t){var r=n.props.inPoint;void 0!==r&&n.seekVideoTo(r),n.updatePlayerVolume(),n.setState({videoDuration:t.duration},(function(){return n.updatePlayCursorPosition()})),e&&e(t)}})),s(h(n),"handleRangeChange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n.state.rangeDisabled;if(!r||t){var o=n.props,i=o.onRangeChange,a=o.outPoint,u=e[1]!==a?"out":"in",s=n.getFormatedValues(e[0],e[1],u),c=s.inValue,l=s.outValue;i([c,l])}})),s(h(n),"handleBeforeRangeChange",(function(e,t){n.pauseVideo(),n.setState({isEditing:!0})})),s(h(n),"handleAfterRangeChange",(function(){var e=n.state,t=e.playCursorPosition,r=e.videoDuration;n.seekVideoTo(t.xRatio*r),n.setState({isEditing:!1})})),s(h(n),"handleFreePlayClick",(function(){n.toggleVideoAutoPlay(!1)})),s(h(n),"handlePlayCursorDrag",(function(e){var t=e.xRatio,r=n.state.videoDuration;n.seekVideoTo(r*t),n.setState({playCursorPosition:e})})),s(h(n),"handleZoomFactorDragStart",(function(){return n.setState({forceCursorDragging:!0})})),s(h(n),"handleZoomFactorDragEnd",(function(){return n.setState({forceCursorDragging:!1})})),s(h(n),"handleZoomFactorChange",(function(e){n.state.zoomFactor;n.setState({zoomFactor:e},n.scrollToCursor)})),s(h(n),"handleContainerMouseDown",(function(e){e.stopPropagation();var t=e.target;t.classList.contains("rc-slider-handle")||t.classList.contains("dnm-video-cut-playing-cursor")?n.setState({rangeDisabled:!1,forceCursorDragging:!1}):n.setState({rangeDisabled:!0,forceCursorDragging:!0})})),s(h(n),"handleContainerMouseUp",(function(){return n.setState({rangeDisabled:!0,forceCursorDragging:!1})})),s(h(n),"handleMuteChange",(function(e){var t=n.props.onMuteChange;t&&t(!e.target.checked)})),n.state={videoDuration:0,isEditing:!1,isPlaying:!1,rangeDisabled:!0,forceCursorDragging:!1,forceScrollToCursor:!1,zoomFactor:[0],playCursorPosition:{xRatio:0,yRatio:0}},n.videoRef=r.createRef(),n.scrollable=r.createRef(),n.draggable=r.createRef(),n.draggableApi=null,n.seekVideoTo=gb(n._seekVideoTo,50),n}return f(t,e),u(t,[{key:"componentDidMount",value:function(){window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentDidUpdate",value:function(e,t){var n=this.state,r=n.videoDuration,o=n.isEditing,i=this.props,a=i.inPoint,u=i.outPoint,s=i.src,c=i.muted;if(isNaN(r)||r===t.videoDuration||this.handleRangeChange([a,u],!0),s!==e.src&&this.pauseVideo(),o&&(e.inPoint!==a||e.outPoint!==u)){var l;if(e.inPoint!==a&&e.outPoint!==u){var f=this.getAcceptedDuration(),p=f.min,d=f.max;l=Math.abs(u-a-p)a?a:u}else l=e.outPoint!==u?u:a;this.seekVideoTo(l)}c!==e.muted&&this.updatePlayerVolume()}},{key:"_seekVideoTo",value:function(e){if(!isNaN(e)){var t=this.videoRef.current;t&&(t.currentTime=e)}}},{key:"render",value:function(){var e=this.getFormatedValues(),t=e.inValue,n=e.outValue,r=this.state,o=r.videoDuration,i=r.isEditing,a=r.playCursorPosition,u=r.isPlaying,s=r.forceCursorDragging,c=r.zoomFactor,l=this.props,f=l.src,p=l.catalogue,d=l.classes,h=l.playerCursorWidth,v=l.muted,y=l.onMuteChange;return Ct("div",{css:At(C_(),Us)},Ct("div",{className:"dnm-video-cut-root ".concat(d.root||""," ").concat(i?"is-editing":""," ").concat(u?"is-playing":"is-paused")},Ct("video",{className:"dnm-video-cut-player ".concat(d.player||""),src:"".concat(f),ref:this.videoRef,loop:!0,muted:v,controls:!1,onLoadedData:this.handleLoadedData,onLoad:this.handleVideoLoad,onError:this.handleVideoPlayerError}),Ct("div",null,Ct("div",{className:"dnm-video-cut-play-icon",onClick:this.handleFreePlayClick},Ct(u?k_:S_,null)),Ct("div",{className:"dnm-video-cut-progress-scrollable-parent",ref:this.scrollable},Ct("div",{className:"dnm-video-cut-progress-container",style:{width:"calc(".concat(c[0]+100,"% - 20px)")},onTouchStart:this.handleContainerMouseDown,onTouchEnd:this.handleContainerMouseUp,onMouseDown:this.handleContainerMouseDown,onMouseUp:this.handleContainerMouseUp},Ct(E_,{className:"dnm-video-cut-playing-cursor-draggable-item",axis:"x",forceDragging:s,onMount:this.handleDraggableApiMount,onDrag:this.handlePlayCursorDrag,onDragStart:this.pauseVideo,position:a,draggableWidth:h,rerenderKey:c[0]},Ct("div",{className:"dnm-video-cut-playing-cursor",ref:this.draggable})),Ct(M_,{className:"dnm-video-cut-range ".concat(d.range||""),min:0,max:o||0,step:.05,value:[t,n],onChange:this.handleRangeChange,onBeforeChange:this.handleBeforeRangeChange,onAfterChange:this.handleAfterRangeChange}))),Ct("div",{className:"dnm-video-cut-tools"},Ct("div",{className:"dnm-video-cut-mute"},y&&Ct("label",{className:"dnm-video-cut-checkbox-container"},p.unmute,Ct("input",{type:"checkbox",checked:!v,onChange:this.handleMuteChange}),Ct("span",{className:"dnm-video-cut-checkmark"}))),Ct("div",{className:"dnm-video-cut-zoom"},Ct(M_,{className:"dnm-video-cut-zoom-range ".concat(d.zoomRange||""),min:0,max:900,step:.05,value:c,onBeforeChange:this.handleZoomFactorDragStart,onAfterChange:this.handleZoomFactorDragEnd,onChange:this.handleZoomFactorChange}),Ct("div",{className:"dnm-video-cut-zoom-icon"},Ct(j_,null))),Ct("div",{className:"clearfix"})))))}}]),t}(r.Component);return P_.propTypes={catalogue:n.object,classes:n.shape({root:n.string,player:n.string,range:n.string}),onRangeChange:n.func.isRequired,onNotSupportedVideoLoad:n.func,onVideoLoadedData:n.func,src:n.string.isRequired,inPoint:n.number,outPoint:n.number,draggableWidth:n.number,maxDuration:n.number,minDuration:n.number,muted:n.bool,onMuteChange:n.func,playerCursorWidth:n.oneOfType([n.func,n.int])},P_.defaultProps={catalogue:{unmute:"Enable sound"},classes:{},onRangeChange:function(e){return null},onNotSupportedVideoLoad:function(e){return null},onVideoLoadedData:function(e){return null},inPoint:0,outPoint:0,draggableWidth:null,maxDuration:0,minDuration:0,muted:!1,playerCursorWidth:14},P_})); +var y_,m_=4294967295,g_=Array.prototype,b_=Object.prototype.hasOwnProperty,__=Ys?Ys.iterator:void 0,w_=Math.max,O_=Math.min,x_=function(e){return function(t,n,r){if(null==r){var o=lc(n),i=o&&xf(n),a=i&&i.length&&yy(n,i);(a?a.length:o)||(r=n,n=t,t=this)}return e(t,n,r)}}(xm);ol.after=r_.after,ol.ary=r_.ary,ol.assign=c_.assign,ol.assignIn=c_.assignIn,ol.assignInWith=c_.assignInWith,ol.assignWith=c_.assignWith,ol.at=c_.at,ol.before=r_.before,ol.bind=r_.bind,ol.bindAll=p_.bindAll,ol.bindKey=r_.bindKey,ol.castArray=o_.castArray,ol.chain=l_.chain,ol.chunk=e_.chunk,ol.compact=e_.compact,ol.concat=e_.concat,ol.cond=p_.cond,ol.conforms=p_.conforms,ol.constant=p_.constant,ol.countBy=t_.countBy,ol.create=c_.create,ol.curry=r_.curry,ol.curryRight=r_.curryRight,ol.debounce=r_.debounce,ol.defaults=c_.defaults,ol.defaultsDeep=c_.defaultsDeep,ol.defer=r_.defer,ol.delay=r_.delay,ol.difference=e_.difference,ol.differenceBy=e_.differenceBy,ol.differenceWith=e_.differenceWith,ol.drop=e_.drop,ol.dropRight=e_.dropRight,ol.dropRightWhile=e_.dropRightWhile,ol.dropWhile=e_.dropWhile,ol.fill=e_.fill,ol.filter=t_.filter,ol.flatMap=t_.flatMap,ol.flatMapDeep=t_.flatMapDeep,ol.flatMapDepth=t_.flatMapDepth,ol.flatten=e_.flatten,ol.flattenDeep=e_.flattenDeep,ol.flattenDepth=e_.flattenDepth,ol.flip=r_.flip,ol.flow=p_.flow,ol.flowRight=p_.flowRight,ol.fromPairs=e_.fromPairs,ol.functions=c_.functions,ol.functionsIn=c_.functionsIn,ol.groupBy=t_.groupBy,ol.initial=e_.initial,ol.intersection=e_.intersection,ol.intersectionBy=e_.intersectionBy,ol.intersectionWith=e_.intersectionWith,ol.invert=c_.invert,ol.invertBy=c_.invertBy,ol.invokeMap=t_.invokeMap,ol.iteratee=p_.iteratee,ol.keyBy=t_.keyBy,ol.keys=xf,ol.keysIn=c_.keysIn,ol.map=t_.map,ol.mapKeys=c_.mapKeys,ol.mapValues=c_.mapValues,ol.matches=p_.matches,ol.matchesProperty=p_.matchesProperty,ol.memoize=r_.memoize,ol.merge=c_.merge,ol.mergeWith=c_.mergeWith,ol.method=p_.method,ol.methodOf=p_.methodOf,ol.mixin=x_,ol.negate=Sm,ol.nthArg=p_.nthArg,ol.omit=c_.omit,ol.omitBy=c_.omitBy,ol.once=r_.once,ol.orderBy=t_.orderBy,ol.over=p_.over,ol.overArgs=r_.overArgs,ol.overEvery=p_.overEvery,ol.overSome=p_.overSome,ol.partial=r_.partial,ol.partialRight=r_.partialRight,ol.partition=t_.partition,ol.pick=c_.pick,ol.pickBy=c_.pickBy,ol.property=p_.property,ol.propertyOf=p_.propertyOf,ol.pull=e_.pull,ol.pullAll=e_.pullAll,ol.pullAllBy=e_.pullAllBy,ol.pullAllWith=e_.pullAllWith,ol.pullAt=e_.pullAt,ol.range=p_.range,ol.rangeRight=p_.rangeRight,ol.rearg=r_.rearg,ol.reject=t_.reject,ol.remove=e_.remove,ol.rest=r_.rest,ol.reverse=e_.reverse,ol.sampleSize=t_.sampleSize,ol.set=c_.set,ol.setWith=c_.setWith,ol.shuffle=t_.shuffle,ol.slice=e_.slice,ol.sortBy=t_.sortBy,ol.sortedUniq=e_.sortedUniq,ol.sortedUniqBy=e_.sortedUniqBy,ol.split=f_.split,ol.spread=r_.spread,ol.tail=e_.tail,ol.take=e_.take,ol.takeRight=e_.takeRight,ol.takeRightWhile=e_.takeRightWhile,ol.takeWhile=e_.takeWhile,ol.tap=l_.tap,ol.throttle=r_.throttle,ol.thru=bb,ol.toArray=o_.toArray,ol.toPairs=c_.toPairs,ol.toPairsIn=c_.toPairsIn,ol.toPath=p_.toPath,ol.toPlainObject=o_.toPlainObject,ol.transform=c_.transform,ol.unary=r_.unary,ol.union=e_.union,ol.unionBy=e_.unionBy,ol.unionWith=e_.unionWith,ol.uniq=e_.uniq,ol.uniqBy=e_.uniqBy,ol.uniqWith=e_.uniqWith,ol.unset=c_.unset,ol.unzip=e_.unzip,ol.unzipWith=e_.unzipWith,ol.update=c_.update,ol.updateWith=c_.updateWith,ol.values=c_.values,ol.valuesIn=c_.valuesIn,ol.without=e_.without,ol.words=f_.words,ol.wrap=r_.wrap,ol.xor=e_.xor,ol.xorBy=e_.xorBy,ol.xorWith=e_.xorWith,ol.zip=e_.zip,ol.zipObject=e_.zipObject,ol.zipObjectDeep=e_.zipObjectDeep,ol.zipWith=e_.zipWith,ol.entries=c_.toPairs,ol.entriesIn=c_.toPairsIn,ol.extend=c_.assignIn,ol.extendWith=c_.assignInWith,x_(ol,ol),ol.add=i_.add,ol.attempt=p_.attempt,ol.camelCase=f_.camelCase,ol.capitalize=f_.capitalize,ol.ceil=i_.ceil,ol.clamp=a_,ol.clone=o_.clone,ol.cloneDeep=o_.cloneDeep,ol.cloneDeepWith=o_.cloneDeepWith,ol.cloneWith=o_.cloneWith,ol.conformsTo=o_.conformsTo,ol.deburr=f_.deburr,ol.defaultTo=p_.defaultTo,ol.divide=i_.divide,ol.endsWith=f_.endsWith,ol.eq=o_.eq,ol.escape=f_.escape,ol.escapeRegExp=f_.escapeRegExp,ol.every=t_.every,ol.find=t_.find,ol.findIndex=e_.findIndex,ol.findKey=c_.findKey,ol.findLast=t_.findLast,ol.findLastIndex=e_.findLastIndex,ol.findLastKey=c_.findLastKey,ol.floor=i_.floor,ol.forEach=t_.forEach,ol.forEachRight=t_.forEachRight,ol.forIn=c_.forIn,ol.forInRight=c_.forInRight,ol.forOwn=c_.forOwn,ol.forOwnRight=c_.forOwnRight,ol.get=c_.get,ol.gt=o_.gt,ol.gte=o_.gte,ol.has=c_.has,ol.hasIn=c_.hasIn,ol.head=e_.head,ol.identity=_c,ol.includes=t_.includes,ol.indexOf=e_.indexOf,ol.inRange=u_,ol.invoke=c_.invoke,ol.isArguments=o_.isArguments,ol.isArray=oc,ol.isArrayBuffer=o_.isArrayBuffer,ol.isArrayLike=o_.isArrayLike,ol.isArrayLikeObject=o_.isArrayLikeObject,ol.isBoolean=o_.isBoolean,ol.isBuffer=o_.isBuffer,ol.isDate=o_.isDate,ol.isElement=o_.isElement,ol.isEmpty=o_.isEmpty,ol.isEqual=o_.isEqual,ol.isEqualWith=o_.isEqualWith,ol.isError=o_.isError,ol.isFinite=o_.isFinite,ol.isFunction=o_.isFunction,ol.isInteger=o_.isInteger,ol.isLength=o_.isLength,ol.isMap=o_.isMap,ol.isMatch=o_.isMatch,ol.isMatchWith=o_.isMatchWith,ol.isNaN=o_.isNaN,ol.isNative=o_.isNative,ol.isNil=o_.isNil,ol.isNull=o_.isNull,ol.isNumber=o_.isNumber,ol.isObject=lc,ol.isObjectLike=o_.isObjectLike,ol.isPlainObject=o_.isPlainObject,ol.isRegExp=o_.isRegExp,ol.isSafeInteger=o_.isSafeInteger,ol.isSet=o_.isSet,ol.isString=o_.isString,ol.isSymbol=o_.isSymbol,ol.isTypedArray=o_.isTypedArray,ol.isUndefined=o_.isUndefined,ol.isWeakMap=o_.isWeakMap,ol.isWeakSet=o_.isWeakSet,ol.join=e_.join,ol.kebabCase=f_.kebabCase,ol.last=Mv,ol.lastIndexOf=e_.lastIndexOf,ol.lowerCase=f_.lowerCase,ol.lowerFirst=f_.lowerFirst,ol.lt=o_.lt,ol.lte=o_.lte,ol.max=i_.max,ol.maxBy=i_.maxBy,ol.mean=i_.mean,ol.meanBy=i_.meanBy,ol.min=i_.min,ol.minBy=i_.minBy,ol.stubArray=p_.stubArray,ol.stubFalse=p_.stubFalse,ol.stubObject=p_.stubObject,ol.stubString=p_.stubString,ol.stubTrue=p_.stubTrue,ol.multiply=i_.multiply,ol.nth=e_.nth,ol.noop=p_.noop,ol.now=n_,ol.pad=f_.pad,ol.padEnd=f_.padEnd,ol.padStart=f_.padStart,ol.parseInt=f_.parseInt,ol.random=s_,ol.reduce=t_.reduce,ol.reduceRight=t_.reduceRight,ol.repeat=f_.repeat,ol.replace=f_.replace,ol.result=c_.result,ol.round=i_.round,ol.sample=t_.sample,ol.size=t_.size,ol.snakeCase=f_.snakeCase,ol.some=t_.some,ol.sortedIndex=e_.sortedIndex,ol.sortedIndexBy=e_.sortedIndexBy,ol.sortedIndexOf=e_.sortedIndexOf,ol.sortedLastIndex=e_.sortedLastIndex,ol.sortedLastIndexBy=e_.sortedLastIndexBy,ol.sortedLastIndexOf=e_.sortedLastIndexOf,ol.startCase=f_.startCase,ol.startsWith=f_.startsWith,ol.subtract=i_.subtract,ol.sum=i_.sum,ol.sumBy=i_.sumBy,ol.template=f_.template,ol.times=p_.times,ol.toFinite=o_.toFinite,ol.toInteger=bc,ol.toLength=o_.toLength,ol.toLower=f_.toLower,ol.toNumber=o_.toNumber,ol.toSafeInteger=o_.toSafeInteger,ol.toString=o_.toString,ol.toUpper=f_.toUpper,ol.trim=f_.trim,ol.trimEnd=f_.trimEnd,ol.trimStart=f_.trimStart,ol.truncate=f_.truncate,ol.unescape=f_.unescape,ol.uniqueId=p_.uniqueId,ol.upperCase=f_.upperCase,ol.upperFirst=f_.upperFirst,ol.each=t_.forEach,ol.eachRight=t_.forEachRight,ol.first=e_.head,x_(ol,(y_={},Qh(ol,(function(e,t){b_.call(ol.prototype,t)||(y_[t]=e)})),y_),{chain:!1}),ol.VERSION="4.17.20",(ol.templateSettings=f_.templateSettings).imports._=ol,vl(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){ol[e].placeholder=ol})),vl(["drop","take"],(function(e,t){Kc.prototype[e]=function(n){n=void 0===n?1:w_(bc(n),0);var r=this.__filtered__&&!t?new Kc(this):this.clone();return r.__filtered__?r.__takeCount__=O_(n,r.__takeCount__):r.__views__.push({size:O_(n,m_),type:e+(r.__dir__<0?"Right":"")}),r},Kc.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),vl(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Kc.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Kh(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),vl(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Kc.prototype[e]=function(){return this[n](1).value()[0]}})),vl(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Kc.prototype[e]=function(){return this.__filtered__?new Kc(this):this[n](1)}})),Kc.prototype.compact=function(){return this.filter(_c)},Kc.prototype.find=function(e){return this.filter(e).head()},Kc.prototype.findLast=function(e){return this.reverse().find(e)},Kc.prototype.invokeMap=Hl((function(e,t){return"function"==typeof e?new Kc(this):this.map((function(n){return Yy(n,e,t)}))})),Kc.prototype.reject=function(e){return this.filter(Sm(Kh(e)))},Kc.prototype.slice=function(e,t){e=bc(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Kc(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=bc(t))<0?n.dropRight(-t):n.take(t-e)),n)},Kc.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Kc.prototype.toArray=function(){return this.take(m_)},Qh(Kc.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=ol[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(ol.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Kc,s=a[0],c=u||oc(t),l=function(e){var t=o.apply(ol,tp([e],a));return r&&f?t[0]:t};c&&n&&"function"==typeof s&&1!=s.length&&(u=c=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&c){t=h?t:new Kc(this);var v=e.apply(t,a);return v.__actions__.push({func:bb,args:[l],thisArg:void 0}),new el(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),vl(["pop","push","shift","sort","splice","unshift"],(function(e){var t=g_[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);ol.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(oc(o)?o:[],e)}return this[n]((function(n){return t.apply(oc(n)?n:[],e)}))}})),Qh(Kc.prototype,(function(e,t){var n=ol[t];if(n){var r=n.name+"";b_.call(Zc,r)||(Zc[r]=[]),Zc[r].push({name:t,func:n})}})),Zc[Pl(void 0,2).name]=[{name:"wrapper",func:void 0}],Kc.prototype.clone=function(){var e=new Kc(this.__wrapped__);return e.__actions__=tl(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=tl(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=tl(this.__views__),e},Kc.prototype.reverse=function(){if(this.__filtered__){var e=new Kc(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Kc.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=oc(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r1&&void 0!==arguments[1]&&arguments[1],r=n.props.forceDragging;if(n.active||r||!0===t){var o,i;e.preventDefault(),"touchmove"===e.type?(o=e.touches[0].clientX-n.initialX,i=e.touches[0].clientY-n.initialY):(o=e.clientX-n.initialX,i=e.clientY-n.initialY);var a=!1,u=5,s=50,c=n.getContainerDimensions(),l=c.containerWidth,f=c.containerHeight,p=n.getAxis(),d=p.xAxis,h=p.yAxis;o>l?(d&&o+u>l&&(a=!0),o=l):o<0&&(d&&o<-u&&(a=!0),o=0),i>f?(h&&i+s>f&&(a=!0),i=f):i<0&&(h&&i<-s&&(a=!0),i=0),!0===a&&n.handleDragEnd(),n.updateState({xRatio:o/l,yRatio:i/f})}})),s(h(n),"handleDragEnd",(function(e){n.active=!1;var t=n.props.onDragEnd;t&&t(),(new Date).getTime()-n.lastMouseDown<300&&n.handleDrag(e,!0)})),s(h(n),"_handleWindowResize",(function(){var e=n.state.render_key;n.updateState({render_key:e})})),s(h(n),"getContainerDimensions",(function(){var e=0,t=0;if(n.container){var r=["paddingLeft","paddingRight","paddingTop","paddingBottom"].map((function(e){return Math.round(getComputedStyle(n.container)[e].replace("px","")||0)}));e=n.container.clientWidth-(r[0]+r[1])-n.draggableRef.current.clientWidth,t=n.container.clientHeight-(r[2]+r[3])-n.draggableRef.current.clientHeight}return{containerWidth:e,containerHeight:t}})),s(h(n),"getCurrentPositionWithPercent",(function(){var e=n.getCurrentPosition(),t=e.xRatio,r=e.yRatio,o=n.getContainerDimensions();return{currentX:t*o.containerWidth,currentY:r*o.containerHeight}})),s(h(n),"getAxis",(function(){var e=n.props.axis;return{xAxis:"y"!==e,yAxis:"x"!==e}})),s(h(n),"getCurrentPosition",(function(){var e=n.props.position;if(e){var t=e.xRatio,r=e.yRatio;return l({xRatio:t,yRatio:r},n.calculateCurrentPositionFromRatios(t,r))}return n.state})),s(h(n),"calculateCurrentPositionFromRatios",(function(e,t){var r=n.getContainerDimensions();return{currentX:e*r.containerWidth,currentY:t*r.containerHeight}})),s(h(n),"updateState",(function(e){n.lastMove=(new Date).getTime();var t=n.props,r=t.position,o=t.onDrag;r?o(l({},r,{},e)):n.setState(e)})),n.state={xRatio:0,yRatio:0,render_key:0},n.active=!1,n.initialX=0,n.initialY=0,n.ghostContainerDimensions=n.getContainerDimensions(),n.draggableRef=r.createRef(),n.handleWindowResize=gb(n._handleWindowResize,200),n}return f(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this.props.onMount;this.container=o.findDOMNode(this).parentNode,this.container.addEventListener("touchstart",this.handleDragStart,!1),this.container.addEventListener("touchend",this.handleDragEnd,!1),this.container.addEventListener("touchmove",this.handleDrag,!1),this.container.addEventListener("mousedown",this.handleDragStart,!1),this.container.addEventListener("mouseup",this.handleDragEnd,!1),this.container.addEventListener("mousemove",this.handleDrag,!1),window.addEventListener("resize",this.handleWindowResize,!1),e&&e(this)}},{key:"componentDidUpdate",value:function(){var e=this.ghostContainerDimensions,t=e.containerWidth,n=e.containerHeight;this.ghostContainerDimensions=this.getContainerDimensions(),t===this.ghostContainerDimensions.containerWidth&&n===this.ghostContainerDimensions.containerHeight||this._handleWindowResize()}},{key:"componentWillUnmount",value:function(){this.container.removeEventListener("touchstart",this.handleDragStart),this.container.removeEventListener("touchend",this.handleDragEnd),this.container.removeEventListener("touchmove",this.handleDrag),this.container.removeEventListener("mousedown",this.handleDragStart),this.container.removeEventListener("mouseup",this.handleDragEnd),this.container.removeEventListener("mousemove",this.handleDrag),window.removeEventListener("resize",this.handleWindowResize,!1)}},{key:"render",value:function(){var e=this.getCurrentPosition(),t=e.currentX,n=e.currentY,o=this.props.className,i=this.getAxis(),a=i.xAxis,u=i.yAxis;return r.createElement("div",{ref:this.draggableRef,style:{transform:"translate3d(".concat(a?t:0,"px, ").concat(u?n:0,"px, 0)")},className:"react-draggable ".concat(o||"")},this.props.children)}}]),t}(r.Component);E_.propTypes={className:n.string,axis:n.oneOf(["x","y"]),position:n.shape({xRatio:n.number,yRatio:n.number}),onDragStart:n.func,onDrag:n.func,onDragEnd:n.func,draggableWidth:n.number,draggableHeight:n.number};var S_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 448 512"},r.createElement("path",{fill:"currentColor",d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}))}}]),t}(r.Component),k_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 448 512"},r.createElement("path",{fill:"currentColor",d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}))}}]),t}(r.Component),j_=function(e){function t(){return i(this,t),v(this,p(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){return r.createElement("svg",{viewBox:"0 0 512 512"},r.createElement("path",{fill:"currentColor",d:"M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"}))}}]),t}(r.Component);function C_(){var e=y(["",""]);return C_=function(){return e},e}var M_=Ai.Range,P_=function(e){function t(e){var n;return i(this,t),s(h(n=v(this,p(t).call(this,e))),"componentWillUnmount",(function(){window.removeEventListener("keydown",n.handleKeyPress)})),s(h(n),"getAcceptedDuration",(function(){var e=n.props,t=e.minDuration,r=e.maxDuration,o=n.state.videoDuration,i=parseFloat(t)||0;i<0&&(i=0);var a=parseFloat(r)||o;return a>o&&(a=o),i>a?{min:a,max:i}:{min:i,max:a}})),s(h(n),"getFormatedValues",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"in";e||(e=n.props.inPoint),t||(t=n.props.outPoint);var o=n.getAcceptedDuration(),i=o.min,a=o.max,u=n.state.videoDuration,s=e||0,c=t||u,l=function(e){c-s>a?"in"===e?c=s+a:s=c-a:c-su&&(c=u,l("out")),{inValue:s,outValue:c}})),s(h(n),"toggleVideoAutoPlay",(function(e){var t=n.videoRef.current;t&&(t.paused?(n.playVideo(),n.monitorAutoplay(e)):n.pauseVideo())})),s(h(n),"monitorAutoplay",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=n.videoRef.current;if(t&&!t.paused){if(!0===e){var r=n.getFormatedValues(),o=r.inValue,i=r.outValue,a=t.currentTime;(ai)&&(t.currentTime=o)}n.updatePlayCursorPosition(null,!0),setTimeout((function(){return n.monitorAutoplay(e)}),100)}})),s(h(n),"playVideo",(function(){var e=n.videoRef.current;e&&e.play(),n.setState({isPlaying:!0})})),s(h(n),"pauseVideo",(function(){var e=n.videoRef.current;e&&e.pause(),n.setState({isPlaying:!1})})),s(h(n),"updatePlayerVolume",(function(){var e=n.props.muted,t=n.videoRef.current;t&&(t.volume=e?0:.5)})),s(h(n),"scrollToCursor",(function(){var e=n.state,t=e.playCursorPosition,r=(e.zoomFactor,e.forceCursorDragging),o=t.xRatio,i=t.yRatio,a=n.draggableApi.calculateCurrentPositionFromRatios(o,i).currentX,u=n.scrollable.current,s=u.scrollLeft,c=u.clientWidth;(r||as+c)&&(n.scrollable.current.scrollLeft=a)})),s(h(n),"updatePlayCursorPosition",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e){var r=n.videoRef.current,o=n.state.videoDuration;e=r&&o?r.currentTime/o:0}var i={xRatio:e,yRatio:0};n.setState({playCursorPosition:i},(function(){!0===t&&n.scrollToCursor()}))})),s(h(n),"handleVideoPlayerError",(function(e){var t=e.target.error;if(t&&4===t.code){var r=n.props.onNotSupportedVideoLoad;r&&r(t.message)}})),s(h(n),"handleDraggableApiMount",(function(e){return n.draggableApi=e})),s(h(n),"handleKeyPress",(function(e){32===e.keyCode&&(e.preventDefault(),n.toggleVideoAutoPlay())})),s(h(n),"handleLoadedData",(function(){var e=n.props.onVideoLoadedData,t=n.videoRef.current;if(t){var r=n.props.inPoint;void 0!==r&&n.seekVideoTo(r),n.updatePlayerVolume(),n.setState({videoDuration:t.duration},(function(){return n.updatePlayCursorPosition()})),e&&e(t)}})),s(h(n),"handleRangeChange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n.state.rangeDisabled;if(!r||t){var o=n.props,i=o.onRangeChange,a=o.outPoint,u=e[1]!==a?"out":"in",s=n.getFormatedValues(e[0],e[1],u),c=s.inValue,l=s.outValue;i([c,l])}})),s(h(n),"handleBeforeRangeChange",(function(e,t){n.pauseVideo(),n.setState({isEditing:!0})})),s(h(n),"handleAfterRangeChange",(function(){var e=n.state,t=e.playCursorPosition,r=e.videoDuration;n.seekVideoTo(t.xRatio*r),n.setState({isEditing:!1})})),s(h(n),"handleFreePlayClick",(function(){n.toggleVideoAutoPlay(!1)})),s(h(n),"handlePlayCursorDrag",(function(e){var t=e.xRatio,r=n.state.videoDuration;n.seekVideoTo(r*t),n.setState({playCursorPosition:e})})),s(h(n),"handleZoomFactorDragStart",(function(){return n.setState({forceCursorDragging:!0})})),s(h(n),"handleZoomFactorDragEnd",(function(){return n.setState({forceCursorDragging:!1})})),s(h(n),"handleZoomFactorChange",(function(e){n.state.zoomFactor;n.setState({zoomFactor:e},n.scrollToCursor)})),s(h(n),"handleContainerMouseDown",(function(e){e.stopPropagation();var t=e.target;t.classList.contains("rc-slider-handle")||t.classList.contains("dnm-video-cut-playing-cursor")?n.setState({rangeDisabled:!1,forceCursorDragging:!1}):n.setState({rangeDisabled:!0,forceCursorDragging:!0})})),s(h(n),"handleContainerMouseUp",(function(){return n.setState({rangeDisabled:!0,forceCursorDragging:!1})})),s(h(n),"handleMuteChange",(function(e){var t=n.props.onMuteChange;t&&t(!e.target.checked)})),n.state={videoDuration:0,isEditing:!1,isPlaying:!1,rangeDisabled:!0,forceCursorDragging:!1,forceScrollToCursor:!1,zoomFactor:[0],playCursorPosition:{xRatio:0,yRatio:0}},n.videoRef=r.createRef(),n.scrollable=r.createRef(),n.draggable=r.createRef(),n.draggableApi=null,n.seekVideoTo=gb(n._seekVideoTo,50),n}return f(t,e),u(t,[{key:"componentDidMount",value:function(){window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentDidUpdate",value:function(e,t){var n=this.state,r=n.videoDuration,o=n.isEditing,i=this.props,a=i.inPoint,u=i.outPoint,s=i.src,c=i.muted;if(isNaN(r)||r===t.videoDuration||this.handleRangeChange([a,u],!0),s!==e.src&&this.pauseVideo(),o&&(e.inPoint!==a||e.outPoint!==u)){var l;if(e.inPoint!==a&&e.outPoint!==u){var f=this.getAcceptedDuration(),p=f.min,d=f.max;l=Math.abs(u-a-p)a?a:u}else l=e.outPoint!==u?u:a;this.seekVideoTo(l)}c!==e.muted&&this.updatePlayerVolume()}},{key:"_seekVideoTo",value:function(e){if(!isNaN(e)){var t=this.videoRef.current;t&&(t.currentTime=e)}}},{key:"render",value:function(){var e=this.getFormatedValues(),t=e.inValue,n=e.outValue,r=this.state,o=r.videoDuration,i=r.isEditing,a=r.playCursorPosition,u=r.isPlaying,s=r.forceCursorDragging,c=r.zoomFactor,l=this.props,f=l.src,p=l.catalogue,d=l.classes,h=l.playerCursorWidth,v=l.muted,y=l.onMuteChange;return Ct("div",{css:At(C_(),Us)},Ct("div",{className:"dnm-video-cut-root ".concat(d.root||""," ").concat(i?"is-editing":""," ").concat(u?"is-playing":"is-paused")},Ct("video",{className:"dnm-video-cut-player ".concat(d.player||""),src:"".concat(f),ref:this.videoRef,loop:!0,muted:v,controls:!1,onLoadedData:this.handleLoadedData,onLoad:this.handleVideoLoad,onError:this.handleVideoPlayerError}),Ct("div",null,Ct("div",{className:"dnm-video-cut-play-icon",onClick:this.handleFreePlayClick},Ct(u?k_:S_,null)),Ct("div",{className:"dnm-video-cut-progress-scrollable-parent",ref:this.scrollable},Ct("div",{className:"dnm-video-cut-progress-container",style:{width:"calc(".concat(c[0]+100,"% - 20px)")},onTouchStart:this.handleContainerMouseDown,onTouchEnd:this.handleContainerMouseUp,onMouseDown:this.handleContainerMouseDown,onMouseUp:this.handleContainerMouseUp},Ct(E_,{className:"dnm-video-cut-playing-cursor-draggable-item",axis:"x",forceDragging:s,onMount:this.handleDraggableApiMount,onDrag:this.handlePlayCursorDrag,onDragStart:this.pauseVideo,position:a,draggableWidth:h,rerenderKey:c[0]},Ct("div",{className:"dnm-video-cut-playing-cursor",ref:this.draggable})),Ct(M_,{className:"dnm-video-cut-range ".concat(d.range||""),min:0,max:o||0,step:.05,value:[t,n],onChange:this.handleRangeChange,onBeforeChange:this.handleBeforeRangeChange,onAfterChange:this.handleAfterRangeChange}))),Ct("div",{className:"dnm-video-cut-tools"},Ct("div",{className:"dnm-video-cut-mute"},y&&Ct("label",{className:"dnm-video-cut-checkbox-container"},p.unmute,Ct("input",{type:"checkbox",checked:!v,onChange:this.handleMuteChange}),Ct("span",{className:"dnm-video-cut-checkmark"}))),Ct("div",{className:"dnm-video-cut-zoom"},Ct(M_,{className:"dnm-video-cut-zoom-range ".concat(d.zoomRange||""),min:0,max:900,step:.05,value:c,onBeforeChange:this.handleZoomFactorDragStart,onAfterChange:this.handleZoomFactorDragEnd,onChange:this.handleZoomFactorChange}),Ct("div",{className:"dnm-video-cut-zoom-icon"},Ct(j_,null))),Ct("div",{className:"clearfix"})))))}}]),t}(r.Component);return P_.propTypes={catalogue:n.object,classes:n.shape({root:n.string,player:n.string,range:n.string}),onRangeChange:n.func.isRequired,onNotSupportedVideoLoad:n.func,onVideoLoadedData:n.func,src:n.string.isRequired,inPoint:n.number,outPoint:n.number,draggableWidth:n.number,maxDuration:n.number,minDuration:n.number,muted:n.bool,onMuteChange:n.func,playerCursorWidth:n.oneOfType([n.func,n.number])},P_.defaultProps={catalogue:{unmute:"Enable sound"},classes:{},onRangeChange:function(e){return null},onNotSupportedVideoLoad:function(e){return null},onVideoLoadedData:function(e){return null},inPoint:0,outPoint:0,draggableWidth:null,maxDuration:0,minDuration:0,muted:!1,playerCursorWidth:14},P_})); diff --git a/package.json b/package.json index 659e602..c0cbde4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dnm-react-video-cut", - "version": "1.2.3", + "version": "1.2.4", "description": "", "main": "dist/dnm-react-video-cut.umd.min.js", "module": "dist/dnm-react-video-cut.es.min.js", diff --git a/src/core.js b/src/core.js index 15e1d87..a5a90d5 100644 --- a/src/core.js +++ b/src/core.js @@ -382,7 +382,7 @@ DnmVideoCut.propTypes = { onMuteChange: PropTypes.func, playerCursorWidth: PropTypes.oneOfType([ PropTypes.func, - PropTypes.int, + PropTypes.number, ]), };