mag-app-2048
Advanced tools
Comparing version 1.0.0 to 2.0.2
@@ -1,2 +0,4 @@ | ||
/*! mag-app-2048: v1.0.0 (webpack: v1.13.1) */ | ||
!function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";var n=i(18),o=i(4);n.data.windowId=stbWebWindow.windowId(),n.data.isPortal=1===n.data.windowId,i(11),n.addListeners({load:function(){window.parent.postMessage("show","*"),o.init([i(16),i(17)])},done:function(){setTimeout(function(){o.navigate("pageMain")},300)}})},function(t,e,i){"use strict";function n(t){var e,i=this;if(t=t||{},this.visible=!0,this.focusable=!0,this.$node=null,this.$body=null,this.parent=null,this.children=[],this.propagate=!!t.propagate,o.call(this,t.data),this.$node=t.$node||document.createElement("div"),this.$body=t.$body||this.$node,this.$node.className+=" component "+(t.className||""),this.id=t.id||this.$node.id||"cid"+a++,t.parent&&t.parent.add(this),t.visible===!1&&this.hide(),t.focusable===!1&&(this.focusable=!1),this.defaultEvents){t.events=t.events||{};for(e in this.defaultEvents)t.events[e]=t.events[e]||this.defaultEvents[e]}t.events&&this.addListeners(t.events),t.children&&this.add.apply(this,t.children),this.$node.addEventListener("click",function(t){0===t.button&&(i.focus(),i.events.click&&i.emit("click",{event:t})),t.stopPropagation()})}var o=i(2),s=i(4),a=0;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.defaultEvents=null,n.prototype.add=function(t){var e;for(e=0;e<arguments.length;e++)t=arguments[e],this.children.push(t),t.parent=this,t.$node&&null===t.$node.parentNode&&this.$body.appendChild(t.$node),this.events.add&&this.emit("add",{item:t})},n.prototype.remove=function(){this.parent&&(s.current.activeComponent===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(t){t.remove()}),this.removeAllListeners(),this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},n.prototype.focus=function(t){var e=s.current,i=e.activeComponent;return this.focusable&&this!==i?(i&&i.blur(),e.activeComponent=i=this,i.$node.classList.add("focus"),i.events.focus&&i.emit("focus",t),!0):!1},n.prototype.blur=function(){var t=s.current,e=t.activeComponent;return this.$node.classList.remove("focus"),this===e?(t.activeComponent=null,this.events.blur&&this.emit("blur"),!0):!1},n.prototype.show=function(t){return this.visible?!0:(this.$node.classList.remove("hidden"),this.visible=!0,this.events.show&&this.emit("show",t),!0)},n.prototype.hide=function(){return this.visible?(this.$node.classList.add("hidden"),this.visible=!1,this.events.hide&&this.emit("hide"),!0):!0},t.exports=n},function(t,e,i){"use strict";function n(){this.events={}}n.prototype={addListener:function(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)},once:function(t,e){var i=this;this.events[t]=this.events[t]||[],this.events[t].push(function n(o){e(o),i.removeListener(t,n)})},addListeners:function(t){var e;if("object"==typeof t)for(e in t)t.hasOwnProperty(e)&&this.addListener(e,t[e])},removeListener:function(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(function(t){return t!==e}),0===this.events[t].length&&(this.events[t]=void 0))},removeAllListeners:function(t){0===arguments.length?this.events={}:t&&(this.events[t]=void 0)},emit:function(t,e){var i,n=this.events[t];if(n)for(i=0;i<n.length;i++)n[i].call(this,e)}},n.prototype.constructor=n,t.exports=n},function(t,e,i){"use strict";t.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(t,e,i){"use strict";var n,o=i(2);n=new o,n.current=null,n.history=[],n.pages=[],n.ids={},n.init=function(t){var e,i,n;if(t){for(this.pages=[],this.pages=t,e=0,i=t.length;i>e;e++)n=t[e],this.ids[n.id]=n,n.active&&(this.current=n);return this.events.init&&this.emit("init",{pages:t}),!0}return!1},n.parse=function(t){var e={name:"",data:[]};return e.data=t.split("/").map(decodeURIComponent),e.name=e.data.shift().slice(1),e},n.stringify=function(t,e){return e=Array.isArray(e)?e:[],t=encodeURIComponent(t),e=e.map(encodeURIComponent),e.unshift(t),e.join("/")},n.show=function(t,e){return t&&!t.active?(t.$node.classList.add("active"),t.active=!0,this.current=t,t.events.show&&t.emit("show",{page:t,data:e}),!0):!1},n.hide=function(t){return t&&t.active?(t.$node.classList.remove("active"),t.active=!1,this.current=null,t.events.hide&&t.emit("hide",{page:t}),!0):!1},n.navigate=function(t,e){var i=this.current,n=this.ids[t];return n&&!n.active?(location.hash=this.stringify(t,e),this.hide(this.current),this.show(n,e),this.events.navigate&&this.emit("navigate",{from:i,to:n}),this.history.push(n),!0):!1},n.back=function(){var t,e;return this.history.length>1&&(t=this.history.pop(),e=this.history[this.history.length-1],e&&!e.active)?(location.hash=e.id,this.hide(this.current),this.show(e),this.events.navigate&&this.emit("navigate",{from:t,to:e}),!0):!1},t.exports=n},function(t,e){"use strict";function i(t,e){this.x=t.x,this.y=t.y,this.value=e||2,this.previousPosition=null,this.mergedFrom=null}i.prototype.savePosition=function(){this.previousPosition={x:this.x,y:this.y}},i.prototype.updatePosition=function(t){this.x=t.x,this.y=t.y},i.prototype.serialize=function(){return{position:{x:this.x,y:this.y},value:this.value}},t.exports=i},function(t,e,i){"use strict";function n(t){t=t||{},this.active=!1,this.activeComponent=null,t.className="page "+(t.className||""),o.call(this,t),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}var o=i(1);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,t.exports=n},function(t,e){"use strict";t.exports={json:"2048.json"}},function(t,e){"use strict";t.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48},576:{height:576,width:720,availTop:24,availBottom:24,availRight:26,availLeft:54},720:{height:720,width:1280,availTop:30,availBottom:30,availRight:40,availLeft:40},1080:{height:1080,width:1920,availTop:45,availBottom:45,availRight:60,availLeft:60}}},function(t,e){"use strict";t.exports={parse:function(t){var e={};return t.split("&").forEach(function(t){t=t.split("="),2===t.length&&(e[t[0]]=decodeURIComponent(t[1]))}),e},stringify:function(t){var e=[];return Object.keys(t).forEach(function(i){e.push(i+"="+encodeURIComponent(t[i]))}),e.join("&")}}},function(t,e,i){"use strict";var n=i(9).parse;t.exports=function(){var t=n(location.search.substring(1));return t.referrer?t.referrer:document.referrer?location.href.split("#")[0]===document.referrer?!1:document.referrer:!1}},function(t,e){"use strict";!function(){var t,e=0,i=["webkit","moz"];for(t=0;t<i.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[i[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i[t]+"CancelAnimationFrame"]||window[i[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var i,n=(new Date).getTime(),o=Math.max(0,16-(n-e));return i=window.setTimeout(function(){t(n+o)},o),e=n+o,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}()},function(t,e,i){"use strict";function n(t,e,i){this.size=t,this.storageManager=new i,this.actuator=new e,this.startTiles=2,this.setup()}var o=i(13),s=i(5);n.prototype.restart=function(){this.storageManager.clearGameState(),this.actuator.continueGame(),this.setup()},n.prototype._keepPlaying=function(){this.keepPlaying=!0,this.actuator.continueGame()},n.prototype.isGameTerminated=function(){return this.over||this.won&&!this.keepPlaying},n.prototype.setup=function(){var t=this.storageManager.getGameState();t?(this.grid=new o(t.grid.size,t.grid.cells),this.score=t.score,this.over=t.over,this.won=t.won,this.keepPlaying=t.keepPlaying):(this.grid=new o(this.size),this.score=0,this.over=!1,this.won=!1,this.keepPlaying=!1,this.addStartTiles()),this.actuate()},n.prototype.addStartTiles=function(){var t;for(t=0;t<this.startTiles;t++)this.addRandomTile()},n.prototype.addRandomTile=function(){var t,e;this.grid.cellsAvailable()&&(t=Math.random()<.9?2:4,e=new s(this.grid.randomAvailableCell(),t),this.grid.insertTile(e))},n.prototype.actuate=function(){this.storageManager.getBestScore()<this.score&&this.storageManager.setBestScore(this.score),this.over?this.storageManager.clearGameState():this.storageManager.setGameState(this.serialize()),this.actuator.actuate(this.grid,{score:this.score,over:this.over,won:this.won,bestScore:this.storageManager.getBestScore(),terminated:this.isGameTerminated()})},n.prototype.serialize=function(){return{grid:this.grid.serialize(),score:this.score,over:this.over,won:this.won,keepPlaying:this.keepPlaying}},n.prototype.prepareTiles=function(){this.grid.eachCell(function(t,e,i){i&&(i.mergedFrom=null,i.savePosition())})},n.prototype.moveTile=function(t,e){this.grid.cells[t.x][t.y]=null,this.grid.cells[e.x][e.y]=t,t.updatePosition(e)},n.prototype.move=function(t){var e,i,n,o,a,r=this,c={38:0,39:1,40:2,37:3};t=c[t],this.isGameTerminated()||(n=this.getVector(t),o=this.buildTraversals(n),a=!1,this.prepareTiles(),o.x.forEach(function(t){o.y.forEach(function(o){var c,l,h;e={x:t,y:o},i=r.grid.cellContent(e),i&&(l=r.findFarthestPosition(e,n),h=r.grid.cellContent(l.next),h&&h.value===i.value&&!h.mergedFrom?(c=new s(l.next,2*i.value),c.mergedFrom=[i,h],r.grid.insertTile(c),r.grid.removeTile(i),i.updatePosition(l.next),r.score+=c.value,2048===c.value&&(r.won=!0)):r.moveTile(i,l.farthest),r.positionsEqual(e,i)||(a=!0))})}),a&&(this.addRandomTile(),this.movesAvailable()||(this.over=!0),this.actuate()))},n.prototype.getVector=function(t){var e={0:{x:0,y:-1},1:{x:1,y:0},2:{x:0,y:1},3:{x:-1,y:0}};return e[t]},n.prototype.buildTraversals=function(t){var e,i={x:[],y:[]};for(e=0;e<this.size;e++)i.x.push(e),i.y.push(e);return 1===t.x&&(i.x=i.x.reverse()),1===t.y&&(i.y=i.y.reverse()),i},n.prototype.findFarthestPosition=function(t,e){var i;do i=t,t={x:i.x+e.x,y:i.y+e.y};while(this.grid.withinBounds(t)&&this.grid.cellAvailable(t));return{farthest:i,next:t}},n.prototype.movesAvailable=function(){return this.grid.cellsAvailable()||this.tileMatchesAvailable()},n.prototype.tileMatchesAvailable=function(){var t,e,i,n,o,s,a,r=this;for(e=0;e<this.size;e++)for(i=0;i<this.size;i++)if(t=this.grid.cellContent({x:e,y:i}))for(s=0;4>s;s++)if(a=r.getVector(s),n={x:e+a.x,y:i+a.y},o=r.grid.cellContent(n),o&&o.value===t.value)return!0;return!1},n.prototype.positionsEqual=function(t,e){return t.x===e.x&&t.y===e.y},t.exports=n},function(t,e,i){"use strict";function n(t,e){this.size=t,this.cells=e?this.fromState(e):this.empty()}var o=i(5);n.prototype.empty=function(){for(var t=[],e=0;e<this.size;e++)for(var i=t[e]=[],n=0;n<this.size;n++)i.push(null);return t},n.prototype.fromState=function(t){for(var e=[],i=0;i<this.size;i++)for(var n=e[i]=[],s=0;s<this.size;s++){var a=t[i][s];n.push(a?new o(a.position,a.value):null)}return e},n.prototype.randomAvailableCell=function(){var t=this.availableCells();return t.length?t[Math.floor(Math.random()*t.length)]:void 0},n.prototype.availableCells=function(){var t=[];return this.eachCell(function(e,i,n){n||t.push({x:e,y:i})}),t},n.prototype.eachCell=function(t){for(var e=0;e<this.size;e++)for(var i=0;i<this.size;i++)t(e,i,this.cells[e][i])},n.prototype.cellsAvailable=function(){return!!this.availableCells().length},n.prototype.cellAvailable=function(t){return!this.cellOccupied(t)},n.prototype.cellOccupied=function(t){return!!this.cellContent(t)},n.prototype.cellContent=function(t){return this.withinBounds(t)?this.cells[t.x][t.y]:null},n.prototype.insertTile=function(t){this.cells[t.x][t.y]=t},n.prototype.removeTile=function(t){this.cells[t.x][t.y]=null},n.prototype.withinBounds=function(t){return t.x>=0&&t.x<this.size&&t.y>=0&&t.y<this.size},n.prototype.serialize=function(){for(var t=[],e=0;e<this.size;e++)for(var i=t[e]=[],n=0;n<this.size;n++)i.push(this.cells[e][n]?this.cells[e][n].serialize():null);return{size:this.size,cells:t}},t.exports=n},function(t,e,i){"use strict";function n(){this.tileContainer=document.getElementById("tile-container"),this.scoreContainer=document.getElementById("score-container"),this.bestContainer=document.getElementById("best-container"),this.score=0,o.call(this)}var o=i(2);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.actuate=function(t,e){var i=this;window.requestAnimationFrame(function(){i.clearContainer(i.tileContainer),t.cells.forEach(function(t){t.forEach(function(t){t&&i.addTile(t)})}),i.updateScore(e.score),i.updateBestScore(e.bestScore),e.terminated&&(e.over?i.emit("lose"):e.won&&i.emit("win"))})},n.prototype.continueGame=function(){this.clearMessage()},n.prototype.clearContainer=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},n.prototype.addTile=function(t){var e=this,i=document.createElement("div"),n=document.createElement("div"),o=t.previousPosition||{x:t.x,y:t.y},s=this.positionClass(o),a=["tile","tile-"+t.value,s];t.value>2048&&a.push("tile-super"),this.applyClasses(i,a),n.classList.add("tile-inner"),n.textContent=t.value,t.previousPosition?window.requestAnimationFrame(function(){a[2]=e.positionClass({x:t.x,y:t.y}),e.applyClasses(i,a)}):t.mergedFrom?(a.push("tile-merged"),this.applyClasses(i,a),t.mergedFrom.forEach(function(t){e.addTile(t)})):(a.push("tile-new"),this.applyClasses(i,a)),i.appendChild(n),this.tileContainer.appendChild(i)},n.prototype.applyClasses=function(t,e){t.setAttribute("class",e.join(" "))},n.prototype.normalizePosition=function(t){return{x:t.x+1,y:t.y+1}},n.prototype.positionClass=function(t){return t=this.normalizePosition(t),"tile-position-"+t.x+"-"+t.y},n.prototype.updateScore=function(t){this.clearContainer(this.scoreContainer),this.score=t,this.scoreContainer.textContent=this.score},n.prototype.updateBestScore=function(t){this.bestContainer.textContent=t},n.prototype.message=function(t){var e=t?"game-won":"game-over",i=t?"You win!":"Game over!";this.messageContainer.classList.add(e),this.messageContainer.getElementsByTagName("p")[0].textContent=i},n.prototype.clearMessage=function(){},t.exports=n},function(t,e,i){"use strict";function n(){this.bestScoreKey="bestScore",this.gameStateKey="gameState",this.real=this.localStorageSupported(),this.storage=this.real?window.localStorage:window.fakeStorage}var o=i(7);window.fakeStorage={_data:{},setItem:function(t,e){return this._data[t]=String(e)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:void 0},removeItem:function(t){return delete this._data[t]},clear:function(){return this._data={}}},n.prototype.localStorageSupported=function(){var t="test",e=window.localStorage;try{return e.setItem(t,"1"),e.removeItem(t),!0}catch(i){return!1}},n.prototype.getBestScore=function(){return this.storage.getItem(this.bestScoreKey)||0},n.prototype.setBestScore=function(t){this.storage.setItem(this.bestScoreKey,t)},n.prototype.getGameState=function(){if(this.real){var t=this.storage.getItem(this.gameStateKey);return t?JSON.parse(t):null}return this._getGameState()},n.prototype.setGameState=function(t){this.storage.setItem(this.gameStateKey,JSON.stringify(t))},n.prototype.clearGameState=function(){this.real?this.storage.removeItem(this.gameStateKey):this._clearGameState()},n.prototype._saveSate=function(t){gSTB.SaveUserData(o.json,JSON.stringify({game:t,best:this.storage.getItem(this.bestScoreKey)}))},n.prototype._clearGameState=function(){gSTB.SaveUserData(o.json,JSON.stringify({best:this.storage.getItem(this.bestScoreKey)}))},n.prototype._getGameState=function(){var t=gSTB.LoadUserData(o.json);try{t=JSON.parse(t),t&&t.best&&this.setBestScore(t.best),t=t&&t.game?t.game:null}catch(e){t=null}return t},t.exports=n},function(t,e,i){"use strict";var n="pageInit",o=i(6),s=new o({$node:document.getElementById(n)});t.exports=s},function(t,e,i){"use strict";function n(t){switch(b.last&&b.last.classList.remove("click"),clearTimeout(b.timer),t){case l.left:b.last=b.$left;break;case l.right:b.last=b.$right;break;case l.up:b.last=b.$top;break;case l.down:b.last=b.$bot}b.last.classList.add("click"),b.timer=setTimeout(function(){b.last.classList.remove("click")},100)}function o(){window.location.href=i(10)()||"file:///home/web/services.html"}var s,a="pageMain",r=i(6),c=new r({$node:document.getElementById(a)}),l=i(3),h=i(23),d=i(21),u=i(22),p=i(12),v=i(14),f=i(15),m=new h({$node:document.getElementById("game"),focusable:!0}),y=new u({className:"gameModal",visible:!1,children:[new h({focusable:!1,className:"modalTitle"}),new d({value:"Exit",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.right:y.children[2].focus();break;case l.exit:case l.back:y.hide()}},click:o}}),new d({value:"Continue",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.left:y.children[1].focus();break;case l.exit:case l.back:y.hide()}},click:function(){y.hide()}}})],events:{hide:function(){m.focus()},show:function(){this.children[2].focus()}}}),w=new u({visible:!1,className:"gameModal",events:{show:function(){this.children[1].focus()},hide:function(){m.focus()}},children:[new h({className:"modalTitle"}),new d({value:"Restart",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.right:w.children[2].focus();break;case l.exit:case l.back:w.hide(),s.restart()}},click:function(){w.hide(),s.restart()}}}),new d({value:"exit",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.left:w.children[1].focus();break;case l.exit:case l.back:w.hide(),s.restart()}},click:o}})]}),g=new u({visible:!1,className:"gameModal",events:{show:function(){g.children[1].focus()},hide:function(){m.focus()}},children:[new h({className:"modalTitle"}),new d({value:"Continue",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.right:g.children[2].focus();break;case l.exit:case l.back:g.hide(),s._keepPlaying()}},click:function(){g.hide(),s._keepPlaying()}}}),new d({value:"Restart",events:{keydown:function(t){switch(d.prototype.defaultEvents.keydown.call(this,t),t.code){case l.left:g.children[1].focus();break;case l.exit:case l.back:g.hide(),s._keepPlaying()}},click:function(){g.hide(),s.restart()}}})]}),b={$left:document.getElementById("leftKey"),$right:document.getElementById("rightKey"),$top:document.getElementById("topKey"),$bot:document.getElementById("botKey"),last:null,timer:0};c.add(y),c.add(w),c.add(g),y.children[0].$node.innerText="Are you sure you want to exit?",w.children[0].$node.innerText="Game over! :(",g.children[0].$node.innerText="You win :)",c.addListener("show",function(){window.game=s=new p(4,v,f),m.focus(),s.actuator.addListeners({lose:function(){w.show()},win:function(){g.show()}})}),m.addListener("keydown",function(t){switch(t.code){case l.down:case l.up:case l.left:case l.right:s.move(t.code),n(t.code);break;case l.f2:s.restart();break;case l.exit:window.parent===window?y.show():window.parent.postMessage("hide","*")}}),c.addListener("unload",function(){s.storageManager._saveSate(s.serialize())}),t.exports=c},function(t,e,i){"use strict";var n,o,s=i(19),a=i(4),r=i(3),c={};i(20),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),n=new s({debug:!1,host:!0,screen:null,time:{init:+new Date,load:0,done:0}}),n.setScreen=function(t){var e;return t?(t.availHeight=t.height-(t.availTop+t.availBottom),t.availWidth=t.width-(t.availLeft+t.availRight),window.moveTo(0,0),window.resizeTo(t.width,t.height),e=document.querySelector("link[rel=stylesheet]"),e&&e instanceof HTMLLinkElement&&document.head.removeChild(e),e=document.createElement("link"),e.rel="stylesheet",e.href="css/release."+t.height+".css?"+ +new Date,document.head.appendChild(e),this.data.metrics=t,!0):!1},n.EVENT_END_OF_FILE=1,n.EVENT_GET_MEDIA_INFO=2,n.EVENT_PLAYBACK_BEGIN=4,n.EVENT_CONTENT_ERROR=5,n.EVENT_DUAL_MONO_DETECT=6,n.EVENT_INFO_GET=7,n.EVENT_SUBTITLE_LOAD_ERROR=8,n.EVENT_SUBTITLE_FIND=9,n.EVENT_HDMI_CONNECT=32,n.EVENT_HDMI_DISCONNECT=33,n.EVENT_RECORD_FINISH_SUCCESSFULL=34,n.EVENT_RECORD_FINISH_ERROR=35,n.EVENT_DVB_SCANING=40,n.EVENT_DVB_FOUND=41,n.EVENT_DVB_CHANELL_EPG_UPDATE=42,n.EVENT_DVB_ANTENNA_OFF=43,n.setScreen(i(8)[screen.height]);for(o in r)"volumeUp"!==o&&"volumeDown"!==o&&(c[r[o]]=!0);n.defaultEvents={load:function(t){n.data.time.load=t.timeStamp,n.events[t.type]&&n.emit(t.type,t),a.pages.forEach(function(e){e.events[t.type]&&e.emit(t.type,t)}),n.data.time.done=+new Date,n.events.done&&n.emit("done",t)},unload:function(t){n.events[t.type]&&n.emit(t.type,t),a.pages.forEach(function(e){e.events[t.type]&&e.emit(t.type,t)})},error:function(t){},keydown:function(t){var e,i=a.current;0!==t.keyCode&&(t.code=t.keyCode,t.shiftKey&&(t.code+=1e3),t.altKey&&(t.code+=2e3),e=i.activeComponent,e&&e!==i&&(e.events[t.type]&&e.emit(t.type,t),!t.stop&&e.propagate&&e.parent&&e.parent.events[t.type]&&e.parent.emit(t.type,t)),t.stop||(i.events[t.type]&&i.emit(t.type,t),t.stop||n.events[t.type]&&n.emit(t.type,t)),n.data.host&&c[t.code]&&t.preventDefault())},keypress:function(t){var e=a.current;e.activeComponent&&e.activeComponent!==e&&e.activeComponent.events[t.type]&&e.activeComponent.emit(t.type,t)},click:function(t){},contextmenu:function(t){t.preventDefault()},mousewheel:function(t){var e=a.current;e.activeComponent&&e.activeComponent!==e&&e.activeComponent.events[t.type]&&e.activeComponent.emit(t.type,t),t.stop||e.events[t.type]&&e.emit(t.type,t)}};for(o in n.defaultEvents)window.addEventListener(o,n.defaultEvents[o]);window.stbEvent={},window.stbEvent.onEvent=function(t,e){if(Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onEvent&&i.stbEvent.onEvent(t,e)}),n.events.media){if(e)try{e=JSON.parse(e)}catch(i){}n.emit("media",{code:parseInt(t,10),info:e})}},window.stbEvent.onBroadcastMessage=function(t,e,i){Array.prototype.forEach.call(window.frames,function(n){n.stbEvent&&n.stbEvent.onBroadcastMessage&&n.stbEvent.onBroadcastMessage(t,e,i)}),n.events.message&&n.emit("message",{broadcast:!0,windowId:t,message:e,data:i})},window.stbEvent.onMessage=function(t,e,i){Array.prototype.forEach.call(window.frames,function(n){n.stbEvent&&n.stbEvent.onMessage&&n.stbEvent.onMessage(t,e,i)}),n.events.message&&n.emit("message",{broadcast:!1,windowId:t,message:e,data:i})},window.stbEvent.onMount=function(t){Array.prototype.forEach.call(window.frames,function(e){e.stbEvent&&e.stbEvent.onMount&&e.stbEvent.onMount(t)}),n.events["device:mount"]&&n.emit("device:mount",{state:t})},window.stbEvent.onMediaAvailable=function(t,e){Array.prototype.forEach.call(window.frames,function(i){i.stbEvent&&i.stbEvent.onMediaAvailable&&i.stbEvent.onMediaAvailable(t,e)}),n.events["media:available"]&&n.emit("media:available",{mime:t,url:e})},window.stbEvent.onNetworkStateChange=function(t){n.events["internet:state"]&&n.emit("internet:state",{state:t})},window.stbEvent.onWebBrowserProgress=function(t){Array.prototype.forEach.call(window.frames,function(e){e.stbEvent&&e.stbEvent.onWebBrowserProgress&&e.stbEvent.onWebBrowserProgress(t)}),n.events["browser:progress"]&&n.emit("browser:progress",{progress:t})},window.stbEvent.onWindowActivated=function(){Array.prototype.forEach.call(window.frames,function(t){t.stbEvent&&t.stbEvent.onWindowActivated&&t.stbEvent.onWindowActivated()}),n.events["window:focus"]&&n.emit("window:focus")},window.gSTB&&gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),t.exports=n},function(t,e,i){"use strict";function n(t){o.call(this),this.data=t||{}}var o=i(2);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.idName="id",n.prototype.clear=function(){var t=this.data;return Object.keys(t).length>0?(this.data={},this.events.clear&&this.emit("clear",{data:t}),!0):!1},n.prototype.init=function(t){return t?(this.clear(),this.data=t,this.events.init&&this.emit("init",{data:t}),!0):!1},n.prototype.has=function(t){return this.data.hasOwnProperty(t)},n.prototype.get=function(t){return this.data[t]},n.prototype.set=function(t,e){var i=t in this.data,n={name:t,curr:e};return i?(n.prev=this.data[t],e!==n.prev?(this.data[t]=e,this.events.change&&this.emit("change",n),!0):!1):(this.data[t]=e,this.events.change&&this.emit("change",n),!0)},n.prototype.unset=function(t){var e,i=t in this.data;return i?(e={name:t,prev:this.data[t]},delete this.data[t],this.events.change&&this.emit("change",e),!0):!1},t.exports=n},function(t,e){"use strict";if(!("classList"in document.documentElement)){var i=Array.prototype,n=i.indexOf,o=i.slice,s=i.push,a=i.splice,r=i.join;window.DOMTokenList=function(t){if(this._element=t,t.className!==this._classCache){if(this._classCache=t.className,!this._classCache)return;var e,i=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(e=0;e<i.length;e++)s.call(this,i[e])}},window.DOMTokenList.prototype={add:function(t){this.contains(t)||(s.call(this,t),this._element.className=o.call(this,0).join(" "))},contains:function(t){return-1!==n.call(this,t)},item:function(t){return this[t]||null},remove:function(t){var e=n.call(this,t);-1!==e&&(a.call(this,e,1),this._element.className=o.call(this,0).join(" "))},toString:function(){return r.call(this," ")},toggle:function(t){return this.contains(t)?this.remove(t):this.add(t),this.contains(t)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(t,e,i){"use strict";function n(t){t=t||{},t.className="button "+(t.className||""),o.call(this,t),t.icon&&(this.$icon=this.$body.appendChild(document.createElement("div")),this.$icon.className="icon "+t.icon),this.$text=this.$body.appendChild(document.createElement("div")),this.$text.classList.add("text"),t.value&&(this.$text.innerText=t.value)}var o=i(1),s=i(3);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.clickDuration=200,n.prototype.defaultEvents={click:function(){var t=this;this.$node.classList.add("click"),setTimeout(function(){t.$node.classList.remove("click")},this.clickDuration)},keydown:function(t){t.code===s.ok&&this.events.click&&this.emit("click",{event:t})}},t.exports=n},function(t,e,i){"use strict";function n(t){t=t||{},t.className="modalBox "+(t.className||""),t.$body=document.createElement("div"),t.$body.className="body",o.call(this,t),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}var o=i(1);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,t.exports=n},function(t,e,i){"use strict";function n(t){t=t||{},t.focusable=t.focusable||!1,t.className="panel "+(t.className||""),o.call(this,t)}var o=i(1);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,t.exports=n}]); | ||
/*! mag-app-2048 v2.0.1 (webpack: v1.13.2) */ | ||
!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=i(1);i(20),s.once("load",function(){s.pages={init:i(21),main:i(24)},setTimeout(function(){s.ready(),s.route(s.pages.main)},300)})},function(e,t,i){"use strict";var s=i(2),n=i(6);window.core=window.parent.getCoreInstance(window,s),i(7),i(8),i(10),i(11),s.ready=function(){window.core.call("app:ready")},s.exit=function(e){var t,n=i(12),o=i(15),a=i(19),r=s.activePage.activeComponent;s.activePage.add(t=new n({title:_("Exit"),events:{show:function(){this.children[0].focus()},hide:function(){r.focus()}},children:[new o({size:2,focusIndex:0,data:[{items:[{value:_("Exit")}],click:function(){return"function"==typeof e&&e(!0)?(t.hide(),void t.remove()):(s.events.exit&&s.emit("exit"),t.hide(),t.remove(),void core.call("exit"))}},{items:[{value:_("Cancel")}],click:function(){"function"==typeof e&&e(!1),t.hide(),t.remove()}}],events:{keydown:function(i){o.prototype.defaultEvents.keydown.call(this,i),i.keyCode===a.codes.back&&(i.stop=!0,"function"==typeof e&&e(!1),t.hide(),t.remove())}}})]})),t.show(),t.focus()},n.load=function(e){window.core=window.parent.getCoreInstanse(window,s),core.ready?s.events.load&&s.emit("load",{}):core.once("load",function(){core.ready=!0,s.events[e.type]&&s.emit(e.type,e)})},Object.keys(n).forEach(function(e){window.addEventListener(e,n[e])}),e.exports=s},function(e,t,i){"use strict";function s(e,t){return!(!e||e.active)&&(e.$node.classList.add("active"),e.active=!0,r.activePage=e,e.events.show&&e.emit("show",{page:e,data:t}),!0)}function n(e){return!(!e||!e.active)&&(e.$node.classList.remove("active"),e.active=!1,r.activePage=null,e.events.hide&&e.emit("hide",{page:e}),!0)}var o=i(3),a=i(4).parse,r=new o;r.query=a(document.location.search.substring(1)),r.config=i(5),r.activePage=null,r.route=function(e,t){var i=r.activePage;return e&&!e.active?(n(r.activePage),s(e,t),this.events.route&&this.emit("route",{from:i,to:e}),!0):(debug.warn("invalid page to route: "+e.id,null,{tags:["route","page",e.id]}),!1)},e.exports=r},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(){t.apply(i,arguments),i.removeListener(e,s)})},addListeners:function(e){var t;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))},emit:function(e){var t,i=this.events[e];if(i)for(t=0;t<i.length;t++)i[t].apply(this,Array.prototype.slice.call(arguments,1))}},s.prototype.constructor=s,e.exports=s},function(e,t){"use strict";e.exports={parse:function(e){var t={};return e.split("&").forEach(function(e){e=e.split("="),2===e.length&&(t[e[0]]=decodeURIComponent(e[1]))}),t},stringify:function(e){var t=[];return Object.keys(e).forEach(function(i){t.push(i+"="+encodeURIComponent(e[i]))}),t.join("&")}}},function(e,t){"use strict";e.exports={}},function(e,t,i){"use strict";var s=i(2);e.exports={DOMContentLoaded:function(e){s.events.dom&&s.emit("dom",e)},load:function(e){s.events[e.type]&&s.emit(e.type,e)},unload:function(e){s.events[e.type]&&s.emit(e.type,e)},error:function(e){debug.fail("app event: "+e.message,e,{tags:[e.type,"event"]})},keydown:function(e){var t,i=s.activePage;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))},keypress:function(e){var t=s.activePage;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e)},mousewheel:function(e){var t=s.activePage;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)}}},function(e,t){"use strict";if(!document.documentElement.classList){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 s.call(this,e)!==-1},item:function(e){return this[e]||null},remove:function(e){var t=s.call(this,e);t!==-1&&(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,i){"use strict";var s=i(2),n=i(9);s.metrics=n[s.query.screenHeight]||n[screen.height]||n[720],s.metrics.availHeight=s.metrics.height-(s.metrics.availTop+s.metrics.availBottom),s.metrics.availWidth=s.metrics.width-(s.metrics.availLeft+s.metrics.availRight)},function(e,t){"use strict";e.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48},576:{height:576,width:720,availTop:24,availBottom:24,availRight:26,availLeft:54},720:{height:720,width:1280,availTop:30,availBottom:30,availRight:40,availLeft:40},1080:{height:1080,width:1920,availTop:45,availBottom:45,availRight:60,availLeft:60}}},function(e,t,i){"use strict";var s,n=i(2);s=document.createElement("link"),s.rel="stylesheet",s.href=window.core.theme.path+n.metrics.height+".css",document.head.appendChild(s),e.exports=s},function(e,t,i){"use strict";var s,n=i(2);s=document.createElement("link"),s.rel="stylesheet",s.href="css/release."+n.metrics.height+".css",document.head.appendChild(s),e.exports=s},function(e,t,i){"use strict";function s(e){var t;e=e||{},e.focusable=e.focusable||!1,e.className="modalMessage "+(e.className||""),e.visible=e.visible||!1,e.$body=document.createElement("div"),e.$body.className="body",n.call(this,e),this.$node.appendChild(document.createElement("div")),this.$node.firstChild.classList.add("alignBox"),this.$node.firstChild.appendChild(document.createElement("div")),this.$header=document.createElement("div"),this.$header.className="header",this.$text=this.$header.appendChild(document.createElement("div")),this.$text.classList.add("text"),this.$text.innerText=e.title||"",e.icon&&(this.$icon=this.$header.appendChild(document.createElement("div")),this.$icon.className="icon "+e.icon),t=document.createElement("div"),t.className="overlay",this.$node.firstChild.firstChild.appendChild(this.$header),this.$node.firstChild.firstChild.appendChild(this.$body),this.$node.firstChild.firstChild.appendChild(t)}var n=i(13);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.focus=function(){this.$node.classList.add("active"),n.prototype.focus.call(this),this.children[0]&&this.children[0]instanceof n&&this.children[0].focus()},s.prototype.blur=function(){this.$node.classList.remove("active"),n.prototype.blur.call(this)},e.exports=s},function(e,t,i){"use strict";e.exports=i(14)},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,o.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&&Object.keys(e.events).forEach(function(t){i.addListener(t,e.events[t])}),e.children&&this.add.apply(this,e.children),this.$node.addEventListener("click",function(e){i.focus(),i.events.click&&i.emit("click",e),e.stopPropagation()})}var n=i(2),o=i(3),a=0;s.prototype=Object.create(o.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&&(n.activePage.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.events={},this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},s.prototype.focus=function(e){var t=n.activePage,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)},s.prototype.blur=function(){var e=n.activePage,t=e.activeComponent;return this.$node.classList.remove("focus"),this===t?(e.activeComponent=null,this.events.blur&&this.emit("blur"),!0):(debug.warn("component "+this.constructor.name+"#"+this.id+" attempt to blur without link to a page",null,{tags:["blur","component",this.constructor.name,this.id]}),!1)},s.prototype.show=function(e){return!!this.visible||(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)},e.exports=s},function(e,t,i){"use strict";function s(e){var t=this;e=e||{},this.handlers={},this.$noData=null,e.className="layoutList "+(e.className||""),e.propagate=e.propagate||!0,this.fixedData=e.fixedData||!1,e.$body=document.createElement("div"),e.$body.className="body",this.$noData=document.createElement("div"),this.$noData.className="noData hidden",n.call(this,e),this.$node.appendChild(this.$body),this.$node.appendChild(this.$noData),this.addListener("click:item",function(e){e.$item.layout.children.length&&!e.inner&&e.$item.layout.children[e.$item.layout.focusIndex].focus(),e.inner&&(t.focus(),t.focusItem(e.$item)),t.handlers[e.$item.index]&&t.handlers[e.$item.index](e.$item)})}var n=i(16),o=i(18);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.renderItemDefault=function(e,t){var i,s;if(e.ready&&this.fixedData&&!e.innerHTML.length)for(s=0;s<t.items.length;s++)"string"==typeof t.items[s].value&&(e.layout.$node.childNodes[s].innerText=t.items[s].value,e.layout.$node.childNodes[s].className=t.items[s].className);else{for(;e.firstChild;)e.removeChild(e.firstChild);i=new o({focusable:!1,data:t.items}),e.appendChild(i.$node),e.layout=i,i.parent=this,i.$parentItem=e,i.addListener("click",function(){this.parent.emit("click:item",{$item:e,inner:!0})}),t.click&&(this.handlers[e.index]=t.click),e.ready=!0}e.value=t.value||{}},s.prototype.init=function(e){var t;n.prototype.init.call(this,e),e.noData&&(this.$noData.innerHTML="",e.noData instanceof Element?this.$noData.appendChild(e.noData):"string"==typeof e.noData&&(t=document.createElement("div"),t.innerText=e.noData,this.$noData.appendChild(t))),e.data&&e.data.length?this.$noData.classList.add("hidden"):this.$noData.classList.remove("hidden")},s.prototype.renderItem=s.prototype.renderItemDefault,e.exports=s},function(e,t,i){"use strict";e.exports=i(17)},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(14);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?38:40),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?37:39)},keydown:function(e){switch(e.keyCode){case 38:case 40:case 39:case 37:case 33:case 34:case 36:case 35:this.move(e.keyCode);break;case 13:this.events["click:item"]&&this.$focusItem&&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,this.$focusItem&&(this.$focusItem.classList.remove("focus"),this.$focusItem=null),void 0!==e.focusIndex&&this.data.length?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=" "),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){this.data.length&&((38===e&&this.type===this.TYPE_VERTICAL||37===e&&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(35),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),(40===e&&this.type===this.TYPE_VERTICAL||39===e&&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(36),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),33===e&&(this.viewIndex<this.size?this.renderView(0):this.renderView(this.viewIndex-this.size+1),this.focusItem(this.$body.firstChild)),34===e&&(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])),36===e&&(this.renderView(0),this.focusItem(this.$body.firstChild)),35===e&&(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)},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)):e<t?(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";function s(e){e=e||{},this.focusIndex=0,e.className="layout "+(e.className||""),this.data=[],o.call(this,e),this.init(e),this.addListener("keydown",function(e){switch(e.keyCode){case a.codes.right:this.children.length&&this.focusIndex<this.children.length-1&&this.children[++this.focusIndex].focus();break;case a.codes.left:this.children.length&&this.focusIndex>0&&this.children[--this.focusIndex].focus();break;case a.codes.back:this.parent.focus(),this.parent&&this.$parentItem&&this.parent.focusItem(this.$parentItem)}})}function n(e){var t,i;for(t=0;t<e.length;t++)i=e[t],"object"!=typeof i?e[t]={value:e[t],wrap:!0}:i instanceof o||i instanceof HTMLElement?e[t]={value:i,wrap:!1}:e[t].wrap=!0;return e}var o=i(13),a=i(19);s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype.init=function(e){for(var t,i,s,a=this,r=n(e.data);this.$node.firstChild;)this.$node.removeChild(this.$node.firstChild);for(this.data=r,s=0;s<r.length;s++)t=r[s],"string"==typeof t.value?(i=document.createElement("div"),i.textContent=t.value,t.className&&(i.className=t.className),this.$node.appendChild(i)):t.value instanceof HTMLElement?t.wrap?(i=document.createElement("div"),t.className&&(i.className=t.className),i.appendChild(t.value),this.$node.appendChild(i)):this.$node.appendChild(t.value):t.value instanceof o&&(t.value.propagate=!0,t.value.index=this.children.length,t.value.addListener("click",function(){a.focusIndex=this.index}),t.wrap?(i=document.createElement("div"),t.className&&(i.className=t.className),i.appendChild(t.value.$node),this.$node.appendChild(i),this.children.push(t.value),t.value.parent=this):this.add(t.value))},e.exports=s},function(e,t){"use strict";e.exports={getCode:function(e){var t=e.keyCode;return e.shiftKey&&(t+=1e3),e.altKey&&(t+=2e3),t},codes:{back:8,channelPrev:1009,channelNext:9,ok:13,exit:27,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,"delete":46,volumeUp:107,volumeDown:109,f1:112,f2:113,f3:114,f4:115,refresh:116,frame:117,phone:119,set:120,tv:121,menu:122,app:123,rewind:2066,forward:2070,audio:2071,standby:2074,keyboard:2076,usbMounted:2080,usbUnmounted:2081,playPause:2082,stop:2083,power:2085,record:2087,info:2089,mute:2192}}},function(e,t){"use strict";!function(){var e,t=0,i=["webkit","moz"];for(e=0;e<i.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[i[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i[e]+"CancelAnimationFrame"]||window[i[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var i,s=(new Date).getTime(),n=Math.max(0,16-(s-t));return i=window.setTimeout(function(){e(s+n)},n),t=s+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}()},function(e,t,i){"use strict";var s=i(22),n=new s({$node:window.pageInit});e.exports=n},function(e,t,i){"use strict";e.exports=i(23)},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(14);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){switch(w.last&&w.last.classList.remove("click"),clearTimeout(w.timer),e){case l.codes.left:w.last=w.$left;break;case l.codes.right:w.last=w.$right;break;case l.codes.up:w.last=w.$top;break;case l.codes.down:w.last=w.$bot}w.last.classList.add("click"),w.timer=setTimeout(function(){w.last.classList.remove("click")},100)}function n(){core.notify({title:"Do you want to exit?",icon:"alert",type:"",buttons:[{value:"Exit",click:function(){core.call("exit")}},{value:"Cancel",click:function(){}}],timeout:5e3})}var o,a="pageMain",r=i(22),c=new r({$node:document.getElementById(a)}),l=(i(1),i(19)),h=i(25),d=i(26),u=i(28),p=i(30),m=i(33),f=i(34),v=new h({$node:document.getElementById("game"),focusable:!0}),y=new u({visible:!1,className:"gameModal",events:{show:function(){this.children[1].focus()},hide:function(){v.focus()}},children:[new h({className:"modalTitle"}),new d({value:"Restart",events:{keydown:function(e){switch(d.prototype.defaultEvents.keydown.call(this,e),e.keyCode){case l.codes.right:y.children[2].focus();break;case l.codes.exit:case l.codes.back:y.hide(),o.restart()}},click:function(){y.hide(),o.restart()}}}),new d({value:"exit",events:{keydown:function(e){switch(d.prototype.defaultEvents.keydown.call(this,e),e.keyCode){case l.codes.left:y.children[1].focus();break;case l.codes.exit:case l.codes.back:y.hide(),o.restart()}},click:function(){core.call("exit")}}})]}),g=new u({visible:!1,className:"gameModal",events:{show:function(){g.children[1].focus()},hide:function(){v.focus()}},children:[new h({className:"modalTitle"}),new d({value:"Continue",events:{keydown:function(e){switch(d.prototype.defaultEvents.keydown.call(this,e),e.keyCode){case l.codes.right:g.children[2].focus();break;case l.codes.exit:case l.codes.back:g.hide(),o._keepPlaying()}},click:function(){g.hide(),o._keepPlaying()}}}),new d({value:"Restart",events:{keydown:function(e){switch(d.prototype.defaultEvents.keydown.call(this,e),e.keyCode){case l.codes.left:g.children[1].focus();break;case l.codes.exit:case l.codes.back:g.hide(),o._keepPlaying()}},click:function(){g.hide(),o.restart()}}})]}),w={$left:document.getElementById("leftKey"),$right:document.getElementById("rightKey"),$top:document.getElementById("topKey"),$bot:document.getElementById("botKey"),last:null,timer:0};c.add(y),c.add(g),y.children[0].$node.innerText="Game over! :(",g.children[0].$node.innerText="You win :)",c.addListener("show",function(){window.game=o=new p(4,m,f),v.focus(),o.actuator.addListeners({lose:function(){y.show()},win:function(){g.show()}})}),v.addListener("keydown",function(e){switch(e.keyCode){case l.codes.down:case l.codes.up:case l.codes.left:case l.codes.right:o.move(e.keyCode),s(e.keyCode);break;case l.codes.f2:o.restart();break;case l.codes.back:n()}}),c.addListener("unload",function(){o.storageManager._saveSate(o.serialize())}),e.exports=c},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(14);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";e.exports=i(27)},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(14);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){13===e.keyCode&&this.events.click&&this.emit("click",{event:e})}},e.exports=s},function(e,t,i){"use strict";e.exports=i(29)},function(e,t,i){"use strict";function s(e){e=e||{},e.className="modal "+(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(14);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e,t,i){this.size=e,this.storageManager=new i,this.actuator=new t,this.startTiles=2,this.setup()}var n=i(31),o=i(32);s.prototype.restart=function(){this.storageManager.clearGameState(),this.actuator.continueGame(),this.setup()},s.prototype._keepPlaying=function(){this.keepPlaying=!0,this.actuator.continueGame()},s.prototype.isGameTerminated=function(){return this.over||this.won&&!this.keepPlaying},s.prototype.setup=function(){var e=this.storageManager.getGameState();e?(this.grid=new n(e.grid.size,e.grid.cells),this.score=e.score,this.over=e.over,this.won=e.won,this.keepPlaying=e.keepPlaying):(this.grid=new n(this.size),this.score=0,this.over=!1,this.won=!1,this.keepPlaying=!1,this.addStartTiles()),this.actuate()},s.prototype.addStartTiles=function(){var e;for(e=0;e<this.startTiles;e++)this.addRandomTile()},s.prototype.addRandomTile=function(){var e,t;this.grid.cellsAvailable()&&(e=Math.random()<.9?2:4,t=new o(this.grid.randomAvailableCell(),e),this.grid.insertTile(t))},s.prototype.actuate=function(){this.storageManager.getBestScore()<this.score&&this.storageManager.setBestScore(this.score),this.over?this.storageManager.clearGameState():this.storageManager.setGameState(this.serialize()),this.actuator.actuate(this.grid,{score:this.score,over:this.over,won:this.won,bestScore:this.storageManager.getBestScore(),terminated:this.isGameTerminated()})},s.prototype.serialize=function(){return{grid:this.grid.serialize(),score:this.score,over:this.over,won:this.won,keepPlaying:this.keepPlaying}},s.prototype.prepareTiles=function(){this.grid.eachCell(function(e,t,i){i&&(i.mergedFrom=null,i.savePosition())})},s.prototype.moveTile=function(e,t){this.grid.cells[e.x][e.y]=null,this.grid.cells[t.x][t.y]=e,e.updatePosition(t)},s.prototype.move=function(e){var t,i,s,n,a,r=this,c={38:0,39:1,40:2,37:3};e=c[e],this.isGameTerminated()||(s=this.getVector(e),n=this.buildTraversals(s),a=!1,this.prepareTiles(),n.x.forEach(function(e){n.y.forEach(function(n){var c,l,h;t={x:e,y:n},i=r.grid.cellContent(t),i&&(l=r.findFarthestPosition(t,s),h=r.grid.cellContent(l.next),h&&h.value===i.value&&!h.mergedFrom?(c=new o(l.next,2*i.value),c.mergedFrom=[i,h],r.grid.insertTile(c),r.grid.removeTile(i),i.updatePosition(l.next),r.score+=c.value,2048===c.value&&(r.won=!0)):r.moveTile(i,l.farthest),r.positionsEqual(t,i)||(a=!0))})}),a&&(this.addRandomTile(),this.movesAvailable()||(this.over=!0),this.actuate()))},s.prototype.getVector=function(e){var t={0:{x:0,y:-1},1:{x:1,y:0},2:{x:0,y:1},3:{x:-1,y:0}};return t[e]},s.prototype.buildTraversals=function(e){var t,i={x:[],y:[]};for(t=0;t<this.size;t++)i.x.push(t),i.y.push(t);return 1===e.x&&(i.x=i.x.reverse()),1===e.y&&(i.y=i.y.reverse()),i},s.prototype.findFarthestPosition=function(e,t){var i;do i=e,e={x:i.x+t.x,y:i.y+t.y};while(this.grid.withinBounds(e)&&this.grid.cellAvailable(e));return{farthest:i,next:e}},s.prototype.movesAvailable=function(){return this.grid.cellsAvailable()||this.tileMatchesAvailable()},s.prototype.tileMatchesAvailable=function(){var e,t,i,s,n,o,a,r=this;for(t=0;t<this.size;t++)for(i=0;i<this.size;i++)if(e=this.grid.cellContent({x:t,y:i}))for(o=0;o<4;o++)if(a=r.getVector(o),s={x:t+a.x,y:i+a.y},n=r.grid.cellContent(s),n&&n.value===e.value)return!0;return!1},s.prototype.positionsEqual=function(e,t){return e.x===t.x&&e.y===t.y},e.exports=s},function(e,t,i){"use strict";function s(e,t){this.size=e,this.cells=t?this.fromState(t):this.empty()}var n=i(32);s.prototype.empty=function(){for(var e=[],t=0;t<this.size;t++)for(var i=e[t]=[],s=0;s<this.size;s++)i.push(null);return e},s.prototype.fromState=function(e){for(var t=[],i=0;i<this.size;i++)for(var s=t[i]=[],o=0;o<this.size;o++){var a=e[i][o];s.push(a?new n(a.position,a.value):null)}return t},s.prototype.randomAvailableCell=function(){var e=this.availableCells();if(e.length)return e[Math.floor(Math.random()*e.length)]},s.prototype.availableCells=function(){var e=[];return this.eachCell(function(t,i,s){s||e.push({x:t,y:i})}),e},s.prototype.eachCell=function(e){for(var t=0;t<this.size;t++)for(var i=0;i<this.size;i++)e(t,i,this.cells[t][i])},s.prototype.cellsAvailable=function(){return!!this.availableCells().length},s.prototype.cellAvailable=function(e){return!this.cellOccupied(e)},s.prototype.cellOccupied=function(e){return!!this.cellContent(e)},s.prototype.cellContent=function(e){return this.withinBounds(e)?this.cells[e.x][e.y]:null},s.prototype.insertTile=function(e){this.cells[e.x][e.y]=e},s.prototype.removeTile=function(e){this.cells[e.x][e.y]=null},s.prototype.withinBounds=function(e){return e.x>=0&&e.x<this.size&&e.y>=0&&e.y<this.size},s.prototype.serialize=function(){for(var e=[],t=0;t<this.size;t++)for(var i=e[t]=[],s=0;s<this.size;s++)i.push(this.cells[t][s]?this.cells[t][s].serialize():null);return{size:this.size,cells:e}},e.exports=s},function(e,t){"use strict";function i(e,t){this.x=e.x,this.y=e.y,this.value=t||2,this.previousPosition=null,this.mergedFrom=null}i.prototype.savePosition=function(){this.previousPosition={x:this.x,y:this.y}},i.prototype.updatePosition=function(e){this.x=e.x,this.y=e.y},i.prototype.serialize=function(){return{position:{x:this.x,y:this.y},value:this.value}},e.exports=i},function(e,t,i){"use strict";function s(){this.tileContainer=document.getElementById("tile-container"),this.scoreContainer=document.getElementById("score-container"),this.bestContainer=document.getElementById("best-container"),this.score=0,n.call(this)}var n=i(3);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.actuate=function(e,t){var i=this;window.requestAnimationFrame(function(){i.clearContainer(i.tileContainer),e.cells.forEach(function(e){e.forEach(function(e){e&&i.addTile(e)})}),i.updateScore(t.score),i.updateBestScore(t.bestScore),t.terminated&&(t.over?i.emit("lose"):t.won&&i.emit("win"))})},s.prototype.continueGame=function(){this.clearMessage()},s.prototype.clearContainer=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},s.prototype.addTile=function(e){var t=this,i=document.createElement("div"),s=document.createElement("div"),n=e.previousPosition||{x:e.x,y:e.y},o=this.positionClass(n),a=["tile","tile-"+e.value,o];e.value>2048&&a.push("tile-super"),this.applyClasses(i,a),s.classList.add("tile-inner"),s.textContent=e.value,e.previousPosition?window.requestAnimationFrame(function(){a[2]=t.positionClass({x:e.x,y:e.y}),t.applyClasses(i,a)}):e.mergedFrom?(a.push("tile-merged"),this.applyClasses(i,a),e.mergedFrom.forEach(function(e){t.addTile(e)})):(a.push("tile-new"),this.applyClasses(i,a)),i.appendChild(s),this.tileContainer.appendChild(i)},s.prototype.applyClasses=function(e,t){e.setAttribute("class",t.join(" "))},s.prototype.normalizePosition=function(e){return{x:e.x+1,y:e.y+1}},s.prototype.positionClass=function(e){return e=this.normalizePosition(e),"tile-position-"+e.x+"-"+e.y},s.prototype.updateScore=function(e){this.clearContainer(this.scoreContainer),this.score=e,this.scoreContainer.textContent=this.score},s.prototype.updateBestScore=function(e){this.bestContainer.textContent=e},s.prototype.message=function(e){var t=e?"game-won":"game-over",i=e?"You win!":"Game over!";this.messageContainer.classList.add(t),this.messageContainer.getElementsByTagName("p")[0].textContent=i},s.prototype.clearMessage=function(){},e.exports=s},function(e,t){"use strict";function i(){this.bestScoreKey="bestScore",this.gameStateKey="gameState",this.real=this.localStorageSupported(),this.storage=this.real||window.fakeStorage}var s="2048.json";window.fakeStorage={_data:{},setItem:function(e,t){return this._data[e]=String(t)},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:void 0},removeItem:function(e){return delete this._data[e]},clear:function(){return this._data={}}},i.prototype.localStorageSupported=function(){var e="test",t=window.top.stbStorage||window.localStorage||window.top.localStorage; | ||
try{return t.setItem(e,"1"),t.removeItem(e),t}catch(i){return!1}},i.prototype.getBestScore=function(){return this.storage.getItem(this.bestScoreKey)||0},i.prototype.setBestScore=function(e){this.storage.setItem(this.bestScoreKey,e)},i.prototype.getGameState=function(){if(this.real){var e=this.storage.getItem(this.gameStateKey);return e?JSON.parse(e):null}return this._getGameState()},i.prototype.setGameState=function(e){this.storage.setItem(this.gameStateKey,JSON.stringify(e))},i.prototype.clearGameState=function(){this.real?this.storage.removeItem(this.gameStateKey):this._clearGameState()},i.prototype._saveSate=function(e){window.top.gSTB.SaveUserData(s,JSON.stringify({game:e,best:this.storage.getItem(this.bestScoreKey)}))},i.prototype._clearGameState=function(){window.top.gSTB.SaveUserData(s,JSON.stringify({best:this.storage.getItem(this.bestScoreKey)}))},i.prototype._getGameState=function(){var e=window.top.gSTB.LoadUserData(s);try{e=JSON.parse(e),e&&e.best&&this.setBestScore(e.best),e=e&&e.game?e.game:null}catch(t){e=null}return e},e.exports=i}]); | ||
//# sourceMappingURL=release.map |
158
package.json
{ | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "mag-app-2048", | ||
"scope": null, | ||
"escapedName": "mag-app-2048", | ||
"name": "mag-app-2048", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"/home/teletec/work" | ||
] | ||
], | ||
"_from": "mag-app-2048@latest", | ||
"_id": "mag-app-2048@2.0.2", | ||
"_inCache": true, | ||
"_installable": true, | ||
"_location": "/mag-app-2048", | ||
"_nodeVersion": "6.4.0", | ||
"_npmUser": {}, | ||
"_npmVersion": "3.10.3", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "mag-app-2048", | ||
"scope": null, | ||
"escapedName": "mag-app-2048", | ||
"name": "mag-app-2048", | ||
"version": "1.0.0", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"_requiredBy": [ | ||
"#USER" | ||
], | ||
"_resolved": "http://npm.lpo.priv:4873/mag-app-2048/-/mag-app-2048-2.0.2.tgz", | ||
"_shasum": "334cfeda6687115bebd2788253f89e9ea809d00c", | ||
"_shrinkwrap": null, | ||
"_spec": "mag-app-2048", | ||
"_where": "/home/teletec/work", | ||
"author": { | ||
"name": "Infomir", | ||
"email": "support@infomir.eu" | ||
}, | ||
"config": { | ||
"type": "app", | ||
"category": "games", | ||
"backgroundColor": "#97897c", | ||
"name": "2048", | ||
"description": "2048 is one of the world’s most popular puzzles. The rules are simple: you need to shuffle all the bars to one side of the game field. Your goal is to reach 2048.", | ||
"author": { | ||
"name": "Infomir", | ||
"email": "support@infomir.eu" | ||
}, | ||
"dependencies": { | ||
"mag-core": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"code-proxy": "^1.2.21", | ||
"del": "^2.0.0", | ||
"gettext-parser": "^1.1.1", | ||
"gremlins.js": "^0.1.0", | ||
"gulp": "^3.9.0", | ||
"gulp-eslint": "^1.0.0", | ||
"gulp-jade": "^1.1.0", | ||
"gulp-less": "^3.0.3", | ||
"gulp-livereload": "^3.8.0", | ||
"gulp-minify-css": "^1.1.6", | ||
"gulp-plumber": "^1.0.1", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-repl": "^0.3.0", | ||
"gulp-sourcemaps": "^1.5.2", | ||
"gulp-util": "^3.0.5", | ||
"gulp-watch": "^4.3.5", | ||
"gulp-zip": "^3.0.2", | ||
"ip": "^0.3.2", | ||
"node-static": "^0.7.7", | ||
"open": "^0.0.5", | ||
"ssh2": "^0.4.11", | ||
"tty-colors": "^0.0.6", | ||
"webpack-stream": "^2.1.0", | ||
"weinre": "^2.0.0-pre-I0Z7U9OV", | ||
"ws": "^0.8.0", | ||
"stb-referrer": "^1.3.0" | ||
}, | ||
"scripts": { | ||
"build": "gulp webpack:develop && gulp lang && gulp webpack:clean && gulp build:release", | ||
"prepublish": "npm run build" | ||
}, | ||
"config": { | ||
"type": "app", | ||
"category": "games", | ||
"backgroundColor": "#97897c", | ||
"name": "2048", | ||
"description": "2048 is one of the world’s most popular puzzles. The rules are simple: you need to shuffle all the bars to one side of the game field. Your goal is to reach 2048.", | ||
"legacy": true, | ||
"icons": { | ||
"paths": { | ||
"480": "img/480/icons/", | ||
"576": "img/576/icons/", | ||
"720": "img/720/icons/", | ||
"1080": "img/1080/icons/" | ||
}, | ||
"states": { | ||
"normal": "2015.png", | ||
"active": "2015.focus.png" | ||
} | ||
} | ||
}, | ||
"keywords": [ | ||
"magsdk", | ||
"stalker", | ||
"2048" | ||
] | ||
"legacy": false, | ||
"icons": { | ||
"paths": { | ||
"480": "img/480/icons/", | ||
"576": "img/576/icons/", | ||
"720": "img/720/icons/", | ||
"1080": "img/1080/icons/" | ||
}, | ||
"states": { | ||
"normal": "2015.png", | ||
"active": "2015.focus.png" | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
"mag-core": "^1.0.0" | ||
}, | ||
"description": "2048 is one of the world’s most popular puzzles. The rules are simple: you need to shuffle all the bars to one side of the game field. Your goal is to reach 2048.", | ||
"devDependencies": { | ||
"cjs-emitter": "1.*.*", | ||
"mag-app": "github:magsdk/app", | ||
"mag-component-layout-list": "github:magsdk/component-layout-list", | ||
"mag-component-modal": "github:magsdk/component-modal", | ||
"spa-component-panel": "github:spasdk/component-panel", | ||
"stb-component-modal": "github:stbsdk/component-modal", | ||
"stb-component-page": "github:stbsdk/component-page", | ||
"stb-eslint-config": "github:stbsdk/eslint-config", | ||
"stb-rc": "github:stbsdk/rc" | ||
}, | ||
"dist": { | ||
"shasum": "334cfeda6687115bebd2788253f89e9ea809d00c", | ||
"tarball": "http://npm.lpo.priv:4873/mag-app-2048/-/mag-app-2048-2.0.2.tgz" | ||
}, | ||
"gitHead": "b54d7648ea24d8c4ebcbfc43f638049d1ac63fc7", | ||
"keywords": [ | ||
"magsdk", | ||
"stalker", | ||
"2048" | ||
], | ||
"name": "mag-app-2048", | ||
"optionalDependencies": {}, | ||
"readme": "ERROR: No README data found!", | ||
"readmeFilename": "readme.md", | ||
"scripts": {}, | ||
"version": "2.0.2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138011
9
21
2377
1