mediacms/static/js/media.js

1 line
209 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){"use strict";var e={3921:function(e,t,n){var i={};n.r(i),n.d(i,{addMediaToPlaylist:function(){return se},addNewPlaylist:function(){return ce},copyEmbedMediaCode:function(){return ne},copyShareLink:function(){return te},createPlaylist:function(){return re},deleteComment:function(){return ae},dislikeMedia:function(){return $},likeMedia:function(){return X},loadMediaData:function(){return K},removeMedia:function(){return ie},removeMediaFromPlaylist:function(){return le},reportMedia:function(){return ee},submitComment:function(){return oe},undislikeMedia:function(){return Q},unlikeMedia:function(){return J}});var o=n(2667),a=(n(5101),n(5466)),r=(n(6116),n(9518)),s=n(3074),l=n.n(s),c=n(920),u=n.n(c),d=n(2276),p=n(2787),f=n(4426),m=n(3811);function h(e){var t=null,n=e.split(".");if(n.length)switch(n=n[n.length-1]){case"webm":t="audio/webm";break;case"flac":t="audio/flac";break;case"wave":t="audio/wave";break;case"wav":t="audio/wav";break;case"ogg":case"ogg":t="audio/ogg";break;case"mp3":case"mpeg":t="audio/mpeg"}return t}n(2322),n(9268);var y=n(9688),b=n(5793),g=n(6983),v=n(9450);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?P(e):t}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}new v.Z;var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=C(i);if(o){var n=C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=r.call(this,e);var n=d.Z.get("media-data");t.AudioPlayerData={},t.audioStartedPlaying=!1;var i=(0,y.U)(n.original_media_url,f.Z.get("config-site").url);t.videoSources=[{src:i,type:h(i)}],t.videoPoster=n.poster_url,t.videoPoster=t.videoPoster?t.videoPoster:n.thumbnail_url,t.videoPoster=t.videoPoster?(0,y.U)(t.videoPoster,f.Z.get("config-site").url):"",t.updatePlayerVolume=t.updatePlayerVolume.bind(P(t)),t.onAudioEnd=t.onAudioEnd.bind(P(t)),t.onAudioRestart=t.onAudioRestart.bind(P(t)),f.Z.on("switched_media_auto_play",t.onUpdateMediaAutoPlay.bind(P(t))),t.wrapperClick=t.wrapperClick.bind(P(t));var o=new v.Z;return o.update(d.Z.get("media-data").duration),t.durationISO8601=o.ISO8601(),t}return t=s,(n=[{key:"componentDidMount",value:function(){this.videoSources.length||console.warn("Audio DEBUG:","Audio file doesn't exist"),this.recommendedMedia=d.Z.get("media-data").related_media.length?new g.Z(d.Z.get("media-data").related_media,this.refs.AudioElem.parentNode,this.props.inEmbed):null,this.upNextLoaderView=!this.props.inEmbed&&d.Z.get("media-data").related_media.length?new b.Z(d.Z.get("media-data").related_media[0]):null,document.hasFocus()||"visible"===document.visibilityState?this.initPlayerInstance():(this.initPlayerInstance=this.initPlayerInstance.bind(this),window.addEventListener("focus",this.initPlayerInstance),document.addEventListener("visibilitychange",this.initPlayerInstance))}},{key:"componentWillUnmount",value:function(){this.recommendedMedia&&(this.AudioPlayerData.instance.player.off("fullscreenchange",this.recommendedMedia.onResize),f.Z.removeListener("window_resize",this.recommendedMedia.onResize),p.Z.removeListener("changed_viewer_mode",this.recommendedMedia.onResize),this.recommendedMedia.destroy()),videojs(this.refs.AudioElem).dispose(),this.AudioPlayerData.instance=null,delete this.AudioPlayerData.instance}},{key:"initPlayerInstance",value:function(){window.removeEventListener("focus",this.initPlayerInstance),document.removeEventListener("visibilitychange",this.initPlayerInstance),this.refs.AudioElem.focus(),this.initPlayerInstance=null,setTimeout(function(){if(!this.AudioPlayerData.instance){var e=this.props.inEmbed?document.createElement("a"):null,t=this.props.inEmbed?document.createElement("a"):null;e&&(e.setAttribute("class","title-link"),e.setAttribute("href",d.Z.get("media-data").url),e.setAttribute("title",d.Z.get("media-data").title),e.setAttribute("target","_blank"),e.innerHTML=d.Z.get("media-data").title),t&&(t.setAttribute("class","user-thumb-link"),t.setAttribute("href",d.Z.get("media-data").author_profile),t.setAttribute("title",d.Z.get("media-data").author_name),t.setAttribute("target","_blank"),t.innerHTML='<img src="'+d.Z.get("media-author-thumbnail-url")+'" alt="" />'),this.AudioPlayerData.instance=new(u())(this.refs.AudioElem,{sources:this.videoSources,poster:this.videoPoster,autoplay:!this.props.inEmbed,bigPlayButton:!0,controlBar:{fullscreen:!1,theaterMode:!1,next:!this.props.inEmbed&&0<d.Z.get("media-data").related_media.length},cornerLayers:{topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:t}},{volume:p.Z.get("player-volume"),soundMuted:p.Z.get("player-sound-muted")},null,null,this.onAudioPlayerStateUpdate.bind(this),this.onClickNextButton.bind(this),null),this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.AudioPlayerData.instance.player.el_),this.onUpdateMediaAutoPlay()),this.refs.AudioElem.parentNode.focus(),this.AudioPlayerData.instance.player.one("play",function(){this.audioStartedPlaying=!0}.bind(this)),this.recommendedMedia&&(this.recommendedMedia.initWrappers(this.AudioPlayerData.instance.player.el_),this.AudioPlayerData.instance.player.one("pause",this.recommendedMedia.init),this.AudioPlayerData.instance.player.on("fullscreenchange",this.recommendedMedia.onResize),f.Z.on("window_resize",this.recommendedMedia.onResize),p.Z.on("changed_viewer_mode",this.recommendedMedia.onResize)),this.AudioPlayerData.instance.player.one("ended",this.onAudioEnd)}}.bind(this),50)}},{key:"initialDocumentFocus",value:function(){this.refs.AudioElem.parentNode&&(this.refs.AudioElem.parentNode.focus(),setTimeout(function(){this.AudioPlayerData.instance.player.play()}.bind(this),50)),window.removeEventListener("focus",this.initialDocumentFocus),this.initialDocumentFocus=null}},{key:"onClickNextButton",value:function(){this.props.inEmbed||(window.location.href=d.Z.get("media-data").related_media[0].url)}},{key:"onUpdateMediaAutoPlay",value:function(){this.upNextLoaderView&&(f.Z.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.AudioPlayerData.instance.isEnded()):this.upNextLoaderView.hideTimerView())}},{key:"onAudioPlayerStateUpdate",value:function(e){this.updatePlayerVolume(e.volume,e.soundMuted)}},{key:"onAudioRestart",value:function(){this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("inline"),this.AudioPlayerData.instance.player.one("pause",this.recommendedMedia.init),this.AudioPlayerData.instance.player.one("ended",this.onAudioEnd))}},{key:"onAudioEnd",value:function(){var e=d.Z.get("playlist-id");if(e){var t=d.Z.get("playlist-next-media-url");if(t)return void(window.location.href=t)}this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("full"),this.AudioPlayerData.instance.player.one("playing",this.onAudioRestart)),this.upNextLoaderView&&(e?(this.upNextLoaderView.cancelTimer(),this.upNextLoaderView.hideTimerView()):f.Z.get("media-auto-play")?(this.upNextLoaderView.startTimer(),this.AudioPlayerData.instance.player.one("play",function(){this.upNextLoaderView.cancelTimer()}.bind(this))):this.upNextLoaderView.cancelTimer())}},{key:"onUpdateMediaAutoPlay",value:function(){this.upNextLoaderView&&(f.Z.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.AudioPlayerData.instance.isEnded()):this.upNextLoaderView.hideTimerView())}},{key:"updatePlayerVolume",value:function(e,t){p.Z.get("player-volume")!==e&&m.zZ(e),p.Z.get("player-sound-muted")!==t&&m.Hs(t)}},{key:"wrapperClick",value:function(e){e.target.parentNode===this.refs.videoPlayerWrap&&(this.AudioPlayerData.instance.player.ended()||(!this.AudioPlayerData.instance.player.hasStarted_||this.AudioPlayerData.instance.player.paused()?this.AudioPlayerData.instance.player.play():this.AudioPlayerData.instance.player.pause()))}},{key:"render",value:function(){return a.createElement("div",{className:"player-container audio-player-container"},a.createElement("div",{className:"player-container-inner"},a.createElement("div",{className:"video-player",ref:"videoPlayerWrap",onClick:this.wrapperClick},a.createElement("audio",{tabIndex:"1",ref:"AudioElem",className:"video-js vjs-mediacms native-dimensions"}))))}}])&&_(t.prototype,n),s}(a.PureComponent);function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?N(e):t}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}O.defaultProps={inEmbed:!1},O.propTypes={inEmbed:l().bool},n(3296),n(3233);var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Z(i);if(o){var n=Z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return D(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={image:t.getImageUrl()},t.state.image=t.state.image?t.state.image:d.Z.get("media-data").thumbnail_url,t.state.image=t.state.image?t.state.image:"",t.onImageLoad=t.onImageLoad.bind(N(t)),d.Z.on("loaded_image_data",t.onImageLoad),t}return t=s,(n=[{key:"getImageUrl",value:function(){var e=d.Z.get("media-data"),t="string"==typeof e.poster_url?e.poster_url.trim():"";return""===t&&(t="string"==typeof e.thumbnail_url?e.thumbnail_url.trim():""),""===t&&(t="string"==typeof d.Z.get("media-original-url")?d.Z.get("media-original-url").trim():""),""===t?"#":f.Z.get("config-site").url+"/"+t.replace(/^\//g,"")}},{key:"onImageLoad",value:function(){this.setState({image:this.getImageUrl()})}},{key:"render",value:function(){return this.state.image?a.createElement("div",{className:"viewer-image-container"},a.createElement("img",{src:this.state.image,alt:d.Z.get("media-data").title||null})):null}}])&&R(t.prototype,n),s}(a.PureComponent);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(i);if(o){var n=A(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,e)}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"player-container viewer-pdf-container"},a.createElement("div",{className:"player-container-inner"},a.createElement("span",null,a.createElement("span",null,a.createElement("i",{className:"material-icons"},"insert_drive_file")))))}}])&&j(t.prototype,n),s}(a.PureComponent);function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e,t){return!t||"object"!==V(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(i);if(o){var n=z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return H(this,e)});function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,e)}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"player-container viewer-attachment-container"},a.createElement("div",{className:"player-container-inner"},a.createElement("span",null,a.createElement("span",null,a.createElement("i",{className:"material-icons"},"insert_drive_file")))))}}])&&U(t.prototype,n),s}(a.PureComponent),q=n(8204),G=n(8416),Y=n.n(G);function K(){Y().dispatch({type:"LOAD_MEDIA_DATA"})}function X(){Y().dispatch({type:"LIKE_MEDIA"})}function J(){Y().dispatch({type:"UNLIKE_MEDIA"})}function $(){Y().dispatch({type:"DISLIKE_MEDIA"})}function Q(){Y().dispatch({type:"UNDISLIKE_MEDIA"})}function ee(e){Y().dispatch({type:"REPORT_MEDIA",reportDescription:e?e.replace(/\s/g,""):""})}function te(e){Y().dispatch({type:"COPY_SHARE_LINK",inputElement:e})}function ne(e){Y().dispatch({type:"COPY_EMBED_MEDIA_CODE",inputElement:e})}function ie(){Y().dispatch({type:"REMOVE_MEDIA"})}function oe(e){Y().dispatch({type:"SUBMIT_COMMENT",commentText:e})}function ae(e){Y().dispatch({type:"DELETE_COMMENT",commentId:e})}function re(e){Y().dispatch({type:"CREATE_PLAYLIST",playlist_data:e})}function se(e,t){Y().dispatch({type:"ADD_MEDIA_TO_PLAYLIST",playlist_id:e,media_id:t})}function le(e,t){Y().dispatch({type:"REMOVE_MEDIA_FROM_PLAYLIST",playlist_id:e,media_id:t})}function ce(e){Y().dispatch({type:"APPEND_NEW_PLAYLIST",playlist_data:e})}function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function me(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fe(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=he(i);if(o){var n=he(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return me(this,e)});function s(){return de(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"viewer-container",key:"viewer-container-error"},a.createElement("div",{className:"player-container player-container-error"},a.createElement("div",{className:"player-container-inner"},a.createElement("div",{className:"error-container"},a.createElement("div",{className:"error-container-inner"},a.createElement("span",{className:"icon-wrap"},a.createElement("i",{className:"material-icons"},"error_outline")),a.createElement("span",{className:"msg-wrap"},d.Z.get("media-load-error-message")))))))}}])&&pe(t.prototype,n),s}(a.PureComponent),be=(n(2004),n(8407),n(4458),n(8349)),ge=(n(7228),n(7448)),ve=n(3671),we=n(9191),_e=n(4067),ke=n(7207),Ee=n(2836);function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Se(e,t,n){return t&&Oe(e.prototype,t),n&&Oe(e,n),e}function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Me(e,t)}function Me(e,t){return(Me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function De(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=xe(e);if(t){var o=xe(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return Ne(this,n)}}function Ne(e,t){return!t||"object"!==Pe(t)&&"function"!=typeof t?Ze(e):t}function Ze(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te="comment",je="Comment",Le="SUBMIT",Ie=function(e){Re(n,e);var t=De(n);function n(e){var i;return Ce(this,n),(i=t.call(this,e)).state={value:"",madeChanges:!1,textareaFocused:!1,textareaLineHeight:-1},i.onChange=i.onChange.bind(Ze(i)),i.onFocus=i.onFocus.bind(Ze(i)),i.onBlur=i.onBlur.bind(Ze(i)),i.submitComment=i.submitComment.bind(Ze(i)),i.onCommentSubmit=i.onCommentSubmit.bind(Ze(i)),i.onCommentSubmitFail=i.onCommentSubmitFail.bind(Ze(i)),d.Z.on("comment_submit",i.onCommentSubmit),d.Z.on("comment_submit_fail",i.onCommentSubmitFail),i}return Se(n,[{key:"onFocus",value:function(){this.setState({textareaFocused:!0})}},{key:"onBlur",value:function(){this.setState({textareaFocused:!1})}},{key:"onCommentSubmit",value:function(){this.refs.FormTextarea.style.height="";var e=this.refs.FormTextarea.scrollHeight,t=0<this.state.textareaLineHeight?this.state.textareaLineHeight:parseFloat(window.getComputedStyle(this.refs.FormTextarea).lineHeight);this.setState({value:"",madeChanges:!1,textareaLineHeight:t},(function(){this.refs.FormTextarea.style.height=Math.max(20,this.state.textareaLineHeight*Math.ceil(e/t))+"px"}))}},{key:"onCommentSubmitFail",value:function(){this.setState({madeChanges:!1})}},{key:"onChange",value:function(e){this.refs.FormTextarea.style.height="";var t=this.refs.FormTextarea.scrollHeight,n=0<this.state.textareaLineHeight?this.state.textareaLineHeight:parseFloat(window.getComputedStyle(this.refs.FormTextarea).lineHeight);this.setState({madeChanges:!0,value:this.refs.FormTextarea.value,textareaLineHeight:n},(function(){this.refs.FormTextarea.style.height=Math.max(20,this.state.textareaLineHeight*Math.ceil(t/n))+"px"}))}},{key:"submitComment",value:function(){if(this.state.madeChanges){var e=this.refs.FormTextarea.value.trim();""!==e&&oe(e)}}},{key:"render",value:function(){var e;return f.Z.get("config-user").is.anonymous&&(e=window.location.href.replace(f.Z.get("config-site").url,"").replace(/^\//g,""),e=f.Z.get("url-signin")+"?next=/"+e),f.Z.get("config-user").is.anonymous?a.createElement("div",{className:"comments-form"},a.createElement("div",{className:"comments-form-inner"},a.createElement(we.Z,null),a.createElement("div",{className:"form"},a.createElement("a",{href:e,rel:"noffolow",className:"form-textarea-wrap",title:"Add a comment..."},a.createElement("span",{ref:"FormTextarea",className:"form-textarea"},"Add a comment...")),a.createElement("div",{className:"form-buttons"},a.createElement("a",{href:e,rel:"noffolow",className:"disabled"},Le))))):a.createElement("div",{className:"comments-form"},a.createElement("div",{className:"comments-form-inner"},a.createElement(we.Z,null),a.createElement("div",{className:"form"},a.createElement("div",{className:"form-textarea-wrap"+(this.state.textareaFocused?" focused":"")},a.createElement("textarea",{ref:"FormTextarea",className:"form-textarea",rows:"1",placeholder:"Add a comment...",value:this.state.value,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur})),a.createElement("div",{className:"form-buttons"},a.createElement("button",{className:""===this.state.value.trim()?"disabled":"",onClick:this.submitComment},Le)))))}}]),n}(a.PureComponent);Ie.propTypes={comment_type:l().oneOf(["new","reply"]),media_id:l().oneOfType([l().string,l().number]).isRequired,reply_comment_id:l().oneOfType([l().string,l().number])},Ie.defaultProps={comment_type:"new"};var Ae=function(e){Re(n,e);var t=De(n);function n(e){var i;return Ce(this,n),(i=t.call(this,e)).state={viewMoreContent:!0,enabledViewMoreContent:!1,isOpenRemoveCommentPopup:!1},f.Z.get("config-user").can.deleteComment?(i.proceedCommentRemoval=i.proceedCommentRemoval.bind(Ze(i)),i.cancelCommentRemoval=i.cancelCommentRemoval.bind(Ze(i)),i.onPopupsDisplayChange=i.onPopupsDisplayChange.bind(Ze(i)),i.removeCommentPopup=new ke.Z(a.createElement("button",{onClick:i.removeComment},"DELETE ","COMMENT"),a.createElement(Ee.W8,null,a.createElement("div",{className:"popup-message"},a.createElement("span",{className:"popup-message-title"},je," removal"),a.createElement("span",{className:"popup-message-main"},"You're willing to remove ",Te," permanently?")),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("button",{className:"button-link cancel-comment-removal",onClick:i.cancelCommentRemoval},"CANCEL"),a.createElement("button",{className:"button-link proceed-comment-removal",onClick:i.proceedCommentRemoval},"PROCEED"))),i.onPopupsDisplayChange)):(i.proceedCommentRemoval=null,i.cancelCommentRemoval=null,i.onPopupsDisplayChange=null),i}return Se(n,[{key:"componentDidMount",value:function(){}},{key:"onWindowResize",value:function(){var e=this.state.enabledViewMoreContent||this.refs.TextInner.offsetHeight>this.refs.Text.offsetHeight;this.setState({enabledViewMoreContent:e,viewMoreContent:!!e&&this.state.viewMoreContent})}},{key:"toggleMore",value:function(){this.setState({viewMoreContent:!this.state.viewMoreContent})}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenRemoveCommentPopup:this.removeCommentPopup.isPopupOpen()})}},{key:"cancelCommentRemoval",value:function(){this.removeCommentPopup.setOpenPopupState(!1)}},{key:"proceedCommentRemoval",value:function(){ae(this.props.comment_id),this.cancelCommentRemoval()}},{key:"render",value:function(){return a.createElement("div",{key:this.props.comment_id,className:"comment"},a.createElement("div",{className:"comment-inner"},a.createElement("a",{className:"comment-author-thumb",href:this.props.author_link,title:this.props.author_name},a.createElement("img",{src:this.props.author_thumb,alt:this.props.author_name})),a.createElement("div",{className:"comment-content"},a.createElement("div",{className:"comment-meta"},a.createElement("div",{className:"comment-author"},a.createElement("a",{href:this.props.author_link,title:this.props.author_name},this.props.author_name)),a.createElement("div",{className:"comment-date"},(0,_e.WU)(new Date(this.props.publish_date)))),a.createElement("div",{ref:"Text",className:"comment-text"+(this.state.viewMoreContent?" show-all":"")},a.createElement("div",{ref:"TextInner",className:"comment-text-inner",dangerouslySetInnerHTML:{__html:this.props.text}})),this.state.enabledViewMoreContent?a.createElement("button",{className:"toggle-more",onClick:this.toggleMore},this.state.viewMoreContent?"Show less":"Read more"):null,f.Z.get("config-user").can.deleteComment?a.createElement("div",{className:"comment-actions"},f.Z.get("config-user").can.deleteComment?a.createElement("div",{className:"comment-action remove-comment"},this.removeCommentPopup.triggerComponent(),this.state.isOpenRemoveCommentPopup?this.removeCommentPopup.contentComponent():null):null):null)))}}]),n}(a.PureComponent);Ae.propTypes={comment_id:l().oneOfType([l().string,l().number]).isRequired,media_id:l().oneOfType([l().string,l().number]).isRequired,text:l().string,author_name:l().string,author_link:l().string,author_thumb:l().string,publish_date:l().oneOfType([l().string,l().number]),likes:l().number,dislikes:l().number},Ae.defaultProps={author_name:"",author_link:"#",publish_date:0,likes:0,dislikes:0};var Fe=function(e){Re(n,e);var t=De(n);function n(e){var i;if(Ce(this,n),(i=t.call(this,e)).state={mediaId:d.Z.get("media-id")},f.Z.get("config-user").can.readComment){var o=d.Z.get("media-comments");i.state.comments=o,i.state.commentsLength=o?o.length:0,i.state.commentsLength||(i.onCommentsLoad=i.onCommentsLoad.bind(Ze(i)),i.onCommentSubmit=i.onCommentSubmit.bind(Ze(i)),i.onCommentSubmitFail=i.onCommentSubmitFail.bind(Ze(i)),i.onCommentDelete=i.onCommentDelete.bind(Ze(i)),i.onCommentDeleteFail=i.onCommentDeleteFail.bind(Ze(i)),d.Z.on("comments_load",i.onCommentsLoad),d.Z.on("comment_submit",i.onCommentSubmit),d.Z.on("comment_submit_fail",i.onCommentSubmitFail),d.Z.on("comment_delete",i.onCommentDelete),d.Z.on("comment_delete_fail",i.onCommentDeleteFail))}return i}return Se(n,[{key:"onCommentsLoad",value:function(){var e=d.Z.get("media-comments");this.setState({comments:e,commentsLength:e?e.length:0},(function(){}));var t=document.querySelector(".page-main"),n=t.querySelector(".no-comment");if(0===e.length&&"unlisted"===d.Z.get("media-data").state){if(-1<f.Z.get("url-profile-home").indexOf(d.Z.get("media-data").author_profile)&&!n){var i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("class","alert info alert-dismissible no-comment"),i.innerHTML='<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+f.Z.get("config-contents").uploader.postUploadMessage,t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i),i.querySelector("button.close").addEventListener("click",(function(e){return i.setAttribute("class","alert info alert-dismissible hiding"),setTimeout(function(){i.parentNode.removeChild(i)}.bind(this),400),e.preventDefault(),e.stopPropagation(),!1}))}}else n&&0<e.length&&n.parentNode.removeChild(n)}},{key:"onCommentSubmit",value:function(e){this.onCommentsLoad(),setTimeout((function(){be.wN("Comment added","commentSubmit")}),100),void 0!==e&&console.info('Added comment "'+e+'"')}},{key:"onCommentSubmitFail",value:function(){setTimeout((function(){be.wN("Comment submition failed","commentSubmitFail")}),100)}},{key:"onCommentDelete",value:function(e){this.onCommentsLoad(),setTimeout((function(){be.wN("Comment removed","commentDelete")}),100),void 0!==e&&console.info('Removed comment "'+e+'"')}},{key:"onCommentDeleteFail",value:function(e){setTimeout((function(){be.wN("Comment removal failed","commentDeleteFail")}),100),void 0!==e&&console.info('Comment "'+e+'" removal failed')}},{key:"commentsContent",value:function(){var e,t=null;if(this.state.comments&&this.state.commentsLength)for(t=[],e=0;e<this.state.commentsLength;)t.push(a.createElement(Ae,{key:this.state.comments[e].uid,comment_id:this.state.comments[e].uid,media_id:this.state.mediaId,text:this.state.comments[e].text,author_name:this.state.comments[e].author_name,author_link:this.state.comments[e].author_profile,author_thumb:f.Z.get("config-site").url+"/"+this.state.comments[e].author_thumbnail_url.replace(/^\//g,""),publish_date:this.state.comments[e].add_date,likes:0,dislikes:0})),e+=1;return t}},{key:"render",value:function(){return a.createElement("div",{className:"comments-list"},a.createElement("div",{className:"comments-list-inner"},!f.Z.get("config-user").can.readComment||d.Z.get("media-data").enable_comments?null:a.createElement("span",{className:"disabled-comments-msg"},"Comments are disabled"),f.Z.get("config-user").can.readComment&&(d.Z.get("media-data").enable_comments||f.Z.get("config-user").can.editMedia)?a.createElement("h2",null,this.state.commentsLength?1<this.state.commentsLength?this.state.commentsLength+" Comments":this.state.commentsLength+" "+je:d.Z.get("media-data").enable_comments?"No comment yet":""):null,f.Z.get("config-user").can.addComment&&d.Z.get("media-data").enable_comments?a.createElement(Ie,{media_id:this.state.mediaId}):null,f.Z.get("config-user").can.readComment&&(d.Z.get("media-data").enable_comments||f.Z.get("config-user").can.editMedia)&&this.state.commentsLength&&this.state.comments&&this.state.commentsLength?this.commentsContent():null))}}]),n}(a.PureComponent),Ve=(a.PureComponent,n(1590)),Ue=n.n(Ve),We=n(4860),He=n(8420);function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Be(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function qe(e,t){return(qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ge(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ye(e){return(Ye=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ke=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qe(e,t)}(r,e);var t,n,i,o,a=(i=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ye(i);if(o){var n=Ye(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ge(this,e)});function r(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(e=a.call(this)).browserCache=new We.Z(f.Z.get("config-site").id,86400),e.data={media_id:null,extendedRateCategories:e.browserCache.get("extended-rate-categories")},e.data.extendedRateCategories=null===e.data.extendedRateCategories?!f.Z.get("config-user").is.anonymous:!!e.data.extendedRateCategories,e}return t=r,(n=[{key:"requestRate",value:function(e,t){(0,He.j0)(f.Z.get("api-media")+"/"+this.data.media_id+"/actions",{type:"rate",extra_info:{score:t,category_id:e}},{headers:{"X-CSRFToken":(0,He.m5)()}},!1,this.succeedRateResponse.bind(this,e,t),this.failedRateResponse.bind(this,e,t))}},{key:"succeedRateResponse",value:function(e,t,n){this.emit("succeed_rate_submit["+e+"]",t)}},{key:"failedRateResponse",value:function(e,t,n){this.emit("failed_rate_submit["+e+"]",t)}},{key:"get",value:function(e){switch(e){case"extended-rate-categories":return this.data.extendedRateCategories}return null}},{key:"actions_handler",value:function(e){switch(e.type){case"INIT":this.data.media_id=e.media_id;break;case"EXTEND_RATE_CATEGORIES":this.data.extendedRateCategories=!this.data.extendedRateCategories,this.browserCache.set("extended-rate-categories",this.data.extendedRateCategories?1:0),this.emit("changed_rate_categories_visibility");break;case"RATE_SUBMIT":this.requestRate(e.id,e.score)}}}])&&Be(t.prototype,n),r}(Ue()),Xe=(0,He.v$)(new Ke,"actions_handler"),Je=n(5763);function $e(e){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function et(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tt(e,t,n){return t&&et(e.prototype,t),n&&et(e,n),e}function nt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&it(e,t)}function it(e,t){return(it=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=st(e);if(t){var o=st(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return at(this,n)}}function at(e,t){return!t||"object"!==$e(t)&&"function"!=typeof t?rt(e):t}function rt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lt=function(e){nt(n,e);var t=ot(n);function n(e){var i;return Qe(this,n),(i=t.call(this,e)).initialScore=e.score,i.state={score:e.score,initialScore:e.score,submitingScore:!1,message:null},i.submitRate=i.submitRate.bind(rt(i)),i.closeRateMessage=i.closeRateMessage.bind(rt(i)),i.onSucceedRateSubmit=i.onSucceedRateSubmit.bind(rt(i)),i.onFailedRateSubmit=i.onFailedRateSubmit.bind(rt(i)),Xe.on("succeed_rate_submit["+e.id+"]",i.onSucceedRateSubmit),Xe.on("failed_rate_submit["+e.id+"]",i.onFailedRateSubmit),i}return tt(n,[{key:"closeRateMessage",value:function(){this.setState({message:null})}},{key:"onSucceedRateSubmit",value:function(e){this.setState({initialScore:e,submitingScore:!1,message:'Thank you for your rating in category of "<strong>'+this.props.title+'</strong>".'})}},{key:"onFailedRateSubmit",value:function(e){this.setState({submitingScore:!1,message:'A problem has occurred when submitting your score for the category of "<strong>'+this.props.title+'</strong>". Please try again.'})}},{key:"onButtonClick",value:function(e){this.setState({score:e})}},{key:"submitRate",value:function(){this.setState({submitingScore:!0},(function(){var e,t;e=this.props.id,t=this.state.score,Y().dispatch({type:"RATE_SUBMIT",id:e,score:t})}))}},{key:"stars",value:function(){for(var e=[],t=1;t<6;)e.push(a.createElement("div",{key:t,className:(t<=this.state.score?"active":"")+(t===this.state.score?" selected":"")},a.createElement(ve.Z,{onClick:this.onButtonClick.bind(this,t)},a.createElement("i",{className:"material-icons"},"star_rate")))),t+=1;return e}},{key:"render",value:function(){return a.createElement("div",{className:"rating-category"+(this.state.submitingScore||null!==this.state.message?" submit-loading":"")},a.createElement("div",{className:"category-title"},this.props.title),a.createElement("div",{className:"stars"},this.stars()),a.createElement("div",{className:"rate-action"},a.createElement("button",{disabled:this.state.score===this.state.initialScore,onClick:this.state.score===this.state.initialScore?null:this.submitRate},"Submit score")),this.state.submitingScore?a.createElement("div",{className:"submit-loader"},a.createElement(Je.Z,null)):null,null!==this.state.message?a.createElement("div",{className:"submit-loader"},a.createElement("div",{className:"submit-msg"},a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.message}})),a.createElement(ve.Z,{className:"close-msg",onClick:this.closeRateMessage},a.createElement("i",{className:"material-icons"},"clear"))):null)}}]),n}(a.PureComponent);lt.propTypes={id:l().oneOfType([l().string,l().number]).isRequired,title:l().string.isRequired,score:l().number.isRequired};var ct=function(e){nt(n,e);var t=ot(n);function n(e){var i;return Qe(this,n),(i=t.call(this,e)).state={extended:Xe.get("extended-rate-categories")},i.onClickExtend=i.onClickExtend.bind(rt(i)),i.onRateCategoriesToggle=i.onRateCategoriesToggle.bind(rt(i)),Xe.on("changed_rate_categories_visibility",i.onRateCategoriesToggle),i}return tt(n,[{key:"componentDidMount",value:function(){var e;e=this.props.media_id,Y().dispatch({type:"INIT",media_id:e})}},{key:"onClickExtend",value:function(){Y().dispatch({type:"EXTEND_RATE_CATEGORIES"})}},{key:"onRateCategoriesToggle",value:function(){this.setState({extended:Xe.get("extended-rate-categories")})}},{key:"ratingCategories",value:function(){for(var e=[],t=0;t<this.props.ratings_data.length;)e.push(a.createElement(lt,{key:t,id:this.props.ratings_data[t].category_id,title:this.props.ratings_data[t].category_title,score:this.props.ratings_data[t].score})),t+=1;return e}},{key:"render",value:function(){var e;return f.Z.get("config-user").is.anonymous&&(e=window.location.href.replace(f.Z.get("config-site").url,"").replace(/^\//g,""),e=f.Z.get("url-signin")+"?next=/"+e),a.createElement("div",{className:"ratings-container"+(this.state.extended?" extended":"")},a.createElement("button",{className:"extend-rating-form",onClick:this.onClickExtend},"Rate the film ",a.createElement(ve.Z,{type:"span"},a.createElement("i",{className:"material-icons"},this.state.extended?"keyboard_arrow_up":"keyboard_arrow_down"))),a.createElement("div",{className:"rating-categories"},f.Z.get("is-logged-in")?this.ratingCategories():a.createElement("div",{className:"rating-category need-login"},a.createElement("div",{className:"category-title"},"Ιn order to be able to rate the film you need to be signed in"),a.createElement("div",{className:"rate-action"},a.createElement("a",{href:e,title:"Sign in"},"SIGN IN")))))}}]),n}(a.PureComponent);function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function pt(e,t){return(pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ft(e,t){return!t||"object"!==ut(t)&&"function"!=typeof t?mt(e):t}function mt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ht(e){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yt(e){var t,n,i=[];if(e.length)for(t=0,n=1<e.length?", ":"";t<e.length;)i[t]=a.createElement("div",{key:t},a.createElement("a",{href:e[t].url,title:e[t].title},e[t].title),t<e.length-1?n:""),t+=1;return i}ct.propTypes={media_id:l().string.isRequired,ratings_data:l().array.isRequired};var bt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pt(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ht(i);if(o){var n=ht(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ft(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={hasSummary:!1,isContentVisible:!0},t.summary=d.Z.get("media-summary"),null!==t.summary&&(t.summary=t.summary.trim(),""!==t.summary&&(t.state.hasSummary=!0,t.state.isContentVisible=!1)),t.description=e.description.trim(),t.productionCompanyContent=d.Z.get("media-production-company"),t.websiteContent=d.Z.get("media-website"),t.licenseContent=d.Z.get("media-license-info"),t.countriesContent=yt(d.Z.get("media-countries")),t.languagesContent=yt(d.Z.get("media-languages")),t.topicsContent=yt(d.Z.get("media-topics")),t.tagsContent=!f.Z.get("config-enabled").taxonomies.tags||f.Z.get("config-enabled").taxonomies.tags.enabled?yt(d.Z.get("media-tags")):[],f.Z.get("config-options").pages.media.categoriesWithTitle?t.categoriesContent=[]:t.categoriesContent=!f.Z.get("config-enabled").taxonomies.categories||f.Z.get("config-enabled").taxonomies.categories.enabled?yt(d.Z.get("media-categories")):[],f.Z.get("config-user").can.deleteMedia?(t.state.isOpenRemoveMediaPopup=!1,t.proceedMediaRemoval=t.proceedMediaRemoval.bind(mt(t)),t.cancelMediaRemoval=t.cancelMediaRemoval.bind(mt(t)),t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(mt(t)),t.removeMediaPopup=new ke.Z(a.createElement("button",{className:"remove-media"},"DELETE MEDIA"),a.createElement(Ee.W8,null,a.createElement("div",{className:"popup-message"},a.createElement("span",{className:"popup-message-title"},"Media removal"),a.createElement("span",{className:"popup-message-main"},"You're willing to remove media permanently?")),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("button",{className:"button-link cancel-comment-removal",onClick:t.cancelMediaRemoval},"CANCEL"),a.createElement("button",{className:"button-link proceed-comment-removal",onClick:t.proceedMediaRemoval},"PROCEED"))),t.onPopupsDisplayChange)):(t.proceedMediaRemoval=null,t.cancelMediaRemoval=null,t.onPopupsDisplayChange=null),t.onClickLoadMore=t.onClickLoadMore.bind(mt(t)),t.onMediaDelete=t.onMediaDelete.bind(mt(t)),t.onMediaDeleteFail=t.onMediaDeleteFail.bind(mt(t)),d.Z.on("media_delete",t.onMediaDelete),d.Z.on("media_delete_fail",t.onMediaDeleteFail),t}return t=s,(n=[{key:"onClickLoadMore",value:function(){this.setState({isContentVisible:!this.state.isContentVisible})}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenRemoveMediaPopup:this.removeMediaPopup.isPopupOpen()})}},{key:"cancelMediaRemoval",value:function(){this.removeMediaPopup.setOpenPopupState(!1)}},{key:"proceedMediaRemoval",value:function(){ie(),this.cancelMediaRemoval()}},{key:"onMediaDelete",value:function(e){setTimeout((function(){be.wN("Media removed. Redirecting...","mediaDelete"),setTimeout((function(){window.location.href=f.Z.get("config-site").url+"/"+d.Z.get("media-data").author_profile.replace(/^\//g,"")}),2e3)}),100),void 0!==e&&console.info("Removed media '"+e+'"')}},{key:"onMediaDeleteFail",value:function(e){setTimeout((function(){be.wN("Media removal failed","mediaDeleteFail")}),100),void 0!==e&&console.info('Media "'+e+'" removal failed')}},{key:"render",value:function(){var e=(0,y.U)(this.props.author.url,f.Z.get("config-site").url),t=(0,y.U)(this.props.author.thumb,f.Z.get("config-site").url),n=d.Z.get("media-data").ratings_info;return void 0!==n&&n.length||(n=null),a.createElement("div",{className:"media-info-content"},void 0===f.Z.get("config-media-item").displayAuthor||null===f.Z.get("config-media-item").displayAuthor||f.Z.get("config-media-item").displayAuthor?a.createElement("div",{className:"media-author-banner"},a.createElement("div",null,this.props.author&&this.props.author.thumb?a.createElement("a",{className:"author-banner-thumb",href:e||null,title:this.props.author.name},a.createElement("span",{style:{backgroundImage:"url("+t+")"}},a.createElement("img",{src:t,loading:"lazy",alt:this.props.author.name,title:this.props.author.name}))):null),a.createElement("div",null,this.props.author?a.createElement("span",null,a.createElement("a",{href:e||null,className:"author-banner-name",title:this.props.author.name},a.createElement("span",null,this.props.author.name))):null,f.Z.get("config-media-item").displayPublishDate&&this.props.published?a.createElement("span",{className:"author-banner-date"},"Published on ",(0,He.hm)(new Date(this.props.published))):null)):null,a.createElement("div",{className:"media-content-banner"+(null!==this.productionCompanyContent&&""!==this.productionCompanyContent?" large-fields-title":"")},a.createElement("div",{className:"media-content-banner-inner"},this.state.hasSummary?a.createElement("div",{className:"media-content-summary"},this.summary):null,this.state.hasSummary&&!this.state.isContentVisible||!this.description?null:f.Z.get("config-options").pages.media.htmlInDescription?a.createElement("div",{className:"media-content-description",dangerouslySetInnerHTML:{__html:this.description}}):a.createElement("div",{className:"media-content-description"},this.description),this.state.hasSummary?a.createElement("button",{className:"load-more",onClick:this.onClickLoadMore},this.state.isContentVisible?"SHOW LESS":"SHOW MORE"):null,this.languagesContent.length?a.createElement("div",{className:"media-content-languages"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,1<this.languagesContent.length?"Languages":"Language")),a.createElement("div",{className:"media-content-field-content"},this.languagesContent))):null,this.countriesContent.length?a.createElement("div",{className:"media-content-countries"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,1<this.countriesContent.length?"Countries":"Country")),a.createElement("div",{className:"media-content-field-content"},this.countriesContent))):null,this.topicsContent.length?a.createElement("div",{className:"media-content-topics"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,1<this.topicsContent.length?"Topics":"Topic")),a.createElement("div",{className:"media-content-field-content"},this.topicsContent))):null,this.tagsContent.length?a.createElement("div",{className:"media-content-categories"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,1<this.tagsContent.length?"Tags":"Tag")),a.createElement("div",{className:"media-content-field-content"},this.tagsContent))):null,this.categoriesContent.length?a.createElement("div",{className:"media-content-categories"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,1<this.categoriesContent.length?"Categories":"Category")),a.createElement("div",{className:"media-content-field-content"},this.categoriesContent))):null,null!==this.productionCompanyContent&&""!==this.productionCompanyContent?a.createElement("div",{className:"media-content-production-company"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,"Production company")),a.createElement("div",{className:"media-content-field-content"},this.productionCompanyContent))):null,null!==this.websiteContent&&""!==this.websiteContent?a.createElement("div",{className:"media-content-website"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,"Website")),a.createElement("div",{className:"media-content-field-content"},this.websiteContent))):null,d.Z.get("display-media-license-info")?a.createElement("div",{className:"media-content-license"},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,null!==this.licenseContent&&""!==this.licenseContent?"License":"Copyright")),a.createElement("div",{className:"media-content-field-content"},null!==this.licenseContent&&""!==this.licenseContent?a.createElement("a",{href:this.licenseContent.url,title:this.licenseContent.title,className:"media-license-link",target:"_blank",rel:"nofollow"},a.createElement("span",null,a.createElement("img",{src:this.licenseContent.thumbnail,alt:""})),a.createElement("span",null,this.licenseContent.title)):a.createElement("span",null,"All rights reserved.")))):null,f.Z.get("config-user").can.editMedia||f.Z.get("config-user").can.editSubtitle||f.Z.get("config-user").can.deleteMedia?a.createElement("div",{className:"media-author-actions"},f.Z.get("config-user").can.editMedia?a.createElement("a",{href:d.Z.get("media-data").edit_url,rel:"nofollow",title:"Edit media",className:"edit-media"},"EDIT MEDIA"):null,f.Z.get("config-user").can.editSubtitle&&"video"===d.Z.get("media-data").media_type?a.createElement("a",{href:d.Z.get("media-data").edit_url.replace("edit?","add_subtitle?"),rel:"nofollow",title:"Edit subtitle",className:"edit-subtitle"},"EDIT SUBTITLE"):null,f.Z.get("config-user").can.deleteMedia?this.removeMediaPopup.triggerComponent():null,f.Z.get("config-user").can.deleteMedia&&this.state.isOpenRemoveMediaPopup?this.removeMediaPopup.contentComponent():null):null)),null!==n?a.createElement(ct,{media_id:d.Z.get("media-id"),ratings_data:n}):null,a.createElement(Fe,null))}}])&&dt(t.prototype,n),s}(a.PureComponent);function gt(e){return(gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _t(e,t){return!t||"object"!==gt(t)&&"function"!=typeof t?kt(e):t}function kt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Pt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wt(e,t)}(l,e);var t,n,o,r,s=(o=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Et(o);if(r){var n=Et(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _t(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=s.call(this,e)).state={likesCounter:(0,He.uf)(d.Z.get("media-likes"),!1),isOpenLikesPopup:!1,likedMedia:d.Z.get("user-liked-media")},t.openLikeAction=!0,t.openLikeAction&&(t.toggleLike=t.toggleLike.bind(kt(t)),t.onCompleteMediaLike=t.onCompleteMediaLike.bind(kt(t)),t.onCompleteMediaUnlike=t.onCompleteMediaUnlike.bind(kt(t)),t.onFailMediaLikeRequest=t.onFailMediaLikeRequest.bind(kt(t))),t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(kt(t)),t.likesPopup=new ke.Z(a.createElement("button",{onClick:t.openLikeAction?t.toggleLike:null},a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"thumb_up"})),a.createElement("span",{className:"likes-counter"},t.state.likesCounter)),t.openLikeAction?null:a.createElement(Ee.W8,null,a.createElement("div",{className:"popup-message"},a.createElement("span",{className:"popup-message-title"},"Like this media?"),a.createElement("span",{className:"popup-message-main"},"Sign in to make your opinion count.")),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("a",{href:f.Z.get("url-signin"),className:"button-link sign-in",title:"Sign in"},"SIGN IN"))),t.openLikeAction?null:t.onPopupsDisplayChange),t}return t=l,(n=[{key:"componentDidMount",value:function(){d.Z.on("liked_media",this.onCompleteMediaLike),d.Z.on("unliked_media",this.onCompleteMediaUnlike),d.Z.on("liked_media_failed_request",this.onFailMediaLikeRequest)}},{key:"updateStateValues",value:function(){this.setState({likesCounter:(0,He.uf)(d.Z.get("media-likes"),!1),likedMedia:d.Z.get("user-liked-media")},(function(){this.refs.LikeWrap.querySelector(".likes-counter").innerHTML=this.state.likesCounter}))}},{key:"toggleLike",value:function(e){e.preventDefault(),e.stopPropagation(),i[this.state.likedMedia?"unlikeMedia":"likeMedia"]()}},{key:"toggleDislike",value:function(e){e.preventDefault(),e.stopPropagation(),i[this.state.dislikedMedia?"undislikeMedia":"dislikeMedia"]()}},{key:"onCompleteMediaUnlike",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Removed from Liked media","unlikedMedia")}.bind(this),100)}},{key:"onCompleteMediaLike",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Added to Liked media","likedMedia")}.bind(this),100)}},{key:"onFailMediaLikeRequest",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Media (like) action's request failed","likedMediaRequestFail")}.bind(this),100)}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenLikesPopup:this.likesPopup.isPopupOpen()})}},{key:"render",value:function(){return a.createElement("div",{ref:"LikeWrap",className:"like"},this.likesPopup.triggerComponent(),this.state.isOpenLikesPopup?this.likesPopup.contentComponent():null)}}])&&vt(t.prototype,n),l}(a.PureComponent);function Ct(e){return(Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ot(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function St(e,t){return(St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e,t){return!t||"object"!==Ct(t)&&"function"!=typeof t?Mt(e):t}function Mt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dt(e){return(Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&St(e,t)}(l,e);var t,n,o,r,s=(o=l,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dt(o);if(r){var n=Dt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Rt(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=s.call(this,e)).state={dislikesCounter:(0,He.uf)(d.Z.get("media-dislikes"),!1),isOpenDislikesPopup:!1,dislikedMedia:d.Z.get("user-disliked-media")},t.openDislikeAction=f.Z.get("is-logged-in"),t.openDislikeAction=!0,t.openDislikeAction&&(t.toggleDislike=t.toggleDislike.bind(Mt(t)),t.onCompleteMediaDislike=t.onCompleteMediaDislike.bind(Mt(t)),t.onCompleteMediaUndislike=t.onCompleteMediaUndislike.bind(Mt(t)),t.onFailMediaDislikeRequest=t.onFailMediaDislikeRequest.bind(Mt(t))),t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(Mt(t)),t.dislikesPopup=t.dislikesPopup||new ke.Z(a.createElement("button",{onClick:t.openDislikeAction?t.toggleDislike:null},a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"thumb_down"})),a.createElement("span",{className:"dislikes-counter"},t.state.dislikesCounter)),t.openDislikeAction?null:a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-message-title"},"Don't like this media?"),a.createElement("span",{className:"popup-message-main"},"Sign in to make your opinion count."),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("a",{href:f.Z.get("url-signin"),className:"button-link sign-in",title:"Sign in"},"SIGN IN"))),t.openDislikeAction?null:t.onPopupsDisplayChange),t}return t=l,(n=[{key:"componentDidMount",value:function(){d.Z.on("disliked_media",this.onCompleteMediaDislike),d.Z.on("undisliked_media",this.onCompleteMediaUndislike),d.Z.on("disliked_media_failed_request",this.onFailMediaDislikeRequest)}},{key:"updateStateValues",value:function(){this.setState({dislikesCounter:(0,He.uf)(d.Z.get("media-dislikes"),!1),dislikedMedia:d.Z.get("user-disliked-media")},(function(){this.refs.DislikeWrap.querySelector(".dislikes-counter").innerHTML=this.state.dislikesCounter}))}},{key:"toggleDislike",value:function(e){e.preventDefault(),e.stopPropagation(),i[this.state.dislikedMedia?"undislikeMedia":"dislikeMedia"]()}},{key:"toggleDislike",value:function(e){e.preventDefault(),e.stopPropagation(),i[this.state.dislikedMedia?"undislikeMedia":"dislikeMedia"]()}},{key:"onCompleteMediaDislike",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Added to Disliked media","dislikedMedia")}.bind(this),100)}},{key:"onCompleteMediaUndislike",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Removed from Disliked media","undislikedMedia")}.bind(this),100)}},{key:"onFailMediaDislikeRequest",value:function(){setTimeout(function(){this.updateStateValues(),be.wN("Media (dislike) action's request failed","dislikedMediaRequestFail")}.bind(this),100)}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenDislikesPopup:this.dislikesPopup.isPopupOpen()})}},{key:"render",value:function(){return a.createElement("div",{ref:"DislikeWrap",className:"dislike"},this.dislikesPopup.triggerComponent(),this.state.isOpenDislikesPopup?this.dislikesPopup.contentComponent():null)}}])&&Ot(t.prototype,n),l}(a.PureComponent);function Zt(e){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function jt(e,t){return(jt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lt(e,t){return!t||"object"!==Zt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function It(e){return(It=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(9808);var At=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jt(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=It(i);if(o){var n=It(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Lt(this,e)});function s(){return xt(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"download hidden-only-in-small"},a.createElement("a",{href:this.props.link,target:"_blank",download:this.props.title,title:"Download"},a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"arrow_downward"})),a.createElement("span",null,"DOWNLOAD")))}}])&&Tt(t.prototype,n),s}(a.PureComponent);At.propTypes={link:l().string.isRequired,title:l().string.isRequired},n(9751),n(9628);var Ft=n(6912),Vt=n(3562);function Ut(e){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ht(e,t){return(Ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zt(e,t){return!t||"object"!==Ut(t)&&"function"!=typeof t?Bt(e):t}function Bt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qt(e){return(qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ht(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qt(i);if(o){var n=qt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zt(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=r.call(this,e);var n,i,o=d.Z.get("media-data"),l=o.encodings_info;for(n in t.state={isOpenDownloadOptionsMenu:!1,downloadOptionsCurrentPage:"main"},t.title=o.title,t.downloadOptionsList={},l)if(l.hasOwnProperty(n)&&Object.keys(l[n]).length)for(i in l[n])l[n].hasOwnProperty(i)&&"success"===l[n][i].status&&100===l[n][i].progress&&(t.downloadOptionsList[l[n][i].title]={text:n+" - "+i.toUpperCase()+" ("+l[n][i].size+")",link:(0,y.U)(l[n][i].url,f.Z.get("config-site").url),linkAttr:{target:"_blank",download:o.title+"_"+n+"_"+i.toUpperCase()}});return t.downloadOptionsList.original_media_url={text:"Original file ("+o.size+")",link:(0,y.U)(o.original_media_url,f.Z.get("config-site").url),linkAttr:{target:"_blank",download:o.title}},t.downloadOptionsPages={main:a.createElement("div",{className:"main-options"},a.createElement(Ee.W8,null,a.createElement(Ft.Z,{items:Object.values(t.downloadOptionsList)})))},t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(Bt(t)),t.initDownloadsPopup(),t}return t=s,(n=[{key:"initDownloadsPopup",value:function(){this.downloadsPopup=Object.keys(this.downloadOptionsPages).length?new ke.Z(a.createElement("button",null,a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"arrow_downward"})),a.createElement("span",null,"DOWNLOAD")),a.createElement(Vt.o,{pageChangeCallback:null,initPage:"main",focusFirstItemOnPageChange:!1,pages:this.downloadOptionsPages,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}),this.onPopupsDisplayChange):null}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenDownloadOptionsMenu:this.downloadsPopup.isPopupOpen(),downloadOptionsCurrentPage:this.downloadsPopup.isPopupOpen()?this.state.downloadOptionsCurrentPage:"main"})}},{key:"render",value:function(){return a.createElement("div",{className:"video-downloads hidden-only-in-small"},this.downloadsPopup.triggerComponent(),this.state.isOpenDownloadOptionsMenu?a.createElement("div",{className:"nav-page-"+this.state.downloadOptionsCurrentPage},this.downloadsPopup.contentComponent()):null)}}])&&Wt(t.prototype,n),s}(a.PureComponent);function Yt(e){return(Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(e,t){return!t||"object"!==Yt(t)&&"function"!=typeof t?$t(e):t}function $t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qt(e){return(Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(4559);var en={},tn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xt(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Qt(i);if(o){var n=Qt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Jt(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),e=r.call(this),en[Object.defineProperty($t(e),"id",{value:"PlaylistPageStoreData_"+Object.keys(en).length}).id]={playlistId:null,data:{}},e.data={savedPlaylist:!1,publishDate:new Date(2018,3,14,1,13,22,0),publishDateLabel:null},e.onPlaylistUpdateCompleted=e.onPlaylistUpdateCompleted.bind($t(e)),e.onPlaylistUpdateFailed=e.onPlaylistUpdateFailed.bind($t(e)),e.onPlaylistRemovalCompleted=e.onPlaylistRemovalCompleted.bind($t(e)),e.onPlaylistRemovalFailed=e.onPlaylistRemovalFailed.bind($t(e)),e}return t=s,(n=[{key:"loadData",value:function(){if(!en[this.id].playlistId)return console.warn("Invalid playlist id:",en[this.id].playlistId),!1;this.playlistAPIUrl=f.Z.get("api-playlists")+"/"+en[this.id].playlistId,this.dataResponse=this.dataResponse.bind(this),this.dataErrorResponse=this.dataErrorResponse.bind(this),(0,He.A_)(this.playlistAPIUrl,!1,this.dataResponse,this.dataErrorResponse)}},{key:"dataResponse",value:function(e){e&&e.data&&(en[this.id].data=e.data,this.emit("loaded_playlist_data"))}},{key:"dataErrorResponse",value:function(e){this.emit("loaded_playlist_error"),e.type}},{key:"get",value:function(e){switch(e){case"playlistId":return en[this.id].playlistId||null;case"logged-in-user-playlist":return!f.Z.get("config-user").is.anonymous&&en[this.id].data.user===f.Z.get("config-user").username;case"playlist-media":return en[this.id].data.playlist_media||[];case"visibility":return"public";case"visibility-icon":switch(this.get("visibility")){case"unlisted":return a.createElement("i",{className:"material-icons"},"insert_link");case"private":return a.createElement("i",{className:"material-icons"},"lock")}return null;case"total-items":return en[this.id].data.playlist_media.length||0;case"views-count":return"N/A";case"title":return en[this.id].data.title||null;case"edit-link":return"#";case"thumb":return en[this.id].data.playlist_media&&en[this.id].data.playlist_media.length?en[this.id].data.playlist_media[0].thumbnail_url:null;case"description":return en[this.id].data.description||null;case"author-username":case"author-name":return en[this.id].data.user||null;case"author-link":return en[this.id].data.user?f.Z.get("config-site").url+"/user/"+en[this.id].data.user:null;case"author-thumb":return en[this.id].data.user_thumbnail_url?f.Z.get("config-site").url+"/"+en[this.id].data.user_thumbnail_url.replace(/^\//g,""):null;case"saved-playlist":return this.data.savedPlaylist;case"date-label":return en[this.id].data&&en[this.id].data.add_date?(this.data.publishDateLabel=this.data.publishDateLabel||"Created on "+(0,He.hm)(new Date(en[this.id].data.add_date),3),this.data.publishDateLabel):null}return null}},{key:"onPlaylistUpdateCompleted",value:function(e){e&&e.data&&(en[this.id].data.title=e.data.title,en[this.id].data.description=e.data.description,this.emit("playlist_update_completed",e.data))}},{key:"onPlaylistUpdateFailed",value:function(){this.emit("playlist_update_failed")}},{key:"onPlaylistRemovalCompleted",value:function(e){e&&void 0!==e.status&&403!==e.status?this.emit("playlist_removal_completed",e):this.onPlaylistRemovalFailed()}},{key:"onPlaylistRemovalFailed",value:function(){this.emit("playlist_removal_failed")}},{key:"actions_handler",value:function(e){switch(e.type){case"LOAD_PLAYLIST_DATA":en[this.id].playlistId=window.MediaCMS.playlistId||((i=window.location.href.split("/")).length?i[i.length-1]:null),this.loadData();break;case"TOGGLE_SAVE":this.data.savedPlaylist=!this.data.savedPlaylist,this.emit("saved-updated");break;case"UPDATE_PLAYLIST":(0,He.j0)(this.playlistAPIUrl,{title:e.playlist_data.title,description:e.playlist_data.description},{headers:{"X-CSRFToken":(0,He.m5)()}},!1,this.onPlaylistUpdateCompleted,this.onPlaylistUpdateFailed);break;case"REMOVE_PLAYLIST":(0,He.Jl)(this.playlistAPIUrl,{headers:{"X-CSRFToken":(0,He.m5)()}},!1,this.onPlaylistRemovalCompleted,this.onPlaylistRemovalFailed);break;case"MEDIA_REMOVED_FROM_PLAYLIST":for(var t=[],n=0;n<en[this.id].data.playlist_media.length;)e.media_id!==en[this.id].data.playlist_media[n].url.split("=")[1]&&t.push(en[this.id].data.playlist_media[n]),n+=1;en[this.id].data.playlist_media=t,this.emit("removed_media_from_playlist")}var i}}])&&Kt(t.prototype,n),s}(Ue()),nn=(0,He.v$)(new tn,"actions_handler"),on=n(5971),an=n(8024);function rn(e){return(rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ln(e,t){return(ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(e,t){return!t||"object"!==rn(t)&&"function"!=typeof t?un(e):t}function un(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dn(e){return(dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ln(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dn(i);if(o){var n=dn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return cn(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={id:e.id||null,title:e.id?nn.get("title"):"",description:e.id?nn.get("description"):"",descriptionLineHeight:-1,selectedPrivacy:"public"},t.onChangeTitle=t.onChangeTitle.bind(un(t)),t.onChangeDescription=t.onChangeDescription.bind(un(t)),t.onFocusDescription=t.onFocusDescription.bind(un(t)),t.onBlurDescription=t.onBlurDescription.bind(un(t)),t.onCancelPlaylistCreation=t.onCancelPlaylistCreation.bind(un(t)),t.onClickPlaylistCreate=t.onClickPlaylistCreate.bind(un(t)),t.onChangePlaylistNameInput=t.onChangePlaylistNameInput.bind(un(t)),t.onFocusPlaylistNameInput=t.onFocusPlaylistNameInput.bind(un(t)),t.onBlurPlaylistNameInput=t.onBlurPlaylistNameInput.bind(un(t)),t.onPrivacyChoose=t.onPrivacyChoose.bind(un(t)),t.state.id||(t.playlistCreationCompleted=t.playlistCreationCompleted.bind(un(t)),t.playlistCreationFailed=t.playlistCreationFailed.bind(un(t)),d.Z.on("playlist_creation_completed",t.playlistCreationCompleted),d.Z.on("playlist_creation_failed",t.playlistCreationFailed)),t}return t=s,(n=[{key:"componentDidMount",value:function(){this.refs.playlistNameInput.focus()}},{key:"UNSAFE_componentWillMount",value:function(){this.state.id&&(this.state.title=nn.get("title"),this.state.description=nn.get("description"))}},{key:"componentWillUnmount",value:function(){this.state.id||(d.Z.removeListener("playlist_creation_completed",this.playlistCreationCompleted),d.Z.removeListener("playlist_creation_failed",this.playlistCreationFailed))}},{key:"onChangeTitle",value:function(){this.setState({title:this.refs.playlistNameInput.value})}},{key:"onChangeDescription",value:function(){this.refs.playlistDescriptionTextarea.style.height="";var e=this.refs.playlistDescriptionTextarea.scrollHeight-2,t=0<this.state.descriptionLineHeight?this.state.descriptionLineHeight:parseFloat(window.getComputedStyle(this.refs.playlistDescriptionTextarea).lineHeight);this.setState({description:this.refs.playlistDescriptionTextarea.value,descriptionLineHeight:t},(function(){this.refs.playlistDescriptionTextarea.style.height=3+Math.max(20,this.state.descriptionLineHeight*Math.ceil(e/t))+"px"}))}},{key:"onFocusDescription",value:function(){(0,an.Ec)(this.refs.playlistDescription,"focused")}},{key:"onBlurDescription",value:function(){(0,an.dt)(this.refs.playlistDescription,"focused")}},{key:"onClickPlaylistCreate",value:function(){var e=this.refs.playlistNameInput.value.trim();if(""!==e){var t=this.refs.playlistDescriptionTextarea.value.trim();this.state.id?on.CE({title:e,description:t}):re({title:e,description:t})}else(0,an.Ec)(this.refs.playlistName,"invalid")}},{key:"onChangePlaylistNameInput",value:function(){(0,an.dt)(this.refs.playlistName,"invalid")}},{key:"onFocusPlaylistNameInput",value:function(){(0,an.Ec)(this.refs.playlistName,"focused")}},{key:"onBlurPlaylistNameInput",value:function(){(0,an.dt)(this.refs.playlistName,"focused")}},{key:"onPrivacyChoose",value:function(e){this.setState({selectedPrivacy:e.currentTarget.value})}},{key:"playlistCreationCompleted",value:function(e){setTimeout(function(){be.wN("Playlist created","playlistCreationCompleted");var t,n,i={playlist_id:(t=e.url,n=t.split("/"),1<n.length?n[n.length-1]:null),add_date:e.add_date,description:e.description,title:e.title,media_list:[]};this.props.onPlaylistSave(i)}.bind(this),100)}},{key:"playlistCreationFailed",value:function(){setTimeout(function(){be.wN("Playlist creation failed","playlistCreationFailed")}.bind(this),100)}},{key:"onCancelPlaylistCreation",value:function(){this.props.onCancel()}},{key:"render",value:function(){return a.createElement("div",{className:"playlist-form-wrap"},a.createElement("div",{className:"playlist-form-field playlist-title",ref:"playlistName"},a.createElement("span",{className:"playlist-form-label"},"Title"),a.createElement("input",{ref:"playlistNameInput",type:"text",placeholder:"Enter playlist title...",value:this.state.title,onChange:this.onChangeTitle,onFocus:this.onFocusPlaylistNameInput,onBlur:this.onBlurPlaylistNameInput,onClick:this.onChangePlaylistNameInput})),a.createElement("div",{className:"playlist-form-field playlist-description",ref:"playlistDescription"},a.createElement("span",{className:"playlist-form-label"},"Description"),a.createElement("textarea",{ref:"playlistDescriptionTextarea",rows:"1",placeholder:"Enter playlist description...",value:this.state.description,onChange:this.onChangeDescription,onFocus:this.onFocusDescription,onBlur:this.onBlurDescription})),a.createElement("div",{className:"playlist-form-actions"},a.createElement("button",{className:"cancel-btn",onClick:this.onCancelPlaylistCreation},"CANCEL"),a.createElement("button",{className:"create-btn",onClick:this.onClickPlaylistCreate},this.state.id?"UPDATE":"CREATE")))}}])&&sn(t.prototype,n),s}(a.PureComponent);function fn(e){return(fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function yn(e,t,n){return t&&hn(e.prototype,t),n&&hn(e,n),e}function bn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gn(e,t)}function gn(e,t){return(gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=kn(e);if(t){var o=kn(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return wn(this,n)}}function wn(e,t){return!t||"object"!==fn(t)&&"function"!=typeof t?_n(e):t}function _n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kn(e){return(kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var En=function(e){bn(n,e);var t=vn(n);function n(e){var i;return mn(this,n),(i=t.call(this,e)).onChange=i.onChange.bind(_n(i)),i}return yn(n,[{key:"onChange",value:function(e){e.persist(),this.props.isChecked?le(this.props.playlistId,d.Z.get("media-id")):se(this.props.playlistId,d.Z.get("media-id"))}},{key:"render",value:function(){return this.props.renderDate?a.createElement("label",null,a.createElement("input",{type:"checkbox",checked:this.props.isChecked,onChange:this.onChange}),a.createElement("span",null,this.props.title)):null}}]),n}(a.PureComponent);En.propTypes={playlistId:l().string,isChecked:l().bool,title:l().string},En.defaultProps={isChecked:!1,title:""};var Pn=function(e){bn(n,e);var t=vn(n);function n(e){var i;return mn(this,n),(i=t.call(this,e)).state={date:new Date,playlists:d.Z.get("playlists"),openCreatePlaylist:!1},i.onWindowResize=i.onWindowResize.bind(_n(i)),i.onClickExit=i.onClickExit.bind(_n(i)),i.togglePlaylistCreationForm=i.togglePlaylistCreationForm.bind(_n(i)),i.onLoadPlaylists=i.onLoadPlaylists.bind(_n(i)),i.onPlaylistMediaAdditionComplete=i.onPlaylistMediaAdditionComplete.bind(_n(i)),i.onPlaylistMediaAdditionFail=i.onPlaylistMediaAdditionFail.bind(_n(i)),i.onPlaylistMediaRemovalComplete=i.onPlaylistMediaRemovalComplete.bind(_n(i)),i.onPlaylistMediaRemovalFail=i.onPlaylistMediaRemovalFail.bind(_n(i)),i.onPlaylistCreation=i.onPlaylistCreation.bind(_n(i)),i}return yn(n,[{key:"componentDidMount",value:function(){f.Z.on("window_resize",this.onWindowResize),d.Z.on("playlists_load",this.onLoadPlaylists),d.Z.on("media_playlist_addition_completed",this.onPlaylistMediaAdditionComplete),d.Z.on("media_playlist_addition_failed",this.onPlaylistMediaAdditionFail),d.Z.on("media_playlist_removal_completed",this.onPlaylistMediaRemovalComplete),d.Z.on("media_playlist_removal_failed",this.onPlaylistMediaRemovalFail),this.updateSavetoSelectMaxHeight()}},{key:"componentWillUnmount",value:function(){f.Z.removeListener("window_resize",this.onWindowResize),d.Z.removeListener("playlists_load",this.onLoadPlaylists),d.Z.removeListener("media_playlist_addition_completed",this.onPlaylistMediaAdditionComplete),d.Z.removeListener("media_playlist_addition_failed",this.onPlaylistMediaAdditionFail),d.Z.removeListener("media_playlist_removal_completed",this.onPlaylistMediaRemovalComplete),d.Z.removeListener("media_playlist_removal_failed",this.onPlaylistMediaRemovalFail)}},{key:"onLoadPlaylists",value:function(){this.setState({date:new Date,playlists:d.Z.get("playlists")})}},{key:"onPlaylistCreation",value:function(e){ce(e),this.togglePlaylistCreationForm()}},{key:"updateSavetoSelectMaxHeight",value:function(){void 0!==this.refs.savetoSelect&&(this.refs.savetoSelect.style.maxHeight=window.innerHeight-74-(this.refs.savetoPopup.offsetHeight-this.refs.savetoSelect.offsetHeight)+"px")}},{key:"onWindowResize",value:function(){this.updateSavetoSelectMaxHeight()}},{key:"onClickExit",value:function(){var e=this;this.setState({openCreatePlaylist:!1},(function(){e.props.triggerPopupClose instanceof Function&&e.props.triggerPopupClose()}))}},{key:"togglePlaylistCreationForm",value:function(){this.setState({openCreatePlaylist:!this.state.openCreatePlaylist},(function(){this.updateSavetoSelectMaxHeight()}))}},{key:"onPlaylistMediaAdditionComplete",value:function(){this.setState({date:new Date,playlists:d.Z.get("playlists")},(function(){setTimeout((function(){be.wN("Media added to playlist","playlistMediaAdditionComplete")}),100)}))}},{key:"onPlaylistMediaAdditionFail",value:function(){setTimeout((function(){be.wN("Media's addition to playlist failed","playlistMediaAdditionFail")}),100)}},{key:"onPlaylistMediaRemovalComplete",value:function(){this.setState({date:new Date,playlists:d.Z.get("playlists")},(function(){setTimeout((function(){be.wN("Media removed from playlist","playlistMediaRemovalComplete")}),100)}))}},{key:"onPlaylistMediaRemovalFail",value:function(){setTimeout((function(){be.wN("Media's removal from playlist failed","playlistMediaaRemovalFail")}),100)}},{key:"getCreatedPlaylists",value:function(){for(var e=d.Z.get("media-id"),t=[],n=0;n<this.state.playlists.length;)t.push(a.createElement("div",{key:"playlist_"+this.state.playlists[n].playlist_id},a.createElement(En,{renderDate:this.state.date,title:this.state.playlists[n].title,privacy:this.state.playlists[n].status,isChecked:-1<this.state.playlists[n].media_list.indexOf(e),playlistId:this.state.playlists[n].playlist_id}))),n+=1;return t}},{key:"render",value:function(){return a.createElement("div",{ref:"savetoPopup",className:"saveto-popup"},a.createElement("div",{className:"saveto-title"},"Save to...",a.createElement(ve.Z,{type:"button",onClick:this.onClickExit},a.createElement(ge.Z,{type:"close"}))),this.state.playlists.length?a.createElement("div",{ref:"savetoSelect",className:"saveto-select"},this.getCreatedPlaylists()):null,this.state.openCreatePlaylist?a.createElement("div",{className:"saveto-new-playlist"},a.createElement(pn,{onCancel:this.togglePlaylistCreationForm,onPlaylistSave:this.onPlaylistCreation})):a.createElement(ve.Z,{className:"saveto-create",type:"button",onClick:this.togglePlaylistCreationForm},a.createElement(ge.Z,{type:"add"}),"Create a new playlist"))}}]),n}(a.PureComponent);function Cn(e){return(Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function On(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Sn(e,t){return(Sn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rn(e,t){return!t||"object"!==Cn(t)&&"function"!=typeof t?Mn(e):t}function Mn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dn(e){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sn(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dn(i);if(o){var n=Dn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Rn(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={isOpenPopup:!1,popupCurrentPage:"selectPlaylist"},t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(Mn(t)),t.onPopupPageChange=t.onPopupPageChange.bind(Mn(t)),t.triggerPopupClose=t.triggerPopupClose.bind(Mn(t));var n={selectPlaylist:a.createElement("div",{className:"popup-fullscreen"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Pn,{triggerPopupClose:t.triggerPopupClose}))),createPlaylist:a.createElement("div",{className:"popup-fullscreen"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"})))};return t.sharePopup=new ke.Z(a.createElement("button",null,a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"playlist_add"})),a.createElement("span",null,"SAVE")),a.createElement(Vt.o,{initPage:t.state.popupCurrentPage,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:n,focusFirstItemOnPageChange:!1,pageChangeCallback:t.onPopupPageChange}),t.onPopupsDisplayChange),t}return t=s,(n=[{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenPopup:this.sharePopup.isPopupOpen()})}},{key:"onPopupPageChange",value:function(e){this.setState({popupCurrentPage:e})}},{key:"triggerPopupClose",value:function(){this.sharePopup.setOpenPopupState(!1)}},{key:"render",value:function(){return a.createElement("div",{className:"save"},this.sharePopup.triggerComponent(),this.state.isOpenPopup?this.sharePopup.contentComponent():null)}}])&&On(t.prototype,n),s}(a.PureComponent),Zn=n(1395);function xn(e){return(xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function jn(e,t){return(jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ln(e,t){return!t||"object"!==xn(t)&&"function"!=typeof t?In(e):t}function In(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function An(e){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jn(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=An(i);if(o){var n=An(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ln(this,e)});function s(e){var t,n,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={displayNext:!1,displayPrev:!1,maxFormContentHeight:f.Z.get("window-inner-height")-196,maxPopupWidth:518>f.Z.get("window-inner-width")-80?f.Z.get("window-inner-width")-80:null},t.onClickCopyMediaLink=t.onClickCopyMediaLink.bind(In(t)),t.onCompleteCopyMediaLink=t.onCompleteCopyMediaLink.bind(In(t)),t.inlineSlider=null,t.nextSlide=t.nextSlide.bind(In(t)),t.prevSlide=t.prevSlide.bind(In(t)),t.previousBtn=a.createElement("span",{className:"previous-slide"},a.createElement(ve.Z,{buttonShadow:!0,onClick:t.prevSlide},a.createElement("i",{className:"material-icons"},"keyboard_arrow_left"))),t.nextBtn=a.createElement("span",{className:"next-slide"},a.createElement(ve.Z,{buttonShadow:!0,onClick:t.nextSlide},a.createElement("i",{className:"material-icons"},"keyboard_arrow_right")));var o=d.Z.get("media-url"),l=d.Z.get("media-data").title,c=f.Z.get("config-media-share").options,u={};for(i=0;i<c.length;){switch(c[i]){case"embed":"video"===d.Z.get("media-data").media_type&&(u[c[i]]={});break;case"email":u[c[i]]={title:"Email",shareUrl:"mailto:?body="+d.Z.get("media-url")};break;case"fb":u[c[i]]={title:"Facebook",shareUrl:"https://www.facebook.com/sharer.php?u="+o};break;case"tw":u[c[i]]={title:"Twitter",shareUrl:"https://twitter.com/intent/tweet?url="+o};break;case"reddit":u[c[i]]={title:"reddit",shareUrl:"https://reddit.com/submit?url="+o+"&title="+l};break;case"tumblr":u[c[i]]={title:"Tumblr",shareUrl:"https://www.tumblr.com/widgets/share/tool?canonicalUrl="+o+"&title="+l};break;case"pinterest":u[c[i]]={title:"Pinterest",shareUrl:"http://pinterest.com/pin/create/link/?url="+o};break;case"vk":u[c[i]]={title:"ВКонтакте",shareUrl:"http://vk.com/share.php?url="+o+"&title="+l};break;case"linkedin":u[c[i]]={title:"LinkedIn",shareUrl:"https://www.linkedin.com/shareArticle?mini=true&url="+o};break;case"mix":u[c[i]]={title:"Mix",shareUrl:"https://mix.com/add?url="+o};break;case"whatsapp":u[c[i]]={title:"WhatsApp",shareUrl:"whatsapp://send?text="+o};break;case"telegram":u[c[i]]={title:"Telegram",shareUrl:"https://t.me/share/url?url="+o+"&text="+l}}i+=1}for(n in c)c.hasOwnProperty(n);for(n in t.shareOptionsElems=[],u)u.hasOwnProperty(n)&&("embed"===n?t.shareOptionsElems.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n+"-opt"},a.createElement("button",{className:"sh-option change-page","data-page-id":"shareEmbed"},a.createElement("span",null,a.createElement("i",{className:"material-icons"},"code")),a.createElement("span",null,"Embed")))):"whatsapp"===n?t.shareOptionsElems.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n},a.createElement("a",{href:u[n].shareUrl,title:"",target:"_blank","data-action":"share/whatsapp/share"},a.createElement("span",null),a.createElement("span",null,u[n].title)))):"email"===n?t.shareOptionsElems.push(a.createElement("div",{key:"share-email",className:"sh-option share-email"},a.createElement("a",{href:u[n].shareUrl,title:""},a.createElement("span",null,a.createElement("i",{className:"material-icons"},"email")),a.createElement("span",null,u[n].title)))):t.shareOptionsElems.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n},a.createElement("a",{href:u[n].shareUrl,title:"",target:"_blank"},a.createElement("span",null),a.createElement("span",null,u[n].title)))));return t.onWindowResize=t.onWindowResize.bind(In(t)),t}return t=s,(n=[{key:"componentDidMount",value:function(){this.enableEvents(),this.updateSlider()}},{key:"componentDidUpdate",value:function(){this.updateSlider()}},{key:"componentWillUnmount",value:function(){this.disableEvents(),this.inlineSlider=null}},{key:"onWindowResize",value:function(){this.setState({maxFormContentHeight:f.Z.get("window-inner-height")-212,maxPopupWidth:518>f.Z.get("window-inner-width")-80?f.Z.get("window-inner-width")-80:null},this.updateSlider)}},{key:"updateSlider",value:function(e){if(!this.inlineSlider){var t=this.refs.MediaShareOptionsContent.querySelector(".share-options-inner");t&&(this.inlineSlider=new Zn.Z(t,".sh-option"))}this.inlineSlider&&(this.inlineSlider.updateDataState(this.shareOptionsElems.length,!0,!0),this.updateSliderButtonsView())}},{key:"nextSlide",value:function(){this.inlineSlider.nextSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}},{key:"prevSlide",value:function(){this.inlineSlider.previousSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}},{key:"updateSliderButtonsView",value:function(){this.setState({displayPrev:this.inlineSlider.hasPreviousSlide(),displayNext:this.inlineSlider.hasNextSlide()})}},{key:"enableEvents",value:function(){f.Z.on("window_resize",this.onWindowResize),d.Z.on("copied_media_link",this.onCompleteCopyMediaLink)}},{key:"disableEvents",value:function(){f.Z.removeListener("window_resize",this.onWindowResize),d.Z.removeListener("copied_media_link",this.onCompleteCopyMediaLink)}},{key:"onClickCopyMediaLink",value:function(){te(this.refs.MediaShareOptionsContent.querySelector(".copy-field input"))}},{key:"onCompleteCopyMediaLink",value:function(){setTimeout(function(){be.wN("Link copied to clipboard","clipboardLinkCopy")}.bind(this),100)}},{key:"render",value:function(){return a.createElement("div",{ref:"MediaShareOptionsContent",style:null!==this.state.maxPopupWidth?{maxWidth:this.state.maxPopupWidth+"px"}:null},a.createElement("div",{className:"scrollable-content",style:null!==this.state.maxFormContentHeight?{maxHeight:this.state.maxFormContentHeight+"px"}:null},a.createElement("div",{className:"share-popup-title"},"Share media"),a.createElement("div",{ref:"ShareOptions",className:"share-options"},this.state.displayPrev?this.previousBtn:null,a.createElement("div",{className:"share-options-inner"},this.shareOptionsElems),this.state.displayNext?this.nextBtn:null)),a.createElement("div",{className:"copy-field"},a.createElement("div",null,a.createElement("input",{type:"text",readOnly:!0,value:d.Z.get("media-url")}),a.createElement("button",{onClick:this.onClickCopyMediaLink},"COPY"))))}}])&&Tn(t.prototype,n),s}(a.PureComponent);function Vn(e){return(Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Wn(e,t){return(Wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hn(e,t){return!t||"object"!==Vn(t)&&"function"!=typeof t?zn(e):t}function zn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bn(e){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wn(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bn(i);if(o){var n=Bn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hn(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={isOpenPopup:!1,popupCurrentPage:"shareOptions"},t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(zn(t)),t.onPopupPageChange=t.onPopupPageChange.bind(zn(t)),t.triggerPopupClose=t.triggerPopupClose.bind(zn(t));var n={shareOptions:a.createElement("div",{className:"popup-fullscreen"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Fn,null)))};return t.sharePopup=new ke.Z(a.createElement("button",null,a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"share"})),a.createElement("span",null,"SHARE")),a.createElement(Vt.o,{initPage:t.state.popupCurrentPage,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:n,focusFirstItemOnPageChange:!1,pageChangeCallback:t.onPopupPageChange}),t.onPopupsDisplayChange),t}return t=s,(n=[{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenPopup:this.sharePopup.isPopupOpen()})}},{key:"onPopupPageChange",value:function(e){this.setState({popupCurrentPage:e})}},{key:"triggerPopupClose",value:function(){this.sharePopup.setOpenPopupState(!1)}},{key:"render",value:function(){return a.createElement("div",{className:"share"},this.sharePopup.triggerComponent(),this.state.isOpenPopup?this.sharePopup.contentComponent():null)}}])&&Un(t.prototype,n),s}(a.PureComponent);function Gn(e){return(Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Kn(e,t){return(Kn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xn(e,t){return!t||"object"!==Gn(t)&&"function"!=typeof t?Jn(e):t}function Jn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Qn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kn(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$n(i);if(o){var n=$n(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Xn(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={maxFormContentHeight:null},t.cancelReportForm=t.cancelReportForm.bind(Jn(t)),t.submitReportForm=t.submitReportForm.bind(Jn(t)),t.onWindowResize=t.onWindowResize.bind(Jn(t)),t}return t=s,(n=[{key:"componentDidMount",value:function(){this.setState({maxFormContentHeight:f.Z.get("window-inner-height")-(104+this.refs.FormActionsBottom.offsetHeight)},(function(){f.Z.on("window_resize",this.onWindowResize)}))}},{key:"componentWillUnmount",value:function(){f.Z.removeListener("window_resize",this.onWindowResize)}},{key:"onWindowResize",value:function(){this.setState({maxFormContentHeight:f.Z.get("window-inner-height")-(104+this.refs.FormActionsBottom.offsetHeight)},(function(){}))}},{key:"cancelReportForm",value:function(e){e.stopPropagation(),e.preventDefault(),this.props.cancelReportForm instanceof Function&&this.props.cancelReportForm()}},{key:"submitReportForm",value:function(e){var t=this.refs.ReportDescription.value.trim();e.stopPropagation(),""!==t&&(e.preventDefault(),this.props.submitReportForm instanceof Function&&this.props.submitReportForm(t))}},{key:"render",value:function(){return a.createElement("form",null,a.createElement("div",{key:"report-form",className:"report-form",style:null!==this.state.maxFormContentHeight?{maxHeight:this.state.maxFormContentHeight+"px"}:null},a.createElement("div",{className:"form-title"},"Report media"),a.createElement("div",{className:"form-field"},a.createElement("span",{className:"label"},"URL"),a.createElement("input",{type:"text",readOnly:!0,value:this.props.mediaUrl})),a.createElement("div",{className:"form-field"},a.createElement("span",{className:"label"},"Description"),a.createElement("textarea",{ref:"ReportDescription",required:!0})),a.createElement("div",{className:"form-field form-help-text"},"Reported media is reviewed")),a.createElement("div",{ref:"FormActionsBottom",className:"form-actions-bottom"},a.createElement("button",{className:"cancel",onClick:this.cancelReportForm},"CANCEL"),a.createElement("button",{onClick:this.submitReportForm},"SUBMIT")))}}])&&Yn(t.prototype,n),s}(a.PureComponent);function ei(e){return(ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ti(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ni(e,t){return(ni=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ii(e,t){return!t||"object"!==ei(t)&&"function"!=typeof t?oi(e):t}function oi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ai(e){return(ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Qn.propTypes={mediaUrl:l().string.isRequired,cancelReportForm:l().func,submitReportForm:l().func};var ri=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ni(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ai(i);if(o){var n=ai(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ii(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={isOpenMoreOptionsMenu:!1,moreOptionsCurrentPage:"main"},t.settingOptionsList={},f.Z.get("config-user").can.reportMedia&&(t.settingOptionsList.reportMedia={itemType:"open-subpage",text:"Report",icon:"flag",buttonAttr:{className:"change-page"+(d.Z.get("media-data").reported_times?" loggedin-media-reported":""),"data-page-id":"loggedInReportMedia"}}),f.Z.get("config-user").can.editMedia&&(t.settingOptionsList.mediaStatus={itemType:"open-subpage",text:"Status info",icon:"info",buttonAttr:{className:"change-page","data-page-id":"mediaStatusInfo"}}),t.downloadLink=null;var n=d.Z.get("media-data"),i=n.encodings_info;t.props.allowDownload&&f.Z.get("config-user").can.downloadMedia&&("video"!==d.Z.get("media-type")?(t.downloadLink=(0,y.U)(d.Z.get("media-original-url"),f.Z.get("config-site").url),t.downloadLink&&(t.settingOptionsList.downloadOriginal={itemType:"link",link:t.downloadLink,text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},linkAttr:{target:"_blank",download:n.title}})):t.settingOptionsList.downloadOriginal={itemType:"open-subpage",text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},buttonAttr:{className:"change-page","data-page-id":"videoDownloadOptions"}});var o=[];if(void 0!==t.settingOptionsList.downloadOriginal&&o.push(t.settingOptionsList.downloadOriginal),void 0!==t.settingOptionsList.mediaStatus&&o.push(t.settingOptionsList.mediaStatus),void 0!==t.settingOptionsList.reportMedia&&o.push(t.settingOptionsList.reportMedia),t.moreOptionsPages=o.length?{main:a.createElement("div",{className:"main-options"},a.createElement(Ee.W8,null,a.createElement(Ft.Z,{key:"main",items:o})))}:{},t.onMoreOptionsPageChangeCallback=t.onMoreOptionsPageChangeCallback.bind(oi(t)),t.onCompleteMediaReport=t.onCompleteMediaReport.bind(oi(t)),t.cancelReportForm=t.cancelReportForm.bind(oi(t)),t.submitReportForm=t.submitReportForm.bind(oi(t)),f.Z.get("config-user").can.reportMedia&&(t.moreOptionsPages.loggedInReportMedia=a.createElement("div",{className:"popup-fullscreen"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement("div",null,a.createElement(Qn,{mediaUrl:d.Z.get("media-url"),submitReportForm:t.submitReportForm,cancelReportForm:t.cancelReportForm}))))),f.Z.get("config-user").can.editMedia&&(t.moreOptionsPages.mediaStatusInfo=a.createElement("div",{className:"main-options"},a.createElement(Ee.W8,null,a.createElement("ul",{className:"media-status-info"},a.createElement("li",null,"Media type: ",a.createElement("span",null,d.Z.get("media-data").media_type||"N/A")),a.createElement("li",null,"State: ",a.createElement("span",null,d.Z.get("media-data").state||"N/A")),a.createElement("li",null,"Review state: ",a.createElement("span",null,d.Z.get("media-data").is_reviewed?"Is reviewed":"Pending review")),"video"===d.Z.get("media-data").media_type?a.createElement("li",null,"Encoding Status: ",a.createElement("span",null,d.Z.get("media-data").encoding_status||"N/A")):null,0<d.Z.get("media-data").reported_times?a.createElement("li",{className:"reports"},"Reports: ",a.createElement("span",null,d.Z.get("media-data").reported_times)):null)))),t.props.allowDownload&&f.Z.get("config-user").can.downloadMedia&&"video"===d.Z.get("media-type")){var l,c,u={};for(l in i)if(i.hasOwnProperty(l)&&Object.keys(i[l]).length)for(c in i[l])i[l].hasOwnProperty(c)&&"success"===i[l][c].status&&100===i[l][c].progress&&(u[i[l][c].title]={text:l+" - "+c.toUpperCase()+" ("+i[l][c].size+")",link:(0,y.U)(i[l][c].url,f.Z.get("config-site").url),linkAttr:{target:"_blank",download:n.title+"_"+l+"_"+c.toUpperCase()}});u.original_media_url={text:"Original file ("+n.size+")",link:(0,y.U)(n.original_media_url,f.Z.get("config-site").url),linkAttr:{target:"_blank",download:n.title}},t.moreOptionsPages.videoDownloadOptions=a.createElement("div",{className:"video-download-options"},a.createElement(Ee.W8,null,a.createElement(Ft.Z,{key:"video-download-options",items:Object.values(u)})))}return t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(oi(t)),t.initMoreOptionsPopup(),t}return t=s,(n=[{key:"initMoreOptionsPopup",value:function(){this.moreOptionsPopup=Object.keys(this.moreOptionsPages).length?new ke.Z(a.createElement("span",null,a.createElement(ve.Z,{type:"button"},a.createElement(ge.Z,{type:"more_horiz"}))),a.createElement(Vt.o,{pageChangeCallback:this.onMoreOptionsPageChangeCallback,initPage:this.state.moreOptionsCurrentPage,focusFirstItemOnPageChange:!1,pages:this.moreOptionsPages,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}),this.onPopupsDisplayChange):null}},{key:"onMoreOptionsPageChangeCallback",value:function(e){this.setState({moreOptionsCurrentPage:e})}},{key:"componentDidMount",value:function(){this.moreOptionsPages&&d.Z.on("reported_media",this.onCompleteMediaReport)}},{key:"onCompleteMediaReport",value:function(){setTimeout(function(){this.moreOptionsPopup.setOpenPopupState(!1),be.wN("Media Reported","reportedMedia"),d.Z.off("reported_media",this.onCompleteMediaReport),this.moreOptionsPages.loggedInReportMedia=null,this.settingOptionsList.reportMedia.itemType="div",this.settingOptionsList.reportMedia.text="Reported",this.settingOptionsList.reportMedia.divAttr={className:"reported-label loggedin-media-reported"},this.initMoreOptionsPopup(),this.forceUpdate()}.bind(this),100)}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenMoreOptionsMenu:this.moreOptionsPopup.isPopupOpen(),moreOptionsCurrentPage:this.moreOptionsPopup.isPopupOpen()?this.state.moreOptionsCurrentPage:"main"})}},{key:"cancelReportForm",value:function(){this.moreOptionsPopup.setOpenPopupState(!1)}},{key:"submitReportForm",value:function(e){ee(e)}},{key:"render",value:function(){return this.moreOptionsPopup?a.createElement("div",{className:"more-options active-options"+(this.props.allowDownload&&f.Z.get("config-user").can.downloadMedia&&"videoDownloadOptions"===this.state.moreOptionsCurrentPage?" video-downloads":"")+(1===Object.keys(this.settingOptionsList).length&&void 0!==this.settingOptionsList.downloadOriginal?" visible-only-in-small":"")},this.moreOptionsPopup.triggerComponent(),this.state.isOpenMoreOptionsMenu?a.createElement("div",{className:"nav-page-"+this.state.moreOptionsCurrentPage},this.moreOptionsPopup.contentComponent()):null):null}}])&&ti(t.prototype,n),s}(a.PureComponent);function si(e){return(si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function li(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ci(e,t){return(ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ui(e,t){return!t||"object"!==si(t)&&"function"!=typeof t?di(e):t}function di(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pi(e){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ri.propTypes={allowDownload:l().bool.isRequired},ri.defaultProps={allowDownload:!1};var fi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ci(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pi(i);if(o){var n=pi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ui(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={likedMedia:d.Z.get("user-liked-media"),dislikedMedia:d.Z.get("user-disliked-media")},t.downloadLink="video"!==d.Z.get("media-type")?(0,y.U)(d.Z.get("media-original-url"),f.Z.get("config-site").url):null,t.updateStateValues=t.updateStateValues.bind(di(t)),t}return t=s,(n=[{key:"componentDidMount",value:function(){d.Z.on("liked_media",this.updateStateValues),d.Z.on("unliked_media",this.updateStateValues),d.Z.on("disliked_media",this.updateStateValues),d.Z.on("undisliked_media",this.updateStateValues)}},{key:"updateStateValues",value:function(){this.setState({likedMedia:d.Z.get("user-liked-media"),dislikedMedia:d.Z.get("user-disliked-media")})}},{key:"mediaCategories",value:function(e){if(void 0===this.props.categories||null===this.props.categories||!this.props.categories.length)return null;for(var t=0,n=[];t<this.props.categories.length;)n.push(a.createElement("span",{key:t},a.createElement("a",{href:(0,y.U)(this.props.categories[t].url,f.Z.get("config-site").url),title:this.props.categories[t].title},this.props.categories[t].title))),t+=1;return a.createElement("div",{className:"media-under-title-categories"+(e?" over-title":"")},n)}},{key:"render",value:function(){console.log(f.Z.get("config-playlists").mediaTypes.indexOf(d.Z.get("media-type")));var e=f.Z.get("config-options").pages.media.displayViews&&void 0!==this.props.views;return a.createElement("div",{className:"media-title-banner"},e&&f.Z.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?a.createElement("h1",null,this.props.title):null,"public"!==d.Z.get("media-data").state?a.createElement("div",{className:"media-labels-area"},a.createElement("span",null,d.Z.get("media-data").state)):null,a.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&f.Z.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?a.createElement("div",{className:"media-views"},(0,He.uf)(this.props.views,!0)," ",1>=this.props.views?"view":"views"):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,f.Z.get("config-user").can.likeMedia?a.createElement(Pt,null):null,f.Z.get("config-user").can.dislikeMedia?a.createElement(Nt,null):null,f.Z.get("config-user").can.shareMedia?a.createElement(qn,null):null,f.Z.get("config-user").can.saveMedia&&-1<f.Z.get("config-playlists").mediaTypes.indexOf(d.Z.get("media-type"))?a.createElement(Nn,null):null,this.props.allowDownload&&f.Z.get("config-user").can.downloadMedia?this.downloadLink?a.createElement(At,{link:this.downloadLink,title:this.props.title}):a.createElement(Gt,null):null,a.createElement(ri,{allowDownload:this.props.allowDownload})))))}}])&&li(t.prototype,n),s}(a.PureComponent);function mi(e){return(mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function yi(e,t){return(yi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bi(e,t){return!t||"object"!==mi(t)&&"function"!=typeof t?gi(e):t}function gi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vi(e){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}fi.propTypes={allowDownload:l().bool.isRequired},fi.defaultProps={allowDownload:!1};var wi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yi(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vi(i);if(o){var n=vi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return bi(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={videoLoaded:!1},t.onVideoLoad=t.onVideoLoad.bind(gi(t)),d.Z.on("loaded_media_data",t.onVideoLoad),t}return t=s,(n=[{key:"onVideoLoad",value:function(){this.setState({videoLoaded:!0})}},{key:"render",value:function(){var e,t,n,i,o,r,s=!1;return this.state.videoLoaded&&(s=void 0===(s=d.Z.get("media-data").allow_download)||!!s,e=d.Z.get("media-data").views,t=d.Z.get("media-data").categories_info,n=d.Z.get("media-data").title,i={name:d.Z.get("media-data").author_name,url:d.Z.get("media-data").author_profile,thumb:d.Z.get("media-author-thumbnail-url")},o=d.Z.get("media-data").add_date,r=d.Z.get("media-data").description),this.state.videoLoaded?a.createElement("div",{className:"viewer-info"},a.createElement("div",{className:"viewer-info-inner"},a.createElement(fi,{title:n,views:e,categories:t,allowDownload:s}),a.createElement(bt,{author:i,published:o,description:r}))):null}}])&&hi(t.prototype,n),s}(a.PureComponent);function _i(e){return(_i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ki(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ei(e,t){return(Ei=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pi(e,t){return!t||"object"!==_i(t)&&"function"!=typeof t?Ci(e):t}function Ci(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oi(e){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Si=n(3441);function Ri(e){return(Ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mi(Object(n),!0).forEach((function(t){Ni(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(e,t){return(xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ti(e,t){return!t||"object"!==Ri(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ji(e){return(ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Li=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xi(e,t)}(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=ji(t);if(n){var o=ji(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return Ti(this,e)});function o(){return Zi(this,o),i.apply(this,arguments)}return o}(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ei(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Oi(i);if(o){var n=Oi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Pi(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).onClickLoadMore=t.onClickLoadMore.bind(Ci(t)),t}return t=s,(n=[{key:"onClickLoadMore",value:function(){this.listHandler.loadItems()}},{key:"renderAfterListWrap",value:function(){return 1>this.listHandler.totalPages()||this.listHandler.loadedAllItems()?null:a.createElement("button",{className:"load-more",onClick:this.onClickLoadMore},"SHOW MORE")}}])&&ki(t.prototype,n),s}(Si.Y));function Ii(e){return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ai(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Fi(e,t){return(Fi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vi(e,t){return!t||"object"!==Ii(t)&&"function"!=typeof t?Ui(e):t}function Ui(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wi(e){return(Wi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Li.defaultProps=Di(Di({},Si.Y.defaultProps),{},{pageItems:24});var Hi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fi(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wi(i);if(o){var n=Wi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Vi(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=r.call(this,e);var n=d.Z.get("media-data");return t.state={item:void 0!==n&&n.related_media.length?n.related_media[0]:null,checkedAutoPlay:f.Z.get("media-auto-play")},d.Z.on("loaded_media_data",t.onMediaDataLoad.bind(Ui(t))),f.Z.on("switched_media_auto_play",t.onUpdateMediaAutoPlay.bind(Ui(t))),t.onCheckAutoPlay=t.onCheckAutoPlay.bind(Ui(t)),t.onKeyPress=t.onKeyPress.bind(Ui(t)),t}return t=s,(n=[{key:"onUpdateMediaAutoPlay",value:function(){this.setState({checkedAutoPlay:f.Z.get("media-auto-play")})}},{key:"onCheckAutoPlay",value:function(){be.p$()}},{key:"onKeyPress",value:function(e){0===e.keyCode&&be.p$()}},{key:"onMediaDataLoad",value:function(){var e=d.Z.get("media-data").related_media;this.setState({item:e.length?e[0]:null})}},{key:"render",value:function(){return this.state.item?a.createElement("div",{className:"auto-play"},a.createElement("div",{className:"auto-play-header"},a.createElement("div",{className:"next-label"},"Up next"),a.createElement("div",{className:"auto-play-option"},a.createElement("label",{className:"checkbox-label right-selectbox",tabIndex:0,onKeyPress:this.onKeyPress},"AUTOPLAY",a.createElement("span",{className:"checkbox-switcher-wrap"},a.createElement("span",{className:"checkbox-switcher"},a.createElement("input",{type:"checkbox",tabIndex:-1,checked:this.state.checkedAutoPlay,onChange:this.onCheckAutoPlay})))))),a.createElement(Li,{className:"items-list-hor",items:[this.state.item],pageItems:1,maxItems:1,singleLinkContent:!0,horizontalItemsOrientation:!0,hideDate:!0,hideViews:!f.Z.get("config-media-item").displayViews,hideAuthor:!f.Z.get("config-media-item").displayAuthor})):null}}])&&Ai(t.prototype,n),s}(a.PureComponent);function zi(e){return(zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function qi(e,t){return(qi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gi(e,t){return!t||"object"!==zi(t)&&"function"!=typeof t?Yi(e):t}function Yi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e){return(Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(288);var Xi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qi(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ki(i);if(o){var n=Ki(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Gi(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=r.call(this,e);var n=d.Z.get("media-data");return t.state={items:void 0!==n?n.related_media:null},d.Z.on("loaded_media_data",t.onMediaDataLoad.bind(Yi(t))),t}return t=s,(n=[{key:"onMediaDataLoad",value:function(){this.setState({items:d.Z.get("media-data").related_media})}},{key:"render",value:function(){return this.state.items&&this.state.items.length?a.createElement(Li,{className:"items-list-hor",items:this.props.hideFirst?this.state.items.slice(1):this.state.items,pageItems:f.Z.get("config-options").pages.media.related.initialSize,singleLinkContent:!0,horizontalItemsOrientation:!0,hideDate:!0,hideViews:!f.Z.get("config-media-item").displayViews,hideAuthor:!f.Z.get("config-media-item").displayAuthor}):null}}])&&Bi(t.prototype,n),s}(a.PureComponent);function Ji(e){return(Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Qi(e,t){return(Qi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eo(e,t){return!t||"object"!==Ji(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function to(e){return(to=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Xi.propTypes={hideFirst:l().bool},Xi.defaultProps={hideFirst:!0};var no=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qi(e,t)}(r,e);var t,n,i,o,a=(i=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=to(i);if(o){var n=to(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return eo(this,e)});function r(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(e=a.call(this)).data={enabledLoop:!1,enabledShuffle:!1,savedPlaylist:!1,response:null},e}return t=r,(n=[{key:"get",value:function(e){switch(e){case"logged-in-user-playlist":return!1;case"enabled-loop":return this.data.enabledLoop;case"enabled-shuffle":return this.data.enabledShuffle;case"saved-playlist":return this.data.savedPlaylist}return null}},{key:"actions_handler",value:function(e){switch(e.type){case"TOGGLE_LOOP":this.data.enabledLoop=!this.data.enabledLoop,this.emit("loop-repeat-updated");break;case"TOGGLE_SHUFFLE":this.data.enabledShuffle=!this.data.enabledShuffle,this.emit("shuffle-updated");break;case"TOGGLE_SAVE":this.data.savedPlaylist=!this.data.savedPlaylist,this.emit("saved-updated")}}}])&&$i(t.prototype,n),r}(Ue()),io=(0,He.v$)(new no,"actions_handler"),oo=n(3386);function ao(e){return(ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ro(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function so(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function lo(e,t){return(lo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function co(e,t){return!t||"object"!==ao(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uo(e){return(uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var po=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lo(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=uo(i);if(o){var n=uo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return co(this,e)});function s(){return ro(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){return a.createElement(Li,{className:"items-list-hor",pageItems:9999,maxItems:9999,items:this.props.items,hideDate:!0,hideViews:!0,hidePlaylistOrderNumber:!1,horizontalItemsOrientation:!0,inPlaylistView:!0,singleLinkContent:!0,playlistActiveItem:this.props.playlistActiveItem})}}])&&so(t.prototype,n),s}(a.PureComponent);function fo(e){return(fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mo(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ho(e,t){return(ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yo(e,t){return!t||"object"!==fo(t)&&"function"!=typeof t?bo(e):t}function bo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function go(e){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}po.propTypes={items:l().array.isRequired,playlistActiveItem:oo.g},po.defaultProps={playlistActiveItem:1};var vo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ho(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=go(i);if(o){var n=go(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return yo(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={expanded:!0,loopRepeat:io.get("enabled-loop"),shuffle:io.get("enabled-shuffle"),savedPlaylist:io.get("saved-playlist-loop"),title:e.playlistData.title,link:e.playlistData.url,authorName:e.playlistData.user,authorLink:f.Z.get("url-user-prefix")+"/"+e.playlistData.user,activeItem:e.activeItem,totalMedia:e.playlistData.media_count,items:e.playlistData.playlist_media},t.onHeaderClick=t.onHeaderClick.bind(bo(t)),t.onLoopClick=t.onLoopClick.bind(bo(t)),t.onShuffleClick=t.onShuffleClick.bind(bo(t)),t.onSaveClick=t.onSaveClick.bind(bo(t)),t.onLoopRepeatUpdate=t.onLoopRepeatUpdate.bind(bo(t)),t.onShuffleUpdate=t.onShuffleUpdate.bind(bo(t)),t.onPlaylistSaveUpdate=t.onPlaylistSaveUpdate.bind(bo(t)),io.on("loop-repeat-updated",t.onLoopRepeatUpdate),io.on("shuffle-updated",t.onShuffleUpdate),io.on("saved-updated",t.onPlaylistSaveUpdate),t}return t=s,(n=[{key:"onHeaderClick",value:function(){this.setState({expanded:!this.state.expanded})}},{key:"onLoopClick",value:function(){Y().dispatch({type:"TOGGLE_LOOP"})}},{key:"onShuffleClick",value:function(){Y().dispatch({type:"TOGGLE_SHUFFLE"})}},{key:"onSaveClick",value:function(){Y().dispatch({type:"TOGGLE_SAVE"})}},{key:"onShuffleUpdate",value:function(){var e=this;this.setState({shuffle:io.get("enabled-shuffle")},(function(){e.state.shuffle?be.wN("Shuffle is on","shuffle-on"):be.wN("Shuffle is off","shuffle-off")}))}},{key:"onLoopRepeatUpdate",value:function(){var e=this;this.setState({loopRepeat:io.get("enabled-loop")},(function(){e.state.loopRepeat?be.wN("Loop is on","loop-on"):be.wN("Loop is off","loop-off")}))}},{key:"onPlaylistSaveUpdate",value:function(){var e=this;this.setState({savedPlaylist:io.get("saved-playlist")},(function(){e.state.savedPlaylist?be.wN("Added to playlists library","added-to-playlists-lib"):be.wN("Removed from playlists library","removed-from-playlists-lib")}))}},{key:"render",value:function(){return a.createElement("div",{className:"playlist-view-wrap"},a.createElement("div",{className:"playlist-view"+(this.state.expanded?" playlist-expanded-view":"")},a.createElement("div",{className:"playlist-header",onClick:this.onHeaderClick},a.createElement("div",{className:"playlist-title"},a.createElement("a",{href:this.state.link,title:this.state.title},this.state.title)),a.createElement("div",{className:"playlist-meta"},a.createElement("span",null,a.createElement("a",{href:this.state.authorLink,title:this.state.authorName},this.state.authorName)),"  -  ",a.createElement("span",{className:"counter"},this.state.activeItem," / ",this.state.totalMedia)),a.createElement(ve.Z,{className:"toggle-playlist-view"},this.state.expanded?a.createElement("i",{className:"material-icons"},"keyboard_arrow_up"):a.createElement("i",{className:"material-icons"},"keyboard_arrow_down"))),this.state.expanded?a.createElement("div",{className:"playlist-actions"},a.createElement(ve.Z,{className:this.state.loopRepeat?"active":"",onClick:this.onLoopClick,title:"Loop playlist"},a.createElement("i",{className:"material-icons"},"repeat"))):null,this.state.expanded&&this.state.items.length?a.createElement("div",{className:"playlist-media"},a.createElement(po,{items:this.state.items,playlistActiveItem:this.state.activeItem})):null))}}])&&mo(t.prototype,n),s}(a.PureComponent);function wo(e){return(wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Eo(e,t){return!t||"object"!==wo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Po(e){return(Po=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}vo.propTypes={playlistData:l().object.isRequired,activeItem:oo.g},vo.defaultProps={};var Co=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ko(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Po(i);if(o){var n=Po(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Eo(this,e)});function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={playlistData:e.playlistData,isPlaylistPage:!!e.playlistData,activeItem:0},e.playlistData)for(var n=0;n<e.playlistData.playlist_media.length;){if(e.mediaId===e.playlistData.playlist_media[n].friendly_token){t.state.activeItem=n+1;break}n+=1}return t}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"viewer-sidebar"},this.state.isPlaylistPage?a.createElement(vo,{activeItem:this.state.activeItem,playlistData:this.props.playlistData}):a.createElement(Hi,null),a.createElement(Xi,{hideFirst:!this.state.isPlaylistPage}))}}])&&_o(t.prototype,n),s}(a.PureComponent);function Oo(e){return(Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function So(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ro(e,t){return(Ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mo(e,t){return!t||"object"!==Oo(t)&&"function"!=typeof t?Do(e):t}function Do(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function No(e){return(No=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ro(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=No(i);if(o){var n=No(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Mo(this,e)});function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={currentValue:null,currentUnit:null},void 0!==e.defaultValue?(t.state.currentValue=void 0!==e.minValue&&e.minValue>e.defaultValue?e.minValue:e.defaultValue,t.state.currentValue=void 0!==e.maxValue&&e.maxValue<t.state.currentValue?e.maxValue:t.state.currentValue):void 0!==e.minValue?t.state.currentValue=e.minValue:void 0!==e.maxValue&&(t.state.currentValue=e.maxValue),e.units.length){for(var n=0;n<e.units.length;){if(void 0!==e.units[n].key&&e.defaultUnit===e.units[n].key){t.state.currentUnit=e.units[n].key;break}n+=1}null===t.state.currentUnit&&(t.state.currentUnit=e.units[0].key)}return t.onChangeValue=t.onChangeValue.bind(Do(t)),t.onChangeUnit=t.onChangeUnit.bind(Do(t)),t}return t=s,(n=[{key:"componentDidUpdate",value:function(e){this.setState({currentValue:0+this.props.defaultValue,currentUnit:this.props.defaultUnit})}},{key:"onChangeValue",value:function(){void 0!==this.props.valueCallback?this.props.valueCallback(this.refs.valueInput.value):this.setState({currentValue:this.refs.valueInput.value})}},{key:"onChangeUnit",value:function(){void 0!==this.props.unitCallback?this.props.unitCallback(this.refs.valueUnit.value):this.setState({currentUnit:this.refs.valueUnit.value})}},{key:"unitOptions",value:function(){if(!this.props.units.length)return null;for(var e=[],t=0;t<this.props.units.length;)void 0!==this.props.units[t].key&&e.push(a.createElement("option",{key:this.props.units[t].key,value:this.props.units[t].key},void 0!==this.props.units[t].label?this.props.units[t].label:this.props.units[t].key)),t+=1;return e}},{key:"render",value:function(){return a.createElement("div",{className:"num-value-unit"},void 0!==this.props.label?a.createElement("span",{className:"label"},this.props.label):null,a.createElement("input",{ref:"valueInput",className:"value-input",type:"number",value:null!==this.state.currentValue?this.state.currentValue:"",min:void 0!==this.props.minValue?this.props.minValue:null,max:void 0!==this.props.maxValue?this.props.maxValue:null,onChange:this.onChangeValue}),a.createElement("select",{ref:"valueUnit",className:"value-unit",onChange:this.onChangeUnit,value:this.state.currentUnit},this.unitOptions()))}}])&&So(t.prototype,n),s}(a.PureComponent);function xo(e){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function To(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function jo(e,t){return(jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lo(e,t){return!t||"object"!==xo(t)&&"function"!=typeof t?Io(e):t}function Io(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ao(e){return(Ao=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Zo.propTypes={label:l().string,units:l().array.isRequired,defaultUnit:l().string,defaultValue:l().number,minValue:l().number,maxValue:l().number,valueCallback:l().func,unitCallback:l().func},Zo.defaultProps={};var Fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jo(e,t)}(l,e);var t,n,i,o,s=(i=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ao(i);if(o){var n=Ao(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Lo(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=s.call(this,e)).state={maxHeight:window.innerHeight-144+56,keepAspectRatio:!1,aspectRatio:"16:9",embedWidthValue:f.Z.get("config-options").embedded.video.dimensions.width,embedWidthUnit:f.Z.get("config-options").embedded.video.dimensions.widthUnit,embedHeightValue:f.Z.get("config-options").embedded.video.dimensions.height,embedHeightUnit:f.Z.get("config-options").embedded.video.dimensions.heightUnit,rightMiddlePositionTop:60,rightMiddlePositionBottom:60,unitOptions:[{key:"px",label:"px"},{key:"percent",label:"%"}]},t.onClickEmbedShareExit=t.onClickEmbedShareExit.bind(Io(t)),t.onWindowResize=t.onWindowResize.bind(Io(t)),t.onClickCopyMediaLink=t.onClickCopyMediaLink.bind(Io(t)),t.onCompleteCopyMediaLink=t.onCompleteCopyMediaLink.bind(Io(t)),t.onEmbedWidthValueChange=t.onEmbedWidthValueChange.bind(Io(t)),t.onEmbedWidthUnitChange=t.onEmbedWidthUnitChange.bind(Io(t)),t.onEmbedHeightValueChange=t.onEmbedHeightValueChange.bind(Io(t)),t.onEmbedHeightUnitChange=t.onEmbedHeightUnitChange.bind(Io(t)),t.onKeepAspectRatioChange=t.onKeepAspectRatioChange.bind(Io(t)),t.onAspectRatioChange=t.onAspectRatioChange.bind(Io(t)),t}return t=l,(n=[{key:"componentDidMount",value:function(){f.Z.on("window_resize",this.onWindowResize),d.Z.on("copied_embed_media_code",this.onCompleteCopyMediaLink),this.setState({maxHeight:window.innerHeight-144+56,rightMiddlePositionTop:this.refs.OnRightTop.offsetHeight,rightMiddlePositionBottom:this.refs.OnRightBottom.offsetHeight})}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){f.Z.removeListener("window_resize",this.onWindowResize),d.Z.removeListener("copied_embed_media_code",this.onCompleteCopyMediaLink)}},{key:"onWindowResize",value:function(){this.setState({maxHeight:window.innerHeight-144+56,rightMiddlePositionTop:this.refs.OnRightTop.offsetHeight,rightMiddlePositionBottom:this.refs.OnRightBottom.offsetHeight})}},{key:"onClickEmbedShareExit",value:function(){this.props.triggerPopupClose instanceof Function&&this.props.triggerPopupClose()}},{key:"onClickCopyMediaLink",value:function(){ne(this.refs.OnRightMiddle.querySelector("textarea"))}},{key:"onCompleteCopyMediaLink",value:function(){setTimeout(function(){be.wN("Embed media code copied to clipboard","clipboardEmbedMediaCodeCopy")}.bind(this),100)}},{key:"onEmbedWidthValueChange",value:function(e){""===e&&(e=0);var t=this.state.aspectRatio.split(":"),n=t[0],i=t[1];this.setState({embedWidthValue:e,embedHeightValue:this.state.keepAspectRatio?parseInt(e*i/n,10):this.state.embedHeightValue})}},{key:"onEmbedWidthUnitChange",value:function(e){this.setState({embedWidthUnit:e})}},{key:"onEmbedHeightValueChange",value:function(e){""===e&&(e=0);var t=this.state.aspectRatio.split(":"),n=t[0],i=t[1];this.setState({embedHeightValue:e,embedWidthValue:this.state.keepAspectRatio?parseInt(e*n/i,10):this.state.embedWidthValue})}},{key:"onEmbedHeightUnitChange",value:function(e){this.setState({embedHeightUnit:e})}},{key:"onKeepAspectRatioChange",value:function(){var e=!this.state.keepAspectRatio,t=this.state.aspectRatio.split(":"),n=t[0],i=t[1];this.setState({keepAspectRatio:e,embedWidthUnit:e?"px":this.state.embedWidthUnit,embedHeightUnit:e?"px":this.state.embedHeightUnit,embedHeightValue:e?parseInt(this.state.embedWidthValue*i/n,10):this.state.embedHeightValue,unitOptions:e?[{key:"px",label:"px"}]:[{key:"px",label:"px"},{key:"percent",label:"%"}]})}},{key:"onAspectRatioChange",value:function(){var e=this.refs.AspectRatioValue.value,t=e.split(":"),n=t[0],i=t[1];this.setState({aspectRatio:e,embedHeightValue:this.state.keepAspectRatio?parseInt(this.state.embedWidthValue*i/n,10):this.state.embedHeightValue})}},{key:"render",value:function(){return a.createElement("div",{className:"share-embed",style:{maxHeight:this.state.maxHeight+"px"}},a.createElement("div",{className:"share-embed-inner"},a.createElement("div",{className:"on-left"},a.createElement("div",{ref:"MediaEmbedWrap",className:"media-embed-wrap"},a.createElement(r.Z,{data:d.Z.get("media-data"),inEmbed:!0}))),a.createElement("div",{ref:"OnRight",className:"on-right"},a.createElement("div",{ref:"OnRightTop",className:"on-right-top"},a.createElement("div",{className:"on-right-top-inner"},a.createElement("span",{className:"ttl"},"Embed Video"),a.createElement(ve.Z,{type:"button",onClick:this.onClickEmbedShareExit},a.createElement(ge.Z,{type:"close"})))),a.createElement("div",{ref:"OnRightMiddle",className:"on-right-middle",style:{top:this.state.rightMiddlePositionTop+"px",bottom:this.state.rightMiddlePositionBottom+"px"}},a.createElement("textarea",{readOnly:!0,value:'<iframe width="'+("percent"===this.state.embedWidthUnit?this.state.embedWidthValue+"%":this.state.embedWidthValue)+'" height="'+("percent"===this.state.embedHeightUnit?this.state.embedHeightValue+"%":this.state.embedHeightValue)+'" src="'+f.Z.get("url-embed")+d.Z.get("media-id")+'" frameborder="0" allowfullscreen></iframe>'}),a.createElement("div",{className:"iframe-config"},a.createElement("div",{className:"iframe-config-options-title"},"Embed options"),a.createElement("div",{className:"iframe-config-option"},a.createElement("div",{className:"option-content"},a.createElement("div",{className:"ratio-options"},a.createElement("div",{className:"options-group"},a.createElement("label",{style:{minHeight:"36px"}},a.createElement("input",{type:"checkbox",checked:this.state.keepAspectRatio,onChange:this.onKeepAspectRatioChange}),"Keep aspect ratio")),this.state.keepAspectRatio?a.createElement("div",{className:"options-group"},a.createElement("select",{ref:"AspectRatioValue",onChange:this.onAspectRatioChange,value:this.state.aspectRatio},a.createElement("optgroup",{label:"Horizontal orientation"},a.createElement("option",{value:"16:9"},"16:9"),a.createElement("option",{value:"4:3"},"4:3"),a.createElement("option",{value:"3:2"},"3:2")),a.createElement("optgroup",{label:"Vertical orientation"},a.createElement("option",{value:"9:16"},"9:16"),a.createElement("option",{value:"3:4"},"3:4"),a.createElement("option",{value:"2:3"},"2:3")))):null),a.createElement("br",null),a.createElement("div",{className:"options-group"},a.createElement(Zo,{valueCallback:this.onEmbedWidthValueChange,unitCallback:this.onEmbedWidthUnitChange,label:"Width",defaultValue:parseInt(this.state.embedWidthValue,10),defaultUnit:this.state.embedWidthUnit,minValue:1,maxValue:99999,units:this.state.unitOptions})),a.createElement("div",{className:"options-group"},a.createElement(Zo,{valueCallback:this.onEmbedHeightValueChange,unitCallback:this.onEmbedHeightUnitChange,label:"Height",defaultValue:parseInt(this.state.embedHeightValue,10),defaultUnit:this.state.embedHeightUnit,minValue:1,maxValue:99999,units:this.state.unitOptions})))))),a.createElement("div",{ref:"OnRightBottom",className:"on-right-bottom"},a.createElement("button",{onClick:this.onClickCopyMediaLink},"COPY")))))}}])&&To(t.prototype,n),l}(a.PureComponent);function Vo(e){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uo(e,t){return(Uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Wo(e,t){return!t||"object"!==Vo(t)&&"function"!=typeof t?Ho(e):t}function Ho(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zo(e){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uo(e,t)}(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=zo(t);if(n){var o=zo(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return Wo(this,e)});function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).state={isOpenPopup:!1,popupCurrentPage:"shareOptions"},t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(Ho(t)),t.onPopupPageChange=t.onPopupPageChange.bind(Ho(t)),t.triggerPopupClose=t.triggerPopupClose.bind(Ho(t));var n={shareOptions:a.createElement("div",{className:"popup-fullscreen"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Fn,null))),shareEmbed:a.createElement("div",{className:"popup-fullscreen share-embed-popup"},a.createElement(Ee.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Fo,{triggerPopupClose:t.triggerPopupClose})))};return t.sharePopup=new ke.Z(a.createElement("button",null,a.createElement(ve.Z,{type:"span"},a.createElement(ge.Z,{type:"share"})),a.createElement("span",null,"SHARE")),a.createElement(Vt.o,{initPage:t.state.popupCurrentPage,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:n,focusFirstItemOnPageChange:!1,pageChangeCallback:t.onPopupPageChange}),t.onPopupsDisplayChange),t}return o}(qn);function qo(e){return(qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yo(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ko(e,t){return(Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xo(e,t){return!t||"object"!==qo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jo(e){return(Jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jo(i);if(o){var n=Jo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Xo(this,e)});function s(){return Go(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){console.log();var e=f.Z.get("config-options").pages.media.displayViews&&void 0!==this.props.views;return a.createElement("div",{className:"media-title-banner"},e&&f.Z.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?a.createElement("h1",null,this.props.title):null,"public"!==d.Z.get("media-data").state?a.createElement("div",{className:"media-labels-area"},a.createElement("span",null,d.Z.get("media-data").state)):null,a.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&f.Z.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?a.createElement("div",{className:"media-views"},(0,He.uf)(this.props.views,!0)," ",1>=this.props.views?"view":"views"):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,f.Z.get("config-user").can.likeMedia?a.createElement(Pt,null):null,f.Z.get("config-user").can.dislikeMedia?a.createElement(Nt,null):null,f.Z.get("config-user").can.shareMedia?a.createElement(Bo,null):null,f.Z.get("config-user").can.saveMedia&&-1<f.Z.get("config-playlists").mediaTypes.indexOf(d.Z.get("media-type"))?a.createElement(Nn,null):null,this.props.allowDownload&&f.Z.get("config-user").can.downloadMedia?this.downloadLink?a.createElement(At,{link:this.downloadLink,title:this.props.title}):a.createElement(Gt,null):null,a.createElement(ri,{allowDownload:this.props.allowDownload})))))}}])&&Yo(t.prototype,n),s}(fi);function Qo(e){return(Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ta(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function na(e,t){return(na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ia(e,t){return!t||"object"!==Qo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oa(e){return(oa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var aa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&na(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oa(i);if(o){var n=oa(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ia(this,e)});function s(){return ea(this,s),r.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e,t,n,i,o,r,s=!1;return this.state.videoLoaded&&(s=void 0===(s=d.Z.get("media-data").allow_download)||!!s,e=d.Z.get("media-data").views,t=d.Z.get("media-data").categories_info,n=d.Z.get("media-data").title,i={name:d.Z.get("media-data").author_name,url:d.Z.get("media-data").author_profile,thumb:d.Z.get("media-author-thumbnail-url")},o=d.Z.get("media-data").add_date,r=d.Z.get("media-data").description),this.state.videoLoaded?a.createElement("div",{className:"viewer-info"},a.createElement("div",{className:"viewer-info-inner"},a.createElement($o,{title:n,views:e,categories:t,allowDownload:s}),a.createElement(bt,{author:i,published:o,description:r}))):null}}])&&ta(t.prototype,n),s}(wi);function ra(e){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sa(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function la(e,t){return(la=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ca(e,t){return!t||"object"!==ra(t)&&"function"!=typeof t?ua(e):t}function ua(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function da(e){return(da=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pa(e){return(pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ma(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ha(e,t){return(ha=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ya(e,t){return!t||"object"!==pa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ba(e){return(ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ga=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ha(e,t)}(l,e);var t,n,i,o,s=(i=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ba(i);if(o){var n=ba(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ya(this,e)});function l(){return fa(this,l),s.apply(this,arguments)}return t=l,(n=[{key:"viewerContainerContent",value:function(e){switch(d.Z.get("media-type")){case"video":return a.createElement(r.Z,{data:e,inEmbed:!1});case"audio":return a.createElement(O,null);case"image":return a.createElement(x,null);case"pdf":return a.createElement(F,null)}return a.createElement(B,null)}}])&&ma(t.prototype,n),l}(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&la(e,t)}(s,e);var t,n,i,o,r=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=da(i);if(o){var n=da(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ca(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e,"media")).state={wideLayout:1216<=f.Z.get("window-inner-width"),mediaLoaded:!1,mediaLoadFailed:!1,isVideoMedia:!1,theaterMode:!1,pagePlaylistLoaded:!1},t.onWindowResize=t.onWindowResize.bind(ua(t)),t.onMediaLoad=t.onMediaLoad.bind(ua(t)),t.onMediaLoadError=t.onMediaLoadError.bind(ua(t)),t.onPagePlaylistLoad=t.onPagePlaylistLoad.bind(ua(t)),d.Z.on("loaded_media_data",t.onMediaLoad),d.Z.on("loaded_media_error",t.onMediaLoadError),d.Z.on("loaded_page_playlist_data",t.onPagePlaylistLoad),t}return t=s,(n=[{key:"componentDidMount",value:function(){K(),f.Z.on("window_resize",this.onWindowResize)}},{key:"onWindowResize",value:function(){this.setState({wideLayout:1216<=f.Z.get("window-inner-width")})}},{key:"onPagePlaylistLoad",value:function(){this.setState({pagePlaylistLoaded:!0})}},{key:"onMediaLoad",value:function(){var e="video"===d.Z.get("media-type");e?(this.onViewerModeChange=this.onViewerModeChange.bind(this),p.Z.on("changed_viewer_mode",this.onViewerModeChange),this.setState({mediaLoaded:!0,isVideoMedia:e,theaterMode:p.Z.get("in-theater-mode")})):this.setState({mediaLoaded:!0,isVideoMedia:e})}},{key:"onViewerModeChange",value:function(){this.setState({theaterMode:p.Z.get("in-theater-mode")})}},{key:"onMediaLoadError",value:function(e){this.setState({mediaLoadFailed:!0})}},{key:"pageContent",value:function(){var e="cf viewer-section"+(this.state.theaterMode?" theater-mode":" viewer-wide"),t="viewer-section-nested"+(this.state.theaterMode?" viewer-section":"");return this.state.mediaLoadFailed?a.createElement("div",{className:e},a.createElement(ye,null)):a.createElement("div",{className:e},[a.createElement("div",{className:"viewer-container",key:"viewer-container"},this.state.mediaLoaded?this.viewerContainerContent(d.Z.get("media-data")):null),a.createElement("div",{key:"viewer-section-nested",className:t},!this.state.wideLayout||this.state.isVideoMedia&&this.state.theaterMode?[a.createElement(aa,{key:"viewer-info"}),this.state.pagePlaylistLoaded?a.createElement(Co,{key:"viewer-sidebar",mediaId:d.Z.get("media-id"),playlistData:d.Z.get("playlist-data")}):null]:[this.state.pagePlaylistLoaded?a.createElement(Co,{key:"viewer-sidebar",mediaId:d.Z.get("media-id"),playlistData:d.Z.get("playlist-data")}):null,a.createElement(aa,{key:"viewer-info"})])])}}])&&sa(t.prototype,n),s}(q.T));(0,o.X)("page-media",ga)},9450:function(e,t,n){n(7441),n(9751),n(6394),n(4669);var i=n(2186);function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a={},r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a[Object.defineProperty(this,"id",{value:"MediaDurationInfo_"+Object.keys(a).length}).id]={fn:{infoToString:function(e){return e<10?"0"+e:e}}},(0,i.ZU)(t)&&this.update(t)}var t,n;return t=e,(n=[{key:"update",value:function(e){a[this.id].toString=void 0,a[this.id].ariaLabel=void 0,(0,i.ZU)(e)&&(a[this.id].days=Math.floor(e/86400),a[this.id].seconds=e%86400,a[this.id].date=a[this.id].seconds?new Date(1e3*a[this.id].seconds):null,a[this.id].hours=a[this.id].date?24*a[this.id].days+a[this.id].date.getUTCHours():0,a[this.id].minutes=a[this.id].date?a[this.id].date.getUTCMinutes():0,a[this.id].seconds=a[this.id].date?a[this.id].date.getSeconds():0)}},{key:"toString",value:function(){return void 0===a[this.id].toString&&(a[this.id].toString=(0<a[this.id].hours?a[this.id].hours+":":"")+(0<a[this.id].hours&&10>a[this.id].minutes?"0":"")+a[this.id].minutes+":"+a[this.id].fn.infoToString(a[this.id].seconds)),a[this.id].toString}},{key:"ariaLabel",value:function(){if(void 0===a[this.id].ariaLabel){var e=[];0<a[this.id].hours&&e.push(a[this.id].hours+" hours"),0<a[this.id].minutes&&e.push(a[this.id].minutes+" minutes"),0<a[this.id].seconds&&e.push(a[this.id].seconds+" seconds"),a[this.id].ariaLabel=e.join(", ")}return a[this.id].ariaLabel}},{key:"ISO8601",value:function(){return"P0Y0M0DT"+a[this.id].hours+"H"+a[this.id].minutes+"M"+a[this.id].seconds+"S"}}])&&o(t.prototype,n),e}();t.Z=r},3671:function(e,t,n){n.d(t,{Z:function(){return f}}),n(5101);var i=n(5466),o=(n(6116),n(3074)),a=n.n(o);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(f,e);var t,n,o,a,r=(o=f,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(o);if(a){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return d(this,e)});function f(){return l(this,f),r.apply(this,arguments)}return t=f,(n=[{key:"render",value:function(){var e,t=i.createElement("span",null,i.createElement("span",null,this.props.children)),n="circle-icon-button"+("string"==typeof this.props.className?" "+this.props.className:"")+(this.props.buttonShadow?" button-shadow":""),o={};switch(void 0!==this.props["data-page-id"]&&(o["data-page-id"]=this.props["data-page-id"]),void 0!==this.props["aria-label"]&&(o["aria-label"]=this.props["aria-label"]),this.props.type){case"link":e=i.createElement("a",s({},o,{className:n,href:this.props.href||null,title:this.props.title||null,tabIndex:this.props.tabIndex||null,rel:this.props.rel||null}),t);break;case"span":e=i.createElement("span",s({},o,{className:n,onClick:this.props.onClick||null,title:this.props.title||null,tabIndex:this.props.tabIndex||null}),t);break;default:e=i.createElement("button",s({},o,{className:n,onClick:this.props.onClick||null,title:this.props.title||null,tabIndex:this.props.tabIndex||null}),t)}return e}}])&&c(t.prototype,n),f}(i.PureComponent);f.propTypes={type:a().oneOf(["button","link","span"]),buttonShadow:a().bool},f.defaultProps={type:"button",buttonShadow:!1}},1395:function(e,t,n){function i(e,t,n){return e.scrollLeft?1+Math.ceil(e.scrollLeft/t):n}function o(e,t){void 0!==e&&(this.data={dom:{wrapper:e,firstItem:e.querySelector(t)},item:{width:null}},this.data.item.width=this.data.dom.firstItem.offsetWidth,this.state={initedAllStateValues:!1,currentSlide:1,maxSlideIndex:null,slideItemsFit:null,slideItems:null,totalItems:null,wrapper:{width:null,scrollWidth:null}})}n.d(t,{Z:function(){return o}}),o.prototype.updateDataStateOnResize=function(e,t){this.data.item.width=this.data.dom.firstItem.offsetWidth,this.state.wrapper.width=this.data.dom.wrapper.offsetWidth,this.state.wrapper.scrollWidth=this.data.dom.wrapper.scrollWidth,this.state.slideItemsFit=Math.floor(this.state.wrapper.width/this.data.item.width),this.state.slideItems=Math.max(1,this.state.slideItemsFit),t&&this.state.slideItems<=this.state.slideItems&&(this.state.itemsLengthFit=this.state.slideItems),this.state.totalItems=e,this.state.maxSlideIndex=Math.max(this.state.totalItems-this.state.slideItemsFit+1),this.state.currentSlide=Math.min(this.state.currentSlide,this.state.maxSlideIndex||1)},o.prototype.updateDataState=function(e,t,n){!n&&this.state.initedAllStateValues||(this.state.initedAllStateValues=!0,this.state.wrapper.width=this.data.dom.wrapper.offsetWidth,this.state.wrapper.scrollWidth=this.data.dom.wrapper.scrollWidth,this.state.slideItemsFit=Math.floor(this.state.wrapper.width/this.data.item.width),this.state.slideItems=Math.max(1,this.state.slideItemsFit),t&&this.state.slideItems<=this.state.slideItems&&(this.state.itemsLengthFit=this.state.slideItems)),this.state.totalItems=e,this.state.maxSlideIndex=Math.max(1,this.state.totalItems-this.state.slideItemsFit+1),this.state.currentSlide=Math.min(this.state.currentSlide,this.state.maxSlideIndex)},o.prototype.nextSlide=function(){this.state.currentSlide=Math.min(i(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)+this.state.slideItems,this.state.maxSlideIndex)},o.prototype.previousSlide=function(){this.state.currentSlide=Math.max(1,i(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)-this.state.slideItems)},o.prototype.scrollToCurrentSlide=function(){this.data.dom.wrapper.scrollLeft=this.data.item.width*(this.state.currentSlide-1)},o.prototype.hasNextSlide=function(){return this.state.currentSlide<this.state.maxSlideIndex},o.prototype.hasPreviousSlide=function(){return 1<this.state.currentSlide},o.prototype.currentSlide=function(){return this.state.currentSlide},o.prototype.loadItemsToFit=function(){return 2*this.state.slideItemsFit>this.state.totalItems},o.prototype.loadMoreItems=function(){return this.state.currentSlide+this.state.slideItemsFit>=this.state.maxSlideIndex},o.prototype.itemsFit=function(){return this.state.slideItemsFit}},7448:function(e,t,n){n.d(t,{Z:function(){return p}}),n(5101);var i=n(5466),o=(n(6116),n(3074)),a=n.n(o);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(p,e);var t,n,o,a,r=(o=p,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(o);if(a){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function p(){return s(this,p),r.apply(this,arguments)}return t=p,(n=[{key:"render",value:function(){return this.props.type&&""!==this.props.type?i.createElement("i",{className:"material-icons","data-icon":this.props.type}):null}}])&&l(t.prototype,n),p}(i.PureComponent);p.propTypes={type:a().string.isRequired},p.defaultProps={}},6912:function(e,t,n){n.d(t,{Z:function(){return g}}),n(5101),n(9808);var i=n(5466),o=(n(6116),n(3074)),a=n.n(o),r=n(7448);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=y(e);if(t){var o=y(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){p(n,e);var t=m(n);function n(e){var o;c(this,n);var a=(o=t.call(this,e)).props.text?o.props.icon&&"right"!==o.props.iconPos?1:0:-1,s=o.props.icon?o.props.text&&"right"===o.props.iconPos?1:0:-1;switch(o.itemAttr=o.props.itemAttr||{},o.children=[],o.className=void 0!==o.itemAttr.className?o.itemAttr.className+" ":"",o.itemAttr.className,-1<a&&(o.children[a]=i.createElement("span",{key:"Text"},o.props.text)),-1<s&&(o.children[s]=i.createElement("span",{key:"Icon",className:"right"===o.props.iconPos?"menu-item-icon-right":"menu-item-icon"},i.createElement(r.Z,{type:o.props.icon}))),o.props.itemType){case"link":o.children=i.createElement("a",l({},o.props.linkAttr||{},{href:o.props.link,title:o.props.text||null}),o.children),o.className+="link-item"+(o.props.active?" active":"");break;case"button":case"open-subpage":o.children=i.createElement("button",l({},o.props.buttonAttr||{},{key:"button"}),o.children);break;case"label":o.children=i.createElement("button",l({},o.props.buttonAttr||{},{key:"button"}),i.createElement("span",null,o.props.text||null)),o.className="label-item";break;case"div":o.children=i.createElement("div",l({},o.props.divAttr||{},{key:"div"}),o.props.text||null)}return o.className=void 0!==o.className?" "+o.className:"",o}return d(n,[{key:"render",value:function(){return i.createElement("li",l({},this.itemAttr,{className:this.className}),this.children)}}]),n}(i.PureComponent),g=function(e){p(n,e);var t=m(n);function n(){return c(this,n),t.apply(this,arguments)}return d(n,[{key:"render",value:function(){for(var e=0,t=[];e<this.props.items.length;)t.push(i.createElement(b,l({key:e},this.props.items[e]))),e+=1;return t.length?i.createElement("div",{className:"nav-menu"+(this.props.removeVerticalPadding?" pv0":"")},i.createElement("nav",null,i.createElement("ul",null,t))):null}}]),n}(i.PureComponent);b.defaultProps={itemType:"link",iconPos:"left",active:!1},b.propTypes={itemType:a().oneOf(["link","open-subpage","button","label","div"]),link:a().string,icon:a().string,iconPos:a().oneOf(["left","right"]),text:a().string,active:a().bool,divAttr:a().object,buttonAttr:a().object,itemAttr:a().object,linkAttr:a().object},g.defaultProps={removeVerticalPadding:!1},g.propTypes={removeVerticalPadding:a().bool,items:a().arrayOf(a().shape(b.propTypes)).isRequired}},8024:function(e,t,n){function i(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function o(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function a(e,t){return e.className&&new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)}n.d(t,{dt:function(){return i},Ec:function(){return o},mO:function(){return a}}),n(7441),n(7390),n(2322),n(4669),n(3296),n(9268)},8420:function(e,t,n){n.d(t,{A_:function(){return i.Z},j0:function(){return o.Z},GH:function(){return a.Z},Jl:function(){return r.Z},v$:function(){return s.Z},uf:function(){return l.Z},$4:function(){return c.Z},hm:function(){return u.Z},UN:function(){return d.Z},$A:function(){return p.Z},m5:function(){return f.Z},vo:function(){return m.ZP}});var i=n(1712),o=n(9752),a=n(84),r=n(9009),s=n(1438),l=n(4135),c=n(3140),u=(n(1752),n(7514),n(716)),d=n(6146),p=n(4845),f=(n(1569),n(6203)),m=n(7188)},716:function(e,t,n){n.d(t,{Z:function(){return o}});var i=["January","February","March","April","May","June","July","August","September","October","November","December"];function o(e,t){if(e instanceof Date)switch(t=0<(t=0+t)?t:1){case 1:return i[e.getMonth()].substring(0,3)+" "+e.getDate()+", "+e.getFullYear();case 2:return e.getDate()+" "+i[e.getMonth()].substring(0,3)+" "+e.getFullYear();case 3:return e.getDate()+" "+i[e.getMonth()]+" "+e.getFullYear()}return null}},2276:function(e,t,n){n(2004),n(8407),n(5101),n(9751),n(2322),n(3296),n(9006),n(9268),n(3233),n(5466);var i=n(1590),o=n.n(i),a=n(8420),r=(n(4559),n(137)),s=n.n(r),l=n(4426);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h={},y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(c,e);var t,n,i,o,r=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m(i);if(o){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return p(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=r.call(this)).pagePlaylistId=null,e.pagePlaylistData=null,h[Object.defineProperty(f(e),"id",{value:"MediaPageStoreData_"+Object.keys(h).length}).id]={likedMedia:!1,dislikedMedia:!1,reported_times:0,while:{deleteMedia:!1,submitComment:!1,deleteCommentId:null}},e.removeMediaResponse=e.removeMediaResponse.bind(f(e)),e.removeMediaFail=e.removeMediaFail.bind(f(e)),e.submitCommentFail=e.submitCommentFail.bind(f(e)),e.submitCommentResponse=e.submitCommentResponse.bind(f(e)),e.removeCommentFail=e.removeCommentFail.bind(f(e)),e.removeCommentResponse=e.removeCommentResponse.bind(f(e)),e}return t=c,(n=[{key:"loadData",value:function(){if(!h[this.id].mediaId){var e=((n=new(s())(window.location.href).query)?((n=n.substring(1)).split("&"),n=n.length?n.split("="):[]):n=[],n);if(e.length)for(var t=0;t<e.length;)"m"===e[t]&&(h[this.id].mediaId=e[t+1]),t+=2}var n;if(!h[this.id].mediaId)return console.warn("Invalid media id:",h[this.id].mediaId),!1;this.mediaAPIUrl=l.Z.get("api-media")+"/"+h[this.id].mediaId,this.dataResponse=this.dataResponse.bind(this),this.dataErrorResponse=this.dataErrorResponse.bind(this),(0,a.A_)(this.mediaAPIUrl,!1,this.dataResponse,this.dataErrorResponse)}},{key:"loadPlaylistData",value:function(){if(this.pagePlaylistId=function(){var e=null,t=window.location.search;if(""!==t){var n=t.split("?");if(2===n.length){var i;n=n[1].split("&");for(var o=0;o<n.length;){if("pl"===(i=n[o].split("="))[0]){2===i.length&&(e=i[1]);break}o+=1}}}return e}(),this.pagePlaylistId){var e=l.Z.get("api-playlists")+"/"+this.pagePlaylistId;this.playlistDataResponse=this.playlistDataResponse.bind(this),this.playlistDataErrorResponse=this.playlistDataErrorResponse.bind(this),(0,a.A_)(e,!1,this.playlistDataResponse,this.playlistDataErrorResponse)}else this.emit("loaded_page_playlist_data")}},{key:"playlistDataResponse",value:function(e){e&&e.data&&(this.pagePlaylistData=e.data,this.emit("loaded_viewer_playlist_data")),this.emit("loaded_page_playlist_data")}},{key:"playlistDataErrorResponse",value:function(e){this.emit("loaded_viewer_playlist_error"),this.emit("loaded_page_playlist_data")}},{key:"loadComments",value:function(){this.commentsAPIUrl=l.Z.get("api-media")+"/"+h[this.id].mediaId+"/comments",this.commentsResponse=this.commentsResponse.bind(this),(0,a.A_)(this.commentsAPIUrl,!1,this.commentsResponse)}},{key:"loadPlaylists",value:function(){l.Z.get("config-user").can.saveMedia&&(this.playlistsAPIUrl=l.Z.get("api-user-playlists")+l.Z.get("user-username"),this.playlistsResponse=this.playlistsResponse.bind(this),(0,a.A_)(this.playlistsAPIUrl,!1,this.playlistsResponse))}},{key:"dataResponse",value:function(e){if(e&&e.data){switch(h[this.id].data=e.data,h[this.id].reported_times=!!h[this.id].data.reported_times,this.get("media-type")){case"video":case"audio":case"image":this.emit("loaded_"+this.get("media-type")+"_data")}this.emit("loaded_media_data")}this.loadPlaylistData(),this.loadPlaylists(),l.Z.get("config-user").can.readComment&&this.loadComments()}},{key:"dataErrorResponse",value:function(e){if(void 0!==e.type)switch(e.type){case"network":case"private":case"unavailable":h[this.id].loadErrorType=e.type,h[this.id].loadErrorMessage=void 0!==e.message?e.message:"Αn error occurred while loading the media's data",this.emit("loaded_media_error")}}},{key:"commentsResponse",value:function(e){e&&e.data&&(h[this.id].comments=e.data.count?e.data.results:[],this.emit("comments_load"))}},{key:"playlistsResponse",value:function(e){var t=this;e&&e.data&&function(){var n=e.data.count?e.data.results:[];h[t.id].playlists=[];for(var i=0,o=0;i<n.length;)(function(e){var t,i,r=this;if(n[e].user===l.Z.get("config-user").username){var s=h[r.id].playlists.length;h[r.id].playlists[s]={playlist_id:(t=n[e].url,i=t.split("/"),1<i.length?i[i.length-1]:null),title:n[e].title,description:n[e].description,add_date:n[e].add_date},(0,a.A_)(l.Z.get("config-site").url+"/"+n[e].api_url.replace(/^\//g,""),!1,(function(e){if(e&&e.data){h[r.id].playlists[s].media_list=[];for(var t,i=0;i<e.data.playlist_media.length;)2===(t=e.data.playlist_media[i].url.split("m=")).length&&h[r.id].playlists[s].media_list.push(t[1]),i+=1}(o+=1)===n.length&&this.emit("playlists_load")}))}}).bind(t)(i),i+=1}()}},{key:"requestMediaLike",value:function(){if(!h[this.id].mediaId)return console.warn("Invalid media id:",h[this.id].mediaId),!1;var e=l.Z.get("api-media")+"/"+h[this.id].mediaId+"/actions";this.likeActionResponse=this.likeActionResponse.bind(this),(0,a.j0)(e,{type:"like"},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.likeActionResponse,function(){this.emit("liked_media_failed_request")}.bind(this))}},{key:"likeActionResponse",value:function(e){e&&(e instanceof Error||e.data&&(h[this.id].likedMedia=!0,this.emit("liked_media")))}},{key:"requestMediaDislike",value:function(){if(!h[this.id].mediaId)return console.warn("Invalid media id:",h[this.id].mediaId),!1;var e=l.Z.get("api-media")+"/"+h[this.id].mediaId+"/actions";this.dislikeActionResponse=this.dislikeActionResponse.bind(this),(0,a.j0)(e,{type:"dislike"},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.dislikeActionResponse,function(){this.emit("disliked_media_failed_request")}.bind(this))}},{key:"dislikeActionResponse",value:function(e){e&&(e instanceof Error||e.data&&(h[this.id].dislikedMedia=!0,this.emit("disliked_media")))}},{key:"requestMediaReport",value:function(e){if(!h[this.id].mediaId)return console.warn("Invalid media id:",h[this.id].mediaId),!1;var t=l.Z.get("api-media")+"/"+h[this.id].mediaId+"/actions";this.reportActionResponse=this.reportActionResponse.bind(this),(0,a.j0)(t,{type:"report",extra_info:e},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.reportActionResponse,this.reportActionResponse)}},{key:"reportActionResponse",value:function(e){e&&(e instanceof Error||e.data&&(h[this.id].reported_times+=1,this.emit("reported_media")))}},{key:"set",value:function(e,t){switch(e){case"media-load-error-type":h[this.id].loadErrorType=t;break;case"media-load-error-message":h[this.id].loadErrorMessage=t}}},{key:"get",value:function(e){var t,n=null;switch(e){case"playlists":n=h[this.id].playlists||[];break;case"media-load-error-type":n=void 0!==h[this.id].loadErrorType?h[this.id].loadErrorType:null;break;case"media-load-error-message":n=void 0!==h[this.id].loadErrorMessage?h[this.id].loadErrorMessage:null;break;case"media-comments":n=h[this.id].comments||[];break;case"media-data":n=h[this.id].data||null;break;case"media-id":n=h[this.id].mediaId;break;case"media-url":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.url?h[this.id].data.url:"N/A";break;case"media-edit-subtitle-url":n=void 0!==h[this.id].data&&"string"==typeof h[this.id].data.add_subtitle_url?h[this.id].data.add_subtitle_url:null;break;case"media-likes":n=(t=h[this.id].likedMedia?1:0)?void 0!==h[this.id].data&&void 0!==h[this.id].data.likes?h[this.id].data.likes+t:t:void 0!==h[this.id].data&&void 0!==h[this.id].data.likes?h[this.id].data.likes:"N/A";break;case"media-dislikes":n=(t=h[this.id].dislikedMedia?1:0)?void 0!==h[this.id].data&&void 0!==h[this.id].data.dislikes?h[this.id].data.dislikes+t:t:void 0!==h[this.id].data&&void 0!==h[this.id].data.dislikes?h[this.id].data.dislikes:"N/A";break;case"media-summary":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.summary?h[this.id].data.summary:null;break;case"media-production-company":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.company&&null!==h[this.id].data.company?h[this.id].data.company.trim():null;break;case"media-website":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.website&&null!==h[this.id].data.website?h[this.id].data.website.trim():null;break;case"display-media-license-info":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.license_info;break;case"media-license-info":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.license_info&&Object.keys(h[this.id].data.license_info).length?h[this.id].data.license_info:null;break;case"media-countries":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.media_country_info?h[this.id].data.media_country_info:[];break;case"media-languages":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.media_language_info?h[this.id].data.media_language_info:[];break;case"media-categories":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.categories_info?h[this.id].data.categories_info:[];break;case"media-topics":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.topics_info?h[this.id].data.topics_info:[];break;case"media-tags":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.tags_info?h[this.id].data.tags_info:[];break;case"media-type":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.media_type?h[this.id].data.media_type:null;break;case"media-original-url":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.original_media_url?h[this.id].data.original_media_url:null;break;case"media-thumbnail-url":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.thumbnail_url?h[this.id].data.thumbnail_url:null;break;case"user-liked-media":n=h[this.id].likedMedia;break;case"user-disliked-media":n=h[this.id].dislikedMedia;break;case"media-author-thumbnail-url":n=void 0!==h[this.id].data&&void 0!==h[this.id].data.author_thumbnail?l.Z.get("config-site").url+"/"+h[this.id].data.author_thumbnail.replace(/^\//g,""):null;break;case"playlist-data":n=this.pagePlaylistData;break;case"playlist-id":n=this.pagePlaylistId;break;case"playlist-next-media-url":n=this.pagePlaylistId;for(var i=0,o=0;o<this.pagePlaylistData.playlist_media.length;){if(h[this.id].mediaId===this.pagePlaylistData.playlist_media[o].friendly_token){i=o+1;break}o+=1}void 0!==this.pagePlaylistData.playlist_media[i]&&(n=this.pagePlaylistData.playlist_media[i].url+"&pl="+this.pagePlaylistId)}return n}},{key:"isVideo",value:function(){return"video"===this.get("media-type")}},{key:"onPlaylistCreationCompleted",value:function(e){e&&e.data&&this.emit("playlist_creation_completed",e.data)}},{key:"onPlaylistCreationFailed",value:function(){this.emit("playlist_creation_failed")}},{key:"onPlaylistMediaAdditionCompleted",value:function(e,t){if(t){for(var n=0;n<h[this.id].playlists.length;){if(e===h[this.id].playlists[n].playlist_id){h[this.id].playlists[n].media_list.push(h[this.id].mediaId);break}n+=1}this.emit("media_playlist_addition_completed",e)}}},{key:"onPlaylistMediaAdditionFailed",value:function(e,t){this.emit("media_playlist_addition_failed")}},{key:"onPlaylistMediaRemovalCompleted",value:function(e,t){if(t){for(var n,i,o=0;o<h[this.id].playlists.length;){if(e===h[this.id].playlists[o].playlist_id){for(i=[],n=0;n<h[this.id].playlists[o].media_list.length;)h[this.id].mediaId!==h[this.id].playlists[o].media_list[n]&&i.push(h[this.id].playlists[o].media_list[n]),n+=1;h[this.id].playlists[o].media_list=i;break}o+=1}this.emit("media_playlist_removal_completed",e)}}},{key:"onPlaylistMediaRemovalFailed",value:function(e,t){this.emit("media_playlist_removal_failed")}},{key:"actions_handler",value:function(e){switch(e.type){case"LOAD_MEDIA_DATA":h[this.id].mediaId=window.MediaCMS.mediaId||h[this.id].mediaId,this.loadData();break;case"UNLIKE_MEDIA":break;case"LIKE_MEDIA":h[this.id].likedMedia||h[this.id].dislikedMedia||this.requestMediaLike();break;case"DISLIKE_MEDIA":h[this.id].likedMedia||h[this.id].dislikedMedia||this.requestMediaDislike();break;case"UNDISLIKE_MEDIA":break;case"REPORT_MEDIA":h[this.id].reported_times||""!==e.reportDescription&&this.requestMediaReport(e.reportDescription);break;case"COPY_SHARE_LINK":e.inputElement instanceof HTMLElement&&(e.inputElement.select(),document.execCommand("copy"),this.emit("copied_media_link"));break;case"COPY_EMBED_MEDIA_CODE":e.inputElement instanceof HTMLElement&&(e.inputElement.select(),document.execCommand("copy"),this.emit("copied_embed_media_code"));break;case"REMOVE_MEDIA":if(h[this.id].while.deleteMedia)return;h[this.id].while.deleteMedia=!0,(0,a.Jl)(this.mediaAPIUrl,{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.removeMediaResponse,this.removeMediaFail);break;case"SUBMIT_COMMENT":if(h[this.id].while.submitComment)return;h[this.id].while.submitComment=!0,(0,a.j0)(this.commentsAPIUrl,{text:e.commentText},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.submitCommentResponse,this.submitCommentFail);break;case"DELETE_COMMENT":if(null!==h[this.id].while.deleteCommentId)return;h[this.id].while.deleteCommentId=e.commentId,(0,a.Jl)(this.commentsAPIUrl+"/"+e.commentId,{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.removeCommentResponse,this.removeCommentFail);break;case"CREATE_PLAYLIST":(0,a.j0)(l.Z.get("api-playlists"),{title:e.playlist_data.title,description:e.playlist_data.description},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.onPlaylistCreationCompleted.bind(this),this.onPlaylistCreationFailed.bind(this));break;case"ADD_MEDIA_TO_PLAYLIST":(0,a.GH)(l.Z.get("api-playlists")+"/"+e.playlist_id,{type:"add",media_friendly_token:e.media_id},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.onPlaylistMediaAdditionCompleted.bind(this,e.playlist_id),this.onPlaylistMediaAdditionFailed.bind(this,e.playlist_id));break;case"REMOVE_MEDIA_FROM_PLAYLIST":(0,a.GH)(l.Z.get("api-playlists")+"/"+e.playlist_id,{type:"remove",media_friendly_token:e.media_id},{headers:{"X-CSRFToken":(0,a.m5)()}},!1,this.onPlaylistMediaRemovalCompleted.bind(this,e.playlist_id),this.onPlaylistMediaRemovalFailed.bind(this,e.playlist_id));break;case"APPEND_NEW_PLAYLIST":h[this.id].playlists.push(e.playlist_data),this.emit("playlists_load")}}},{key:"removeMediaResponse",value:function(e){e&&204===e.status&&this.emit("media_delete",h[this.id].mediaId)}},{key:"removeMediaFail",value:function(){this.emit("media_delete_fail",h[this.id].mediaId),setTimeout((function(e){h[e.id].while.deleteMedia=null}),100,this)}},{key:"removeCommentFail",value:function(e){this.emit("comment_delete_fail",h[this.id].while.deleteCommentId),setTimeout((function(e){h[e.id].while.deleteCommentId=null}),100,this)}},{key:"removeCommentResponse",value:function(e){if(e&&204===e.status){var t,n=[];for(t in h[this.id].comments)h[this.id].comments.hasOwnProperty(t)&&h[this.id].while.deleteCommentId!==h[this.id].comments[t].uid&&n.push(h[this.id].comments[t]);h[this.id].comments=n,n=null,this.emit("comment_delete",h[this.id].while.deleteCommentId)}setTimeout((function(e){h[e.id].while.deleteCommentId=null}),100,this)}},{key:"submitCommentFail",value:function(e){this.emit("comment_submit_fail"),setTimeout((function(e){h[e.id].while.submitComment=!1}),100,this)}},{key:"submitCommentResponse",value:function(e){e&&201===e.status&&e.data&&Object.keys(e.data)&&(h[this.id].comments.push(e.data),this.emit("comment_submit",e.data.uid)),setTimeout((function(e){h[e.id].while.submitComment=!1}),100,this)}}])&&u(t.prototype,n),c}(o());t.Z=(0,a.v$)(new y,"actions_handler")},5971:function(e,t,n){n.d(t,{CE:function(){return a},X1:function(){return r}});var i=n(8416),o=n.n(i);function a(e){o().dispatch({type:"UPDATE_PLAYLIST",playlist_data:e})}function r(e,t){o().dispatch({type:"MEDIA_REMOVED_FROM_PLAYLIST",media_id:e,playlist_id:t})}},8204:function(e,t,n){n.d(t,{T:function(){return p}}),n(5101);var i=n(5466),o=(n(6116),n(8349)),a=n(9690),r=n(2802);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(m,e);var t,n,s,p,f=(s=m,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(s);if(p){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function m(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),n=f.call(this,e),void 0!==t&&o.df(t),n}return t=m,(n=[{key:"render",value:function(){return[i.createElement(a.Z,{key:"page-main"},this.pageContent()),i.createElement(r.Z,{key:"notifications"})]}}])&&l(t.prototype,n),m}(i.PureComponent)},8349:function(e,t,n){n.d(t,{sc:function(){return a},df:function(){return r},Zr:function(){return s},vh:function(){return l},Qb:function(){return c},p$:function(){return u},wN:function(){return d}});var i=n(8416),o=n.n(i);function a(){o().dispatch({type:"TOGGLE_PAGE_SIDEBAR"})}function r(e){o().dispatch({type:"INIT_PAGE",page:e})}function s(e){o().dispatch({type:"INIT_SIDEBAR",page:e})}function l(e){o().dispatch({type:"TOGGLE_MOBILE_SEARCH_FIELD",open:e})}function c(e){o().dispatch({type:"TOGGLE_DARK_THEME"})}function u(){o().dispatch({type:"TOGGLE_AUTO_PLAY"})}function d(e,t){o().dispatch({type:"ADD_NOTIFICATION",notification:e,notificationId:t})}},4426:function(e,t,n){n(5101),n(9751),n(2322),n(9006),n(9268),n(5466);var i,o,a=n(1590),r=n.n(a),s=n(4860),l=n(8420),c=n(8024),u=n(8680);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=null,g=null,v=function(e){return g.url[e]||"#"},w=function(e){return g.url.user[e]||"#"},_=function(e){return g.url.search[e]||"#"},k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(d,e);var t,n,a,r,l=(a=d,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(a);if(r){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function d(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),t=l.call(this),b||(g=(0,u.v)(window.MediaCMS),o=new s.Z(g.site.id,86400),(b={visibleMobileSearch:!1,useDarkTheme:o.get("use-dark-theme"),mediaAutoPlay:o.get("media-auto-play"),visiblePageSidebar:o.get("visible-sidebar"),existsPageSidebar:!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),notifications:{},notificationsTime:{}}).mediaAutoPlay=null===b.mediaAutoPlay||b.mediaAutoPlay,b.useDarkTheme=null!==b.useDarkTheme?b.useDarkTheme:"dark"===g.theme.mode,b.visiblePageSidebar=1023<window.innerWidth&&(null===b.visiblePageSidebar||b.visiblePageSidebar)),b.useDarkTheme?(0,c.Ec)(document.body,"dark_theme"):(0,c.dt)(document.body,"dark_theme"),t.onWindowResize=t.onWindowResize.bind(h(t)),t.onWindowScroll=t.onWindowScroll.bind(h(t)),t.onDocumentVisibilityChange=t.onDocumentVisibilityChange.bind(h(t)),window.addEventListener("resize",t.onWindowResize),window.addEventListener("scroll",t.onWindowScroll),document.addEventListener("visibilitychange",t.onDocumentVisibilityChange),t}return t=d,(n=[{key:"onDocumentVisibilityChange",value:function(){this.emit("document_visibility_change")}},{key:"onWindowScroll",value:function(){this.emit("window_scroll")}},{key:"onWindowResize",value:function(){this.windowWidth=window.outerWidth,this.windowInnerWidth=window.innerWidth,this.windowHeight=window.outerHeight,this.windowInnerHeight=window.innerHeight,this.emit("window_resize")}},{key:"initPage",value:function(e){b.existsPageSidebar||(b.existsPageSidebar=!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),b.existsPageSidebar&&(b.visiblePageSidebar=o.get("visible-sidebar"),b.visiblePageSidebar=null!==b.visiblePageSidebar?b.visiblePageSidebar:1023<window.innerWidth,this.emit("updated_existsPageSidebar"))),b.currentPage=e,"media"===e&&(b.visiblePageSidebar=!1,(0,c.dt)(document.body,"visible-sidebar"),this.windowWidth=window.outerWidth,this.windowInnerWidth=window.innerWidth),this.clearNotificationsTimeoutId=null;var t=window.MediaCMS.notifications?JSON.parse(window.MediaCMS.notifications):"";if(""!==t){var n=Object.keys(t);if(n.length)for(var i=0;i<n.length;)setTimeout(function(e){var t=(new Date).getTime(),n=t+"["+t+"]";b.notifications[n]=e,b.notificationsTime[n]=t,this.emit("added_notification"),this.clearNotifications()}.bind(this),100*i,t[n[i]]),i+=1}}},{key:"get",value:function(e){var t,n;switch(e){case"current-page":t=b.currentPage;break;case"page-sidebar-exists":t=b.existsPageSidebar;break;case"is-visible-mobile-search":t=b.visibleMobileSearch;break;case"is-visible-page-sidebar":t=b.visiblePageSidebar;break;case"use-dark-theme":t=b.useDarkTheme;break;case"media-auto-play":t=b.mediaAutoPlay;break;case"config-enabled":t=g.enabled;break;case"config-media-item":t=g.media.item;break;case"config-media-share":t=g.media.share;break;case"config-playlists":t=g.playlists;break;case"config-site":t=g.site;break;case"config-theme":t=g.theme;break;case"config-user":t=g.member;break;case"config-contents":t=g.contents;break;case"config-options":t=g.options;break;case"notifications":t=b.notifications;break;case"is-logged-in":t=!g.member.is.anonymous;break;case"window-width":t=this.windowWidth||window.outerWidth;break;case"window-inner-width":t=this.windowInnerWidth||window.innerWidth;break;case"window-height":t=this.windowHeight||window.outerHeight;break;case"window-inner-height":t=this.windowInnerHeight||window.innerHeight;break;case"url-search":t=_("base");break;case"url-archive-tag":case"url-archive-category":case"url-archive-topic":case"url-archive-country":case"url-archive-language":t=_(e.split("-")[2]);break;case"api-archive-tags":case"api-archive-categories":case"api-archive-topics":case"api-archive-countries":case"api-archive-languages":n=e.split("-")[2],t=g.api.archive[n]||null;break;case"api-manage-media":case"api-manage-users":case"api-manage-comments":t=function(e){return g.api.manage[e]||null}(e.split("-")[2]);break;case"api-media":case"api-featured":case"api-recommended":case"api-playlists":case"api-users":case"api-history":t=function(e){return g.api[e]||null}(e.split("-")[1]);break;case"api-search-query":case"api-search-titles":t=function(e){return g.api.search[e]||null}(e.split("-")[2]);break;case"api-user-liked":case"api-user-history":case"api-user-playlists":t=function(e){return g.api.user[e]||null}(e.split("-")[2]);break;case"url-user-prefix":t=v("home")+"/user";break;case"url-home":case"url-signin":case"url-signout":case"url-register":case"url-latest-media":case"url-featured-media":case"url-recommended-media":case"url-members":case"url-error404":case"url-embed":case"url-admin":case"url-playlists":t=v(e.split("-")[1]);break;case"url-profile-home":case"url-profile-media":case"url-profile-about":case"url-profile-playlists":t=function(e){return g.url.profile[e]||"#"}(e.split("-")[2]);break;case"url-change-password":t=v("changePassword");break;case"url-tags":case"url-categories":case"url-topics":case"url-countries":case"url-languages":t=function(e){return g.url.archive[e]||"#"}(e.split("-")[1]);break;case"url-manage-media":case"url-manage-users":case"url-manage-comments":t=function(e){return g.url.manage[e]||"#"}(e.split("-")[2]);break;case"url-history":case"url-liked-media":t=w(e.split("-")[1]);break;case"url-uploader":t=w("addMedia");break;case"url-edit-profile":t=w("editProfile");break;case"url-logged-in-user-profile-url":t=g.member.pages.home||"#";break;case"user-name":case"user-username":case"user-thumbnail":t=function(e){return g.member[e]||null}(e.split("-")[1])}return t}},{key:"clearNotifications",value:function(){var e,t,n=!1,i=!1,o=Object.keys(b.notificationsTime);if(o.length)for(t=new Date((new Date).valueOf()-6001),e=0;e<o.length;)t.getTime()<b.notificationsTime[o[e]]?i=!0:(n=!0,b.notifications[o[e]]=void 0,b.notificationsTime[o[e]]=void 0),e+=1;n&&(b.notifications=JSON.parse(JSON.stringify(b.notifications)),b.notificationsTime=JSON.parse(JSON.stringify(b.notificationsTime)),this.emit("cleared_notification")),i&&(this.clearNotificationsTimeoutId&&clearTimeout(this.clearNotificationsTimeoutId),this.clearNotificationsTimeoutId=setTimeout(function(){this.clearNotifications(),this.clearNotificationsTimeoutId=null}.bind(this),1e3))}},{key:"actions_handler",value:function(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page);break;case"INIT_SIDEBAR":"media"!==b.currentPage&&b.visiblePageSidebar&&((0,c.Ec)(document.body,"visible-sidebar"),this.emit("changed_page_sidebar_visibility"));break;case"TOGGLE_PAGE_SIDEBAR":clearTimeout(i),(0,c.Ec)(document.body,"sliding-sidebar"),i=setTimeout(function(){b.visiblePageSidebar=!b.visiblePageSidebar,(b.visiblePageSidebar?c.Ec:c.dt)(document.body,"visible-sidebar"),"media"===b.currentPage?(b.visiblePageSidebar?c.Ec:c.dt)(document.body,"overflow-hidden"):((!b.visiblePageSidebar||767<window.innerWidth?c.dt:c.Ec)(document.body,"overflow-hidden"),o.set("visible-sidebar",b.visiblePageSidebar)),this.emit("changed_page_sidebar_visibility"),i=setTimeout((function(){i=null,(0,c.dt)(document.body,"sliding-sidebar")}),220)}.bind(this),20);break;case"COMPLETE_SIDEBAR_VISIBILITY_CHANGE":this.emit("completed_page_sidebar_visibility_change");break;case"TOGGLE_MOBILE_SEARCH_FIELD":b.visibleMobileSearch=!!e.open,this.emit("changed_mobile_search_field_visibility");break;case"TOGGLE_AUTO_PLAY":b.mediaAutoPlay=!b.mediaAutoPlay,o.set("media-auto-play",b.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"TOGGLE_DARK_THEME":b.useDarkTheme=!b.useDarkTheme,b.useDarkTheme?(0,c.Ec)(document.body,"dark_theme"):(0,c.dt)(document.body,"dark_theme"),o.set("use-dark-theme",b.useDarkTheme),this.emit("switched_theme");break;case"ADD_NOTIFICATION":var t=(new Date).getTime(),n=(e.notificationId||t)+"["+t+"]";void 0===b.notifications[n]&&(b.notifications[n]=e.notification,b.notificationsTime[n]=t,this.emit("added_notification"),this.clearNotifications())}}}])&&p(t.prototype,n),d}(r());t.Z=(0,l.v$)(new k,"actions_handler")}},t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.m=e,n.x=function(){},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=411,function(){var e={411:0},t=[[3921,431]],i=function(){},o=function(o,a){for(var r,s,l=a[0],c=a[1],u=a[2],d=a[3],p=0,f=[];p<l.length;p++)s=l[p],n.o(e,s)&&e[s]&&f.push(e[s][0]),e[s]=0;for(r in c)n.o(c,r)&&(n.m[r]=c[r]);for(u&&u(n),o&&o(a);f.length;)f.shift()();return d&&t.push.apply(t,d),i()},a=self.webpackChunk_mediacms_frontend=self.webpackChunk_mediacms_frontend||[];function r(){for(var i,o=0;o<t.length;o++){for(var a=t[o],r=!0,s=1;s<a.length;s++){var l=a[s];0!==e[l]&&(r=!1)}r&&(t.splice(o--,1),i=n(n.s=a[0]))}return 0===t.length&&(n.x(),n.x=function(){}),i}a.forEach(o.bind(null,0)),a.push=o.bind(null,a.push.bind(a));var s=n.x;n.x=function(){return n.x=s||function(){},(i=r)()}}(),n.x()}();