text: /*! vk.video: v1.1.12 (webpack: v1.11.0) */
  !function(e){function t(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return e[s].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";var s,n=i(2),o=i(3),a=i(1),r=i(4),c=i(51),d=i(20),l=i(34);n.show=function(){stbWindowMgr.windowShow(n.data.windowId)},n.exit=function(){n.player&&n.player.stop(),window.parent!==window?window.parent.postMessage("hide","*"):(n.params.referrer=n.params.referrer||i(29)(),window.location.href=n.params.referrer||"file:///home/web/services.html")},n.addListeners({load:function(){var e=document.createElement("iframe");e.src="about:blank",e.style.display="none",document.body.appendChild(e),window.XMLHttpRequest=e.contentWindow.XMLHttpRequest,window.parent!==window&&window.parent.postMessage("show","*"),l.setVKButtonState(!0),l.setAppButtonState(!0),l.setServiceButtonState(!0),stbWindowMgr.SetVirtualKeyboardCoord("bottom"),s=i(26),n.params=i(48)(location.search.substring(1)),n.environment=JSON.parse(l.getEnv('{"varList":["hdmi_event_delay"]}')).result;try{n.settings=JSON.parse(l.loadUserData(r.file))}catch(t){n.settings={}}if(!n.settings.language){try{n.settings.language=JSON.parse(l.getEnv('{"varList":["language"]}')).result.language}catch(t){n.settings.language=""}-1===c.languages.indexOf(n.settings.language)&&(n.settings.language=c.languages[0])}void 0===n.settings.safeSearch&&(n.settings.safeSearch=!0),i(8).load({name:n.settings.language},function(e){e&&(self.languageIndex=-1),o.init([i(39),i(41),i(40),i(42),i(10),i(27),i(16)]),d.authorize(n.settings,function(){o.pages.forEach(function(e){e.emit("load")})})})},keydown:function(e){switch(e.code){case a.volumeDown:case a.volumeUp:case a.mute:s.changeVolume(e.code);break;case 2085:gSTB.GetStandByStatus()?gSTB.StandBy(!1):(gSTB.StandBy(!0),o.navigate("pageMenu"),location.reload())}},unload:function(){l.saveUserData(r.file,JSON.stringify(n.settings))}}),window.addEventListener("hashchange",function(){"#pageReload"===location.hash&&o.navigate("pageReload")})},function(e,t,i){"use strict";e.exports={back:8,"delete":46,channelPrev:1009,channelNext:9,ok:13,exit:27,up:38,down:40,left:37,right:39,pageUp:33,pageDown:34,end:35,home:36,volumeUp:107,volumeDown:109,f1:112,f2:113,f3:114,f4:115,refresh:116,frame:117,phone:119,set:120,tv:121,menu:122,web:123,mic:2032,rewind:2066,forward:2070,app:2076,usbMounted:2080,usbUnmounted:2081,playPause:2082,stop:2083,power:2085,record:2087,info:2089,mute:2192,clock:2032,audio:2071,keyboard:2076}},function(e,t,i){"use strict";var s,n,o=i(43),a=i(3),r=i(1),c={};i(46),window.parent&&window.parent.gSTB&&(window.dvbManager=window.parent.dvbManager,window.epgManager=window.parent.epgManager,window.gSTB=window.parent.gSTB,window.pvrManager=window.parent.pvrManager,window.stbDownloadManager=window.parent.stbDownloadManager,window.stbStorage=window.parent.stbStorage,window.stbUpdate=window.parent.stbUpdate,window.stbUPnP=window.parent.stbUPnP,window.stbWebWindow=window.parent.stbWebWindow,window.stbWindowMgr=window.parent.stbWindowMgr,window.timeShift=window.parent.timeShift),s=new o({debug:!1,host:!0,screen:null,time:{init:+new Date,load:0,done:0}}),s.setScreen=function(e){var t;return e?(e.availHeight=e.height-(e.availTop+e.availBottom),e.availWidth=e.width-(e.availLeft+e.availRight),window.moveTo(0,0),window.resizeTo(e.width,e.height),t=document.querySelector("link[rel=stylesheet]"),t&&t instanceof HTMLLinkElement&&document.head.removeChild(t),t=document.createElement("link"),t.rel="stylesheet",t.href="css/release."+e.height+".css?"+ +new Date,document.head.appendChild(t),this.data.metrics=e,!0):!1},s.EVENT_END_OF_FILE=1,s.EVENT_GET_MEDIA_INFO=2,s.EVENT_PLAYBACK_BEGIN=4,s.EVENT_CONTENT_ERROR=5,s.EVENT_DUAL_MONO_DETECT=6,s.EVENT_INFO_GET=7,s.EVENT_SUBTITLE_LOAD_ERROR=8,s.EVENT_SUBTITLE_FIND=9,s.EVENT_HDMI_CONNECT=32,s.EVENT_HDMI_DISCONNECT=33,s.EVENT_RECORD_FINISH_SUCCESSFULL=34,s.EVENT_RECORD_FINISH_ERROR=35,s.EVENT_DVB_SCANING=40,s.EVENT_DVB_FOUND=41,s.EVENT_DVB_CHANELL_EPG_UPDATE=42,s.EVENT_DVB_ANTENNA_OFF=43,s.setScreen(i(52)[screen.height]);for(n in r)"volumeUp"!==n&&"volumeDown"!==n&&(c[r[n]]=!0);s.defaultEvents={load:function(e){s.data.time.load=e.timeStamp,s.events[e.type]&&s.emit(e.type,e),a.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)}),s.data.time.done=+new Date,s.events.done&&s.emit("done",e)},unload:function(e){s.events[e.type]&&s.emit(e.type,e),a.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)})},error:function(e){},keydown:function(e){var t,i=a.current;0!==e.keyCode&&(e.code=e.keyCode,e.shiftKey&&(e.code+=1e3),e.altKey&&(e.code+=2e3),t=i.activeComponent,t&&t!==i&&(t.events[e.type]&&t.emit(e.type,e),!e.stop&&t.propagate&&t.parent&&t.parent.events[e.type]&&t.parent.emit(e.type,e)),e.stop||(i.events[e.type]&&i.emit(e.type,e),e.stop||s.events[e.type]&&s.emit(e.type,e)),s.data.host&&c[e.code]&&e.preventDefault())},keypress:function(e){var t=a.current;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e)},click:function(e){},contextmenu:function(e){e.preventDefault()},mousewheel:function(e){var t=a.current;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e),e.stop||t.events[e.type]&&t.emit(e.type,e)}};for(n in s.defaultEvents)window.addEventListener(n,s.defaultEvents[n]);window.stbEvent={},window.stbEvent.onEvent=function(e,t){if(Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onEvent&&i.stbEvent.onEvent(e,t)}),s.events.media){if(t)try{t=JSON.parse(t)}catch(i){}s.emit("media",{code:parseInt(e,10),info:t})}},window.stbEvent.onBroadcastMessage=function(e,t,i){Array.prototype.forEach.call(window.frames,function(s){s.stbEvent&&s.stbEvent.onBroadcastMessage&&s.stbEvent.onBroadcastMessage(e,t,i)}),s.events.message&&s.emit("message",{broadcast:!0,windowId:e,message:t,data:i})},window.stbEvent.onMessage=function(e,t,i){Array.prototype.forEach.call(window.frames,function(s){s.stbEvent&&s.stbEvent.onMessage&&s.stbEvent.onMessage(e,t,i)}),s.events.message&&s.emit("message",{broadcast:!1,windowId:e,message:t,data:i})},window.stbEvent.onMount=function(e){Array.prototype.forEach.call(window.frames,function(t){t.stbEvent&&t.stbEvent.onMount&&t.stbEvent.onMount(e)}),s.events["device:mount"]&&s.emit("device:mount",{state:e})},window.stbEvent.onMediaAvailable=function(e,t){Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onMediaAvailable&&i.stbEvent.onMediaAvailable(e,t)}),s.events["media:available"]&&s.emit("media:available",{mime:e,url:t})},window.stbEvent.onNetworkStateChange=function(e){s.events["internet:state"]&&s.emit("internet:state",{state:e})},window.stbEvent.onWebBrowserProgress=function(e){Array.prototype.forEach.call(window.frames,function(t){t.stbEvent&&t.stbEvent.onWebBrowserProgress&&t.stbEvent.onWebBrowserProgress(e)}),s.events["browser:progress"]&&s.emit("browser:progress",{progress:e})},window.stbEvent.onWindowActivated=function(){Array.prototype.forEach.call(window.frames,function(e){e.stbEvent&&e.stbEvent.onWindowActivated&&e.stbEvent.onWindowActivated()}),s.events["window:focus"]&&s.emit("window:focus")},window.gSTB&&gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),e.exports=s},function(e,t,i){"use strict";var s,n=i(7);s=new n,s.current=null,s.history=[],s.pages=[],s.ids={},s.init=function(e){var t,i,s;if(e){for(this.pages=[],this.pages=e,t=0,i=e.length;i>t;t++)s=e[t],this.ids[s.id]=s,s.active&&(this.current=s);return this.events.init&&this.emit("init",{pages:e}),!0}return!1},s.parse=function(e){var t={name:"",data:[]};return t.data=e.split("/").map(decodeURIComponent),t.name=t.data.shift().slice(1),t},s.stringify=function(e,t){return t=Array.isArray(t)?t:[],e=encodeURIComponent(e),t=t.map(encodeURIComponent),t.unshift(e),t.join("/")},s.show=function(e,t){return e&&!e.active?(e.$node.classList.add("active"),e.active=!0,this.current=e,e.events.show&&e.emit("show",{page:e,data:t}),!0):!1},s.hide=function(e){return e&&e.active?(e.$node.classList.remove("active"),e.active=!1,this.current=null,e.events.hide&&e.emit("hide",{page:e}),!0):!1},s.navigate=function(e,t){var i=this.current,s=this.ids[e];return s&&!s.active?(location.hash=this.stringify(e,t),this.hide(this.current),this.show(s,t),this.events.navigate&&this.emit("navigate",{from:i,to:s}),this.history.push(s),!0):!1},s.back=function(){var e,t;return this.history.length>1&&(e=this.history.pop(),t=this.history[this.history.length-1],t&&!t.active)?(location.hash=t.id,this.hide(this.current),this.show(t),this.events.navigate&&this.emit("navigate",{from:e,to:t}),!0):!1},e.exports=s},function(e,t){"use strict";e.exports={file:"vk.video.json",backend:{url:{authorization:"http://api.freemultiplex.com/v1/session",profile:"http://api.freemultiplex.com/v1/profile",searchHistory:"http://api.freemultiplex.com/v1/history/search",playbackHistory:"http://api.freemultiplex.com/v1/history/playback",favorite:"http://api.freemultiplex.com/v1/favorites/media"}},movieList:{},dataProviderType:{TYPE_SERVICE:1,TYPE_SEARCH:2,TYPE_HISTORY:3,TYPE_FAVORITE:4},playNext:!0,bufferSize:5,appRating:null,ads:!1,adsTimeout:36e5,proxyServer:"",volume:100,singleMode:{active:!0,name:"",hd:!0}}},function(e,t,i){"use strict";function s(e){var t,i=this;if(e=e||{},this.visible=!0,this.focusable=!0,this.$node=null,this.$body=null,this.parent=null,this.children=[],this.propagate=!!e.propagate,n.call(this,e.data),this.$node=e.$node||document.createElement("div"),this.$body=e.$body||this.$node,this.$node.className+=" component "+(e.className||""),this.id=e.id||this.$node.id||"cid"+a++,e.parent&&e.parent.add(this),e.visible===!1&&this.hide(),e.focusable===!1&&(this.focusable=!1),this.defaultEvents){e.events=e.events||{};for(t in this.defaultEvents)e.events[t]=e.events[t]||this.defaultEvents[t]}e.events&&this.addListeners(e.events),e.children&&this.add.apply(this,e.children),this.$node.addEventListener("click",function(e){0===e.button&&(i.focus(),i.events.click&&i.emit("click",{event:e})),e.stopPropagation()})}var n=i(7),o=i(3),a=0;s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.defaultEvents=null,s.prototype.add=function(e){var t;for(t=0;t<arguments.length;t++)e=arguments[t],this.children.push(e),e.parent=this,e.$node&&null===e.$node.parentNode&&this.$body.appendChild(e.$node),this.events.add&&this.emit("add",{item:e})},s.prototype.remove=function(){this.parent&&(o.current.activeComponent===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(e){e.remove()}),this.removeAllListeners(),this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},s.prototype.focus=function(e){var t=o.current,i=t.activeComponent;return this.focusable&&this!==i?(i&&i.blur(),t.activeComponent=i=this,i.$node.classList.add("focus"),i.events.focus&&i.emit("focus",e),!0):!1},s.prototype.blur=function(){var e=o.current,t=e.activeComponent;return this.$node.classList.remove("focus"),this===t?(e.activeComponent=null,this.events.blur&&this.emit("blur"),!0):!1},s.prototype.show=function(e){return this.visible?!0:(this.$node.classList.remove("hidden"),this.visible=!0,this.events.show&&this.emit("show",e),!0)},s.prototype.hide=function(){return this.visible?(this.$node.classList.add("hidden"),this.visible=!1,this.events.hide&&this.emit("hide"),!0):!0},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},this.active=!1,this.activeComponent=null,e.className="page "+(e.className||""),n.call(this,e),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}var n=i(5);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(){this.events={}}s.prototype={addListener:function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},once:function(e,t){var i=this;this.events[e]=this.events[e]||[],this.events[e].push(function s(n){t(n),i.removeListener(e,s)})},addListeners:function(e){var t;if("object"==typeof e)for(t in e)e.hasOwnProperty(t)&&this.addListener(t,e[t])},removeListener:function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==t}),0===this.events[e].length&&(this.events[e]=void 0))},removeAllListeners:function(e){0===arguments.length?this.events={}:e&&(this.events[e]=void 0)},emit:function(e,t){var i,s=this.events[e];if(s)for(i=0;i<s.length;i++)s[i].call(this,t)}},s.prototype.constructor=s,e.exports=s},function(module,exports,__webpack_require__){"use strict";var Emitter=__webpack_require__(7),gettext=new Emitter,meta=null,data=null;gettext.load=function(e,t){var i=new XMLHttpRequest;e.ext=e.ext||"json",e.path=e.path||"lang",i.responseType="text",i.onload=function(){var e;try{e=JSON.parse(i.responseText),meta=e.meta,data=e.data,t&&t(null,data)}catch(s){meta=null,data=null,i.onerror(s)}gettext.events.load&&gettext.emit("load")},i.onerror=function(e){t(e),gettext.events.error&&gettext.emit("error")},i.open("GET",e.path+"/"+e.name+"."+e.ext,!0),i.send(null)},window.gettext=function(e){return data&&data[""][e]?data[""][e]:e},window.pgettext=function(e,t){return data&&data[e][t]?data[e][t]:t},window.ngettext=function(msgId,plural,value){var index;return data&&meta?(index=eval("var n = "+value+"; "+meta.plural),data[""][msgId][index]||msgId):1===value?msgId:plural},module.exports=gettext},function(e,t,i){"use strict";function s(e){e=e||{},e.className="button "+(e.className||""),n.call(this,e),e.icon&&(this.$icon=this.$body.appendChild(document.createElement("div")),this.$icon.className="icon "+e.icon),this.$text=this.$body.appendChild(document.createElement("div")),this.$text.classList.add("text"),e.value&&(this.$text.innerText=e.value)}var n=i(5),o=i(1);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.clickDuration=200,s.prototype.defaultEvents={click:function(){var e=this;this.$node.classList.add("click"),setTimeout(function(){e.$node.classList.remove("click")},this.clickDuration)},keydown:function(e){e.code===o.ok&&this.events.click&&this.emit("click",{event:e})}},e.exports=s},function(e,t,i){"use strict";function s(e){var t,i;if(e.$item.y>1)return this.emit("keydown",{code:p.down}),void this.focusItem(this.map[1][e.$item.x]);if(e.$item.y<1)return this.emit("keydown",{code:p.up}),void this.focusItem(this.map[1][e.$item.x]);switch(e.$item.movieObj.nextType===E.TYPE_FOLDER?(i=_,t=k):(i=b,t=x),e.$item.movieObj.type){case E.TYPE_FOLDER:c&&I.push(c),window.breadcrumb.push(e.$item.movieObj.title),window.pageVideoListBreadCrumb.innerText=window.breadcrumb.join(" | "),window.pageVideoListError.style.display="",window.pageVideoListError.innerText=gettext("Loading..."),u.loadingTimeout&&clearTimeout(u.loadingTimeout),u.loadingTimeout=setTimeout(function(){window.pageVideoListError.innerText=gettext("No content or some error happened, try later.")},1e4),d.hide(),l=new i({item:{item:e.$item.movieObj},size:m.data.metrics.movieList.perLine,plugin:E}),l.addListener("preload",function(e){e.array.forEach(function(e){e.value&&e.value.img&&f.add([e.value.img])})}),a=new g({provider:l,focusable:!0,cycleY:!1,sizeX:m.data.metrics.movieList.perLine,sizeY:3,render:t,events:{keydown:n,"data:ready":function h(){clearTimeout(u.loadingTimeout),window.pageVideoListError.style.display="none",setTimeout(function(){a.focusItem(a.map[1][0]),a.removeListener("data:ready",h)},4)},"data:error":function v(){setTimeout(function(){window.pageVideoListError.innerText=gettext("No videos or loading error, try later."),a.removeListener("data:error",v),clearTimeout(u.loadingTimeout)},4)},mousewheel:function(e){e.deltaY>0?this.emit("keydown",{code:p.down}):this.emit("keydown",{code:p.up})},"click:item":s}}),r.add(a),I.push(a),a.focus(),o.show(),d=a;break;case E.TYPE_MOVIE:S.play(d.data,e.$item.x)}}function n(e){var t,i,s,n=this;switch(e.code){case p.left:case p.right:this.move(e.code);break;case p.down:case p.up:if(t=+new Date,L>t-D)break;D=t,this.provider.get(e.code,function(e,t){if(e&&n.emit("data:error",e),t){for(n.data=n.translate(t),i=0;i<n.sizeY;i++)for(s=0;s<n.sizeX;s++)n.renderItem(n.map[i][s],n.data[i][s]);n.emit("data:ready")}n.provider.page>1?o.hide():o.show()}),n.$focusItem.data.disable&&n.focusItem(n.map[1][0]);break;case p.ok:void 0!==this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}var o,a,r,c,d,l,u=new(i(6))({$node:window.pageVideoList}),h=i(3),p=i(1),m=i(2),f=i(45),v=i(13),g=i(12),y=(i(30),i(9),i(19)),w=i(4),E=i(11),T=(i(35),i(16)),S=i(27),b=(new y({visible:!1,events:{show:function(){var e=this;this.focus(),setTimeout(function(){e.hide(),a&&a.focus()},2e3)}}}),i(33)),_=i(32),x=i(38),k=i(37),I=[],L=(m.data.metrics.movieList.perLine,333),D=(new Date).getTime();u.addListener("load",function(){o=new v({$node:document.getElementById("pageVideoListHeader")}),r=new v({$node:document.getElementById("pageVideoListContentWrapper")}),u.add(r),r.add(o)}),u.initVideoList=function(e,t,i){var c,h;I.length>0&&(I.forEach(function(e){e.remove()}),I=[]),window.breadcrumb=[],e===w.dataProviderType.TYPE_SERVICE&&t.item.nextType===E.TYPE_FOLDER?(h=_,c=k):(h=b,c=x),e===w.dataProviderType.TYPE_SERVICE?window.breadcrumb[breadcrumb.length-1]!==t.item.title&&window.breadcrumb.push(t.item.title):e===w.dataProviderType.TYPE_SEARCH&&window.breadcrumb[breadcrumb.length-1]!==t.searchText&&window.breadcrumb.push(t.searchText),o.show(),window.pageVideoListBreadCrumb.innerText=window.breadcrumb.join(" | "),window.pageVideoListError.style.display="",window.pageVideoListError.innerText=gettext("Loading..."),u.loadingTimeout&&clearTimeout(u.loadingTimeout),u.loadingTimeout=setTimeout(function(){window.pageVideoListError.innerText=gettext("No content or some error happened, try later.")},1e4),i(),l=new h({item:t,size:m.data.metrics.movieList.perLine,plugin:E}),l.addListener("preload",function(e){e.array.forEach(function(e){e.value&&e.value.img&&f.add([e.value.img])})}),a=new g({provider:l,focusable:!0,cycleY:!1,sizeX:m.data.metrics.movieList.perLine,sizeY:3,render:c,events:{keydown:n,"data:ready":function v(){clearTimeout(u.loadingTimeout),window.pageVideoListError.style.display="none",setTimeout(function(){a.focusItem(a.map[1][0]),a.removeListener("data:ready",v),a.focus()},4)},"data:error":function y(){setTimeout(function(){window.pageVideoListError.innerText=gettext("No videos or loading error, try later."),a.removeListener("data:error",y),clearTimeout(u.loadingTimeout)},4)},mousewheel:function(e){e.deltaY>0?this.emit("keydown",{code:p.down}):this.emit("keydown",{code:p.up})},"click:item":s}}),r.add(a),d=a,I[0]=a},u.addListener("keydown",function(e){var t;switch(e.code){case p.back:I.length>1?(breadcrumb.pop(),window.pageVideoListBreadCrumb.innerText=window.breadcrumb.join(" | "),t=I.pop(),t.remove(),d=I[I.length-1],d.show(),d.focus(),d.provider.page>1&&o.hide()):d.provider.type===w.dataProviderType.TYPE_SEARCH?T.initSearch(function(){h.navigate("pageSearch")}):d.provider.type===w.dataProviderType.TYPE_SERVICE&&h.navigate("pageService");break;case p.exit:h.navigate("pageService");break;case p.f1:}}),e.exports=u},function(e,t,i){"use strict";function s(e,t,i){var n=+new Date,o=new XMLHttpRequest;return u>n-h?void setTimeout(function(){s(e,t,i)},n-h):(h=n,o.open("GET",d+e+"?"+t+"&version="+l+"&access_token="+p,!0),i&&(o.onload=function(){try{i(JSON.parse(this.responseText))}catch(e){i({response:null,error:e})}},o.onerror=function(){i({response:null,error:{code:this.status,message:this.responseText}})}),void o.send())}var n,o=i(2),a=i(3),r=i(1),c=i(8),d="https://api.vk.com/method/",l="5.27",u=333,h=(new Date).getTime(),p="",m=0,f="5050833",v="Ftlp5wcwZhm6IYRZGSvt",g="video",y="https://oauth.vk.com/token?grant_type=password&scope="+g+"&client_id="+f+"&client_secret="+v,w={REQUIRE_AUTH:!0,auth:{access_token:null,user_id:null},login:function(e,t,s,o){var a=new XMLHttpRequest;o=o||"",a.open("GET",y+"&username="+e+"&password="+t+o),a.onload=function(){var o;try{o=JSON.parse(this.responseText)}catch(a){s({result:!1,code:this.status})}o.captcha_sid?(null===n&&(n=i(31)),n.activate(o,"GET",y+"&username="+e+"&password="+t,function(i){w.login(e,t,s,"&captcha_sid="+o.captcha_sid+"&captcha_key="+i)})):s({result:!o.error,code:this.status,message:o.error_description,access_token:o.access_token,user_id:o.user_id,error:o.error,redirect_uri:o.redirect_uri})},a.onerror=function(){s({result:!1,code:this.status})},a.send(null)},TYPE_ROOT:1,TYPE_CATEGORY:2,TYPE_FOLDER:3,TYPE_MOVIE:4,TYPE_FILE:5},E=i(17);w.root={title:"vk.com",url:"vk.com",img:"",type:w.TYPE_ROOT,system:{type:w.TYPE_ROOT,search:[]},searchable:!1},w.checkAuth=function(e,t){e&&e.access_token?(w.auth.access_token=p=e.access_token,w.auth.user_id=m=e.user_id,s("video.get","owner_id="+e.user_id+"&count=1",function(e){e.error?(p="",m=0,t(!1)):t(!0)})):t(!1)},w.ajax=s,w.getNext=function(e,t){var n;switch(e.page++,e.system.type){case E.ROOT:if(e.page>0)return void t(!1,[]);t(!1,i(25)());break;case E.OWN_VIDEOS:e.system.albumId&&(n="album_id="+e.system.albumId),e.system.ownerId&&(n=n?n+"&owner_id="+e.system.ownerId:"owner_id="+e.system.ownerId),s("video.get","extended=1&"+n+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.OWN_ALBUMS:t(!1,[{title:gettext("Own albums"),type:w.TYPE_CATEGORY,img:"videos",nextType:w.TYPE_FOLDER,system:{type:E.OWN_ALBUM_VIDEOS}},{title:gettext("Videos of me"),type:w.TYPE_CATEGORY,img:"videos",system:{type:E.VIDEOS_WITH_ME}}]);break;case E.OWN_ALBUM_VIDEOS:s("video.getAlbums","extended=1&owner_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_320,e.info=e.count+" "+ngettext("video","videos",e.count),e.system={albumId:e.album_id,type:E.OWN_VIDEOS}}),t(!1,e.response))});break;case E.VIDEOS_WITH_ME:s("video.getUserVideos","extended=1&owner_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.FRIENDS:s("friends.get","fields=city,photo_200_orig&name_case=nom&user_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_200_orig,e.title=e.first_name+" "+e.last_name,e.info=e.online?gettext("online"):gettext("offline"),e.system={userId:e.uid,name:e.title,type:E.FRIEND_VIDEOS}}),t(!1,e.response))});break;case E.FRIEND_VIDEOS:0===e.page?s("video.getAlbums","extended=1&owner_id="+e.system.userId+"&count=1&offset=0",function(i){s("video.get","extended=1&owner_id="+e.system.userId+"&count=19&offset=0",function(s){s.error?t(!0,[]):(s.response.shift(),s.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),0!==i.response[0]&&s.response.unshift({type:w.TYPE_FOLDER,image:i.response[1].photo_320,title:gettext("User albums"),duration:"",date:gettext("Total")+": "+i.response[0],nextType:w.TYPE_FOLDER,system:{userId:e.system.userId,name:e.system.name,type:E.FRIEND_ALBUMS}}),t(!1,s.response))})}):s("video.get","extended=1&owner_id="+e.system.userId+"&count=20&offset="+(19+20*(e.page-1)),function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.FRIEND_ALBUMS:s("video.getAlbums","extended=1&owner_id="+e.system.userId+"&count=20&offset="+20*e.page,function(i){i.error?t(!0,[]):(i.response.shift(),i.response.forEach(function(t){t.type=w.TYPE_FOLDER,t.img=t.photo_320,t.info=t.count+" "+ngettext("video","videos",t.count),t.system={ownerId:e.system.userId,albumId:t.album_id,type:E.OWN_VIDEOS}}),t(!1,i.response))});break;case E.GROUPS:s("groups.get","fields=members_count&extended=1&user_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_big,e.title=e.name,e.info=e.members_count?e.members_count+" "+ngettext("user","users",e.members_count):"",e.nextType=w.TYPE_MOVIE,e.system={groupId:e.gid,name:e.name,type:E.GROUP_VIDEOS}}),t(!1,e.response))});break;case E.GROUP_VIDEOS:0===e.page?s("video.getAlbums","extended=1&owner_id=-"+e.system.groupId+"&count=1&offset=0",function(i){s("video.get","extended=1&owner_id=-"+e.system.groupId+"&count=19&offset=0",function(s){s.error?t(!0,[]):(s.response.shift(),s.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),0!==i.response[0]&&s.response.unshift({type:w.TYPE_FOLDER,image:i.response[1].photo_320,title:gettext("Group albums"),duration:"",date:gettext("Total")+": "+i.response[0],nextType:w.TYPE_FOLDER,system:{groupId:e.system.groupId,name:e.system.name,type:E.GROUP_ALBUMS}}),t(!1,s.response))})}):s("video.get","extended=1&owner_id=-"+e.system.groupId+"&count=20&offset="+(19+20*(e.page-1)),function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.GROUP_ALBUMS:s("video.getAlbums","extended=1&owner_id=-"+e.system.groupId+"&count=20&offset="+20*e.page,function(i){i.error?t(!0,[]):(i.response.shift(),i.response.forEach(function(t){t.type=w.TYPE_FOLDER,t.img=t.photo_320,t.info=t.count+" "+ngettext("video","videos",t.count),t.system={ownerId:"-"+e.system.groupId,albumId:t.album_id,type:E.OWN_VIDEOS}}),t(!1,i.response))});break;case E.VIDEO:var d,l,u={};if(e.system.files.external)return-1!==e.system.files.external.indexOf("youtube.com/watch?v")?(l=e.system.files.external.replace("http://www.youtube.com/watch?v=",""),d=new XMLHttpRequest,d.open("GET","http://playontv.net/api/getyoutubeurl.php/?youtubeid="+l),d.onload=function(){t(!1,{240:{title:e.system.title,url:this.responseText,type:w.TYPE_FILE}})},void d.send(null)):void t(!1);e.system.files.mp4_240?u[240]={title:e.system.title,url:e.system.files.mp4_240,type:w.TYPE_FILE}:e.system.files.flv_240&&(u[240]={title:e.system.title,url:e.system.files.flv_240,type:w.TYPE_FILE}),e.system.files.mp4_360?u[360]={title:e.system.title,url:e.system.files.mp4_360,type:w.TYPE_FILE}:e.system.files.flv_320&&(u[360]={title:e.system.title,url:e.system.files.flv_320,type:w.TYPE_FILE}),e.system.files.mp4_480?u[480]={title:e.system.title,url:e.system.files.mp4_480,type:w.TYPE_FILE}:e.system.files.flv_480&&(u[480]={title:e.system.title,url:e.system.files.flv_480,type:w.TYPE_FILE}),e.system.files.mp4_720?u[720]={title:e.system.title,url:e.system.files.mp4_720,type:w.TYPE_FILE}:e.system.files.flv_720&&(u[720]={title:e.system.title,url:e.system.files.flv_720,type:w.TYPE_FILE}),t(!1,u);break;case E.SEARCH:s("video.search","q="+e.system.query+"&sort=0&adult="+(o.settings.safeSearch?"0":"1")+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.SETTINGS:t(!1,[{title:gettext("Language"),type:w.TYPE_FOLDER,img:"",system:{type:E.SETTINGS_LANG}},{title:gettext("Safe search"),type:w.TYPE_FOLDER,img:"",system:{type:E.SETTINGS_SAFE_SEARCH}},{title:gettext("Logout"),img:"",system:{onclick:function(){a.current.modalExit.titleText="Logout?",o.params.referrer="#pageReload",a.current.emit("keydown",{code:r.exit})}}}]);break;case E.SETTINGS_LANG:t(!1,[{title:"Русский",img:"",system:{onclick:function(e){return"ru"!==e.language?(e.language="ru",c.load({name:e.language}),!0):void 0}}},{title:"Українська",img:"",system:{onclick:function(e){return"uk"!==e.language?(e.language="uk",c.load({name:e.language}),!0):void 0}}},{title:"English",img:"",system:{onclick:function(e){return"en"!==e.language?(e.language="en",c.load({name:e.language}),!0):void 0}}}]);break;case E.SETTINGS_SAFE_SEARCH:t(!1,[{title:"Enable",img:"",system:{onclick:function(e){return e.safeSearch=!0,!0}}},{title:"Disable",img:"",system:{onclick:function(e){return e.safeSearch=!1,!0}}}])}},w.getPrev=function(e,t){var n;if(e.page<0)return void t(!1,[]);switch(e.system.type){case E.ROOT:if(e.page>0)return void t(!1,[]);t(!1,i(25)());break;case E.OWN_VIDEOS:e.system.albumId&&(n="album_id="+e.system.albumId),e.system.ownerId&&(n=n?n+"&owner_id="+e.system.ownerId:"owner_id="+e.system.ownerId),s("video.get","extended=1&"+n+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.OWN_ALBUMS:t(!1,[{title:gettext("Own albums"),type:w.TYPE_CATEGORY,img:"videos",nextType:w.TYPE_FOLDER,system:{type:E.OWN_ALBUM_VIDEOS}},{title:gettext("Videos of me"),type:w.TYPE_CATEGORY,img:"videos",system:{type:E.VIDEOS_WITH_ME}}]);break;case E.OWN_ALBUM_VIDEOS:s("video.getAlbums","extended=1&owner_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_320,e.info=e.count+" "+ngettext("video","videos",e.count),e.system={albumId:e.album_id,type:E.OWN_VIDEOS}}),t(!1,e.response))});break;case E.VIDEOS_WITH_ME:s("video.getUserVideos","extended=1&owner_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,
  image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.FRIENDS:s("friends.get","fields=city,photo_200_orig&name_case=nom&user_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_200_orig,e.title=e.first_name+" "+e.last_name,e.info=e.online?gettext("online"):gettext("offline"),e.system={userId:e.uid,name:e.title,type:E.FRIEND_VIDEOS}}),t(!1,e.response))});break;case E.FRIEND_VIDEOS:0===e.page?s("video.getAlbums","extended=1&owner_id="+e.system.userId+"&count=1&offset=0",function(i){s("video.get","extended=1&owner_id="+e.system.userId+"&count=19&offset=0",function(s){s.error?t(!0,[]):(s.response.shift(),0!==i.response[0]&&s.response.unshift({type:w.TYPE_FOLDER,image:i.response[1].photo_320,title:gettext("User albums"),duration:"",date:gettext("Total")+": "+i.response[0],nextType:w.TYPE_FOLDER,system:{userId:e.system.userId,name:e.system.name,type:E.FRIEND_ALBUMS}}),t(!1,s.response))})}):s("video.get","extended=1&owner_id="+e.system.userId+"&count=20&offset="+(19+20*(e.page-1)),function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.FRIEND_ALBUMS:s("video.getAlbums","extended=1&owner_id="+e.system.userId+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_320,e.info=e.count+" "+ngettext("video","videos",e.count),e.system={albumId:e.album_id,type:E.OWN_VIDEOS}}),t(!1,e.response))});break;case E.GROUPS:s("groups.get","fields=members_count&extended=1&user_id="+m+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.type=w.TYPE_FOLDER,e.img=e.photo_big,e.title=e.name,e.info=e.members_count?" "+ngettext("user","users",e.members_count):"",e.system={groupId:e.gid,name:e.name,type:E.GROUP_VIDEOS}}),t(!1,e.response))});break;case E.GROUP_VIDEOS:0===e.page?s("video.getAlbums","extended=1&owner_id=-"+e.system.groupId+"&count=1&offset=0",function(i){s("video.get","extended=1&owner_id=-"+e.system.groupId+"&count=19&offset=0",function(s){s.error?t(!0,[]):(s.response.shift(),s.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),0!==i.response[0]&&s.response.unshift({type:w.TYPE_FOLDER,image:i.response[1].photo_320,title:gettext("Group albums"),duration:"",date:gettext("Total")+": "+i.response[0],nextType:w.TYPE_FOLDER,system:{groupId:e.system.groupId,name:e.system.name,type:E.GROUP_ALBUMS}}),t(!1,s.response))})}):s("video.get","extended=1&owner_id=-"+e.system.groupId+"&count=20&offset="+(19+20*(e.page-1)),function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.GROUP_ALBUMS:s("video.getAlbums","extended=1&owner_id=-"+e.system.groupId+"&count=20&offset="+20*e.page,function(i){i.error?t(!0,[]):(i.response.shift(),i.response.forEach(function(t){t.type=w.TYPE_FOLDER,t.img=t.photo_320,t.info=t.count+" "+ngettext("video","videos",t.count),t.system={ownerId:"-"+e.system.groupId,albumId:t.album_id,type:E.OWN_VIDEOS}}),t(!1,i.response))});break;case E.VIDEO:var d,l,u={};if(e.system.files.external)return-1!==e.system.files.external.indexOf("youtube.com/watch?v")?(l=e.system.files.external.replace("http://www.youtube.com/watch?v=",""),d=new XMLHttpRequest,d.open("GET","http://playontv.net/api/getyoutubeurl.php/?youtubeid="+l),d.onload=function(){t(!1,{240:{title:e.system.title,url:this.responseText,type:w.TYPE_FILE}})},void d.send(null)):void t(!1);e.system.files.mp4_240?u[240]={title:e.system.title,url:e.system.files.mp4_240,type:w.TYPE_FILE}:e.system.files.flv_240&&(u[240]={title:e.system.title,url:e.system.files.flv_240,type:w.TYPE_FILE}),e.system.files.mp4_360?u[360]={title:e.system.title,url:e.system.files.mp4_360,type:w.TYPE_FILE}:e.system.files.flv_320&&(u[360]={title:e.system.title,url:e.system.files.flv_320,type:w.TYPE_FILE}),e.system.files.mp4_480?u[480]={title:e.system.title,url:e.system.files.mp4_480,type:w.TYPE_FILE}:e.system.files.flv_480&&(u[480]={title:e.system.title,url:e.system.files.flv_480,type:w.TYPE_FILE}),e.system.files.mp4_720?u[720]={title:e.system.title,url:e.system.files.mp4_720,type:w.TYPE_FILE}:e.system.files.flv_720&&(u[720]={title:e.system.title,url:e.system.files.flv_720,type:w.TYPE_FILE}),t(!1,u);break;case E.SEARCH:s("video.search","q="+e.system.query+"&sort=0&adult="+(o.settings.safeSearch?"0":"1")+"&count=20&offset="+20*e.page,function(e){e.error?t(!0,[]):(e.response.shift(),e.response.forEach(function(e){e.system={vid:e.vid,owner_id:e.owner_id,title:e.title,description:e.description,duration:e.duration,link:e.link,date:e.date,views:e.views,image:e.image,image_medium:e.image_medium,comments:e.comments,files:e.files,can_comment:e.can_comment,can_repost:e.can_repost,likes:e.likes,user_likes:e.user_likes,count:e.count,repeat:e.repeat,type:E.VIDEO}}),t(!1,e.response))});break;case E.SETTINGS:t(!1,[{title:gettext("Language"),type:w.TYPE_FOLDER,img:"",system:{type:E.SETTINGS_LANG}},{title:gettext("Safe search"),type:w.TYPE_FOLDER,img:"",system:{type:E.SETTINGS_SAFE_SEARCH}},{title:gettext("Logout"),img:"",system:{onclick:function(){a.current.modalExit.titleText="Logout?",o.params.referrer="#pageReload",a.current.emit("keydown",{code:r.exit})}}}]);break;case E.SETTINGS_LANG:t(!1,[{title:"Русский",img:"",system:{onclick:function(e){return"ru"!==e.language?(e.language="ru",c.load({name:e.language}),!0):void 0}}},{title:"Українська",img:"",system:{onclick:function(e){return"uk"!==e.language?(e.language="uk",c.load({name:e.language}),!0):void 0}}},{title:"English",img:"",system:{onclick:function(e){return"en"!==e.language?(e.language="en",c.load({name:e.language}),!0):void 0}}}]);break;case E.SETTINGS_SAFE_SEARCH:t(!1,[{title:"Enable",img:"",system:{onclick:function(e){return e.safeSearch=!0,!0}}},{title:"Disable",img:"",system:{onclick:function(e){return e.safeSearch=!1,!0}}}])}e.page--},w.getCursor=function(e,t){var i=!1;t(i,{page:-1,system:e.item.system})},w.getInfo=function(e,t){t(e)},e.exports=w},function(e,t,i){"use strict";function s(e){e=e||{},this.map=[],this.$focusItem=null,this.data=[],this.cycleX=!0,this.cycleY=!0,this.focusX=0,this.focusY=0,e.className="grid "+(e.className||""),r.call(this,e),this.init(e)}function n(e){var t,i,s;for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)s=e[t][i],"object"!=typeof s?s=e[t][i]={value:e[t][i],colSpan:1,rowSpan:1}:(s.colSpan=s.colSpan||1,s.rowSpan=s.rowSpan||1);return e}function o(e,t,i,s,n,o){var a,r;for(a=i;i+n>a;a++){for(e.length<a+1&&e.push([]);void 0!==e[a][t];)t++;for(r=t;t+s>r;r++)e[a].length<r+1&&e[a].push(),e[a][r]=o,void 0===o.x&&(o.x=r),void 0===o.y&&(o.y=a)}}function a(e){var t,i,s,n=[];for(t=0;t<e.length;t++)for(i=0;i<e[t].length;i++)s=e[t][i],o(n,i,t,s.colSpan,s.rowSpan,s.$item),delete s.$item;return n}var r=i(5),c=i(1);s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.renderItemDefault=function(e,t){e.innerText=t.value},s.prototype.renderItem=s.prototype.renderItemDefault,s.prototype.defaultEvents={mousewheel:function(e){e.wheelDeltaY&&this.move(e.wheelDeltaY>0?c.up:c.down),e.wheelDeltaX&&this.move(e.wheelDeltaX>0?c.left:c.right)},keydown:function(e){switch(e.code){case c.up:case c.down:case c.right:case c.left:this.move(e.code);break;case c.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},s.prototype.init=function(e){var t,i,s,o,r,c,d,l,u=this,h=!1,p=function(e){this.data.disable!==!0&&(u.focusItem(this),u.events["click:item"]&&u.emit("click:item",{$item:this,event:e}))},m=function(l){if(l&&u.data!==l&&(u.data=l,h=!0),e.render&&u.renderItem!==e.render&&(u.renderItem=e.render,h=!0),h){for(u.$table=document.createElement("table"),r=document.createElement("tbody"),u.data=n(u.data),t=0;t<u.data.length;t++){for(s=r.insertRow(),i=0;i<u.data[t].length;i++)o=s.insertCell(-1),o.className="item",d=u.data[t][i],d.$item=o,o.colSpan=d.colSpan,o.rowSpan=d.rowSpan,d.focus&&(c=o),d.disable&&o.classList.add("disable"),d.mark&&o.classList.add("mark"),u.renderItem(o,d),o.data=d,o.addEventListener("click",p);r.appendChild(s)}u.map=a(u.data),u.$body.innerText=null,u.$table.appendChild(r),u.$body.appendChild(u.$table),c?u.focusItem(c):u.focusItem(u.map[0][0])}};void 0!==e.cycleX&&(this.cycleX=e.cycleX),void 0!==e.cycleY&&(this.cycleY=e.cycleY),e.provider&&(this.provider=e.provider,this.sizeX=e.sizeX,this.sizeY=e.sizeY),e.translate&&(this.translate=e.translate),e.provider?(l=this.provider.get(null,function(e,t){e&&u.events["data:error"]&&u.emit("data:error",e),m(u.translate(t)),u.events["data:ready"]&&u.emit("data:ready")}),this.events["data:get"]&&this.emit("data:get",{fresh:l})):m(e.data)},s.prototype.defaultTranslate=function(e){var t,i,s,n=[];for(t=0;t<this.sizeY;t++){for(s=[],i=0;i<this.sizeX;i++)s[i]=e[t*this.sizeX+i];n[t]=s}return n},s.prototype.translate=s.prototype.defaultTranslate,s.prototype.move=function(e){for(var t,i,s,n=this.focusX,o=this.focusY,a=!0,r=!1,d=!1;a;){switch(e){case c.up:o>0?o--:(this.cycleY&&(o=this.map.length-1,d=!0),r=!0);break;case c.down:o<this.map.length-1?o++:(this.cycleY&&(o=0,d=!0),r=!0);break;case c.right:n<this.map[o].length-1?n++:(this.cycleX&&(n=0,d=!0),r=!0);break;case c.left:n>0?n--:(this.cycleX&&(n=this.map[o].length-1,d=!0),r=!0)}n===this.focusX&&o===this.focusY&&(a=!1),this.map[o][n]!==this.map[this.focusY][this.focusX]&&this.map[o][n].data.disable!==!0&&(a=!1),r&&(a=!1,this.map[o][n].data.disable===!0&&(n=this.focusX,o=this.focusY))}this.focusItem(this.map[o][n]),this.focusX=n,this.focusY=o,r&&(this.provider&&(t=this.provider.get(e,function(e,t){if(e&&self.events["data:error"]&&self.emit("data:error",e),t){for(self.data=self.translate(t),i=0;i<self.sizeY-1;i++)for(s=0;s<self.sizeX;s++)self.renderItem(self.map[i][s],self.data[i][s]);self.events["data:ready"]&&self.emit("data:ready")}}),this.events["data:get"]&&this.emit("data:get",{fresh:t})),this.events.overflow&&this.emit("overflow",{direction:e,cycle:d}))},s.prototype.focusItem=function(e){var t=this.$focusItem;return e&&t!==e&&e.data.disable!==!0?(null!==t&&(t.classList.remove("focus"),this.events["blur:item"]&&this.emit("blur:item",{$item:t})),this.focusX=e.x,this.focusY=e.y,this.$focusItem=e,e.classList.add("focus"),this.events["focus:item"]&&this.emit("focus:item",{$prev:t,$curr:e}),!0):!1},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.className="panel "+(e.className||""),n.call(this,e)}var n=i(5);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.className="widget "+(e.className||""),n.call(this,e)}var n=i(5);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e,t){(n=document.getElementById("pluginScript"))&&l.removeChild(n),n=document.createElement("script"),n.type="text/javascript",n.src=c.api.servicesUrl+"/"+e+"/code/",n.id="pluginScript",n.onload=t,n.onerror=function(){},l.appendChild(n)}var n,o={array:[],current:{}},a=i(2),r=i(3),c=i(4),d=i(11),l=document.head;o.loadPlugin=function(e,t){var i=this,n=!1;return null===e&&c.singleMode.active===!0?(o.current.plugin=d,void d.checkAuth(a.settings.auth,function(e){e?t(i.current):r.navigate("pageLogin")})):(i.array.forEach(function(s){s.serviceId===e&&(o.current=s,n=!0,t(i.current))}),void(n||s(e,function(){i.array.push({serviceId:e,plugin:window.plugin}),delete window.plugin,i.current=i.array[i.array.length-1],t(i.current),i.array.length>=6&&i.array.shift()})))},e.exports=o},function(e,t,i){"use strict";var s,n,o,a=new(i(6))({$node:window.pageSearch}),r=i(3),c=i(1),d=i(22),l=i(15),u=i(23),h=i(24),p=i(12),m=i(9),f=i(19),v=i(13),g=new f({visible:!1,events:{show:function(){g.okBtn.focus()},hide:function(){n.focus()}}}),y=document.createElement("span");a.addListener("load",function(){y.classList.add("searchType"),window.pageSearchStory.appendChild(y),n=new m({$node:window.pageSearchStoryClear,value:gettext("Clear history")}),window.pageSearchStory.innerText=gettext("Search history "),n.$text.innerText=gettext("Clear history"),i(8).addListener("load",function(){window.pageSearchStory.innerText=gettext("Search history "),g.title.$body.innerText=gettext("Clear search history ?"),n.$text.innerText=gettext("Clear history")}),a.add(n),n.addListener("keydown",function(e){switch(e.code){case c.up:u.input.focus();break;case c.down:s?s.focus():h.keys.focus()}}),n.addListener("click",function(){g.show()}),u.input.addListener("keydown",function(e){e.code===c.down&&"pageSearch"===r.current.id&&n.focus()}),a.add(g),g.add(g.title=new v),g.title.$body.innerText=gettext("Clear search history ?"),g.add(g.okBtn=new m({value:"Очистить",events:{keydown:function(e){switch(e.code){case c.right:g.cancelBtn.focus();break;case c.back:case c.exit:g.hide(),e.stop=!0;break;case c.ok:this.events.click&&this.emit("click",{event:event})}},click:function(){d.clearStorage(function(e){e?a.initSearch(a.lastSearchData,function(){n.focus(),g.hide()}):(s.hide(),g.hide())})}}})),g.add(g.cancelBtn=new m({value:"Отмена",events:{keydown:function(e){switch(e.code){case c.left:g.okBtn.focus();break;case c.back:case c.exit:g.hide(),e.stop=!0}},click:function(){g.hide()}}}))}),a.addListener("show",function(){a.add(h),a.add(u),u.show(),h.show(),h.showBg(0),h.keys.focus(),h.keys.focusItem(h.keys.map[2][5]),h.overflowTop(function(){s?s.focus():n.focus()}),h.button.once("keydown",function(e){e.code===c.up&&("pageSearch"===r.current.id?s?(s.focus(),s.focusItem(s.map[4][1])):n.focus():"pageVideoList"===r.current.id&&u.input.focus())})}),a.addListener("keydown",function(e){switch(e.code){case c.back:case c.exit:h.hide(),u.hide(),r.navigate("pageService")}}),a.initSearch=function(e,t){this.lastSearchData=e,o=l.current.plugin,s&&s.show(),d.getData(function(e){var i=e;null!==i?s?s.init({data:i}):(s=new p({data:i,cycleY:!1,render:function(e,t){if(!t.disable){var i=document.createElement("span");i.innerText=t.value,e.appendChild(i)}}}),a.add(s),s.addListener("overflow",function(e){switch(e.direction){case c.up:n.focus();break;case c.down:h.keys.focus()}}),s.addListener("click:item",function(e){u.setValue(e.$item.data.value),h.button.focus()})):s&&s.hide(),t()})},e.exports=a},function(e,t){"use strict";e.exports={ROOT:1,OWN_VIDEOS:2,OWN_ALBUMS:3,OWN_ALBUM_VIDEOS:4,FRIEND:5,FRIEND_VIDEOS:6,FRIEND_ALBUMS:7,FRIEND_ALBUM_VIDEOS:8,GROUP_VIDEOS:9,GROUP_ALBUMS:10,GROUP_ALBUMS_VIDEOS:11,VIDEO:12,VIDEOS_WITH_ME:13,FRIENDS:14,GROUPS:15,GROUP:16,SEARCH:17,SETTINGS:18,SETTINGS_LANG:19,SETTINGS_SAFE_SEARCH:20,SETTINGS_LOGOUT:21}},function(e,t,i){"use strict";function s(e){e=e||{},this.value="",this.type=this.TYPE_TEXT,e.className="input "+(e.className||""),n.call(this,e),this.$line=this.$body.appendChild(document.createElement("div")),this.$line.className="line",this.$caret=this.$line.appendChild(document.createElement("div")),this.$caret.className="caret",this.$placeholder=this.$line.appendChild(document.createElement("div")),this.$placeholder.className="placeholder",this.$caret.index=0,this.init(e)}var n=i(5),o=i(1);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.TYPE_TEXT=0,s.prototype.TYPE_PASSWORD=1,s.prototype.defaultEvents={keypress:function(e){this.addChar(String.fromCharCode(e.keyCode),this.$caret.index)},keydown:function(e){switch(e.code){case o["delete"]:this.removeChar(this.$caret.index);break;case o.back:this.removeChar(this.$caret.index-1);break;case o.left:this.setCaretPosition(this.$caret.index-1);break;case o.right:this.setCaretPosition(this.$caret.index+1);break;case o.end:case o.down:this.setCaretPosition(this.value.length);break;case o.home:case o.up:this.setCaretPosition(0)}}},s.prototype.init=function(e){e.type&&(this.type=e.type),e.value&&this.setValue(e.value),e.placeholder&&(this.$placeholder.innerText=e.placeholder),this.$line.dir=e.direction||"ltr"},s.prototype.addChar=function(e,t){var i=document.createElement("div");t=void 0===t?this.$caret.index:t,0===this.value.length&&this.$line.removeChild(this.$placeholder),i.className="char",this.value=this.value.substring(0,t)+e+this.value.substring(t,this.value.length),++this.$caret.index,this.type===this.TYPE_PASSWORD?i.innerText="*":" "===e?i.innerHTML="&nbsp;":i.innerText=e,t>=this.value.length?(this.$line.appendChild(i),this.$line.appendChild(this.$caret)):(this.$line.insertBefore(this.$caret,this.$line.children[t]),this.$line.insertBefore(i,this.$caret)),this.events.input&&this.emit("input",{value:this.value})},s.prototype.removeChar=function(e){var t=this.value;e=void 0===e?this.$caret.index-1:e,this.value.length>0&&(this.$caret.index===e&&e<this.value.length?this.$line.removeChild(this.$line.children[e+1]):this.$caret.index>e&&(--this.$caret.index,this.$line.removeChild(this.$line.children[e])),this.value=this.value.substring(0,e)+this.value.substring(e+1,this.value.length),this.events.input&&t!==this.value&&this.emit("input",{value:this.value})),0===this.value.length&&this.$line.appendChild(this.$placeholder)},s.prototype.setCaretPosition=function(e){e>=0&&e<=this.value.length&&this.$caret.index!==e&&(this.$line.removeChild(this.$caret),e===this.value.length?this.$line.appendChild(this.$caret):this.$line.insertBefore(this.$caret,this.$line.children[e]),this.$caret.index=e)},s.prototype.setValue=function(e){var t,i,s=this.value.length,n=e.length,o=0;if(e!==this.value){if(n>0){if(this.$placeholder.parentNode===this.$line&&this.$line.removeChild(this.$placeholder),this.$line.removeChild(this.$caret),n!==s)if(i=n-s,i>0)for(o=0;i>o;o++)t=this.$line.appendChild(document.createElement("div")),t.className="char";else for(o=0;o>i;o--)this.$line.removeChild(this.$line.lastChild);for(o=0;n>o;o++)t=this.$line.children[o],this.type===this.TYPE_PASSWORD?t.innerHTML="*":" "===e[o]?t.innerHTML="&nbsp;":t.innerText=e[o];this.value=e,this.$caret.index=n,this.$line.appendChild(this.$caret)}else this.value="",this.$line.innerText="",this.$line.appendChild(this.$caret),this.$line.appendChild(this.$placeholder);this.events.input&&this.emit("input",{value:this.value})}},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.className="modalBox "+(e.className||""),e.$body=document.createElement("div"),e.$body.className="body",n.call(this,e),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}var n=i(5);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s,n={profile:{},playback:{},token:void 0,favorite:{data:[]}},o=i(4),a=i(28);n.authorize=function(e,t){e.backend?(n.token=e.backend.token,n.profile.load(function(){n.isAuthorize=!0,t()})):a.ajax(o.backend.url.authorization,{onload:function(i){var s=JSON.parse(i);200===s.code?(n.token=s.data.sid,e.backend={token:s.data.sid},t(),n.isAuthorize=!0,n.profile.save({playNext:!0,buffer:5})):(n.isAuthorize=!1,t())},onerror:function(){t()},timeout:6e3})},n.profile.load=function(e){var t;s=i(26),a.ajax(o.backend.url.profile,{onload:function(i){var n;if(t=JSON.parse(i),null===i.info)return void(e&&e());if(200===t.code){if(t.data.info||(t.data.info={}),o.playNext=t.data.info.playNext,o.bufferSize=t.data.info.buffer,o.appRating=t.data.info.appRating,t.data.info.volume){o.volume=t.data.info.volume;try{s.setValue(o.volume)}catch(a){}}n=Math.floor(768*o.bufferSize*1e3),gSTB.SetBufferSize(1e3*o.bufferSize,n)}e&&e(i)},onerror:function(){e&&e()},method:"GET",headers:{Authorization:n.token},timeout:6e3})},n.profile.save=function(e,t){void 0===e&&(e={playNext:o.playNext,buffer:o.bufferSize,appRating:o.appRating,volume:o.volume}),a.ajax(o.backend.url.profile,{onload:function(e){t&&t()},timeout:6e3,method:"PUT",data:e,headers:{"Content-Type":"application/json",Authorization:n.token}})},n.playback.send=function(e){n.isAuthorize&&a.ajax(o.backend.url.playbackHistory,{method:"POST",timeout:6e3,data:e,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code}})},n.playback.load=function(e){n.isAuthorize&&a.ajax(o.backend.url.playbackHistory,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);200!==i.code||e(i.data)},onerror:function(){}})},n.favorite.send=function(e,t){n.isAuthorize&&a.ajax(o.backend.url.favorite,{method:"POST",data:e,timeout:6e3,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code,t()},onerror:function(){t()}})},n.favorite.load=function(e,t){n.isAuthorize&&a.ajax(o.backend.url.favorite+"?info.categoryId="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code||t(i.data)}})},n.favorite.checkState=function(e,t){return n.isAuthorize?void a.ajax(o.backend.url.favorite+"?info.id="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code?t(null):0!==i.data.length?t(!0,i.data[0].id):t(!1)},onerror:function(){t(null)}}):void t(null)},n.favorite.deleteItem=function(e,t){return n.isAuthorize?void a.ajax(o.backend.url.favorite+"/"+e,{method:"DELETE",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);t(200===i.code?!0:!1)},onerror:function(){t(!1)}}):void t(!1)},e.exports=n},function(e,t,i){"use strict";function s(e){e=e||{},this.plugin=e.plugin,n.call(this,e)}var n=i(7);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.timeDiff=function(e,t){var i,s;return(e*=1e3)?(i=new Date(e),i.setTime(t-i.getTime()),e=i.getTime(),i.getFullYear()>1970?(s=i.getFullYear()-1970,e=s+" "+ngettext("year","years",+s)+" "+gettext("ago")):i.getMonth()>0?(s=i.getMonth()+1,e=s+" "+ngettext("month","months",+s)+" "+gettext("ago")):i.getDate()>1?(s=i.getDate(),e=s+" "+ngettext("day","days",+s)+" "+gettext("ago")):i.getHours()>0?(s=i.getHours(),e=s+" "+ngettext("hour","hours",+s)+" "+gettext("ago")):i.getMinutes()>0?(s=i.getMinutes(),e=s+" "+ngettext("minute","minutes",+s)+" "+gettext("ago")):(s=i.getSeconds(),e=s+" "+ngettext("second","seconds",+s)+" "+gettext("ago")),e):e},s.prototype.normalizeVideoDuration=function(e){var t,i,s;return e=new Date(1e3*e),s=e.getUTCSeconds(),t=e.getUTCHours(),i=e.getUTCMinutes(),10>s&&(s||(s="0"),s="0"+s),t>1&&10>i&&(i="0"+i),1>t?t="":10>t&&(t="0"+t+":"),t+i+":"+s},e.exports=s},function(e,t,i){"use strict";var s={},n=[],o=i(4),a=i(20),r=i(28);s.getData=function(e){var t,i,s=[];n=[],a.isAuthorize?r.ajax(o.backend.url.searchHistory,{method:"GET",headers:{Authorization:a.token},timeout:6e3,onload:function(o){var a,r=JSON.parse(o).data;if(r.forEach(function(e){n.push(e.info)}),n.length>0){for(n.length%2!==0&&n.push({value:"",disable:!0}),i=n.length/2,s[0]=[],s[0].push(n[0]),s[0].push(n[i]),t=1;i>t;t++)s[t]=[],s[t].push(n[t]),a=t+parseFloat(i),s[t].push(n[a]);e(s)}else e(null)}}):e(null)},s.clearStorage=function(e){n=[],r.ajax(o.backend.url.searchHistory,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:a.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);e(200===i.code?!0:!1)},onerror:function(){e(!1)}})},s.removeLast=function(){n.pop()},s.add=function(e){n.length&&e===n[0].value||(n.pop(),n.unshift({value:e}),e&&r.ajax(o.backend.url.searchHistory,{method:"POST",headers:{"Content-Type":"application/json",Authorization:a.token},data:{value:e},timeout:6e3,onload:function(){}}))},e.exports=s},function(e,t,i){"use strict";var s=new(i(14))({$node:window.inputWidgetWrapper,visible:!1,focusable:!0}),n=i(1),o=new(i(18))({$node:window.inputWidget});s.add(o),s.$node.classList.remove("invisible"),s.addChar=function(e){o.addChar(e)},s.removeChar=function(){o.removeChar()},s.getValue=function(){return o.value},s.setValue=function(e){o.setValue(e),setTimeout(function(){o.setValue(e)},0)},s.delChar=function(){o.removeChar(o.value.length-1)},s.input=o,o.addListener("keydown",function(e){var t;e.code===n.ok&&o.value.length>0?(t=i(24),t.button.focus()):e.code===n.back&&(e.stop=!0)}),s.overflowBot=function(e){o.addListener("keydown",function(t){t.code===n.down&&e()})},e.exports=s},function(e,t,i){"use strict";var s,s,n=new(i(14))({$node:window.keyboardWidgetWrapper,visible:!1,focusable:!0}),o=i(1),a=i(2),r=i(3),c=i(4),d=i(50),l=i(23),u=new(i(12))({$node:window.keyboardWidget,data:d.ru,cycleY:!1,cycleX:!1,render:function(e,t){var i,s=document.createElement("div");s.classList.add("keyboardButton"),t.id&&(e.id=t.id),s.innerText=t.value,e.appendChild(s),t.img&&(i=document.createElement("img"),i.src="./img/"+a.data.metrics.height+"/"+t.img+".png",s.appendChild(i))}}),h=new(i(9))({$node:window.keyboardWidgetSearchBtn,value:gettext("Search")}),p=i(17),m=i(22),f={};n.$node.classList.remove("invisible"),n.add(u),n.add(h),n.isUpper=!1,n.lang="ru",u.addListener("overflow",function(e){switch(e.direction){case o.right:h.focus()}}),u.addListener("click:item",function(e){if(l.visible)if(e.$item.data.id)switch(e.$item.data.id){case"keyUp":n.upper();break;case"keyBackspace":l.delChar();break;case"keySpace":l.addChar(" ");break;case"keyLeft":l.input.emit("keydown",{code:o.left});break;case"keyRight":l.input.emit("keydown",{code:o.right});break;case"keyLang":n.changeLang()}else n.isUpper?l.addChar(e.$item.data.value.toString().toUpperCase()):l.addChar(e.$item.data.value.toString())}),u.addListener("keydown",function(e){switch(e.code){case 112:e.stop=!0,l.delChar();break;case 115:h.emit("click",{});break;case 114:n.changeLang();break;case 113:l.addChar(" ")}}),h.addListener("keydown",function(e){switch(e.code){case o.left:u.focus()}}),n.setSearchObj=function(e){f=e},h.addListener("click",function(){s||(s=i(10)),l.visible&&l.getValue().length>0&&s.initVideoList(c.dataProviderType.TYPE_SEARCH,{item:{system:{query:l.getValue(),type:p.SEARCH}}},function(){n.hide(),l.hide(),r.navigate("pageVideoList"),m.add(l.getValue())})}),n.upper=function(){this.isUpper?(this.isUpper=!1,this.$node.classList.remove("upperCase")):(this.isUpper=!0,this.$node.classList.add("upperCase"))},n.overflowTop=function(e){var t=r.current.id;u.addListener("overflow",function(i){i.direction===o.up&&r.current.id===t&&e()})},n.changeLang=function(){"ru"===n.lang?(u.init({data:d.en}),n.lang="en"):(u.init({data:d.ru}),n.lang="ru"),u.focusItem(u.map[2][5])},n.showBg=function(e){1===e?n.$node.classList.add("background"):0===e&&n.$node.classList.remove("background")},n.button=h,n.keys=u,e.exports=n},function(e,t,i){"use strict";var s=i(11),n={TYPE_BACK:20,TYPE_SEARCH_LIST:12,TYPE_SEARCH:13},o=i(17),a=[{title:gettext("Search"),type:n.TYPE_SEARCH,img:"search"},{title:gettext("My videos"),type:s.TYPE_CATEGORY,img:"video",system:{type:o.OWN_VIDEOS,ownerId:s.auth.user_id}},{title:gettext("My albums"),type:s.TYPE_FOLDER,img:"videos",system:{type:o.OWN_ALBUMS}},{title:gettext("Friends videos"),type:s.TYPE_CATEGORY,img:"friendsvideos",nextType:s.TYPE_FOLDER,system:{type:o.FRIENDS}},{title:gettext("Groups videos"),type:s.TYPE_CATEGORY,img:"groupvideos",nextType:s.TYPE_FOLDER,system:{type:o.GROUPS}},{title:gettext("Settings"),img:"settings",type:s.TYPE_FOLDER,system:{type:o.SETTINGS}}];i(8).addListener("load",function(){a=[{title:gettext("Search"),type:n.TYPE_SEARCH,img:"search"},{title:gettext("My videos"),type:s.TYPE_CATEGORY,img:"video",system:{type:o.OWN_VIDEOS,ownerId:s.auth.user_id}},{title:gettext("My albums"),type:s.TYPE_FOLDER,img:"videos",system:{type:o.OWN_ALBUMS}},{title:gettext("Friends videos"),type:s.TYPE_CATEGORY,img:"friendsvideos",nextType:s.TYPE_FOLDER,system:{type:o.FRIENDS}},{title:gettext("Groups videos"),type:s.TYPE_CATEGORY,img:"groupvideos",nextType:s.TYPE_FOLDER,system:{type:o.GROUPS}},{title:gettext("Settings"),img:"settings",type:s.TYPE_FOLDER,system:{type:o.SETTINGS}}]}),e.exports=function(){return a}},function(e,t,i){"use strict";function s(){r.isMuted&&(gSTB.SetMute(0),r.isMuted=!1,window.volumeCurrentValue.classList.remove("muted")),l>=u&&(l-=u,window.volumeCurrentValue.innerText=l.toString(),0!==l&&l-u>0?window.volumeBotValue.innerText=(l-u).toString():window.volumeBotValue.innerText="",window.volumeTopValue.innerText=(l+u).toString(),gSTB.SetVolume(l))}function n(){r.isMuted&&(gSTB.SetMute(0),r.isMuted=!1,window.volumeCurrentValue.classList.remove("muted")),100>=l+u&&(l+=u,window.volumeCurrentValue.innerText=l.toString(),100!==l?window.volumeTopValue.innerText=(l+u).toString():window.volumeTopValue.innerText="",gSTB.SetVolume(l),window.volumeBotValue.innerText=(l-u).toString())}function o(){r.isMuted?(gSTB.SetMute(0),r.isMuted=!1,window.volumeCurrentValue.classList.remove("muted")):(gSTB.SetMute(1),r.isMuted=!0,window.volumeCurrentValue.classList.add("muted"))}var a,r=new(i(14))({$node:window.volumeWidget,visible:!1,focusable:!0}),c=i(1),d=i(4),l=d.volume,u=10;gSTB.SetVolume(l),window.volumeCurrentValue.innerText=l.toString(),100-u>=l&&(window.volumeTopValue.innerText=(l+u).toString()),l>=u?window.volumeBotValue.innerText=(l-u).toString():window.volumeBotValue.innerText="0",r.isMuted=Boolean(gSTB.GetMute()),r.$node.classList.remove("invisible"),r.changeVolume=function(e){switch(e){case c.volumeDown:s();break;case c.volumeUp:n();break;case c.mute:o()}this.display(2),d.volume=l},r.display=function(e){r.visible&&clearTimeout(a),void 0!==e&&(a=setTimeout(function(){r.hide()},1e3*e)),this.show()},r.setValue=function(e){0>e||e>100||(l=e,window.volumeCurrentValue.innerText=l.toString(),0!==l&&l-u>0?window.volumeBotValue.innerText=(l-u).toString():window.volumeBotValue.innerText="",100!==l?window.volumeTopValue.innerText=(l+u).toString():window.volumeTopValue.innerText="")},e.exports=r},function(e,t,i){"use strict";function s(){var e;l.hide(),S.current<i(2).data.metrics.movieList.perLine-1?(S.current++,S.list[1][S.current].disabled?h.back():e=S.list[1][S.current].value):(S.list=r.nextData(),S.current=0,S.list[1][S.current].disabled?h.back():e=S.list[1][S.current].value),T.set(0),window.playerTitle.innerHTML=e.title,window.playerTotalDuration.innerText="00:00",window.playerCurrentDuration.innerText="00:00",x.likes.innerText=e.likes?e.likes.count:0,x.comments.innerText=e.comments,x.plays.innerText=e.views,x.date.innerText=gettext("added")+" "+e.date,a.getCursor({item:e},function(e,t){a.getNext(t,function(e,t){return 0===t.length?void s():(S.currentMedia=t,void(t[720]&&y.singleMode.hd?(b=0,d.play(t[720].url),window.playerHD.innerText="720 HD"):t[480]?(b=1,d.play(movie[480].url),window.playerHD.innerText="480"):t[360]?(b=2,d.play(t[360].url),window.playerHD.innerText="360"):(b=3,d.play(t[240].url),window.playerHD.innerText="240")))})}),S.current<S.list[1].length-1?l.text.innerHTML=S.list[1][S.current+1].value.title:l.text.innerHTML=S.list[2][0].value.title;
  }function n(){var e;l.hide(),S.current>0?(S.current--,S.list[1][S.current].disabled?h.back():e=S.list[1][S.current].value):(S.list=r.prevData(),S.current=i(2).data.metrics.movieList.perLine,S.list[1][S.current].disabled?h.back():e=S.list[1][S.current].value),T.set(0),window.playerTitle.innerHTML=e.title,window.playerTotalDuration.innerText="00:00",window.playerCurrentDuration.innerText="00:00",x.likes.innerText=e.likes?e.likes.count:0,x.comments.innerText=e.comments,x.plays.innerText=e.views,x.date.innerText=gettext("added")+" "+e.date,a.getCursor({item:e},function(e,t){a.getNext(t,function(e,t){return 0===t.length?void n():(S.currentMedia=t,void(t[720]&&y.singleMode.hd?(b=0,d.play(t[720].url),window.playerHD.innerText="720 HD"):t[480]?(b=1,d.play(movie[480].url),window.playerHD.innerText="480"):t[360]?(b=2,d.play(t[360].url),window.playerHD.innerText="360"):(b=3,d.play(t[240].url),window.playerHD.innerText="240")))})}),S.current<S.list[1].length-1?l.text.innerHTML=S.list[1][S.current+1].value.title:l.text.innerHTML=S.list[2][0].value.title}function o(){var e=S.currentMedia;return++b,b>3&&(b=0),0===b&&e[720]?(y.singleMode.hd=!0,d.play(e[720].url,{position:d.currentSec}),window.playerHD.innerText="720 HD"):1===b&&e[480]?(y.singleMode.hd=!1,d.play(e[480].url,{position:d.currentSec}),window.playerHD.innerText="480"):2===b&&e[360]?(y.singleMode.hd=!1,d.play(e[360].url,{position:d.currentSec}),window.playerHD.innerText="360"):3===b&&e[240]&&(y.singleMode.hd=!1,d.play(e[240].url,{position:d.currentSec}),window.playerHD.innerText="240"),E=!0,y.singleMode.hd}var a,r,c,d,l,u=new(i(6))({$node:window.pagePlayer}),h=i(3),p=i(1),m=i(2),f=i(36),v=i(44),g=i(49),y=i(4),w=i(15),E=!1,T=new g({$node:window.playerProgressBar}),S={current:0,list:[],currentMedia:{}},b=0,_={aspects:{fit:"Оригинальный",big:"Увеличенный",opt:"Оптимальный",exp:"Растянутый"}},x={author:window.playerAuthor,likes:window.playerLikes,plays:window.playerPlays,comments:window.playerComments,date:window.playerDate};u.play=function(e,t){var i;S.list=e,S.current=t,a=w.current.plugin,i=S.list[1][S.current].value,T.set(0),window.playerTitle.innerHTML=i.title,window.playerTotalDuration.innerText="00:00",window.playerCurrentDuration.innerText="00:00",x.likes.innerText=i.likes?i.likes.count:0,x.comments.innerText=i.comments,x.plays.innerText=i.views,x.date.innerText=gettext("added")+" "+i.date,window.playerButtonPlay.className="icon-pause2",a.getCursor({item:i},function(e,t){a.getNext(t,function(e,t){if(!e){if(h.navigate("pagePlayer"),"{}"===JSON.stringify(i))return void s();S.currentMedia=t,t[720]&&y.singleMode.hd?(b=0,d.play(t[720].url),window.playerHD.innerText="720 HD"):t[480]?(b=1,d.play(t[480].url),window.playerHD.innerText="480"):t[360]?(b=2,d.play(t[360].url),window.playerHD.innerText="360"):(b=3,d.play(t[240].url),window.playerHD.innerText="240")}})}),S.current<S.list[1].length-1?l.text.innerHTML=S.list[1][S.current+1].value.title:l.text.innerHTML=S.list[2][0].value.title},u.addListener("load",function(){d=new v({$node:document.getElementById("vimeoPlayer"),rewindTimeout:600,events:{keydown:function(e){switch(e.code){case p.info:return void c.display();case p.ok:case p.playPause:this.playPause();break;case p.stop:this.stop();break;case p.forward:case p.right:this.rewind(!0);break;case p.rewind:case p.left:this.rewind(!1);break;case p.f3:o();break;case p.f4:case 117:this.nextAspect();break;case p.pageDown:s();break;case p.pageUp:n()}c.display(5)}}}),c=new f({$node:document.getElementById("playerPanel")}),u.add(d),d.add(c),window.playerAspect.innerText=gettext("Aspect")+":"+gettext("Original"),l=new f({$node:document.getElementById("playerNextMedia"),visible:!1}),l.text=document.createElement("div"),l.$body.appendChild(l.text),d.addListeners({duration:function(e){this.rewindHelper.isActive||this.setModeHelper.active||E||(T.set(e.sec),window.playerCurrentDuration.innerText=e.time,d.totalDurationSec-e.sec<6&&d.totalDurationSec>0?l.show():l.hide())},"get:info":function(e){window.playerTotalDuration.innerText=e.totalDuration,T.init({value:0,max:e.totalDurationSec}),c.display(5)},rewind:function(e){var t=d.parseTime(e.time),i="";T.set(e.time),+t.hour&&(i+=t.hour+":"),i+=t.min+":"+t.sec,window.playerCurrentDuration.innerText=i},"aspect:change":function(e){window.playerAspect.innerText=gettext("Aspect")+":"+_.aspects[e.name]},"content:end":function(){s()},"content:error":function(){s()},pause:function(e){e.state?window.playerButtonPlay.className="icon-play3":window.playerButtonPlay.className="icon-pause2"}}),i(8).addListener("load",function(){window.playerAspect.innerText=gettext("Aspect")+":"+gettext("Original")}),r=i(10),m.addListener("media",function(e){e.code===m.EVENT_PLAYBACK_BEGIN&&E&&(E=!1)})}),u.addListener("show",function(){d.focus()}),u.addListener("keydown",function(e){switch(e.code){case p.back:d.stop(),h.navigate("pageVideoList",{position:S.current});break;case p.stop:d.stop(),h.navigate("pageVideoList",{position:S.current});break;case p.exit:d.stop(),h.navigate("pageService")}}),u.addListener("hide",function(){l.hide()}),e.exports=u},function(e,t,i){"use strict";var s={},n={method:"GET",async:!0,headers:{},type:"text",data:null,timeout:3e4,onload:null,onerror:null,ontimeout:null},o=Object.keys(n);s.ajax=function(e,t){var i,s,a;if(t=t||{},e&&("string"==typeof e||e instanceof String)&&e.length>0){if(t&&"object"==typeof t)for(i=0;i<o.length;i++)void 0===t[o[i]]&&(t[o[i]]=n[o[i]]);if(a=new XMLHttpRequest,a.open(t.method,e,t.async),t.headers&&"object"==typeof t.headers)for(s=Object.keys(t.headers),i=0;i<s.length;i++)a.setRequestHeader(s[i],t.headers[s[i]]);return a.responseType=t.type,a.timeout=t.timeout,t.onload&&"function"==typeof t.onload&&(a.onload=function(){t.onload.call(this,this.response||this.responseText,this.status)}),a.onerror=t.onerror,a.ontimeout=t.ontimeout,a.send(t.data?JSON.stringify(t.data):null),a}return!1},s.encode=function(e){var t,i,s=[];if(e&&"object"==typeof e){for(i=Object.keys(e),t=0;t<i.length;t++)s.push(encodeURIComponent(i[t])+"="+encodeURIComponent(e[i[t]]));if(s.length>0)return s.join("&")}return null},e.exports=s},function(e,t,i){"use strict";var s=i(47);e.exports=function(){var e=s(location.search.substring(1));return e.referrer?decodeURIComponent(e.referrer):document.referrer?location.href.split("#")[0]===document.referrer?!1:document.referrer:!1}},function(e,t,i){"use strict";function s(e){e=e||{},this.$focusItem=null,this.viewIndex=null,this.data=[],this.type=this.TYPE_VERTICAL,this.size=5,this.cycle=!1,this.scroll=null,e.type&&(this.type=e.type),e.className="list "+(e.className||""),this.type===this.TYPE_HORIZONTAL&&(e.className+=" horizontal"),o.call(this,e),this.init(e)}function n(e){var t,i;for(t=0;t<e.length;t++)i=e[t],"object"!=typeof i&&(i=e[t]={value:e[t]});return e}var o=i(5),a=i(1);s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype.TYPE_VERTICAL=1,s.prototype.TYPE_HORIZONTAL=2,s.prototype.renderItemDefault=function(e,t){e.innerText=t.value},s.prototype.renderItem=s.prototype.renderItemDefault,s.prototype.defaultEvents={mousewheel:function(e){this.type===this.TYPE_VERTICAL&&e.wheelDeltaY&&this.move(e.wheelDeltaY>0?a.up:a.down),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?a.left:a.right)},keydown:function(e){switch(e.code){case a.up:case a.down:case a.right:case a.left:case a.pageUp:case a.pageDown:case a.home:case a.end:this.move(e.code);break;case a.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},s.prototype.init=function(e){var t,i,s=this,o=this.$body.children.length,a=function(e){this.data&&(s.focusItem(this),s.events["click:item"]&&s.emit("click:item",{$item:this,event:e}))};if(void 0!==e.cycle&&(this.cycle=e.cycle),e.scroll&&(this.scroll=e.scroll),e.data&&(this.data=n(e.data)),e.render&&(this.renderItem=e.render),e.size&&(this.size=e.size),this.size!==o)for(o>0&&(this.$body.innerText=null),i=0;i<this.size;i++)t=document.createElement("div"),t.index=i,t.className="item",t.addEventListener("click",a),this.$body.appendChild(t);void 0!==e.viewIndex,this.viewIndex=null,void 0!==e.focusIndex?this.focusIndex(e.focusIndex):this.renderView(e.viewIndex||0)},s.prototype.renderView=function(e){var t,i,s,n,o;if(this.viewIndex!==e){for(n=this.viewIndex,this.viewIndex=o=e,i=0;i<this.size;i++)t=this.$body.children[i],s=this.data[e],s?(t.data=s,t.index=e,this.renderItem(t,s),s.mark?t.classList.add("mark"):t.classList.remove("mark")):(t.data=t.index=void 0,t.innerHTML="&nbsp;"),e++;return this.events["move:view"]&&this.emit("move:view",{prevIndex:n,currIndex:o}),this.events["select:item"]&&this.emit("select:item",{$item:t}),this.scroll&&this.scroll.scrollTo(this.viewIndex),!0}return!1},s.prototype.move=function(e){(e===a.up&&this.type===this.TYPE_VERTICAL||e===a.left&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.index>0?this.$focusItem===this.$body.firstChild?this.renderView(this.viewIndex-1):this.focusItem(this.$focusItem.previousSibling):this.cycle?(this.move(a.end),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),(e===a.down&&this.type===this.TYPE_VERTICAL||e===a.right&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.index<this.data.length-1?this.$focusItem===this.$body.lastChild?this.renderView(this.viewIndex+1):this.focusItem(this.$focusItem.nextSibling):this.cycle?(this.move(a.home),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),e===a.pageUp&&(this.viewIndex<this.size?this.renderView(0):this.renderView(this.viewIndex-this.size+1),this.focusItem(this.$body.firstChild)),e===a.pageDown&&(this.data.length>this.size?(this.viewIndex>this.data.length-2*this.size?this.renderView(this.data.length-this.size):this.renderView(this.viewIndex+this.size-1),this.focusItem(this.$body.lastChild)):this.focusItem(this.$body.children[this.data.length-1])),e===a.home&&(this.renderView(0),this.focusItem(this.$body.firstChild)),e===a.end&&(this.data.length>this.size?(this.renderView(this.data.length-this.size),this.focusItem(this.$body.lastChild)):this.focusItem(this.$body.children[this.data.length-1]))},s.prototype.focusItem=function(e){var t=this.$focusItem;return e&&t!==e?(null!==t&&(t.classList.remove("focus"),this.events["blur:item"]&&this.emit("blur:item",{$item:t})),this.$focusItem=e,this.$focusItem.data=this.data[this.$focusItem.index],e.classList.add("focus"),this.events["focus:item"]&&this.emit("focus:item",{$prev:t,$curr:e}),this.events["select:item"]&&this.emit("select:item",{$item:e}),!0):!1},s.prototype.focusIndex=function(e){var t=this.viewIndex||0;e>=t+this.size?(e=e<this.data.length-1?e:this.data.length-1,this.renderView(e-this.size+1),this.focusItem(this.$body.lastChild)):t>e?(e=e>0?e:0,this.renderView(e),this.focusItem(this.$body.firstChild)):(null===this.viewIndex&&this.renderView(0),this.focusItem(this.$body.children[e-t]))},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";var s=i(18),n=i(12),o=i(14),a=i(1),r=(i(2),new o({$node:window.captchaWidget,$body:window.captchaWidgetBody,visible:!1})),c=new s({events:{keydown:function(e){e.stop=!0}}}),d=new n({cycleY:!1,data:[["1","2","3","4","5","6","7","8","9","0",{value:"ok",code:a.ok,rowSpan:6}],["a","b","c","d","e","f","g","h","i","j"],["k","l","m","n","o","p","q","r","s","t"],["u","v","w","x","y","z",".",",","!","%"],[{value:"left",code:a.left},{value:"right",code:a.right},{value:"backspace",code:a.back},"@","#","$","^","&","*","/"],["(",")","{","}","-","=",'"',"'","[","]"]],events:{keydown:function(e){e.stop=!0},"click:item":function(e){e.$item.data.code===a.ok?c.value&&(requestArgs.callback(c.value),c.setValue("")):e.$item.data.code===a.left?c.moveCaret(a.left):e.$item.data.code===a.right?c.moveCaret(a.right):e.$item.data.code===a.back?c.removeChar():c.addChar(e.$item.data.value)}}}),l=document.createElement("img"),u=document.createElement("div");l.className="captchaImage",d.$body.classList.add("captchaKeyBoard"),u.className="header",u.innerText="Input code from image",r.$body.appendChild(u),r.activate=function(e,t,i,s){this.show(),d.focus(),requestArgs.callback=s,l.setAttribute("src",e.captcha_img)},r.$body.appendChild(l),r.add(c,d),e.exports=r},function(e,t,i){"use strict";function s(e){e=e||{},n.call(this,e),this.initItem=e.item,this.responseSize=e.size,this.nextCacheSize=e.cacheSize/2||40,this.prevCacheSize=e.cacheSize/2||40,this.cache={data:[],head:0,tail:0},e.item.searchText?(this.type=a.dataProviderType.TYPE_SEARCH,this.searchText=e.searchText):this.type=a.dataProviderType.TYPE_SERVICE}var n=i(21),o=i(1),a=i(4);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.get=function(e,t){var i,s=this,n=!0,a=!1,r=[],c=[];switch(e){case null:for(this.page=1,this.cache.tail=0,this.cache.head=0,this.cache.data=[],this.cache.emptyBotCount=0,this.cache.botEmptyLine=!1,this.cache.topEmptyLine=!0,i=0;i<this.responseSize;i++)this.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});this.plugin.getCursor(this.initItem,function(e,i){s.cache.headCursor=i,s.plugin.getCursor(s.initItem,function(e,t){s.cache.tailCursor=t}),s.plugin.getNext(s.cache.headCursor,function(e,i){var n,o=!1;e||(i.forEach(function(e){s.cache.data.push({value:e})}),s.cache.data.length>=3*s.responseSize?(n=s.cache.data.slice(0,3*s.responseSize),s.cache.head=3*s.responseSize,t(o,n),s.events.preload&&s.emit("preload",{array:s.cache.data.slice(3*s.responseSize,5*s.responseSize)}),s.cache.currentData=n,s.checkNext()):s.checkNext(function(){n=s.cache.data.slice(0,3*s.responseSize),s.cache.head=3*s.responseSize,t(o,n),s.cache.currentData=n,s.events.preload&&s.emit("preload",{array:s.cache.data.slice(3*s.responseSize,5*s.responseSize)})}))})});break;case o.down:if(this.cache.head+this.responseSize<=this.cache.data.length)r=this.cache.data.slice(this.cache.head,this.cache.head+this.responseSize),this.cache.head+=this.responseSize,this.cache.tail+=this.responseSize,this.cache.head+3*this.responseSize<=this.cache.data.length&&(c=this.cache.data.slice(this.cache.head+2*this.responseSize,this.cache.head+3*this.responseSize)),this.page++,this.checkNext();else if(1===this.page&&this.cache.data.length%this.responseSize!==0){for(i=0;i<this.cache.data.length%this.responseSize+this.responseSize;i++)this.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0}),this.cache.emptyBotCount++;this.cache.botEmptyLine=!0,r=this.cache.data.slice(this.cache.head,this.cache.head+this.responseSize),this.cache.head+=this.responseSize,this.cache.tail+=this.responseSize,this.page++,this.checkNext()}else r=[],a=!0;r.length>0&&(this.cache.currentData=this.cache.currentData.slice(this.responseSize).concat(r)),t(a,this.cache.currentData),this.events.preload&&this.emit("preload",{array:c});break;case o.up:if(1===this.page)return!1;this.cache.tail-this.responseSize>=0?(r=this.cache.data.slice(this.cache.tail-this.responseSize,this.cache.tail),this.cache.head-=this.responseSize,this.cache.tail-=this.responseSize,this.cache.tail-2*this.responseSize>=0&&(c=this.cache.data.slice(this.cache.tail-2*this.responseSize,this.cache.tail-this.responseSize)),this.page--,this.checkPrev()):(r=null,a=!0),r.length>0&&(this.cache.currentData.splice(-this.responseSize),this.cache.currentData=r.concat(this.cache.currentData)),t(a,this.cache.currentData)}return n},s.prototype.checkNext=function(e){var t,i=this;this.cache.botEmptyLine||(this.cache.data.length<this.cache.head+this.nextCacheSize&&this.plugin.getNext(this.cache.headCursor,function(s,n){if(s);else if(n.length>0)n.forEach(function(e){i.cache.data.push({value:e})}),i.cache.data.length>=3*i.responseSize&&e?e():i.checkNext(e);else{for(t=0;t<i.cache.data.length%i.responseSize;t++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0}),i.cache.emptyBotCount++;for(t=0;t<i.responseSize;t++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});i.cache.emptyBotCount+=i.responseSize,i.cache.botEmptyLine=!0,e&&e()}}),this.cache.tail>=this.prevCacheSize+3*this.responseSize&&this.plugin.getNext(this.cache.tailCursor,function(e,t){var s,n;if(e);else{for(n=t.length,i.cache.topEmptyLine&&(n+=i.responseSize,i.cache.topEmptyLine=!1),s=0;n>s;s++)i.cache.data.shift();i.cache.head-=n,i.cache.tail-=n}}))},s.prototype.checkPrev=function(){var e,t=this;this.topEmptyLine||(this.cache.tail<this.prevCacheSize-3*this.responseSize&&this.plugin.getPrev(this.cache.tailCursor,function(i,s){if(i);else if(s.length>0){for(e=s.length-1;e>=0;e--)t.cache.data.unshift({value:s[e]});t.cache.head+=s.length,t.cache.tail+=s.length}else if(!t.cache.topEmptyLine){for(e=0;e<t.responseSize;e++)t.cache.data.unshift({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});t.cache.head+=t.responseSize,t.cache.tail+=t.responseSize,t.cache.topEmptyLine=!0}}),this.cache.data.length-this.cache.head>this.nextCacheSize&&this.plugin.getPrev(this.cache.headCursor,function(e,i){var s;s=i.length,t.cache.botEmptyLine&&(s+=t.cache.emptyBotCount,t.cache.botEmptyLine=!1),t.cache.data.splice(t.cache.data.length-s,s)}))},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},n.call(this,e),this.initItem=e.item,this.responseSize=e.size,this.nextCacheSize=e.cacheSize/2||40,this.prevCacheSize=e.cacheSize/2||40,this.cache={data:[],head:0,tail:0},this.nextRepeatTimes=0,e.item.searchText?(this.type=a.dataProviderType.TYPE_SEARCH,this.searchText=e.searchText):this.type=a.dataProviderType.TYPE_SERVICE}var n=i(21),o=i(1),a=i(4);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.get=function(e,t){var i,s=this,n=!0,a=!1,r=[],c=[],d=+new Date;switch(e){case null:for(this.page=1,this.cache.tail=0,this.cache.head=0,this.cache.data=[],this.cache.emptyBotCount=0,this.cache.botEmptyLine=!1,this.cache.topEmptyLine=!0,i=0;i<this.responseSize;i++)this.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});this.plugin.getCursor(this.initItem,function(e,i){return e?void t(!0):(s.cache.headCursor=i,s.plugin.getCursor(s.initItem,function(e,t){s.cache.tailCursor=t}),void s.plugin.getNext(s.cache.headCursor,function(e,i){var n,o=!1;e||(i.forEach(function(e){e.type||(e.date=s.timeDiff(e.date,d),e.duration=s.normalizeVideoDuration(e.duration),e.type=s.plugin.TYPE_MOVIE),s.cache.data.push({value:e})}),s.cache.data.length>=3*s.responseSize?(n=s.cache.data.slice(0,3*s.responseSize),s.cache.head=3*s.responseSize,t(o,n),s.events.preload&&s.emit("preload",{array:s.cache.data.slice(3*s.responseSize,5*s.responseSize)}),s.cache.currentData=n,s.checkNext()):s.checkNext(function(){n=s.cache.data.slice(0,3*s.responseSize),s.cache.head=3*s.responseSize,t(o,n),s.cache.currentData=n,s.events.preload&&s.emit("preload",{array:s.cache.data.slice(3*s.responseSize,5*s.responseSize)})}))}))});break;case o.down:if(this.cache.head+this.responseSize<=this.cache.data.length)r=this.cache.data.slice(this.cache.head,this.cache.head+this.responseSize),this.cache.head+=this.responseSize,this.cache.tail+=this.responseSize,this.cache.head+3*this.responseSize<=this.cache.data.length&&(c=this.cache.data.slice(this.cache.head+2*this.responseSize,this.cache.head+3*this.responseSize)),this.page++,this.checkNext();else if(1===this.page&&this.cache.data.length%this.responseSize!==0){for(i=0;i<this.cache.data.length%this.responseSize+this.responseSize;i++)this.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0}),this.cache.emptyBotCount++;this.cache.botEmptyLine=!0,r=this.cache.data.slice(this.cache.head,this.cache.head+this.responseSize),this.cache.head+=this.responseSize,this.cache.tail+=this.responseSize,this.page++,this.checkNext()}else r=[],a=!0;r.length>0&&(this.cache.currentData=this.cache.currentData.slice(this.responseSize).concat(r)),t(a,this.cache.currentData),this.events.preload&&this.emit("preload",{array:c});break;case o.up:if(1===this.page)return!1;this.cache.tail-this.responseSize>=0?(r=this.cache.data.slice(this.cache.tail-this.responseSize,this.cache.tail),this.cache.head-=this.responseSize,this.cache.tail-=this.responseSize,this.cache.tail-2*this.responseSize>=0&&(c=this.cache.data.slice(this.cache.tail-2*this.responseSize,this.cache.tail-this.responseSize)),this.page--,this.checkPrev()):(r=null,a=!0),r.length>0&&(this.cache.currentData.splice(-this.responseSize),this.cache.currentData=r.concat(this.cache.currentData)),t(a,this.cache.currentData)}return n},s.prototype.checkNext=function(e){var t,i=this,s=+new Date;this.cache.botEmptyLine||(this.cache.data.length<this.cache.head+this.nextCacheSize&&this.plugin.getNext(this.cache.headCursor,function(n,o){if(n);else if(o.length>0?i.nextRepeatTimes=0:++i.nextRepeatTimes,i.nextRepeatTimes>6){for(t=0;t<i.cache.data.length%i.responseSize;t++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0}),i.cache.emptyBotCount++;for(t=0;t<i.responseSize;t++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});i.cache.emptyBotCount+=i.responseSize,i.cache.botEmptyLine=!0,e&&e()}else o.forEach(function(e){e.type||(e.date=i.timeDiff(e.date,s),e.duration=i.normalizeVideoDuration(e.duration),e.type=i.plugin.TYPE_MOVIE),i.cache.data.push({value:e})}),i.cache.data.length>=3*i.responseSize&&e?e():i.checkNext(e)}),this.cache.tail>=this.prevCacheSize+3*this.responseSize&&this.plugin.getNext(this.cache.tailCursor,function(e,t){var s,n;if(e);else{for(n=t.length,i.cache.topEmptyLine&&(n+=i.responseSize,i.cache.topEmptyLine=!1),s=0;n>s;s++)i.cache.data.shift();i.cache.head-=n,i.cache.tail-=n}}))},s.prototype.checkPrev=function(){var e,t=this;this.topEmptyLine||(this.cache.tail<this.prevCacheSize-3*this.responseSize&&this.plugin.getPrev(this.cache.tailCursor,function(i,s){if(i);else if(s.length>0){for(e=s.length-1;e>=0;e--)t.cache.data.unshift({value:s[e]});t.cache.head+=s.length,t.cache.tail+=s.length}else if(!t.cache.topEmptyLine){for(e=0;e<t.responseSize;e++)t.cache.data.unshift({value:{date:"",img:"",title:"",url:"",invisible:!0},disable:!0});t.cache.head+=t.responseSize,t.cache.tail+=t.responseSize,t.cache.topEmptyLine=!0}}),this.cache.data.length-this.cache.head>this.nextCacheSize&&this.plugin.getPrev(this.cache.headCursor,function(e,i){var s;s=i.length,t.cache.botEmptyLine&&(s+=t.cache.emptyBotCount,t.cache.botEmptyLine=!1),t.cache.data.splice(t.cache.data.length-s,s)}))},e.exports=s},function(e,t){"use strict";e.exports={initPlayer:gSTB.InitPlayer,saveUserData:gSTB.SaveUserData,loadUserData:gSTB.LoadUserData,setPosTime:gSTB.SetPosTime,getPosTime:gSTB.GetPosTime,play:gSTB.Play,pause:gSTB.Pause,continuePlay:gSTB.Continue,getVolume:gSTB.GetVolume,setVolume:gSTB.SetVolume,setNativeStringMode:gSTB&&gSTB.SetNativeStringMode?gSTB.SetNativeStringMode:function(){},setServiceButtonState:gSTB.EnableServiceButton,setVKButtonState:gSTB.EnableVKButton,setTvButtonState:gSTB.EnableTvButton,setAppButtonState:gSTB.EnableAppButton,hideVK:gSTB.HideVirtualKeyboard,showVK:gSTB.ShowVirtualKeyboard,getStandByStatus:gSTB.GetStandByStatus,setStandByStatus:gSTB.StandBy,getEnv:gSTB.GetEnv,isMuted:gSTB.GetMute,setMute:gSTB.SetMute,deviceModel:gSTB.GetDeviceModelExt}},function(e,t){"use strict";function i(e){return e in s&&(e=s[e]),e}var s={followers:"По подписчикам",likes:"По лайкам",comments:"По комментариям",date:"По дате",alphabetical:"По алфавиту",plays:"По просмотрам",duration:"По длительности",relevant:"По актуальности",preset:"По умолчанию",videos:"По количеству",members:"По участникам"};e.exports=i},function(e,t,i){"use strict";function s(e){e=e||{},n.call(this,e),this.displayTimeout=0,this.attach=!1,this.$node.classList.add("playerPanel")}var n=i(13);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.display=function(e){var t=this;if(e){if(this.attach)return;e=1e3*e,this.show(),this.displayTimeout&&(clearTimeout(this.displayTimeout),this.displayTimeout=0),this.displayTimeout=setTimeout(function(){t.hide(),t.displayTimeout=0},e)}else this.displayTimeout?(clearTimeout(this.displayTimeout),this.displayTimeout=0):this.attach?(this.hide(),this.attach=!1):(this.show(),this.attach=!0)},e.exports=s},function(e,t){"use strict";e.exports=function(e,t){e.ready||(e.$box=e.appendChild(document.createElement("div")),e.$box.className="movieItem",e.$img=e.$box.appendChild(document.createElement("div")),e.$img.className="cover",e.$duration=e.$img.appendChild(document.createElement("div")),e.$duration.className="duration",e.$description=e.$box.appendChild(document.createElement("div")),e.$description.className="movieDescription",e.$name=e.$description.appendChild(document.createElement("div")),e.$name.className="name",e.$info=e.$description.appendChild(document.createElement("div")),e.$info.className="info",t.value.invisible&&e.classList.add("invisible"),e.ready=!0),e.data&&(t.value.invisible?(e.classList.add("invisible"),e.data.disable=!0):(e.classList.remove("invisible"),e.data.disable=!1)),t.value.invisible||(e.movieObj=t.value,e.$img.style.backgroundImage="url("+t.value.img+")",e.$name.innerHTML=t.value.title,e.$info.innerText=t.value.info)}},function(e,t,i){"use strict";var s=i(2),n="image";s.data.metrics.height<720&&(n="image_medium"),e.exports=function(e,t){e.ready||(e.$box=e.appendChild(document.createElement("div")),e.$box.className="movieItem",e.$img=e.$box.appendChild(document.createElement("div")),e.$img.className="cover",e.$duration=e.$img.appendChild(document.createElement("div")),e.$duration.className="duration",e.$description=e.$box.appendChild(document.createElement("div")),e.$description.className="movieDescription",e.$name=e.$description.appendChild(document.createElement("div")),e.$name.className="name",e.$info=e.$description.appendChild(document.createElement("div")),e.$info.className="info",t.value.invisible&&e.classList.add("invisible"),e.ready=!0),e.data&&(t.value.invisible?(e.classList.add("invisible"),e.data.disable=!0):(e.classList.remove("invisible"),e.data.disable=!1)),t.value.invisible||(e.movieObj=t.value,e.$img.style.backgroundImage="url("+(t.value.image||t.value.image_medium)+")",e.$name.innerHTML=t.value.title,t.value.views?e.$info.innerText=t.value.views+" "+ngettext("view","views",t.value.views)+" · "+t.value.date:e.$info.innerText=t.value.date,t.value.files&&t.value.files.external?(e.classList.add("external"),e.$duration.innerHTML=gettext("External video may not be played")):(e.classList.remove("external"),e.$duration.innerText=t.value.duration))}},function(e,t,i){"use strict";e.exports=new(i(6))({$node:window.pageInit})},function(e,t,i){"use strict";function s(e){return"window."+e+".id"}function n(e,t){var i,n=s(e),o=stbStorage.getItem(n);if(o)try{i=JSON.parse(stbWindowMgr.windowInfo(o)),-1===i.result.url.indexOf(t)&&stbWebWindow.messageSend(o,"window.load",t),e===p.BROWSER?(o=stbWindowMgr.openWebFace(t),stbStorage.setItem(n,o)):stbWindowMgr.windowShow(o)}catch(a){debug.error(a),stbWindowMgr.openWebFace(t)}else o=e===p.BROWSER?stbWindowMgr.openWebFace(t):stbWindowMgr.windowInit(JSON.stringify({url:t,backgroundColor:"#000"})),stbStorage.setItem(n,o);return o}var o=i(3),a=i(2),r=i(1),c=i(18),d=i(9),l=new(i(6))({$node:window.pageLogin}),u=i(11),h=-1,p={PORTAL:"portal",HELP:"help",DOWNLOAD_MANAGER:"dlman",PVR:"recordsManager",BROWSER:"ibman",BROWSER_VIEW:"ibmanView",PORTALS_LOADER:"portalsLoader",SYSTEM_SETTINGS:"systemSettings"};l.addListener("load",function(e){window.plLoginLabel.innerText=gettext("Phone or email"),window.plPasswordLabel.innerText=gettext("Password"),l.add(l.loginInput=new c({$node:window.plLoginInput,events:{keydown:function(e){switch(e.code){case r["delete"]:this.removeChar(this.$caret.index);break;case r.back:this.removeChar(this.$caret.index-1);break;case r.left:this.setCaretPosition(this.$caret.index-1);break;case r.right:this.setCaretPosition(this.$caret.index+1);break;case r.end:this.setCaretPosition(this.value.length);break;case r.home:this.setCaretPosition(0);break;case r.down:case r.channelNext:l.passInput.focus()}},focus:function(){stbWindowMgr.SetVirtualKeyboardCoord("bottom")}}})),l.add(l.passInput=new c({$node:window.plPasswordInput,type:c.prototype.TYPE_PASSWORD,events:{keydown:function(e){switch(e.code){case r["delete"]:this.removeChar(this.$caret.index);break;case r.back:this.removeChar(this.$caret.index-1);break;case r.left:this.setCaretPosition(this.$caret.index-1);break;case r.right:this.setCaretPosition(this.$caret.index+1);break;case r.end:this.setCaretPosition(this.value.length);break;case r.home:this.setCaretPosition(0);break;case r.down:case r.channelNext:l.submitButton.focus();break;case r.up:l.loginInput.focus()}},focus:function(){stbWindowMgr.SetVirtualKeyboardCoord("top")}}})),l.add(l.submitButton=new d({$node:window.plSubmitButtom,value:gettext("Login"),events:{keydown:function(e){e.code===r.ok?this.emit("click"):e.code===r.up?l.passInput.focus():(e.code===r.right||e.code===r.channelNext)&&l.exitButton.focus()},click:function(){var e=this;return clearTimeout(h),this.$node.classList.add("click"),window.plErrorMessage.className="",setTimeout(function(){e.$node.classList.remove("click")},this.clickDuration),h=setTimeout(function(){window.plErrorMessage.className="",window.plErrorMessage.innerHTML="&nbsp;"},3e3),l.loginInput.value?l.passInput.value?void u.login(l.loginInput.value,l.passInput.value,function(e){var t,i,r=0;e.result?u.checkAuth(e,function(t){t?(a.settings.auth={user_id:e.user_id,access_token:e.access_token},location.reload()):a.settings.auth=!1}):e.redirect_uri?(clearTimeout(h),window.plErrorMessage.className="error",window.plErrorMessage.innerText=gettext('After 10 seconds, the browser will be loaded, and to confirm your wish to log in, click on the button "Pass test check" or enter the code from sms message, if you enable two-factor authentication'),setTimeout(function(){setTimeout(function(){n(p.BROWSER,"file:///home/web/public/app/ibman/index.html?mode=2&url="+encodeURIComponent(e.redirect_uri))},0),o.navigate("pageInit"),i=setInterval(function(){var e,n=stbWindowMgr.getCurrWebUrl(),o={};if(t=stbStorage.getItem(s(p.BROWSER)),0===n.length&&r>10){try{stbWebWindow.messageSend(t,"close")}catch(c){}return clearInterval(i),void location.reload()}if(++r,-1!==n.indexOf("blank.html")){try{n=n.split("?")[1].split("&")}catch(c){try{n=n.split("#")[1].split("&")}catch(c){return}}n.forEach(function(t){e=t.split("="),o[e[0]]=e[1]}),clearInterval(i);try{stbWebWindow.messageSend(t,"close")}catch(c){}o.access_token&&o.user_id&&(a.settings.auth={user_id:o.user_id,access_token:o.access_token}),location.reload()}},1e3)},1e4)):(clearTimeout(h),l.loginInput.focus(),e.message?(window.plErrorMessage.className="error",window.plErrorMessage.innerText=gettext(e.message)):(window.plErrorMessage.className="error",window.plErrorMessage.innerText=gettext("Service is temporarily unavailable")))}):(window.plErrorMessage.className="warning",window.plErrorMessage.innerText=gettext("Please, input password"),void l.passInput.focus()):(window.plErrorMessage.className="warning",window.plErrorMessage.innerText=gettext("Please, input login"),void l.loginInput.focus())}}})),l.add(l.exitButton=new d({$node:window.plExitButtom,value:gettext("Exit"),events:{keydown:function(e){e.code===r.ok?this.emit("click"):e.code===r.up?l.passInput.focus():e.code===r.left?l.submitButton.focus():e.code===r.channelNext&&l.loginInput.focus()},click:function(){var e=this;this.$node.classList.add("click"),setTimeout(function(){e.$node.classList.remove("click"),a.exit()},this.clickDuration)}}}))}),l.addListener("show",function(e){l.loginInput.focus()}),l.addListener("keydown",function(e){e.code===r.exit&&a.exit()}),e.exports=l},function(e,t,i){"use strict";var s=i(2);e.exports=new(i(6))({$node:window.pageReload,events:{show:function(){delete s.settings.auth,location.reload()}}})},function(e,t,i){"use strict";
  function s(e){var t=[];switch(e.$item.data.value.type){case k.TYPE_CATEGORY:b.initVideoList(T.dataProviderType.TYPE_SERVICE,{item:e.$item.data.value},function(){m.navigate("pageVideoList")});break;case k.TYPE_FOLDER:n(e.$item.data.value);break;case L.TYPE_BACK:o();break;case L.TYPE_SEARCH_LIST:I.push(u),t=[],t=D.searchArr,c.viewIndex=-1,c.init({data:t,size:t.length}),c.focusItem(c.$body.children[0]);break;case L.TYPE_SEARCH:_.initSearch(e.$item.data.value,function(){m.navigate("pageSearch")});break;default:e.$item.data.value.system.onclick&&e.$item.data.value.system.onclick(v.settings)&&(I.pop(),o())}}function n(e){I.push(u),u=e,k.getCursor({item:e},function(e,t){k.getNext(t,function(e,t){var i=[];0!==t.length&&(i.push(D.back),t.forEach(function(e){i.push({value:e})}),c.viewIndex=-1,c.init({data:i,size:i.length}),c.$body.children[1]?c.focusItem(c.$body.children[1]):c.focusItem(c.$body.children[0]))})})}function o(){0===I.length||(1===I.length?p.initService(null,function(){c.focus(),I=[]}):k.getCursor({item:I.pop()},function(e,t){var i=[];k.getNext(t,function(e,t){0!==I.length&&i.push(D.back),t.forEach(function(e){i.push({value:e})}),c.viewIndex=-1,c.init({data:i,size:i.length}),c.focusItem(c.$body.children[0])})}))}var a,r,c,d,l,u,h=i(6),p=new h({$node:window.pageService}),m=i(3),f=i(1),v=i(2),g=i(13),y=i(30),w=i(19),E=i(9),T=i(4),S=i(15),b=i(10),_=i(16),x=new w({visible:!1,events:{show:function(){this.title.$body.innerText=gettext(this.titleText),this.okBtn.$text.innerText=gettext("Ok"),this.cancelBtn.$text.innerText=gettext("Cancel"),this.okBtn.focus()},hide:function(){this.titleText="Exit from the app?",v.params.referrer=i(29)(),d.focus()}}}),k={},I=[],L={TYPE_BACK:20,TYPE_SEARCH_LIST:12,TYPE_SEARCH:13},D={back:{value:{title:gettext("Back"),specialClass:"backItem",type:L.TYPE_BACK}},searchArr:[]},P=[];p.addListener("load",function(){a=new g({focusable:!1,$node:document.getElementById("pageServiceWrapper")}),p.add(a),r=new g({$node:document.getElementById("pageServiceRightPanel")}),a.add(r),p.modalExit=x,p.add(x),gettext("Exit from the app?"),gettext("Logout?"),x.add(x.title=new g),x.titleText=gettext("Exit from the app?"),x.add(x.okBtn=new E({value:gettext("Ok"),events:{keydown:function(e){switch(e.code){case f.ok:this.emit("click");break;case f.right:x.cancelBtn.focus();break;case f.back:case f.exit:x.hide(),e.stop=!0}},click:function(){v.exit()}}})),x.add(x.cancelBtn=new E({value:gettext("Cancel"),events:{keydown:function(e){switch(e.code){case f.ok:this.emit("click");break;case f.left:x.okBtn.focus();break;case f.back:case f.exit:x.hide(),e.stop=!0}},click:function(){x.hide()}}})),p.initService(null,function(){m.navigate("pageService")})}),p.addListener("show",function(){try{c.focus(),c.focusItem(c.$focusItem)}catch(e){}window.breadcrumb=[]}),p.initService=function(e,t,n){window.pageServiceLogo.classList.add("logo"),P=[],window.pageServiceDescription.innerText=gettext("Convenient application for viewing videos from the popular social network VKontakte. This service allows you to watch video from a personal page or use the search by friends, groups or title."),i(8).addListener("load",function(){window.pageServiceDescription.innerText=gettext("Convenient application for viewing videos from the popular social network VKontakte. This service allows you to watch video from a personal page or use the search by friends, groups or title.")}),S.loadPlugin(e,function(i){k=i.plugin,k.info={serviceId:e},window.breadcrumb=[],u=k.root,k.getCursor({item:k.root},function(e,i){return e?void n():(l=i,void k.getNext(l,function(e,i){i.forEach(function(e){var t={};t.value=e,P.push(t)}),c&&c.remove();p.Menu=c=new y({data:P,size:P.length,render:function(e,t){var i=document.createElement("div"),s=document.createElement("div");e.innerHTML="",s.className="text",i.className="wrapper",s.innerText=t.value.title,t.value.specialClass?(s.innerText=gettext("Back"),i.classList.add(t.value.specialClass)):i.className="wrapper",t.value.searchType&&(e.data.value.searchType=t.value.searchType),i.appendChild(s),e.appendChild(i)}}),r.add(c),c.addListeners({"click:item":s,"focus:item":function(e){c.$node.style.top=p.$node.offsetHeight/2-c.$focusItem.index*c.$focusItem.offsetHeight-c.$focusItem.offsetHeight/2+"px",e.$curr.data.value.img&&(window.pageServiceCatImg.className=e.$curr.data.value.img)}}),c.$node.style.top=p.$node.offsetHeight/2-c.$node.firstChild.offsetHeight/2+"px",c.focusItem(c.$body.firstChild),t()}))})})},p.addListener("keydown",function(e){switch(e.code){case f.back:o();break;case f.exit:d=m.current.activeComponent,x.show()}}),e.exports=p},function(e,t,i){"use strict";function s(e){n.call(this),this.data=e||{}}var n=i(7);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.idName="id",s.prototype.clear=function(){var e=this.data;return Object.keys(e).length>0?(this.data={},this.events.clear&&this.emit("clear",{data:e}),!0):!1},s.prototype.init=function(e){return e?(this.clear(),this.data=e,this.events.init&&this.emit("init",{data:e}),!0):!1},s.prototype.has=function(e){return this.data.hasOwnProperty(e)},s.prototype.get=function(e){return this.data[e]},s.prototype.set=function(e,t){var i=e in this.data,s={name:e,curr:t};return i?(s.prev=this.data[e],t!==s.prev?(this.data[e]=t,this.events.change&&this.emit("change",s),!0):!1):(this.data[e]=t,this.events.change&&this.emit("change",s),!0)},s.prototype.unset=function(e){var t,i=e in this.data;return i?(t={name:e,prev:this.data[e]},delete this.data[e],this.events.change&&this.emit("change",t),!0):!1},e.exports=s},function(e,t,i){"use strict";function s(e){var t=this;this.isPLaying=!1,this.isPause=!1,this.totalDuration="",this.totalDurationSec=0,this.currentTime="",this.currentSec=0,this.rewindHelper={isActive:!1,startTime:0,time:0,timeout:0,duration:void 0,timeoutDuration:!1},this.setModeHelper={active:!1,timeout:0,time:0,timeStr:"",count:0,length:0,sec:0,timeoutDuration:0},this.audioPIDs=[],this.currentAudioPID=0,this.activeAspect=0,this.subtitlePIDs=[],this.currentSubtitle=null,this.durationInterval=0,this.allowInputPosition=!0,e=e||{},a.call(this,e),this.$node.classList.add("player"),this.init(e),n.addListener("media",function(e){s.prototype.mediaListener.call(t,e)})}var n=i(2),o=i(1),a=i(5);s.prototype=Object.create(a.prototype),s.prototype.constructor=s,s.prototype.ASPECT_TYPE_FIT=16,s.prototype.ASPECT_TYPE_BIG=64,s.prototype.ASPECT_TYPE_OPTIMAL=80,s.prototype.ASPECT_TYPE_ZOOM=0,s.prototype.aspects=[{name:"fit",mode:s.prototype.ASPECT_TYPE_FIT},{name:"big",mode:s.prototype.ASPECT_TYPE_BIG},{name:"opt",mode:s.prototype.ASPECT_TYPE_OPTIMAL},{name:"exp",mode:s.prototype.ASPECT_TYPE_ZOOM}],s.prototype.STEREO_MODE_OFF=0,s.prototype.STEREO_MODE_OVER_UNDER=1,s.prototype.STEREO_MODE_OVER_UNDER_HD=2,s.prototype.STEREO_MODE_SIDE_BY_SIDE=3,s.prototype.stereoModes=[{mode:s.prototype.STEREO_MODE_OFF,name:"Off"},{mode:s.prototype.STEREO_MODE_OVER_UNDER,name:"Over-Under"},{mode:s.prototype.STEREO_MODE_OVER_UNDER_HD,name:"Over-Under HD"},{mode:s.prototype.STEREO_MODE_SIDE_BY_SIDE,name:"Side-by-side"}],s.prototype.defaultEvents={keydown:function(e){switch(e.code){case o.ok:case o.playPause:this.playPause();break;case o.stop:this.stop();break;case o.forward:case o.right:this.rewind(!0);break;case o.rewind:case o.left:this.rewind(!1);break;case o.f4:case 117:this.nextAspect();break;case o.f1:this.nextAudioTrack();break;case o.f2:this.nextSubtitle();break;case o.f3:this.nextViewMode();break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:this.inputPosition(e.code)}}},s.prototype.mediaListener=function(e){var t,i,s,o,a,r,c=this,d={};switch(e.code){case n.EVENT_PLAYBACK_BEGIN:c.isPLaying=!0,c.durationInterval&&(clearInterval(c.durationInterval),c.durationInterval=0),c.durationInterval=setInterval(function(){c.events.duration&&(c.currentSec=gSTB.GetPosTime(),i=c.parseTime(c.currentSec),c.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,c.emit("duration",{sec:c.currentSec,time:c.currentTime}))},1e3);break;case n.EVENT_GET_MEDIA_INFO:c.totalDurationSec=gSTB.GetMediaLen(),c.totalDurationSec>3600?c.setModeHelper.length=6:c.setModeHelper.length=4,t=c.parseTime(gSTB.GetMediaLen()),c.totalDuration=(t.hour>0?t.hour+":":"")+t.min+":"+t.sec,d.totalDuration=c.totalDuration,d.totalDurationSec=c.totalDurationSec;try{a=gSTB.GetAudioPIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),c.audioPIDs=JSON.parse(a)}catch(l){}try{r=gSTB.GetSubtitlePIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),c.subtitlePIDs=JSON.parse(r)}catch(l){}c.currentAudioPID=0,""!==c.audioPIDs[0].lang[0]?d.audioPid=c.audioPIDs[0].lang[0]:d.audioPid=void 0,c.currentSubtitle=null,d.subtitles=null,d.stereoMode={type:gSTB.Get3DConversionMode(),name:c.stereoModes[gSTB.Get3DConversionMode()].name},c.events["get:info"]&&c.emit("get:info",d);break;case n.EVENT_CONTENT_ERROR:c.isPLaying=!1,c.events["content:error"]&&c.emit("content:error");break;case n.EVENT_END_OF_FILE:c.currentSec=c.totalDurationSec,c.isPLaying=!1,c.events["content:end"]&&c.emit("content:end");break;case n.EVENT_SUBTITLE_LOAD_ERROR:c.subtitlePIDs.pop();break;case n.EVENT_HDMI_DISCONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;c.hdmiEventTimeout=setTimeout(function(){c.isPLaying&&stbStorage.setItem("standByPlayback",JSON.stringify({url:c.playUrl,position:c.currentSec})),gSTB.StandBy(!0),c.hdmiEventTimeout=null},s);break;case n.EVENT_HDMI_CONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;if(c.hdmiEventTimeout)return clearTimeout(c.hdmiEventTimeout),void(c.hdmiEventTimeout=null);gSTB.StandBy(!1),o=JSON.parse(stbStorage.getItem("standByPlayback")),s&&(c.play(o.url,{position:o.position}),stbStorage.removeItem("standByPlayback"))}},s.prototype.init=function(e){e.allowInputPosition&&(this.allowInputPosition=e.allowInputPosition),e.rewindDuration&&(this.rewindHelper.duration=e.rewindDuration),e.rewindTimeout&&(this.rewindHelper.timeoutDuration=e.rewindTimeout),e.inputPositionTimeout&&(this.setModeHelper.timeoutDuration=e.inputPositionTimeout),gSTB.InitPlayer(),gSTB.SetAspect(16),gSTB.SetVideoControl(0),gSTB.SetVideoState(0),gSTB.SetMode(0),gSTB.SetWinAlphaLevel(0,255),gSTB.SetWinAlphaLevel(1,255),gSTB.SetPIG(1,0,0,0),gSTB.Set3DConversionMode(0),gSTB.SetTopWin(0)},s.prototype.play=function(e,t){var i,s;this.totalDurationSec=0,this.currentSec=0,this.playUrl=e,t=t||{},i=t.solution?t.solution:"auto",s=" position:"+t.position,gSTB.Play(i+" "+e+s,t.proxy)},s.prototype.stop=function(){gSTB.Stop(),clearInterval(this.durationInterval),this.isPLaying=!1,this.isPause=!1},s.prototype.playPause=function(){this.isPause?gSTB.Continue():gSTB.Pause(),this.isPause=!this.isPause,this.events.pause&&this.emit("pause",{state:this.isPause})},s.prototype.rewind=function(e,t){var i,s=this;t=t||this.rewindHelper.duration||15,this.rewindHelper.isActive||(this.currentSec=gSTB.GetPosTime(),i=s.parseTime(s.currentSec),this.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,this.rewindHelper.isActive=!0,this.rewindHelper.startTime=this.currentSec,this.rewindHelper.time=this.currentSec,this.events["rewind:start"]&&this.emit("rewind:start")),e?this.rewindHelper.time+t<this.totalDurationSec?this.rewindHelper.time+=t:this.rewindHelper.time=this.totalDurationSec:this.rewindHelper.time-t>0?this.rewindHelper.time-=t:this.rewindHelper.time=0,this.rewindHelper.timeout&&clearTimeout(this.rewindHelper.timeout),this.events.rewind&&this.emit("rewind",{time:this.rewindHelper.time,shift:this.rewindHelper.time-this.rewindHelper.startTime}),this.rewindHelper.timeoutDuration?this.rewindHelper.timeout=setTimeout(function(){return clearInterval(s.durationInterval),s.durationInterval=0,s.rewindHelper.isActive=!1,s.events["rewind:apply"]&&s.emit("rewind:apply"),s.currentSec=s.rewindHelper.time,s.rewindHelper.timeout=0,s.rewindHelper.time===s.totalDurationSec?void(s.events["content:end"]&&s.emit("content:end")):void gSTB.SetPosTime(s.rewindHelper.time)},this.rewindHelper.timeoutDuration):(clearInterval(s.durationInterval),s.durationInterval=0,gSTB.SetPosTime(s.rewindHelper.time),s.currentSec=s.rewindHelper.time,s.rewindHelper.isActive=!1,s.events["rewind:apply"]&&s.emit("rewind:apply"))},s.prototype.nextAudioTrack=function(){return this.audioPIDs.length<=1?!1:(this.currentAudioPID<this.audioPIDs.length-1?this.currentAudioPID++:this.currentAudioPID=0,gSTB.SetAudioPID(this.audioPIDs[this.currentAudioPID].pid),this.events["audio:track"]&&this.emit("audio:track",{lang:this.audioPIDs[this.currentAudioPID].lang[0],pid:this.audioPIDs[this.currentAudioPID].pid}),!0)},s.prototype.setAudioTrack=function(e){gSTB.SetAudioPID(this.audioPIDs[e].pid),this.currentAudioPID=e,this.events["audio:track"]&&this.emit("audio:track",{lang:this.audioPIDs[this.currentAudioPID].lang[0],pid:this.audioPIDs[this.currentAudioPID].pid})},s.prototype.nextAspect=function(){this.activeAspect++,this.activeAspect>this.aspects.length-1&&(this.activeAspect=0),gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.events["aspect:change"]&&this.emit("aspect:change",{type:this.aspects[this.activeAspect].mode,name:this.aspects[this.activeAspect].name})},s.prototype.setAspect=function(e){this.activeAspect=e,gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.events["aspect:change"]&&this.emit("aspect:change",{type:this.aspects[this.activeAspect].type,name:this.aspects[this.activeAspect].name})},s.prototype.nextSubtitle=function(){return this.subtitlePIDs.length<=0?(this.events["subtitles:change"]&&this.emit("subtitles:change",null),!1):(null===this.currentSubtitle?this.currentSubtitle=0:this.currentSubtitle<this.subtitlePIDs.length-1?this.currentSubtitle++:this.currentSubtitle=null,null!==this.currentSubtitle?(gSTB.SetSubtitlePID(this.subtitlePIDs[this.currentSubtitle].pid),gSTB.SetSubtitles(!0),this.events["subtitles:change"]&&this.emit("subtitles:change",{lang:this.subtitlePIDs[this.currentSubtitle].lang[0],pid:this.subtitlePIDs[this.currentSubtitle].pid})):(gSTB.SetSubtitles(!1),this.events["subtitles:change"]&&this.emit("subtitles:change",null)),!0)},s.prototype.setSubtitle=function(e){gSTB.SetSubtitlePID(this.subtitlePIDs[e].pid),gSTB.SetSubtitles(!0),this.currentSubtitle=e,this.events["subtitles:change"]&&this.emit("subtitles:change",{lang:this.subtitlePIDs[this.currentSubtitle].lang[0],pid:this.subtitlePIDs[this.currentSubtitle].pid})},s.prototype.hideSubtitles=function(){gSTB.SetSubtitles(!1),this.events["subtitles:change"]&&this.emit("subtitles:change",null)},s.prototype.loadExternalSubtitle=function(e){e&&"string"==typeof e&&(gSTB.LoadExternalSubtitles(e),this.subtitlePIDs.push({pid:8192}),this.events["subtitles:load"]&&this.emit("subtitles:load",null))},s.prototype.nextViewMode=function(){var e=gSTB.Get3DConversionMode();3>e?e++:e=0,gSTB.Set3DConversionMode(e),this.events["viewmode:change"]&&this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name})},s.prototype.setViewMode=function(e){e>0&&3>=e&&(gSTB.Set3DConversionMode(e),this.events["viewmode:change"]&&this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}))},s.prototype.inputPosition=function(e){var t,i,s,n,o,a=this,r=parseInt(e,10)-48,c=[],d=0;this.allowInputPosition&&(this.setModeHelper.active||(6===this.setModeHelper.length?this.setModeHelper.time=[0,0,0,0,0,0]:this.setModeHelper.time=[0,0,0,0],this.setModeHelper.count=0,this.setModeHelper.active=!0,6===this.setModeHelper.length?this.events["position:input"]&&this.emit("position:input",{time:"00:00:00",start:!0,sec:0}):this.events["position:input"]&&this.emit("position:input",{time:"00:00",start:!0,sec:0})),this.setModeHelper.count<=this.setModeHelper.length&&(this.setModeHelper.time.shift(),this.setModeHelper.time.push(r),c=this.setModeHelper.time.slice(0,this.setModeHelper.length+1),6===this.setModeHelper.length?this.setModeHelper.timeStr=c[0].toString()+c[1].toString()+":"+c[2].toString()+c[3].toString()+":"+c[4].toString()+c[5].toString():this.setModeHelper.timeStr=c[0].toString()+c[1].toString()+":"+c[2].toString()+c[3].toString(),this.setModeHelper.count++,6===this.setModeHelper.length&&(s=c.shift()+c.shift().toString(),d+=3600*parseInt(s,10)),n=c.shift()+c.shift().toString(),d+=60*parseInt(n,10),o=c.shift()+c.shift().toString(),d+=parseInt(o,10),d>this.totalDurationSec&&(d=this.totalDurationSec),this.setModeHelper.sec=d,this.events["position:input"]&&this.emit("position:input",{time:a.setModeHelper.timeStr,sec:d})),clearTimeout(this.setModeHelper.timeout),t=this.setModeHelper.timeoutDuration?this.setModeHelper.timeoutDuration:2e3,this.setModeHelper.timeout=setTimeout(function(){a.setModeHelper.active=!1,clearInterval(a.durationInterval),a.durationInterval=0,gSTB.SetPosTime(a.setModeHelper.sec),a.currentSec=a.setModeHelper.sec,i=a.parseTime(a.currentSec),a.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,a.events["position:input"]&&a.emit("position:input",{time:a.setModeHelper.timeStr,sec:a.setModeHelper.sec,end:!0})},t))},s.prototype.setPosition=function(e){var t;gSTB.SetPosTime(e),this.currentSec=e,t=self.parseTime(self.currentSec),this.currentTime=(t.hour>0?t.hour+":":"")+t.min+":"+t.sec,this.events["position:set"]&&this.emit("position:set",{sec:e})},s.prototype.parseTime=function(e){var t,i,s;return e>=0?(t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i)):(e=Math.abs(e),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i),t="-"+t),{hour:t,min:i,sec:s}},s.prototype.addListener=function(e,t){var i;a.prototype.addListener.call(this,e,t),"duration"===e&&(this.currentSec=gSTB.GetPosTime(),i=this.parseTime(this.currentSec),this.currentTime=(i.hour>0?i.hour+":":"")+i.min+":"+i.sec,this.emit("duration",{sec:this.currentSec,time:this.currentTime}))},e.exports=s},function(e,t,i){"use strict";function s(e){"error"===e.type,a--,r[this.group]--,o.events.link&&o.emit("link",{url:this.src,group:this.group}),0===r[this.group]&&o.events.group&&o.emit("group",{name:this.group}),0===a&&o.events.done&&o.emit("done")}var n=i(7),o=new n,a=0,r={};o.add=function(e){e.forEach(function(e){var t=new Image,i=e.url||e,n=e.group||"";a++,r[n]=void 0===r[n]?1:r[n]+1,t.src=i,t.group=n,t.onload=t.onerror=t.ontimeout=s})},e.exports=o},function(e,t){"use strict";if(!("classList"in document.documentElement)){var i=Array.prototype,s=i.indexOf,n=i.slice,o=i.push,a=i.splice,r=i.join;window.DOMTokenList=function(e){if(this._element=e,e.className!==this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,i=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t<i.length;t++)o.call(this,i[t])}},window.DOMTokenList.prototype={add:function(e){this.contains(e)||(o.call(this,e),this._element.className=n.call(this,0).join(" "))},contains:function(e){return-1!==s.call(this,e)},item:function(e){return this[e]||null},remove:function(e){var t=s.call(this,e);-1!==t&&(a.call(this,t,1),this._element.className=n.call(this,0).join(" "))},toString:function(){return r.call(this," ")},toggle:function(e){return this.contains(e)?this.remove(e):this.add(e),this.contains(e)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(e,t){"use strict";e.exports=function(e){var t={};return e.split("&").forEach(function(e){e=e.split("="),2===e.length&&(t[e[0]]=decodeURIComponent(e[1]))}),t}},function(e,t){"use strict";function i(e){for(var t=i.options,s=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},o=14;o--;)n[t.key[o]]=s[o]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,i,s){i&&(n[t.q.name][i]=s)}),n}i.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.exports=i},function(e,t,i){"use strict";function s(e){e=e||{},this.max=100,this.min=0,this.value=0,this.step=1,e.focusable=e.focusable||!1,e.className="progressBar "+(e.className||""),n.call(this,e),this.$value=this.$body.appendChild(document.createElement("div")),this.$value.className="value",this.init(e)}var n=i(5);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.set=function(e){var t=this.value;return this.value!==e&&e<=this.max&&e>=this.min?(this.value=e,e=Math.abs(this.value-this.min)/this.step,100===e&&this.events.done&&this.emit("done"),this.$value.style.width=e+"%",this.events.change&&this.emit("change",{curr:this.value,prev:t}),!0):!1},s.prototype.init=function(e){void 0!==e.max&&(this.max=e.max),void 0!==e.min&&(this.min=e.min),void 0!==e.value&&(this.value=e.value),this.step=Math.abs(this.max-this.min)/100,this.$value.style.width=Math.abs(this.min-this.value)/this.step+"%"},e.exports=s},function(e,t){"use strict";e.exports={en:[[1,2,3,4,5,6,7,8,9,0,{value:"",id:"keyBackspace",img:"key.del",underline:"red"}],["q","w","e","r","t","y","u","i","o","p","@"],["a","s","d","f","g","h","j","k","l","_","&"],["z","x","c","v","b","n","m",",",".","-","?"],[{value:"En",id:"keyLang",underline:"yellow"},{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"}]],ru:[[1,2,3,4,5,6,7,8,9,0,"@",{value:"",id:"keyBackspace",img:"key.del",underline:"red"}],["й","ц","у","к","е","н","г","ш","щ","з","х","ъ"],["ф","ы","в","а","п","р","о","л","д","ж","э","?"],["я","ч","с","м","и","т","ь","б","ю",",",".","-"],[{value:"Ру",id:"keyLang",underline:"yellow"},{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"},{value:"",disable:!0}]]}},function(e,t){"use strict";e.exports={active:!0,languages:["en","ru","uk"],fromCode:"UTF-8",addComments:"gettext",indent:!1,noLocation:!0,noWrap:!0,sortOutput:!0,sortByFile:!1,verbose:!1}},function(e,t){"use strict";e.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48,movieList:{perLine:3}},576:{height:576,width:720,availTop:24,availBottom:24,availRight:26,availLeft:54,movieList:{perLine:3}},720:{height:720,width:1280,availTop:30,availBottom:30,availRight:40,availLeft:40,movieList:{perLine:4}},1080:{height:1080,width:1920,availTop:45,availBottom:45,availRight:60,availLeft:60,movieList:{perLine:4}}}}]);