mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-20 21:24:42 -05:00
7 lines
31 KiB
JavaScript
7 lines
31 KiB
JavaScript
/**
|
|
* videojs-share
|
|
* @version 2.0.1
|
|
* @copyright 2018 Mikhail Khazov <mkhazov.work@gmail.com>
|
|
* @license MIT
|
|
*/
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):t.videojsShare=e(t.videojs)}(this,function(t){"use strict";function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),o=document.createRange();o.selectNodeContents(t),i.removeAllRanges(),i.addRange(o),e=i.toString()}return e}function i(){}function o(t,e){for(;t&&t.nodeType!==J;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}function r(t,e,n,i,o){var r=l.apply(this,arguments);return t.addEventListener(n,r,o),{destroy:function(){t.removeEventListener(n,r,o)}}}function a(t,e,n,i,o){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return r(t,e,n,i,o)}))}function l(t,e,n,i){return function(n){n.delegateTarget=Q(n.target,e),n.delegateTarget&&i.call(t,n)}}function s(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!G.string(e))throw new TypeError("Second argument must be a String");if(!G.fn(n))throw new TypeError("Third argument must be a Function");if(G.node(t))return c(t,e,n);if(G.nodeList(t))return u(t,e,n);if(G.string(t))return h(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function u(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function h(t,e,n){return Z(document.body,t,e,n)}function d(t){return Object.keys(t).filter(function(e){return void 0!==t[e]&&""!==t[e]}).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fbAppId,n=t.url,i=t.redirectUri;if(!e)throw new Error("fbAppId is not defined");var o=d({app_id:e,display:"popup",redirect_uri:i,link:n});return window.open("https://www.facebook.com/dialog/feed?"+o,"_blank",et)}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fbAppId,n=t.url,i=t.hashtag,o=t.redirectUri;if(!e)throw new Error("fbAppId is not defined");var r=d({app_id:e,display:"popup",redirect_uri:o,href:n,hashtag:i});return window.open("https://www.facebook.com/dialog/share?"+r,"_blank",et)}function v(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).url;if(!t)throw new Error("url is not defined");var e=d({kid_directed_site:"0",sdk:"joey",u:t,display:"popup",ref:"plugin",src:"share_button"});return window.open("https://www.facebook.com/sharer/sharer.php?"+e,"_blank",et)}function g(){var t=d({url:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).url});return window.open("https://plus.google.com/share?"+t,"_blank",et)}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=d({share_url:t.url,title:t.title,description:t.description,imageurl:t.image});return window.open("http://connect.mail.ru/share?"+e,"_blank",et)}function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,n=t.title,i=t.description,o=(n||"")+"\r\n"+(i||"")+"\r\n"+(e||""),r="mailto:?body="+encodeURIComponent(o);return window.location.assign(r)}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=d({"st.cmd":"addShare","st._surl":t.url,title:t.title});return window.open("https://ok.ru/dk?"+e,"_blank",et)}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=d({url:t.url,text:t.title});return window.open("https://t.me/share/url?"+e,"_blank",et)}function k(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.title,n=t.url,i=t.hashtags,o=d({text:e,url:n,hashtags:(void 0===i?[]:i).join(",")});return window.open("https://twitter.com/intent/tweet?"+o,"_blank",et)}function _(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=d({url:t.url,title:t.title});return window.open("https://www.reddit.com/submit?"+e,"_blank",et)}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.description,n=d({url:t.url,description:e,media:t.media});return window.open("https://pinterest.com/pin/create/button/?"+n,"_blank",et)}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,n=t.title,i=t.caption,o=t.tags,r=void 0===o?[]:o,a=t.posttype,l=void 0===a?"link":a,s=d({canonicalUrl:e,title:n,caption:i,tags:r.join(","),posttype:l});return window.open("https://www.tumblr.com/widgets/share/tool?"+s,"_blank",et)}function E(){return!!window.navigator.userAgent.match(/Version\/[\d.]+.*Safari/)}function j(t){return E()?window.open(t):window.location.assign(t)}function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,n=t.title;if(!e&&!n)throw new Error("url and title not specified");return j("viber://forward?"+d({text:[n,e].filter(function(t){return t}).join(" ")}))}function F(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.url,n=t.image,i=t.isVkParse,o=t.description,r=t.title;o&&o.length>nt&&(o=o.substr(0,nt)+"..."),r&&r.length>nt&&(r=r.substr(0,nt)+"...");return"https://vk.com/share.php?"+d(i?{url:e}:{url:e,title:r,description:o,image:n,noparse:!0})}function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return window.open(F(t),"_blank",et)}function T(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.phone,n=d({text:[t.title,t.url].filter(function(t){return t}).join(" "),phone:e});return window.open("https://api.whatsapp.com/send?"+n,"_blank",et)}function z(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.title,n=t.url,i=d({title:e,summary:t.description,url:n});return window.open("https://www.linkedin.com/shareArticle?mini=true&"+i,"_blank",et)}function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.fbAppId,n=t.url;if(!e)throw new Error("fbAppId is not defined");var i=d({app_id:e,link:n});return window.location.assign("fb-messenger://share?"+i)}function O(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.title,n=t.url;if(!n)throw new Error("url is not defined");var i=encodeURIComponent(""+n);return e&&(i=""+encodeURIComponent(e+" ")+i),window.open("https://line.me/R/msg/text/?"+i,"_blank",et)}function L(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0}function V(){return/Android/.test(window.navigator.userAgent)||/iP(hone|ad|od)/i.test(window.navigator.userAgent)}function H(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?V()?t:t.filter(function(t){return!ot.includes(t)}):t}t="default"in t?t.default:t;var I=function(){return window.location.href}(),P={mobileVerification:!0,title:"Video",url:I,socials:["fbFeed","tw","reddit","gp","messenger","linkedin","vk","ok","mail","telegram","whatsapp","viber"],embedCode:function(){return"<iframe src='"+I+"' width='560' height='315' frameborder='0' allowfullscreen></iframe>"}(),redirectUri:function(){return I+"#close_window"}()},R=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},U=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),N=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},B=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},q=function(t){function e(n,i){R(this,e);var o=B(this,t.call(this,n,i));return o.addClass("vjs-menu-button"),o.addClass("vjs-share-control"),o.addClass("vjs-icon-share"),o.controlText(n.localize("Share")),o}return N(e,t),e.prototype.handleClick=function(){this.player().getChild("ShareOverlay").open()},e}(videojs.getComponent("Button")),D=function(t){function e(n,i){R(this,e);var o=B(this,t.call(this,n,i));return o.playerClassName="vjs-videojs-share_open",o}return N(e,t),e.prototype.open=function(){var e=this.player();e.addClass(this.playerClassName),t.prototype.open.call(this),e.trigger("sharing:opened")},e.prototype.close=function(){var e=this.player();e.removeClass(this.playerClassName),t.prototype.close.call(this),e.trigger("sharing:closed")},e}(videojs.getComponent("ModalDialog")),Y=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,n),W=e(function(t,e){!function(e,n){n(t,Y)}(0,function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(t){return t&&t.__esModule?t:{default:t}}(e),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return r(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":o(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})});i.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function i(){o.off(t,i),e.apply(n,arguments)}var o=this;return i._=e,this.on(t,i,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,o=n.length;for(i;i<o;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],o=[];if(i&&e)for(var r=0,a=i.length;r<a;r++)i[r].fn!==e&&i[r].fn._!==e&&o.push(i[r]);return o.length?n[t]=o:delete n[t],this}};var X=i,G=e(function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}}),J=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var K=Element.prototype;K.matches=K.matchesSelector||K.mozMatchesSelector||K.msMatchesSelector||K.oMatchesSelector||K.webkitMatchesSelector}var Q=o,Z=a,$=s,tt=function(t){return t&&t.__esModule?t.default:t}(e(function(t,e){!function(e,n){n(t,W,X,$)}(0,function(t,e,n,i){function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var c=o(e),u=o(n),h=o(i),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),p=function(t){function e(t,n){r(this,e);var i=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.resolveOptions(n),i.listenClick(t),i}return l(e,t),f(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,h.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new c.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(u.default);t.exports=p})})),et="scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0",nt=80,it=(Object.freeze||Object)({fbFeed:f,fbShare:p,fbButton:v,gp:g,mail:m,email:w,ok:y,telegram:b,tw:k,reddit:_,pinterest:C,tumblr:x,viber:S,getVkUrl:F,vk:A,whatsapp:T,linkedin:z,messenger:M,line:O}),ot=["whatsapp","viber","messenger"],rt={fbFeed:'<svg width="8" height="16" viewbox="0 0 8 16" xmlns="http://www.w3.org/2000/svg">\n <path d="M5.937 2.752h1.891V.01L5.223 0c-2.893 0-3.55 2.047-3.55 3.353v1.829H0v2.824h1.673V16H5.19V8.006h2.375l.308-2.824H5.19v-1.66c0-.624.44-.77.747-.77" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',tw:'<svg width="18" height="15" viewbox="0 0 18 15" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 12.616a10.657 10.657 0 0 0 5.661 1.615c6.793 0 10.507-5.476 10.507-10.223 0-.156-.003-.31-.01-.464A7.38 7.38 0 0 0 18 1.684a7.461 7.461 0 0 1-2.12.564A3.621 3.621 0 0 0 17.503.262c-.713.411-1.505.71-2.345.871A3.739 3.739 0 0 0 12.462 0C10.422 0 8.77 1.607 8.77 3.59c0 .283.033.556.096.82A10.578 10.578 0 0 1 1.254.656a3.506 3.506 0 0 0-.5 1.807c0 1.246.65 2.346 1.642 2.99a3.731 3.731 0 0 1-1.673-.45v.046c0 1.74 1.274 3.193 2.962 3.523a3.756 3.756 0 0 1-.972.126c-.239 0-.47-.022-.695-.064.469 1.428 1.833 2.467 3.449 2.494A7.531 7.531 0 0 1 .88 12.665c-.298 0-.591-.014-.881-.049" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',reddit:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24">\n <path d="M24 11.779a2.654 2.654 0 0 0-4.497-1.899c-1.81-1.191-4.259-1.949-6.971-2.046l1.483-4.669 4.016.941-.006.058a2.17 2.17 0 0 0 2.174 2.163c1.198 0 2.172-.97 2.172-2.163a2.171 2.171 0 0 0-4.193-.785l-4.329-1.015a.37.37 0 0 0-.44.249L11.755 7.82c-2.838.034-5.409.798-7.3 2.025a2.643 2.643 0 0 0-1.799-.712A2.654 2.654 0 0 0 0 11.779c0 .97.533 1.811 1.317 2.271a4.716 4.716 0 0 0-.086.857C1.231 18.818 6.039 22 11.95 22s10.72-3.182 10.72-7.093c0-.274-.029-.544-.075-.81A2.633 2.633 0 0 0 24 11.779zM6.776 13.595c0-.868.71-1.575 1.582-1.575.872 0 1.581.707 1.581 1.575s-.709 1.574-1.581 1.574-1.582-.706-1.582-1.574zm9.061 4.669c-.797.793-2.048 1.179-3.824 1.179L12 19.44l-.013.003c-1.777 0-3.028-.386-3.824-1.179a.369.369 0 0 1 0-.523.372.372 0 0 1 .526 0c.65.647 1.729.961 3.298.961l.013.003.013-.003c1.569 0 2.648-.315 3.298-.962a.373.373 0 0 1 .526 0 .37.37 0 0 1 0 .524zm-.189-3.095a1.58 1.58 0 0 1-1.581-1.574c0-.868.709-1.575 1.581-1.575s1.581.707 1.581 1.575-.709 1.574-1.581 1.574z" fill="#FFF" fill-rule="evenodd"/>\n</svg>\n',gp:'<svg width="21" height="14" viewbox="0 0 21 14" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.816.006C8.5-.071 10.08.646 11.37 1.655a24.11 24.11 0 0 1-1.728 1.754C8.091 2.36 5.89 2.06 4.34 3.272c-2.217 1.503-2.317 5.05-.186 6.668 2.073 1.843 5.991.928 6.564-1.895-1.298-.02-2.6 0-3.899-.042-.003-.76-.006-1.518-.003-2.278 2.17-.006 4.341-.01 6.516.007.13 1.786-.11 3.688-1.23 5.164-1.696 2.34-5.1 3.022-7.756 2.02C1.681 11.921-.207 9.161.018 6.348.077 2.905 3.305-.11 6.816.006zm10.375 3.812h1.893c.004.634.007 1.27.014 1.903.632.007 1.27.007 1.902.013v1.893l-1.902.016c-.007.636-.01 1.27-.014 1.902h-1.896c-.006-.632-.006-1.266-.013-1.899l-1.902-.02V5.735c.633-.006 1.266-.01 1.902-.013.004-.636.01-1.27.016-1.903z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',messenger:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 223 223" width="512" height="512">\n <path d="M111.5 0C50.5 0 0.8 47 0.8 104.7c0 31.1 14.5 60.3 39.7 80.3 3.3 2.6 8 2 10.5-1.2 2.6-3.2 2-8-1.2-10.5 -21.6-17.1-34-42.1-34-68.5C15.8 55.2 58.7 15 111.5 15c52.8 0 95.7 40.2 95.7 89.7 0 49.4-42.9 89.7-95.7 89.7 -9.2 0-18.3-1.2-27.1-3.6 -1.9-0.5-4-0.3-5.7 0.7l-31.1 17.6c-3.6 2-4.9 6.6-2.8 10.2 1.4 2.4 3.9 3.8 6.5 3.8 1.3 0 2.5-0.3 3.7-1l28.4-16.1c9.1 2.2 18.5 3.4 28 3.4 61.1 0 110.7-47 110.7-104.7C222.3 47 172.6 0 111.5 0z" fill="#FFF" fill-rule="evenodd"/>\n <path d="M114.7 71.9c-2.6-1.2-5.8-0.8-8 1.1l-57.9 49.1c-3.2 2.7-3.6 7.4-0.9 10.6 2.7 3.2 7.4 3.6 10.6 0.9l45.5-38.6v35.9c0 2.9 1.7 5.6 4.3 6.8 1 0.5 2.1 0.7 3.2 0.7 1.7 0 3.5-0.6 4.9-1.8l57.9-49.1c3.2-2.7 3.6-7.4 0.9-10.6 -2.7-3.2-7.4-3.6-10.6-0.9l-45.5 38.6V78.7C119 75.7 117.3 73.1 114.7 71.9z" fill="#FFF" fill-rule="evenodd"/>\n</svg>\n',linkedin:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path fill="#FFF" fill-rule="evenodd" d="M4.98 3.5C4.98 4.881 3.87 6 2.5 6S.02 4.881.02 3.5C.02 2.12 1.13 1 2.5 1s2.48 1.12 2.48 2.5zM5 8H0v16h5V8zm7.982 0H8.014v16h4.969v-8.399c0-4.67 6.029-5.052 6.029 0V24H24V13.869c0-7.88-8.922-7.593-11.018-3.714V8z"/>\n</svg>\n',vk:'<svg width="22" height="12" viewbox="0 0 22 12" xmlns="http://www.w3.org/2000/svg">\n <path d="M10.764 11.94h1.315s.397-.042.6-.251c.187-.192.18-.552.18-.552s-.025-1.685.794-1.934c.807-.245 1.844 1.629 2.942 2.35.832.545 1.463.425 1.463.425l2.938-.039s1.537-.09.808-1.244c-.06-.095-.425-.855-2.184-2.415-1.843-1.633-1.596-1.37.623-4.195 1.351-1.72 1.892-2.771 1.722-3.22-.16-.43-1.154-.316-1.154-.316l-3.308.02s-.246-.033-.427.071c-.178.102-.292.34-.292.34s-.524 1.33-1.222 2.463C14.09 5.833 13.5 5.96 13.26 5.81c-.56-.346-.42-1.388-.42-2.13 0-2.315.368-3.28-.716-3.531-.36-.082-.624-.137-1.544-.146C9.4-.01 8.4.006 7.835.27c-.377.176-.668.568-.49.59.218.029.713.128.976.47.339.44.327 1.43.327 1.43s.195 2.725-.455 3.064c-.446.232-1.057-.242-2.371-2.41-.673-1.11-1.18-2.338-1.18-2.338S4.542.848 4.368.725C4.157.576 3.86.529 3.86.529L.717.549S.245.562.072.757c-.155.175-.012.536-.012.536s2.46 5.5 5.247 8.271c2.556 2.542 5.457 2.375 5.457 2.375" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',ok:'<svg width="12" height="18" viewbox="0 0 12 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.843 8.83c2.17-.468 4.162-2.626 3.521-5.3C9.863 1.442 7.561-.599 4.742.161c-6.148 1.662-3.661 9.912 2.1 8.668zm-1.6-6.458c1.39-.375 2.504.554 2.788 1.57.363 1.305-.592 2.394-1.618 2.657-2.913.747-4.16-3.43-1.17-4.227zM9.05 9.536c.41-.23.748-.608 1.367-.577.832.044 2.514 1.404-.445 2.824-1.624.778-1.699.558-2.972.926.22.411 2.55 2.453 3.214 3.082 1.103 1.046.164 2.234-.967 2.115-.718-.077-2.971-2.352-3.38-2.82-.92.438-2.541 2.674-3.431 2.81-1.175.182-2.155-1.091-.96-2.19L4.65 12.73c-.287-.145-1.171-.261-1.59-.389C-1.57 10.93.08 8.838 1.405 8.963c.478.046.907.42 1.274.621 1.931 1.05 4.463 1.029 6.37-.048z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',mail:'<svg width="17" height="16" viewbox="0 0 17 16" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.205 3.322c1.3 0 2.521.563 3.418 1.445v.003c0-.423.29-.742.694-.742l.101-.001c.631 0 .76.586.76.771l.004 6.584c-.045.431.454.653.73.377 1.077-1.086 2.366-5.585-.67-8.192-2.831-2.43-6.629-2.03-8.649-.664-2.146 1.453-3.52 4.668-2.185 7.688 1.455 3.294 5.617 4.276 8.091 3.296 1.253-.496 1.832 1.165.53 1.708-1.965.822-7.438.74-9.994-3.605C-.692 9.057-.6 3.896 3.98 1.222c3.505-2.046 8.125-1.48 10.91 1.374 2.913 2.985 2.743 8.572-.097 10.745-1.288.986-3.199.025-3.187-1.413l-.013-.47a4.827 4.827 0 0 1-3.388 1.381c-2.566 0-4.825-2.215-4.825-4.733 0-2.543 2.259-4.784 4.825-4.784zm3.231 4.602C11.34 6.08 9.944 4.97 8.26 4.97h-.063c-1.945 0-3.023 1.5-3.023 3.204 0 1.908 1.305 3.113 3.015 3.113 1.907 0 3.162-1.37 3.252-2.992l-.004-.372z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',telegram:'<svg width="21" height="17" viewbox="0 0 21 17" xmlns="http://www.w3.org/2000/svg">\n <path d="M10.873 13.323c-.784.757-1.56 1.501-2.329 2.252-.268.262-.57.407-.956.387-.263-.014-.41-.13-.49-.378-.589-1.814-1.187-3.626-1.773-5.44a.425.425 0 0 0-.322-.317A417.257 417.257 0 0 1 .85 8.541a2.37 2.37 0 0 1-.59-.265c-.309-.203-.353-.527-.07-.762.26-.216.57-.397.886-.522C2.828 6.304 4.59 5.638 6.35 4.964L19.039.101c.812-.311 1.442.12 1.366.988-.05.572-.2 1.137-.32 1.702-.938 4.398-1.88 8.794-2.82 13.191l-.003.026c-.23 1.006-.966 1.28-1.806.668-1.457-1.065-2.91-2.134-4.366-3.201-.068-.05-.14-.098-.217-.152zm-3.22 1.385c.023-.103.038-.151.043-.2.092-.989.189-1.977.27-2.967a.732.732 0 0 1 .256-.534c2.208-1.968 4.41-3.943 6.613-5.917.626-.561 1.256-1.12 1.876-1.688.065-.06.08-.174.117-.263-.095-.027-.203-.095-.285-.072-.189.052-.38.127-.545.23C12.722 5.343 9.45 7.395 6.175 9.44c-.167.104-.214.19-.147.389.518 1.547 1.022 3.098 1.531 4.648.02.061.048.12.094.23z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',whatsapp:'<svg width="22" height="22" viewbox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">\n <path d="M7.926 5.587c-.213-.51-.375-.53-.698-.543a6.234 6.234 0 0 0-.369-.013c-.42 0-.86.123-1.125.395-.323.33-1.125 1.1-1.125 2.677 0 1.578 1.15 3.104 1.306 3.318.162.213 2.244 3.498 5.476 4.837 2.528 1.048 3.278.95 3.853.828.84-.181 1.894-.802 2.16-1.552.265-.75.265-1.39.187-1.527-.078-.135-.291-.213-.614-.375-.323-.161-1.894-.937-2.192-1.04-.29-.11-.569-.072-.788.239-.31.433-.614.873-.86 1.138-.194.207-.511.233-.776.123-.356-.149-1.351-.498-2.58-1.591-.95-.847-1.596-1.901-1.784-2.218-.187-.323-.02-.511.13-.685.161-.201.316-.343.478-.53.161-.188.252-.285.355-.505.11-.214.033-.434-.045-.595-.078-.162-.724-1.74-.99-2.38zM10.996 0C4.934 0 0 4.934 0 11c0 2.405.776 4.636 2.095 6.447L.724 21.534l4.228-1.351A10.913 10.913 0 0 0 11.003 22C17.067 22 22 17.066 22 11S17.067 0 11.003 0h-.006z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n',viber:'<svg width="21" height="21" viewbox="0 0 21 21" xmlns="http://www.w3.org/2000/svg">\n <path d="M18.639 14.904c-.628-.506-1.3-.96-1.96-1.423-1.318-.926-2.523-.997-3.506.491-.552.836-1.325.873-2.133.506-2.228-1.01-3.949-2.567-4.956-4.831-.446-1.002-.44-1.9.603-2.609.552-.375 1.108-.818 1.064-1.637C7.693 4.334 5.1.765 4.077.39 3.653.233 3.23.243 2.8.388.4 1.195-.594 3.169.358 5.507c2.84 6.974 7.84 11.829 14.721 14.792.392.169.828.236 1.049.297 1.567.015 3.402-1.494 3.932-2.992.51-1.441-.568-2.013-1.421-2.7zm-7.716-13.8c-.417-.064-1.052.026-1.02-.525.046-.817.8-.513 1.165-.565 4.833.163 8.994 4.587 8.935 9.359-.006.468.162 1.162-.536 1.149-.668-.013-.493-.717-.553-1.185-.64-5.067-2.96-7.46-7.991-8.233zm.984 1.39c3.104.372 5.64 3.065 5.615 6.024-.047.35.157.95-.409 1.036-.764.116-.615-.583-.69-1.033-.511-3.082-1.593-4.213-4.7-4.907-.458-.102-1.17-.03-1.052-.736.113-.671.752-.443 1.236-.385zm.285 2.419c1.377-.034 2.992 1.616 2.969 3.044.014.39-.028.802-.49.857-.333.04-.552-.24-.586-.585-.128-1.272-.798-2.023-2.073-2.228-.382-.061-.757-.184-.579-.7.12-.345.436-.38.76-.388z" fill="#FFF" fill-rule="evenodd"></path>\n</svg>\n'},at=function(){function t(e,n){R(this,t),this.player=e,this.options=n,this.socials=H(n.socials,n.mobileVerification),this.copyBtnTextClass="vjs-share__btn-text",this.socialBtnClass="vjs-share__social",this._createContent(),this._initToggle(),this._initClipboard(),this._initSharing()}return t.prototype.getContent=function(){return this.content},t.prototype._createContent=function(){var t='\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="20">\n <path fill="#FFF" fill-rule="evenodd" d="M10.07 20H1.318A1.325 1.325 0 0 1 0 18.67V6.025c0-.712.542-1.21 1.318-1.21h7.294l2.776 2.656v11.2c0 .734-.59 1.33-1.318 1.33zm6.46-15.926v9.63h-3.673v1.48h3.825c.727 0 1.318-.595 1.318-1.328v-11.2L15.225 0H7.93c-.776 0-1.318.497-1.318 1.21v2.123h1.47V1.48h5.877v2.594h2.57zm-.73-1.48l-.37-.357v.356h.37zM9.918 8.888v9.63H1.47V6.295h5.878V8.89h2.57zm-.73-1.483l-.372-.355v.355h.37z"></path>\n </svg>\n <span class="'+this.copyBtnTextClass+'">'+this.player.localize("Copy")+"</span>\n ",e=document.createElement("div");e.innerHTML='<div class="vjs-share">\n <div class="vjs-share__top hidden-sm">\n <div class="vjs-share__title">'+this.player.localize("Share")+'</div>\n </div>\n\n <div class="vjs-share__middle">\n <div class="vjs-share__subtitle hidden-xs">'+this.player.localize("Direct Link")+':</div>\n <div class="vjs-share__short-link-wrapper">\n <input class="vjs-share__short-link" type="text" readonly="true" value="'+this.options.url+'">\n <div class="vjs-share__btn">\n '+t+'\n </div>\n </div>\n\n <div class="vjs-share__subtitle hidden-xs">'+this.player.localize("Embed Code")+':</div>\n <div class="vjs-share__short-link-wrapper hidden-xs">\n <input class="vjs-share__short-link" type="text" readonly="true" value="'+this.options.embedCode+'">\n <div class="vjs-share__btn">\n '+t+'\n </div>\n </div>\n </div>\n\n <div class="vjs-share__bottom">\n <div class="vjs-share__socials">\n '+this._getSocialItems().join("")+"\n </div>\n </div>\n </div>",this.content=e.firstChild},t.prototype._initClipboard=function(){var t=this;new tt(".vjs-share__btn",{target:function(t){return t.previousElementSibling}}).on("success",function(e){var n=e.trigger.querySelector("."+t.copyBtnTextClass),i=function(){n.innerText=t.player.localize("Copy"),e.clearSelection()};n.innerText=t.player.localize("Copied"),L()?setTimeout(i,1e3):n.parentElement.addEventListener("mouseleave",function(){setTimeout(i,300)})})},t.prototype._initSharing=function(){var t=this,e=this.content.querySelectorAll("."+this.socialBtnClass);Array.from(e).forEach(function(e){e.addEventListener("click",function(e){var n=e.currentTarget.getAttribute("data-social");"function"==typeof it[n]&&it[n](t.socialOptions)})})},t.prototype._initToggle=function(){var t=this.content.querySelector(".vjs-share__socials");this.socials.length>10||window.innerWidth<=180&&this.socials.length>6?t.style.height="calc((2em + 5px) * 2)":t.classList.add("horizontal")},t.prototype._getSocialItems=function(){var t=[];return this.socials.forEach(function(e){rt[e]&&t.push('\n <button class="vjs-share__social vjs-share__social_'+e+'" data-social="'+e+'">\n '+rt[e]+"\n </button>\n ")}),t},U(t,[{key:"socialOptions",get:function(){var t=this.options;return{url:t.url,title:t.title,description:t.description,image:t.image,fbAppId:t.fbAppId,isVkParse:t.isVkParse,redirectUri:t.redirectUri}}}]),t}(),lt=function(t){function e(n,i){R(this,e);var o=B(this,t.call(this,n,i));return o.player=n,o.options=i,o}return N(e,t),e.prototype._createModal=function(){var t=new at(this.player,this.options).getContent();this.modal=new D(this.player,{content:t,temporary:!0}),this.el=this.modal.contentEl(),this.player.addChild(this.modal)},e.prototype.open=function(){this._createModal(),this.modal.open()},e}(videojs.getComponent("Component")),st=function(e){function n(i,o){R(this,n);var r=B(this,e.call(this,i));return r.options=t.mergeOptions(P,o),r.player.ready(function(){r.player.addClass("vjs-share"),i.addClass("vjs-videojs-share"),i.getChild("controlBar").addChild("ShareButton",o),i.addChild("ShareOverlay",o)}),r}return N(n,e),n}(t.getPlugin("plugin"));return st.defaultState={},st.VERSION="2.0.1",t.registerComponent("ShareButton",q),t.registerComponent("ShareOverlay",lt),t.registerPlugin("share",st),st}); |