text: (function(e){function t(t){for(var i,s,a=t[0],c=t[1],l=t[2],d=0,p=[];d<a.length;d++)s=a[d],Object.prototype.hasOwnProperty.call(o,s)&&o[s]&&p.push(o[s][0]),o[s]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);u&&u(t);while(p.length)p.shift()();return r.push.apply(r,l||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],i=!0,a=1;a<n.length;a++){var c=n[a];0!==o[c]&&(i=!1)}i&&(r.splice(t--,1),e=s(s.s=n[0]))}return e}var i={},o={app:0},r=[];function s(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=i,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/penguin/";var a=window["webpackJsonp"]=window["webpackJsonp"]||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=c;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},2395:function(e,t,n){},"25f7":function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);var i=n("2b0e"),o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("notifications",{attrs:{group:"main",position:"top center",width:"500"}}),n("div",{style:{backgroundImage:"url(bg/"+e.store("background")+".jpg)"},attrs:{id:"bg"}}),n("div",{attrs:{id:"layout"}},[n("header",[n("div",e._l(e.menu,(function(t){return n("div",{key:t.title,staticClass:"menu-button",on:{click:function(n){return e.openMenu(t.title)}}},[n("div",{staticClass:"menu-button__title"},[n("icon",{attrs:{color:"#fff",path:e.icon(t.icon)}}),e._v(" "+e._s(t.title)+" ")],1)])})),0),n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.executing,expression:"executing"}],staticStyle:{height:"100%"}},[n("sync-loader",{attrs:{color:"#ffffff4a",size:"10px"}})],1)]),e.executing?e._e():n("div",{staticClass:"action-button action-button__execute"},[n("div",{on:{click:e.execute}},[e._v(" Execute "),n("icon",{attrs:{path:e.icon("CodeGreaterThan")}})],1)]),e.executing?n("div",{staticClass:"action-button action-button__stop"},[n("div",{on:{click:e.stop}},[e._v(" Stop "),n("icon",{attrs:{path:e.icon("StopCircleOutline")}})],1)]):e._e()]),n("section",{style:{fontSize:e.store("editorFont")+"px"},attrs:{id:"editor-section"}},[n("div",{attrs:{id:"editor-bg"},on:{click:e.focus}}),n("editor",{ref:"editor",attrs:{theme:e.store("editorTheme")},model:{value:e.code,callback:function(t){e.code=t},expression:"code"}})],1)]),e.executing?n("div",{attrs:{id:"modal-bg"}}):e._e(),e.executing?n("section",{ref:"modal",attrs:{id:"modal"}},[n("div")]):e._e(),n("section",{directives:[{name:"show",rawName:"v-show",value:"hidden"!==e.menuMode,expression:"menuMode !== 'hidden'"}],staticClass:"settings-modal"},[n("header",[n("div",e._l(e.menu,(function(t){return n("span",{directives:[{name:"show",rawName:"v-show",value:e.menuMode===t.title,expression:"menuMode === item.title"}],key:t.title},[n("icon",{attrs:{color:"#fff",path:e.icon(t.icon)}}),e._v(" "+e._s(t.title)+" ")],1)})),0),n("div",{staticClass:"modal-close",staticStyle:{"text-align":"right"},on:{click:function(t){return e.closeMenu()}}},[n("icon",{attrs:{color:"#fff",path:e.icon("CloseBoxOutline")}})],1)]),n("div",{staticClass:"modal-content"},[n("div",[n("settings",{directives:[{name:"show",rawName:"v-show",value:"Settings"===e.menuMode,expression:"menuMode === 'Settings'"}]}),n("file",{directives:[{name:"show",rawName:"v-show",value:"File"===e.menuMode,expression:"menuMode === 'File'"}]}),n("help",{directives:[{name:"show",rawName:"v-show",value:"Help"===e.menuMode,expression:"menuMode === 'Help'"}]}),n("div",{directives:[{name:"show",rawName:"v-show",value:"About"===e.menuMode,expression:"menuMode === 'About'"}]},[e._m(0)])],1)])])],1)},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{"text-align":"center","padding-top":"20px"}},[n("img",{staticStyle:{height:"150px"},attrs:{src:"android-chrome-192x192.png"}}),n("br"),n("br"),e._v(" Say hello to Penguin! "),n("br"),n("br"),e._v(" Online IDE for coding on JS with some old-school features "),n("br"),n("br"),e._v(" Fork me on "),n("a",{staticStyle:{color:"#6cb1de"},attrs:{target:"__blank",href:"https://github.com/VladReshet/penguin"}},[e._v("Github!")])])}],s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("prism-editor",{ref:"editor",staticClass:"my-editor",attrs:{tabSize:4,highlight:e.highlighter,"line-numbers":""},model:{value:e.code,callback:function(t){e.code=t},expression:"code"}})},a=[],c=n("e57a"),l=n("c197"),u=(n("5c81"),n("cabf"),{name:"Editor",props:{theme:{type:String,required:!1,default:"coy"}},components:{PrismEditor:c["a"]},data(){return{code:""}},methods:{highlighter:e=>Object(l["highlight"])(e,l["languages"].ts),saveCode(){this.$store.commit("saveCode",this.code)}},watch:{code(){this.saveCode(),this.$emit("input",this.code)}},created(){n("dff1")},mounted(){this.code=this.store("code")}}),d=u,p=(n("b16a"),n("2877")),h=Object(p["a"])(d,s,a,!1,null,null,null),m=h.exports,f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{viewBox:"0 0 24 22"}},[n("path",{attrs:{fill:e.color,d:e.path}})])},v=[],g={name:"Icon",props:{path:{type:String,required:!0},color:{type:String,required:!1,default:""}}},b=g,x=Object(p["a"])(b,f,v,!1,null,null,null),_=x.exports,w=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"row row-2"},[n("div",[n("label",[e._v(" Code Font Size ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:e.editorFont,expression:"editorFont"}],on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.editorFont=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"12"}},[e._v("12px")]),n("option",{attrs:{value:"14"}},[e._v("14px")]),n("option",{attrs:{value:"16"}},[e._v("16px")]),n("option",{attrs:{value:"18"}},[e._v("18px")]),n("option",{attrs:{value:"20"}},[e._v("20px")]),n("option",{attrs:{value:"24"}},[e._v("24px")]),n("option",{attrs:{value:"30"}},[e._v("30px")])])]),n("div",[n("label",[e._v(" Background ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:e.background,expression:"background"}],on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.background=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"1"}},[e._v("Abstract")]),n("option",{attrs:{value:"2"}},[e._v("Mountains")]),n("option",{attrs:{value:"3"}},[e._v("Sky")]),n("option",{attrs:{value:"4"}},[e._v("Stones")])])])]),n("br"),n("br"),n("div",{staticClass:"row row-3"},[n("div"),n("div",{staticClass:"btn",on:{click:e.reset}},[e._v(" Reset ")])])])},y=[],k={name:"Settings",data(){return{editorFont:0,background:0,editorTheme:""}},methods:{reset(){this.editorFont=12,this.background="2",this.editorTheme="funky"}},watch:{editorFont(){this.$store.commit("setEditorFont",this.editorFont)},background(){this.$store.commit("setBackground",this.background)},editorTheme(){this.$store.commit("setEditorTheme",this.editorTheme)}},created(){this.editorFont=this.$store.state.editorFont,this.background=this.$store.state.background,this.editorTheme=this.$store.state.editorTheme}},E=k,C=Object(p["a"])(E,w,y,!1,null,null,null),O=C.exports,S=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"row row-2"},[n("div",[n("div",{staticClass:"btn",on:{click:e._import}},[n("icon",{attrs:{color:"#fff",path:e.icon("DatabaseImportOutline")}}),e._v(" Import file ")],1)]),n("div",[n("div",{staticClass:"btn",on:{click:e._export}},[n("icon",{attrs:{color:"#fff",path:e.icon("DatabaseExportOutline")}}),e._v(" Export file ")],1)])]),n("input",{ref:"input",staticStyle:{display:"none"},attrs:{type:"file",accept:".jsi"}})])},F=[];const M=(e,t)=>{const n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)};var $={components:{Icon:_},name:"File",data(){return{editorFont:0,background:0,editorTheme:""}},methods:{_import(){if(!window.File||!window.FileReader||!window.FileList||!window.Blob)return this.error("The File APIs are not fully supported in this browser.");this.$refs.input.click()},_export(){M("Code.jsi",this.store("code"))},handleFileSelection({target:e}){if(e.files.length<1)return;const t=new FileReader;t.readAsText(e.files[0]),t.onload=()=>{this.$store.commit("saveCode",t.result),window.location.reload()},t.onerror=()=>this.error(t.error)}},mounted(){this.$refs.input.onchange=this.handleFileSelection.bind(this)}},T=$,j=(n("b470"),Object(p["a"])(T,S,F,!1,null,"15475ffc",null)),A=j.exports,P=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._v(" Basic javascript syntax is supported, plus 4 special cli functions. "),n("br"),n("br"),n("b",[e._v(" readln() ")]),e._v(" - read user input. "),n("br"),e._v(" Example: const name = readln(); "),n("br"),n("br"),n("b",[e._v(" write(text) ")]),e._v(" - write text to cli. "),n("br"),e._v(" Example: write(name); "),n("br"),n("br"),n("b",[e._v(" writeln(text) ")]),e._v(" - write text to cli and finish it with \\n. "),n("br"),e._v(" Example: writeln(name); "),n("br"),n("br"),n("b",[e._v(" wait(ms) ")]),e._v(" - delay execution for "),n("i",[e._v("ms")]),e._v(" milliseconds. "),n("br"),e._v(" Example: wait(3 * 1000); // wait 3 seconds "),n("hr"),e._v(" Example: ask user's name, wait 2 seconds, and say hello to him. "),n("br"),n("br"),n("i",[n("code",{domProps:{innerHTML:e._s(e.highlight("writeln('What is your name?');"))}}),n("br"),n("code",{domProps:{innerHTML:e._s(e.highlight("const name = readln();"))}}),n("br"),n("code",{domProps:{innerHTML:e._s(e.highlight("wait(2000);"))}}),n("br"),n("code",{domProps:{innerHTML:e._s(e.highlight("write('Hello ');"))}}),n("br"),n("code",{domProps:{innerHTML:e._s(e.highlight("write(name);"))}})])])},H=[],I={name:"Help",methods:{highlight(e){return Object(l["highlight"])(e,l["languages"].ts)}}},D=I,B=Object(p["a"])(D,P,H,!1,null,null,null),N=B.exports,L=n("9b1a"),q=n("1861"),R=n("7bdc"),z=n.n(R),G=n("ead4"),J=n.n(G),U={name:"App",components:{Editor:m,Icon:_,SyncLoader:L["a"],Settings:O,File:A,Help:N},data(){return{code:"",executing:!1,menuMode:"hidden",menu:[{title:"File",icon:"FileDocumentOutline"},{title:"Settings",icon:"CogOutline"},{title:"Help",icon:"HelpBox"},{title:"About",icon:"InformationOutline"}],cache:Math.random()}},methods:{focus(){this.$refs.editor.$refs.editor.$el.querySelector("textarea").focus()},stop(){this.executing=!1},openMenu(e){this.menuMode=e},closeMenu(){this.menuMode="hidden"},transform(e){return J()(e,{enter({node:e}){if("FunctionDeclaration"===e.type&&(e.async=!0),"AwaitExpression"!==e.type)for(let t in e)if(null!==e[t]&&void 0!==e[t].type){if("CallExpression"===e[t].type){const n=e[t];e[t]={type:"AwaitExpression",argument:n}}"FunctionExpression"!==e[t].type&&"ArrowFunctionExpression"!==e[t].type||(e[t].async=!0)}if("CallExpression"===e.type)for(let t in e.arguments)if("CallExpression"===e.arguments[t].type){const n=e.arguments[t];e.arguments[t]={type:"AwaitExpression",argument:n}}}}),e},async execute(){if(0===this.code.length)return this.warn("🤨 Nothing to execute");let e;try{e=Object(q["parse"])(this.code)}catch(t){return this.error("📛 Error: "+t.toString())}this.executing=!0,await this.$nextTick(),this.createIframe(z()(this.transform(e)).code)},createIframe(e){const t=document.createElement("iframe");t.src="run.html?cache="+this.cache,t.onload=()=>{t.contentDocument.body.querySelector("#script").innerHTML=`\n                "use strict";\n                (async () => {\n                  try {\n                    ${e}\n                  } catch (e) {\n                    notifyAboutError(e);\n                  }\n                  syslog("Execution finished");\n                })();\n              `},this.$refs.modal.appendChild(t)}},watch:{executing(){this.closeMenu()}}},V=U,W=(n("7c55"),Object(p["a"])(V,o,r,!1,null,null,null)),K=W.exports,Q=n("2f62"),X=n("0e44");i["default"].use(Q["a"]);var Y=new Q["a"].Store({plugins:[Object(X["a"])()],state:{editorFont:12,background:2,editorTheme:"funky",code:""},mutations:{setEditorFont(e,t){e.editorFont=t},setBackground(e,t){e.background=t},setEditorTheme(e,t){e.editorTheme=t},saveCode(e,t){e.code=t}},actions:{},modules:{}}),Z=n("ee98"),ee=n.n(Z),te=n("94ed");i["default"].config.productionTip=!1,i["default"].use(ee.a),i["default"].mixin({methods:{store(e){return this.$store.state[e]},icon(e){return{mdiFileDocumentOutline:te["f"],mdiCogOutline:te["c"],mdiHelpBox:te["g"],mdiCodeGreaterThan:te["b"],mdiStopCircleOutline:te["i"],mdiCloseBoxOutline:te["a"],mdiInformationOutline:te["h"],mdiDatabaseImportOutline:te["e"],mdiDatabaseExportOutline:te["d"]}["mdi"+e]},warn(e){this.$notify({group:"main",ignoreDuplicates:!0,type:"warn",duration:100,speed:400,text:e})},error(e){this.$notify({group:"main",ignoreDuplicates:!0,type:"error",duration:2e3,speed:400,text:e})},info(e){this.$notify({group:"main",ignoreDuplicates:!0,type:"info",duration:300,speed:100,text:e})}}}),new i["default"]({store:Y,render:function(e){return e(K)}}).$mount("#app")},"7c55":function(e,t,n){"use strict";n("2395")},b16a:function(e,t,n){"use strict";n("25f7")},b470:function(e,t,n){"use strict";n("bf54")},bf54:function(e,t,n){}});
  //# sourceMappingURL=app.6ad061b0.js.map