1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9405],{69405:function(e,t,n){n.r(t),n.d(t,{default:function(){return vn}});var i=n(11527),r=n(75229),o=n.n(r),s=n(36838),a=n.n(s),c=n(51760),l=n.n(c),u=n(5411),d=n.n(u),m=n(59933),p=n.n(m),h=n(48663),f=n(53346),g=n(18521),v=n(94410),b=n(6379),T=n(73023),x=n(10629),y=n(66424),w=n(66091),S=n(57988),P=n(92042),Z=n.n(P),j=function(){function e(){(0,w.Z)(this,e),o()(this,"animate")}return(0,S.Z)(e,[{key:"animate",value:function(e){if(!Z()(e))throw new TypeError("AnimationFrameHander animate() - first argument is not a function");this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=window.requestAnimationFrame(e)}}]),e}(),C=n(83379),k=n(14107),D=n(25163),A=n(68909),_=n(2272),I=n(86132),E=n(89300),L=n.n(E),O=n(40749),z=n.n(O),M=n(63442),F=n.n(M),U=function(e){var t=e.startLabel,n=e.endLabel;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"grTimelineOuter js-timeline-outer",children:[(0,i.jsx)("div",{className:"grTimeline js-timeline-wrapper",children:(0,i.jsx)("div",{className:"timeline-elastic js-timeline-elastic",style:{width:"100%",position:"relative"},children:(0,i.jsx)("div",{className:"timeline-wrapper js-timeline-container"})})}),(0,i.jsx)("div",{className:"grTimeGrid js-timegrid"})]}),(0,i.jsxs)("div",{className:"grTimescale",children:[(0,i.jsx)("a",{href:"#/date-select/time",className:"grTimescale__label grTimescale__label--start js-label-start",children:t}),(0,i.jsxs)("div",{className:"grTimescale__container js-timescale-wrapper",children:[(0,i.jsx)("div",{className:"grTimescale__clip js-timeline-clip"}),(0,i.jsx)("div",{className:"grTimescale__slider",children:(0,i.jsx)("div",{className:"js-timescale"})}),(0,i.jsx)("div",{className:"grTimescale__lollipop js-timeline-lollipop","data-type":"timescale"})]}),(0,i.jsx)("a",{href:"#/date-select/time",className:"grTimescale__label grTimescale__label--end js-label-end",children:n}),(0,i.jsx)("i",{className:"js-zoom-out gb-icon-minus grTimescale__zoom-out grTimescale__icon"}),(0,i.jsx)("i",{className:"js-zoom-in gb-icon-plus grTimescale__zoom-in grTimescale__icon"}),(0,i.jsx)("i",{className:"js-zoom-to-selection gb-icon-zoomtoselection grTimescale__icon"})]})]})},N=I.Z.View.extend({tagName:"section",className:"grTimeControl grTimeControl__udvr",template:(0,C.L)(U),lollipopTemplate:function(){return'<div class="grLollipop js-timeline-lollipop" data-type="timeline"></div>'},events:{"mousedown .js-timescale":"onTimescaleMouseDown","mousedown .js-timeline-lollipop":"onLollipopMouseDown","mousewheel .js-timeline-wrapper":"onTimelineScroll","DOMMouseScroll .js-timeline-wrapper":"onTimelineScroll","click .js-zoom-in":"zoomInCenter","click .js-zoom-out":"zoomOut","click .js-zoom-to-selection":"zoomToSelection"},initialize:function(){var e=this;o()(this,"onTimescaleChange","onTimescaleStart","onTimescaleFinish","onTimescaleSlide","onTimescaleMouseUp"),o()(this,"onLollipopDrag","onLollipopMouseUp","onFirstSectionBoundariesChange","onTimelineScroll","refreshTimescale"),this.listenTo(this.model,"change:currentTime",this.onCurrentTimeUpdate),this.listenTo(this.model,"change:start change:end",this.onBoundariesChange),this.listenToOnce(this.model,"change:sectionEnd change:sectionStart",this.onFirstSectionBoundariesChange),this.timescaleWidth=1,this.timelineWrapperWidth=1;var t=function(t){return function(n){var i=(0,_.Z)(n,1)[0].contentRect.width,r=e.getLollipopPercentage();t(i),e.updateLollipop(r)}};this.timelineObserver=new T.Z(t((function(t){return e.timelineWrapperWidth=t})).bind(this)),this.timescaleObserver=new T.Z(t((function(t){return e.timescaleWidth=t})).bind(this))},render:function(){return this.destroyTimescale(),this.$el.html(this.template(this.model.getTimelineLabels())),this.timescale=this.el.querySelector(".js-timescale"),this.timelineWrapper=this.el.querySelector(".js-timeline-elastic"),F().create(this.timescale,{start:this.model.getTimescaleInitialSection(),range:{min:[this.model.get("start")],max:[this.model.get("end")]},connect:!0,step:1,animate:!1,behaviour:"drag"}),this.timescale.noUiSlider.on("start",this.onTimescaleStart),this.timescale.noUiSlider.on("end",this.onTimescaleFinish),this.timescale.noUiSlider.on("slide",this.onTimescaleChange),this.timescale.noUiSlider.on("slide",this.onTimescaleSlide),this.$wrapper=this.$(".js-timeline-wrapper"),this.$timelineWrapper=this.$(".js-timeline-elastic"),this.$timescaleWrapper=this.$(".js-timescale-wrapper"),this.$labelStart=this.$(".js-label-start"),this.$labelEnd=this.$(".js-label-end"),this.$timelineWrapper.append(this.lollipopTemplate()),this.timescaleSliderActive=!1,this.timescaleSliderSlide=!1,this.lollipops=this.el.querySelectorAll(".js-timeline-lollipop"),this.initObservers(),this},onTimescaleChange:function(){var e=(0,D.KX)(this.timescale.noUiSlider),t=this.model.get("end")-this.model.get("start"),n=1/((e[1]-e[0])/t),i=(e[0]-this.model.get("start"))/t*n*-1;this.$timelineWrapper[0].style.width="".concat(100*n,"%"),this.$timelineWrapper[0].style.left="".concat(100*i,"%"),this.model.set({sectionStart:e[0],sectionEnd:e[1]}),this.onCurrentTimeUpdate(this.model,this.model.get("currentTime")),App.Events.trigger("timeline:zoom")},onCurrentTimeUpdate:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!this.lollipopActive){var n=this.model.get("end")-this.model.get("start"),i=t/n;i=(i=i<0?0:i)>1?1:i,this.updateLollipop(i)}},onTimescaleMouseDown:function(){App.Utils.$window.on("mouseup",this.onTimescaleMouseUp)},onTimescaleStart:function(){this.timescaleSliderActive=!0,this.timescaleSliderSlide=!1},onTimescaleFinish:function(){this.timescaleSliderActive=!1},onTimelineStart:function(){this.trigger("drag:start")},onTimelineFinish:function(){N.__super__.onTimelineFinish.apply(this,arguments),this.timelineSliderActive=!1;var e=this,t=arguments;d()((function(){e.timelineSliderSlide=!1,e.onTimelineSlide.apply(e,t)})),this.trigger("drag:stop")},onTimescaleSlide:function(){App.Events.trigger("timeline:zoom"),this.timescaleSliderSlide=!0,this.timescaleSliderActive||(this.timescaleSliderActive=!0)},onTimescaleMouseUp:function(){var e=this;d()((function(){e.timescaleSliderActive=!1,e.timescaleSliderSlide=!1})),App.Utils.$window.off("mouseup",this.onTimescaleMouseUp)},onBoundariesChange:function(e){var t={range:{min:[L()(e.get("start"))?0:e.get("start")],max:[L()(e.get("end"))?0:e.get("end")]}};if(!this.timescaleSliderActive){var n=this.model.previous("end"),i=(0,D.KX)(this.timescale.noUiSlider)[1];this.timescale.noUiSlider.updateOptions(t),i===n&&this.timescale.noUiSlider.set([null,e.get("end")])}return this.updateTimelineLabels(),this.onTimescaleChange(),t},onFirstSectionBoundariesChange:function(e){if(!L()(e.get("sectionStart"))&&!L()(e.get("sectionEnd"))){var t={range:{min:[L()(e.get("start"))?0:e.get("start")],max:[L()(e.get("end"))?0:e.get("end")]}};return t.start=[e.get("sectionStart"),e.get("sectionEnd")],this.timescale.noUiSlider.updateOptions(t),this.onTimescaleChange(),t}},zoomToSelection:function(e){e=p()(e)&&e>0?e:0;var t=this.model.get("inPoint")-e;t=t>this.model.get("start")?t:this.model.get("start");var n=this.model.get("outPoint")+e;n=n<this.model.get("end")?n:this.model.get("end"),this.refreshTimescale(t,n)},zoomOut:function(){this.zoom(2)},zoomIn:function(){this.zoom(.5)},zoomInCenter:function(){this.zoom(.5,!0)},zoom:function(e,t){if(!this.timescale.hasAttribute("disabled")){var n=this.model.get("sectionStart"),i=this.model.get("sectionEnd"),r=z()(n),o=z()(i),s=this.model.get("start"),a=this.model.get("end");if(!r&&o)n=i;else if(r&&!o)i=n;else if(!r&&!o)throw new Error("inPoint and outPoint non finite value");var c=this.getNewSectionLength(e,t),l=(0,D.tw)(c,n,i,s,a);this.refreshTimescale(l.start,l.end),App.Events.trigger("timeline:zoom")}},getNewSectionLength:function(e){var t=this.model.get("sectionStart"),n=(this.model.get("sectionEnd")-t)*e;return n<500?500:n},refreshTimescale:function(e,t){this.model.set({sectionStart:e,sectionEnd:t}),this.timescaleSliderActive||this.timescale.noUiSlider.set([e,t]),this.onTimescaleChange()},updateTimelineLabels:function(){var e=this.model.getTimelineLabels();this.$labelStart.text(e.startLabel),this.$labelEnd.text(e.endLabel)},onTimelineScroll:function(e){var t=e.originalEvent;if(t.wheelDeltaX||"axis"in t&&"HORIZONTAL_AXIS"in t&&t.axis===t.HORIZONTAL_AXIS){e.preventDefault();var n=t.detail||-t.wheelDeltaX/40;n*=19;var i=this.$wrapper.width(),r=1-(i-Math.abs(n))/i,o=this.model.getSectionDuration(),s=o*r,a=0,c=0;if(n<0){var l=this.model.get("sectionStart");c=(a=l-s>=0?l-s:0)+o}else{var u=this.model.get("sectionEnd");a=(c=u+s<=this.model.get("end")?u+s:this.model.get("end"))-o}this.timescale.noUiSlider.set([a,c]),this.onTimescaleChange()}},onLollipopMouseDown:function(e){App.Utils.$window.on("mousemove",this.onLollipop
1Drag),App.Utils.$window.on("mouseup",this.onLollipopMouseUp),this.lollipopActive=e.currentTarget.getAttribute("data-type")},onLollipopMouseUp:function(){App.Utils.$window.off("mousemove",this.onLollipopDrag),App.Utils.$window.off("mouseup",this.onLollipopMouseUp),this.lollipopActive=!1;var e=this.getLollipopTime();this.model.set({currentTime:e,currentTimeLocked:!0}),this.model.trigger("update:currentTime",e)},onLollipopDrag:function(e){var t=0;"timeline"===this.lollipopActive?t=(x.Z.getTimeHovered.call(this,e.pageX)-this.model.get("start"))/this.model.getTimelineDuration():"timescale"===this.lollipopActive&&(t=x.Z.getPercentageHovered(e.pageX,this.$timescaleWrapper));t=(t=t<0?0:t)>1?1:t,this.updateLollipop(t)},getLollipopPercentage:function(){var e=/\((.*?)px/.exec(this.lollipops[0].style.transform);return null!==e?e[1]/this.timelineWrapperWidth:0},getSelectionDuration:function(){return this.model.get("outPoint")-this.model.get("inPoint")||0},getLollipopTime:function(){return this.model.getTimelineDuration()*this.getLollipopPercentage()},getLollipopTimestamp:function(){return this.getLollipopTime()+this.model.get("start")},destroyTimescale:function(){this.timescale&&this.timescale.noUiSlider&&(this.timescale.noUiSlider.off(),this.timescale.noUiSlider.destroy())},destroy:function(){this.destroyTimescale(),N.__super__.destroy.apply(this,arguments)},initObservers:function(){this.timelineObserver.observe(this.timelineWrapper),this.timescaleObserver.observe(this.timescale)},updateLollipop:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=this.lollipops[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var s=r.value,a=("timeline"===s.dataset.type?this.timelineWrapperWidth:this.timescaleWidth)*e;s.style.transform="translateX(".concat(a,"px)")}}catch(c){n=!0,i=c}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}}),W=N,G=n(43119),R=n(72635),B=n(50959),$=n(22778),H=n(12956);function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);s=!0);}catch(c){a=!0,r=c}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function X(){var e=(0,G.Z)(["\n position: fixed;\n pointer-events: none;\n z-index: 100000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n"]);return X=function(){return e},e}function V(e){var t,n,i,r,o=e.item.previewDimensions,s=e.clientOffset,a=e.currentOffset,c=e.itemType;return s&&a?(o&&(i=o.width,r=o.height),c===R.C6&&(t=a.x,n=a.y),c===R.Yr&&(t=s.x-i/2,n=s.y-r/2),{transform:"translate3D(".concat(t,"px, ").concat(n,"px,0)"),width:i,height:r}):{display:"none"}}var K=b.ZP.div.withConfig({componentId:"sc-a1c84766-0"})(X()),Q=function(){var e,t=function(e){var t=(0,$.N)().getMonitor(),n=q((0,H.r)(t,e),2),i=n[0],r=n[1];return(0,B.useEffect)((function(){return t.subscribeToOffsetChange(r)})),(0,B.useEffect)((function(){return t.subscribeToStateChange(r)})),i}((function(e){return{item:e.getItem(),itemType:e.getItemType(),clientOffset:e.getClientOffset(),currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging()}})),n=t.isDragging,r=t.itemType,o=t.item;return n&&((e=r)===R.C6||e===R.Yr)&&(0,i.jsx)(K,{"data-testid":"drag-preview",children:(0,i.jsx)("div",{style:V(t),children:null===o||void 0===o?void 0:o.previewElement})})},J=n(70902),ee=n(57389),te=n(5683),ne=n(72006),ie=n(4405),re=n(45347),oe=n(849),se=n(74428),ae=n(19036),ce=n.n(ae);function le(){var e=(0,G.Z)(["\n\tdisplay: flex;\n\talign-items: center;\n\tposition: relative;\n\ttransition: border-color .1s linear;\n\tbox-sizing: border-box;\n\tborder-radius: 3px;\n\theight: ","px;\n\tmargin-bottom: ","px;\n\tbackground-color: ",";\n"]);return le=function(){return e},e}function ue(){var e=(0,G.Z)(["\n font-family: Open Sans;\n font-style: normal;\n font-weight: 300;\n font-size: 16px;\n padding-left: 15px;\n color: ",";\n"]);return ue=function(){return e},e}var de={drop:R.qj,hover:R.GW,canDrop:R.GF},me=function(e,t,n,i){return e&&t?n:e&&!t?i:"transparent"},pe=(0,oe._g)(b.ZP.div,(function(e){var t=e.theme,n=e.isOver,i=e.canDrop;return{border:"1px solid ".concat(me(n,i,t.colors.secondaryLighter,t.colors.primary))}}
1))(le(),(function(e){var t=e.layer;return(0,R.zF)(t)}),(function(e){return e.theme.layerMargin}),(function(e){return e.theme.colors.secondaryDark})),he=b.ZP.div.withConfig({componentId:"sc-df34912f-0"})(ue(),(function(e){return e.theme.colors.text1})),fe=function(e){(0,te.Z)(n,e);var t=(0,re.Z)(n);function n(){var e;return(0,w.Z)(this,n),e=t.apply(this,arguments),(0,ee.Z)((0,J.Z)(e),"getLayerLabel",(function(){var t=e.props.layer;return t.isBaseLayer?"Base layer":t.type===se.ZP.MEDIA_TYPE.CAPTION?"Captions":t.type===se.ZP.MEDIA_TYPE.AUDIO?"Audio":void 0})),(0,ee.Z)((0,J.Z)(e),"onLayerClick",(function(){e.props.ui.clearActiveSection(),e.props.ui.clearActiveTransition()})),e}return(0,S.Z)(n,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.layer,n=e.isOver;n&&!t.isHovered&&t.setIsHovered(!0),!n&&t.isHovered&&t.setIsHovered(!1)}},{key:"render",value:function(){var e=this.props.connectDropTarget;return(0,i.jsxs)(pe,(0,ie.Z)((0,ne.Z)({"data-testid":"layer-".concat(this.props.id)},this.props),{onClick:this.onLayerClick,ref:e,children:[(0,i.jsx)(he,{type:this.props.layer.type,children:this.getLayerLabel()}),this.props.children]}))}}]),n}(B.Component);fe.propTypes={id:ce().string.isRequired,ui:ce().object.isRequired,layer:ce().object.isRequired,connectDropTarget:ce().func.isRequired,isOver:ce().bool.isRequired,canDrop:ce().bool};var ge=(0,R.TF)(R.ly,de,(function(e,t){return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop()}}))((0,h.Pi)(fe)),ve=(0,h.f3)((function(e,t){var n=e.composition,i=e.ui,r=t.id;return{ui:i,composition:n,layer:n.getLayer(r)}}))(ge),be=n(57135),Te=n(15767),xe=n(11896),ye=n(82400),we=n(56956),Se=n(18803),Pe=n(48435),Ze=n(30418),je=n(98400),Ce=n(23671);function ke(){var e=(0,G.Z)(["\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n top: 0;\n pointer-events: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"]);return ke=function(){return e},e}function De(){var e=(0,G.Z)(["\n background-color: ",";\n"]);return De=function(){return e},e}function Ae(){var e=(0,G.Z)(["\n display: flex;\n align-items: center;\n color: white;\n background-color: ",";\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n margin: 0 10px;\n"]);return Ae=function(){return e},e}function _e(){var e=(0,G.Z)(["\n color: ",";\n background-color: ",";\n display: flex;\n border-radius: 2px;\n margin-left: 2px;\n"]);return _e=function(){return e},e}function Ie(){var e=(0,G.Z)(["\n background-size: auto 100%;\n background-repeat: repeat-x;\n background-color: black;\n"]);return Ie=function(){return e},e}function Ee(){var e=(0,G.Z)(["\n display: flex;\n position: relative;\n left: 7px;\n top: 4px;\n"]);return Ee=function(){return e},e}function Le(){var e=(0,G.Z)(["\n background-color: ",";\n color: ",";\n padding: 1px 2.5px;\n border-radius: 3px;\n font-size: 10px;\n"]);return Le=function(){return e},e}function Oe(){var e=(0,G.Z)(["\n position: absolute;\n top: 4px;\n right: 5px;\n width: 16px;\n height: 16px;\n font-size: 16px;\n color: ",";\n background-color: ",";\n cursor: pointer;\n border-radius: 2px;\n line-height: 1;\n\n :hover {\n background-color: ",";\n color: ",";\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);\n }\n\n :active {\n background-color: ",";\n }\n"]);return Oe=function(){return e},e}function ze(){var e=(0,G.Z)(["\n display: flex;\n position: relative;\n background: ",";\n border-radius: 6px;\n margin-right: 2px;\n\n i {\n font-size: 18px;\n color: ",";\n }\n\n "," {\n border-top: 5px solid #596281;\n position: relative;\n right: 2px;\n left: 0;\n top: 5px;\n margin: 0 3px 0 3px;\n }\n"]);return ze=function(){return e},e}function Me(){var e=(0,G.Z)(["\n position: relative;\n height: 100%;\n width: 100%;\n border-radius: 5px;\n border: 2px solid ",";\n background: black;\n background-position: top left;\n background-size: contain;\n"]);return Me=function(){return e},e}function Fe(){var e=(0,G.Z)(["\n position: relative;\n width: 100%;\n height: 100%;\n"]);return Fe=function(){return e},e}function Ue(){var e=(0,G.Z)(["\n bottom: 4px;\n "]);return Ue=function(){return e},e}function Ne(){var e=(0,G.Z)(["\n top: 4px;\n "]);return Ne=function(){return e},e}function We(){var e=(0,G.Z)(['\n :after {\n content: "";\n width: 10px;\n height: 6px;\n bottom: 0;\n position: absolute;\n left: 0;\n background: ',";\n }\n "]);return We=function(){return e},e}function Ge(){var e=(0,G.Z)(["\n width: 2px;\n left: 0;\n height: calc(","px - 4px);\n background-color: ",";\n position: absolute;\n\n ","\n\n ","\n"]);return Ge=function(){return e},e}function Re(){var e=(0,G.Z)(["\n left: ",";\n "]);return Re=function(){return e},e}function Be(){var e=(0,G.Z)(["\n right: ",";\n "]);return Be=function(){return e},e}function $e(){var e=(0,G.Z)(["\n background-color: ",";\n "]);return $e=function(){return e},e}function He(){var e=(0,G.Z)(["\n background-color: #a39eff;\n "]);return He=function(){return e},e}function qe(){var e=(0,G.Z)(["\n background-color: ",";\n "]);return qe=function(){return e},e}function Ye(){var e=(0,G.Z)(["\n width: ",";\n max-height: 30px;\n position: absolute;\n cursor: ew-resize;\n opacity: ",";\n top: 3px;\n bottom: 3px;\n margin: auto;\n border-radius: ",";\n z-index: 10000010;\n :hover {\n opacity: 1;\n }\n\n ","\n\n ","\n"]);return Ye=function(){return e},e}function Xe(){var e=(0,G.Z)(["\n right: 3px;\n "]);return Xe=function(){return e},e}function Ve(){var e=(0,G.Z)(["\n left: 3px;\n "]);return Ve=function(){return e},e}function Ke(){var e=(0,G.Z)(["\n height: 80%;\n border-left: 1px solid;\n opacity: 0.3;\n top: 50%;\n transform: translateY(-50%);\n position: absolute;\n border-radius: ",";\n\n ","\n"]);return Ke=function(){return e},e}var Qe=b.ZP.div.withConfig({componentId:"sc-4de41f32-0"})(ke()),Je=(0,b.ZP)(Qe).withConfig({componentId:"sc-4de41f32-1"})(De(),(function(e){return e.theme.colors.secondaryLight})),et=((0,b.ZP)(Qe).withConfig({componentId:"sc-4de41f32-2"}
1)(Ae(),(function(e){return e.theme.templateSectionBackground})),b.ZP.div.withConfig({componentId:"sc-4de41f32-3"})(_e(),(function(e){return e.theme.colors.backgroundGrey}),(function(e){return e.theme.colors.backgroundLightBlack}))),tt=(0,b.ZP)(Qe).attrs((function(e){var t=e.url;return{style:{backgroundImage:"url(".concat(t,")")}}})).withConfig({componentId:"sc-4de41f32-4"})(Ie()),nt=b.ZP.div.withConfig({componentId:"sc-4de41f32-5"})(Ee()),it=b.ZP.span.withConfig({componentId:"sc-4de41f32-6"})(Le(),(function(e){return e.theme.colors.backgroundLightBlack}),(function(e){return e.theme.colors.backgroundGrey})),rt=b.ZP.span.withConfig({componentId:"sc-4de41f32-7"})(Oe(),(function(e){return e.theme.colors.backgroundGrey}),(function(e){return e.theme.colors.backgroundLightBlack}),(function(e){return e.theme.colors.backgroundGrey}),(function(e){return e.theme.colors.backgroundLightBlack}),(function(e){return e.theme.colors.outline})),ot=b.ZP.section.withConfig({componentId:"sc-4de41f32-8"})(ze(),(function(e){return e.theme.colors.backgroundLightBlack}),(function(e){return e.theme.colors.backgroundGrey}),Pe.$),st=b.ZP.div.attrs((function(e){return(0,ne.Z)({},!e.isCaption&&e.active&&{style:{borderColor:e.theme.sectionBorder}},e.isCaption&&{style:{backgroundColor:e.theme.captionSectionBackground,borderColor:e.theme.captionSectionBorder}})})).withConfig({componentId:"sc-4de41f32-9"})(Me(),(function(e){return e.theme.assetOutline})),at=b.ZP.div.withConfig({componentId:"sc-4de41f32-10"})(Fe()),ct=b.ZP.div.withConfig({componentId:"sc-4de41f32-11"})(Ge(),(function(e){var t=e.height;return Math.abs(t)}),(function(e){var t=e.section,n=e.theme;return t.asset.type===se.ZP.MEDIA_TYPE.CAPTION?n.captionSectionBorder:n.sectionBorder}),(function(e){return e.height<0?(0,b.iv)(Ue()):(0,b.iv)(Ne())}),(function(e){var t=e.section,n=e.theme;if(t.asset.type===se.ZP.MEDIA_TYPE.CAPTION)return(0,b.iv)(We(),n.captionSectionBorder)})),lt=b.ZP.div.withConfig({componentId:"sc-4de41f32-12"})(Ye(),(function(e){return"captions"===e.type||"audio"===e.type?"7px":"10px"}),(function(e){return e.isActive?"1":"0"}),(function(e){return e.theme.borderRadius}),(function(e){switch(e.side){case R.Wd:return(0,b.iv)(Re(),"captions"===e.type||"audio"===e.type?"-5px":"-6px");case R.DP:return(0,b.iv)(Be(),"captions"===e.type||"audio"===e.type?"-5px":"-6px")}}),(function(e){return e.isActive&&"captions"!==e.type?(0,b.iv)($e(),(function(e){return e.theme.colors.pending})):e.isActive&&"captions"===e.type?(0,b.iv)(He()):(0,b.iv)(qe(),(function(e){return e.theme.colors.editorSectionOutline}))})),ut=b.ZP.div.withConfig({componentId:"sc-4de41f32-13"})(Ke(),(function(e){return e.theme.defaultBorderRadius}),(function(e){return e.grabber===R.Wd?(0,b.iv)(Xe()):e.grabber===R.DP?(0,b.iv)(Ve()):void 0})),dt=n(445),mt=n.n(dt),pt=n(88417),ht=n(92428),ft=n(43492);var gt=function(e){(0,te.Z)(n,e);var t=(0,re.Z)(n);function n(e){var i;return(0,w.Z)(this,n),(i=t.call(this,e)).onDragging=i.onDragging.bind((0,J.Z)(i)),i}return(0,S.Z)(n,[{key:"componentDidMount",value:function(){var e=this.props.connectDragPreview;e&&e((0,ht.r)(),{captureDraggingState:!0})}},{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.isDragging,i=t.ui;n&&!this.requestAnimationFrameId?ft.r.startGroup((function(){e.requestAnimationFrameId=window.requestAnimationFrame(e.onDragging)})):!n&&this.requestAnimationFrameId&&(i.composition.updateConnectedSections(),window.cancelAnimationFrame(this.requestAnimationFrameId),ft.r.stopGroup(),delete this.requestAnimationFrameId,delete this.prevOffset)}},{key:"onDragging",value:function(){var e=this.props,t=e.monitor,n=e.ui,i=e.section,r=i.x,o=t.getClientOffset();if(mt()(o))console.log("Offset was null, RAF fired after section handle stopped dragging");else{this.prevOffset||(this.prevOffset=o.x);var s=o.x-this.prevOffset;this.prevOffset=o.x;var a=t.getItem().side;if(a===R.Wd){var c;if(i.isChildOfBaseLayer)c=n.timelinePxToTime(r+s);else if(c=n.getMousePositionAsTime(o.x),n.snappingEnabled){var l=n.snapOnTimelineByTime([c]);l&&i.isWithinInPointBoundaries(l.to)?(n.setSnapGuidePositionByTime(l.to),c=l.to):null!==n.snapGuidePosition&&n.setSnapGuidePosition(null)}(0,R.qI)(i,c)}if(a===R.DP){var u=n.getMousePositionAsTime(o.x);if(!i.isChildOfBaseLayer&&n.snappingEnabled){var d=n.snapOnTimelineByTime([u]);d&&i.isWithinOutPointBoundaries(d.to)?(n.setSnapGuidePositionByTime(d.to),u=d.to):null!==n.snapGuidePosition&&n.setSnapGuidePosition(null)}(0,R.zb)(i,u)}this.requestAnimationFrameId=window.requestAnimationFrame(this.onDragging)}}},{key:"render",value:function(){var e=this.props,t=e.connectDragSource,n=e.section,r=e.side;return t((0,i.jsx)("div",{children:(0,i.jsxs)(lt,{"data-testid":"section-handle-".concat(n.id,"-").concat(r),isActive:n.selected,type:n.type,side:r,children:[(0,i.jsx)(ut,{grabber:R.Wd}),(0,i.jsx)(ut,{grabber:R.DP})]})}))}}]),n}(B.Component),vt=(0,pt.E)(R.kb,{beginDrag:function(e){return e.ui.onSectionHandleDragStart(e.section.id),{id:e.section.id,side:e.side}},endDrag:function(e){return e.ui.onSectionHandleDragEnd()}},(function(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging(),monitor:t}}
1))((0,h.Pi)(gt)),bt=n(24669),Tt=n.n(bt),xt=n(18683),yt=function(e){var t=e.canvas,n=e.sprite,i=e.from,r=e.to,o=e.height,s=e.width,a=e.y,c=e.frameInterval,l=void 0===c?1:c,u=e.framesPerLine,d=void 0===u?10:u,m=e.frameWidth,h=void 0===m?160:m,f=e.frameHeight,g=void 0===f?90:f;if(!(0,xt.z0)(i)||i<0)throw new RangeError("[from ".concat(i,"] needs to be a positive finite number."));if(!(0,xt.z0)(r)||r<0)throw new RangeError("[to ".concat(r,"] needs to be a positive finite number."));if(r<=i)throw new RangeError("[from: ".concat(i,"] needs to be strictly greater than [to: ").concat(r,"]"));var v=t.getContext("2d"),b=r-i,T=o/g,x=h*T,y=Math.ceil(s/x),w=b/(y||1),S=x,P=0,Z=Math.ceil(b/l),j=l;w>l&&(P=(x-(S=s/(Z=y)))/2,j=w);var C=Array(Z).fill(0).map((function(e,t){return i+j*t})).map((function(e){return function(e){var t=e.frameTime,n=e.frameInterval,i=void 0===n?1:n,r=e.framesPerLine,o=void 0===r?10:r,s=e.frameWidth,a=void 0===s?160:s,c=e.frameHeight,l=void 0===c?90:c;if((0,xt.aP)("framesPerLine",o),(0,xt.aP)("frameWidth",a),(0,xt.aP)("frameHeight",l),!(0,xt.z0)(i)||i<0)throw new RangeError("[frameInterval ".concat(i,"] needs to be a positive finite number."));if(!(0,xt.z0)(t)||t<0)throw new RangeError("[frameTime ".concat(t,"] needs to be a positive finite number."));if(!p()(t)||!Number.isFinite(t)||t<0)throw new RangeError("[frameTime: ".concat(t,"] needs to be a positive finite number."));var u=i*Math.round(t/i)/i,d=Math.floor(u/o),m=u%o;return{line:d,column:m,x:m*a,y:d*l}}({frameTime:e,frameInterval:l,framesPerLine:d,frameWidth:h,frameHeight:g})}));
1return C.forEach((function(e,t){var i,r=e.x,c=e.y,u=r+P/T,d=1;if(w<l){var m=l/b*s;i=m*t,d=Math.ceil(m/S)}else i=S*t;for(var p=0;p<d;p++)v.drawImage(n,u,c,S/T,g,i+p*S,a,S,o)})),C},wt=n(37163),St=n(21265),Pt=function(e,t,n,i){return e/1e3+t/n*i},Zt=(0,h.Pi)((function(e){var t=e.section,n=t.asset&&t.asset.numberOfVideoStreams>0,r=t.asset&&t.asset.numberOfAudioStreams>0,o=t.asset&&t.asset.thumbnailURI,s=t.asset&&t.asset.spritemapMetadata,a=(0,_.Z)(B.useState(!1),2),c=a[0],l=a[1],u=(0,_.Z)(B.useState(!1),2),d=u[0],m=u[1],p=(0,_.Z)(B.useState(!1),2),h=p[0],g=p[1],v=B.useRef(),b=function(){return n&&c||r&&d},T=function(){return!!o},x=function(){if(t.visualizationCues){var e=v.current.height,n=v.current.width;v.current.canvases.forEach((function(i){!function(e){var t=e.canvas,n=e.width,i=e.height,r=e.inPoint,o=e.outPoint,s=e.cues,a=e.playbackStartTime,c=t.getContext("2d"),l=1e3*r-a,u=1e3*o-a,d=u-l;c.fillStyle="#596281",c.strokeStyle="#8983ff",c.fillRect(0,0,n,i),s.forEach((function(e){if(l<e.endTime&&u>e.startTime){var t=(0,xt.W$)(e.endTime,d,n),r=(0,xt.W$)(e.startTime,d,n),o=i/2;c.beginPath(),c.moveTo(r,o-2.5),c.lineTo(r,o+2.5),c.stroke(),c.moveTo(r,o),c.lineTo(t,o),c.stroke(),c.moveTo(t,o-2.5),c.lineTo(t,o+2.5),c.stroke(),c.closePath()}}))}({canvas:i.el,height:e,width:n,x:0,y:0,cues:t.visualizationCues,inPoint:i.inPoint,outPoint:i.outPoint,playbackStartTime:t.playbackStartTime})})),h||g(!0)}},w=function(){!function(){if(t.asset.waveformCache){var e=v.current.height,i=v.current.width;v.current.canvases.forEach((function(r){(0,wt.Gn)({height:n?.25*e:e,width:i,x:0,y:n?.75*e:0,waveform:t.asset.waveformCache,canvas:r.el,inPoint:r.inPoint,outPoint:r.outPoint})})),d||m(!0)}}(),function(){if(t.asset.spritemapCache){var e=v.current.height,n=v.current.width;v.current.canvases.forEach((function(i){yt((0,ne.Z)({height:r?.75*e:e,width:n,x:0,y:0,canvas:i.el,sprite:t.asset.spritemapCache,from:i.inPoint,to:i.outPoint},s&&{frameHeight:s.height,frameWidth:s.width,frameInterval:s.frameIntervalSeconds,framesPerLine:s.columns}))})),c||l(!0)}}()};return(0,y.TT)(v,(function(e){var n=e.width,i=e.height;v.current.width=n,v.current.height=i,function(){var e=Math.ceil(v.current.width/32e3);if(Tt()(v.current.canvases)||(v.current.canvases=[]),e>v.current.canvases.length)for(var n=e-v.current.canvases.length,i=0;i<n;i++){var r=document.createElement("canvas");r.setAttribute("style","position: absolute; top: 0; left: 0;"),v.current.canvases.push({el:v.current.appendChild(r)})}if(e<v.current.canvases.length)for(var o=v.current.canvases.length-e,s=0;s<o;s++)v.current.canvases.pop().el.remove();v.current.canvases.forEach((function(e,n){e.el.height=v.current.height,e.el.width=v.current.width/v.current.canvases.length,e.el.style.left="".concat(e.width*n,"px"),e.inPoint=Pt(t.playbackStartTime,t.durationSeconds,v.current.canvases.length,n),e.outPoint=Pt(t.playbackStartTime,t.durationSeconds,v.current.canvases.length,n+1)}))}(),w(),x()})),B.useEffect((function(){var e=(0,f.U5)((function(){return t.asset.spritemapCache}),w),n=(0,f.U5)((function(){return t.asset.waveformCache}),w),i=(0,f.U5)((function(){return t.visualizationCues}),x);return function(){e(),n(),i()}}),[]),(0,i.jsxs)(Qe,{children:[(t.asset.type===se.ZP.MEDIA_TYPE.IMAGE?!T():t.asset.type===se.ZP.MEDIA_TYPE.VOD?!T()&&!b():void 0)&&(0,i.jsx)(Je,{children:(0,i.jsx)(A.g,{color:St.editorSectionOutline})}),T()&&!b()&&(0,i.jsx)(tt,{url:o}),(0,i.jsx)(Qe,{ref:v})]})}));function jt(){var e=(0,G.Z)(["\n top: -2px;\n left: -2px;\n right: -2px;\n bottom: -2px;\n overflow: hidden;\n position: absolute;\n"]);return jt=function(){return e},e}function Ct(){var e=(0,G.Z)(["\n width: 17px;\n height: 17px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n border-radius: 3px;\n background: ","\n url(",") center;\n background-size: contain;\n"]);return Ct=function(){return e},e}function kt(){var e=(0,G.Z)(["\n height: 55%;\n top: 0;\n bottom: 0;\n margin: auto;\n background: ",";\n position: absolute;\n border-radius: 5px;\n overflow: hidden;\n z-index: 5;\n"]);return kt=function(){return e},e}function Dt(){var e=(0,G.Z)(["\n ","\n width: ","px;\n height: 100%;\n position: absolute;\n cursor: ew-resize;\n background-color: ",";\n opacity: 0;\n\n &:hover {\n opacity: 1;\n }\n"]);return Dt=function(){return e},e}var At=b.ZP.div.withConfig({componentId:"sc-f6581de6-0"})(jt()),_t=b.ZP.div.attrs((function(e){return(0,ne.Z)({},e.active&&{style:{backgroundColor:e.theme.transitionBgActive}})})).withConfig({componentId:"sc-f6581de6-1"})(Ct(),(function(e){return e.theme.transitionBg}),(function(e){return e.iconUrl})),It=b.ZP.div.attrs((function(e){return(0,ne.Z)({}
1,e.active&&{style:{background:e.theme.transitionBgTransparentActive}})})).withConfig({componentId:"sc-f6581de6-2"})(kt(),(function(e){return e.theme.transitionBgTransparent})),Et=b.ZP.div.attrs((function(e){return(0,ne.Z)({},e.active&&{style:{opacity:1,background:e.theme.transitionBgActive}})})).withConfig({componentId:"sc-f6581de6-3"})(Dt(),(function(e){return function(e){return e.side===R.zw?"left: 0;":e.side===R.zG?"right: 0;":void 0}(e)}),(function(e){return e.theme.assetHandleWidth}),(function(e){return e.theme.transitionBg})),Lt=(0,h.Pi)((function(e){var t=e.side,n=e.transition,r=e.active,o=(0,_.Z)((0,y.D_)({type:R.O_,end:function(){return ft.r.stopGroup()},item:{type:R.O_,transition:n,side:t}}),2)[1];return(0,i.jsx)(Et,{"data-testid":"transition-handle-".concat(n.id,"-").concat(t),side:t,active:r,ref:o})})),Ot=function(e){var t=e.transition,n=e.ui,r=e.section,o=(0,_.Z)(B.useState(!1),2),s=o[0],a=o[1],c=(0,_.Z)(B.useState({}),2),l=c[0],u=c[1],d=function(){a(!1)},m=(0,xt.W$)(t.startTime-r.startTime,r.duration),p=(0,xt.W$)(t.duration,r.duration),h={left:"".concat(m,"%"),width:"".concat(p,"%"),borderRadius:t.sectionFrom&&t.sectionTo?"5px":t.sectionFrom?"5px 0 0 5px":t.sectionTo?"0 5px 5px 0":void 0},f=n.activeTransitionId===t.id;return(0,i.jsxs)(It,{"data-testid":"timeline-transition",active:f,onClick:function(e){e.stopPropagation(),d(),n.onTransitionClick(t.id)},style:h,onContextMenu:function(e){e.preventDefault(),e.stopPropagation(),u({contextMenuX:e.pageX,contextMenuY:e.pageY}),a(!0)},children:[(0,i.jsx)(_t,{active:f,iconUrl:"/static/img/".concat(t.sectionFrom&&t.sectionTo?"crossfade":t.sectionFrom?"fade-left":t.sectionTo?"fade-right":void 0,".svg")}),t.sectionFrom&&(0,i.jsx)(Lt,{side:R.zw,transition:t,active:f}),t.sectionTo&&(0,i.jsx)(Lt,{side:R.zG,transition:t,active:f}),s&&(0,i.jsx)(we.Z,{positionX:l.contextMenuX,positionY:l.contextMenuY,items:[{id:"delete",onClick:t.remove,text:"Delete"}],onClose:d})]})},zt=(0,h.Pi)(Ot),Mt={hover:function(e,t){return(0,R.c)(e.ui,t)}},Ft=(0,R.TF)(R.d1,Mt,(function(e){return{connectDropTarget:e.dropTarget()}}))((0,h.Pi)((function(e){var t=e.connectDropTarget,n=e.section,r=e.ui;return(0,i.jsx)(At,{ref:t,"data-testid":"transition-drop-".concat(n.id),children:n.transitions.map((function(e){return(0,i.jsx)(zt,{transition:e,section:n,ui:r},e.id)}))})}))),Ut=(0,h.Pi)((function(e){var t,n,r,o,s,a,c,l=e.section,u=e.ui,d=B.useRef(),m=(0,_.Z)(B.useState(!1),2),p=m[0],h=m[1],g=(0,_.Z)(B.useState(!1),2),v=g[0],b=g[1],T=(0,_.Z)(B.useState(!1),2),x=T[0],y=T[1],w=(0,_.Z)(B.useState(null),2),S=w[0],P=w[1],Z=(0,_.Z)(B.useState(""),2),j=Z[0],C=Z[1],k=xe.ZP.determineTimeFormat(l.durationSeconds),D=xe.ZP.secondsToInputTimeFormat(l.durationSeconds,!0,k),A=function(e){e.preventDefault(),P({contextMenuX:e.pageX,contextMenuY:e.pageY}),h(!0)},I=function(){h(!1),P(null)},E=function(e){e.stopPropagation(),l.duplicate()},L=function(){(0,Ce.C$)()&&((0,Ce.rl)(),(0,Ce.k_)()),l.id===u.activeSectionId&&u.clearActiveSection(),l.remove()},O=function(){var e=(0,be.Z)((function(){var e,t,n;return(0,Te.__generator)(this,(function(i){switch(i.label){case 0:return e=(0,ye.dU)(u).captionService,[4,e._tracksRef(l.asset.captionId).get().then((function(e){return e.docs[0].id}))];case 1:return t=i.sent(),[4,u.composition.addAsset({captionId:l.asset.captionId,trackId:t,type:se.ZP.MEDIA_TYPE.CAPTION,status:se.ZP.ASSET_UPLOAD_STATUS.COMPLETE})];case 2:return n=i.sent().id,u.composition.addSection({duration:l.duration,startTime:l.startTime,playbackStartTime:l.playbackStartTime,assetId:n,id:je.Z.generateGrabyoId(11)},"captions"),(0,Ce.gI)(l.id),[2]}}))}));return function(){return e.apply(this,arguments)}}(),z=function(){return(0,Ce.gI)(l.id)},M=function(){return l.muted?l.unmute():l.mute()},F=l.selected&&v,U=!!l.asset.captionId&&!!u.composition.captionLayer&&l.asset.type!==se.ZP.MEDIA_TYPE.CAPTION;B.useEffect((function(){var e=function(){l.width-25<60?(b(!1),y(!1)):(b(!0),y(!0))};return e(),(0,f.U5)((function(){return l.width}),(function(){return e()}))}),[]),B.useEffect((function(){var e;if((null===(e=l.asset)||void 0===e?void 0:e.type)===se.ZP.MEDIA_TYPE.TEMPLATE)return(0,f.EH)((function(){var e="",t=l.templateFields.get("title")||l.templateFields.get("subtitle");t?e=t.get("content").get("0").value:l.templateFields.forEach((function(t){t.forEach((function(t,n){"content"!==n||j||(e=t.get("0").value)}))})),C(e)}))}),[]);var N=null===(t=u.composition.getAsset(l.assetId))||void 0===t?void 0:t.hasBuffer;return(0,i.jsx)(st,{active:l.selected,isCaption:(null===(n=l.asset)||void 0===n?void 0:n.type)===se.ZP.MEDIA_TYPE.CAPTION,children:(0,i.jsxs)(at,{ref:d,onContextMenu:A,onClick:function(e){e.stopPropagation(),u.activeTransitionId&&u.clearActiveTransition(),u.setActiveSection(l.id),I()},onDoubleClick:z,children:[(0,i.jsx)(Ft,{section:l,ui:u}),(null===(r=l.asset)||void 0===r?void 0:r.type)!==se.ZP.MEDIA_TYPE.TEMPLATE?(0,i.jsx)(Zt,{section:l}):(0,i.jsx)(Qe,{children:j}),(0,i.jsxs)(nt,{children:[x&&(null===(o=l.asset)||void 0===o?void 0:o.transcriptionStatus)===se.ZP.ASSET_UPLOAD_STATUS.PROCESSING&&(0,i.jsxs)(ot,{activeSection:l.selected,children:[(0,i.jsx)(Se.Z,{name:"cc-card"}),(0,i.jsx)(Pe.$,{})]}),x&&(null===(s=l.asset)||void 0===s?void 0:s.transcriptionStatus)===se.ZP.ASSET_UPLOAD_STATUS.SUCCESSFUL&&(0,i.jsx)(ot,{activeSection:l.selected,children:(0,i.jsx)(Se.Z,{name:"cc-card"})}),x&&(null===(a=l.asset)||void 0===a?void 0:a.transcriptionStatus)===se.ZP.ASSET_UPLOAD_STATUS.FAILED&&(0,i.jsxs)(ot,{activeSection:l.selected,children:[(0,i.jsx)(Se.Z,{name:"cc-card"}),(0,i.jsx)(Se.Z,{name:"fail"})]}),F&&(0,i.jsxs)(it,{ccEnabled:x&&null!==(null===(c=l.asset)||void 0===c?void 0:c.transcriptionStatus),children:[D,"s"]}),N&&F&&(0,i.jsx)(Ze.Z,{innerHtml:"Asset contains buffer",distance:5,children:(0,i.jsx)(et,{children:(0,i.jsx)(Se.Z,{name:"info"})})})]}),F&&(0,i.jsx)(rt,{onClick:function(e){e.preventDefault(),e.stopPropagation(),A(e)},children:(0,i.jsx)(Se.Z,{name:"small-menu"})}),(0,i.jsx)(vt,{side:R.Wd,ui:u,section:l}),(0,i.jsx)(vt,{side:R.DP,ui:u,section:l}),p&&function(){var e=[{id:"mute",onClick:M,text:l.muted?"Unmute":"Mute"},{id:"delete",onClick:L,text:"Delete"},{id:"settings",onClick:z,text:"Settings"},{id:"duplicate",onClick:E,text:"Duplicate"}];return U&&e.push({id:"extract",onClick:O,text:"Extract Captions"}),(0,i.jsx)(we.Z,{positionX:S.contextMenuX,positionY:S.contextMenuY,items:e,onClose:I,parentRef:d})}()]})})})),Nt=n(43226),Wt=n.n(Nt),Gt=n(45768),Rt=n(10422),Bt=n(9970),$t=n(80831),Ht=(0,h.Pi
1)((function(e){var t=e.ui,n=e.section,r=n.x,o=n.y,s=n.width,a=n.height,c=n.zIndex,l=n.showConnection,u=n.connectionHeight,d=(0,_.Z)((0,y.D_)({type:R.bY,item:function(){return t.onSectionDragStart(n.id),function(e,t){return(0,ne.Z)({id:t.id,type:t.asset.type,initialIndex:t.index,isChildOfBaseLayer:t.isChildOfBaseLayer,isConstrainedToBaseLayer:t.isConstrainedToBaseLayer},e.composition.baseLayer&&{baseLayerPreview:(0,Bt.Z)(e.composition.baseLayer.sectionsArraySorted)})}(t,n)},end:function(){t.onSectionDragEnd(),t.composition.baseLayer&&t.composition.sortBaseLayer(),ft.r.stopGroup()},collect:function(e){return{isDragging:e.isDragging(),monitor:e}}}),2),m=d[0],p=m.isDragging,h=m.monitor,g=d[1],v=B.useRef({}),b=function(e){return v.current.wasPartOfDragPreview=e},T=function(e){return v.current.requestAnimationFrameId=window.requestAnimationFrame(e)},x=function(){return v.current.wasPartOfDragPreview},w=function(){return!!v.current.requestAnimationFrameId};B.useEffect((function(){var e=function(){var n=h.getDifferenceFromInitialOffset();!mt()(n)&&t.setDragOffset(n),T(e)};p&&!w()&&T(e),!p&&w()&&(window.cancelAnimationFrame(v.current.requestAnimationFrameId),delete v.current.requestAnimationFrameId,t.setDragOffset(null))}),[p]),B.useEffect((function(){return(0,f.U5)((function(){return n.isPartOfDragPreview}),(function(e,t){t&&!e&&b(!0)}))}),[]);var S=n.isPartOfDragPreview||x()?100:1;return(0,i.jsx)($t.AM,{native:!0,to:{xy:[r,o],height:a},config:{mass:1,friction:75,tension:1e3},immediate:!(n.animated||x()),onRest:x()?function(){return b(!1)}:null,children:function(e){var r=e.xy,o=e.height;return(0,i.jsxs)($t.q.div,{style:{transform:r.interpolate((function(e,t){return"translate3d(".concat(e,"px, ").concat(t,"px, 0px)")})),height:o,position:"absolute",zIndex:c+S,width:"".concat(s,"px")},"data-testid":"timeline-section-".concat(n.id),ref:g,children:[l&&(0,i.jsx)(ct,{height:u,section:n}),(0,i.jsx)(Ut,{ui:t,section:n})]})}})})),qt=n(25937),Yt=n(79492);function Xt(){var e=(0,G.Z)(["\n position: absolute;\n width: 100%;\n height: ","px;\n top: ","px;\n pointer-events: none;\n z-index: 20;\n"]);return Xt=function(){return e},e}function Vt(){var e=(0,G.Z)(["\n position: absolute;\n height: 100%;\n background: rgb(255, 255, 255);\n top: 0;\n z-index: 1;\n opacity: 0;\n pointer-events: all;\n"]);return Vt=function(){return e},e}var Kt=b.ZP.div.withConfig({componentId:"sc-423700d7-0"})(Xt(),(function(e){return(0,R.fT)(e.layer)}),(function(e){return(0,R.TP)(e.layer)})),Qt=b.ZP.div.withConfig({componentId:"sc-423700d7-1"})(Vt()),Jt=function(e,t,n,i){return i&&n?(0,R.c3)(e,n,i):n&&!i?(0,R.ms)(t):i&&!n?(0,R.cf)(t):void 0},en=(0,h.Pi)((function(e){var t=e.layer,n=e.sectionFrom,r=e.sectionTo,o=e.section,s=e.style,a=e.ui,c=(0,_.Z)((0,Yt.L)({drop:function(e,i){return function(e,t,n,i,r,o){var s=o.composition.defaultTransitionTime,a=e.getItemType(),c=e.getItem().transitionData,l=s||qt.TQ;if(a===R.Yr){var u=Jt(t,r,i,n);u>l&&(u=l),t.addTransition((0,ie.Z)((0,ne.Z)({},c),{duration:u,sectionFrom:n,sectionTo:i}))}}(i,t,n,r,o,a)},canDrop:function(e){return function(e,t,n,i,r){var o=e.transitionData.mediaType,s=t.getTransitionFrom(n)||t.getTransitionTo(i),a=!r.canTransitionVideo&&o===qt.mk.VIDEO||!r.canTransitionAudio&&o===qt.mk.AUDIO,c=Jt(t,r,i,n)<qt.Pt;return!(s||a||c)}(e,t,n,r,o)},collect:function(e){return{isOver:e.isOver(),canDrop:e.canDrop()}},accept:R.Yr}),2),l=c[0],u=l.isOver,d=l.canDrop,m=c[1];return(0,i.jsx)(Qt,{ref:m,style:(0,ne.Z)({},u&&{opacity:.65},!d&&{backgroundColor:"red"},s)})})),tn=(0,h.Pi)((function(e){var t=e.ui,n=e.layer,r=function(e){return parseFloat((0,xt.W$)(e,t.timelineDuration).toFixed(4))},o=[];return n.sectionsArraySorted.forEach((function(e){var i,s={layer:n,section:e,ui:t},a=r(e.startTime),c=r(e.endTime),l=r(e.duration),u=function(t,n,i){return(0,ie.Z)((0,ne.Z)({},s),(0,ee.Z)({style:{left:"".concat(t,"%"),width:"".concat(n,"%"),zIndex:1}},i,e.id))};o.push(u(a,l/2,"sectionTo")),o.push(u(c-l/2,l/2,"sectionFrom")),e.siblingRight&&e.width>25&&e.siblingRight.width>25&&o.push((i=c,(0,ie.Z)((0,ne.Z)({},s),{style:{left:"".concat(i,"%"),width:50,transform:"translateX(-50%)",zIndex:2},sectionFrom:e.id,sectionTo:e.siblingRight.id})))})),(0,i.jsx)(Kt,{layer:n,children:o.map((function(e,t){return(0,B.createElement)(en,(0,ie.Z)((0,ne.Z)({},e),{key:t}))}))})}));function nn(){var e=(0,G.Z)(["\n\twidth: 1px;\n\theight: 100%;\n\tposition: absolute;\n\tbackground-color: #FFC461;\n\tz-index: ",";\n"]);return nn=function(){return e},e}var rn=(0,oe._g)(b.ZP.div,(function(e){var t=e.position;return{transform:"translateX(".concat(t,"px")}}))(nn(),(function(e){return e.theme.snapGuideZIndex})),on=function(e){(0,te.Z)(n,e);var t=(0,re.Z)(n);function n(e){return(0,w.Z)(this,n),t.call(this,e)}
1return(0,S.Z)(n,[{key:"componentDidUpdate",value:function(e){var t=this.shouldExposeLayers(e.itemType),n=this.shouldExposeLayers(this.props.itemType);!t&&n&&d()(this.props.ui.disableTimelinePointerEvents),t&&!n&&this.props.ui.enableTimelinePointerEvents()}},{key:"shouldExposeLayers",value:function(e){return e===R.C6||e===R.bY}},{key:"renderDragPreview",value:function(){var e=this.props.itemType;return e===R.C6||e===R.Yr?Rt.createPortal((0,i.jsx)(Q,{}),document.querySelector("body")):null}},{key:"renderSections",value:function(){var e=this.props,t=e.ui,n=e.composition;return(0,i.jsx)("div",{style:{zIndex:1,position:"relative",pointerEvents:t.pointerEvents?"all":"none"},children:n.sections.map((function(e){return(0,i.jsx)(Ht,{section:e,composition:n,ui:t},e.id)}))})}},{key:"renderLayers",value:function(){return this.props.composition.layersForTimeline.map((function(e){var t=e.id;return(0,i.jsx)(ve,{id:t},t)}))}},{key:"renderSnapGuide",value:function(){var e=this.props.ui.snapGuidePosition;return e?(0,i.jsx)(rn,{position:e}):null}},{key:"renderTransitionDropAreas",value:function(){var e=this.props,t=e.ui,n=e.itemType,r=e.composition.layersForTimeline;return n===R.Yr?r.map((function(e){return(0,i.jsx)(tn,{ui:t,layer:e},e.id)})):null}},{key:"render",value:function(){var e=this.props.connectDropTarget;return(0,i.jsxs)("div",{"data-testid":"timeline",ref:e,children:[this.renderSnapGuide(),this.renderDragPreview(),this.renderSections(),this.renderLayers(),this.renderTransitionDropAreas()]})}}]),n}(B.Component),sn=(0,h.f3)("composition","ui")((0,Gt.G)(R.ly,{},(function(e,t){return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),itemType:t.getItemType(),item:t.getItem()}}))((0,h.Pi)(on))),an=function(e){(0,te.Z)(n,e);var t=(0,re.Z)(n);function n(e){var i;return(0,w.Z)(this,n),i=t.call(this,e),(0,ee.Z)((0,J.Z)(i),"onSectionsLengthChange",(function(){var e=i.props.composition.sections;e.length>i.currentSections.length&&e.forEach((function(e){i.currentSections.includes(e.id)||i.onNewSection(e)})),i.currentSections=e.map((function(e){return e.id}))})),(0,ee.Z)((0,J.Z)(i),"onNewSection",(function(e){return d()((function(){var t=i.props,n=t.ui,r=t.player;n.setNewSection(e.id),n.setActiveSection(e.id),r&&r.seek(e.startTime)}))})),i.ref=B.createRef(),i}return(0,S.Z)(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.composition,n=t.sections,i=t.assets;this.props.renderCallback(this.ref.current),this.currentSections=n.map((function(e){return e.id})),this.currentAssets=je.Z.mapToArray(i).map((function(e){return e.id})),this.onNewSectionDisposer=(0,f.U5)((function(){return e.props.composition.sections.length}),(function(){return e.onSectionsLengthChange()}))}},{key:"componentWillUnmount",value:function(){this.onNewSectionDisposer()}},{key:"render",value:function(){return(0,i.jsx)("div",{ref:this.ref,style:{position:"relative"},children:(0,i.jsx)(sn,{})})}}]),n}(B.Component);an.propTypes={renderCallback:ce().func,player:ce().object},an.defaultProps={renderCallback:Wt()};var cn=(0,h.f3)((function(e){return{composition:e.composition,ui:e.ui}}))(an),ln=n(98777),un=n.n(ln),dn=function(e){return e*window.devicePixelRatio},mn=function(e){var t=e.seekCallback,n=e.timelineModel,r=e.displayLabels,o=e.primaryTickPosition,s=e.secondaryTickPosition,a=e.parentWidth,c=e.parentHeight,l=e.timelineWidth,u=e.preDraw,d=e.blocks,m=(0,B.useRef)(null),p=n.get("ignoreTimezone"),h=n.get("sectionStart"),f=n.get("sectionEnd"),g=function(e){return r?function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=un().unix(e/1e3);return t&&n.utc(),n.format("HH:mm:ss")}(e,p):""},v=function(){return""};(0,B.useEffect)((function(){var e=m.current.getContext("2d");e.clearRect(0,0,dn(a),dn(c)),n.calculateIntervals();var t=h,i=f;if(a>0&&l>0){var d=f-h,p=(d*(a/l)-d)/2;t-=p,i+=p}var b=i-t,T=function(e){var t=[{first:n.primaryScaleFirst,next:n.primaryScaleNext,label:g,options:(0,ne.Z)({color:"#adb1bb"},o)},{first:n.secondaryScaleFirst,next:n.secondaryScaleNext,label:v,options:(0,ne.Z)({color:"#5b6477"},s)}];return r&&(e.textAlign="center","top"===r&&(e.textBaseline="bottom"),"bottom"===r&&(e.textBaseline="top"),e.font="".concat(dn(11),"px Open Sans"),e.fillStyle="#707788"),e.strokeWidth=1,e.lineCap="square",t}(e);e.translate(.5,.5),u(t,i,b,e),function(e,t,n,i,o){var s=dn(5);e.forEach((function(e){var c,l=e.first,u=e.next,d=e.label,m=e.options,p=m.top,h=m.bottom,f=m.color,g=l(t,n);do{g=u(c=g);var v=Math.round(dn(p)),b=Math.round(dn(h)),T=Math.round(dn((c-t)/i*a));if(o.strokeStyle=f,o.beginPath(),o.moveTo(T,v),o.lineTo(T,b),o.stroke(),o.closePath(),r){o.fillStyle=f;var x=Math.round("top"===r?v-s:b+s);o.fillText(d(c),T,x)}}while(g<n&&!isNaN(g))}))}(T,t,i,b,e),e.translate(-.5,-.5)}),[l,a,c,h,f,p,d]);return(0,i.jsx)("canvas",{"data-testid":"timeGrid",width:dn(a),height:dn(c),style:{display:"block",width:a,height:c},onClick:function(e){var i=e.pageX-m.current.getBoundingClientRect().left,r=h+i/a*n.getSectionDuration();r<0&&(r=0),t(r)},ref:m})},pn=ce().shape({top:ce().number.isRequired,bottom:ce().number.isRequired});mn.propTypes={seekCallback:ce().func,timelineModel:ce().object,displayLabels:ce().oneOf(["top","bottom"]),primaryTickPosition:pn,secondaryTickPosition:pn,parentWidth:ce().number,parentHeight:ce().number,timelineWidth:ce().number,preDraw:ce().func},mn.defaultProps={seekCallback:function(){},parentHeight:150,primaryTickPosition:{top:30,bottom:120},secondaryTickPosition:{top:60,bottom:90},preDraw:function(){}};var hn=mn,fn=function(e){var t=e.startLabel,n=e.endLabel;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"editorTimeline__timeGrid",children:(0,i.jsx)("div",{className:"editorTimeline__timeGridInner js-timegrid-inner"})}),(0,i.jsx)("div",{className:"editorTimeline__layers js-timeline-wrapper",children:(0,i.jsx)("div",{className:"editorTimeline__layersInner timeline-elastic js-timeline-elastic",style:{width:"100%",position:"relative"},children:(0,i.jsx)("div",{className:"editorTimeline__layersScrollable editorTimeline__layersInner timeline-wrapper js-timeline-container"})})}),(0,i.jsxs)("div",{className:"grTimescale",children:[(0,i.jsx)("div",{className:"grTimescale__label grTimescale__label--start js-label-start",children:t}),(0,i.jsxs)("div",{className:"grTimescale__container js-timescale-wrapper",children:[(0,i.jsx)("div",{className:"grTimescale__clip js-timeline-clip"}),(0,i.jsx)("div",{className:"grTimescale__slider",children:(0,i.jsx)("div",{className:"js-timescale"})}),(0,i.jsx)("div",{className:"grTimescale__lollipop js-timeline-lollipop","data-type":"timescale"})]}),(0,i.jsx)("div",{className:"grTimescale__label grTimescale__label--end js-label-end",children:n}),(0,i.jsx)("i",{className:"js-zoom-out gb-icon-minus grTimescale__zoom-out grTimescale__icon"}),(0,i.jsx)("i",{className:"js-zoom-in gb-icon-plus grTimescale__zoom-in grTimescale__icon"}),(0,i.jsx)("i",{className:"js-zoom-to-selection gb-icon-zoomtoselection grTimescale__icon"})]})]})},gn=W.extend({template:(0,C.L)(fn),className:"".concat(W.prototype.className," grTimeControl--composer js-composer-output editorTimeline"),events:l()({},W.prototype.events,{click:"focusComposition"}),initialize:function(e){var t=this;gn.__super__.initialize.apply(this,arguments),this.animationHandler=new j,e=a()(e)?e:{},a()(e.video)&&(this.video=e.video),this.composition=e.composition,this.ui=e.ui,this.timelineUpdateDisposer=(0,f.EH)((function(){t.model.set("end",t.ui.timelineDuration),t.video.currentTime>t.composition.duration&&t.video.seek(t.composition.duration),t.timelineWrapper&&d()((function(){return t.ui.setTimelineWidth(t.timelineWrapper.offsetWidth)}))})),o()(this,"onTimelineRender","bringLollipopIntoView","resizeObserverCb","mutationObserverCb","timeGridRoCb"),this.listenTo(this.model,"change:sectionStart change:sectionEnd",(function(){return t.renderTimeGrid()}))},onBoundariesChange:function(){var e={range:{min:this.model.get("start"),max:this.model.get("end")},limit:this.ui.maxTimelineSelection};return this.timescale.noUiSlider.updateOptions(e),this.updateTimelineLabels(),this.onTimescaleChange(),e},onTimelineRender:function(e){var t=this;0!==e.offsetHeight?this.$timelineContainer.scrollTop(e.offsetHeight-this.$timelineContainer.height()):setTimeout((function(){return t.onTimelineRender(e)}),50)},mutationObserverCb:function(e){var t=this;e.forEach((function(e){if("attributes"===e.type&&"style"===e.attributeName){var n=t.timelineWrapper.getBoundingClientRect().left;t.ui.setTimelineOffset(n)}}))},resizeObserverCb:function(e){var t=this;e.forEach((function(e){var n=e.contentRect.width;n!==t.ui.timelineWidth&&t.ui.setTimelineWidth(n)}))},timeGridRoCb:function(e){var t=this;e.forEach((function(e){var n=e.contentRect,i=n.width,r=n.height;t.timeGridWidth===i&&t.timeGridHeight===r||t.renderTimeGrid(i,r)}))},renderTimeGrid:function(e,t){p()(e)&&(this.timeGridWidth=e),p()(t)&&(this.timeGridHeight=t),this.timeGridHeight&&this.timeGridWidth&&(0,y.sY)((0,i.jsx)(hn,{timelineModel:this.model,displayLabels:"top",listenToClick:!0,seekCallback:this.video.seek,parentWidth:this.timeGridWidth,parentHeight:this.timeGridHeight,primaryTickPosition:{top:23,bottom:45},secondaryTickPosition:{top:28,bottom:40}}),this.timeGridInner)},render:function(){gn.__super__.render.apply(this,arguments),this.$timelineContainer=this.$(".js-timeline-container"),this.$timelineContainer.empty(),this.timeGridInner=this.el.querySelector(".js-timegrid-inner");var e=this.timelineWrapper.getBoundingClientRect(),t=e.left,n=e.width;return this.ui.setTimelineOffset(t),this.ui.setTimelineWidth(n),this.resizeObserversSet||(this.mutationObserver=new MutationObserver(this.mutationObserverCb),this.resizeObserver=new T.Z(this.resizeObserverCb),this.timeGridRo=new T.Z(this.timeGridRoCb),this.mutationObserver.observe(this.timelineWrapper,{attributes:!0}),this.resizeObserver.observe(this.timelineWrapper),this.timeGridRo.observe(this.timeGridInner),this.resizeObserversSet=!0),this.composition.layers.size>0?(0,y.sY)((0,i.jsx)(g.W,{backend:v.PD,children:(0,i.jsx)(b.f6,{theme:k.$,children:(0,i.jsx)(h.zt,{ui:this.ui,composition:this.composition,children:(0,i.jsx)(cn,{renderCallback:this.onTimelineRender,player:this.video})})})}),this.$timelineContainer[0]):(0,y.sY)((0,i.jsx)(A.g,{}),this.el.querySelector(".js-timeline-wrapper")),this.onBoundariesChange(),this},onLollipopMouseUp:function(){gn.__super__.onLollipopMouseUp.apply(this,arguments)}
1,onLollipopDrag:function(e){var t=this,n=0,i=this.composition.duration/this.composition.timelineDuration;"timeline"===this.lollipopActive?n=(x.Z.getTimeHovered.call(this,e.pageX)-this.model.get("start"))/this.model.getTimelineDuration():"timescale"===this.lollipopActive&&(n=x.Z.getPercentageHovered(e.pageX,this.$timescaleWrapper));n=(n=n<0?0:n)>i?i:n,this.updateLollipop(n);var r=this.getLollipopTimestamp();this.animationHandler.animate((function(){t.video.currentTime!==r&&t.video.seek(r)}))},destroy:function(){this.timelineUpdateDisposer(),(0,y.su)(this.$timelineContainer[0]),this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.timeGridRo.disconnect(),gn.__super__.destroy.apply(this,arguments)},lollipopInView:function(){return this.model.get("currentTime")<=this.model.get("sectionEnd")&&this.model.get("currentTime")>=this.model.get("sectionStart")},bringLollipopIntoView:function(){if(!this.lollipopInView()){var e,t=this.model.get("currentTime"),n=this.model.get("sectionEnd"),i=this.model.get("sectionStart");t>n&&(e=t-n+5e3),t<i&&(e=-(i-t+5e3)),i+=e,n+=e,this.refreshTimescale(i,n)}},zoom:function(e,t){if(!this.timescale.hasAttribute("disabled")){var n=this.model.get("sectionStart"),i=this.model.get("sectionEnd"),r=isFinite(n),o=isFinite(i),s=this.model.get("start"),a=this.model.get("end"),c=this.model.get("currentTime");if(!r&&o)n=i;else if(r&&!o)i=n;else if(!r&&!o)throw new Error("inPoint and outPoint non finite value");e=e>1&&0===s?2*e:e;var l,u=this.getNewSectionLength(e,t);l=this.lollipopInView()?(0,D.LH)(u,s,a,c):(0,D.tw)(u,n,i,s,a),this.refreshTimescale(l.start,l.end),App.Events.trigger("timeline:zoom")}}}),vn=gn}}]); 2//# sourceMappingURL=9405.8df361df0b7c1cbc.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.