//!wrt $BSPEC:{"icn":"objects/keys","cpr":"Copyright (C) Windows 96 Team 2023.","dsc":"WPA (Joke)","frn":"WPA","ver":1,"ssy":"gui"}

const{MsgBoxSimple:MsgBoxSimple}=w96.ui;class WPA_Application extends WApplication{constructor(){super()}async main(e){super.main(e),this._createWindow()}_createWindow(){window.notGenuine?MsgBoxSimple.error("License Expired","Your Windows license is expired, please purchase a new license from our store.","OK").setSize(350,110).dlg.center():MsgBoxSimple.confirm("For the low low price of FREE, you can activate Windows 96 today!\n\nWant to proceed?",(e=>{if(e){this.terminate(),MsgBoxSimple.error("Activation Error","This copy of Windows is not genuine.","OK"),document.querySelector(".user-desktop").style.background="black";const n=document.createElement("div");n.classList.add("troll-not-genuine"),n.innerHTML='<span class="left">This copy of Windows is not genuine</span>\n                <span class="right">This copy of Windows is not genuine</span>\n                <span class="bleft">This copy of Windows is not genuine</span>\n                <span class="bright">This copy of Windows is not genuine</span>',document.body.appendChild(n);const o=document.createElement("div");o.innerText="This copy of Windows is not genuine",o.classList.add("troll-not-genuine");let i=1,t=1;function r(){const e=o.getBoundingClientRect();o.style.top=`${e.top+t}px`,o.style.left=`${e.top+i}px`,e.y>window.innerHeight?t=-1:t<0&&(t=1),e.x>window.innerWidth?i=-1:i<0&&(i=1),requestAnimationFrame(r)}r(),document.body.appendChild(o),deregisterApp("explorer"),deregisterApp("textpad"),deregisterApp("dyk"),registerApp("explorer",[],(e=>{MsgBoxSimple.error("Error","This app is disabled because you didn't register your copy.","Damn")})),registerApp("textpad",[],(e=>{MsgBoxSimple.error("Error","This app is disabled because you didn't register your copy.","Damn")})),registerApp("dyk",[],(e=>{MsgBoxSimple.info("Pro Tip","You can end this hell of unregistered windows if you restart via start menu.",":O")})),document.body.oncontextmenu=e=>{e.preventDefault(),MsgBoxSimple.error("Error","Please register your copy of Windows to continue using Windows 96 uninterrupted.","Damn").dlg.setPosition(e.x,e.y)};const s=document.createElement("style");s.innerText=".w96_sm_logo .container .text::after {\n                    content: 'Windows 96 (UNREGISTERED)';\n                }\n                \n                .shell-icon .icon-image {\n                    background: url(system/resource/themes/default/icons/error.png) !important;\n                }",document.body.appendChild(s),setTimeout((()=>{MsgBoxSimple.error("Error","Color display is only available for genuine Windows 96.",":("),document.body.style.filter="grayscale(1)"}),2e3),setInterval((()=>{MsgBoxSimple.error("Error","Failed to load DLL - You didn't register your copy of Windows.","Damn").dlg.randomizePosition()}),1e4),window.notGenuine=!0}}))}}

return await WApplication.execAsync(new WPA_Application(), this.boxedEnv.args, this);