//!wrt $BSPEC:{"icn":null,"cpr":"Copyright (C) Windows 96 Team 2021.","dsc":"Welcome program","frn":"Welcome","ver":1,"ssy":"gui"}

function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const{CheckBox:CheckBox}=w96.ui.components,{sysConf:SCM}=w96;class WelcomeApplication extends WApplication{constructor(){super(),this.opts={showOnStart:!0}}async main(e){super.main(e),this.mainwnd=this.createWindow({title:"Welcome to Windows 96",icon:"system/resource/shell/start-icn.png",body:'\n\t\t\t\t<div class="welcome96-header" style="height:60px;padding-bottom:21px;">\n\t\t\t\t\t<div class="welcome96-hr" style="position:relative;top:44px;"></div>\n\t\t\t\t\t<img src="/system/resource/app/welcome/logo.png" style="position:relative;top:15px;left:36px;">\n\t\t\t\t</div>\n\t\t\t\t<div class="welcome96-body">\n\t\t\t\t\t<div class="welcome96-sidebar">\n\t\t\t\t\t\t<div class="welcome96-sidebar-item welcome96-sidebar-header"><span>C O N T E N T S</span></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="welcome96-content"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="welcome96-footer">\n\t\t\t\t\t<div class="welcome96-autostart-checkbox"></div>\n\t\t\t\t\t<button class="w96-button welcome96-close-btn">Close</button>\n\t\t\t\t</div>\n\t\t\t',bodyClass:"welcome96-app",minWidth:477,minHeight:343,initialWidth:477,initialHeight:343,center:!0,resizable:!1,taskbar:!0,controlBoxStyle:"WS_CBX_CLOSE"},!0),this.opts.showOnStart=await FS.exists("c:/system/startup/welcome.link");const t=this.mainwnd.getBodyContainer(),o=t.querySelector(".welcome96-sidebar");t.querySelector(".welcome96-autostart-checkbox").replaceWith(new CheckBox({label:"Show this screen each time Windows 96 starts.",checked:this.opts.showOnStart,onchange:e=>this.opts.showOnStart=e.checked,displayAsBlock:!1}).getElement()),t.querySelector("button.welcome96-close-btn").onclick=()=>{this.terminate()},o.onmouseleave=()=>this.setContent(),WelcomeApplication.sidebar.forEach((e=>{const t=document.createElement("div");t.className="welcome96-sidebar-item",t.innerText=e.shortName,t.onclick=e.onclick,t.onmouseenter=()=>{this.setContent(e)},o.appendChild(t)})),this.setContent(),this.music=new Audio("/system/resource/app/welcome/music.ogg"),this.music.play(),this.mainwnd.show()}setContent(e=WelcomeApplication.defaultItem){const t=this.mainwnd.getBodyContainer(),o=t.querySelector(".welcome96-content");for(t.style.backgroundImage=`url(/system/resource/app/welcome/${e.image}), url(/system/resource/app/welcome/background.png)`;o.firstChild;)o.removeChild(o.firstChild);o.innerHTML=`<h1 style="margin-top:0;">${e.heading}</h1>${e.contents}`}async ontermination(){super.ontermination(),this.mainwnd=null,this.music.pause(),this.music.removeAttribute("src"),this.music.load()}}_defineProperty(WelcomeApplication,"defaultItem",{heading:"Welcome",contents:"<p>Welcome to the exciting new world of Windows 96, where your computer desktop meets the Internet!</p><p>Sit back and relax as you take a brief tour of the options available on this screen.</p><p>If you want to explore an option, just click it.</p>",image:"welcome.png"}),_defineProperty(WelcomeApplication,"sidebar",[{shortName:"Register Now",heading:"Register Now!",contents:"<p>Registering your copy of Windows 96 opens the doors to full Internet support for your system. Better product support, free product enhancements, free tips and tricks, and the coolest Windows add-ons are just a mouse-click away by registering.</p>",image:"register_now.png",onclick:()=>{}},{shortName:"Connect to the Internet",heading:"Connect to the Internet",contents:"<p>On the Internet, you can correspond through electronic mail (e-mail), get the latest news and financial information, and visit Web sites around the world.</p><p>Windows 96 makes getting connected to the Internet quick and simple.</p>",image:"connect_to_the_internet.png",onclick:()=>{}},{shortName:"Discover Windows 96",heading:"Discover Windows 96",contents:'<p>"Computer Essentials" introduces first-time users to basic computing.</p><p>"Windows 96 Overview" offers step-by-step lessons for new Windows users.</p><p>"What\'s New" highlights the features of Windows 96.</p>',image:"discover.png",onclick:()=>{}},{shortName:"Maintain Your Computer",heading:"Maintain Your Computer",contents:"<p>Speed up your computer! For top-notch performance, schedule regular maintenance that frees up hard disk space, makes your programs run faster, and optimizes the performance of your hard disk.</p>",image:"maintain_your_computer.png",onclick:()=>{}}]);

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