Repository navigation
Expand file tree
/
Copy pathVisualFBEditor.js
More file actions
1 lines (1 loc) · 302 KB
/
Copy pathVisualFBEditor.js
File metadata and controls
1 lines (1 loc) · 302 KB
1
var Module=typeof Module!="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){if(Module["ENVIRONMENT_IS_PTHREAD"]||Module["$ww"])return;var loadPackage=function(metadata){var PACKAGE_PATH="";if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof process==="undefined"&&typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var PACKAGE_NAME="D:/GitHub/VisualFBEditor/src/../VisualFBEditor.data";var REMOTE_PACKAGE_BASE="VisualFBEditor.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];function fetchRemotePackage(packageName,packageSize,callback,errback){if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){require("fs").readFile(packageName,function(err,contents){if(err){errback(err)}else{callback(contents.buffer)}});return}var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","Controls",true,true);Module["FS_createPath"]("/Controls","MyFbFramework",true,true);Module["FS_createPath"]("/Controls/MyFbFramework","mff",true,true);Module["FS_createPath"]("/","Settings",true,true);Module["FS_createPath"]("/Settings","Keywords",true,true);Module["FS_createPath"]("/Settings","Languages",true,true);Module["FS_createPath"]("/Settings","Others",true,true);Module["FS_createPath"]("/Settings","Snippets",true,true);Module["FS_createPath"]("/Settings","Themes",true,true);Module["FS_createPath"]("/Settings/Themes","Interface",true,true);Module["FS_createPath"]("/","Templates",true,true);Module["FS_createPath"]("/Templates","Files",true,true);Module["FS_createPath"]("/Templates","Projects",true,true);Module["FS_createPath"]("/Templates/Projects","Addin Project",true,true);Module["FS_createPath"]("/Templates/Projects","Console Application",true,true);Module["FS_createPath"]("/Templates/Projects","Control Library",true,true);Module["FS_createPath"]("/Templates/Projects","Dynamic Library",true,true);Module["FS_createPath"]("/Templates/Projects","GTK Application",true,true);Module["FS_createPath"]("/Templates/Projects","GUI Application",true,true);Module["FS_createPath"]("/Templates/Projects","Static Library",true,true);Module["FS_createPath"]("/Templates/Projects","Windows Application",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i<files.length;++i){new DataRequest(files[i]["start"],files[i]["end"],files[i]["audio"]||0).open("GET",files[i]["filename"])}function processPackageData(arrayBuffer){assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);DataRequest.prototype.byteArray=byteArray;var files=metadata["files"];for(var i=0;i<files.length;++i){DataRequest.prototype.requests[files[i].filename].onload()}Module["removeRunDependency"]("datafile_D:/GitHub/VisualFBEditor/src/../VisualFBEditor.data")}Module["addRunDependency"]("datafile_D:/GitHub/VisualFBEditor/src/../VisualFBEditor.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}};loadPackage({"files":[{"filename":"/Controls/MyFbFramework/Settings.ini","start":0,"end":676},{"filename":"/Controls/MyFbFramework/mff/.poseidon","start":676,"end":3997},{"filename":"/Controls/MyFbFramework/mff/Animate.bas","start":3997,"end":43079},{"filename":"/Controls/MyFbFramework/mff/Animate.bi","start":43079,"end":51791},{"filename":"/Controls/MyFbFramework/mff/Application.bas","start":51791,"end":115211},{"filename":"/Controls/MyFbFramework/mff/Application.bi","start":115211,"end":126169},{"filename":"/Controls/MyFbFramework/mff/Bitmap.bas","start":126169,"end":150670},{"filename":"/Controls/MyFbFramework/mff/Bitmap.bi","start":150670,"end":154946},{"filename":"/Controls/MyFbFramework/mff/Brush.bas","start":154946,"end":159288},{"filename":"/Controls/MyFbFramework/mff/Brush.bi","start":159288,"end":163685},{"filename":"/Controls/MyFbFramework/mff/Button.bas","start":163685,"end":212698},{"filename":"/Controls/MyFbFramework/mff/Button.bi","start":212698,"end":228913},{"filename":"/Controls/MyFbFramework/mff/Canvas.bas","start":228913,"end":413577},{"filename":"/Controls/MyFbFramework/mff/Canvas.bi","start":413577,"end":428185},{"filename":"/Controls/MyFbFramework/mff/Chart.bas","start":428185,"end":662984},{"filename":"/Controls/MyFbFramework/mff/Chart.bi","start":662984,"end":684560},{"filename":"/Controls/MyFbFramework/mff/CheckBox.bas","start":684560,"end":698275},{"filename":"/Controls/MyFbFramework/mff/CheckBox.bi","start":698275,"end":701730},{"filename":"/Controls/MyFbFramework/mff/CheckedListBox.bas","start":701730,"end":721982},{"filename":"/Controls/MyFbFramework/mff/CheckedListBox.bi","start":721982,"end":725051},{"filename":"/Controls/MyFbFramework/mff/Classes.bas","start":725051,"end":725054},{"filename":"/Controls/MyFbFramework/mff/Classes.bi","start":725054,"end":725911},{"filename":"/Controls/MyFbFramework/mff/Clipboard.bas","start":725911,"end":730686},{"filename":"/Controls/MyFbFramework/mff/Clipboard.bi","start":730686,"end":732242},{"filename":"/Controls/MyFbFramework/mff/ColorPicker.bas","start":732242,"end":799047},{"filename":"/Controls/MyFbFramework/mff/ColorPicker.bi","start":799047,"end":815749},{"filename":"/Controls/MyFbFramework/mff/ComboBoxEdit.bas","start":815749,"end":852088},{"filename":"/Controls/MyFbFramework/mff/ComboBoxEdit.bi","start":852088,"end":860874},{"filename":"/Controls/MyFbFramework/mff/ComboBoxEx.bas","start":860874,"end":897207},{"filename":"/Controls/MyFbFramework/mff/ComboBoxEx.bi","start":897207,"end":905013},{"filename":"/Controls/MyFbFramework/mff/CommandButton.bas","start":905013,"end":917052},{"filename":"/Controls/MyFbFramework/mff/CommandButton.bi","start":917052,"end":921408},{"filename":"/Controls/MyFbFramework/mff/Component.bas","start":921408,"end":959199},{"filename":"/Controls/MyFbFramework/mff/Component.bi","start":959199,"end":978637},{"filename":"/Controls/MyFbFramework/mff/Console.bi","start":978637,"end":1009653},{"filename":"/Controls/MyFbFramework/mff/ContainerControl.bas","start":1009653,"end":1016054},{"filename":"/Controls/MyFbFramework/mff/ContainerControl.bi","start":1016054,"end":1018450},{"filename":"/Controls/MyFbFramework/mff/Control.bas","start":1018450,"end":1244026},{"filename":"/Controls/MyFbFramework/mff/Control.bi","start":1244026,"end":1288932},{"filename":"/Controls/MyFbFramework/mff/Cursor.bas","start":1288932,"end":1300526},{"filename":"/Controls/MyFbFramework/mff/Cursor.bi","start":1300526,"end":1307460},{"filename":"/Controls/MyFbFramework/mff/DateTimePicker.bas","start":1307460,"end":1361352},{"filename":"/Controls/MyFbFramework/mff/DateTimePicker.bi","start":1361352,"end":1367958},{"filename":"/Controls/MyFbFramework/mff/Dialogs.bas","start":1367958,"end":1410767},{"filename":"/Controls/MyFbFramework/mff/Dialogs.bi","start":1410767,"end":1420657},{"filename":"/Controls/MyFbFramework/mff/Dictionary.bas","start":1420657,"end":1438596},{"filename":"/Controls/MyFbFramework/mff/Dictionary.bi","start":1438596,"end":1443518},{"filename":"/Controls/MyFbFramework/mff/DoubleList.bas","start":1443518,"end":1451633},{"filename":"/Controls/MyFbFramework/mff/DoubleList.bi","start":1451633,"end":1454668},{"filename":"/Controls/MyFbFramework/mff/FBMemCheck.bi","start":1454668,"end":1472047},{"filename":"/Controls/MyFbFramework/mff/FileListBox.bi","start":1472047,"end":1478006},{"filename":"/Controls/MyFbFramework/mff/Font.bas","start":1478006,"end":1492102},{"filename":"/Controls/MyFbFramework/mff/Font.bi","start":1492102,"end":1497400},{"filename":"/Controls/MyFbFramework/mff/Form.bas","start":1497400,"end":1620888},{"filename":"/Controls/MyFbFramework/mff/Form.bi","start":1620888,"end":1635825},{"filename":"/Controls/MyFbFramework/mff/GUI.bas","start":1635825,"end":1639476},{"filename":"/Controls/MyFbFramework/mff/GUI.bi","start":1639476,"end":1640471},{"filename":"/Controls/MyFbFramework/mff/Graphic.bas","start":1640471,"end":1649986},{"filename":"/Controls/MyFbFramework/mff/Graphic.bi","start":1649986,"end":1653489},{"filename":"/Controls/MyFbFramework/mff/Graphics.bas","start":1653489,"end":1658454},{"filename":"/Controls/MyFbFramework/mff/Graphics.bi","start":1658454,"end":1675653},{"filename":"/Controls/MyFbFramework/mff/Grid.bas","start":1675653,"end":1778884},{"filename":"/Controls/MyFbFramework/mff/Grid.bi","start":1778884,"end":1802566},{"filename":"/Controls/MyFbFramework/mff/GridData.bas","start":1802566,"end":1914866},{"filename":"/Controls/MyFbFramework/mff/GridData.bi","start":1914866,"end":1940351},{"filename":"/Controls/MyFbFramework/mff/GridDataEx.bas","start":1940351,"end":2329289},{"filename":"/Controls/MyFbFramework/mff/GridDataEx.bi","start":2329289,"end":2418927},{"filename":"/Controls/MyFbFramework/mff/GridDataExEnums.bi","start":2418927,"end":2436863},{"filename":"/Controls/MyFbFramework/mff/GroupBox.bas","start":2436863,"end":2445704},{"filename":"/Controls/MyFbFramework/mff/GroupBox.bi","start":2445704,"end":2448245},{"filename":"/Controls/MyFbFramework/mff/HScrollBar.bas","start":2448245,"end":2459122},{"filename":"/Controls/MyFbFramework/mff/HScrollBar.bi","start":2459122,"end":2462604},{"filename":"/Controls/MyFbFramework/mff/HTTP.bas","start":2462604,"end":2472262},{"filename":"/Controls/MyFbFramework/mff/HTTP.bi","start":2472262,"end":2474054},{"filename":"/Controls/MyFbFramework/mff/HTTPServer.bas","start":2474054,"end":2492128},{"filename":"/Controls/MyFbFramework/mff/HTTPServer.bi","start":2492128,"end":2497643},{"filename":"/Controls/MyFbFramework/mff/Header.bas","start":2497643,"end":2530992},{"filename":"/Controls/MyFbFramework/mff/Header.bi","start":2530992,"end":2540434},{"filename":"/Controls/MyFbFramework/mff/HorizontalBox.bas","start":2540434,"end":2545811},{"filename":"/Controls/MyFbFramework/mff/HorizontalBox.bi","start":2545811,"end":2547729},{"filename":"/Controls/MyFbFramework/mff/HotKey.bas","start":2547729,"end":2560594},{"filename":"/Controls/MyFbFramework/mff/HotKey.bi","start":2560594,"end":2562869},{"filename":"/Controls/MyFbFramework/mff/IPAddress.bas","start":2562869,"end":2587197},{"filename":"/Controls/MyFbFramework/mff/IPAddress.bi","start":2587197,"end":2590713},{"filename":"/Controls/MyFbFramework/mff/Icon.bas","start":2590713,"end":2600353},{"filename":"/Controls/MyFbFramework/mff/Icon.bi","start":2600353,"end":2603721},{"filename":"/Controls/MyFbFramework/mff/IconPanel.bas","start":2603721,"end":2626621},{"filename":"/Controls/MyFbFramework/mff/IconPanel.bi","start":2626621,"end":2636059},{"filename":"/Controls/MyFbFramework/mff/ImageBox.bas","start":2636059,"end":2652206},{"filename":"/Controls/MyFbFramework/mff/ImageBox.bi","start":2652206,"end":2656384},{"filename":"/Controls/MyFbFramework/mff/ImageList.bas","start":2656384,"end":2679416},{"filename":"/Controls/MyFbFramework/mff/ImageList.bi","start":2679416,"end":2686229},{"filename":"/Controls/MyFbFramework/mff/IniFile.bas","start":2686229,"end":2697479},{"filename":"/Controls/MyFbFramework/mff/IniFile.bi","start":2697479,"end":2700314},{"filename":"/Controls/MyFbFramework/mff/Integer.bas","start":2700314,"end":2700574},{"filename":"/Controls/MyFbFramework/mff/Integer.bi","start":2700574,"end":2700743},{"filename":"/Controls/MyFbFramework/mff/IntegerList.bas","start":2700743,"end":2708580},{"filename":"/Controls/MyFbFramework/mff/IntegerList.bi","start":2708580,"end":2711604},{"filename":"/Controls/MyFbFramework/mff/Label.bas","start":2711604,"end":2728367},{"filename":"/Controls/MyFbFramework/mff/Label.bi","start":2728367,"end":2733536},{"filename":"/Controls/MyFbFramework/mff/LinkLabel.bas","start":2733536,"end":2741039},{"filename":"/Controls/MyFbFramework/mff/LinkLabel.bi","start":2741039,"end":2743349},{"filename":"/Controls/MyFbFramework/mff/List.bas","start":2743349,"end":2756938},{"filename":"/Controls/MyFbFramework/mff/List.bi","start":2756938,"end":2760410},{"filename":"/Controls/MyFbFramework/mff/ListControl.bas","start":2760410,"end":2787150},{"filename":"/Controls/MyFbFramework/mff/ListControl.bi","start":2787150,"end":2794820},{"filename":"/Controls/MyFbFramework/mff/ListItemsOld.bas","start":2794820,"end":2797598},{"filename":"/Controls/MyFbFramework/mff/ListItemsOld.bi","start":2797598,"end":2799817},{"filename":"/Controls/MyFbFramework/mff/ListView.bas","start":2799817,"end":2878887},{"filename":"/Controls/MyFbFramework/mff/ListView.bi","start":2878887,"end":2898307},{"filename":"/Controls/MyFbFramework/mff/MD2RTF.bi","start":2898307,"end":2939221},{"filename":"/Controls/MyFbFramework/mff/Manifest.xml","start":2939221,"end":2940095},{"filename":"/Controls/MyFbFramework/mff/Menus.bas","start":2940095,"end":3045108},{"filename":"/Controls/MyFbFramework/mff/Menus.bi","start":3045108,"end":3066905},{"filename":"/Controls/MyFbFramework/mff/MonthCalendar.bas","start":3066905,"end":3078330},{"filename":"/Controls/MyFbFramework/mff/MonthCalendar.bi","start":3078330,"end":3082228},{"filename":"/Controls/MyFbFramework/mff/NativeFontControl.bas","start":3082228,"end":3084245},{"filename":"/Controls/MyFbFramework/mff/NativeFontControl.bi","start":3084245,"end":3085328},{"filename":"/Controls/MyFbFramework/mff/NoInterface.bi","start":3085328,"end":3106114},{"filename":"/Controls/MyFbFramework/mff/NotifyIcon.bas","start":3106114,"end":3114339},{"filename":"/Controls/MyFbFramework/mff/NotifyIcon.bi","start":3114339,"end":3120352},{"filename":"/Controls/MyFbFramework/mff/NumericUpDown.bas","start":3120352,"end":3134723},{"filename":"/Controls/MyFbFramework/mff/NumericUpDown.bi","start":3134723,"end":3139576},{"filename":"/Controls/MyFbFramework/mff/Object.bas","start":3139576,"end":3147471},{"filename":"/Controls/MyFbFramework/mff/Object.bi","start":3147471,"end":3154067},{"filename":"/Controls/MyFbFramework/mff/OpenFileControl.bas","start":3154067,"end":3188760},{"filename":"/Controls/MyFbFramework/mff/OpenFileControl.bi","start":3188760,"end":3194865},{"filename":"/Controls/MyFbFramework/mff/PagePanel.bas","start":3194865,"end":3212994},{"filename":"/Controls/MyFbFramework/mff/PagePanel.bi","start":3212994,"end":3216531},{"filename":"/Controls/MyFbFramework/mff/PageScroller.bas","start":3216531,"end":3242758},{"filename":"/Controls/MyFbFramework/mff/PageScroller.bi","start":3242758,"end":3246124},{"filename":"/Controls/MyFbFramework/mff/PageSetupDialog.bas","start":3246124,"end":3259839},{"filename":"/Controls/MyFbFramework/mff/PageSetupDialog.bi","start":3259839,"end":3263845},{"filename":"/Controls/MyFbFramework/mff/Panel.bas","start":3263845,"end":3276950},{"filename":"/Controls/MyFbFramework/mff/Panel.bi","start":3276950,"end":3280685},{"filename":"/Controls/MyFbFramework/mff/Pen.bas","start":3280685,"end":3284080},{"filename":"/Controls/MyFbFramework/mff/Pen.bi","start":3284080,"end":3287637},{"filename":"/Controls/MyFbFramework/mff/Picture.bas","start":3287637,"end":3305373},{"filename":"/Controls/MyFbFramework/mff/Picture.bi","start":3305373,"end":3309137},{"filename":"/Controls/MyFbFramework/mff/PointerList.bas","start":3309137,"end":3316187},{"filename":"/Controls/MyFbFramework/mff/PointerList.bi","start":3316187,"end":3318565},{"filename":"/Controls/MyFbFramework/mff/PrintDialog.bas","start":3318565,"end":3325799},{"filename":"/Controls/MyFbFramework/mff/PrintDialog.bi","start":3325799,"end":3328159},{"filename":"/Controls/MyFbFramework/mff/PrintDocument.bas","start":3328159,"end":3341632},{"filename":"/Controls/MyFbFramework/mff/PrintDocument.bi","start":3341632,"end":3345014},{"filename":"/Controls/MyFbFramework/mff/PrintPreviewControl.bas","start":3345014,"end":3369790},{"filename":"/Controls/MyFbFramework/mff/PrintPreviewControl.bi","start":3369790,"end":3374030},{"filename":"/Controls/MyFbFramework/mff/PrintPreviewDialog.bas","start":3374030,"end":3386494},{"filename":"/Controls/MyFbFramework/mff/PrintPreviewDialog.bi","start":3386494,"end":3389013},{"filename":"/Controls/MyFbFramework/mff/Printer.bas","start":3389013,"end":3456310},{"filename":"/Controls/MyFbFramework/mff/Printer.bi","start":3456310,"end":3469728},{"filename":"/Controls/MyFbFramework/mff/Progress.bas","start":3469728,"end":3512819},{"filename":"/Controls/MyFbFramework/mff/Progress.bi","start":3512819,"end":3524494},{"filename":"/Controls/MyFbFramework/mff/ProgressBar.bas","start":3524494,"end":3540455},{"filename":"/Controls/MyFbFramework/mff/ProgressBar.bi","start":3540455,"end":3544560},{"filename":"/Controls/MyFbFramework/mff/RadioButton.bas","start":3544560,"end":3559676},{"filename":"/Controls/MyFbFramework/mff/RadioButton.bi","start":3559676,"end":3563288},{"filename":"/Controls/MyFbFramework/mff/ReBar.bas","start":3563288,"end":3614950},{"filename":"/Controls/MyFbFramework/mff/ReBar.bi","start":3614950,"end":3623455},{"filename":"/Controls/MyFbFramework/mff/Regex.bas","start":3623455,"end":3651212},{"filename":"/Controls/MyFbFramework/mff/Regex.bi","start":3651212,"end":3656509},{"filename":"/Controls/MyFbFramework/mff/Registry.bas","start":3656509,"end":3659446},{"filename":"/Controls/MyFbFramework/mff/Registry.bi","start":3659446,"end":3660394},{"filename":"/Controls/MyFbFramework/mff/Report.bas","start":3660394,"end":3727233},{"filename":"/Controls/MyFbFramework/mff/Report.bi","start":3727233,"end":3757960},{"filename":"/Controls/MyFbFramework/mff/ReportDataBind.bas","start":3757960,"end":3760273},{"filename":"/Controls/MyFbFramework/mff/ReportDataBind.bi","start":3760273,"end":3763284},{"filename":"/Controls/MyFbFramework/mff/RichTextBox.bas","start":3763284,"end":3836152},{"filename":"/Controls/MyFbFramework/mff/RichTextBox.bi","start":3836152,"end":3845312},{"filename":"/Controls/MyFbFramework/mff/Ruler.bas","start":3845312,"end":3854949},{"filename":"/Controls/MyFbFramework/mff/Ruler.bi","start":3854949,"end":3859751},{"filename":"/Controls/MyFbFramework/mff/ScrollBarControl.bas","start":3859751,"end":3872713},{"filename":"/Controls/MyFbFramework/mff/ScrollBarControl.bi","start":3872713,"end":3876614},{"filename":"/Controls/MyFbFramework/mff/ScrollControl.bas","start":3876614,"end":3887428},{"filename":"/Controls/MyFbFramework/mff/ScrollControl.bi","start":3887428,"end":3889371},{"filename":"/Controls/MyFbFramework/mff/SearchBox.bas","start":3889371,"end":3901186},{"filename":"/Controls/MyFbFramework/mff/SearchBox.bi","start":3901186,"end":3903329},{"filename":"/Controls/MyFbFramework/mff/SelectBar.bas","start":3903329,"end":3925864},{"filename":"/Controls/MyFbFramework/mff/SelectBar.bi","start":3925864,"end":3934293},{"filename":"/Controls/MyFbFramework/mff/SoundPlayer.bas","start":3934293,"end":3944792},{"filename":"/Controls/MyFbFramework/mff/SoundPlayer.bi","start":3944792,"end":3949123},{"filename":"/Controls/MyFbFramework/mff/Splitter.bas","start":3949123,"end":3967490},{"filename":"/Controls/MyFbFramework/mff/Splitter.bi","start":3967490,"end":3970851},{"filename":"/Controls/MyFbFramework/mff/StatusBar.bas","start":3970851,"end":3992346},{"filename":"/Controls/MyFbFramework/mff/StatusBar.bi","start":3992346,"end":3999626},{"filename":"/Controls/MyFbFramework/mff/StringList.bas","start":3999626,"end":4010697},{"filename":"/Controls/MyFbFramework/mff/StringList.bi","start":4010697,"end":4014746},{"filename":"/Controls/MyFbFramework/mff/Sys.bas","start":4014746,"end":4018271},{"filename":"/Controls/MyFbFramework/mff/Sys.bi","start":4018271,"end":4019042},{"filename":"/Controls/MyFbFramework/mff/SysUtils.bas","start":4019042,"end":4125169},{"filename":"/Controls/MyFbFramework/mff/SysUtils.bi","start":4125169,"end":4173219},{"filename":"/Controls/MyFbFramework/mff/SystemInformation.bas","start":4173219,"end":4175671},{"filename":"/Controls/MyFbFramework/mff/SystemInformation.bi","start":4175671,"end":4176516},{"filename":"/Controls/MyFbFramework/mff/TabControl.bas","start":4176516,"end":4236276},{"filename":"/Controls/MyFbFramework/mff/TabControl.bi","start":4236276,"end":4247652},{"filename":"/Controls/MyFbFramework/mff/TextBox.bas","start":4247652,"end":4322648},{"filename":"/Controls/MyFbFramework/mff/TextBox.bi","start":4322648,"end":4335909},{"filename":"/Controls/MyFbFramework/mff/TimerComponent.bas","start":4335909,"end":4341564},{"filename":"/Controls/MyFbFramework/mff/TimerComponent.bi","start":4341564,"end":4343305},{"filename":"/Controls/MyFbFramework/mff/Toggle.bas","start":4343305,"end":4376027},{"filename":"/Controls/MyFbFramework/mff/Toggle.bi","start":4376027,"end":4387651},{"filename":"/Controls/MyFbFramework/mff/ToolBar.bas","start":4387651,"end":4454081},{"filename":"/Controls/MyFbFramework/mff/ToolBar.bi","start":4454081,"end":4467587},{"filename":"/Controls/MyFbFramework/mff/ToolPalette.bas","start":4467587,"end":4512392},{"filename":"/Controls/MyFbFramework/mff/ToolPalette.bi","start":4512392,"end":4521204},{"filename":"/Controls/MyFbFramework/mff/ToolTips.bas","start":4521204,"end":4526899},{"filename":"/Controls/MyFbFramework/mff/ToolTips.bi","start":4526899,"end":4528611},{"filename":"/Controls/MyFbFramework/mff/TrackBar.bas","start":4528611,"end":4550082},{"filename":"/Controls/MyFbFramework/mff/TrackBar.bi","start":4550082,"end":4555409},{"filename":"/Controls/MyFbFramework/mff/TreeListView.bas","start":4555409,"end":4642296},{"filename":"/Controls/MyFbFramework/mff/TreeListView.bi","start":4642296,"end":4661936},{"filename":"/Controls/MyFbFramework/mff/TreeView.bas","start":4661936,"end":4720890},{"filename":"/Controls/MyFbFramework/mff/TreeView.bi","start":4720890,"end":4734137},{"filename":"/Controls/MyFbFramework/mff/UString.bas","start":4734137,"end":4813508},{"filename":"/Controls/MyFbFramework/mff/UString.bi","start":4813508,"end":4823629},{"filename":"/Controls/MyFbFramework/mff/UString_WString.bas","start":4823629,"end":4903573},{"filename":"/Controls/MyFbFramework/mff/UString_WString.bi","start":4903573,"end":4913997},{"filename":"/Controls/MyFbFramework/mff/UpDown.bas","start":4913997,"end":4933781},{"filename":"/Controls/MyFbFramework/mff/UpDown.bi","start":4933781,"end":4938707},{"filename":"/Controls/MyFbFramework/mff/UserControl.bas","start":4938707,"end":4940827},{"filename":"/Controls/MyFbFramework/mff/UserControl.bi","start":4940827,"end":4942046},{"filename":"/Controls/MyFbFramework/mff/VScrollBar.bas","start":4942046,"end":4953001},{"filename":"/Controls/MyFbFramework/mff/VScrollBar.bi","start":4953001,"end":4956541},{"filename":"/Controls/MyFbFramework/mff/VerticalBox.bas","start":4956541,"end":4961858},{"filename":"/Controls/MyFbFramework/mff/VerticalBox.bi","start":4961858,"end":4963761},{"filename":"/Controls/MyFbFramework/mff/WStringList.bas","start":4963761,"end":4977507},{"filename":"/Controls/MyFbFramework/mff/WStringList.bi","start":4977507,"end":4982066},{"filename":"/Controls/MyFbFramework/mff/WebBrowser.bas","start":4982066,"end":5043831},{"filename":"/Controls/MyFbFramework/mff/WebBrowser.bi","start":5043831,"end":5064814},{"filename":"/Controls/MyFbFramework/mff/gtk4compat.bi","start":5064814,"end":5218416},{"filename":"/Controls/MyFbFramework/mff/mff.asm","start":5218416,"end":5218416},{"filename":"/Controls/MyFbFramework/mff/mff.bas","start":5218416,"end":5218443},{"filename":"/Controls/MyFbFramework/mff/mff.bi","start":5218443,"end":5238194},{"filename":"/Controls/MyFbFramework/mff/mff.rc","start":5238194,"end":5244414},{"filename":"/Settings/Keywords/Asm","start":5244414,"end":5248681},{"filename":"/Settings/Keywords/Preprocessors","start":5248681,"end":5249901},{"filename":"/Settings/Keywords/Standard Data Types","start":5249901,"end":5250054},{"filename":"/Settings/Keywords/Statements And Operators","start":5250054,"end":5252823},{"filename":"/Settings/Keywords/User Defined","start":5252823,"end":5252823},{"filename":"/Settings/Languages/Arabic.lng","start":5252823,"end":5330403},{"filename":"/Settings/Languages/Czech.lng","start":5330403,"end":5405077},{"filename":"/Settings/Languages/Dutch.lng","start":5405077,"end":5479570},{"filename":"/Settings/Languages/English.lng","start":5479570,"end":5546902},{"filename":"/Settings/Languages/French-AI.lng","start":5546902,"end":5662807},{"filename":"/Settings/Languages/French.lng","start":5662807,"end":5762575},{"filename":"/Settings/Languages/Italian-AI.lng","start":5762575,"end":5874995},{"filename":"/Settings/Languages/Italian.lng","start":5874995,"end":5988657},{"filename":"/Settings/Languages/Portuguese-AI.lng","start":5988657,"end":6100104},{"filename":"/Settings/Languages/Readme.txt","start":6100104,"end":6100821},{"filename":"/Settings/Languages/Spain-AI.lng","start":6100821,"end":6214512},{"filename":"/Settings/Languages/Ukrainian.lng","start":6214512,"end":6292255},{"filename":"/Settings/Languages/chinese((Traditional).lng","start":6292255,"end":6408144},{"filename":"/Settings/Languages/chinese(Simplified).lng","start":6408144,"end":6523343},{"filename":"/Settings/Languages/default.lng","start":6523343,"end":6590675},{"filename":"/Settings/Languages/english.html","start":6590675,"end":6661265},{"filename":"/Settings/Languages/german.lng","start":6661265,"end":6774307},{"filename":"/Settings/Languages/polish.lng","start":6774307,"end":6856944},{"filename":"/Settings/Languages/russian.lng","start":6856944,"end":6909996},{"filename":"/Settings/Languages/spanish.lng","start":6909996,"end":6991313},{"filename":"/Settings/Languages/swabian.lng","start":6991313,"end":7061610},{"filename":"/Settings/Languages/tester.lng","start":7061610,"end":7121970},{"filename":"/Settings/Languages/uzbekcyril.lng","start":7121970,"end":7257014},{"filename":"/Settings/Languages/uzbeklatin.lng","start":7257014,"end":7364544},{"filename":"/Settings/Others/AsmKeywordsHelp.txt","start":7364544,"end":7375439},{"filename":"/Settings/Others/Compiler error messages.txt","start":7375439,"end":7392351},{"filename":"/Settings/Others/Compiler options.chinese(Simplified).txt","start":7392351,"end":7398990},{"filename":"/Settings/Others/Compiler options.chinese(Traditional).txt","start":7398990,"end":7405613},{"filename":"/Settings/Others/Compiler options.txt","start":7405613,"end":7410939},{"filename":"/Settings/Others/HotKeys.txt","start":7410939,"end":7412791},{"filename":"/Settings/Others/Intel 80x86 Assembly Language OpCodes.mhtml","start":7412791,"end":7629863},{"filename":"/Settings/Others/KeywordsHelp.chinese(Simplified).txt","start":7629863,"end":10353517},{"filename":"/Settings/Others/KeywordsHelp.chinese(Traditional).txt","start":10353517,"end":13085838},{"filename":"/Settings/Others/KeywordsHelp.txt","start":13085838,"end":15853089},{"filename":"/Settings/Others/Properties.txt","start":15853089,"end":15878112},{"filename":"/Settings/Others/compiler error message.html","start":15878112,"end":15919889},{"filename":"/Settings/Others/property message.html","start":15919889,"end":15970618},{"filename":"/Settings/Snippets/Default.ini","start":15970618,"end":15976383},{"filename":"/Settings/Themes/Dark (Visual Studio).ini","start":15976383,"end":15982501},{"filename":"/Settings/Themes/Default Theme.ini","start":15982501,"end":15987938},{"filename":"/Settings/Themes/Interface/Dark.ini","start":15987938,"end":15988020},{"filename":"/Settings/Themes/a11y-dark.ini","start":15988020,"end":15990560},{"filename":"/Settings/Themes/a11y-light.ini","start":15990560,"end":15993081},{"filename":"/Settings/Themes/agate.ini","start":15993081,"end":15995568},{"filename":"/Settings/Themes/an-old-hope.ini","start":15995568,"end":15998100},{"filename":"/Settings/Themes/androidstudio.ini","start":15998100,"end":16000648},{"filename":"/Settings/Themes/arduino-light.ini","start":16000648,"end":16003193},{"filename":"/Settings/Themes/arta.ini","start":16003193,"end":16005672},{"filename":"/Settings/Themes/ascetic.ini","start":16005672,"end":16008191},{"filename":"/Settings/Themes/atelier-cave-dark.ini","start":16008191,"end":16010727},{"filename":"/Settings/Themes/atelier-cave-light.ini","start":16010727,"end":16013254},{"filename":"/Settings/Themes/atelier-dune-dark.ini","start":16013254,"end":16015797},{"filename":"/Settings/Themes/atelier-dune-light.ini","start":16015797,"end":16018324},{"filename":"/Settings/Themes/atelier-estuary-dark.ini","start":16018324,"end":16020860},{"filename":"/Settings/Themes/atelier-estuary-light.ini","start":16020860,"end":16023388},{"filename":"/Settings/Themes/atelier-forest-dark.ini","start":16023388,"end":16025934},{"filename":"/Settings/Themes/atelier-forest-light.ini","start":16025934,"end":16028462},{"filename":"/Settings/Themes/atelier-heath-dark.ini","start":16028462,"end":16031003},{"filename":"/Settings/Themes/atelier-heath-light.ini","start":16031003,"end":16033531},{"filename":"/Settings/Themes/atelier-lakeside-dark.ini","start":16033531,"end":16036071},{"filename":"/Settings/Themes/atelier-lakeside-light.ini","start":16036071,"end":16038599},{"filename":"/Settings/Themes/atelier-plateau-dark.ini","start":16038599,"end":16041136},{"filename":"/Settings/Themes/atelier-plateau-light.ini","start":16041136,"end":16043663},{"filename":"/Settings/Themes/atelier-savanna-dark.ini","start":16043663,"end":16046198},{"filename":"/Settings/Themes/atelier-savanna-light.ini","start":16046198,"end":16048728},{"filename":"/Settings/Themes/atelier-seaside-dark.ini","start":16048728,"end":16051272},{"filename":"/Settings/Themes/atelier-seaside-light.ini","start":16051272,"end":16053803},{"filename":"/Settings/Themes/atelier-sulphurpool-dark.ini","start":16053803,"end":16056346},{"filename":"/Settings/Themes/atelier-sulphurpool-light.ini","start":16056346,"end":16058877},{"filename":"/Settings/Themes/atom-one-dark-reasonable.ini","start":16058877,"end":16061438},{"filename":"/Settings/Themes/atom-one-dark.ini","start":16061438,"end":16063983},{"filename":"/Settings/Themes/atom-one-light.ini","start":16063983,"end":16066517},{"filename":"/Settings/Themes/brown-paper.ini","start":16066517,"end":16069073},{"filename":"/Settings/Themes/codepen-embed.ini","start":16069073,"end":16071552},{"filename":"/Settings/Themes/color-brewer.ini","start":16071552,"end":16074057},{"filename":"/Settings/Themes/darcula.ini","start":16074057,"end":16076590},{"filename":"/Settings/Themes/dark.ini","start":16076590,"end":16079102},{"filename":"/Settings/Themes/default.ini","start":16079102,"end":16081660},{"filename":"/Settings/Themes/docco.ini","start":16081660,"end":16084188},{"filename":"/Settings/Themes/dracula.ini","start":16084188,"end":16086738},{"filename":"/Settings/Themes/far.ini","start":16086738,"end":16089226},{"filename":"/Settings/Themes/foundation.ini","start":16089226,"end":16091727},{"filename":"/Settings/Themes/github-gist.ini","start":16091727,"end":16094263},{"filename":"/Settings/Themes/github.ini","start":16094263,"end":16096771},{"filename":"/Settings/Themes/gml.ini","start":16096771,"end":16099301},{"filename":"/Settings/Themes/googlecode.ini","start":16099301,"end":16101804},{"filename":"/Settings/Themes/gradient-dark.ini","start":16101804,"end":16104322},{"filename":"/Settings/Themes/grayscale.ini","start":16104322,"end":16106827},{"filename":"/Settings/Themes/gruvbox-dark.ini","start":16106827,"end":16109379},{"filename":"/Settings/Themes/gruvbox-light.ini","start":16109379,"end":16111935},{"filename":"/Settings/Themes/hopscotch.ini","start":16111935,"end":16114466},{"filename":"/Settings/Themes/hybrid.ini","start":16114466,"end":16117014},{"filename":"/Settings/Themes/idea.ini","start":16117014,"end":16119503},{"filename":"/Settings/Themes/ir-black.ini","start":16119503,"end":16122043},{"filename":"/Settings/Themes/isbl-editor-dark.ini","start":16122043,"end":16124604},{"filename":"/Settings/Themes/isbl-editor-light.ini","start":16124604,"end":16127132},{"filename":"/Settings/Themes/kimbie.dark.ini","start":16127132,"end":16129679},{"filename":"/Settings/Themes/kimbie.light.ini","start":16129679,"end":16132210},{"filename":"/Settings/Themes/lightfair.ini","start":16132210,"end":16134765},{"filename":"/Settings/Themes/lioshi.ini","start":16134765,"end":16137301},{"filename":"/Settings/Themes/magula.ini","start":16137301,"end":16139814},{"filename":"/Settings/Themes/mono-blue.ini","start":16139814,"end":16142342},{"filename":"/Settings/Themes/monokai-sublime.ini","start":16142342,"end":16144891},{"filename":"/Settings/Themes/monokai.ini","start":16144891,"end":16147418},{"filename":"/Settings/Themes/night-owl.ini","start":16147418,"end":16149934},{"filename":"/Settings/Themes/nnfx-dark.ini","start":16149934,"end":16152434},{"filename":"/Settings/Themes/nnfx.ini","start":16152434,"end":16154933},{"filename":"/Settings/Themes/nord.ini","start":16154933,"end":16157481},{"filename":"/Settings/Themes/obsidian.ini","start":16157481,"end":16160028},{"filename":"/Settings/Themes/ocean.ini","start":16160028,"end":16162560},{"filename":"/Settings/Themes/paraiso-dark.ini","start":16162560,"end":16165106},{"filename":"/Settings/Themes/paraiso-light.ini","start":16165106,"end":16167639},{"filename":"/Settings/Themes/pojoaque.ini","start":16167639,"end":16170181},{"filename":"/Settings/Themes/purebasic.ini","start":16170181,"end":16172691},{"filename":"/Settings/Themes/qtcreator_dark.ini","start":16172691,"end":16175194},{"filename":"/Settings/Themes/qtcreator_light.ini","start":16175194,"end":16177742},{"filename":"/Settings/Themes/railscasts.ini","start":16177742,"end":16180288},{"filename":"/Settings/Themes/rainbow.ini","start":16180288,"end":16182823},{"filename":"/Settings/Themes/routeros.ini","start":16182823,"end":16185379},{"filename":"/Settings/Themes/school-book.ini","start":16185379,"end":16187935},{"filename":"/Settings/Themes/shades-of-purple.ini","start":16187935,"end":16190483},{"filename":"/Settings/Themes/solarized-dark.ini","start":16190483,"end":16192998},{"filename":"/Settings/Themes/solarized-light.ini","start":16192998,"end":16195528},{"filename":"/Settings/Themes/srcery.ini","start":16195528,"end":16198060},{"filename":"/Settings/Themes/sunburst.ini","start":16198060,"end":16200611},{"filename":"/Settings/Themes/tomorrow-night-blue.ini","start":16200611,"end":16203101},{"filename":"/Settings/Themes/tomorrow-night-bright.ini","start":16203101,"end":16205634},{"filename":"/Settings/Themes/tomorrow-night-eighties.ini","start":16205634,"end":16208166},{"filename":"/Settings/Themes/tomorrow-night.ini","start":16208166,"end":16210698},{"filename":"/Settings/Themes/tomorrow.ini","start":16210698,"end":16213228},{"filename":"/Settings/Themes/vs.ini","start":16213228,"end":16215746},{"filename":"/Settings/Themes/vs2015.ini","start":16215746,"end":16218289},{"filename":"/Settings/Themes/xcode.ini","start":16218289,"end":16220789},{"filename":"/Settings/Themes/xt256.ini","start":16220789,"end":16223322},{"filename":"/Settings/Themes/zenburn.ini","start":16223322,"end":16225859},{"filename":"/Settings/VisualFBEditor32.ini","start":16225859,"end":16239064},{"filename":"/Settings/VisualFBEditor64.ini","start":16239064,"end":16251907},{"filename":"/Settings/VisualFBEditorAndroid.ini","start":16251907,"end":16252150},{"filename":"/Settings/VisualFBEditorX64_gtk2.ini","start":16252150,"end":16257448},{"filename":"/Settings/VisualFBEditorX64_gtk3.ini","start":16257448,"end":16262891},{"filename":"/Settings/VisualFBEditorX64_gtk4.ini","start":16262891,"end":16268334},{"filename":"/Templates/Files/Form.frm","start":16268334,"end":16269150},{"filename":"/Templates/Files/Form_3D.frm","start":16269150,"end":16274714},{"filename":"/Templates/Files/Include File.bi","start":16274714,"end":16274717},{"filename":"/Templates/Files/Manifest.xml","start":16274717,"end":16276273},{"filename":"/Templates/Files/Module.bas","start":16276273,"end":16276276},{"filename":"/Templates/Files/Report.rpt","start":16276276,"end":16280803},{"filename":"/Templates/Files/Resource.rc","start":16280803,"end":16282745},{"filename":"/Templates/Files/User Control.bas","start":16282745,"end":16282913},{"filename":"/Templates/Projects/Addin Project.vfp","start":16282913,"end":16283601},{"filename":"/Templates/Projects/Addin Project/Module1.bas","start":16283601,"end":16290114},{"filename":"/Templates/Projects/Console Application.vfp","start":16290114,"end":16290852},{"filename":"/Templates/Projects/Console Application/Module1.bas","start":16290852,"end":16291051},{"filename":"/Templates/Projects/Control Library.vfp","start":16291051,"end":16291794},{"filename":"/Templates/Projects/Control Library/UserControl1.bas","start":16291794,"end":16291962},{"filename":"/Templates/Projects/Dynamic Library.vfp","start":16291962,"end":16292654},{"filename":"/Templates/Projects/Dynamic Library/Module1.bas","start":16292654,"end":16292657},{"filename":"/Templates/Projects/Empty Project.vfp","start":16292657,"end":16292660},{"filename":"/Templates/Projects/GTK Application.vfp","start":16292660,"end":16293537},{"filename":"/Templates/Projects/GTK Application/Form1.bas","start":16293537,"end":16295430},{"filename":"/Templates/Projects/GUI Application.vfp","start":16295430,"end":16296309},{"filename":"/Templates/Projects/GUI Application/Form1.frm","start":16296309,"end":16297125},{"filename":"/Templates/Projects/Static Library.vfp","start":16297125,"end":16297816},{"filename":"/Templates/Projects/Static Library/Module1.bas","start":16297816,"end":16297819},{"filename":"/Templates/Projects/Windows Application.vfp","start":16297819,"end":16298511},{"filename":"/Templates/Projects/Windows Application/Form1.bas","start":16298511,"end":16299677},{"filename":"/VisualFBEditor.rc","start":16299677,"end":16306704},{"filename":"/mff.rc","start":16306704,"end":16308700}],"remote_package_size":16308700})})();var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);if(typeof module!="undefined"){module["exports"]=Module}process.on("uncaughtException",function(ex){if(ex!=="unwind"&&!(ex instanceof ExitStatus)&&!(ex.context instanceof ExitStatus)){throw ex}});var nodeMajor=process.versions.node.split(".")[0];if(nodeMajor<15){process.on("unhandledRejection",function(reason){throw reason})}quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="VisualFBEditor.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(binaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(binaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(binaryFile)})}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}else{return instantiateArrayBuffer(binaryFile,imports,callback)}}function createWasm(){var info={"env":wasmImports,"wasi_snapshot_preview1":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;exports=Asyncify.instrumentWasmExports(exports);Module["asm"]=exports;wasmMemory=Module["asm"]["memory"];updateMemoryViews();wasmTable=Module["asm"]["__indirect_function_table"];addOnInit(Module["asm"]["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return exports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult);return{}}var tempDouble;var tempI64;var compilerSettings={"ASSERTIONS":0,"RUNTIME_LOGGING":false,"STACK_OVERFLOW_CHECK":0,"VERBOSE":false,"INVOKE_RUN":true,"EXIT_RUNTIME":false,"STACK_SIZE":8388608,"MALLOC":"dlmalloc","ABORTING_MALLOC":0,"INITIAL_MEMORY":67108864,"MAXIMUM_MEMORY":2147483648,"ALLOW_MEMORY_GROWTH":1,"MEMORY_GROWTH_GEOMETRIC_STEP":.2,"MEMORY_GROWTH_GEOMETRIC_CAP":100663296,"MEMORY_GROWTH_LINEAR_STEP":-1,"MEMORY64":0,"INITIAL_TABLE":-1,"ALLOW_TABLE_GROWTH":false,"GLOBAL_BASE":1024,"USE_CLOSURE_COMPILER":false,"CLOSURE_WARNINGS":"quiet","IGNORE_CLOSURE_COMPILER_ERRORS":false,"DECLARE_ASM_MODULE_EXPORTS":true,"INLINING_LIMIT":false,"SUPPORT_BIG_ENDIAN":false,"SAFE_HEAP":0,"SAFE_HEAP_LOG":false,"EMULATE_FUNCTION_POINTER_CASTS":false,"EXCEPTION_DEBUG":false,"DEMANGLE_SUPPORT":false,"LIBRARY_DEBUG":false,"SYSCALL_DEBUG":false,"SOCKET_DEBUG":false,"DYLINK_DEBUG":false,"FS_DEBUG":false,"SOCKET_WEBRTC":false,"WEBSOCKET_URL":"ws:#","PROXY_POSIX_SOCKETS":false,"WEBSOCKET_SUBPROTOCOL":"binary","OPENAL_DEBUG":false,"WEBSOCKET_DEBUG":false,"GL_ASSERTIONS":false,"TRACE_WEBGL_CALLS":false,"GL_DEBUG":false,"GL_TESTING":false,"GL_MAX_TEMP_BUFFER_SIZE":2097152,"GL_UNSAFE_OPTS":true,"FULL_ES2":false,"GL_EMULATE_GLES_VERSION_STRING_FORMAT":true,"GL_EXTENSIONS_IN_PREFIXED_FORMAT":true,"GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS":true,"GL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS":true,"GL_TRACK_ERRORS":true,"GL_SUPPORT_EXPLICIT_SWAP_CONTROL":false,"GL_POOL_TEMP_BUFFERS":true,"WORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG":0,"GL_EXPLICIT_UNIFORM_LOCATION":false,"GL_EXPLICIT_UNIFORM_BINDING":false,"USE_WEBGL2":false,"MIN_WEBGL_VERSION":1,"MAX_WEBGL_VERSION":1,"WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION":false,"FULL_ES3":false,"LEGACY_GL_EMULATION":false,"GL_FFP_ONLY":false,"GL_PREINITIALIZED_CONTEXT":false,"USE_WEBGPU":false,"STB_IMAGE":false,"GL_DISABLE_HALF_FLOAT_EXTENSION_IF_BROKEN":false,"GL_WORKAROUND_SAFARI_GETCONTEXT_BUG":true,"JS_MATH":false,"POLYFILL_OLD_MATH_FUNCTIONS":0,"LEGACY_VM_SUPPORT":false,"ENVIRONMENT":"web,webview,worker,node","LZ4":false,"DISABLE_EXCEPTION_CATCHING":1,"EXPORT_EXCEPTION_HANDLING_HELPERS":false,"EXCEPTION_STACK_TRACES":false,"DISABLE_EXCEPTION_THROWING":false,"NODEJS_CATCH_EXIT":true,"NODEJS_CATCH_REJECTION":true,"ASYNCIFY":1,"ASYNCIFY_IGNORE_INDIRECT":false,"ASYNCIFY_STACK_SIZE":1048576,"ASYNCIFY_ADVISE":false,"ASYNCIFY_LAZY_LOAD_CODE":false,"ASYNCIFY_DEBUG":0,"CASE_INSENSITIVE_FS":1,"FILESYSTEM":true,"FORCE_FILESYSTEM":1,"NODERAWFS":false,"NODE_CODE_CACHING":false,"EXPORT_ALL":false,"EXPORT_KEEPALIVE":true,"RETAIN_COMPILER_SETTINGS":1,"INCLUDE_FULL_LIBRARY":false,"RELOCATABLE":false,"MAIN_MODULE":0,"SIDE_MODULE":0,"BUILD_AS_WORKER":false,"PROXY_TO_WORKER":false,"PROXY_TO_WORKER_FILENAME":"","PROXY_TO_PTHREAD":false,"LINKABLE":false,"STRICT":false,"IGNORE_MISSING_MAIN":true,"AUTO_ARCHIVE_INDEXES":true,"STRICT_JS":false,"WARN_ON_UNDEFINED_SYMBOLS":true,"ERROR_ON_UNDEFINED_SYMBOLS":0,"SMALL_XHR_CHUNKS":false,"HEADLESS":false,"DETERMINISTIC":false,"MODULARIZE":false,"EXPORT_ES6":false,"USE_ES6_IMPORT_META":true,"BENCHMARK":false,"EXPORT_NAME":"Module","DYNAMIC_EXECUTION":1,"BOOTSTRAPPING_STRUCT_INFO":false,"EMSCRIPTEN_TRACING":false,"USE_GLFW":2,"WASM":1,"STANDALONE_WASM":false,"BINARYEN_IGNORE_IMPLICIT_TRAPS":false,"BINARYEN_EXTRA_PASSES":"","WASM_ASYNC_COMPILATION":true,"DYNCALLS":1,"WASM_BIGINT":false,"EMIT_PRODUCERS_SECTION":false,"EMIT_EMSCRIPTEN_LICENSE":false,"LEGALIZE_JS_FFI":true,"USE_SDL":0,"USE_SDL_GFX":0,"USE_SDL_IMAGE":1,"USE_SDL_TTF":1,"USE_SDL_NET":1,"USE_ICU":false,"USE_ZLIB":false,"USE_BZIP2":false,"USE_GIFLIB":false,"USE_LIBJPEG":false,"USE_LIBPNG":false,"USE_REGAL":false,"USE_BOOST_HEADERS":false,"USE_BULLET":false,"USE_VORBIS":false,"USE_OGG":false,"USE_MPG123":false,"USE_FREETYPE":false,"USE_SDL_MIXER":1,"USE_HARFBUZZ":false,"USE_COCOS2D":0,"USE_MODPLUG":false,"USE_SQLITE3":false,"SHARED_MEMORY":false,"WASM_WORKERS":0,"AUDIO_WORKLET":0,"WEBAUDIO_DEBUG":0,"PTHREAD_POOL_SIZE":0,"PTHREAD_POOL_SIZE_STRICT":1,"PTHREAD_POOL_DELAY_LOAD":false,"DEFAULT_PTHREAD_STACK_SIZE":0,"PTHREADS_PROFILING":false,"ALLOW_BLOCKING_ON_MAIN_THREAD":true,"PTHREADS_DEBUG":false,"EVAL_CTORS":0,"TEXTDECODER":1,"EMBIND_STD_STRING_IS_UTF8":true,"OFFSCREENCANVAS_SUPPORT":false,"OFFSCREENCANVASES_TO_PTHREAD":"#canvas","OFFSCREEN_FRAMEBUFFER":false,"FETCH_SUPPORT_INDEXEDDB":true,"FETCH_DEBUG":false,"FETCH":false,"WASMFS":false,"SINGLE_FILE":false,"AUTO_JS_LIBRARIES":true,"AUTO_NATIVE_LIBRARIES":true,"MIN_FIREFOX_VERSION":65,"MIN_SAFARI_VERSION":140100,"MIN_IE_VERSION":2147483647,"MIN_EDGE_VERSION":2147483647,"MIN_CHROME_VERSION":75,"MIN_NODE_VERSION":101900,"SUPPORT_ERRNO":true,"MINIMAL_RUNTIME":0,"MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION":false,"MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION":false,"SUPPORT_LONGJMP":"emscripten","DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR":true,"HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS":true,"MINIFY_HTML":true,"MAYBE_WASM2JS":false,"ASAN_SHADOW_SIZE":-1,"USE_OFFSET_CONVERTER":false,"LOAD_SOURCE_MAP":false,"DEFAULT_TO_CXX":true,"PRINTF_LONG_DOUBLE":false,"WASM2C":false,"WASM2C_SANDBOXING":"full","SEPARATE_DWARF_URL":"","ERROR_ON_WASM_CHANGES_AFTER_LINK":false,"ABORT_ON_WASM_EXCEPTIONS":false,"PURE_WASI":false,"IMPORTED_MEMORY":false,"SPLIT_MODULE":false,"REVERSE_DEPS":"auto","AUTOLOAD_DYLIBS":true,"ALLOW_UNIMPLEMENTED_SYSCALLS":true,"TRUSTED_TYPES":false,"POLYFILL":true,"RUNTIME_DEBUG":0,"LEGACY_RUNTIME":false,"OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH":false,"TEST_MEMORY_GROWTH_FAILS":false,"TARGET_BASENAME":"VisualFBEditor","TARGET_JS_NAME":"VisualFBEditor.js","SYSCALLS_REQUIRE_FILESYSTEM":true,"AUTODEBUG":false,"WASM2JS":false,"UBSAN_RUNTIME":0,"USE_LSAN":false,"USE_ASAN":false,"EMBIND":false,"MAIN_READS_PARAMS":true,"FETCH_WORKER_FILE":"","WASI_MODULE_NAME":"wasi_snapshot_preview1","EMSCRIPTEN_VERSION":"3.1.36","USE_RTTI":true,"OPT_LEVEL":2,"DEBUG_LEVEL":0,"SHRINK_LEVEL":0,"EMIT_NAME_SECTION":false,"EMIT_SYMBOL_MAP":false,"WASM_BINARY_FILE":"VisualFBEditor.wasm","PTHREAD_WORKER_FILE":"","WASM_WORKER_FILE":"","AUDIO_WORKLET_FILE":"","SOURCE_MAP_BASE":"","MEM_INIT_IN_WASM":true,"SUPPORT_BASE64_EMBEDDING":false,"ENVIRONMENT_MAY_BE_WEB":true,"ENVIRONMENT_MAY_BE_WORKER":true,"ENVIRONMENT_MAY_BE_NODE":true,"ENVIRONMENT_MAY_BE_SHELL":false,"ENVIRONMENT_MAY_BE_WEBVIEW":true,"MINIFY_WASM_IMPORTS_AND_EXPORTS":false,"MINIFY_WASM_IMPORTED_MODULES":false,"MINIFY_WASM_EXPORT_NAMES":true,"TARGET_NOT_SUPPORTED":2147483647,"SUPPORTS_GLOBALTHIS":false,"SUPPORTS_PROMISE_ANY":false,"LTO":0,"CAN_ADDRESS_2GB":false,"SEPARATE_DWARF":false,"WASM_EXCEPTIONS":false,"EXPECT_MAIN":true,"EXPORT_READY_PROMISE":true,"MEMORYPROFILER":false,"GENERATE_SOURCE_MAP":false,"GENERATE_DWARF":false,"STACK_HIGH":0,"STACK_LOW":0,"HEAP_BASE":0,"HAS_MAIN":true,"LINK_AS_CXX":true,"TRANSPILE_TO_ES5":false,"STACK_FIRST":false,"HAVE_EM_ASM":true,"PTHREADS":false,"BULK_MEMORY":false,"AGGRESSIVE_VARIABLE_ELIMINATION":0,"ALIASING_FUNCTION_POINTERS":0,"ASM_JS":1,"BINARYEN":1,"BINARYEN_ASYNC_COMPILATION":true,"BINARYEN_MEM_MAX":2147483648,"BINARYEN_METHOD":"native-wasm","BINARYEN_PASSES":"","BINARYEN_SCRIPTS":"","BINARYEN_TRAP_MODE":-1,"BUILD_AS_SHARED_LIB":0,"DOUBLE_MODE":0,"ELIMINATE_DUPLICATE_FUNCTIONS":0,"ELIMINATE_DUPLICATE_FUNCTIONS_DUMP_EQUIVALENT_FUNCTIONS":0,"ELIMINATE_DUPLICATE_FUNCTIONS_PASSES":5,"EMITTING_JS":1,"EMIT_EMSCRIPTEN_METADATA":0,"ERROR_ON_MISSING_LIBRARIES":1,"EXPORT_BINDINGS":0,"EXPORT_FUNCTION_TABLES":0,"FAST_UNROLLED_MEMCPY_AND_MEMSET":0,"FINALIZE_ASM_JS":0,"FORCE_ALIGNED_MEMORY":0,"FUNCTION_POINTER_ALIGNMENT":2,"LLD_REPORT_UNDEFINED":1,"MEMFS_APPEND_TO_TYPED_ARRAYS":1,"MEMORY_GROWTH_STEP":-1,"MEM_INIT_METHOD":0,"PGO":0,"PRECISE_F32":0,"PRECISE_I64_MATH":1,"QUANTUM_SIZE":4,"RESERVED_FUNCTION_POINTERS":false,"RUNNING_JS_OPTS":0,"SAFE_SPLIT_MEMORY":0,"SAFE_STACK":0,"SEPARATE_ASM":0,"SEPARATE_ASM_MODULE_NAME":"","SHELL_FILE":"","SIMPLIFY_IFS":1,"SKIP_STACK_IN_SMALL":0,"SPLIT_MEMORY":0,"SWAPPABLE_ASM_MODULE":0,"TOTAL_MEMORY":67108864,"TOTAL_STACK":8388608,"UNALIGNED_MEMORY":0,"USES_DYNAMIC_ALLOC":1,"USE_PTHREADS":0,"WARN_UNALIGNED":0,"WASM_BACKEND":-1,"WASM_MEM_MAX":2147483648,"WASM_OBJECT_FILES":0,"WORKAROUND_IOS_9_RIGHT_SHIFT_BUG":0,"FOUR_GB":4294967296,"POINTER_SIZE":4,"STACK_ALIGN":16,"GL_POOL_TEMP_BUFFERS_SIZE":288};var ASM_CONSTS={404984:()=>{return typeof window!=="undefined"},405024:()=>{return __fb_rtlib.console.size_get()},405066:()=>{return __fb_rtlib.console.pos_get()},405107:($0,$1)=>{__fb_rtlib.console.writeSubs(UTF8ToString($0),$1)}};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function stringToNewUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function runAndAbortIfError(func){try{return func()}catch(e){abort(e)}}function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)}var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>{return PATH.normalize(l+"/"+r)}};function initRandomFill(){if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")}function randomFill(view){return(randomFill=initRandomFill())(view)}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open:function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close:function(stream){stream.tty.ops.fsync(stream.tty)},fsync:function(stream){stream.tty.ops.fsync(stream.tty)},read:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60)}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i])}}catch(e){throw new FS.ErrnoError(29)}if(length){stream.node.timestamp=Date.now()}return i}},default_tty_ops:{get_char:function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;try{bytesRead=fs.readSync(process.stdin.fd,buf,0,BUFSIZE,-1)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){abort()}var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray:function(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage:function(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size},write:function(stream,buffer,offset,length,position,canOwn){if(buffer.buffer===HEAP8.buffer){canOwn=false}if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position)}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(28)}return position},allocate:function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)},mmap:function(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}HEAP8.set(contents,ptr)}return{ptr:ptr,allocated:allocated}},msync:function(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0}}};function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al "+url):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}});if(dep)addRunDependency(dep)}var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(path,opts={})=>{path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:node=>{var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:(parentid,name)=>{var hash=0;name=name.toLowerCase();for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length},hashAddNode:node=>{var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:node=>{var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:(parent,name)=>{var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);name=name.toLowerCase();for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;nodeName=nodeName.toLowerCase();if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:(parent,name,mode,rdev)=>{var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:node=>{FS.hashRemoveNode(node)},isRoot:node=>{return node===node.parent},isMountpoint:node=>{return!!node.mounted},isFile:mode=>{return(mode&61440)===32768},isDir:mode=>{return(mode&61440)===16384},isLink:mode=>{return(mode&61440)===40960},isChrdev:mode=>{return(mode&61440)===8192},isBlkdev:mode=>{return(mode&61440)===24576},isFIFO:mode=>{return(mode&61440)===4096},isSocket:mode=>{return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:str=>{var flags=FS.flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:flag=>{var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:(node,perms)=>{if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:dir=>{var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:(dir,name)=>{try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:(dir,name,isdir)=>{var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:(node,flags)=>{if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:(fd_start=0,fd_end=FS.MAX_OPEN_FDS)=>{for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:fd=>FS.streams[fd],createStream:(stream,fd_start,fd_end)=>{if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(val){this.shared.flags=val}},position:{get:function(){return this.shared.position},set:function(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:fd=>{FS.streams[fd]=null},chrdev_stream_ops:{open:stream=>{var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:()=>{throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice:(dev,ops)=>{FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts:mount=>{var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:(populate,callback)=>{if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:(type,opts,mountpoint)=>{var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:mountpoint=>{var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:(parent,name)=>{return parent.node_ops.lookup(parent,name)},mknod:(path,mode,dev)=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:(path,mode)=>{mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:(path,mode)=>{mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:(path,mode)=>{var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}},mkdev:(path,mode,dev)=>{if(typeof dev=="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)},symlink:(oldpath,newpath)=>{if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63)}return parent.node_ops.symlink(parent,newname,oldpath)},rename:(old_path,new_path)=>{var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28)}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode)}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10)}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode)}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}},rmdir:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node)},readdir:path=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54)}return node.node_ops.readdir(node)},unlink:path=>{var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44)}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}parent.node_ops.unlink(parent,name);FS.destroyNode(node)},readlink:path=>{var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44)}if(!link.node_ops.readlink){throw new FS.ErrnoError(28)}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))},stat:(path,dontFollow)=>{var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44)}if(!node.node_ops.getattr){throw new FS.ErrnoError(63)}return node.node_ops.getattr(node)},lstat:path=>{return FS.stat(path,true)},chmod:(path,mode,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})},lchmod:(path,mode)=>{FS.chmod(path,mode,true)},fchmod:(fd,mode)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chmod(stream.node,mode)},chown:(path,uid,gid,dontFollow)=>{var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}node.node_ops.setattr(node,{timestamp:Date.now()})},lchown:(path,uid,gid)=>{FS.chown(path,uid,gid,true)},fchown:(fd,uid,gid)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}FS.chown(stream.node,uid,gid)},truncate:(path,len)=>{if(len<0){throw new FS.ErrnoError(28)}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(63)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28)}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})},ftruncate:(fd,len)=>{var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(28)}FS.truncate(stream.node,len)},utime:(path,atime,mtime)=>{var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})},open:(path,flags,mode)=>{if(path===""){throw new FS.ErrnoError(44)}flags=typeof flags=="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path=="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(44)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode)}}if(flags&512&&!created){FS.truncate(node,0)}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1}}return stream},close:stream=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null},isClosed:stream=>{return stream.fd===null},llseek:(stream,offset,whence)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70)}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position},read:(stream,buffer,offset,length,position)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.read){throw new FS.ErrnoError(28)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead},write:(stream,buffer,offset,length,position,canOwn)=>{if(length<0||position<0){throw new FS.ErrnoError(28)}if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31)}if(!stream.stream_ops.write){throw new FS.ErrnoError(28)}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(70)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten},allocate:(stream,offset,length)=>{if(FS.isClosed(stream)){throw new FS.ErrnoError(8)}if(offset<0||length<=0){throw new FS.ErrnoError(28)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138)}stream.stream_ops.allocate(stream,offset,length)},mmap:(stream,length,position,prot,flags)=>{if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43)}return stream.stream_ops.mmap(stream,length,position,prot,flags)},msync:(stream,buffer,offset,length,mmapFlags)=>{if(!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)},munmap:stream=>0,ioctl:(stream,cmd,arg)=>{if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile:(path,opts={})=>{opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile:(path,data,opts={})=>{opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir:path=>{var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories:()=>{FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices:()=>{FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:()=>{var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup:(parent,name)=>{var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams:()=>{if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError:()=>{if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.name="ErrnoError";this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"})},staticInit:()=>{FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS}},init:(input,output,error)=>{FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit:()=>{FS.init.initialized=false;for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}},getMode:(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode},findObject:(path,dontResolveLastLink)=>{var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null}return ret.object},analyzePath:(path,dontResolveLastLink)=>{try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret},createPath:(parent,path,canRead,canWrite)=>{parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current},createFile:(parent,name,properties,canRead,canWrite)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)},createDataFile:(parent,name,data,canRead,canWrite,canOwn)=>{var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent}var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node},createDevice:(parent,name,input,output)=>{var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:stream=>{stream.seekable=false},close:stream=>{if(output&&output.buffer&&output.buffer.length){output(10)}},read:(stream,buffer,offset,length,pos)=>{var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead},write:(stream,buffer,offset,length,pos)=>{for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(29)}}if(length){stream.node.timestamp=Date.now()}return i}});return FS.mkdev(path,mode,dev)},forceLoadFile:obj=>{if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length}catch(e){throw new FS.ErrnoError(29)}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}},createLazyFile:(parent,name,url,canRead,canWrite)=>{function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size}stream_ops.read=(stream,buffer,offset,length,position)=>{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node},createPreloadedFile:(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(Browser.handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat:function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAPU32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];HEAPU32[buf+96>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+104>>2]=tempI64[0],HEAP32[buf+108>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream}};function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))}function exitJS(status,implicit){EXITSTATUS=status;_proc_exit(status)}var _exit=exitJS;function maybeExit(){if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}}function callUserCallback(func){if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}}var Asyncify={instrumentWasmImports:function(imports){var ASYNCIFY_IMPORTS=["invoke_*","fd_sync","__wasi_fd_sync","__asyncjs__*","emscripten_idb_load","emscripten_idb_store","emscripten_idb_delete","emscripten_idb_exists","emscripten_idb_load_blob","emscripten_idb_store_blob","emscripten_sleep","emscripten_wget","emscripten_wget_data","emscripten_scan_registers","emscripten_lazy_load_code","_load_secondary_module","emscripten_fiber_swap","SDL_Delay","COMPILEONSERVER","MESSAGEBOX","SHOWINPUTBOX","SHOWFILEDIALOG","SHOWFONTDIALOG","SHOWCOLORDIALOG","PAGESLEEP","MODALWAIT","SHOWPOPUPMENU","CLIPBOARDGETTEXT"];for(var x in imports){(function(x){var original=imports[x];var sig=original.sig;if(typeof original=="function"){var isAsyncifyImport=original.isAsync||ASYNCIFY_IMPORTS.indexOf(x)>=0||x.startsWith("__asyncjs__")}})(x)}},instrumentWasmExports:function(exports){var ret={};for(var x in exports){(function(x){var original=exports[x];if(typeof original=="function"){ret[x]=function(){Asyncify.exportCallStack.push(x);try{return original.apply(null,arguments)}finally{if(!ABORT){var y=Asyncify.exportCallStack.pop();assert(y===x);Asyncify.maybeStopUnwind()}}}}else{ret[x]=original}})(x)}return ret},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:1048576,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function(funcName){var id=Asyncify.callStackNameToId[funcName];if(id===undefined){id=Asyncify.callStackId++;Asyncify.callStackNameToId[funcName]=id;Asyncify.callStackIdToName[id]=funcName}return id},maybeStopUnwind:function(){if(Asyncify.currData&&Asyncify.state===Asyncify.State.Unwinding&&Asyncify.exportCallStack.length===0){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_unwind);if(typeof Fibers!="undefined"){Fibers.trampoline()}}},whenDone:function(){return new Promise((resolve,reject)=>{Asyncify.asyncPromiseHandlers={resolve:resolve,reject:reject}})},allocateData:function(){var ptr=_malloc(12+Asyncify.StackSize);Asyncify.setDataHeader(ptr,ptr+12,Asyncify.StackSize);Asyncify.setDataRewindFunc(ptr);return ptr},setDataHeader:function(ptr,stack,stackSize){HEAP32[ptr>>2]=stack;HEAP32[ptr+4>>2]=stack+stackSize},setDataRewindFunc:function(ptr){var bottomOfCallStack=Asyncify.exportCallStack[0];var rewindId=Asyncify.getCallStackId(bottomOfCallStack);HEAP32[ptr+8>>2]=rewindId},getDataRewindFunc:function(ptr){var id=HEAP32[ptr+8>>2];var name=Asyncify.callStackIdToName[id];var func=Module["asm"][name];return func},doRewind:function(ptr){var start=Asyncify.getDataRewindFunc(ptr);return start()},handleSleep:function(startAsync){if(ABORT)return;if(Asyncify.state===Asyncify.State.Normal){var reachedCallback=false;var reachedAfterCallback=false;startAsync((handleSleepReturnValue=0)=>{if(ABORT)return;Asyncify.handleSleepReturnValue=handleSleepReturnValue;reachedCallback=true;if(!reachedAfterCallback){return}Asyncify.state=Asyncify.State.Rewinding;runAndAbortIfError(()=>_asyncify_start_rewind(Asyncify.currData));if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.resume()}var asyncWasmReturnValue,isError=false;try{asyncWasmReturnValue=Asyncify.doRewind(Asyncify.currData)}catch(err){asyncWasmReturnValue=err;isError=true}var handled=false;if(!Asyncify.currData){var asyncPromiseHandlers=Asyncify.asyncPromiseHandlers;if(asyncPromiseHandlers){Asyncify.asyncPromiseHandlers=null;(isError?asyncPromiseHandlers.reject:asyncPromiseHandlers.resolve)(asyncWasmReturnValue);handled=true}}if(isError&&!handled){throw asyncWasmReturnValue}});reachedAfterCallback=true;if(!reachedCallback){Asyncify.state=Asyncify.State.Unwinding;Asyncify.currData=Asyncify.allocateData();if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.pause()}runAndAbortIfError(()=>_asyncify_start_unwind(Asyncify.currData))}}else if(Asyncify.state===Asyncify.State.Rewinding){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_rewind);_free(Asyncify.currData);Asyncify.currData=null;Asyncify.sleepCallbacks.forEach(func=>callUserCallback(func))}else{abort("invalid state: "+Asyncify.state)}return Asyncify.handleSleepReturnValue},handleAsync:function(startAsync){return Asyncify.handleSleep(wakeUp=>{startAsync().then(wakeUp)})}};var mff={str:function(p){if(!p)return"";var data=HEAPU32[p>>2];return data?UTF8ToString(data):""},el:function(id){return document.getElementById(String(id))},color:function(v){if(v<0)return"";return"rgb("+(v&255)+", "+(v>>8&255)+", "+(v>>16&255)+")"},cannotWait:function(){return!!Asyncify.currData||Asyncify.exportCallStack.length>1},call:function(name,args){var f=Module["_"+name];if(f)return f.apply(null,args)},ownEvent:function(e){var path=e.composedPath?e.composedPath():[];if(path.length){for(var i=0;i<path.length&&path[i]!==e.currentTarget;i++){if(/^\d+$/.test(path[i].id||""))return false}return true}for(var x=e.target;x&&x!==e.currentTarget;x=x.parentElement){if(/^\d+$/.test(x.id))return false}return true},prevent:function(e){(e.mffPreventDefault||e.preventDefault).call(e)},shift:function(e){return(e.shiftKey?1:0)|(e.ctrlKey?2:0)|(e.altKey?4:0)},key:function(e){if(e.keyCode)return e.keyCode;return e.key&&e.key.length===1?e.key.charCodeAt(0):0},keys:function(){if(mff.keysOn)return;mff.keysOn=true;var control=function(x){while(x&&!/^\d+$/.test(x.id||""))x=x.parentElement;return x?Number(x.id):0};window.addEventListener("keydown",function(e){if(mff.modalWait||Asyncify.currData)return;var key=mff.key(e),shift=mff.shift(e);if(!key||key==16||key==17||key==18)return;var a=document.activeElement,typing=a&&(a.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName));if(typing&&!(shift&6)&&!(key>=112&&key<=135))return;if(typing&&shift&2&&!(shift&4)&&[8,35,36,37,38,39,40,45,46,65,67,86,88,89,90].indexOf(key)>=0)return;var item=mff.call("ONSHORTCUT",[control(a),key,shift]);if(!item)return;e.preventDefault();e.stopPropagation();setTimeout(function(){mff.call("ONSHORTCUTCLICK",[item])},0)},true);window.addEventListener("keydown",function(e){if(e.defaultPrevented||e.key!="Enter"&&e.key!="Escape"||e.shiftKey||e.ctrlKey||e.altKey)return;var a=e.target;if(!a||!(a.tagName=="SELECT"||a.tagName=="INPUT"&&!/^(button|submit|reset|checkbox|radio|file)$/.test(a.type)))return;var btn=mff.call("ONDIALOGKEY",[control(a),e.key=="Enter"?13:27]);if(!btn)return;e.preventDefault();setTimeout(function(){mff.call("ONCLICK",[btn])},0)});window.addEventListener("contextmenu",function(e){if(mff.modalWait||Asyncify.currData)return;var c=mff.call("ONCONTEXTMENU",[control(e.target)]);if(!c)return;e.preventDefault();var x=Math.round(e.clientX),y=Math.round(e.clientY);setTimeout(function(){mff.call("ONCONTEXTMENUPOPUP",[c,x,y])},0)})},list:function(e){if(!e||e.tagName!="INPUT")return e;var l=e.list;if(!l){l=document.createElement("datalist");l.id=e.id+"List";document.body.appendChild(l);e.setAttribute("list",l.id);e.addEventListener("mousedown",function(ev){if(ev.button!=0||ev.offsetX<e.clientWidth-18||e.disabled||e.readOnly)return;ev.preventDefault();e.focus();try{e.showPicker()}catch(err){}})}return l},items:function(e){return e.tagName=="SELECT"||e.tagName=="DATALIST"?e.options:e.querySelectorAll(":scope > .mffitem")},item:function(e,text){if(e.tagName=="SELECT"){var o=document.createElement("option");o.textContent=text;return o}if(e.tagName=="DATALIST"){var d=document.createElement("option");d.value=text;return d}var l=document.createElement("div");l.className="mffitem";l.style.cssText="display: block; white-space: nowrap;";var c=document.createElement("input");c.type=e.getAttribute("data-check")||"checkbox";if(c.type=="radio")c.name=String(e.id);l.appendChild(c);var t=document.createElement("span");t.className="mffnodetext";t.textContent=text;l.appendChild(t);mff.listInit(e);return l},listInit:function(e){if(e.mffListInit)return;e.mffListInit=true;e.addEventListener("mousedown",function(ev){var l=ev.target&&ev.target.closest?ev.target.closest(".mffitem"):null;if(!l||l.parentNode!==e)return;var index=Array.prototype.indexOf.call(mff.items(e),l);var old=e.hasAttribute("data-position")?Number(e.getAttribute("data-position")):-1;mff.listSelect(e,index);if(index!=old&&e.hasAttribute("data-mffchange"))mff.call("ONCHANGE",[e.id])})},imageURLs:{},findImage:function(sources,done){var key=sources.join("|"),url=mff.imageURLs[key];if(typeof url=="string"){if(url)done(url);return}if(url){url.push(done);return}var waiting=mff.imageURLs[key]=[done],i=0,img=new Image;img.onload=function(){mff.imageURLs[key]=sources[i];waiting.forEach(function(f){f(sources[i])})};img.onerror=function(){i++;if(i<sources.length)img.src=sources[i];else mff.imageURLs[key]=""};img.src=sources[0]},comboFace:function(e){var o=e.options[e.selectedIndex],url=o?o.getAttribute("data-img"):null;if(e.size>1)url=null;if(url){e.style.backgroundImage='url("'+url+'")';e.style.backgroundRepeat="no-repeat";e.style.backgroundPosition="3px center";e.style.backgroundSize="16px 16px";e.style.paddingLeft="21px"}else{e.style.backgroundImage="";e.style.paddingLeft=""}},comboInit:function(e){if(e.mffImages)return;e.mffImages=true;e.addEventListener("change",function(){mff.comboFace(e)});new MutationObserver(function(){mff.comboFace(e)}).observe(e,{attributes:true,attributeFilter:["size"]});e.addEventListener("mousedown",function(ev){if(e.size>1||e.disabled||ev.button!=0)return;ev.preventDefault();e.focus({preventScroll:true});mff.comboPopup(e)})},comboPopup:function(e){if(mff.comboList){var old=mff.comboList;mff.comboList=null;old.remove();if(old.mffOwner===e)return}var r=e.getBoundingClientRect(),list=document.createElement("div");list.className="mffcombolist";list.mffOwner=e;list.style.left=r.left+"px";list.style.minWidth=r.width+"px";var close=function(){if(mff.comboList!==list)return;mff.comboList=null;list.remove();document.removeEventListener("mousedown",outside,true)};var outside=function(ev){if(!list.contains(ev.target)&&ev.target!==e)close()};Array.prototype.forEach.call(e.options,function(o){var item=document.createElement("div");item.className="mffcomboitem"+(o.index==e.selectedIndex?" mffselected":"");item.style.paddingLeft=(o.mffIndent||0)*10+2+"px";var url=o.getAttribute("data-img");var img=document.createElement("span");img.className="mffcomboimage";if(url)img.style.backgroundImage='url("'+url+'")';item.appendChild(img);item.appendChild(document.createTextNode(o.text));item.addEventListener("mouseenter",function(){var s=list.querySelector(".mffselected");if(s)s.classList.remove("mffselected");item.classList.add("mffselected")});item.addEventListener("mousedown",function(ev){ev.preventDefault()});item.addEventListener("click",function(){close();if(e.selectedIndex!=o.index){e.selectedIndex=o.index;e.dispatchEvent(new Event("change",{bubbles:true}))}});list.appendChild(item)});document.body.appendChild(list);var h=list.offsetHeight;list.style.top=(r.bottom+h<=window.innerHeight||r.top<h?r.bottom:r.top-h)+"px";var sel=list.querySelector(".mffselected");if(sel)sel.scrollIntoView({block:"nearest"});mff.comboList=list;document.addEventListener("mousedown",outside,true);e.addEventListener("blur",close,{once:true})},listSelect:function(e,index){var items=mff.items(e);for(var i=0;i<items.length;i++)items[i].classList.toggle("mffselected",i==index);e.setAttribute("data-position",index)},tableFill:function(tr,cells,table){tr.innerHTML="";cells.split("\t").forEach(function(text,i){var td=document.createElement("td"),img=null,lines=null;if(i==0&&text.charAt(0)==""){var endLines=text.indexOf("",1);if(endLines>0){lines=text.substring(1,endLines);text=text.substring(endLines+1)}}if(i==0&&text.charAt(0)==""){var end=text.indexOf("",1);if(end>0){var sources=text.substring(1,end).split("|");img=document.createElement("img");img.className="mffitemimage";img.src=sources.shift();img.alt="";img.addEventListener("error",function(){if(sources.length)img.src=sources.shift();else img.style.visibility="hidden"});text=text.substring(end+1)}}td.style.cssText="border-right: 1px solid var(--mff-line, #ddd); border-bottom: 1px solid var(--mff-line, #ddd); padding: 1px 4px; white-space: nowrap;";var m=i==0?/^( *)([\u25BC\u25BA] )?/.exec(text):null;if(m&&(m[1].length>=2||m[2])){var level=Math.floor(m[1].length/4);td.style.paddingLeft=4+level*16+"px";var sign=document.createElement("span");sign.className="mfftoggle";if(m[2])sign.setAttribute("data-state",m[2].charAt(0)=="▼"?"open":"closed");td.appendChild(sign);text=text.substring(m[0].length).replace(/^ +/,"");if(lines)mff.treeLines(td,lines,m[2]?m[2].charAt(0):"")}var node=i==0&&m&&(m[1].length>=2||m[2]),tree=table&&table.classList.contains("mfftree");if(img&&!(node&&tree))td.appendChild(img);if(node){td.classList.add("mffnode");var span=document.createElement("span");span.className="mffnodetext";if(img&&tree)span.appendChild(img);span.appendChild(document.createTextNode(text));td.appendChild(span)}else td.appendChild(document.createTextNode(text));tr.appendChild(td)});var c=table?table.getAttribute("data-colorcolumn"):null;if(c!=null&&tr.cells[c]&&/color$/i.test(tr.cells[0].textContent.trim())){var v=parseInt(tr.cells[c].textContent,10);if(!isNaN(v)){var sq=document.createElement("span");sq.style.cssText="display: inline-block; width: 10px; height: 10px; border: 1px solid #000; margin: 0 3px 0 -1px; vertical-align: -1px; background: "+(v<0?"#fff":"rgb("+(v&255)+","+(v>>8&255)+","+(v>>16&255)+")")+";";tr.cells[c].insertBefore(sq,tr.cells[c].firstChild)}}},treeLines:function(td,lines,sign){td.style.position="relative";var n=lines.length-1,gap="calc(50% + 6px)";function line(x,top,bottom,width){var l=document.createElement("span");l.className=width?"mfftreeline mfftreelineh":"mfftreeline";l.style.left=x+"px";if(width){l.style.top="50%";l.style.width=width+"px"}else{l.style.top=top;l.style.bottom=bottom}td.insertBefore(l,td.firstChild)}for(var k=0;k<n;k++)if(lines.charAt(k)=="1")line(4+k*16+8,"0","0");var x=4+n*16+8,c=lines.charAt(n);if(sign){if(c=="T"||c=="L")line(x,"0",gap);if(c=="T"||c=="F")line(x,gap,"0");line(x+6,0,0,3)}else{if(c=="T")line(x,"0","0");else if(c=="L")line(x,"0","50%");else if(c=="F")line(x,"50%","0");line(x,0,0,9)}if(sign=="▼")line(x+16,"calc(50% + 8px)","0")},tableSelect:function(e,index){var rows=e.tBodies[0].rows;for(var i=0;i<rows.length;i++)rows[i].classList.toggle("mffselected",i==index);e.setAttribute("data-position",index)},ctx:function(id,create){var page=mff.pages[id];if(page)return page.getContext("2d");var e=mff.el(id);if(!e)return null;var c=e.querySelector(":scope > canvas.mffcanvas");if(!c){if(!create)return null;c=document.createElement("canvas");c.className="mffcanvas";c.style.cssText="position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none;";e.insertAdjacentElement("afterbegin",c);if(typeof ResizeObserver!=="undefined"){var w0=e.clientWidth,h0=e.clientHeight;new ResizeObserver(function(){if(e.clientWidth==w0&&e.clientHeight==h0)return;w0=e.clientWidth;h0=e.clientHeight;mff.call("ONPAINT",[id])}).observe(e)}}var dpr=window.devicePixelRatio||1;var w=Math.max(1,Math.round(e.clientWidth*dpr)),h=Math.max(1,Math.round(e.clientHeight*dpr));var g=c.getContext("2d");if(c.width!=w||c.height!=h){c.width=w;c.height=h;g.setTransform(dpr,0,0,dpr,0,0)}return g},pages:{},rgba:function(color,alpha){return"rgba("+(color&255)+", "+(color>>8&255)+", "+(color>>16&255)+", "+alpha/255+")"},font:function(name,size,bold,italic){return(italic?"italic ":"")+(bold?"bold ":"")+size+"px "+(name?"'"+name+"', ":"")+"sans-serif"},images:{},image:function(path,id){var img=mff.images[path];if(!img){img=new Image;img.waiting=[];img.onload=function(){img.waiting.forEach(function(w){mff.call("ONPAINT",[w])});img.waiting=[]};img.src=path;mff.images[path]=img}if(!img.complete&&img.waiting.indexOf(id)<0)img.waiting.push(id);return img},place:function(e,left,top){if(e.style.position=="relative"){e.style.left="";e.style.top="";e.style.marginLeft="0px";e.style.marginTop="0px"}else{e.style.left=left;e.style.top=top}},fitMainForm:function(e,Id){var pending=false;var term=document.getElementById("termContainer");function fit(){pending=false;var r=e.getBoundingClientRect();var x=r.left+window.scrollX,y=r.top+window.scrollY;var below=term&&term.offsetHeight?term.offsetHeight+x:0;var w=Math.max(100,Math.floor(document.documentElement.clientWidth-2*x));var h=Math.max(100,Math.floor(window.innerHeight-y-x-below));var bar=mff.el(String(Id)+"MainMenu");if(bar)bar.style.width=w+"px";if(w==e.offsetWidth&&h==e.offsetHeight)return;e.style.width=w+"px";e.style.height=h+"px";mff.call("ONRESIZE",[Id,w,h])}function request(){if(!pending){pending=true;requestAnimationFrame(fit)}}window.addEventListener("resize",request);if(typeof ResizeObserver!=="undefined"){new ResizeObserver(request).observe(document.documentElement);if(term)new ResizeObserver(request).observe(term)}setTimeout(fit,0)},on:function(id,event,handler){var e=mff.el(id);if(e)e.addEventListener(event,handler,false)},scrollBar:function(e){var dir=e.getAttribute("data-scrollbar");if(!dir)return false;if(!e.mffSpacer){var v=dir=="v";e.style.overflowX=v?"hidden":"scroll";e.style.overflowY=v?"scroll":"hidden";if(!e.hasAttribute("data-position"))e.setAttribute("data-position","0");var sp=document.createElement("div");sp.style.cssText=v?"width: 1px;":"height: 1px;";e.appendChild(sp);e.mffSpacer=sp;e.addEventListener("scroll",function(){var scroll=v?e.scrollTop:e.scrollLeft;if(e.mffScrollSet!==undefined&&Math.abs(scroll-e.mffScrollSet)<1)return;e.mffScrollSet=undefined;var min=Number(e.getAttribute("data-min")||0),max=Number(e.getAttribute("data-max")||0);var room=v?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;var pos=room>0?Math.round(min+scroll/room*(max-min)):min;if(pos==Number(e.getAttribute("data-position")))return;e.setAttribute("data-position",pos);mff.call("ONCHANGE",[Number(e.id)])});if(typeof ResizeObserver!=="undefined")new ResizeObserver(function(){mff.scrollBarLayout(e)}).observe(e)}return true},scrollBarLayout:function(e){if(!e.mffSpacer)return;var v=e.getAttribute("data-scrollbar")=="v";var min=Number(e.getAttribute("data-min")||0),max=Number(e.getAttribute("data-max")||0);var pos=Number(e.getAttribute("data-position")||0),range=Math.max(0,max-min);var size=v?e.clientHeight:e.clientWidth;if(size<=0)return;var page=Number(e.getAttribute("data-page")||0)||Math.max(1,range/10);var total=range>0?Math.round(size*(range+page)/page):size;if(v)e.mffSpacer.style.height=total+"px";else e.mffSpacer.style.width=total+"px";var scroll=range>0?Math.round((Math.min(max,Math.max(min,pos))-min)/range*(total-size)):0;if((v?e.scrollTop:e.scrollLeft)!=scroll){e.mffScrollSet=scroll;if(v)e.scrollTop=scroll;else e.scrollLeft=scroll}},mousePos:function(el,e){var r=el.getBoundingClientRect();if(el.mffDownRect&&r.width==0&&r.height==0&&!el.offsetParent)r=el.mffDownRect;if(el.tagName=="FIELDSET")return[Math.round(e.clientX-r.left),Math.round(e.clientY-r.top)];return[Math.round(e.clientX-r.left-el.clientLeft),Math.round(e.clientY-r.top-el.clientTop)]},mouseIds:{move:{},up:{}},mouseCapture:function(){if(mff.captureOn)return;mff.captureOn=true;function captured(e){var id=mff.captureId;if(!id)return;var el=mff.el(id);if(!el){mff.captureId=0;return}e.mffDone=true;var p=mff.mousePos(el,e);if(e.type=="mousemove"){if(mff.mouseIds.move[id])mff.call("ONMOUSEMOVE",[id,e.buttons,p[0],p[1],mff.shift(e)])}else{mff.captureId=0;if(mff.mouseIds.up[id])mff.call("ONMOUSEUP",[id,e.button,p[0],p[1],mff.shift(e)])}}document.addEventListener("mousemove",captured,true);document.addEventListener("mouseup",captured,true)}};function _ADDSELECTITEM(Id,Text){var e=mff.list(mff.el(Id));if(e)e.insertBefore(mff.item(e,mff.str(Text)),null)}function _BUTTONSITEMLEFT(Id,Index){var e=mff.el(Id),row=e?e.querySelector(":scope > .mffbuttons"):null;var item=row?row.children[Index]:null;return item?item.offsetLeft+row.offsetLeft:-1}function _BUTTONSITEMWIDTH(Id,Index){var e=mff.el(Id),row=e?e.querySelector(":scope > .mffbuttons"):null;var item=row?row.children[Index]:null;return item?item.offsetWidth:-1}function _CANVASARC(Id,cx,cy,r,a1,a2,Negative){var g=mff.ctx(Id,true);if(g)g.arc(cx,cy,Math.max(0,r),a1,a2,!!Negative)}function _CANVASBEGIN(Id){var g=mff.ctx(Id,false);if(!g)return;g.save();g.setTransform(1,0,0,1,0,0);g.clearRect(0,0,g.canvas.width,g.canvas.height);g.restore();g.beginPath()}function _CANVASCLIP(Id){var g=mff.ctx(Id,false);if(g){g.clip();g.beginPath()}}function _CANVASCLOSEPATH(Id){var g=mff.ctx(Id,false);if(g)g.closePath()}function _CANVASCURVETO(Id,x1,y1,x2,y2,x3,y3){var g=mff.ctx(Id,true);if(g)g.bezierCurveTo(x1,y1,x2,y2,x3,y3)}function _CANVASEND(Id){}function _CANVASFILL(Id,Color,Alpha){var g=mff.ctx(Id,true);if(!g)return;g.fillStyle=mff.rgba(Color,Alpha);g.fill()}function _CANVASFILLRECT(Id,x,y,w,h,Color,Alpha){var g=mff.ctx(Id,true);if(!g)return;g.fillStyle=mff.rgba(Color,Alpha);g.fillRect(x,y,w,h)}function _CANVASIMAGE(Id,Path,x,y,w,h,Alpha){var g=mff.ctx(Id,true);if(!g)return;var img=mff.image(mff.str(Path),Id);if(!img.complete||!img.naturalWidth)return;g.save();g.globalAlpha=Alpha/255;g.drawImage(img,x,y,w<0?img.naturalWidth:w,h<0?img.naturalHeight:h);g.restore()}function _CANVASINVERTRECT(Id,x,y,w,h){var g=mff.ctx(Id,true);if(!g)return;g.save();g.globalCompositeOperation="difference";g.fillStyle="#fff";g.fillRect(x,y,w,h);g.restore()}function _CANVASLINETO(Id,x,y){var g=mff.ctx(Id,true);if(g)g.lineTo(x,y)}function _CANVASMOVETO(Id,x,y){var g=mff.ctx(Id,true);if(g)g.moveTo(x,y)}function _CANVASNEWPATH(Id){var g=mff.ctx(Id,false);if(g)g.beginPath()}function _CANVASRECTPATH(Id,x,y,w,h){var g=mff.ctx(Id,true);if(g)g.rect(x,y,w,h)}function _CANVASRESTORE(Id){var g=mff.ctx(Id,false);if(g)g.restore()}function _CANVASROTATE(Id,x,y,Angle){var g=mff.ctx(Id,true);if(!g)return;g.translate(x,y);g.rotate(-Angle*Math.PI/180);g.translate(-x,-y)}function _CANVASSAVE(Id){var g=mff.ctx(Id,true);if(g)g.save()}function _CANVASSTROKE(Id,Color,Alpha,LineWidth,Dash){var g=mff.ctx(Id,true);if(!g)return;var d=mff.str(Dash);g.setLineDash(d==""?[]:d.split(",").map(Number));g.strokeStyle=mff.rgba(Color,Alpha);g.lineWidth=LineWidth>0?LineWidth:1;g.stroke()}function _CANVASTEXT(Id,x,y,Text,Color,BkColor,FontName,FontSize,Bold,Italic){var g=mff.ctx(Id,true);if(!g)return;var s=mff.str(Text);g.font=mff.font(mff.str(FontName),FontSize,Bold,Italic);g.textBaseline="top";if(BkColor>=0){g.fillStyle=mff.rgba(BkColor,255);g.fillRect(x,y,g.measureText(s).width,FontSize*1.2)}g.fillStyle=mff.rgba(Color,255);g.fillText(s,x,y)}function _CANVASTEXTHEIGHT(Id,FontName,FontSize,Bold,Italic){return Math.ceil(FontSize*1.2)}function _CANVASTEXTWIDTH(Id,Text,FontName,FontSize,Bold,Italic){var g=mff.ctx(Id,false)||(mff.measure=mff.measure||document.createElement("canvas").getContext("2d"));g.font=mff.font(mff.str(FontName),FontSize,Bold,Italic);return Math.ceil(g.measureText(mff.str(Text)).width)}function _CLEARSELECTITEMS(Id){var e=mff.list(mff.el(Id));if(!e)return;var items=mff.items(e);for(var i=items.length-1;i>=0;i--)e.removeChild(items[i])}function _CLIPBOARDGETTEXT(){return Asyncify.handleSleep(function(wakeUp){var done=function(s){wakeUp(s==null?0:stringToNewUTF8(s))};if(!navigator.clipboard||!navigator.clipboard.readText)return done(mff.clipboard);navigator.clipboard.readText().then(done,function(){done(mff.clipboard)})})}_CLIPBOARDGETTEXT.isAsync=true;function _CLIPBOARDSETTEXT(Text){mff.clipboard=mff.str(Text);if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(mff.clipboard).catch(function(){})}function _COMPILEONSERVER(Root,MainFile,Options,RunPage){if(Asyncify.state===Asyncify.State.Normal&&mff.cannotWait())return 0;return Asyncify.handleSleep(function(wakeUp){var root=mff.str(Root).replace(/\\/g,"/"),main=mff.str(MainFile).replace(/\\/g,"/");if(root.slice(-1)!="/")root+="/";var server=new URLSearchParams(location.search).get("server")||location.origin+"/";if(server.slice(-1)!="/")server+="/";if(!Module.webCompileId)Module.webCompileId=Math.random().toString(36).slice(2,12);var enc=new TextEncoder,parts=[],total=0;var mainName=main.substring(main.lastIndexOf("/")+1).replace(/\.[^.]*$/,"").toLowerCase();var skip=/\.(exe|dll|o|obj|wasm|data|pdb|zip|7z|rar|log)$/i;var line=function(s){parts.push(enc.encode(s.replace(/[\r\n]+/g," ")+"\n"))};var walk=function(dir,rel,depth){var names;try{names=FS.readdir(dir)}catch(err){return}names.forEach(function(n){if(n=="."||n=="..")return;var p=dir+n,st;try{st=FS.stat(p)}catch(err){return}if(FS.isDir(st.mode)){if(depth<8&&n.charAt(0)!=".")walk(p+"/",rel+n+"/",depth+1);return}var base=n.replace(/\.[^.]*$/,"").toLowerCase(),ext=n.substring(base.length).toLowerCase();if(skip.test(n)||base==mainName&&(ext==".html"||ext==".js"||ext==".c"))return;if(st.size>16<<20||total+st.size>64<<20)return;var data=FS.readFile(p);total+=data.length;line("file "+data.length+" "+rel+n);parts.push(data,enc.encode("\n"))})};line("VFBE-WEBCOMPILE 1");line("id "+Module.webCompileId);line("root "+root);line("main "+(main.indexOf(root)==0?main.substring(root.length):main));line("options "+mff.str(Options));walk(root,"",0);line("end");var win=null;if(RunPage){win=window.open("","_blank");if(win)win.document.title="Compiling..."}fetch(server+"compile",{method:"POST",body:new Blob(parts)}).then(function(r){return r.text().then(function(t){return r.ok||/^result=/.test(t)?t:"result=0\nerror="+server+"compile: "+r.status+" "+r.statusText+"\n"})},function(err){return"result=0\nerror="+server+"compile: "+(err&&err.message||err)+"\n"}).then(function(t){var page=/^page=(.*)$/m.exec(t),url="";if(/^result=1$/m.test(t)&&page){url=new URL(page[1],server).href;if(!Module.webPages)Module.webPages={};Module.webPages[main.toLowerCase()]=url}if(win){if(url)win.location.href=url;else win.close()}wakeUp(stringToNewUTF8(t))})})}_COMPILEONSERVER.isAsync=true;function _CREATEELEMENT(AddPosition,ClassName,Class,Type,Id,Name,Text,Style,PositionType,Left,Top,Width,Height,Right,Bottom,Parent){mff.keys();var strType=mff.str(Type);var strText=mff.str(Text);var strClass=mff.str(Class);var e=document.createElement(mff.str(ClassName)||"div");if(strType!="")e.type=strType;if(strType=="text"||strType=="password"||e.tagName=="TEXTAREA"){e.value=strText;if(typeof Terminal!=="undefined"&&Terminal.prototype.globals&&Terminal.prototype.globals.activeTerm)Terminal.prototype.globals.activeTerm.lock=true}else{e.innerHTML=strText}e.id=String(Id);e.name=mff.str(Name);e.className=strClass;if(/(^| )mffrichtext( |$)/.test(strClass))e.contentEditable="true";e.style.cssText=mff.str(Style);if(e.style.display&&e.style.display!="none")e.setAttribute("data-display",e.style.display);e.style.position=mff.str(PositionType);mff.place(e,mff.str(Left),mff.str(Top));e.style.width=mff.str(Width);e.style.height=mff.str(Height);e.style.right=mff.str(Right);e.style.bottom=mff.str(Bottom);e.style.boxSizing="border-box";var parent=Parent?mff.el(String(Parent)+"Client")||mff.el(Parent):null;(parent||document.body).insertAdjacentElement(mff.str(AddPosition)||"beforeend",e);if(e.tagName=="INPUT"&&e.classList.contains("mffcombo"))mff.list(e);if(e.style.position=="relative")mff.fitMainForm(e,Id);if(strClass.indexOf("vetdialog box")>=0||/(^| )mffdialog( |$)/.test(strClass)){var header=mff.el(String(Id)+"Header");var design=/(^| )mffdesign( |$)/.test(strClass);if(header){var ch=header.offsetHeight;if(/px$/.test(e.style.height))e.style.height=Math.max(0,parseFloat(e.style.height)-ch)+"px";if(!design)e.style.top=(parseFloat(e.style.top)||0)+ch+"px"}if(header&&typeof dragElement==="function"&&!design)dragElement(header,e);if(design&&e.parentElement&&e.parentElement!==document.body)e.parentElement.style.overflow="auto";var close=mff.el(String(Id)+"CloseButton");if(close&&!design)close.onclick=function(){mff.call("ONCLOSE",[Id])};var min=mff.el(String(Id)+"MinButton"),max=mff.el(String(Id)+"MaxButton");if(min&&!design)min.onclick=function(){mff.call("ONCAPTIONBUTTON",[Id,1])};if(max&&!design)max.onclick=function(){mff.call("ONCAPTIONBUTTON",[Id,2])};if(header&&max&&!design)header.addEventListener("dblclick",function(ev){if(ev.target.closest(".mffclose, .mffcaptionbutton")||max.style.display=="none")return;mff.call("ONCAPTIONBUTTON",[Id,2])})}}function _DELETEELEMENT(Id){var e=mff.el(Id);if(e&&e.tagName=="INPUT"&&e.list)e.list.remove();if(e&&e.parentNode)e.parentNode.removeChild(e)}function _ELEMENTCONTENTWIDTH(Id){var e=mff.el(Id);if(!e||e.style.display=="none")return 0;var row=e.querySelector(":scope > .mffbuttons");if(!row)return e.scrollWidth;var w=0,items=row.children,cs=getComputedStyle(row);for(var i=0;i<items.length;i++){var it=items[i],s=getComputedStyle(it);if(s.display=="none")continue;var basis=it.className=="mffgap"?parseFloat(s.flexBasis)||0:it.offsetWidth;w+=basis+(parseFloat(s.marginLeft)||0)+(parseFloat(s.marginRight)||0)}var gap=parseFloat(cs.columnGap)||0;return Math.ceil(w+gap*Math.max(0,items.length-1)+(parseFloat(cs.paddingLeft)||0)+(parseFloat(cs.paddingRight)||0))+2}function _ELEMENTNATURALSIZE(Id,Horizontal){var e=mff.el(Id);if(!e)return 0;var w=e.style.width,h=e.style.height;if(Horizontal)e.style.width="max-content";e.style.height="auto";var r=Horizontal?e.offsetWidth:e.offsetHeight;e.style.width=w;e.style.height=h;return r}function _ELEMENTSETBOUNDS(Id,Left,Top,Width,Height){var e=mff.el(Id);if(!e)return;var header=mff.el(String(Id)+"Header"),ch=header&&header.parentElement===e?header.offsetHeight:0;mff.place(e,Left+"px",Top+(e.classList.contains("mffdesign")?0:ch)+"px");e.style.width=Width+"px";e.style.height=Math.max(0,Height-ch)+"px"}function _ELEMENTSETFOCUS(Id){var e=mff.el(Id);if(!e||!e.focus)return;if(e.tabIndex<0&&!e.hasAttribute("tabindex"))e.tabIndex=-1;e.focus({preventScroll:true})}function _ELEMENTZORDER(Id,ToFront){var e=mff.el(Id),p=e?e.parentNode:null;if(!p)return;if(p===document.body&&e.style.position=="relative")return;if(ToFront){if(p.lastElementChild!==e)p.appendChild(e)}else{var first=p.firstElementChild;while(first&&(first===e||first.classList.contains("mffcanvas")||first.classList.contains("mfftabs")))first=first.nextElementSibling;if(first)p.insertBefore(e,first)}}var mffDialog={show:function(caption,build){if(Asyncify.state===Asyncify.State.Normal&&mff.cannotWait())return 0;return Asyncify.handleSleep(function(wakeUp){var back=document.createElement("div");back.style.cssText="position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.15); z-index: 10000; display: flex; align-items: center; justify-content: center;";var win=document.createElement("div");win.style.cssText="background: var(--mff-window, #fff); color: var(--mff-text, #000); font: 8pt Tahoma, sans-serif; border: 1px solid var(--mff-frame, #5b7fae); border-radius: 6px; "+"filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35)); width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); "+"display: flex; flex-direction: column; overflow: hidden;";var title=document.createElement("div");title.style.cssText="height: 28px; box-sizing: border-box; display: flex; align-items: center; padding: 0 4px 0 10px; "+"background: var(--mff-caption, linear-gradient(#f4f8fc, #dce7f3)); border-bottom: 1px solid var(--mff-caption-line, #b9cbe0); color: var(--mff-caption-text, #1e3a5f); font-weight: bold; cursor: move; user-select: none; flex: 0 0 auto;";var titleText=document.createElement("span");titleText.textContent=caption;titleText.style.cssText="flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;";var x=document.createElement("div");x.textContent="✕";x.title="Close";x.style.cssText="flex: 0 0 auto; width: 30px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; color: var(--mff-caption-button, #44546a); font-size: 12px; font-weight: normal; cursor: default;";x.onmouseenter=function(){x.style.background="#e81123";x.style.color="#fff"};x.onmouseleave=function(){x.style.background="";x.style.color="var(--mff-caption-button, #44546a)"};title.appendChild(titleText);title.appendChild(x);var box=document.createElement("div");box.className="mffdialogbox";box.style.cssText="padding: 12px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; overflow: auto;";win.appendChild(title);win.appendChild(box);back.appendChild(win);document.body.appendChild(back);title.addEventListener("mousedown",function(ev){if(ev.button!=0||ev.target===x)return;ev.preventDefault();var r=win.getBoundingClientRect(),dx=ev.clientX-r.left,dy=ev.clientY-r.top;win.style.position="absolute";win.style.left=r.left+"px";win.style.top=r.top+"px";function move(e){win.style.left=Math.max(0,Math.min(window.innerWidth-40,e.clientX-dx))+"px";win.style.top=Math.max(0,Math.min(window.innerHeight-28,e.clientY-dy))+"px"}function up(){document.removeEventListener("mousemove",move,true);document.removeEventListener("mouseup",up,true)}document.addEventListener("mousemove",move,true);document.addEventListener("mouseup",up,true)});var done=false;function close(result){if(done)return;done=true;document.body.removeChild(back);wakeUp(result)}x.addEventListener("click",function(){var cancel=[...box.querySelectorAll("button")].filter(function(b){return b.textContent=="Cancel"})[0];if(cancel)cancel.click();else close(0)});build(box,close);var rows=box.querySelectorAll(":scope > div");if(rows.length&&rows[rows.length-1].querySelector("button"))rows[rows.length-1].style.justifyContent="flex-end"})},row:function(parent){var r=document.createElement("div");r.style.cssText="display: flex; gap: 6px; align-items: center; flex-wrap: wrap;";parent.appendChild(r);return r},button:function(parent,text,onclick){var b=document.createElement("button");b.textContent=text;b.type="button";b.style.cssText="min-width: 75px; height: 23px; font: inherit; padding: 0 10px;";b.onclick=onclick;parent.appendChild(b);return b},input:function(parent,type,value){var i=document.createElement("input");i.type=type;i.value=value;i.style.font="inherit";parent.appendChild(i);return i},filters:function(filter){var parts=filter.split("|"),result=[];for(var i=0;i+1<parts.length;i+=2){var globs=parts[i+1].split(";").map(function(g){return g.trim().replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")});var first=parts[i+1].split(";")[0].trim();result.push({text:parts[i],re:new RegExp("^("+globs.join("|")+")$","i"),ext:/^\*\.[^*?]+$/.test(first)?first.substring(1):""})}return result},join:function(dir,name){return(dir=="/"?"":dir.replace(/\/+$/,""))+"/"+name},isDir:function(path){try{return FS.isDir(FS.stat(path).mode)}catch(err){return false}},parent:function(dir){return dir.substring(0,dir.replace(/\/+$/,"").lastIndexOf("/"))||"/"},icon:function(name){var svg={folder:"<path d='M2 6.5h10l3 3h15v18H2z' fill='#e8b73d' stroke='#b88a1b'/><path d='M2 12.5h28v15H2z' fill='#ffd766' stroke='#c99a2e'/>",up:"<path d='M2 6.5h10l3 3h15v18H2z' fill='#e8b73d' stroke='#b88a1b'/><path d='M2 12.5h28v15H2z' fill='#ffd766' stroke='#c99a2e'/><path d='M16 15l-5 5h3v4h4v-4h3z' fill='#2e6fbd'/>",file:"<path d='M7 2.5h13l6 6v21H7z' fill='#fff' stroke='#7a7a7a'/><path d='M20 2.5v6h6' fill='#e6e6e6' stroke='#7a7a7a'/><path d='M10 14h13M10 18h13M10 22h9' stroke='#a8a8a8'/>",icon:"<path d='M3 3h11v11H3zM18 3h11v11H18zM3 18h11v11H3zM18 18h11v11H18z' fill='#5b7fae'/>",list:"<path d='M3 5h5v5H3zM3 14h5v5H3zM3 23h5v5H3z' fill='#5b7fae'/><path d='M11 7.5h18M11 16.5h18M11 25.5h18' stroke='#5b7fae' stroke-width='3'/>"}[name];return"data:image/svg+xml,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>"+svg+"</svg>")},fileView:function(parent,o){var d=this,el=document.createElement("div"),v={el:el,items:[],multiple:false,anchor:-1};el.className="mfffileview";el.tabIndex=0;parent.appendChild(el);v.view=function(name){if(name){el.setAttribute("data-view",name);try{localStorage.setItem("mffFileView",name)}catch(err){}if(v.onView)v.onView(name)}return el.getAttribute("data-view")};var saved=null;try{saved=localStorage.getItem("mffFileView")}catch(err){}el.setAttribute("data-view",saved=="icon"?"icon":"list");v.fill=function(dir,accept){el.innerHTML="";v.items=[];v.anchor=-1;var dirs=[],files=[];try{FS.readdir(dir).forEach(function(n){if(n=="."||n=="..")return;if(d.isDir(d.join(dir,n)))dirs.push(n);else if(accept&&accept(n))files.push(n)})}catch(err){}var names=(dir!="/"?[".."]:[]).concat(dirs.sort(),files.sort()),nDirs=names.length-files.length;names.forEach(function(n,i){var it=document.createElement("div"),img=document.createElement("img"),t=document.createElement("span");it.className="mfffileitem";it.title=n;it.mffName=n;it.mffDir=i<nDirs;img.alt="";img.src=d.icon(n==".."?"up":it.mffDir?"folder":"file");t.textContent=n;it.appendChild(img);it.appendChild(t);el.appendChild(it);v.items.push(it)});el.scrollTop=el.scrollLeft=0};v.selected=function(){return v.items.filter(function(it){return it.classList.contains("mffselected")})};function select(i,ctrl,shift){if(i<0||i>=v.items.length)return;if(v.multiple&&shift&&v.anchor>=0){var a=Math.min(v.anchor,i),b=Math.max(v.anchor,i);v.items.forEach(function(it,k){it.classList.toggle("mffselected",k>=a&&k<=b)})}else if(v.multiple&&ctrl){v.items[i].classList.toggle("mffselected");v.anchor=i}else{v.items.forEach(function(it,k){it.classList.toggle("mffselected",k==i)});v.anchor=i}v.items[i].scrollIntoView({block:"nearest",inline:"nearest"});if(o.onSelect)o.onSelect(v.items[i])}function index(ev){var it=ev.target.closest?ev.target.closest(".mfffileitem"):null;return it?v.items.indexOf(it):-1}function perLine(){var prop=v.view()=="icon"?"offsetTop":"offsetLeft",n=0;while(n<v.items.length&&v.items[n][prop]==v.items[0][prop])n++;return Math.max(1,n)}el.addEventListener("mousedown",function(ev){if(ev.button!=0)return;var i=index(ev);if(i>=0)select(i,ev.ctrlKey||ev.metaKey,ev.shiftKey)});el.addEventListener("dblclick",function(ev){var i=index(ev);if(i>=0&&o.onOpen)o.onOpen(v.items[i])});el.addEventListener("keydown",function(ev){var i=v.anchor,n=v.items.length,line=perLine(),icon=v.view()=="icon";var step={ArrowRight:icon?1:line,ArrowLeft:icon?-1:-line,ArrowDown:icon?line:1,ArrowUp:icon?-line:-1}[ev.key];if(step){select(i<0?0:Math.max(0,Math.min(n-1,i+step)),false,ev.shiftKey)}else if(ev.key=="Home"){select(0,false,ev.shiftKey)}else if(ev.key=="End"){select(n-1,false,ev.shiftKey)}else if(ev.key=="Enter"){if(i>=0&&o.onOpen)o.onOpen(v.items[i])}else if(ev.key=="Backspace"){if(n&&v.items[0].mffName==".."&&o.onOpen)o.onOpen(v.items[0])}else if(ev.key=="a"&&(ev.ctrlKey||ev.metaKey)&&v.multiple){v.items.forEach(function(it){it.classList.toggle("mffselected",!it.mffDir)})}else return;ev.preventDefault()});return v},viewButtons:function(parent,v){var d=this,buttons=[];[["icon","Large icons"],["list","List"]].forEach(function(b){var btn=document.createElement("button"),img=document.createElement("img");btn.type="button";btn.className="mffviewbutton";btn.title=b[1];btn.mffView=b[0];img.alt=b[1];img.src=d.icon(b[0]);btn.appendChild(img);btn.onclick=function(){v.view(b[0]);v.el.focus()};parent.appendChild(btn);buttons.push(btn)});v.onView=function(name){buttons.forEach(function(btn){btn.toggleAttribute("data-on",btn.mffView==name)})};v.onView(v.view())}};function _FILEVIEWFILL(Id,Dir,Patterns,Multiple){var e=mff.el(Id),d=mffDialog;if(!e)return;var v=e.mffFileView;if(!v){var wrap=document.createElement("div"),bar=document.createElement("div");wrap.className="mfffileviewhost";bar.className="mfffileviewbar";wrap.appendChild(bar);e.appendChild(wrap);function report(ev){e.setAttribute("data-dir",v.dir);e.setAttribute("data-files",v.selected().filter(function(it){return!it.mffDir}).map(function(it){return d.join(v.dir,it.mffName)}).join("\n"));e.setAttribute("data-event",ev);mff.call("ONCHANGE",[Id])}v=e.mffFileView=d.fileView(wrap,{onSelect:function(){report("select")},onOpen:function(it){if(!it.mffDir){report("activate");return}v.dir=it.mffName==".."?d.parent(v.dir):d.join(v.dir,it.mffName);v.fill(v.dir,v.accept);report("folder")}});d.viewButtons(bar,v)}var dir=mff.str(Dir).replace(/\\/g,"/")||"/";if(!d.isDir(dir))dir=FS.cwd();var re=d.filters("|"+(mff.str(Patterns)||"*"))[0].re;v.multiple=Multiple!=0;v.dir=dir;v.accept=function(n){return re.test(n)};v.fill(dir,v.accept);e.setAttribute("data-dir",dir);e.setAttribute("data-files","")}function _FREEPTR(ptr){_free(ptr)}function _GETATTRIBUTE(Id,Name){var e=mff.el(Id);var v=e?e.getAttribute(mff.str(Name)):null;return stringToNewUTF8(v==null?"":String(v))}function _GETCHECKED(Id){var e=mff.el(mff.str(Id));return e&&e.checked?1:0}function _GETCLIENTSIZE(Id,Vertical){var e=mff.el(String(Id)+"Client");if(!e){var f=mff.el(Id),header=mff.el(String(Id)+"Header");if(!f||!header||header.parentElement!==f)return-1;var cs=getComputedStyle(f);var s=Vertical?parseFloat(f.style.height)-parseFloat(cs.borderTopWidth)-parseFloat(cs.borderBottomWidth):parseFloat(f.style.width)-parseFloat(cs.borderLeftWidth)-parseFloat(cs.borderRightWidth);return s>0?Math.round(s):-1}var v=Vertical?e.clientHeight:e.clientWidth;return v>0?v:-1}function _GETDOCUMENTHEIGHT(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function _GETDOCUMENTWIDTH(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function _GETITEMCHECKED(Id,Index){var e=mff.el(Id);if(!e)return 0;var items=mff.items(e);var box=Index>=0&&Index<items.length?items[Index].querySelector("input"):null;return box&&box.checked?1:0}function _GETPARENTPAGEOFFSET(Id,Vertical){var e=mff.el(Id),p=e?e.offsetParent:null;if(!p)return 0;var r=p.getBoundingClientRect();return Math.round(Vertical?r.top+p.clientTop:r.left+p.clientLeft)}function _GETPOSITION(Id){var e=mff.el(Id);if(!e)return 0;if(e.tagName=="PROGRESS")return Math.round(Number(e.value)+Number(e.getAttribute("data-min")||0));if(e.hasAttribute("data-position"))return Number(e.getAttribute("data-position"))|0;return Math.round(Number(e.value)||0)}function _GETSELECTEDINDEX(Id){var e=mff.el(Id);if(!e)return-1;if(e.tagName=="INPUT")return Array.prototype.findIndex.call(mff.list(e).options,function(o){return o.value==e.value});if(e.tagName!="SELECT")return e.hasAttribute("data-position")?Number(e.getAttribute("data-position"))|0:-1;return e.selectedIndex}function _GETSTRINGVALUE(Id){var e=mff.el(Id);return stringToNewUTF8(e?e.value!==undefined?e.value:e.classList.contains("mffrichtext")?e.innerText:e.textContent:"")}function _INSERTSELECTITEM(Id,Index,Text){var e=mff.list(mff.el(Id));if(e)e.insertBefore(mff.item(e,mff.str(Text)),mff.items(e)[Index]||null)}function _MESSAGEBOX(Message,Caption,MessageType,Buttons){var msg=mff.str(Message),ttl=mff.str(Caption);var mrCancel=1,mrNo=3,mrOK=4,mrYes=6;var list=[[["OK",mrOK]],[["OK",mrOK]],[["Yes",mrYes],["No",mrNo]],[["Yes",mrYes],["No",mrNo],["Cancel",mrCancel]],[["OK",mrOK],["Cancel",mrCancel]]][Buttons]||[["OK",mrOK]];var escResult=list.length==1?list[0][1]:list.some(function(b){return b[1]==mrCancel})?mrCancel:mrNo;if(Asyncify.state===Asyncify.State.Normal&&mff.cannotWait()){var text=(ttl?ttl+"\n\n":"")+msg;if(list.length==1){alert(text);return list[0][1]}return confirm(text)?list[0][1]:list[1][1]}return Asyncify.handleSleep(function(wakeUp){var back=document.createElement("div");back.style.cssText="position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.15); z-index: 10000; display: flex; align-items: center; justify-content: center;";var box=document.createElement("div");box.style.cssText="background: var(--mff-window, #fff); color: var(--mff-text, #000); font: 8pt Tahoma, sans-serif; border: 1px solid var(--mff-frame, #5b7fae); border-radius: 6px; "+"filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35)); min-width: 280px; max-width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); "+"display: flex; flex-direction: column; overflow: hidden;";var title=document.createElement("div");title.style.cssText="height: 28px; box-sizing: border-box; display: flex; align-items: center; padding: 0 4px 0 10px; "+"background: var(--mff-caption, linear-gradient(#f4f8fc, #dce7f3)); border-bottom: 1px solid var(--mff-caption-line, #b9cbe0); color: var(--mff-caption-text, #1e3a5f); font-weight: bold; cursor: move; user-select: none; flex: 0 0 auto;";var titleText=document.createElement("span");titleText.textContent=ttl||document.title;titleText.style.cssText="flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;";var x=document.createElement("div");x.textContent="✕";x.title="Close";x.style.cssText="flex: 0 0 auto; width: 30px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; color: var(--mff-caption-button, #44546a); font-size: 12px; font-weight: normal;";x.onmouseenter=function(){x.style.background="#e81123";x.style.color="#fff"};x.onmouseleave=function(){x.style.background="";x.style.color="var(--mff-caption-button, #44546a)"};title.appendChild(titleText);title.appendChild(x);var body=document.createElement("div");body.style.cssText="display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 16px 16px; overflow: auto;";var icons=[null,["i","#1e6fd9"],["!","#e8a200"],["?","#1e6fd9"],["✕","#d93025"]];var icon=icons[MessageType];if(icon){var ic=document.createElement("div");ic.textContent=icon[0];ic.style.cssText="flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: "+icon[1]+"; color: #fff; font: bold 18px Georgia, serif; display: flex; align-items: center; justify-content: center;"+(MessageType==2?" border-radius: 4px; clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 6px; box-sizing: border-box; font-size: 15px;":"");body.appendChild(ic)}var text=document.createElement("div");text.textContent=msg;text.style.cssText="white-space: pre-wrap; word-break: break-word; line-height: 1.4; padding-top: "+(icon?"7px":"0")+";";body.appendChild(text);var bar=document.createElement("div");bar.style.cssText="display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; background: var(--mff-face, #f0f0f0); border-top: 1px solid var(--mff-line, #dfdfdf); flex: 0 0 auto;";var done=false,buttons=[];function close(result){if(done)return;done=true;document.removeEventListener("keydown",onKey,true);if(back.parentNode)back.parentNode.removeChild(back);wakeUp(result)}list.forEach(function(item){var b=document.createElement("button");b.type="button";b.textContent=item[0];b.style.cssText="min-width: 75px; height: 23px; font: inherit; padding: 0 10px;";b.addEventListener("click",function(){close(item[1])});bar.appendChild(b);buttons.push(b)});x.addEventListener("click",function(){close(escResult)});title.addEventListener("mousedown",function(ev){if(ev.button!=0||ev.target===x)return;ev.preventDefault();var r=box.getBoundingClientRect(),dx=ev.clientX-r.left,dy=ev.clientY-r.top;box.style.position="absolute";box.style.left=r.left+"px";box.style.top=r.top+"px";function move(e){box.style.left=Math.max(0,Math.min(window.innerWidth-40,e.clientX-dx))+"px";box.style.top=Math.max(0,Math.min(window.innerHeight-28,e.clientY-dy))+"px"}function up(){document.removeEventListener("mousemove",move,true);document.removeEventListener("mouseup",up,true)}document.addEventListener("mousemove",move,true);document.addEventListener("mouseup",up,true)});function onKey(e){if(e.key=="Escape"){e.preventDefault();e.stopPropagation();close(escResult)}else if(e.key=="Enter"){e.preventDefault();e.stopPropagation();var i=buttons.indexOf(document.activeElement);close(list[i>=0?i:0][1])}else if(e.key=="Tab"||e.key=="ArrowLeft"||e.key=="ArrowRight"){e.preventDefault();e.stopPropagation();var j=buttons.indexOf(document.activeElement),d=e.key=="ArrowLeft"||e.key=="Tab"&&e.shiftKey?-1:1;buttons[((j<0?0:j)+d+buttons.length)%buttons.length].focus()}else{e.stopPropagation()}}document.addEventListener("keydown",onKey,true);box.appendChild(title);box.appendChild(body);box.appendChild(bar);back.appendChild(box);document.body.appendChild(back);buttons[0].focus()})}_MESSAGEBOX.isAsync=true;function _MODALWAIT(Id){var e=mff.el(Id);if(Asyncify.state===Asyncify.State.Normal&&(!e||mff.cannotWait()))return 0;return Asyncify.handleSleep(function(wakeUp){mff.modalWait=true;var back=document.createElement("div");back.style.cssText="position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 999;";e.parentNode.insertBefore(back,e);var timer=setInterval(function(){if(e.isConnected&&e.style.display!="none")return;clearInterval(timer);if(back.parentNode)back.parentNode.removeChild(back);mff.modalWait=false;wakeUp(1)},50)})}_MODALWAIT.isAsync=true;function _MOUSEHOVERTIMER(Id,x,y,Shift){clearTimeout(mff.hoverTimer);var e=mff.el(Id);if(!e)return;if(!e.mffHover){e.mffHover=true;e.addEventListener("mouseleave",function(){clearTimeout(mff.hoverTimer)})}mff.hoverTimer=setTimeout(function(){if(mff.modalWait||Asyncify.currData||!e.isConnected)return;mff.call("ONMOUSEHOVER",[Id,x,y,Shift])},400)}function _OPENURL(URL){window.open(mff.str(URL),"_blank")}function _PAGECREATE(Id,Width,Height){var c=document.createElement("canvas"),k=2;c.width=Math.max(1,Math.round(Width*k));c.height=Math.max(1,Math.round(Height*k));c.mffWidth=Width;c.mffHeight=Height;var g=c.getContext("2d");g.setTransform(k,0,0,k,0,0);g.fillStyle="#fff";g.fillRect(0,0,Width,Height);g.beginPath();mff.pages[Id]=c}function _PAGEDELETE(Id){delete mff.pages[Id]}function _PAGEDRAW(Id,PageId,x,y,w,h){var g=mff.ctx(Id,true),page=mff.pages[PageId];if(!g)return;g.save();g.fillStyle="#fff";g.fillRect(x,y,w,h);if(page){g.imageSmoothingQuality="high";g.drawImage(page,x,y,w,h)}g.strokeStyle="#000";g.lineWidth=1;g.strokeRect(x-.5,y-.5,w+1,h+1);g.restore()}function _PAGESLEEP(ms){if(Asyncify.state===Asyncify.State.Normal&&mff.cannotWait())return;return Asyncify.handleSleep(function(wakeUp){mff.pageSleep=true;setTimeout(function(){mff.pageSleep=false;wakeUp()},ms)})}_PAGESLEEP.isAsync=true;function _PRINTPAGES(Ids,Title){var pages=mff.str(Ids).split(" ").filter(function(i){return i&&mff.pages[i]}).map(function(i){return mff.pages[i]});if(!pages.length)return;var old=document.getElementById("mffprintframe");if(old)old.remove();var f=document.createElement("iframe");f.id="mffprintframe";f.style.cssText="position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden;";document.body.appendChild(f);var mm=function(px){return(px*25.4/96).toFixed(2)+"mm"};var w=pages[0].mffWidth,h=pages[0].mffHeight,d=f.contentWindow.document;d.open();d.write("<!doctype html><html><head><meta charset='utf-8'><title></title><style>@page {size: "+mm(w)+" "+mm(h)+"; margin: 0;} html, body {margin: 0; padding: 0;} img {display: block; width: "+mm(w)+"; height: calc("+mm(h)+" - 0.5mm); break-after: page;} img:last-child {break-after: auto;}</style></head><body></body></html>");d.close();d.title=mff.str(Title)||document.title;var loads=pages.map(function(p){var img=d.createElement("img");img.src=p.toDataURL("image/png");d.body.appendChild(img);return img.decode?img.decode().catch(function(){}):Promise.resolve()});Promise.all(loads).then(function(){f.contentWindow.focus();f.contentWindow.print()})}function _REGEXCOMPILE(Pattern,Flags){var pattern=mff.str(Pattern),flags="dgu";if(Flags&1)flags+="i";if(Flags&2)flags+="m";if(Flags&4)flags+="s";if(Flags&8)pattern=pattern.replace(/\\.|\[(?:\\.|[^\]])*\]|#[^\n]*|\s+/g,function(t){return t[0]=="\\"||t[0]=="["?t:""});if(!mff.regex)mff.regex={next:1,items:{},error:""};try{var id=mff.regex.next++;mff.regex.items[id]=new RegExp(pattern,flags);mff.regex.error="";return id}catch(err){mff.regex.error=err.message;return 0}}function _REGEXERROR(){return stringToNewUTF8(mff.regex?mff.regex.error:"")}function _REGEXEXEC(Id,Subject,StartByte,Offsets,MaxGroups){var re=mff.regex&&mff.regex.items[Id];if(!re)return 0;var data=HEAPU32[Subject>>2],len=HEAP32[(Subject>>2)+1];var s=data?UTF8ToString(data,len):"";var start=data&&StartByte>0?UTF8ToString(data,StartByte).length:0;re.lastIndex=start;var m=re.exec(s);if(!m)return 0;var count=Math.min(m.length,MaxGroups);for(var i=0;i<count;i++){var b=-1,e=-1,r=m.indices[i];if(r){b=lengthBytesUTF8(s.substring(0,r[0]));e=b+lengthBytesUTF8(s.substring(r[0],r[1]))}HEAP32[(Offsets>>2)+2*i]=b;HEAP32[(Offsets>>2)+2*i+1]=e}return count}function _REGEXFREE(Id){if(mff.regex)delete mff.regex.items[Id]}function _REMOVESELECTITEM(Id,Index){var e=mff.list(mff.el(Id));if(!e)return;var items=mff.items(e);if(Index>=0&&Index<items.length)e.removeChild(items[Index])}var mffRich={init:function(){if(mffRich.inited)return;mffRich.inited=true;document.addEventListener("selectionchange",function(){var s=document.getSelection();if(!s||!s.rangeCount)return;var n=s.anchorNode,e=n&&(n.nodeType==1?n:n.parentNode);e=e&&e.closest?e.closest(".mffrichtext"):null;if(e&&document.activeElement===e)e.mffRange=s.getRangeAt(0).cloneRange()})},isBlock:function(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE)$/.test(n.tagName)},walk:function(e,f){var started=false;(function go(p){for(var n=p.firstChild;n;n=n.nextSibling){if(n.nodeType==3){if(n.nodeValue.length){f(n,n.nodeValue);started=true}}else if(n.nodeType==1){if(n.tagName=="BR"){f(n,"\n");started=true;continue}if(mffRich.isBlock(n)&&started)f(null,"\n");go(n)}}})(e)},text:function(e){var t="";mffRich.walk(e,function(n,s){t+=s});return t},offsetOf:function(e,node,offset){var pos=0,done=false;if(node===e||node.nodeType==1&&node.childNodes.length){var child=node.childNodes[offset];if(!child){var r=document.createRange();r.selectNodeContents(node);r.collapse(false);node=r.endContainer}mffRich.walk(e,function(n,s){if(done)return;if(child&&n&&(n===child||child.contains(n))){done=true;return}if(!child&&n&&!node.contains(n)&&node.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING){done=true;return}pos+=s.length});return pos}mffRich.walk(e,function(n,s){if(done)return;if(n===node){pos+=n.nodeType==3?offset:offset>0?1:0;done=true;return}pos+=s.length});return pos},pointAt:function(e,pos){var res=null,last=null;mffRich.walk(e,function(n,s){if(res)return;if(n&&n.nodeType==3)last={node:n,offset:n.nodeValue.length};if(pos<=s.length&&n){if(n.nodeType==3)res={node:n,offset:pos};else res={node:n.parentNode,offset:Array.prototype.indexOf.call(n.parentNode.childNodes,n)+(pos>0?1:0)}}pos-=s.length});return res||last||{node:e,offset:e.childNodes.length}},range:function(e){var r=e.mffRange;if(!r||!e.contains(r.startContainer)){r=document.createRange();r.selectNodeContents(e);r.collapse(false)}return r},apply:function(e,f){var editable=e.contentEditable,s=document.getSelection(),active=document.activeElement;if(editable!="true")e.contentEditable="true";e.focus({preventScroll:true});s.removeAllRanges();s.addRange(mffRich.range(e));document.execCommand("styleWithCSS",false,true);var result=f(s);if(s.rangeCount)e.mffRange=s.getRangeAt(0).cloneRange();if(editable!="true")e.contentEditable=editable;if(active!==e){if(active&&active!==document.body&&active.focus)active.focus({preventScroll:true});if(document.activeElement===e)e.blur()}return result},select:function(e,start,end){var a=mffRich.pointAt(e,start),b=mffRich.pointAt(e,end),r=document.createRange();r.setStart(a.node,a.offset);r.setEnd(b.node,b.offset);e.mffRange=r;if(document.activeElement===e){var s=document.getSelection();s.removeAllRanges();s.addRange(r)}},anchor:function(e){var r=mffRich.range(e),n=r.startContainer;if(!r.collapsed){var root=r.commonAncestorContainer.nodeType==1?r.commonAncestorContainer:r.commonAncestorContainer.parentNode;var w=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);for(var t=w.nextNode();t;t=w.nextNode()){if(!r.intersectsNode(t)||!t.nodeValue.length)continue;if(t===r.startContainer&&r.startOffset>=t.nodeValue.length)continue;if(t===r.endContainer&&r.endOffset==0)continue;return t.parentNode}}if(n.nodeType==1&&n.childNodes[r.startOffset]&&n.childNodes[r.startOffset].nodeType==1)n=n.childNodes[r.startOffset];return n.nodeType==1?n:n.parentNode},block:function(e){var n=mffRich.anchor(e);while(n&&n!==e&&!mffRich.isBlock(n))n=n.parentNode;return n||e},bgr:function(c){var m=/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?/.exec(c||"");if(!m||m[4]==="0")return-1;return+m[1]|+m[2]<<8|+m[3]<<16},fontSize:function(e,pt){document.execCommand("styleWithCSS",false,false);document.execCommand("fontSize",false,"7");var first=null,last=null;Array.prototype.forEach.call(e.querySelectorAll("font[size='7']"),function(f){var sp=document.createElement("span");sp.style.fontSize=pt+"pt";while(f.firstChild)sp.appendChild(f.firstChild);f.parentNode.replaceChild(sp,f);if(!first)first=sp;last=sp});if(first){var r=document.createRange(),s=document.getSelection();r.setStart(first,0);r.setEnd(last,last.childNodes.length);s.removeAllRanges();s.addRange(r)}},rtf:function(e){var fonts=[],colors=[],body="";function fontIndex(f){f=(f||"").split(",")[0].replace(/["']/g,"").trim();var i=fonts.indexOf(f);if(i<0){fonts.push(f);i=fonts.length-1}return i}function colorIndex(c){var i=colors.indexOf(c);if(i<0){colors.push(c);i=colors.length-1}return i+1}function esc(s){var r="";for(var i=0;i<s.length;i++){var ch=s.charAt(i),code=s.charCodeAt(i);if(ch=="\\"||ch=="{"||ch=="}")r+="\\"+ch;else if(ch=="\n")r+="\\par\n";else if(ch=="\t")r+="\\tab ";else if(code>127)r+="\\u"+(code>32767?code-65536:code)+"?";else r+=ch}return r}var base=getComputedStyle(e),last="",align="";fontIndex(base.fontFamily);mffRich.walk(e,function(n,s){var el=n?n.nodeType==3?n.parentNode:n.parentNode:null,fmt="";if(el){var cs=getComputedStyle(el),deco=cs.textDecorationLine||cs.textDecoration||"";var blk=el;while(blk&&blk!==e&&!mffRich.isBlock(blk))blk=blk.parentNode;var a=getComputedStyle(blk||e).textAlign,q=a=="center"?"\\qc":a=="right"||a=="end"?"\\qr":a=="justify"?"\\qj":"\\ql";if(q!=align){body+="\\pard"+q+" ";align=q;last=""}fmt=(parseInt(cs.fontWeight,10)>=600?"\\b":"\\b0")+(cs.fontStyle=="italic"?"\\i":"\\i0")+(deco.indexOf("underline")>=0?"\\ul":"\\ulnone")+(deco.indexOf("line-through")>=0?"\\strike":"\\strike0")+"\\f"+fontIndex(cs.fontFamily)+"\\fs"+Math.round(parseFloat(cs.fontSize)*.75*2)+"\\cf"+colorIndex(mffRich.bgr(cs.color));var bg=mffRich.bgr(cs.backgroundColor);fmt+=bg>=0?"\\highlight"+colorIndex(bg):"\\highlight0"}if(fmt&&fmt!=last){body+=fmt+" ";last=fmt}body+=esc(s)});var ft="{\\fonttbl"+fonts.map(function(f,i){return"{\\f"+i+" "+f+";}"}).join("")+"}";var ct="{\\colortbl ;"+colors.map(function(c){return"\\red"+(c&255)+"\\green"+(c>>8&255)+"\\blue"+(c>>16&255)+";"}).join("")+"}";return"{\\rtf1\\ansi\\deff0"+ft+ct+"\n"+body+"\\par\n}"}};function _RICHTEXTCMD(Id,Cmd,Value){var e=mff.el(Id),cmd=mff.str(Cmd),v=mff.str(Value),res="";if(!e)return stringToNewUTF8("");mffRich.init();var R=mffRich;switch(cmd){case"getbold":res=parseInt(getComputedStyle(R.anchor(e)).fontWeight,10)>=600?"1":"0";break;case"getitalic":res=getComputedStyle(R.anchor(e)).fontStyle=="italic"?"1":"0";break;case"getunderline":case"getstrikeout":var n=R.anchor(e),want=cmd=="getunderline"?"underline":"line-through";res="0";for(;n&&n!==e.parentNode;n=n.parentNode){var cs=getComputedStyle(n);if((cs.textDecorationLine||cs.textDecoration||"").indexOf(want)>=0){res="1";break}}break;case"bold":case"italic":case"underline":case"strikeThrough":R.apply(e,function(){if(document.queryCommandState(cmd)!=(v=="1"))document.execCommand(cmd)});break;case"getcolor":res=String(R.bgr(getComputedStyle(R.anchor(e)).color));break;case"getbackcolor":res=String(R.bgr(getComputedStyle(R.anchor(e)).backgroundColor));break;case"color":case"backcolor":var c=parseInt(v,10),css=c<0?cmd=="color"?"inherit":"transparent":mff.color(c);R.apply(e,function(){document.execCommand(cmd=="color"?"foreColor":"hiliteColor",false,css)});break;case"getfontname":res=getComputedStyle(R.anchor(e)).fontFamily.split(",")[0].replace(/["']/g,"").trim();break;case"fontname":R.apply(e,function(){document.execCommand("fontName",false,v)});break;case"getfontsize":res=String(Math.round(parseFloat(getComputedStyle(R.anchor(e)).fontSize)*.75));break;case"fontsize":R.apply(e,function(){R.fontSize(e,parseFloat(v))});break;case"getalignment":var ta=getComputedStyle(R.block(e)).textAlign;res=ta=="center"?"1":ta=="right"||ta=="end"?"2":"0";break;case"alignment":R.apply(e,function(){document.execCommand(v=="1"?"justifyCenter":v=="2"?"justifyRight":"justifyLeft")});break;case"getbullet":var b=R.anchor(e);res=b.closest&&b.closest("ul")&&e.contains(b.closest("ul"))?"1":"0";break;case"bullet":R.apply(e,function(){if(document.queryCommandState("insertUnorderedList")!=(v=="1"))document.execCommand("insertUnorderedList")});break;case"getindent":res=String(Math.round(parseFloat(getComputedStyle(R.block(e)).marginLeft)*15));break;case"getrightindent":res=String(Math.round(parseFloat(getComputedStyle(R.block(e)).marginRight)*15));break;case"gethangingindent":res=String(Math.round(-parseFloat(getComputedStyle(R.block(e)).textIndent)*15));break;case"indent":case"rightindent":case"hangingindent":R.apply(e,function(){var blk=R.block(e);if(blk===e){document.execCommand("formatBlock",false,"div");blk=R.block(e)}if(blk===e)return;var px=parseInt(v,10)/15+"px";if(cmd=="indent")blk.style.marginLeft=px;else if(cmd=="rightindent")blk.style.marginRight=px;else{blk.style.textIndent="-"+px;blk.style.paddingLeft=px}});break;case"getcharoffset":var va=getComputedStyle(R.anchor(e)).verticalAlign;res=va=="super"?"40":va=="sub"?"-40":"0";break;case"charoffset":R.apply(e,function(){var o=parseInt(v,10);if(document.queryCommandState("superscript"))document.execCommand("superscript");if(document.queryCommandState("subscript"))document.execCommand("subscript");if(o>0)document.execCommand("superscript");else if(o<0)document.execCommand("subscript")});break;case"getseltext":var r=R.range(e);res=R.text(e).substring(R.offsetOf(e,r.startContainer,r.startOffset),R.offsetOf(e,r.endContainer,r.endOffset));break;case"seltext":R.apply(e,function(){document.execCommand("insertText",false,v)});break;case"getsel":var r2=R.range(e);res=R.offsetOf(e,r2.startContainer,r2.startOffset)+","+R.offsetOf(e,r2.endContainer,r2.endOffset);break;case"setsel":var p=v.split(",");R.select(e,Math.max(0,parseInt(p[0],10)||0),Math.max(0,parseInt(p[1],10)||0));break;case"gettext":res=R.text(e);break;case"gettextrange":var q=v.split(","),t=R.text(e),hi=parseInt(q[1],10);res=t.substring(parseInt(q[0],10)||0,hi<0?t.length:hi);break;case"getrtf":res=R.rtf(e);break;case"find":var i1=v.indexOf(","),i2=v.indexOf(",",i1+1),from=parseInt(v.substring(0,i1),10),flags=parseInt(v.substring(i1+1,i2),10),what=v.substring(i2+1);var hay=R.text(e);if(!(flags&2)){hay=hay.toLowerCase();what=what.toLowerCase()}var at=flags&1?hay.lastIndexOf(what,Math.max(0,from-1)):hay.indexOf(what,from);if(at>=0&&what.length){R.select(e,at,at+what.length);res=String(at)}else res="-1";break;case"getcharindexfrompos":var xy=v.split(","),b2=e.getBoundingClientRect(),x=b2.left+parseInt(xy[0],10),y=b2.top+parseInt(xy[1],10),node=null,off=0;if(document.caretPositionFromPoint){var cp=document.caretPositionFromPoint(x,y);if(cp){node=cp.offsetNode;off=cp.offset}}else if(document.caretRangeFromPoint){var cr=document.caretRangeFromPoint(x,y);if(cr){node=cr.startContainer;off=cr.startOffset}}res=node&&e.contains(node)?String(R.offsetOf(e,node,off)):"-1";break;case"undo":R.apply(e,function(){document.execCommand("undo")});break;case"redo":R.apply(e,function(){document.execCommand("redo")});break;case"getcanredo":res=R.apply(e,function(){return document.queryCommandEnabled("redo")})?"1":"0";break;case"getcanundo":res=R.apply(e,function(){return document.queryCommandEnabled("undo")})?"1":"0";break;case"zoom":e.style.zoom=(parseInt(v,10)||100)/100;break;case"getbottomline":var bb=e.getBoundingClientRect(),lh=parseFloat(getComputedStyle(e).lineHeight)||parseFloat(getComputedStyle(e).fontSize)*1.2;res=String(Math.max(0,Math.floor((e.scrollTop+bb.height)/lh)-1));break;case"image":var src=v;if(!/^(data|blob|https?):/.test(src)){try{src=URL.createObjectURL(new Blob([FS.readFile(src)]))}catch(err){src=v}}R.apply(e,function(){document.execCommand("insertImage",false,src)});break;case"html":e.innerHTML=v;e.mffRange=null;break}return stringToNewUTF8(res)}function _SENDHTTPREQUEST(url,method,data){var xhr=new XMLHttpRequest;var result;try{xhr.open(mff.str(method),mff.str(url),false);xhr.setRequestHeader("Content-Type","application/text");xhr.send(mff.str(data));result=xhr.status+":"+(xhr.status>=200&&xhr.status<300?xhr.responseText:xhr.statusText)}catch(err){result="0:"+err}return stringToNewUTF8(result)}function _SETATTRIBUTE(Id,Name,Value){var e=mff.el(Id);if(!e)return;var name=mff.str(Name),value=mff.str(Value);if(name=="src"||name=="srcdoc"||name=="href"||name=="placeholder"||name=="title"){if(name=="src"&&e.hasAttribute("srcdoc"))e.removeAttribute("srcdoc");e.setAttribute(name,value)}else if(value==""){e.removeAttribute(name)}else{e.setAttribute(name,value)}}function _SETBUTTONS(Id,Items){var e=mff.el(Id);if(!e)return;if(!document.getElementById("mffbuttonsstyle")){var st=document.createElement("style");st.id="mffbuttonsstyle";st.textContent=".mffbuttons > button.mffflat:not(:disabled):hover { border: 1px solid #8a8a8a !important; background: rgba(0, 120, 215, 0.08) !important; }"+" .mffbuttons > button.mffflat:not(:disabled):active { border: 1px solid #6a6a6a !important; background: rgba(0, 0, 0, 0.12) !important; }"+" .mffbuttons > button.mffchecked { border: 1px solid #6a8fb8 !important; background: rgba(0, 120, 215, 0.16) !important; }"+" .mffbuttons > button.mffgroup:hover { background: var(--mff-hover, #f4f4f4) !important; border-color: #8a8a8a !important; }"+" .mffbuttons > button.mffgroup:active { background: var(--mff-pressed, #dcdcdc) !important; }";document.head.appendChild(st)}var row=e.querySelector(":scope > .mffbuttons");if(!row){row=document.createElement("div");row.className="mffbuttons";row.style.cssText="display: flex; align-items: center; height: 100%; overflow: hidden; gap: 2px; padding: 0 2px;";e.insertAdjacentElement("afterbegin",row);if(typeof ResizeObserver!=="undefined"){var w0=-1,h0=-1;new ResizeObserver(function(){if(row.clientWidth==w0&&row.clientHeight==h0)return;w0=row.clientWidth;h0=row.clientHeight;if(row.mffSet&&!row.mffPalette&&e.clientWidth>0&&e.clientHeight>e.clientWidth*1.5!=row.mffColumn){row.mffSet(row.mffItems)}if(w0>0&&row.querySelector(":scope > .mffgap"))mff.call("ONPAINT",[Id])}).observe(row)}}row.mffSet=function(s){row.mffItems=s;var list=s==""?[]:s.split("\n");var palette=list.some(function(item){return(item.split("\t")[2]||"").indexOf("G")>=0});var column=!palette&&e.clientHeight>e.clientWidth*1.5;row.mffPalette=palette;row.mffColumn=column;row.style.flexDirection=column?"column":"row";row.style.flexWrap=palette?"wrap":"nowrap";row.style.alignItems=column?"stretch":palette?"flex-start":"center";row.style.alignContent=palette?"flex-start":"normal";row.style.overflow=column||palette?"auto":"hidden";row.style.boxSizing="border-box";var sig=(column?"C":"R")+list.map(function(item){var f=item.charAt(0);return(f=="3"||f=="6"||f=="7"?f:"b")+item.substring(1)}).join("\n");if(row.mffSig===sig&&row.children.length==list.length){list.forEach(function(item,i){var b=row.children[i],flag=item.charAt(0);if(b.tagName!="BUTTON")return;b.disabled=flag=="1";b.classList.toggle("mffchecked",flag=="2");b.style.display=flag=="4"?"none":"inline-flex";var img=b.querySelector(":scope > img");if(img)img.style.opacity=b.disabled?"0.4":"";if(b.mffTriangle)b.mffTriangle.style.borderTopColor=b.disabled?"#aaa":"#444"});return}row.mffSig=sig;row.innerHTML="";var paletteWidth=0;if(palette){var measure=document.createElement("canvas").getContext("2d");measure.font=getComputedStyle(e).font||"8pt Tahoma, sans-serif";list.forEach(function(item){var parts=item.substring(1).split("\t");if((parts[2]||"").indexOf("G")<0&&item.charAt(0)!="3"){paletteWidth=Math.max(paletteWidth,Math.ceil(measure.measureText(parts[0]).width)+(parts[1]?16+3:0)+8+2)}})}list.forEach(function(item,i){var flag=item.charAt(0),parts=item.substring(1).split("\t");var text=parts[0],image=parts[1]||"",options=parts[2]||"",hint=parts[3]||"";var showText=options.indexOf("S")>=0,whole=options.indexOf("W")>=0,arrow=whole||options.indexOf("D")>=0;var b;if(flag=="3"){b=document.createElement("span");b.style.cssText=palette?"flex: 0 0 100%; height: 1px; margin: 3px 0; background: var(--mff-border, #aaa);":column?"height: 1px; margin: 2px 3px; background: var(--mff-border, #aaa);":"width: 1px; align-self: stretch; margin: 3px 2px; background: var(--mff-border, #aaa);"}else if(flag=="6"||flag=="7"){b=document.createElement("span");b.className="mffgap";b.style.cssText="align-self: stretch; flex: "+(flag=="7"?"1 1 ":"0 0 ")+(Number(text)||0)+"px;"}else{b=document.createElement("button");b.type="button";b.disabled=flag=="1";if(flag=="2")b.classList.add("mffchecked");b.style.cssText="white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;";if(image){var sources=image.split("|");var img=document.createElement("img");img.src=sources.shift();img.alt=text;img.style.cssText="width: 16px; height: 16px; display: block; flex: 0 0 16px;"+(b.disabled?" opacity: 0.4;":"");b.appendChild(img);if(showText){var label=document.createElement("span");label.textContent=text;label.style.cssText="overflow: hidden; text-overflow: ellipsis;";b.appendChild(label)}img.addEventListener("error",function(){if(sources.length){img.src=sources.shift()}else if(showText){img.style.visibility="hidden"}else{img.replaceWith(document.createTextNode(text))}});b.title=hint||text;b.style.cssText+=" padding: "+(showText||arrow?"2px 3px":"2px")+"; background: transparent; border: 1px solid transparent;";b.classList.add("mffflat")}else{b.appendChild(document.createTextNode(text));if(hint&&hint!=text)b.title=hint}if(palette){if(options.indexOf("G")>=0){b.style.cssText+=" font: inherit; flex: 0 0 100%; box-sizing: border-box; justify-content: flex-start; padding: 2px 4px; margin-top: 1px; border: 1px solid var(--mff-border, #c4c4c4); border-radius: 2px; background: var(--mff-face, #ececec);";b.classList.add("mffgroup")}else{b.style.cssText+=" font: inherit; box-sizing: border-box; justify-content: flex-start; width: "+paletteWidth+"px; max-width: 100%;"}}var dropArrow=null;if(arrow){dropArrow=document.createElement("span");dropArrow.style.cssText="display: inline-flex; align-items: center; align-self: stretch;"+(whole?"":" padding-left: 3px; border-left: 1px solid var(--mff-border, #ccc);");var triangle=document.createElement("span");triangle.style.cssText="width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid "+(b.disabled?"var(--mff-disabled, #aaa)":"var(--mff-glyph, #444)")+";";dropArrow.appendChild(triangle);b.mffTriangle=triangle;b.appendChild(dropArrow)}b.addEventListener("click",function(ev){ev.stopPropagation();e.setAttribute("data-position",i);var r=b.getBoundingClientRect();e.setAttribute("data-dropdown",whole||dropArrow&&dropArrow.contains(ev.target)?"1":"0");e.setAttribute("data-x",Math.round(r.left));e.setAttribute("data-y",Math.round(r.bottom));mff.call("ONCHANGE",[Id])},false)}if(flag=="4")b.style.display="none";row.appendChild(b)})};row.mffSet(mff.str(Items))}function _SETCAPTIONSTATE(Id,State){var min=mff.el(String(Id)+"MinButton"),max=mff.el(String(Id)+"MaxButton");if(min){min.setAttribute("data-glyph",State==1?"restore":"min");min.title=State==1?"Restore Up":"Minimize"}if(max){max.setAttribute("data-glyph",State==2?"restore":"max");max.title=State==2?"Restore Down":"Maximize"}}function _SETCHANGEEVENT(Id){var e=mff.el(Id);if(!e)return;var tag=e.tagName;var ev=tag=="INPUT"&&(e.type=="text"||e.type=="password"||e.type=="search"||e.type=="range"||e.type=="number")||tag=="TEXTAREA"||e.isContentEditable?"input":"change";e.setAttribute("data-mffchange","1");if(e.tagName!="SELECT"&&e.querySelector(".mffitem"))mff.listInit(e);mff.on(Id,ev,function(evt){var owner=evt.target&&evt.target.closest?evt.target.closest("[data-mffchange]"):e;if(owner&&owner!==e)return;var item=evt.target&&evt.target.closest?evt.target.closest(".mffitem"):null;if(item&&item.parentNode===e)e.setAttribute("data-position",Array.prototype.indexOf.call(mff.items(e),item));mff.call("ONCHANGE",[Id])})}function _SETCHECKED(Id,Value){var e=mff.el(mff.str(Id));if(e)e.checked=!!Value}function _SETCLICKEVENT(Id){mff.on(Id,"click",function(e){e.stopPropagation();if(mff.ownEvent(e))mff.call("ONCLICK",[Id])})}function _SETDBLCLICKEVENT(Id){mff.on(Id,"dblclick",function(e){e.stopPropagation();if(mff.ownEvent(e))mff.call("ONDBLCLICK",[Id])})}function _SETDRAGEVENT(Id){var e=mff.el(Id);if(!e)return;var x0=0,y0=0,down=false;function report(state,ev){e.setAttribute("data-drag",state);e.setAttribute("data-dx",Math.round(ev.clientX-x0));e.setAttribute("data-dy",Math.round(ev.clientY-y0));mff.call("ONCHANGE",[Id])}e.addEventListener("pointerdown",function(ev){down=true;x0=ev.clientX;y0=ev.clientY;if(e.setPointerCapture)e.setPointerCapture(ev.pointerId);ev.preventDefault();report(1,ev)});e.addEventListener("pointermove",function(ev){if(down)report(2,ev)});function up(ev){if(!down)return;down=false;report(3,ev)}e.addEventListener("pointerup",up);e.addEventListener("pointercancel",up)}function _SETFONT(Id,Value){var e=mff.el(Id);if(e)e.style.font=mff.str(Value)}function _SETFORECOLOR(Id,Value){var e=mff.el(Id);if(e)e.style.color=mff.color(Value)}function _SETFORMICON(Id,URLs,Main){var sources=mff.str(URLs),old=mff.el(String(Id)+"Icon");if(!sources){if(old)old.remove();return}mff.findImage(sources.split("|"),function(url){var header=mff.el(String(Id)+"Header"),img=mff.el(String(Id)+"Icon");if(header&&!img){img=document.createElement("img");img.id=String(Id)+"Icon";img.className="mffcaptionicon";header.insertBefore(img,header.firstChild)}if(img)img.src=url;if(Main){var link=document.querySelector("link[rel~='icon']");if(!link){link=document.createElement("link");link.rel="icon";document.head.appendChild(link)}link.href=url}})}function _SETGOTFOCUSEVENT(Id){var e=mff.el(Id);if(e)e.mffGotFocusEvent=true;mff.on(Id,"focus",function(){mff.call("ONGOTFOCUS",[Id])})}function _SETHOTKEYEVENT(Id){mff.on(Id,"keydown",function(ev){if(ev.key=="Tab")return;mff.prevent(ev);var e=mff.el(Id);var k=ev.key;if(k=="Control"||k=="Shift"||k=="Alt"||k=="Meta")k="";else if(k==" ")k="Space";else if(k.length==1)k=k.toUpperCase();if(k=="Backspace"&&!ev.ctrlKey&&!ev.shiftKey&&!ev.altKey)e.value="";else e.value=(ev.ctrlKey?"Ctrl+":"")+(ev.shiftKey?"Shift+":"")+(ev.altKey?"Alt+":"")+k;mff.call("ONCHANGE",[Id])})}function _SETINNERHTML(Id,Value){var e=mff.el(Id);if(e)e.innerHTML=mff.str(Value)}function _SETINNERTEXT(Id,Value){var e=mff.el(Id);if(e)e.textContent=mff.str(Value)}function _SETINNERTEXTBYSTRINGID(Id,Value){var e=mff.el(mff.str(Id));if(e)e.textContent=mff.str(Value)}function _SETITEMCHECKED(Id,Index,Value){var e=mff.el(Id);if(!e)return;var items=mff.items(e);var box=Index>=0&&Index<items.length?items[Index].querySelector("input"):null;if(box)box.checked=!!Value}function _SETKEYDOWNEVENT(Id){var el=mff.el(Id);if(el&&!el.hasAttribute("tabindex"))el.tabIndex=0;if(typeof Terminal!=="undefined"&&Terminal.prototype.globals&&Terminal.prototype.globals.activeTerm)Terminal.prototype.globals.activeTerm.lock=true;mff.on(Id,"keydown",function(e){if(mff.call("ONKEYDOWN",[Id,mff.key(e),mff.shift(e)]))mff.prevent(e)})}function _SETKEYPRESSEVENT(Id){mff.on(Id,"keypress",function(e){if(mff.call("ONKEYPRESS",[Id,mff.key(e),mff.shift(e)]))mff.prevent(e)})}function _SETKEYUPEVENT(Id){mff.on(Id,"keyup",function(e){if(mff.call("ONKEYUP",[Id,mff.key(e),mff.shift(e)]))mff.prevent(e)})}function _SETLINKEVENT(Id){mff.on(Id,"click",function(ev){var e=mff.el(Id);var a=ev.target&&ev.target.closest?ev.target.closest("a"):null;if(!a||!e||!e.contains(a))return;ev.preventDefault();var links=e.querySelectorAll("a");e.setAttribute("data-position",Array.prototype.indexOf.call(links,a));e.setAttribute("data-link",a.getAttribute("href")||a.getAttribute("id")||"");mff.call("ONCHANGE",[Id])})}function _SETLOADEVENT(Id){function fire(){if(mff.pageSleep){setTimeout(fire,10);return}mff.call("ONLOAD",[Id])}setTimeout(fire,0)}function _SETLOSTFOCUSEVENT(Id){mff.on(Id,"blur",function(){mff.call("ONLOSTFOCUS",[Id])})}function _SETMAINMENU(Id,Captions){var form=mff.el(Id);if(!form)return;var bar=mff.el(String(Id)+"MainMenu");if(!bar){bar=document.createElement("div");bar.id=String(Id)+"MainMenu";bar.className="unselectable";bar.style.cssText="display: flex; flex-wrap: wrap; box-sizing: border-box; background: var(--mff-face, #f0f0f0); color: var(--mff-text, #000); border: 1px solid var(--mff-border, #ccc); border-bottom: none; font: 8pt Tahoma, sans-serif; user-select: none;";bar.style.marginLeft=form.style.marginLeft;bar.style.marginTop=form.style.marginTop;bar.style.width=form.offsetWidth+"px";form.style.marginTop="0px";form.insertAdjacentElement("beforebegin",bar)}bar.innerHTML="";mff.str(Captions).split("\n").forEach(function(Caption,Index){if(Caption=="")return;var item=document.createElement("div");item.textContent=Caption;item.style.cssText="padding: 3px 8px; cursor: default; white-space: nowrap;";item.className="mffmenubaritem";item.addEventListener("mouseenter",function(){if(mff.menuBarItem!=item)item.style.background="var(--mff-menu-hover, #dde8f5)"});item.addEventListener("mouseleave",function(){if(mff.menuBarItem!=item)item.style.background=""});item.addEventListener("mousedown",function(e){e.preventDefault();if(mff.popupOpen)return;mff.menuBarItem=item;item.style.background="var(--mff-hot, #cce4ff)";var r=item.getBoundingClientRect();mff.call("ONMAINMENU",[Id,Index,Math.round(r.left),Math.round(r.bottom)])});bar.appendChild(item)});window.dispatchEvent(new Event("resize"))}function _SETMOUSEDOWNEVENT(Id){mff.mouseCapture();mff.on(Id,"mousedown",function(e){if(e.mffDone||!mff.ownEvent(e))return;e.mffDone=true;mff.captureId=Id;e.currentTarget.mffDownRect=e.currentTarget.getBoundingClientRect();var p=mff.mousePos(e.currentTarget,e);mff.call("ONMOUSEDOWN",[Id,e.button,p[0],p[1],mff.shift(e)])})}function _SETMOUSEENTEREVENT(Id){mff.on(Id,"mouseenter",function(){mff.call("ONMOUSEENTER",[Id])})}function _SETMOUSELEAVEEVENT(Id){mff.on(Id,"mouseleave",function(){mff.call("ONMOUSELEAVE",[Id])})}function _SETMOUSEMOVEEVENT(Id){mff.mouseIds.move[Id]=true;mff.on(Id,"mousemove",function(e){if(e.mffDone||!mff.ownEvent(e))return;e.mffDone=true;var p=mff.mousePos(e.currentTarget,e);mff.call("ONMOUSEMOVE",[Id,e.buttons,p[0],p[1],mff.shift(e)])})}function _SETMOUSEUPEVENT(Id){mff.mouseCapture();mff.mouseIds.up[Id]=true;mff.on(Id,"mouseup",function(e){if(e.mffDone||!mff.ownEvent(e))return;e.mffDone=true;var p=mff.mousePos(e.currentTarget,e);mff.call("ONMOUSEUP",[Id,e.button,p[0],p[1],mff.shift(e)])})}function _SETMOUSEWHEELEVENT(Id){mff.on(Id,"wheel",function(e){if(e.defaultPrevented||!mff.ownEvent(e))return;var p=mff.mousePos(e.currentTarget,e);if(mff.call("ONMOUSEWHEEL",[Id,e.deltaY<0?1:-1,p[0],p[1],mff.shift(e)]))e.preventDefault()})}function _SETMULTIPLE(Id,Value){var e=mff.el(Id);if(e)e.multiple=!!Value}function _SETPAGEDARKMODE(Value){document.documentElement.classList.toggle("mffdark",!!Value)}function _SETPARENTELEMENT(Id,Parent){var e=mff.el(Id),p=mff.el(String(Parent)+"Client")||mff.el(Parent);if(e&&p&&e.parentNode!==p&&!e.contains(p))p.appendChild(e);if(e&&p&&e.classList.contains("mffdesign"))p.style.overflow="auto"}function _SETPOSITION(Id,Value){var e=mff.el(Id);if(!e)return;if(mff.scrollBar(e)){e.setAttribute("data-position",Value);mff.scrollBarLayout(e);return}if(e.tagName=="PROGRESS"){e.value=Math.max(0,Value-Number(e.getAttribute("data-min")||0))}else if(e.hasAttribute("data-tabs")){e.setAttribute("data-position",Value);var tabs=e.querySelectorAll(":scope > .mfftabs > button");for(var i=0;i<tabs.length;i++)tabs[i].className=i==Value?"mfftab selected":"mfftab"}else if(e.hasAttribute("data-position")){e.setAttribute("data-position",Value)}else{e.value=Value}}function _SETRANGE(Id,MinValue,MaxValue){var e=mff.el(Id);if(!e)return;if(mff.scrollBar(e)){e.setAttribute("data-min",MinValue);e.setAttribute("data-max",MaxValue);mff.scrollBarLayout(e)}else if(e.tagName=="PROGRESS"){var pos=Number(e.value)+Number(e.getAttribute("data-min")||0);e.setAttribute("data-min",MinValue);e.max=Math.max(1,MaxValue-MinValue);e.value=Math.max(0,pos-MinValue)}else{e.min=MinValue;e.max=MaxValue}}function _SETREADONLY(Id,Value){var e=mff.el(Id);if(!e)return;if(e.classList.contains("mffrichtext"))e.contentEditable=Value?"false":"true";else e.readOnly=!!Value}function _SETSELECTEDINDEX(Id,Value){var e=mff.el(Id);if(!e)return;if(e.tagName=="INPUT"){var o=mff.list(e).options[Value];e.value=o?o.value:""}else if(e.tagName!="SELECT"){mff.listInit(e);mff.listSelect(e,Value)}else{e.selectedIndex=Value;if(e.mffImages)mff.comboFace(e)}}function _SETSELECTITEMIMAGE(Id,Index,URLs,Indent){var e=mff.el(Id);if(!e||e.tagName!="SELECT"||!e.options[Index])return;var o=e.options[Index],sources=mff.str(URLs);o.style.paddingLeft=Indent*10+(sources?20:2)+"px";o.mffIndent=Indent;if(!sources){o.removeAttribute("data-img");o.style.backgroundImage="";return}mff.comboInit(e);mff.findImage(sources.split("|"),function(url){o.setAttribute("data-img",url);o.style.backgroundImage='url("'+url+'")';o.style.backgroundRepeat="no-repeat";o.style.backgroundPosition=Indent*10+2+"px center";o.style.backgroundSize="16px 16px";if(o.index==e.selectedIndex)mff.comboFace(e)})}function _SETSIZE(Id,Value){var e=mff.el(Id);if(e)e.size=Value}function _SETSTRINGVALUE(Id,Value){var e=mff.el(Id);if(!e)return;if(e.classList.contains("mffrichtext"))e.textContent=mff.str(Value);else e.value=mff.str(Value)}function _SETSTYLE(Id,Name,Value){var e=mff.el(Id);if(e)e.style.setProperty(mff.str(Name),mff.str(Value))}function _SETTABS(Id,Titles){var e=mff.el(Id);if(!e)return;e.setAttribute("data-tabs","1");if(!e.hasAttribute("data-position"))e.setAttribute("data-position","0");var strip=e.querySelector(":scope > .mfftabs");if(!strip){strip=document.createElement("div");strip.className="mfftabs";e.insertAdjacentElement("afterbegin",strip)}Array.prototype.slice.call(e.childNodes).forEach(function(n){if(n.nodeType==3)e.removeChild(n)});var pos=Number(e.getAttribute("data-tabpos")||2);var vertical=pos==0||pos==1;strip.style.cssText="position: absolute; display: flex; overflow: hidden; "+["left: 0; top: 0; bottom: 0; width: 26px; flex-direction: column; border-right: 1px solid #aaa;","right: 0; top: 0; bottom: 0; width: 26px; flex-direction: column; border-left: 1px solid #aaa;","left: 0; top: 0; right: 0; height: 26px; border-bottom: 1px solid var(--mff-border, #aaa);","left: 0; bottom: 0; right: 0; height: 26px; border-top: 1px solid #aaa;"][pos]||"";var client=mff.el(String(Id)+"Client");if(!client){client=document.createElement("div");client.id=String(Id)+"Client";Array.prototype.slice.call(e.children).forEach(function(c){if(c!==strip)client.appendChild(c)});e.appendChild(client)}client.style.cssText="position: absolute; "+["left: 27px; top: 0; right: 0; bottom: 0;","left: 0; top: 0; right: 27px; bottom: 0;","left: 0; top: 27px; right: 0; bottom: 0;","left: 0; top: 0; right: 0; bottom: 27px;"][pos];strip.innerHTML="";var titles=mff.str(Titles);var list=titles==""?[]:titles.split("\n");var selected=Number(e.getAttribute("data-position"))|0;list.forEach(function(title,i){var b=document.createElement("button");b.type="button";b.className=i==selected?"mfftab selected":"mfftab";var parts=title.split("\t");b.textContent=parts[0];if(parts[2]){var sources=parts[2].split("|");var img=document.createElement("img");img.src=sources.shift();img.alt="";img.style.cssText="width: 16px; height: 16px; vertical-align: middle; margin-right: 4px;"+(vertical?" transform: rotate(90deg);":"");img.addEventListener("error",function(){if(sources.length)img.src=sources.shift();else img.remove()});b.insertBefore(img,b.firstChild)}if(parts[1]=="x"){var x=document.createElement("span");x.textContent="×";x.title="Close";x.style.cssText="margin-left: 6px; padding: 0 3px; border-radius: 3px; color: var(--mff-gray, #666); font-weight: normal;";x.onmouseenter=function(){x.style.background="#e81123";x.style.color="#fff"};x.onmouseleave=function(){x.style.background="";x.style.color="var(--mff-gray, #666)"};x.addEventListener("click",function(ev){ev.stopPropagation();e.setAttribute("data-close",i);mff.call("ONCHANGE",[Id])});b.appendChild(x)}b.style.cssText=vertical?"margin-bottom: 2px; border: 1px solid var(--mff-border, #aaa); writing-mode: vertical-rl; padding: 8px 2px; white-space: nowrap;"+(pos==0?" border-right: none; border-radius: 4px 0 0 4px; transform: rotate(180deg);":" border-left: none; border-radius: 0 4px 4px 0;"):"margin-right: 2px; border: 1px solid #aaa; display: inline-flex; align-items: center; "+(pos==3?"border-top: none; border-radius: 0 0 4px 4px;":"border-bottom: none; border-radius: 4px 4px 0 0;");if(vertical||pos==3)b.style.top="0";b.addEventListener("click",function(ev){e.setAttribute("data-position",i);var tabs=strip.querySelectorAll("button");for(var j=0;j<tabs.length;j++)tabs[j].className=j==i?"mfftab selected":"mfftab";mff.call("ONCHANGE",[Id])},false);strip.appendChild(b)})}function _SETTITLE(value){document.title=mff.str(value)}function _SETUNLOADEVENT(Id){window.addEventListener("unload",function(){mff.call("ONUNLOAD",[Id])})}function _SETVISIBLE(Id,value){var e=mff.el(Id);if(e)e.style.display=value?e.getAttribute("data-display")||"":"none"}function _SETVISIBLEBYSTRINGID(Id,value){var e=mff.el(mff.str(Id));if(e)e.style.display=value?"":"none"}function _SHOWCOLORDIALOG(Caption,Color){var d=mffDialog;return d.show(mff.str(Caption)||"Color",function(box,close){var color=d.input(box,"color","#"+[Color&255,Color>>8&255,Color>>16&255].map(function(c){return("0"+c.toString(16)).slice(-2)}).join(""));color.style.cssText="width: 100%; height: 48px;";var buttons=d.row(box);buttons.style.justifyContent="flex-end";d.button(buttons,"OK",function(){var c=parseInt(color.value.slice(1),16);close((c&255)<<16|c&65280|c>>16&255)});d.button(buttons,"Cancel",function(){close(-1)})})}_SHOWCOLORDIALOG.isAsync=true;function _SHOWFILEDIALOG(Mode,Caption,InitialDir,FileName,Filter,FilterIndex){var d=mffDialog,fileName=mff.str(FileName),dir=mff.str(InitialDir).replace(/\\/g,"/");var filters=d.filters(mff.str(Filter));if(fileName.indexOf("/")>=0){if(!dir)dir=fileName.substring(0,fileName.lastIndexOf("/"))||"/";fileName=fileName.substring(fileName.lastIndexOf("/")+1)}if(!dir||!d.isDir(dir))dir=FS.cwd();var result=d.show(mff.str(Caption)||["Open","Open","Save As","Select Folder"][Mode],function(box,close){box.parentNode.style.width="600px";var top=d.row(box);top.style.flexWrap="nowrap";var path=d.input(top,"text",dir);path.style.flex="1";path.style.minWidth="0";var list=d.fileView(box,{onSelect:function(it){if(name&&!it.mffDir)name.value=it.mffName},onOpen:function(it){if(it.mffDir)open(it.mffName);else if(Mode!=3){name.value=it.mffName;ok()}}});list.multiple=Mode==1;list.el.style.height="260px";d.viewButtons(top,list);var name=null,type=null;if(Mode!=3){name=d.input(d.row(box),"text",fileName);name.style.flex="1";name.placeholder="File name";if(filters.length){type=document.createElement("select");filters.forEach(function(f,i){type.add(new Option(f.text,i))});type.selectedIndex=Math.max(0,Math.min(FilterIndex-1,filters.length-1));type.onchange=fill;name.parentNode.appendChild(type)}}function fill(){path.value=dir;var re=type?filters[type.selectedIndex].re:null;list.fill(dir,Mode==3?null:function(n){return!re||re.test(n)})}function open(n){dir=n==".."?d.parent(dir):d.join(dir,n);fill()}function ok(){if(Mode==3){var sel=list.selected()[0];close(sel&&sel.mffName!=".."?d.join(dir,sel.mffName):dir);return}var names=Mode==1?list.selected().filter(function(it){return!it.mffDir}).map(function(it){return it.mffName}):[];if(!names.length&&name.value)names=[name.value];if(!names.length)return;if(Mode==2&&type&&!d.isDir(names[0].charAt(0)=="/"?names[0]:d.join(dir,names[0]))){var f=filters[type.selectedIndex],title=names[0].substring(names[0].lastIndexOf("/")+1);if(f.ext&&!f.re.test(title))names[0]+=f.ext}var paths=names.map(function(n){return n.charAt(0)=="/"?n:d.join(dir,n)});if(paths.length==1&&d.isDir(paths[0])){dir=paths[0];name.value="";fill();return}if(Mode==2){if(FS.analyzePath(paths[0]).exists&&!confirm(paths[0]+"\n\nThe file already exists. Replace it?"))return}else if(!paths.every(function(p){return FS.analyzePath(p).exists})){alert("The file was not found.");return}close(paths.join("\n"))}path.onkeydown=function(e){if(e.key=="Enter"&&d.isDir(path.value)){dir=path.value;fill()}};if(name)name.onkeydown=function(e){if(e.key=="Enter")ok()};var buttons=d.row(box);buttons.style.justifyContent="flex-end";if(Mode<=1){d.button(buttons,"Upload...",function(){var f=document.createElement("input");f.type="file";f.multiple=true;f.onchange=function(){var pending=f.files.length;Array.prototype.forEach.call(f.files,function(file){file.arrayBuffer().then(function(buf){FS.writeFile(d.join(dir,file.name),new Uint8Array(buf));if(--pending==0){fill();name.value=file.name}})})};f.click()})}else{d.button(buttons,"New folder",function(){var n=prompt("Folder name:");if(!n)return;try{FS.mkdir(d.join(dir,n))}catch(err){alert(err.message||err)}fill()})}d.button(buttons,Mode==2?"Save":"OK",ok);d.button(buttons,"Cancel",function(){close("")});fill();(name||list.el).focus()});return result?stringToNewUTF8(result):0}_SHOWFILEDIALOG.isAsync=true;function _SHOWFONTDIALOG(FontName,Size,Style,Color){var d=mffDialog;var result=d.show("Font",function(box,close){var r1=d.row(box);var name=d.input(r1,"text",mff.str(FontName));name.style.flex="1";name.setAttribute("list","mff-fonts");var fonts=document.createElement("datalist");fonts.id="mff-fonts";["Arial","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Verdana","monospace","sans-serif","serif"].forEach(function(f){fonts.appendChild(new Option(f))});r1.appendChild(fonts);var size=d.input(r1,"number",Size||10);size.min=1;size.style.width="60px";var color=d.input(r1,"color","#"+[Color&255,Color>>8&255,Color>>16&255].map(function(c){return("0"+c.toString(16)).slice(-2)}).join(""));var r2=d.row(box),checks=[];["Bold","Italic","Underline","Strikeout"].forEach(function(text,i){var l=document.createElement("label");var c=document.createElement("input");c.type="checkbox";c.checked=(Style&1<<i)!=0;c.onchange=preview;l.appendChild(c);l.appendChild(document.createTextNode(" "+text));r2.appendChild(l);checks.push(c)});var sample=document.createElement("div");sample.textContent="AaBbYyZz 0123";sample.style.cssText="border: 1px solid var(--mff-border, #ccc); padding: 8px; min-height: 40px; overflow: hidden;";box.appendChild(sample);function style(){return checks.reduce(function(s,c,i){return s|(c.checked?1<<i:0)},0)}function preview(){var s=style();sample.style.fontFamily="'"+name.value+"'";sample.style.fontSize=size.value+"pt";sample.style.fontWeight=s&1?"bold":"normal";sample.style.fontStyle=s&2?"italic":"normal";sample.style.textDecoration=[s&4?"underline":"",s&8?"line-through":""].join(" ").trim()||"none";sample.style.color=color.value}name.oninput=size.oninput=color.oninput=preview;preview();var buttons=d.row(box);buttons.style.justifyContent="flex-end";d.button(buttons,"OK",function(){var c=parseInt(color.value.slice(1),16);close([name.value,size.value,style(),(c&255)<<16|c&65280|c>>16&255].join("\n"))});d.button(buttons,"Cancel",function(){close("")})});return result?stringToNewUTF8(result):0}_SHOWFONTDIALOG.isAsync=true;function _SHOWINPUTBOX(Caption,Message,DefaultText,Password){var ttl=mff.str(Caption),msg=mff.str(Message),def=mff.str(DefaultText);if(Asyncify.state===Asyncify.State.Normal&&mff.cannotWait()){var r=prompt((ttl?ttl+"\n\n":"")+msg,def);return r===null?0:stringToNewUTF8(r)}return Asyncify.handleSleep(function(wakeUp){var back=document.createElement("div");back.style.cssText="position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.15); z-index: 10000; display: flex; align-items: center; justify-content: center;";var box=document.createElement("div");box.style.cssText="background: var(--mff-window, #fff); color: var(--mff-text, #000); font: 8pt Tahoma, sans-serif; border: 1px solid var(--mff-frame, #5b7fae); border-radius: 6px; "+"filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35)); width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden;";var title=document.createElement("div");title.style.cssText="height: 28px; box-sizing: border-box; display: flex; align-items: center; padding: 0 4px 0 10px; "+"background: var(--mff-caption, linear-gradient(#f4f8fc, #dce7f3)); border-bottom: 1px solid var(--mff-caption-line, #b9cbe0); color: var(--mff-caption-text, #1e3a5f); font-weight: bold; user-select: none; flex: 0 0 auto;";var titleText=document.createElement("span");titleText.textContent=ttl||document.title;titleText.style.cssText="flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;";var x=document.createElement("div");x.textContent="✕";x.title="Close";x.style.cssText="flex: 0 0 auto; width: 30px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; color: var(--mff-caption-button, #44546a); font-size: 12px; font-weight: normal;";x.onmouseenter=function(){x.style.background="#e81123";x.style.color="#fff"};x.onmouseleave=function(){x.style.background="";x.style.color="var(--mff-caption-button, #44546a)"};title.appendChild(titleText);title.appendChild(x);var body=document.createElement("div");body.style.cssText="display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px 16px; overflow: auto;";var text=document.createElement("div");text.textContent=msg;text.style.cssText="white-space: pre-wrap; word-break: break-word; line-height: 1.4;";var input=document.createElement("input");input.type=Password?"password":"text";input.value=def;input.style.cssText="font: inherit; height: 22px; box-sizing: border-box; width: 100%;";body.appendChild(text);body.appendChild(input);var bar=document.createElement("div");bar.style.cssText="display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; background: var(--mff-face, #f0f0f0); border-top: 1px solid var(--mff-line, #dfdfdf); flex: 0 0 auto;";var done=false;function close(ok){if(done)return;done=true;document.removeEventListener("keydown",onKey,true);if(back.parentNode)back.parentNode.removeChild(back);wakeUp(ok?stringToNewUTF8(input.value):0)}[["OK",true],["Cancel",false]].forEach(function(item){var b=document.createElement("button");b.type="button";b.textContent=item[0];b.style.cssText="min-width: 75px; height: 23px; font: inherit; padding: 0 10px;";b.addEventListener("click",function(){close(item[1])});bar.appendChild(b)});x.addEventListener("click",function(){close(false)});function onKey(e){if(e.key=="Escape"){e.preventDefault();e.stopPropagation();close(false)}else if(e.key=="Enter"&&(document.activeElement===input||!bar.contains(document.activeElement))){e.preventDefault();e.stopPropagation();close(true)}else if(!box.contains(e.target)){e.stopPropagation()}}document.addEventListener("keydown",onKey,true);box.appendChild(title);box.appendChild(body);box.appendChild(bar);back.appendChild(box);document.body.appendChild(back);input.focus();input.select()})}_SHOWINPUTBOX.isAsync=true;function _SHOWPOPUPMENU(Items,x,y){var lines=mff.str(Items).split("\n").filter(function(l){return l.length}).map(function(l,i){var p=l.split("\t");return{index:i,level:+p[0],enabled:p[1]=="1",checked:p[2]=="1",image:p[3],caption:p.slice(4).join("\t"),items:[]}});var root={items:[]},stack=[root];lines.forEach(function(it){stack.length=Math.min(stack.length,it.level+1);(stack[stack.length-1]||root).items.push(it);stack.push(it)});if(mff.popupOpen||Asyncify.state===Asyncify.State.Normal&&mff.cannotWait())return-1;return Asyncify.handleSleep(function(wakeUp){mff.popupOpen=true;var menus=[],done=false;var back=document.createElement("div");back.style.cssText="position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10001;";document.body.appendChild(back);var barItem=mff.menuBarItem||null;function close(result){if(done)return;done=true;document.body.removeChild(back);document.removeEventListener("keydown",onKey,true);if(barItem){barItem.style.background="";if(mff.menuBarItem==barItem)mff.menuBarItem=null}mff.popupOpen=false;wakeUp(result)}function barItemAt(x,y){if(!barItem||!barItem.parentElement)return null;var items=barItem.parentElement.children;for(var j=0;j<items.length;j++){var r=items[j].getBoundingClientRect();if(x>=r.left&&x<r.right&&y>=r.top&&y<r.bottom)return items[j]}return null}back.addEventListener("mousemove",function(e){var other=barItemAt(e.clientX,e.clientY);if(!other||other==barItem)return;close(-1);setTimeout(function(){other.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}))},0)});back.addEventListener("mousedown",function(e){if(barItemAt(e.clientX,e.clientY)==barItem&&barItem){e.preventDefault();close(-1)}});function onKey(e){if(e.key=="Escape"){e.preventDefault();close(-1)}}document.addEventListener("keydown",onKey,true);back.addEventListener("mousedown",function(e){if(e.target==back)close(-1)});back.addEventListener("contextmenu",function(e){e.preventDefault()});function show(items,left,top,depth){while(menus.length>depth)back.removeChild(menus.pop());var m=document.createElement("div");m.style.cssText="position: absolute; background: var(--mff-window, #fff); color: var(--mff-text, #000); font: 8pt Tahoma, sans-serif; border: 1px solid var(--mff-border, #aaa); box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25); padding: 2px 0; min-width: 160px;";items.forEach(function(it){var row=document.createElement("div");if(it.caption=="-"){row.style.cssText="border-top: 1px solid var(--mff-line, #ddd); margin: 3px 0;";m.appendChild(row);return}row.style.cssText="padding: 4px 24px 4px 28px; white-space: nowrap; position: relative; cursor: default; display: flex;"+(it.enabled?"":" color: var(--mff-disabled, #999);");var parts=it.caption.replace(/&(.)/g,"$1").split("\t");var text=document.createElement("span");text.textContent=parts[0];text.style.cssText="flex: 1;";row.appendChild(text);if(parts[1]){var k=document.createElement("span");k.textContent=parts[1];k.style.cssText="margin-left: 24px; color: "+(it.enabled?"var(--mff-gray, #555)":"var(--mff-disabled, #aaa)")+";";row.appendChild(k)}if(it.checked){var c=document.createElement("span");c.textContent="✓";c.style.cssText="position: absolute; left: 8px;";row.appendChild(c)}else if(it.image){var img=document.createElement("img");img.src=it.image;img.style.cssText="position: absolute; left: 5px; top: 50%; margin-top: -8px; width: 16px; height: 16px;"+(it.enabled?"":" opacity: 0.4;");img.addEventListener("error",function(){img.remove()});row.appendChild(img)}if(it.items.length){var a=document.createElement("span");a.textContent="▸";a.style.cssText="position: absolute; right: 8px;";row.appendChild(a)}row.onmouseenter=function(){row.style.background=it.enabled?"var(--mff-hot, #cce4ff)":"";if(it.items.length&&it.enabled){var r=row.getBoundingClientRect();show(it.items,r.right-2,r.top-3,depth+1)}else{while(menus.length>depth+1)back.removeChild(menus.pop())}};row.onmouseleave=function(){row.style.background=""};row.onclick=function(){if(!it.enabled||it.items.length)return;close(it.index)};m.appendChild(row)});back.appendChild(m);menus.push(m);var w=m.offsetWidth,h=m.offsetHeight;m.style.left=Math.max(0,Math.min(left,window.innerWidth-w))+"px";m.style.top=Math.max(0,Math.min(top,window.innerHeight-h))+"px"}show(root.items,x,y,0)})}_SHOWPOPUPMENU.isAsync=true;function _STARTTIMER(Id,Interval){mff.timers=mff.timers||{};if(mff.timers[Id])clearInterval(mff.timers[Id]);mff.timers[Id]=setInterval(function(){mff.call("ONTIMER",[Id])},Math.max(1,Interval))}function _STOPTIMER(Id){if(mff.timers&&mff.timers[Id]){clearInterval(mff.timers[Id]);delete mff.timers[Id]}}function _TABLECELLRECT(Id,Row,Col,pRect){var e=mff.el(Id),r=[0,0,0,0];var row=e&&e.tBodies&&e.tBodies[0]?e.tBodies[0].rows[Row]:null;var c=row?row.cells[Col]:null;if(c){var b=c.getBoundingClientRect(),eb=e.getBoundingClientRect();var l=b.left-eb.left-e.clientLeft+e.scrollLeft,t=b.top-eb.top-e.clientTop+e.scrollTop;r=[l,t,l+c.clientLeft+c.clientWidth,t+b.height]}for(var i=0;i<4;i++)HEAP32[(pRect>>2)+i]=Math.round(r[i])}function _TABLECLEAR(Id){var e=mff.el(Id);if(e&&e.tBodies.length)e.tBodies[0].innerHTML="";if(e)e.setAttribute("data-position","-1")}function _TABLEINIT(Id){var e=mff.el(Id);if(!e||e.getAttribute("data-table"))return;e.setAttribute("data-table","1");e.setAttribute("data-position","-1");if(!e.hasAttribute("tabindex"))e.tabIndex=0;e.style.borderCollapse="separate";e.style.borderSpacing="0";e.setAttribute("data-display","block");if(e.style.display!="none")e.style.display="block";e.style.overflow="auto";var kids=Array.prototype.slice.call(e.children);e.innerHTML="<thead><tr></tr></thead><tbody></tbody>";kids.forEach(function(k){e.appendChild(k)});function row(ev){var tr=ev.target&&ev.target.closest?ev.target.closest("tbody > tr"):null;return tr&&e.contains(tr)?Array.prototype.indexOf.call(tr.parentNode.children,tr):-1}e.addEventListener("click",function(ev){var i=row(ev);if(i<0)return;mff.tableSelect(e,i);var toggle=ev.target.classList&&ev.target.classList.contains("mfftoggle")&&ev.target.hasAttribute("data-state");e.setAttribute("data-event",toggle?"toggle":"click");mff.call("ONCHANGE",[Id])});e.addEventListener("dblclick",function(ev){var i=row(ev);if(i<0)return;e.setAttribute("data-event","dblclick");mff.call("ONCHANGE",[Id])})}function _TABLEINSERTROW(Id,Index,Cells){var e=mff.el(Id);if(!e||!e.tBodies.length)return;var b=e.tBodies[0];var tr=document.createElement("tr");mff.tableFill(tr,mff.str(Cells),e);b.insertBefore(tr,Index>=0?b.rows[Index]||null:null);var p=Number(e.getAttribute("data-position"));if(Index>=0&&p>=Index)e.setAttribute("data-position",p+1)}function _TABLEREMOVEROW(Id,Index){var e=mff.el(Id);if(!e||!e.tBodies.length||!e.tBodies[0].rows[Index])return;e.tBodies[0].deleteRow(Index);var p=Number(e.getAttribute("data-position"));if(p==Index)e.setAttribute("data-position","-1");else if(p>Index)e.setAttribute("data-position",p-1)}function _TABLESETCOLUMNS(Id,Captions,Widths){var e=mff.el(Id);if(!e||!e.tHead)return;var tr=e.tHead.rows[0];tr.innerHTML="";var c=mff.str(Captions),w=mff.str(Widths).split("\n");if(c=="")return;c.split("\n").forEach(function(text,i){var th=document.createElement("th");th.textContent=text;th.style.cssText="position: sticky; top: 0; z-index: 1; background: var(--mff-header, #e8e8e8); border-right: 1px solid var(--mff-grid, #bbb); border-bottom: 1px solid var(--mff-grid, #bbb); padding: 2px 4px; text-align: left; white-space: nowrap; font-weight: normal; box-sizing: border-box;";if(w[i]&&Number(w[i])>0)th.style.minWidth=th.style.width=w[i]+"px";tr.appendChild(th)})}function _TABLESETINDEX(Id,Index){var e=mff.el(Id);if(e&&e.tBodies.length)mff.tableSelect(e,Index)}function _TABLESETROW(Id,Index,Cells){var e=mff.el(Id);if(e&&e.tBodies.length&&e.tBodies[0].rows[Index])mff.tableFill(e.tBodies[0].rows[Index],mff.str(Cells),e)}function _TABLESETVIEW(Id,View){var e=mff.el(Id);if(!e)return;e.classList.add("mfftable");e.setAttribute("data-view",mff.str(View)||"report")}function _TEXTGETSEL(Id){var e=mff.el(Id);if(!e)return stringToNewUTF8("0,0");if(e.classList.contains("mffrichtext")){mffRich.init();var r=mffRich.range(e);return stringToNewUTF8(mffRich.offsetOf(e,r.startContainer,r.startOffset)+","+mffRich.offsetOf(e,r.endContainer,r.endOffset))}return stringToNewUTF8((e.selectionStart||0)+","+(e.selectionEnd||0))}function _TEXTSETSEL(Id,Start,End){var e=mff.el(Id);if(!e)return;if(e.classList.contains("mffrichtext")){mffRich.init();mffRich.select(e,Start,End);return}if(e.setSelectionRange)e.setSelectionRange(Start,End)}function _WEBRUNPAGE(MainFile){var url=Module.webPages&&Module.webPages[mff.str(MainFile).split("\\").join("/").toLowerCase()];if(!url)return 0;window.open(url,"_blank");return 1}function ___syscall_chdir(path){try{path=SYSCALLS.getStr(path);FS.chdir(path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_dup3(fd,suggestFD,flags){try{var old=SYSCALLS.getStreamFromFD(fd);if(old.fd===suggestFD)return-28;var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.createStream(old,suggestFD,suggestFD+1).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.createStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 5:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_fstat64(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_getcwd(buf,size){try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx<stream.getdents.length&&pos+struct_size<=count){var id;var type;var name=stream.getdents[idx];if(name==="."){id=stream.node.id;type=4}else if(name===".."){var lookup=FS.lookupPath(stream.path,{parent:true});id=lookup.node.id;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}tempI64=[id>>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:return-28}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_mkdirat(dirfd,path,mode){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_readlinkat(dirfd,path,buf,bufsize){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_rmdir(path){try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_unlinkat(dirfd,path,flags){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path)}else if(flags===512){FS.rmdir(path)}else{abort("Invalid flags passed to unlinkat")}return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function readI53FromI64(ptr){return HEAPU32[ptr>>2]+HEAP32[ptr+4>>2]*4294967296}function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];function ydayFromDate(date){var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday}function __localtime_js(time,tmPtr){var date=new Date(readI53FromI64(time)*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst}function __tzset_js(timezone,daylight,tzname){var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=stringToNewUTF8(winterName);var summerNamePtr=stringToNewUTF8(summerName);if(summerOffset<winterOffset){HEAPU32[tzname>>2]=winterNamePtr;HEAPU32[tzname+4>>2]=summerNamePtr}else{HEAPU32[tzname>>2]=summerNamePtr;HEAPU32[tzname+4>>2]=winterNamePtr}}var readEmAsmArgsArray=[];function readEmAsmArgs(sigPtr,buf){readEmAsmArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){buf+=ch!=105&buf;readEmAsmArgsArray.push(ch==105?HEAP32[buf]:HEAPF64[buf++>>1]);++buf}return readEmAsmArgsArray}function runEmAsmFunction(code,sigPtr,argbuf){var args=readEmAsmArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_asm_const_int(code,sigPtr,argbuf){return runEmAsmFunction(code,sigPtr,argbuf)}function _emscripten_date_now(){return Date.now()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){var b=wasmMemory.buffer;try{wasmMemory.grow(size-b.byteLength+65535>>>16);updateMemoryViews();return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence<y.precedence})},removeDeferredCalls:function(targetFunction){for(var i=0;i<JSEvents.deferredCalls.length;++i){if(JSEvents.deferredCalls[i].targetFunction==targetFunction){JSEvents.deferredCalls.splice(i,1);--i}}},canPerformEventHandlerRequests:function(){return JSEvents.inEventHandler&&JSEvents.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!JSEvents.canPerformEventHandlerRequests()){return}for(var i=0;i<JSEvents.deferredCalls.length;++i){var call=JSEvents.deferredCalls[i];JSEvents.deferredCalls.splice(i,1);--i;call.targetFunction.apply(null,call.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(target,eventTypeString){for(var i=0;i<JSEvents.eventHandlers.length;++i){if(JSEvents.eventHandlers[i].target==target&&(!eventTypeString||eventTypeString==JSEvents.eventHandlers[i].eventTypeString)){JSEvents._removeHandler(i--)}}},_removeHandler:function(i){var h=JSEvents.eventHandlers[i];h.target.removeEventListener(h.eventTypeString,h.eventListenerFunc,h.useCapture);JSEvents.eventHandlers.splice(i,1)},registerOrRemoveHandler:function(eventHandler){var jsEventHandler=function jsEventHandler(event){++JSEvents.inEventHandler;JSEvents.currentEventHandler=eventHandler;JSEvents.runDeferredCalls();eventHandler.handlerFunc(event);JSEvents.runDeferredCalls();--JSEvents.inEventHandler};if(eventHandler.callbackfunc){eventHandler.eventListenerFunc=jsEventHandler;eventHandler.target.addEventListener(eventHandler.eventTypeString,jsEventHandler,eventHandler.useCapture);JSEvents.eventHandlers.push(eventHandler);JSEvents.registerRemoveEventListeners()}else{for(var i=0;i<JSEvents.eventHandlers.length;++i){if(JSEvents.eventHandlers[i].target==eventHandler.target&&JSEvents.eventHandlers[i].eventTypeString==eventHandler.eventTypeString){JSEvents._removeHandler(i--)}}}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};var specialHTMLTargets=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function getBoundingClientRect(e){return specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{"left":0,"top":0}}function fillMouseEventData(eventStruct,e,target){HEAPF64[eventStruct>>3]=e.timeStamp;var idx=eventStruct>>2;HEAP32[idx+2]=e.screenX;HEAP32[idx+3]=e.screenY;HEAP32[idx+4]=e.clientX;HEAP32[idx+5]=e.clientY;HEAP32[idx+6]=e.ctrlKey;HEAP32[idx+7]=e.shiftKey;HEAP32[idx+8]=e.altKey;HEAP32[idx+9]=e.metaKey;HEAP16[idx*2+20]=e.button;HEAP16[idx*2+21]=e.buttons;HEAP32[idx+11]=e["movementX"];HEAP32[idx+12]=e["movementY"];var rect=getBoundingClientRect(target);HEAP32[idx+13]=e.clientX-rect.left;HEAP32[idx+14]=e.clientY-rect.top}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!="undefined"?document.querySelector(target):undefined);return domElement}function registerMouseEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=findEventTarget(target);var mouseEventHandlerFunc=function(e=event){fillMouseEventData(JSEvents.mouseEvent,e,target);if(((a1,a2,a3)=>dynCall_iiii.apply(null,[callbackfunc,a1,a2,a3]))(eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_dblclick_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerMouseEventCallback(target,userData,useCapture,callbackfunc,7,"dblclick",targetThread);return 0}function registerKeyEventCallback(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread){if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(176);var keyEventHandlerFunc=function(e){var keyEventData=JSEvents.keyEvent;HEAPF64[keyEventData>>3]=e.timeStamp;var idx=keyEventData>>2;HEAP32[idx+2]=e.location;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;HEAP32[idx+7]=e.repeat;HEAP32[idx+8]=e.charCode;HEAP32[idx+9]=e.keyCode;HEAP32[idx+10]=e.which;stringToUTF8(e.key||"",keyEventData+44,32);stringToUTF8(e.code||"",keyEventData+76,32);stringToUTF8(e.char||"",keyEventData+108,32);stringToUTF8(e.locale||"",keyEventData+140,32);if(((a1,a2,a3)=>dynCall_iiii.apply(null,[callbackfunc,a1,a2,a3]))(eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}function _emscripten_set_keydown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread);return 0}function _emscripten_set_keypress_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerKeyEventCallback(target,userData,useCapture,callbackfunc,1,"keypress",targetThread);return 0}function _emscripten_set_keyup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread);return 0}function _emscripten_set_mousedown_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread);return 0}function _emscripten_set_mousemove_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread);return 0}function _emscripten_set_mouseup_callback_on_thread(target,userData,useCapture,callbackfunc,targetThread){registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread);return 0}function safeSetTimeout(func,timeout){return setTimeout(function(){callUserCallback(func)},timeout)}function _emscripten_sleep(ms){return Asyncify.handleSleep(wakeUp=>safeSetTimeout(wakeUp,ms))}_emscripten_sleep.isAsync=true;var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}HEAP8[buffer>>0]=0}function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!=="undefined"){offset+=curr}}return ret}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function convertI32PairToI53Checked(lo,hi){return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var offset=convertI32PairToI53Checked(offset_low,offset_high);if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function stringToUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_unlink"]=FS.unlink;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;var decodeBase64=typeof atob=="function"?atob:function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i<input.length);return output};function intArrayFromBase64(s){if(typeof ENVIRONMENT_IS_NODE=="boolean"&&ENVIRONMENT_IS_NODE){var buf=Buffer.from(s,"base64");return new Uint8Array(buf["buffer"],buf["byteOffset"],buf["byteLength"])}try{var decoded=decodeBase64(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i)}return bytes}catch(_){throw new Error("Converting base64 string to bytes failed.")}}var wasmImports={"ADDSELECTITEM":_ADDSELECTITEM,"BUTTONSITEMLEFT":_BUTTONSITEMLEFT,"BUTTONSITEMWIDTH":_BUTTONSITEMWIDTH,"CANVASARC":_CANVASARC,"CANVASBEGIN":_CANVASBEGIN,"CANVASCLIP":_CANVASCLIP,"CANVASCLOSEPATH":_CANVASCLOSEPATH,"CANVASCURVETO":_CANVASCURVETO,"CANVASEND":_CANVASEND,"CANVASFILL":_CANVASFILL,"CANVASFILLRECT":_CANVASFILLRECT,"CANVASIMAGE":_CANVASIMAGE,"CANVASINVERTRECT":_CANVASINVERTRECT,"CANVASLINETO":_CANVASLINETO,"CANVASMOVETO":_CANVASMOVETO,"CANVASNEWPATH":_CANVASNEWPATH,"CANVASRECTPATH":_CANVASRECTPATH,"CANVASRESTORE":_CANVASRESTORE,"CANVASROTATE":_CANVASROTATE,"CANVASSAVE":_CANVASSAVE,"CANVASSTROKE":_CANVASSTROKE,"CANVASTEXT":_CANVASTEXT,"CANVASTEXTHEIGHT":_CANVASTEXTHEIGHT,"CANVASTEXTWIDTH":_CANVASTEXTWIDTH,"CLEARSELECTITEMS":_CLEARSELECTITEMS,"CLIPBOARDGETTEXT":_CLIPBOARDGETTEXT,"CLIPBOARDSETTEXT":_CLIPBOARDSETTEXT,"COMPILEONSERVER":_COMPILEONSERVER,"CREATEELEMENT":_CREATEELEMENT,"DELETEELEMENT":_DELETEELEMENT,"ELEMENTCONTENTWIDTH":_ELEMENTCONTENTWIDTH,"ELEMENTNATURALSIZE":_ELEMENTNATURALSIZE,"ELEMENTSETBOUNDS":_ELEMENTSETBOUNDS,"ELEMENTSETFOCUS":_ELEMENTSETFOCUS,"ELEMENTZORDER":_ELEMENTZORDER,"FILEVIEWFILL":_FILEVIEWFILL,"FREEPTR":_FREEPTR,"GETATTRIBUTE":_GETATTRIBUTE,"GETCHECKED":_GETCHECKED,"GETCLIENTSIZE":_GETCLIENTSIZE,"GETDOCUMENTHEIGHT":_GETDOCUMENTHEIGHT,"GETDOCUMENTWIDTH":_GETDOCUMENTWIDTH,"GETITEMCHECKED":_GETITEMCHECKED,"GETPARENTPAGEOFFSET":_GETPARENTPAGEOFFSET,"GETPOSITION":_GETPOSITION,"GETSELECTEDINDEX":_GETSELECTEDINDEX,"GETSTRINGVALUE":_GETSTRINGVALUE,"INSERTSELECTITEM":_INSERTSELECTITEM,"MESSAGEBOX":_MESSAGEBOX,"MODALWAIT":_MODALWAIT,"MOUSEHOVERTIMER":_MOUSEHOVERTIMER,"OPENURL":_OPENURL,"PAGECREATE":_PAGECREATE,"PAGEDELETE":_PAGEDELETE,"PAGEDRAW":_PAGEDRAW,"PAGESLEEP":_PAGESLEEP,"PRINTPAGES":_PRINTPAGES,"REGEXCOMPILE":_REGEXCOMPILE,"REGEXERROR":_REGEXERROR,"REGEXEXEC":_REGEXEXEC,"REGEXFREE":_REGEXFREE,"REMOVESELECTITEM":_REMOVESELECTITEM,"RICHTEXTCMD":_RICHTEXTCMD,"SENDHTTPREQUEST":_SENDHTTPREQUEST,"SETATTRIBUTE":_SETATTRIBUTE,"SETBUTTONS":_SETBUTTONS,"SETCAPTIONSTATE":_SETCAPTIONSTATE,"SETCHANGEEVENT":_SETCHANGEEVENT,"SETCHECKED":_SETCHECKED,"SETCLICKEVENT":_SETCLICKEVENT,"SETDBLCLICKEVENT":_SETDBLCLICKEVENT,"SETDRAGEVENT":_SETDRAGEVENT,"SETFONT":_SETFONT,"SETFORECOLOR":_SETFORECOLOR,"SETFORMICON":_SETFORMICON,"SETGOTFOCUSEVENT":_SETGOTFOCUSEVENT,"SETHOTKEYEVENT":_SETHOTKEYEVENT,"SETINNERHTML":_SETINNERHTML,"SETINNERTEXT":_SETINNERTEXT,"SETINNERTEXTBYSTRINGID":_SETINNERTEXTBYSTRINGID,"SETITEMCHECKED":_SETITEMCHECKED,"SETKEYDOWNEVENT":_SETKEYDOWNEVENT,"SETKEYPRESSEVENT":_SETKEYPRESSEVENT,"SETKEYUPEVENT":_SETKEYUPEVENT,"SETLINKEVENT":_SETLINKEVENT,"SETLOADEVENT":_SETLOADEVENT,"SETLOSTFOCUSEVENT":_SETLOSTFOCUSEVENT,"SETMAINMENU":_SETMAINMENU,"SETMOUSEDOWNEVENT":_SETMOUSEDOWNEVENT,"SETMOUSEENTEREVENT":_SETMOUSEENTEREVENT,"SETMOUSELEAVEEVENT":_SETMOUSELEAVEEVENT,"SETMOUSEMOVEEVENT":_SETMOUSEMOVEEVENT,"SETMOUSEUPEVENT":_SETMOUSEUPEVENT,"SETMOUSEWHEELEVENT":_SETMOUSEWHEELEVENT,"SETMULTIPLE":_SETMULTIPLE,"SETPAGEDARKMODE":_SETPAGEDARKMODE,"SETPARENTELEMENT":_SETPARENTELEMENT,"SETPOSITION":_SETPOSITION,"SETRANGE":_SETRANGE,"SETREADONLY":_SETREADONLY,"SETSELECTEDINDEX":_SETSELECTEDINDEX,"SETSELECTITEMIMAGE":_SETSELECTITEMIMAGE,"SETSIZE":_SETSIZE,"SETSTRINGVALUE":_SETSTRINGVALUE,"SETSTYLE":_SETSTYLE,"SETTABS":_SETTABS,"SETTITLE":_SETTITLE,"SETUNLOADEVENT":_SETUNLOADEVENT,"SETVISIBLE":_SETVISIBLE,"SETVISIBLEBYSTRINGID":_SETVISIBLEBYSTRINGID,"SHOWCOLORDIALOG":_SHOWCOLORDIALOG,"SHOWFILEDIALOG":_SHOWFILEDIALOG,"SHOWFONTDIALOG":_SHOWFONTDIALOG,"SHOWINPUTBOX":_SHOWINPUTBOX,"SHOWPOPUPMENU":_SHOWPOPUPMENU,"STARTTIMER":_STARTTIMER,"STOPTIMER":_STOPTIMER,"TABLECELLRECT":_TABLECELLRECT,"TABLECLEAR":_TABLECLEAR,"TABLEINIT":_TABLEINIT,"TABLEINSERTROW":_TABLEINSERTROW,"TABLEREMOVEROW":_TABLEREMOVEROW,"TABLESETCOLUMNS":_TABLESETCOLUMNS,"TABLESETINDEX":_TABLESETINDEX,"TABLESETROW":_TABLESETROW,"TABLESETVIEW":_TABLESETVIEW,"TEXTGETSEL":_TEXTGETSEL,"TEXTSETSEL":_TEXTSETSEL,"WEBRUNPAGE":_WEBRUNPAGE,"__syscall_chdir":___syscall_chdir,"__syscall_dup3":___syscall_dup3,"__syscall_fcntl64":___syscall_fcntl64,"__syscall_fstat64":___syscall_fstat64,"__syscall_getcwd":___syscall_getcwd,"__syscall_getdents64":___syscall_getdents64,"__syscall_ioctl":___syscall_ioctl,"__syscall_lstat64":___syscall_lstat64,"__syscall_mkdirat":___syscall_mkdirat,"__syscall_newfstatat":___syscall_newfstatat,"__syscall_openat":___syscall_openat,"__syscall_readlinkat":___syscall_readlinkat,"__syscall_renameat":___syscall_renameat,"__syscall_rmdir":___syscall_rmdir,"__syscall_stat64":___syscall_stat64,"__syscall_unlinkat":___syscall_unlinkat,"_localtime_js":__localtime_js,"_tzset_js":__tzset_js,"emscripten_asm_const_int":_emscripten_asm_const_int,"emscripten_date_now":_emscripten_date_now,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_dblclick_callback_on_thread":_emscripten_set_dblclick_callback_on_thread,"emscripten_set_keydown_callback_on_thread":_emscripten_set_keydown_callback_on_thread,"emscripten_set_keypress_callback_on_thread":_emscripten_set_keypress_callback_on_thread,"emscripten_set_keyup_callback_on_thread":_emscripten_set_keyup_callback_on_thread,"emscripten_set_mousedown_callback_on_thread":_emscripten_set_mousedown_callback_on_thread,"emscripten_set_mousemove_callback_on_thread":_emscripten_set_mousemove_callback_on_thread,"emscripten_set_mouseup_callback_on_thread":_emscripten_set_mouseup_callback_on_thread,"emscripten_sleep":_emscripten_sleep,"environ_get":_environ_get,"environ_sizes_get":_environ_sizes_get,"exit":_exit,"fd_close":_fd_close,"fd_read":_fd_read,"fd_seek":_fd_seek,"fd_write":_fd_write};var asm=createWasm();var ___wasm_call_ctors=function(){return(___wasm_call_ctors=Module["asm"]["__wasm_call_ctors"]).apply(null,arguments)};var _free=function(){return(_free=Module["asm"]["free"]).apply(null,arguments)};var _malloc=function(){return(_malloc=Module["asm"]["malloc"]).apply(null,arguments)};var _ONSTART=Module["_ONSTART"]=function(){return(_ONSTART=Module["_ONSTART"]=Module["asm"]["ONSTART"]).apply(null,arguments)};var _ONMAINMENU=Module["_ONMAINMENU"]=function(){return(_ONMAINMENU=Module["_ONMAINMENU"]=Module["asm"]["ONMAINMENU"]).apply(null,arguments)};var _ONRESIZE=Module["_ONRESIZE"]=function(){return(_ONRESIZE=Module["_ONRESIZE"]=Module["asm"]["ONRESIZE"]).apply(null,arguments)};var _ONTIMER=Module["_ONTIMER"]=function(){return(_ONTIMER=Module["_ONTIMER"]=Module["asm"]["ONTIMER"]).apply(null,arguments)};var _ONPAINT=Module["_ONPAINT"]=function(){return(_ONPAINT=Module["_ONPAINT"]=Module["asm"]["ONPAINT"]).apply(null,arguments)};var _ONLOAD=Module["_ONLOAD"]=function(){return(_ONLOAD=Module["_ONLOAD"]=Module["asm"]["ONLOAD"]).apply(null,arguments)};var _ONCHANGE=Module["_ONCHANGE"]=function(){return(_ONCHANGE=Module["_ONCHANGE"]=Module["asm"]["ONCHANGE"]).apply(null,arguments)};var _ONCLICK=Module["_ONCLICK"]=function(){return(_ONCLICK=Module["_ONCLICK"]=Module["asm"]["ONCLICK"]).apply(null,arguments)};var _ONCLOSE=Module["_ONCLOSE"]=function(){return(_ONCLOSE=Module["_ONCLOSE"]=Module["asm"]["ONCLOSE"]).apply(null,arguments)};var _ONDBLCLICK=Module["_ONDBLCLICK"]=function(){return(_ONDBLCLICK=Module["_ONDBLCLICK"]=Module["asm"]["ONDBLCLICK"]).apply(null,arguments)};var _ONGOTFOCUS=Module["_ONGOTFOCUS"]=function(){return(_ONGOTFOCUS=Module["_ONGOTFOCUS"]=Module["asm"]["ONGOTFOCUS"]).apply(null,arguments)};var _ONLOSTFOCUS=Module["_ONLOSTFOCUS"]=function(){return(_ONLOSTFOCUS=Module["_ONLOSTFOCUS"]=Module["asm"]["ONLOSTFOCUS"]).apply(null,arguments)};var _ONKEYDOWN=Module["_ONKEYDOWN"]=function(){return(_ONKEYDOWN=Module["_ONKEYDOWN"]=Module["asm"]["ONKEYDOWN"]).apply(null,arguments)};var _ONKEYPRESS=Module["_ONKEYPRESS"]=function(){return(_ONKEYPRESS=Module["_ONKEYPRESS"]=Module["asm"]["ONKEYPRESS"]).apply(null,arguments)};var _ONKEYUP=Module["_ONKEYUP"]=function(){return(_ONKEYUP=Module["_ONKEYUP"]=Module["asm"]["ONKEYUP"]).apply(null,arguments)};var _ONSHORTCUT=Module["_ONSHORTCUT"]=function(){return(_ONSHORTCUT=Module["_ONSHORTCUT"]=Module["asm"]["ONSHORTCUT"]).apply(null,arguments)};var _ONCAPTIONBUTTON=Module["_ONCAPTIONBUTTON"]=function(){return(_ONCAPTIONBUTTON=Module["_ONCAPTIONBUTTON"]=Module["asm"]["ONCAPTIONBUTTON"]).apply(null,arguments)};var _ONSHORTCUTCLICK=Module["_ONSHORTCUTCLICK"]=function(){return(_ONSHORTCUTCLICK=Module["_ONSHORTCUTCLICK"]=Module["asm"]["ONSHORTCUTCLICK"]).apply(null,arguments)};var _ONCONTEXTMENU=Module["_ONCONTEXTMENU"]=function(){return(_ONCONTEXTMENU=Module["_ONCONTEXTMENU"]=Module["asm"]["ONCONTEXTMENU"]).apply(null,arguments)};var _ONCONTEXTMENUPOPUP=Module["_ONCONTEXTMENUPOPUP"]=function(){return(_ONCONTEXTMENUPOPUP=Module["_ONCONTEXTMENUPOPUP"]=Module["asm"]["ONCONTEXTMENUPOPUP"]).apply(null,arguments)};var _ONDIALOGKEY=Module["_ONDIALOGKEY"]=function(){return(_ONDIALOGKEY=Module["_ONDIALOGKEY"]=Module["asm"]["ONDIALOGKEY"]).apply(null,arguments)};var _ONMOUSEDOWN=Module["_ONMOUSEDOWN"]=function(){return(_ONMOUSEDOWN=Module["_ONMOUSEDOWN"]=Module["asm"]["ONMOUSEDOWN"]).apply(null,arguments)};var _ONMOUSEMOVE=Module["_ONMOUSEMOVE"]=function(){return(_ONMOUSEMOVE=Module["_ONMOUSEMOVE"]=Module["asm"]["ONMOUSEMOVE"]).apply(null,arguments)};var _ONMOUSEHOVER=Module["_ONMOUSEHOVER"]=function(){return(_ONMOUSEHOVER=Module["_ONMOUSEHOVER"]=Module["asm"]["ONMOUSEHOVER"]).apply(null,arguments)};var _ONMOUSEUP=Module["_ONMOUSEUP"]=function(){return(_ONMOUSEUP=Module["_ONMOUSEUP"]=Module["asm"]["ONMOUSEUP"]).apply(null,arguments)};var _ONMOUSEENTER=Module["_ONMOUSEENTER"]=function(){return(_ONMOUSEENTER=Module["_ONMOUSEENTER"]=Module["asm"]["ONMOUSEENTER"]).apply(null,arguments)};var _ONMOUSELEAVE=Module["_ONMOUSELEAVE"]=function(){return(_ONMOUSELEAVE=Module["_ONMOUSELEAVE"]=Module["asm"]["ONMOUSELEAVE"]).apply(null,arguments)};var _ONMOUSEWHEEL=Module["_ONMOUSEWHEEL"]=function(){return(_ONMOUSEWHEEL=Module["_ONMOUSEWHEEL"]=Module["asm"]["ONMOUSEWHEEL"]).apply(null,arguments)};var _ONUNLOAD=Module["_ONUNLOAD"]=function(){return(_ONUNLOAD=Module["_ONUNLOAD"]=Module["asm"]["ONUNLOAD"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["__main_argc_argv"]).apply(null,arguments)};var ___errno_location=function(){return(___errno_location=Module["asm"]["__errno_location"]).apply(null,arguments)};var _setThrew=function(){return(_setThrew=Module["asm"]["setThrew"]).apply(null,arguments)};var _saveSetjmp=function(){return(_saveSetjmp=Module["asm"]["saveSetjmp"]).apply(null,arguments)};var _emscripten_stack_set_limits=function(){return(_emscripten_stack_set_limits=Module["asm"]["emscripten_stack_set_limits"]).apply(null,arguments)};var _emscripten_stack_get_base=function(){return(_emscripten_stack_get_base=Module["asm"]["emscripten_stack_get_base"]).apply(null,arguments)};var _emscripten_stack_get_end=function(){return(_emscripten_stack_get_end=Module["asm"]["emscripten_stack_get_end"]).apply(null,arguments)};var stackSave=function(){return(stackSave=Module["asm"]["stackSave"]).apply(null,arguments)};var stackRestore=function(){return(stackRestore=Module["asm"]["stackRestore"]).apply(null,arguments)};var stackAlloc=function(){return(stackAlloc=Module["asm"]["stackAlloc"]).apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return(dynCall_vi=Module["dynCall_vi"]=Module["asm"]["dynCall_vi"]).apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return(dynCall_iiii=Module["dynCall_iiii"]=Module["asm"]["dynCall_iiii"]).apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return(dynCall_vii=Module["dynCall_vii"]=Module["asm"]["dynCall_vii"]).apply(null,arguments)};var dynCall_ji=Module["dynCall_ji"]=function(){return(dynCall_ji=Module["dynCall_ji"]=Module["asm"]["dynCall_ji"]).apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return(dynCall_viiii=Module["dynCall_viiii"]=Module["asm"]["dynCall_viiii"]).apply(null,arguments)};var dynCall_viiiii=Module["dynCall_viiiii"]=function(){return(dynCall_viiiii=Module["dynCall_viiiii"]=Module["asm"]["dynCall_viiiii"]).apply(null,arguments)};var dynCall_viii=Module["dynCall_viii"]=function(){return(dynCall_viii=Module["dynCall_viii"]=Module["asm"]["dynCall_viii"]).apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return(dynCall_iii=Module["dynCall_iii"]=Module["asm"]["dynCall_iii"]).apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return(dynCall_iiiii=Module["dynCall_iiiii"]=Module["asm"]["dynCall_iiiii"]).apply(null,arguments)};var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=function(){return(dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=Module["asm"]["dynCall_iiiiiiiii"]).apply(null,arguments)};var dynCall_iiiiii=Module["dynCall_iiiiii"]=function(){return(dynCall_iiiiii=Module["dynCall_iiiiii"]=Module["asm"]["dynCall_iiiiii"]).apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){return(dynCall_ii=Module["dynCall_ii"]=Module["asm"]["dynCall_ii"]).apply(null,arguments)};var dynCall_i=Module["dynCall_i"]=function(){return(dynCall_i=Module["dynCall_i"]=Module["asm"]["dynCall_i"]).apply(null,arguments)};var dynCall_viiiiii=Module["dynCall_viiiiii"]=function(){return(dynCall_viiiiii=Module["dynCall_viiiiii"]=Module["asm"]["dynCall_viiiiii"]).apply(null,arguments)};var dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=function(){return(dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=Module["asm"]["dynCall_viiiiiiiii"]).apply(null,arguments)};var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=function(){return(dynCall_viiiiiii=Module["dynCall_viiiiiii"]=Module["asm"]["dynCall_viiiiiii"]).apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){return(dynCall_v=Module["dynCall_v"]=Module["asm"]["dynCall_v"]).apply(null,arguments)};var dynCall_iiji=Module["dynCall_iiji"]=function(){return(dynCall_iiji=Module["dynCall_iiji"]=Module["asm"]["dynCall_iiji"]).apply(null,arguments)};var dynCall_iijj=Module["dynCall_iijj"]=function(){return(dynCall_iijj=Module["dynCall_iijj"]=Module["asm"]["dynCall_iijj"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["dynCall_jiji"]).apply(null,arguments)};var dynCall_iidiiii=Module["dynCall_iidiiii"]=function(){return(dynCall_iidiiii=Module["dynCall_iidiiii"]=Module["asm"]["dynCall_iidiiii"]).apply(null,arguments)};var _asyncify_start_unwind=function(){return(_asyncify_start_unwind=Module["asm"]["asyncify_start_unwind"]).apply(null,arguments)};var _asyncify_stop_unwind=function(){return(_asyncify_stop_unwind=Module["asm"]["asyncify_stop_unwind"]).apply(null,arguments)};var _asyncify_start_rewind=function(){return(_asyncify_start_rewind=Module["asm"]["asyncify_start_rewind"]).apply(null,arguments)};var _asyncify_stop_rewind=function(){return(_asyncify_stop_rewind=Module["asm"]["asyncify_stop_rewind"]).apply(null,arguments)};Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args=[]){var entryFunction=_main;args.unshift(thisProgram);var argc=args.length;var argv=stackAlloc((argc+1)*4);var argv_ptr=argv>>2;args.forEach(arg=>{HEAP32[argv_ptr++]=stringToUTF8OnStack(arg)});HEAP32[argv_ptr]=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(args=arguments_){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run();var __fb_rtlib={console:{term:null,divId:"termDiv",fg_color:"8",bg_color:"1",cols:80,rows:25,open:function(cols,rows){if(this.term===null){if(typeof Terminal!=="undefined"){this.cols=!cols?cols:80;this.rows=!rows?rows:25;this.term=new Terminal({"x":0,"y":0,"cols":this.cols,"rows":this.rows,termDiv:this.divId,bgColor:"#000000",textColor:"#FFFFFF",catchCtrlH:false,closeOnESC:false,greeting:"",crsrBlockMode:false,initHandler:this.termInitHandler,handler:this.termHandler});this.term.open();this.term.resizeTo(cols,rows)}}},close:function(){if(this.term!==null){}},write:function(text){if(this.term===null){if(typeof process!=="undefined")process.stdout.write(text);else console.log(text);return}this.term.write("%c("+this.fg_color+","+this.bg_color+")"+text.replace("%(","%%("))},writeSubs:function(text,len){this.write(text.substr(0,len))},input:function(){var t=prompt();this.write(t+"\n");return t},color_set:function(fg,bg){if(fg>=0&&fg<=15)this.fg_color=fg;if(bg>=0&&bg<=15)this.bg_color=bg},color_get:function(){return this.bg_color<<8|this.fg_color},clear:function(){if(this.term!==null)this.term.clear()},pos_set:function(row,col){if(this.term!==null)this.term.cursorSet(row,col)},pos_get:function(){if(this.term!==null)return this.term.r<<8|this.term.c;else return 0},size_get:function(){if(this.term!==null)return this.rows<<8|this.cols;else return 0},size_set:function(cols,rows){if(this.term!==null){if(this.term.resizeTo(cols,rows)){this.rows=rows;this.cols=cols;return true}return false}else return false},charAt:function(col,row){if(this.term===null||col<0||col>=this.cols||row<0||row>=this.rows)return 0;return this.term.charBuf[row][col]},colorAt:function(col,row){if(this.term===null||col<0||col>=this.cols||row<0||row>=this.rows)return 0;return this.term.styleBuf[row][col]},requestFullScreen:function(){if(this.term===null)return false;var target=document.getElementById(this.divId);if(target.requestFullscreen)target.requestFullscreen();else if(target.msRequestFullscreen)target.msRequestFullscreen();else if(target.mozRequestFullScreen)target.mozRequestFullScreen();else if(target.mozRequestFullscreen)target.mozRequestFullscreen();else if(target.webkitRequestFullscreen)target.webkitRequestFullscreen();else return false;return true},termInitHandler:function(){this.lock=false},termHandler:function(){this.lock=false}}};var Terminal=function(conf){if(typeof conf!="object")conf=new Object;for(var i in this.Defaults){if(typeof conf[i]=="undefined")conf[i]=this.Defaults[i]}if(typeof conf.handler!="function")conf.handler=Terminal.prototype.defaultHandler;this.conf=conf;this.setInitValues()};Terminal.prototype={version:"1.66 (fb)",Defaults:{cols:80,rows:24,x:100,y:100,termDiv:"termDiv",bgColor:"#181818",frameColor:"#555555",frameWidth:1,rowHeight:15,blinkDelay:500,fontClass:"term",crsrBlinkMode:false,crsrBlockMode:true,DELisBS:false,printTab:true,printEuro:true,catchCtrlH:true,closeOnESC:true,historyUnique:false,id:0,ps:">",greeting:"%+r Terminal ready. %-r",handler:null,ctrlHandler:null,initHandler:null,exitHandler:null,wrapping:false,mapANSI:false,ANSItrueBlack:false,textBlur:0,textColor:""},setInitValues:function(){this.isSafari=navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("WebKit")>=0?true:false;this.isOpera=window.opera&&navigator.userAgent.indexOf("Opera")>=0?true:false;this.isChrome=navigator.userAgent.indexOf("Chrome/")>=0&&navigator.userAgent.indexOf("WebKit")>=0?true:false;this.domAPI=document&&document.createElement?true:false;this.isMac=navigator.userAgent.indexOf("Mac")>=0?true:false;this.id=this.conf.id;this.maxLines=this.conf.rows;this.maxCols=this.conf.cols;this.termDiv=this.conf.termDiv;this.crsrBlinkMode=this.conf.crsrBlinkMode;this.crsrBlockMode=this.conf.crsrBlockMode;this.blinkDelay=this.conf.blinkDelay;this.DELisBS=this.conf.DELisBS;this.printTab=this.conf.printTab;this.printEuro=this.conf.printEuro;this.catchCtrlH=this.conf.catchCtrlH;this.closeOnESC=this.conf.closeOnESC;this.historyUnique=this.conf.historyUnique;this.ps=this.conf.ps;this.closed=false;this.r;this.c;this.charBuf=new Array;this.styleBuf=new Array;this.scrollBuf=null;this.blinkBuffer=0;this.blinkTimer;this.cursoractive=false;this.lock=true;this.insert=false;this.charMode=false;this.rawMode=false;this.lineBuffer="";this.inputChar=0;this.lastLine="";this.guiCounter=0;this.history=new Array;this.histPtr=0;this.env=new Object;this.buckupBuffer=null;this.handler=this.conf.handler;this.wrapping=this.conf.wrapping;this.mapANSI=this.conf.mapANSI;this.ANSItrueBlack=this.conf.ANSItrueBlack;this.ctrlHandler=this.conf.ctrlHandler;this.initHandler=this.conf.initHandler;this.exitHandler=this.conf.exitHandler;this.fieldMode=false;this.fieldStart=this.fieldEnd=this.fieldC=0;if(typeof this.conf.textBlur==="object"&&this.conf.textBlur.length){var a=[];for(var i=0;i<this.conf.textBlur.length;i++){var b=Number(this.conf.textBlur[i]);if(!isNaN(b)&&b>0)a.push(b)}this.textBlur=a.length?a:0}else{this.textBlur=Number(this.conf.textBlur);if(isNaN(this.textBlur)||this.textBlur<0||this.textBlur>40)this.textBlur=0}this.textColor=this.conf.textColor||""},defaultHandler:function(){this.newLine();if(this.lineBuffer!=""){this.type("You typed: "+this.lineBuffer);this.newLine()}this.prompt()},open:function(){if(this.termDivReady()){if(!this.closed)this._makeTerm();this.init();return true}else{return false}},close:function(){this.lock=true;this.cursorOff();if(this.exitHandler)this.exitHandler();this.globals.setVisible(this.termDiv,0);this.closed=true},init:function(){if(this.guiReady()){this.guiCounter=0;if(this.closed){this.setInitValues()}this.clear();this.globals.setVisible(this.termDiv,1);this.globals.enableKeyboard(this);if(this.initHandler){this.initHandler()}else{this.write(this.conf.greeting);this.newLine();this.prompt()}}else{this.guiCounter++;if(this.guiCounter>18e3){if(confirm("Terminal:\nYour browser hasn't responded for more than 2 minutes.\nRetry?")){this.guiCounter=0}else{return}}this.globals.termToInitialze=this;window.setTimeout("Terminal.prototype.globals.termToInitialze.init()",200)}},getRowArray:function(l,v){var a=new Array;for(var i=0;i<l;i++)a[i]=v;return a},wrapOn:function(){this.wrapping=true},wrapOff:function(){this.wrapping=false},setTextBlur:function(v){var rerender=false;if(typeof v==="object"&&v.length){var a=[];for(var i=0;i<v.length;i++){var b=Number(v[i]);if(!isNaN(b)&&b>0)a.push(b)}this.textBlur=a.length?a:0;rerender=true}else{v=Number(v);if(isNaN(v)||v<0||v>40)v=0;if(v!=this.textBlur){this.textBlur=v;rerender=true}}if(rerender){for(var r=0,l=this.conf.rows;r<l;r++)this.redraw(r)}},setTextColor:function(v){if(!v)v="";if(v!=this.textColor){this.textColor=v;for(var r=0,l=this.conf.rows;r<l;r++){this.redraw(r)}}},type:function(text,style){for(var i=0;i<text.length;i++){var ch=text.charCodeAt(i);if(!this.isPrintable(ch))ch=94;this.charBuf[this.r][this.c]=ch;this.styleBuf[this.r][this.c]=style?style:0;var last_r=this.r;this._incCol();if(this.r!=last_r)this.redraw(last_r)}this.redraw(this.r)},write:function(text,usemore){if(typeof text!="object"){if(typeof text!="string")text=""+text;if(text.indexOf("\n")>=0){var ta=text.split("\n");text=ta.join("%n")}}else{if(text.join){text=text.join("%n")}else{text=""+text}if(text.indexOf("\n")>=0){var ta=text.split("\n");text=ta.join("%n")}}if(this.mapANSI)text=this.globals.ANSI_map(text,this.ANSItrueBlack);this._sbInit(usemore);var chunks=text.split("%");var esc=text.charAt(0)!="%";var style=0;var styleMarkUp=this.globals.termStyleMarkup;for(var i=0;i<chunks.length;i++){if(esc){if(chunks[i].length>0){this._sbType(chunks[i],style)}else if(i>0){this._sbType("%",style)}esc=false}else{var func=chunks[i].charAt(0);if(chunks[i].length==0&&i>0){this._sbType("%",style);esc=true}else if(func=="n"){this._sbNewLine(true);if(chunks[i].length>1)this._sbType(chunks[i].substring(1),style)}else if(func=="+"){var opt=chunks[i].charAt(1);opt=opt.toLowerCase();if(opt=="p"){style=0}else if(styleMarkUp[opt]){style|=styleMarkUp[opt]}if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else if(func=="-"){var opt=chunks[i].charAt(1);opt=opt.toLowerCase();if(opt=="p"){style=0}else if(styleMarkUp[opt]){style&=~styleMarkUp[opt]}if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else if(chunks[i].length>1&&func=="c"){var cinfo=this._parseColor(chunks[i].substring(1));style=style&~16777200|cinfo.style;if(cinfo.rest)this._sbType(cinfo.rest,style)}else if(chunks[i].length>1&&chunks[i].charAt(0)=="C"&&chunks[i].charAt(1)=="S"){this.clear();this._sbInit();if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else{if(chunks[i].length>0)this._sbType(chunks[i],style)}}}this._sbOut()},_lookupColor:function(clabel){if(clabel.length&&clabel.length<=2){var isHex=false;for(var i=0;i<clabel.length;i++){if(this.globals.isHexOnlyChar(clabel.charAt(i))){isHex=true;break}}var cl=isHex?parseInt(clabel,16):parseInt(clabel,10);if(!isNaN(cl)||cl<=15){style=cl}}else{style=this.globals.getColorCode(clabel)}return style},_parseColor:function(chunk){var rest="";var style=0;if(chunk.length){if(chunk.charAt(0)=="("){var clabel="";var bclabel="";var isforeground=true;for(var i=1;i<chunk.length;i++){var c=chunk.charAt(i);if(c==")"){if(chunk.length>i)rest=chunk.substring(i+1);break}else if(c==","){isforeground=false;continue}if(isforeground)clabel+=c;else bclabel+=c}if(clabel){style=this._lookupColor(clabel,false)<<8}if(bclabel){style=style&65280|this._lookupColor(bclabel,true)<<16}}else{var c=chunk.charAt(0);if(this.globals.isHexChar(c)){style=this.globals.hexToNum[c]<<8;rest=chunk.substring(1)}else{rest=chunk}}}return{rest:rest,style:style}},_sbInit:function(usemore){var sb=this.scrollBuf=new Object;var sbl=sb.lines=new Array;var sbs=sb.styles=new Array;sb.more=usemore;sb.line=0;sb.status=0;sb.r=0;sb.c=this.c;sbl[0]=this.getRowArray(this.conf.cols,0);sbs[0]=this.getRowArray(this.conf.cols,0);for(var i=0;i<this.c;i++){sbl[0][i]=this.charBuf[this.r][i];sbs[0][i]=this.styleBuf[this.r][i]}},_sbType:function(text,style){var sb=this.scrollBuf;for(var i=0;i<text.length;i++){var ch=text.charCodeAt(i);if(!this.isPrintable(ch))ch=94;sb.lines[sb.r][sb.c]=ch;sb.styles[sb.r][sb.c++]=style?style:0;if(sb.c>=this.maxCols)this._sbNewLine()}},_sbNewLine:function(forced){var sb=this.scrollBuf;if(this.wrapping&&forced){sb.lines[sb.r][sb.c]=10;sb.lines[sb.r].length=sb.c+1}sb.r++;sb.c=0;sb.lines[sb.r]=this.getRowArray(this.conf.cols,0);sb.styles[sb.r]=this.getRowArray(this.conf.cols,0)},_sbWrap:function(){var wb=new Object;wb.lines=new Array;wb.styles=new Array;wb.lines[0]=this.getRowArray(this.conf.cols,0);wb.styles[0]=this.getRowArray(this.conf.cols,0);wb.r=0;wb.c=0;var sb=this.scrollBuf;var sbl=sb.lines;var sbs=sb.styles;var ch,st,wrap,lc,ls;var l=this.c;var lastR=0;var lastC=0;wb.cBreak=false;for(var r=0;r<sbl.length;r++){lc=sbl[r];ls=sbs[r];for(var c=0;c<lc.length;c++){ch=lc[c];st=ls[c];if(ch){var wrap=this.globals.wrapChars[ch];if(ch==10)wrap=1;if(wrap){if(wrap==2){l++}else if(wrap==4){l++;lc[c]=45}this._wbOut(wb,lastR,lastC,l);if(ch==10){this._wbIncLine(wb)}else if(wrap==1&&wb.c<this.maxCols){wb.lines[wb.r][wb.c]=ch;wb.styles[wb.r][wb.c++]=st;if(wb.c>=this.maxCols)this._wbIncLine(wb)}if(wrap==3){lastR=r;lastC=c;l=1}else{l=0;lastR=r;lastC=c+1;if(lastC==lc.length){lastR++;lastC=0}if(wrap==4)wb.cBreak=true}}else{l++}}else{continue}}}if(l){if(wb.cBreak&&wb.c!=0)wb.c--;this._wbOut(wb,lastR,lastC,l)}sb.lines=wb.lines;sb.styles=wb.styles;sb.r=wb.r;sb.c=wb.c},_wbOut:function(wb,br,bc,l){var sb=this.scrollBuf;var sbl=sb.lines;var sbs=sb.styles;var ofs=0;var lc,ls;if(l+wb.c>this.maxCols){if(l<this.maxCols){this._wbIncLine(wb)}else{var i0=0;ofs=this.maxCols-wb.c;lc=sbl[br];ls=sbs[br];while(true){for(var i=i0;i<ofs;i++){wb.lines[wb.r][wb.c]=lc[bc];wb.styles[wb.r][wb.c++]=ls[bc++];if(bc==sbl[br].length){bc=0;br++;lc=sbl[br];ls=sbs[br]}}this._wbIncLine(wb);if(l-ofs<this.maxCols)break;i0=ofs;ofs+=this.maxCols}}}else if(wb.cBreak){wb.c--}lc=sbl[br];ls=sbs[br];for(var i=ofs;i<l;i++){wb.lines[wb.r][wb.c]=lc[bc];wb.styles[wb.r][wb.c++]=ls[bc++];if(bc==sbl[br].length){bc=0;br++;lc=sbl[br];ls=sbs[br]}}wb.cBreak=false},_wbIncLine:function(wb){wb.r++;wb.c=0;wb.lines[wb.r]=this.getRowArray(this.conf.cols,0);wb.styles[wb.r]=this.getRowArray(this.conf.cols,0)},_sbOut:function(){var sb=this.scrollBuf;if(this.wrapping&&!sb.status)this._sbWrap();var sbl=sb.lines;var sbs=sb.styles;var tcb=this.charBuf;var tsb=this.styleBuf;var ml=this.maxLines;var buflen=sbl.length;if(sb.more){if(sb.status){if(this.inputChar==this.globals.lcMoreKeyAbort){this.r=ml-1;this.c=0;tcb[this.r]=this.getRowArray(this.conf.cols,0);tsb[this.r]=this.getRowArray(this.conf.cols,0);this.redraw(this.r);this.handler=sb.handler;this.charMode=false;this.inputChar=0;this.scrollBuf=null;this.prompt();return}else if(this.inputChar==this.globals.lcMoreKeyContinue){this.clear()}else{return}}else{if(this.r>=ml-1)this.clear()}}if(this.r+buflen-sb.line<=ml){for(var i=sb.line;i<buflen;i++){var r=this.r+i-sb.line;tcb[r]=sbl[i];tsb[r]=sbs[i];this.redraw(r)}this.r+=sb.r-sb.line;this.c=sb.c;if(sb.more){if(sb.status)this.handler=sb.handler;this.charMode=false;this.inputChar=0;this.scrollBuf=null;this.prompt();return}}else if(sb.more){ml--;if(sb.status==0){sb.handler=this.handler;this.handler=this._sbOut;this.charMode=true;sb.status=1}if(this.r){var ofs=ml-this.r;for(var i=sb.line;i<ofs;i++){var r=this.r+i-sb.line;tcb[r]=sbl[i];tsb[r]=sbs[i];this.redraw(r)}}else{var ofs=sb.line+ml;for(var i=sb.line;i<ofs;i++){var r=this.r+i-sb.line;tcb[r]=sbl[i];tsb[r]=sbs[i];this.redraw(r)}}sb.line=ofs;this.r=ml;this.c=0;this.type(this.globals.lcMorePrompt1,this.globals.lcMorePromtp1Style);this.type(this.globals.lcMorePrompt2,this.globals.lcMorePrompt2Style);this.lock=false;return}else if(buflen>=ml){var ofs=buflen-ml;for(var i=0;i<ml;i++){var r=ofs+i;tcb[i]=sbl[r];tsb[i]=sbs[r];this.redraw(i)}this.r=ml-1;this.c=sb.c}else{var dr=ml-buflen;var ofs=this.r-dr;for(var i=0;i<dr;i++){var r=ofs+i;for(var c=0;c<this.maxCols;c++){tcb[i][c]=tcb[r][c];tsb[i][c]=tsb[r][c]}this.redraw(i)}for(var i=0;i<buflen;i++){var r=dr+i;tcb[r]=sbl[i];tsb[r]=sbs[i];this.redraw(r)}this.r=ml-1;this.c=sb.c}this.scrollBuf=null},typeAt:function(r,c,text,style){var tr1=this.r;var tc1=this.c;this.cursorSet(r,c);for(var i=0;i<text.length;i++){var ch=text.charCodeAt(i);if(!this.isPrintable(ch))ch=94;this.charBuf[this.r][this.c]=ch;this.styleBuf[this.r][this.c]=style?style:0;var last_r=this.r;this._incCol();if(this.r!=last_r)this.redraw(last_r)}this.redraw(this.r);this.r=tr1;this.c=tc1},statusLine:function(text,style,offset){var ch,r;style=style&&!isNaN(style)?parseInt(style)&15:0;if(offset&&offset>0){r=this.conf.rows-offset}else{r=this.conf.rows-1}for(var i=0;i<this.conf.cols;i++){if(i<text.length){ch=text.charCodeAt(i);if(!this.isPrintable(ch))ch=94}else{ch=0}this.charBuf[r][i]=ch;this.styleBuf[r][i]=style}this.redraw(r)},printRowFromString:function(r,text,style){var ch;style=style&&!isNaN(style)?parseInt(style)&15:0;if(r>=0&&r<this.maxLines){if(typeof text!="string")text=""+text;for(var i=0;i<this.conf.cols;i++){if(i<text.length){ch=text.charCodeAt(i);if(!this.isPrintable(ch))ch=94}else{ch=0}this.charBuf[r][i]=ch;this.styleBuf[r][i]=style}this.redraw(r)}},setChar:function(ch,r,c,style){this.charBuf[r][c]=ch;this.styleBuf[r][c]=style?style:0;this.redraw(r)},newLine:function(){this.c=0;this._incRow()},_charOut:function(ch,style){this.charBuf[this.r][this.c]=ch;this.styleBuf[this.r][this.c]=style?style:0;this.redraw(this.r);this._incCol()},_incCol:function(){this.c++;if(this.c>=this.maxCols){this.c=0;this._incRow()}},_incRow:function(){this.r++;if(this.r>=this.maxLines){this._scrollLines(0,this.maxLines);this.r=this.maxLines-1}},_scrollLines:function(start,end){window.status="Scrolling lines ...";start++;for(var ri=start;ri<end;ri++){var rt=ri-1;this.charBuf[rt]=this.charBuf[ri];this.styleBuf[rt]=this.styleBuf[ri]}var rt=end-1;this.charBuf[rt]=this.getRowArray(this.conf.cols,0);this.styleBuf[rt]=this.getRowArray(this.conf.cols,0);this.redraw(rt);for(var r=end-1;r>=start;r--)this.redraw(r-1);window.status=""},clear:function(){window.status="Clearing display ...";this.cursorOff();this.insert=false;for(var ri=0;ri<this.maxLines;ri++){this.charBuf[ri]=this.getRowArray(this.conf.cols,0);this.styleBuf[ri]=this.getRowArray(this.conf.cols,0);this.redraw(ri)}this.r=0;this.c=0;window.status=""},reset:function(){if(this.lock)return;this.lock=true;this.rawMode=false;this.charMode=false;this.maxLines=this.conf.rows;this.maxCols=this.conf.cols;this.lastLine="";this.lineBuffer="";this.inputChar=0;this.clear()},prompt:function(){this.lock=true;if(this.c>0)this.newLine();this.type(this.ps);this._charOut(1);this.lock=false;this.cursorOn()},isPrintable:function(ch,unicodePage1only){if(this.wrapping&&this.globals.wrapChars[ch]==4)return true;if(unicodePage1only&&ch>255){return ch==this.termKey.EURO&&this.printEuro?true:false}return ch>=32&&ch!=this.termKey.DEL||this.printTab&&ch==this.termKey.TAB},cursorSet:function(r,c){var crsron=this.cursoractive;if(crsron)this.cursorOff();this.r=r%this.maxLines;this.c=c%this.maxCols;this._cursorReset(crsron)},cursorOn:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);this.blinkBuffer=this.styleBuf[this.r][this.c];this._cursorBlink();this.cursoractive=true},cursorOff:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);if(this.cursoractive){this.styleBuf[this.r][this.c]=this.blinkBuffer;this.redraw(this.r);this.cursoractive=false}},cursorLeft:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff();var r=this.r;var c=this.c;if(c>0){c--}else if(r>0){c=this.maxCols-1;r--}if(this.isPrintable(this.charBuf[r][c])){this.r=r;this.c=c}this.insert=true;this._cursorReset(crsron)},cursorRight:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff();var r=this.r;var c=this.c;if(c<this.maxCols-1){c++}else if(r<this.maxLines-1){c=0;r++}if(!this.isPrintable(this.charBuf[r][c])){this.insert=false}if(this.isPrintable(this.charBuf[this.r][this.c])){this.r=r;this.c=c}this._cursorReset(crsron)},backspace:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff();var r=this.r;var c=this.c;if(c>0)c--;else if(r>0){c=this.maxCols-1;r--}if(this.isPrintable(this.charBuf[r][c])){this._scrollLeft(r,c);this.r=r;this.c=c}this._cursorReset(crsron)},fwdDelete:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff();if(this.isPrintable(this.charBuf[this.r][this.c])){this._scrollLeft(this.r,this.c);if(!this.isPrintable(this.charBuf[this.r][this.c]))this.insert=false}this._cursorReset(crsron)},_cursorReset:function(crsron){if(crsron){this.cursorOn()}else{this.blinkBuffer=this.styleBuf[this.r][this.c]}},_cursorBlink:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);if(this==this.globals.activeTerm){if(this.crsrBlockMode){this.styleBuf[this.r][this.c]=this.styleBuf[this.r][this.c]&1?this.styleBuf[this.r][this.c]&16777214:this.styleBuf[this.r][this.c]|1}else{this.styleBuf[this.r][this.c]=this.styleBuf[this.r][this.c]&2?this.styleBuf[this.r][this.c]&1048573:this.styleBuf[this.r][this.c]|2}this.redraw(this.r)}if(this.crsrBlinkMode)this.blinkTimer=setTimeout("Terminal.prototype.globals.activeTerm._cursorBlink()",this.blinkDelay)},_scrollLeft:function(r,c){var rows=new Array;rows[0]=r;while(this.isPrintable(this.charBuf[r][c])){var ri=r;var ci=c+1;if(ci==this.maxCols){if(ri<this.maxLines-1){ci=0;ri++;rows[rows.length]=ri}else{break}}this.charBuf[r][c]=this.charBuf[ri][ci];this.styleBuf[r][c]=this.styleBuf[ri][ci];c=ci;r=ri}if(this.charBuf[r][c]!=0)this.charBuf[r][c]=0;for(var i=0;i<rows.length;i++)this.redraw(rows[i])},_scrollRight:function(r,c){var rows=new Array;var end=this._getLineEnd(r,c);var ri=end[0];var ci=end[1];if(ci==this.maxCols-1&&ri==this.maxLines-1){if(r==0)return;this._scrollLines(0,this.maxLines);this.r--;r--;ri--}rows[r]=1;while(this.isPrintable(this.charBuf[ri][ci])){var rt=ri;var ct=ci+1;if(ct==this.maxCols){ct=0;rt++;rows[rt]=1}this.charBuf[rt][ct]=this.charBuf[ri][ci];this.styleBuf[rt][ct]=this.styleBuf[ri][ci];if(ri==r&&ci==c)break;ci--;if(ci<0){ci=this.maxCols-1;ri--;rows[ri]=1}}for(var i=r;i<this.maxLines;i++){if(rows[i])this.redraw(i)}},_getLineEnd:function(r,c){if(!this.isPrintable(this.charBuf[r][c])){c--;if(c<0){if(r>0){r--;c=this.maxCols-1}else{c=0}}}if(this.isPrintable(this.charBuf[r][c])){while(true){var ri=r;var ci=c+1;if(ci==this.maxCols){if(ri<this.maxLines-1){ri++;ci=0}else{break}}if(!this.isPrintable(this.charBuf[ri][ci]))break;c=ci;r=ri}}return[r,c]},_getLineStart:function(r,c){var ci,ri;if(!this.isPrintable(this.charBuf[r][c])){ci=c-1;ri=r;if(ci<0){if(ri==0)return[0,0];ci=this.maxCols-1;ri--}if(!this.isPrintable(this.charBuf[ri][ci])){return[r,c]}else{r=ri;c=ci}}while(true){var ri=r;var ci=c-1;if(ci<0){if(ri==0)break;ci=this.maxCols-1;ri--}if(!this.isPrintable(this.charBuf[ri][ci]))break;r=ri;c=ci}return[r,c]},_getLine:function(adjustCrsrPos){var end=this._getLineEnd(this.r,this.c);var r=end[0];var c=end[1];if(adjustCrsrPos&&(this.r!=r||this.c!=c+1)){this.r=r;this.c=c+1;if(this.c>=this.maxCols)this.c=this.maxCols-1}var line=new Array;while(this.isPrintable(this.charBuf[r][c])){line[line.length]=String.fromCharCode(this.charBuf[r][c]);if(c>0){c--}else if(r>0){c=this.maxCols-1;r--}else{break}}line.reverse();return line.join("")},_clearLine:function(){var end=this._getLineEnd(this.r,this.c);var r=end[0];var c=end[1];while(this.isPrintable(this.charBuf[r][c])){this.charBuf[r][c]=0;if(c>0){c--}else if(r>0){this.redraw(r);c=this.maxCols-1;r--}else{break}}if(r!=end[0])this.redraw(r);c++;this.cursorSet(r,c);this.insert=false},backupScreen:function(){var backup=this.backupBuffer=new Object;var rl=this.conf.rows;var cl=this.conf.cols;backup.cbuf=new Array(rl);backup.sbuf=new Array(rl);backup.maxCols=this.maxCols;backup.maxLines=this.maxLines;backup.r=this.r;backup.c=this.c;backup.charMode=this.charMode;backup.rawMode=this.rawMode;backup.handler=this.handler;backup.ctrlHandler=this.ctrlHandler;backup.cursoractive=this.cursoractive;backup.crsrBlinkMode=this.crsrBlinkMode;backup.crsrBlockMode=this.crsrBlockMode;backup.blinkDelay=this.blinkDelay;backup.DELisBS=this.DELisBS;backup.printTab=this.printTab;backup.printEuro=this.printEuro;backup.catchCtrlH=this.catchCtrlH;backup.closeOnESC=this.closeOnESC;backup.historyUnique=this.historyUnique;backup.ps=this.ps;backup.lineBuffer=this.lineBuffer;backup.inputChar=this.inputChar;backup.lastLine=this.lastLine;backup.historyLength=this.history.length;backup.histPtr=this.histPtr;backup.wrapping=this.wrapping;backup.mapANSI=this.mapANSI;backup.ANSItrueBlack=this.ANSItrueBlack;if(this.cursoractive)this.cursorOff();for(var r=0;r<rl;r++){var cbr=this.charBuf[r];var sbr=this.styleBuf[r];var tcbr=backup.cbuf[r]=new Array(cl);var tsbr=backup.sbuf[r]=new Array(cl);for(var c=0;c<cl;c++){tcbr[c]=cbr[c];tsbr[c]=sbr[c]}}},restoreScreen:function(){var backup=this.backupBuffer;if(!backup)return;var rl=this.conf.rows;for(var r=0;r<rl;r++){this.charBuf[r]=backup.cbuf[r];this.styleBuf[r]=backup.sbuf[r];this.redraw(r)}this.maxCols=backup.maxCols;this.maxLines=backup.maxLines;this.r=backup.r;this.c=backup.c;this.charMode=backup.charMode;this.rawMode=backup.rawMode;this.handler=backup.handler;this.ctrlHandler=backup.ctrlHandler;this.cursoractive=backup.cursoractive;this.crsrBlinkMode=backup.crsrBlinkMode;this.crsrBlockMode=backup.crsrBlockMode;this.blinkDelay=backup.blinkDelay;this.DELisBS=backup.DELisBS;this.printTab=backup.printTab;this.printEuro=backup.printEuro;this.catchCtrlH=backup.catchCtrlH;this.closeOnESC=backup.closeOnESC;this.historyUnique=backup.historyUnique;this.ps=backup.ps;this.lineBuffer=backup.lineBuffer;this.inputChar=backup.inputChar;this.lastLine=backup.lastLine;if(this.history.length>backup.historyLength){this.history.length=backup.historyLength;this.histPtr=backup.histPtr}this.wrapping=backup.wrapping;this.mapANSI=backup.mapANSI;this.ANSItrueBlack=backup.ANSItrueBlack;if(this.cursoractive)this.cursorOn();this.backupBuffer=null},swapBackup:function(){var backup=this.backupBuffer;this.backupScreen;if(backup){var backup2=this.backupBuffer;this.backupBuffer=backup;this.restoreScreen();this.backupBuffer=backup2}},escapeMarkup:function(t){return t.replace(/%/g,"%%")},enterFieldMode:function(start,end,style){this.cursorOff();if(start===undefined||start<0)start=this.c;if(end===undefined||end<start||end>this.maxCols)end=this.maxCols;if(!style)style=0;this.fieldStart=start;this.fieldEnd=end;this.fieldStyle=style;this.fieldC=0;this.lastLine="";this.fieldMode=true;this.rawMode=this.charMode=false;if(style&1){this._crsrWasBlockMode=this.crsrBlockMode;this._crsrWasBlinkMode=this.crsrBlinkMode;this.crsrBlockMode=false;this.crsrBlinkMode=true}this.drawField();this.lock=false},exitFieldMode:function(){this.drawField(true);this.fieldMode=false;this.c=this.fieldEnd;if(this.c==this.maxLine)this.newLine();this.lock=true},drawField:function(isfinal){this.cursorOff();if(isfinal)this.fieldC=0;var fl=this.fieldEnd-this.fieldStart;if(this.fieldC==this.lastLine.length)fl--;var ofs=this.fieldC-fl;if(ofs<0)ofs=0;var line=ofs?this.lastLine.substring(ofs):this.lastLine;var sb=this.styleBuf[this.r];var cb=this.charBuf[this.r];var max=line.length;for(var i=this.fieldStart,k=0;i<this.fieldEnd;i++,k++){sb[i]=this.fieldStyle;cb[i]=k<max?line.charCodeAt(k):0}this.redraw(this.r);if(isfinal){if(this.fieldStyle&1){this.crsrBlockMode=this._crsrWasBlockMode;this.crsrBlinkMode=this._crsrWasBlinkMode;delete this._crsrWasBlockMode;delete this._crsrWasBlinkMode}}else{this.c=this.fieldStart+this.fieldC-ofs;this.cursorOn()}},focus:function(){this.globals.setFocus(this)},termKey:null,_makeTerm:function(rebuild){window.status="Building terminal ...";var divPrefix=this.termDiv+"_r";if(this.domAPI){this.globals.hasSubDivs=false;var td,row,table,tbody,table2,tbody2,tr,td,node;table=document.createElement("table");table.setAttribute("border",0);table.setAttribute("cellSpacing",0);table.setAttribute("cellPadding",this.conf.frameWidth);tbody=document.createElement("tbody");table.appendChild(tbody);row=document.createElement("tr");tbody.appendChild(row);ptd=document.createElement("td");ptd.style.backgroundColor=this.conf.frameColor;row.appendChild(ptd);table2=document.createElement("table");table2.setAttribute("border",0);table2.setAttribute("cellSpacing",0);table2.setAttribute("cellPadding",2);tbody2=document.createElement("tbody");table2.appendChild(tbody2);tr=document.createElement("tr");tbody2.appendChild(tr);td=document.createElement("td");td.style.backgroundColor=this.conf.bgColor;tr.appendChild(td);ptd.appendChild(table2);ptd=td;table2=document.createElement("table");table2.setAttribute("border",0);table2.setAttribute("cellSpacing",0);table2.setAttribute("cellPadding",0);tbody2=document.createElement("tbody");table2.appendChild(tbody2);var rstr="";for(var c=0;c<this.conf.cols;c++)rstr+=" ";for(var r=0;r<this.conf.rows;r++){tr=document.createElement("tr");td=document.createElement("td");td.id=divPrefix+r;td.style.height=td.style.minHeight=td.style.maxHeight=this.conf.rowHeight+"px";td.style.whiteSpace="nowrap";td.className=this.conf.fontClass;td.innerHTML=rstr;tr.appendChild(td);tbody2.appendChild(tr)}ptd.appendChild(table2);node=document.getElementById(this.termDiv);while(node.hasChildNodes())node.removeChild(node.firstChild);node.appendChild(table)}else{this.globals.hasSubDivs=navigator.userAgent.indexOf("Gecko")<0;var s="",bgColorAttribute=this.conf.bgColor&&(this.conf.bgColor!=="none"||this.conf.bgColor!="transparent")?' bgcolor="'+this.conf.bgColor+'"':"",frameColorAttribute=this.conf.frameColor&&(this.conf.frameColor!=="none"||this.conf.frameColor!="transparent")?' bgcolor="'+this.conf.frameColor+'"':"";s+='<table border="0" cellspacing="0" cellpadding="'+this.conf.frameWidth+'">\n';s+="<tr><td"+frameColorAttribute+'><table border="0" cellspacing="0" cellpadding="2"><tr><td'+bgColorAttribute+'><table border="0" cellspacing="0" cellpadding="0">\n';var rstr="";for(var c=0;c<this.conf.cols;c++)rstr+=" ";for(var r=0;r<this.conf.rows;r++){var termid=this.globals.hasSubDivs?"":' id="'+divPrefix+r+'"';s+='<tr><td nowrap height="'+this.conf.rowHeight+'"'+termid+' class="'+this.conf.fontClass+'">'+rstr+"</td></tr>\n"}s+="</table></td></tr>\n";s+="</table></td></tr>\n";s+="</table>\n";var termOffset=2+this.conf.frameWidth;if(this.globals.hasSubDivs){for(var r=0;r<this.conf.rows;r++){s+='<div id="'+divPrefix+r+'" style="position:absolute; top:'+(termOffset+r*this.conf.rowHeight)+"px; left: "+termOffset+'px;" class="'+this.conf.fontClass+'"></div>\n'}this.globals.termStringStart='<table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap height="'+this.conf.rowHeight+'" class="'+this.conf.fontClass+'">';this.globals.termStringEnd="</td></tr></table>"}this.globals.writeElement(this.termDiv,s)}if(!rebuild){this.globals.setElementXY(this.termDiv,this.conf.x,this.conf.y);this.globals.setVisible(this.termDiv,1)}window.status=""},rebuild:function(){var rl=this.conf.rows;var cl=this.conf.cols;for(var r=0;r<rl;r++){var cbr=this.charBuf[r];if(!cbr){this.charBuf[r]=this.getRowArray(cl,0);this.styleBuf[r]=this.getRowArray(cl,0)}else if(cbr.length<cl){for(var c=cbr.length;c<cl;c++){this.charBuf[r][c]=0;this.styleBuf[r][c]=0}}}var resetcrsr=false;if(this.r>=rl){r=rl-1;resetcrsr=true}if(this.c>=cl){c=cl-1;resetcrsr=true}if(resetcrsr&&this.cursoractive)this.cursorOn();this._makeTerm(true);for(var r=0;r<rl;r++){this.redraw(r)}this.backupBuffer=null},moveTo:function(x,y){this.globals.setElementXY(this.termDiv,x,y)},resizeTo:function(x,y){if(this.termDivReady()){x=parseInt(x,10);y=parseInt(y,10);if(isNaN(x)||isNaN(y)||x<4||y<2)return false;this.maxCols=this.conf.cols=x;this.maxLines=this.conf.rows=y;this._makeTerm();this.clear();return true}else{return false}},redraw:function(r){var s=this.globals.termStringStart;var curStyle=0;var tstls=this.globals.termStyles;var tscls=this.globals.termStyleClose;var tsopn=this.globals.termStyleOpen;var tspcl=this.globals.termSpecials;var tclrs=this.globals.colorCodes;var twclrs=this.globals.webColorCodes;var t_cb=this.charBuf;var t_sb=this.styleBuf;var blur=this.textBlur;var clr="";var textColor=this.textColor||"";for(var i=0;i<this.conf.cols;i++){var c=t_cb[r][i];var cs=t_sb[r][i];if(cs!=curStyle||i==0&&textColor){if(curStyle){if(curStyle&16776960)s+="</span>";for(var k=tstls.length-1;k>=0;k--){var st=tstls[k];if(curStyle&st)s+=tscls[st]}}curStyle=cs;for(var k=0;k<tstls.length;k++){var st=tstls[k];if(curStyle&st)s+=tsopn[st]}clr=textColor;var bgclr=null;if(curStyle&65280){var cc=(curStyle&65280)>>>8&255;clr=cc<16?tclrs[cc]:0}if(curStyle&16711680){var bc=(curStyle&16711680)>>>16&255;bgclr=bc<16?tclrs[bc]:0}if(clr){if(curStyle&1){s+='<span style="background-color:'+clr+' !important;">'}else if(typeof blur==="object"){s+='<span style="color:'+clr+" !important; text-shadow: 0 0 "+blur.join("px "+clr+", 0 0 ")+"px "+clr+';">'}else if(blur){s+='<span style="color:'+clr+" !important; text-shadow: 0 0 "+blur+"px "+clr+';">'}else{s+='<span style="color:'+clr+" !important;"+(bgclr?" background-color:"+bgclr+"!important;":"")+'">'}}}s+=tspcl[c]?tspcl[c]:String.fromCharCode(c)}if(curStyle>0){if(curStyle&16776960)s+="</span>";for(var k=tstls.length-1;k>=0;k--){var st=tstls[k];if(curStyle&st)s+=tscls[st]}}s+=this.globals.termStringEnd;this.globals.writeElement(this.termDiv+"_r"+r,s)},guiReady:function(){var ready=true;if(this.globals.guiElementsReady(this.termDiv)){for(var r=0;r<this.conf.rows;r++){if(this.globals.guiElementsReady(this.termDiv+"_r"+r)==false){ready=false;break}}}else{ready=false}return ready},termDivReady:function(){if(document.getElementById){return document.getElementById(this.termDiv)?true:false}else if(document.all){return document.all[this.termDiv]?true:false}else{return false}},getDimensions:function(){var w=0;var h=0;var d=this.termDiv;if(document.getElementById){var obj=document.getElementById(d);if(obj&&obj.firstChild){w=parseInt(obj.firstChild.offsetWidth,10);h=parseInt(obj.firstChild.offsetHeight,10)}else if(obj&&obj.children&&obj.children[0]){w=parseInt(obj.children[0].offsetWidth,10);h=parseInt(obj.children[0].offsetHeight,10)}}else if(document.all){var obj=document.all[d];if(obj&&obj.children&&obj.children[0]){w=parseInt(obj.children[0].offsetWidth,10);h=parseInt(obj.children[0].offsetHeight,10)}}return{width:w,height:h}},globals:{termToInitialze:null,activeTerm:null,kbdEnabled:false,keylock:false,keyRepeatDelay1:450,keyRepeatDelay2:100,keyRepeatTimer:null,lcMorePrompt1:" -- MORE -- ",lcMorePromtp1Style:1,lcMorePrompt2:" (Type: space to continue, 'q' to quit)",lcMorePrompt2Style:0,lcMoreKeyAbort:113,lcMoreKeyContinue:32,_initGlobals:function(){var tg=Terminal.prototype.globals;tg._extendMissingStringMethods();tg._initWebColors();tg._initDomKeyRef();Terminal.prototype.termKey=tg.termKey},getHexChar:function(c){var tg=Terminal.prototype.globals;if(tg.isHexChar(c))return tg.hexToNum[c];return-1},isHexChar:function(c){return c>="0"&&c<="9"||c>="a"&&c<="f"||c>="A"&&c<="F"?true:false},isHexOnlyChar:function(c){return c>="a"&&c<="f"||c>="A"&&c<="F"?true:false},hexToNum:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"a":10,"b":11,"c":12,"d":13,"e":14,"f":15,"A":10,"B":11,"C":12,"D":13,"E":14,"F":15},webColors:[],webColorCodes:[""],colors:{black:1,red:2,green:3,yellow:4,blue:5,magenta:6,cyan:7,white:8,grey:9,red2:10,green2:11,yellow2:12,blue2:13,magenta2:14,cyan2:15,red1:2,green1:3,yellow1:4,blue1:5,magenta1:6,cyan1:7,gray:9,darkred:10,darkgreen:11,darkyellow:12,darkblue:13,darkmagenta:14,darkcyan:15,"default":0,clear:0},colorCodes:["","#000000","#ff0000","#00ff00","#ffff00","#0066ff","#ff00ff","#00ffff","#ffffff","#808080","#990000","#009900","#999900","#003399","#990099","#009999"],_webSwatchChars:["0","3","6","9","c","f"],_initWebColors:function(){var tg=Terminal.prototype.globals;var ws=tg._webColorSwatch;var wn=tg.webColors;var cc=tg.webColorCodes;var n=1;var a,b,c,al,bl,bs,cl;for(var i=0;i<6;i++){a=tg._webSwatchChars[i];al=a+a;for(var j=0;j<6;j++){b=tg._webSwatchChars[j];bl=al+b+b;bs=a+b;for(var k=0;k<6;k++){c=tg._webSwatchChars[k];cl=bl+c+c;wn[bs+c]=wn[cl]=n;cc[n]=cl;n++}}}},webifyColor:function(s){var tg=Terminal.prototype.globals;if(s.length==6){var c="";for(var i=0;i<6;i+=2){var a=s.charAt(i);var b=s.charAt(i+1);if(tg.isHexChar(a)&&tg.isHexChar(b)){c+=tg._webSwatchChars[Math.round(parseInt(a+b,16)/255*5)]}else{return""}}return c}else if(s.length==3){var c="";for(var i=0;i<3;i++){var a=s.charAt(i);if(tg.isHexChar(a)){c+=tg._webSwatchChars[Math.round(parseInt(a,16)/15*5)]}else{return""}}return c}else{return""}},setColor:function(label,value){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>=1&&label<=15){tg.colorCodes[label]=value}else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label)){var n=tg.hexToNum[label];if(n)tg.colorCodes[n]=value}else if(typeof tg.colors[label]!="undefined"){var n=tg.colors[label];if(n)tg.colorCodes[n]=value}}},getColorString:function(label){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>=0&&label<=15){return tg.colorCodes[label]}else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label)){return tg.colorCodes[tg.hexToNum[label]]}else if(typeof tg.colors[label]!="undefined"){return tg.colorCodes[tg.colors[label]]}}return""},getColorCode:function(label){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>=0&&label<=15){return label}else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label)){return parseInt(label,16)}else if(typeof tg.colors[label]!="undefined"){return tg.colors[label]}}return 0},insertText:function(text){var tg=Terminal.prototype.globals;var termRef=tg.activeTerm;if(!termRef||termRef.closed||tg.keylock||termRef.lock||termRef.charMode||termRef.fieldMode)return false;for(var i=0;i<text.length;i++){tg.keyHandler({which:text.charCodeAt(i),_remapped:true})}return true},importEachLine:function(text){var tg=Terminal.prototype.globals;var termRef=tg.activeTerm;if(!termRef||termRef.closed||tg.keylock||termRef.lock||termRef.charMode||termRef.fieldMode)return false;termRef.cursorOff();termRef._clearLine();text=text.replace(/\r\n?/g,"\n");var t=text.split("\n");for(var i=0;i<t.length;i++){for(var k=0;k<t[i].length;k++){tg.keyHandler({which:t[i].charCodeAt(k),_remapped:true})}tg.keyHandler({which:term.termKey.CR,_remapped:true})}return true},importMultiLine:function(text){var tg=Terminal.prototype.globals;var termRef=tg.activeTerm;if(!termRef||termRef.closed||tg.keylock||termRef.lock||termRef.charMode||termRef.fieldMode)return false;termRef.lock=true;termRef.cursorOff();termRef._clearLine();text=text.replace(/\r\n?/g,"\n");var lines=text.split("\n");for(var i=0;i<lines.length;i++){termRef.type(lines[i]);if(i<lines.length-1)termRef.newLine()}termRef.lineBuffer=text;termRef.lastLine="";termRef.inputChar=0;termRef.handler();return true},normalize:function(n,m){var s=""+n;while(s.length<m)s="0"+s;return s},fillLeft:function(t,n){if(typeof t!="string")t=""+t;while(t.length<n)t=" "+t;return t},center:function(t,l){var s="";for(var i=t.length;i<l;i+=2)s+=" ";return s+t},stringReplace:function(s1,s2,t){var l1=s1.length;var l2=s2.length;var ofs=t.indexOf(s1);while(ofs>=0){t=t.substring(0,ofs)+s2+t.substring(ofs+l1);ofs=t.indexOf(s1,ofs+l2)}return t},wrapChars:{9:1,10:1,12:4,13:1,32:1,40:3,45:2,61:2,91:3,94:3,123:3},setFocus:function(termref){Terminal.prototype.globals.activeTerm=termref;Terminal.prototype.globals.clearRepeatTimer()},termKey:{"NUL":0,"SOH":1,"STX":2,"ETX":3,"EOT":4,"ENQ":5,"ACK":6,"BEL":7,"BS":8,"BACKSPACE":8,"HT":9,"TAB":9,"LF":10,"VT":11,"FF":12,"CR":13,"SO":14,"SI":15,"DLE":16,"DC1":17,"DC2":18,"DC3":19,"DC4":20,"NAK":21,"SYN":22,"ETB":23,"CAN":24,"EM":25,"SUB":26,"ESC":27,"IS4":28,"IS3":29,"IS2":30,"IS1":31,"DEL":127,"EURO":8364,"LEFT":28,"RIGHT":29,"UP":30,"DOWN":31},termDomKeyRef:{},_domKeyMappingData:{"LEFT":"LEFT","RIGHT":"RIGHT","UP":"UP","DOWN":"DOWN","BACK_SPACE":"BS","RETURN":"CR","ENTER":"CR","ESCAPE":"ESC","DELETE":"DEL","TAB":"TAB"},_initDomKeyRef:function(){var tg=Terminal.prototype.globals;var m=tg._domKeyMappingData;var r=tg.termDomKeyRef;var k=tg.termKey;for(var i in m)r["DOM_VK_"+i]=k[m[i]]},registerEvent:function(obj,eventType,handler,capture){if(obj.addEventListener){obj.addEventListener(eventType.toLowerCase(),handler,capture)}else{var et=eventType.toUpperCase();if(window.Event&&window.Event[et]&&obj.captureEvents)obj.captureEvents(Event[et]);obj["on"+eventType.toLowerCase()]=handler}},releaseEvent:function(obj,eventType,handler,capture){if(obj.removeEventListener){obj.removeEventListener(eventType.toLowerCase(),handler,capture)}else{var et=eventType.toUpperCase();if(window.Event&&window.Event[et]&&obj.releaseEvents)obj.releaseEvents(Event[et]);et="on"+eventType.toLowerCase();if(obj[et]&&obj[et]==handler)obj.et=null}},enableKeyboard:function(term){var tg=Terminal.prototype.globals;if(!tg.kbdEnabled){tg.registerEvent(document,"keypress",tg.keyHandler,true);tg.registerEvent(document,"keydown",tg.keyFix,true);tg.registerEvent(document,"keyup",tg.clearRepeatTimer,true);tg.kbdEnabled=true}tg.activeTerm=term},disableKeyboard:function(term){var tg=Terminal.prototype.globals;if(tg.kbdEnabled){tg.releaseEvent(document,"keypress",tg.keyHandler,true);tg.releaseEvent(document,"keydown",tg.keyFix,true);tg.releaseEvent(document,"keyup",tg.clearRepeatTimer,true);tg.kbdEnabled=false}tg.activeTerm=null},keyFix:function(e){var tg=Terminal.prototype.globals;var term=tg.activeTerm;var ch;if(tg.keylock||term.lock)return true;if(window.event){if(!e)e=window.event;ch=e.keyCode;if(e.DOM_VK_UP){for(var i in tg.termDomKeyRef){if(e[i]&&ch==e[i]){tg.keyHandler({which:tg.termDomKeyRef[i],_remapped:true,_repeat:ch==27?true:false});if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();e.cancelBubble=true;return false}}e.cancelBubble=false;return true}else{var termKey=term.termKey;var keyHandler=tg.keyHandler;if(ch==8&&!term.isOpera){keyHandler({which:termKey.BS,_remapped:true,_repeat:true})}else if(ch==9){keyHandler({which:termKey.TAB,_remapped:true,_repeat:term.printTab?false:true})}else if(ch==27){keyHandler({which:termKey.ESC,_remapped:true,_repeat:term.printTab?false:true})}else if(ch==37){keyHandler({which:termKey.LEFT,_remapped:true,_repeat:true})}else if(ch==39){keyHandler({which:termKey.RIGHT,_remapped:true,_repeat:true})}else if(ch==38){keyHandler({which:termKey.UP,_remapped:true,_repeat:true})}else if(ch==40){keyHandler({which:termKey.DOWN,_remapped:true,_repeat:true})}else if(ch==127||ch==46){keyHandler({which:termKey.DEL,_remapped:true,_repeat:true})}else if(ch>=57373&&ch<=57376){if(ch==57373){keyHandler({which:termKey.UP,_remapped:true,_repeat:true})}else if(ch==57374){keyHandler({which:termKey.DOWN,_remapped:true,_repeat:true})}else if(ch==57375){keyHandler({which:termKey.LEFT,_remapped:true,_repeat:true})}else if(ch==57376){keyHandler({which:termKey.RIGHT,_remapped:true,_repeat:true})}}else{e.cancelBubble=false;return true}if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();e.cancelBubble=true;return false}}},clearRepeatTimer:function(e){var tg=Terminal.prototype.globals;if(tg.keyRepeatTimer){clearTimeout(tg.keyRepeatTimer);tg.keyRepeatTimer=null}},doKeyRepeat:function(ch){Terminal.prototype.globals.keyHandler({which:ch,_remapped:true,_repeated:true})},keyHandler:function(e){var tg=Terminal.prototype.globals;var term=tg.activeTerm;if(tg.keylock||term.lock||term.isMac&&e&&e.metaKey)return true;if(window.event){if(window.event.preventDefault)window.event.preventDefault();if(window.event.stopPropagation)window.event.stopPropagation()}else if(e){if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation()}var ch;var ctrl=false;var shft=false;var remapped=false;var termKey=term.termKey;var keyRepeat=0;if(e){ch=e.which;ctrl=e.ctrlKey&&!e.altKey||e.modifiers==2;shft=e.shiftKey||e.modifiers==4;if(e._remapped){remapped=true;if(window.event){ctrl=ctrl||window.event.ctrlKey&&!window.event.altKey;shft=shft||window.event.shiftKey}}if(e._repeated){keyRepeat=2}else if(e._repeat){keyRepeat=1}}else if(window.event){ch=window.event.keyCode;ctrl=window.event.ctrlKey&&!window.event.altKey;shft=window.event.shiftKey;if(window.event._repeated){keyRepeat=2}else if(window.event._repeat){keyRepeat=1}}else{return true}if(ch==""&&remapped==false){if(e==null)e=window.event;if(e.charCode==0&&e.keyCode){if(e.DOM_VK_UP){var dkr=tg.termDomKeyRef;for(var i in dkr){if(e[i]&&e.keyCode==e[i]){ch=dkr[i];break}}}else{if(e.keyCode==28){ch=termKey.LEFT}else if(e.keyCode==29){ch=termKey.RIGHT}else if(e.keyCode==30){ch=termKey.UP}else if(e.keyCode==31){ch=termKey.DOWN}else if(e.keyCode==37){ch=termKey.LEFT}else if(e.keyCode==39){ch=termKey.RIGHT}else if(e.keyCode==38){ch=termKey.UP}else if(e.keyCode==40){ch=termKey.DOWN}else if(e.keyCode==9){ch=termKey.TAB}}}}if(ch>=57344&&ch<=63743)return;if(keyRepeat){tg.clearRepeatTimer();tg.keyRepeatTimer=window.setTimeout("Terminal.prototype.globals.doKeyRepeat("+ch+")",keyRepeat==1?tg.keyRepeatDelay1:tg.keyRepeatDelay2)}if(term.charMode){term.insert=false;term.inputChar=ch;term.lineBuffer="";term.handler();if(ch<=32&&window.event)window.event.cancelBubble=true;return false}if(!ctrl){if(ch==termKey.CR){term.lock=true;term.cursorOff();term.insert=false;if(term.rawMode){term.lineBuffer=term.lastLine}else if(term.fieldMode){term.lineBuffer=term.lastLine;term.exitFieldMode()}else{term.lineBuffer=term._getLine(true);if(term.lineBuffer!=""&&(!term.historyUnique||term.history.length==0||term.lineBuffer!=term.history[term.history.length-1])){term.history[term.history.length]=term.lineBuffer}term.histPtr=term.history.length}term.lastLine="";term.inputChar=0;term.handler();if(window.event)window.event.cancelBubble=true;return false}else if(term.fieldMode){if(ch==termKey.ESC){term.lineBuffer=term.lastLine="";term.exitFieldMode();term.lastLine="";term.inputChar=0;term.handler();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.LEFT){if(term.fieldC>0)term.fieldC--}else if(ch==termKey.RIGHT){if(term.fieldC<term.lastLine.length)term.fieldC++}else if(ch==termKey.BS){if(term.fieldC>0){term.lastLine=term.lastLine.substring(0,term.fieldC-1)+term.lastLine.substring(term.fieldC);term.fieldC--}}else if(ch==termKey.DEL){if(term.fieldC<term.lastLine.length){term.lastLine=term.lastLine.substring(0,term.fieldC)+term.lastLine.substring(term.fieldC+1)}}else if(ch>=32){term.lastLine=term.lastLine.substring(0,term.fieldC)+String.fromCharCode(ch)+term.lastLine.substring(term.fieldC);term.fieldC++}term.drawField();return false}else if(ch==termKey.ESC&&term.conf.closeOnESC){term.close();if(window.event)window.event.cancelBubble=true;return false}if(ch<32&&term.rawMode){if(window.event)window.event.cancelBubble=true;return false}else{if(ch==termKey.LEFT){term.cursorLeft();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.RIGHT){term.cursorRight();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.UP){term.cursorOff();if(term.histPtr==term.history.length)term.lastLine=term._getLine();term._clearLine();if(term.history.length&&term.histPtr>=0){if(term.histPtr>0)term.histPtr--;term.type(term.history[term.histPtr])}else if(term.lastLine){term.type(term.lastLine)}term.cursorOn();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.DOWN){term.cursorOff();if(term.histPtr==term.history.length)term.lastLine=term._getLine();term._clearLine();if(term.history.length&&term.histPtr<=term.history.length){if(term.histPtr<term.history.length)term.histPtr++;if(term.histPtr<term.history.length){term.type(term.history[term.histPtr])}else if(term.lastLine){term.type(term.lastLine)}}else if(term.lastLine){term.type(term.lastLine)}term.cursorOn();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.BS){term.backspace();if(window.event)window.event.cancelBubble=true;return false}else if(ch==termKey.DEL){if(term.DELisBS){term.backspace()}else{term.fwdDelete()}if(window.event)window.event.cancelBubble=true;return false}}}if(term.rawMode){if(term.isPrintable(ch)){term.lastLine+=String.fromCharCode(ch)}if(ch==32&&window.event){window.event.cancelBubble=true}else if(window.opera&&window.event){window.event.cancelBubble=true}return false}else{if(term.conf.catchCtrlH&&(ch==termKey.BS||ctrl&&ch==72)){term.backspace();if(window.event)window.event.cancelBubble=true;return false}else if(term.ctrlHandler&&(ch<32||ctrl&&term.isPrintable(ch,true))){if(ch>=65&&ch<=96||ch==63){if(ch==63){ch=31}else{ch-=64}}term.inputChar=ch;term.ctrlHandler();if(window.event)window.event.cancelBubble=true;return false}else if(ctrl||!term.isPrintable(ch,true)){if(window.event)window.event.cancelBubble=true;return false}else if(term.isPrintable(ch,true)){if(term.blinkTimer)clearTimeout(term.blinkTimer);if(term.insert){term.cursorOff();term._scrollRight(term.r,term.c)}term._charOut(ch);term.cursorOn();if(ch==32&&window.event){window.event.cancelBubble=true}else if(window.opera&&window.event){window.event.cancelBubble=true}return false}}return true},hasSubDivs:false,termStringStart:"",termStringEnd:"",termSpecials:{0:" ",1:" ",9:" ",32:" ",34:""",38:"&",60:"<",62:">",127:"◊",8364:"€"},termStyles:[1,2,4,8,16],termStyleMarkup:{"r":1,"u":2,"i":4,"s":8,"b":16},termStyleOpen:{1:'<span class="termReverse">',2:"<u>",4:"<i>",8:"<strike>",16:"<i>"},termStyleClose:{1:"</span>",2:"</u>",4:"</i>",8:"</strike>",16:"</i>"},assignStyle:function(styleCode,markup,htmlOpen,htmlClose){var tg=Terminal.prototype.globals;if(!styleCode||isNaN(styleCode)){if(styleCode>=256){alert("termlib.js:\nCould not assign style.\n"+s+" is not a valid power of 2 between 0 and 256.");return}}var s=styleCode&255;var matched=false;for(var i=0;i<8;i++){if(s>>>i&1){if(matched){alert("termlib.js:\nCould not assign style code.\n"+s+" is not a power of 2!");return}matched=true}}if(!matched){alert("termlib.js:\nCould not assign style code.\n"+s+" is not a valid power of 2 between 0 and 256.");return}markup=String(markup).toLowerCase();if(markup=="c"||markup=="p"){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is a reserved code.');return}if(markup.length>1){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is not a single letter code.');return}var exists=false;for(var i=0;i<tg.termStyles.length;i++){if(tg.termStyles[i]==s){exists=true;break}}if(exists){var m=tg.termStyleMarkup[markup];if(m&&m!=s){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is already in use.');return}}else{if(tg.termStyleMarkup[markup]){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is already in use.');return}tg.termStyles[tg.termStyles.length]=s}tg.termStyleMarkup[markup]=s;tg.termStyleOpen[s]=htmlOpen;tg.termStyleClose[s]=htmlClose},ANSI_regexp:/(\x1b\[|x9b)([0-9;]+?)([a-zA-Z])/g,ANIS_SGR_codes:{0:"%+p",1:"%+b",3:"%+i",4:"%+u",7:"%+r",9:"%+s",21:"%+u",22:"%-b",23:"%-i",24:"%-u",27:"%-r",29:"%-s",30:"%c(0)",31:"%c(a)",32:"%c(b)",33:"%c(c)",34:"%c(d)",35:"%c(e)",36:"%c(f)",37:"%c(#999)",39:"%c(0)",90:"%c(9)",91:"%c(2)",92:"%c(3)",93:"%c(4)",94:"%c(5)",95:"%c(6)",96:"%c(7)",97:"%c(8)",99:"%c(0)","trueBlack":"%c(1)"},ANSI_map:function(t,trueBlack){var tg=Terminal.prototype.globals;tg.ANSI_regexp.lastIndex=0;return t.replace(tg.ANSI_regexp,function(str,p1,p2,p3,offset,s){return tg.ANSI_replace(p2,p3,trueBlack)})},ANSI_replace:function(p,cmd,trueBlack){var tg=Terminal.prototype.globals;if(cmd=="m"){if(p==""){return tg.ANIS_SGR_codes[0]}else if(trueBlack&&p=="30"){return tg.ANIS_SGR_codes.trueBlack}else if(tg.ANIS_SGR_codes[p]){return tg.ANIS_SGR_codes[p]}}return""},writeElement:function(e,t){if(document.getElementById){var obj=document.getElementById(e);obj.innerHTML=t}else if(document.all){document.all[e].innerHTML=t}},setElementXY:function(d,x,y){if(document.getElementById){var obj=document.getElementById(d);obj.style.left=x+"px";obj.style.top=y+"px"}else if(document.all){document.all[d].style.left=x+"px";document.all[d].style.top=y+"px"}},setVisible:function(d,v){if(document.getElementById){var obj=document.getElementById(d);obj.style.visibility=v?"visible":"hidden"}else if(document.all){document.all[d].style.visibility=v?"visible":"hidden"}},setDisplay:function(d,v){if(document.getElementById){var obj=document.getElementById(d);obj.style.display=v}else if(document.all){document.all[d].style.display=v}},guiElementsReady:function(e){if(document.getElementById){return document.getElementById(e)?true:false}else if(document.all){return document.all[e]?true:false}else{return false}},_termString_makeKeyref:function(){var tg=Terminal.prototype.globals;var termString_keyref=tg.termString_keyref=new Array;var termString_keycoderef=tg.termString_keycoderef=new Array;var hex=new Array("A","B","C","D","E","F");for(var i=0;i<=15;i++){var high=i<10?i:hex[i-10];for(var k=0;k<=15;k++){var low=k<10?k:hex[k-10];var cc=i*16+k;if(cc>=32){var cs=unescape("%"+high+low);termString_keyref[cc]=cs;termString_keycoderef[cs]=cc}}}},_extendMissingStringMethods:function(){if(!String.fromCharCode||!String.prototype.charCodeAt){Terminal.prototype.globals._termString_makeKeyref()}if(!String.fromCharCode){String.fromCharCode=function(cc){return cc!=null?Terminal.prototype.globals.termString_keyref[cc]:""}}if(!String.prototype.charCodeAt){String.prototype.charCodeAt=function(n){cs=this.charAt(n);return Terminal.prototype.globals.termString_keycoderef[cs]?Terminal.prototype.globals.termString_keycoderef[cs]:0}}}}};Terminal.prototype.globals._initGlobals();var TerminalDefaults=Terminal.prototype.Defaults;var termDefaultHandler=Terminal.prototype.defaultHandler;var TermGlobals=Terminal.prototype.globals;var termKey=Terminal.prototype.globals.termKey;var termDomKeyRef=Terminal.prototype.globals.termDomKeyRef;if(typeof __fb_rtlib!=="undefined"&&__fb_rtlib.console&&__fb_rtlib.console.write){var mffConsoleWrite=__fb_rtlib.console.write;__fb_rtlib.console.write=function(text){return mffConsoleWrite.call(this,String(text).replace(/\r\n/g,"\n"))}}addOnPostRun(function(){if(Module["_ONSTART"])Module["_ONSTART"]()});var mymod=mymod||{};mymod.dialog=function(){var _exposed={msgBoxGet:msgbxGet,msgBoxShow:msgbxShow};function msgbxGet(title,msg,options){if(!options)options={};var dlgstyle=options.dlgStyle?options.dlgStyle:"none";var dlgbuttons=options.dlgButtons?options.dlgButtons:"ok";var dlgcallbackOk=options.dlgCallbackOk?options.dlgCallbackOk:null;var dlgcallbackApply=options.dlgCallbackApply?options.dlgCallbackApply:null;var dlgcallbackCancel=options.dlgCallbackCancel?options.dlgCallbackCancel:null;var dlgOkLabel=options.dlgOkLabel&&options.dlgOkLabel!=""?options.dlgOkLabel:"Ok";var dlgApplyLabel=options.dlgApplyLabel&&options.dlgApplyLabel!=""?options.dlgApplyLabel:"Apply";var dlgCancelLabel=options.dlgCancelLabel&&options.dlgCancelLabel!=""?options.dlgCancelLabel:"Cancel";var dlginputBox=options.dlgInputBox?options.dlgInputBox:false;var dlginputCb=options.dlgInputBoxCallback?options.dlgInputBoxCallback:null;var dlguserElm=options.dlgCustElement?options.dlgCustElement:null;var mask=document.createElement("div");mask.id="vetdialogmodal";mask.className+=" vetdialog mask ";mask.onkeydown=function(){ondlgKeydown(event,dlgcallbackOk,mask)};var box=document.createElement("div");box.className+=" vetdialog box dropshadow";mask.appendChild(box);var titdv=document.createElement("div");titdv.className+=" flexpanel backgroundmenu unselectable basecolorblue";setElmStyle(titdv,{padding:"8px"});dragElement(titdv,box);var tittxt=document.createElement("div");tittxt.innerHTML=title==""||!title?"Title":title;tittxt.className+=" ";titdv.appendChild(tittxt);var titbut=document.createElement("div");titbut.className+=" vetdialogbutton fa fa-remove ";titbut.innerHTML="X";setElmStyle(titbut,{width:"20px",position:"absolute",right:"8px",opacity:"0.7"});titbut.onclick=function(){if(mask)document.body.removeChild(mask)};titdv.appendChild(titbut);box.appendChild(titdv);var msgdiv=document.createElement("div");msgdiv.className+=" flexpanel unselectable ";var icdiv=document.createElement("div");icdiv.className+=" flexpanel vertical basecolorblue fontbigger";setElmStyle(icdiv,{width:"15%",alignItems:"center",paddingTop:"15px"});var icimg=getIcon(dlgstyle);if(icimg){icdiv.className+=" "+icimg}msgdiv.appendChild(icdiv);var bddiv=document.createElement("div");bddiv.id="vetdialogbody";bddiv.className+=" flexpanel vertical dockfill ";setElmStyle(bddiv,{padding:"4px"});var lins=splitMsg(msg),pr;for(var i=0;i<lins.length;i++){pr=document.createElement("p");pr.innerHTML=lins[i];bddiv.appendChild(pr)}if(dlginputBox){var ipdiv=document.createElement("input");ipdiv.id="vetdialogdefaultinputbox";ipdiv.className+=" fonttitle fontsizesmall ";setElmStyle(ipdiv,{marginLeft:"0%",width:"82%"});if(dlginputCb){ipdiv.onkeydown=function(){oninputKeydown(event,dlginputCb,mask)};dlgcallbackOk=function(){dlginputCb(ipdiv.value)};dlgcallbackApply=function(){dlginputCb(ipdiv.value)}}bddiv.appendChild(ipdiv)}if(dlguserElm){bddiv.appendChild(dlguserElm)}msgdiv.appendChild(bddiv);box.appendChild(msgdiv);var defaultclose=function(){if(mask)document.body.removeChild(mask)};var butdiv=document.createElement("div");butdiv.className+=" flexpanel backgroundmenu unselectable basecolorred";setElmStyle(butdiv,{padding:"8px",justifyContent:"flex-end"});dlgbuttons=String(dlgbuttons).toLowerCase();var butok=getDialogButton("ok",1,dlgOkLabel);butok.onclick=dlgcallbackOk?function(){dlgcallbackOk();defaultclose()}:defaultclose;var butapply=getDialogButton("apply",2,dlgApplyLabel);butapply.onclick=dlgcallbackApply?function(){dlgcallbackApply()}:null;var butcancel=getDialogButton("cancel",3,dlgCancelLabel);butcancel.onclick=dlgcallbackCancel?function(){dlgcallbackCancel();defaultclose()}:defaultclose;if(dlgbuttons=="okcancel"){butdiv.appendChild(butok);butdiv.appendChild(butcancel)}else if(dlgbuttons=="okapplycancel"){butdiv.appendChild(butok);butdiv.appendChild(butapply);butdiv.appendChild(butcancel)}else if(dlgbuttons=="applycancel"){butdiv.appendChild(butapply);butdiv.appendChild(butcancel)}else{butdiv.appendChild(butok)}box.appendChild(butdiv);return mask}function msgbxShow(msgbox){document.body.appendChild(msgbox);var focel=msgbox.querySelector("#vetdialogdefaultinputbox");if(focel){focel.focus();return true}focel=msgbox.querySelector("#vetdialogcancel");if(focel){focel.focus();return true}focel=msgbox.querySelector("#vetdialogok");if(focel){focel.focus();return true}return true}function getIcon(dlgstl){dlgstl=dlgstl.substr(0,4).toLowerCase();var icimgtg=null;if(dlgstl=="info"){icimgtg="fa fa-info-circle"}else if(dlgstl=="excl"||dlgstl=="warn"){icimgtg="fa fa-exclamation-triangle"}else if(dlgstl=="ques"){icimgtg="fa fa-question-circle"}else if(dlgstl=="erro"){icimgtg="fa fa-minus-circle"}return icimgtg}function getDialogButton(txt,tbindx,lab){var bx=txt.substr(0,2).toLowerCase();var bt=document.createElement("div");bt.className+=" vetdialogbutton";bt.tabIndex=tbindx;bt.innerHTML=lab;bt.onfocus=function(){this.style.outlineWidth="3px";this.setAttribute("hasfocus",true)};bt.onblur=function(){this.style.outlineWidth="1px";this.setAttribute("hasfocus",false)};if(bx=="ap"){bt.id="vetdialogapply"}else if(bx=="ca"){bt.id="vetdialogcancel"}else{bt.id="vetdialogok"}return bt}function splitMsg(msg){var ps=[],nolines=false;if(!msg||msg==""){nolines=true}else{var lines=String(msg).split("<br>");if(!lines||lines.length==1){lines=msg.match(/[^\r\n]+/g);if(!lines||lines.length==0)nolines=true}if(nolines){ps.push("No message")}else{for(var i=0;i<lines.length;i++){ps.push(lines[i])}}}if(ps.length==0)ps.push("No message");return ps}function oninputKeydown(e,clb,dlg){var clskeys=[13];if(clskeys.indexOf(e.keyCode)>-1){if(clb)clb(e.target.value);if(dlg)document.body.removeChild(dlg)}if(e.keyCode==32){(e.mffPreventDefault||e.preventDefault).call(e);e.stopPropagation();e.target.value+=" "}}function ondlgKeydown(e,okclb,dlg){var clskeys=[13,32];if(clskeys.indexOf(e.keyCode)>-1){var okb=dlg.querySelector("#vetdialogok");if(okb&&okb.getAttribute("hasfocus")=="true"){if(okclb)okclb(e.target.value)}if(dlg){try{document.body.removeChild(dlg)}catch(err){}}}}function setElmStyle(elm,props){if(!elm)return null;for(var property in props)elm.style[property]=props[property]}return _exposed}(mymod.dialog||{});function dragElement(elmnt,frm){var pos1=0,pos2=0,pos3=0,pos4=0;elmnt.onmousedown=dragMouseDown;function dragMouseDown(e){e=e||window.event;e.preventDefault();pos3=e.clientX;pos4=e.clientY;document.onmouseup=closeDragElement;document.onmousemove=elementDrag}function elementDrag(e){e=e||window.event;e.preventDefault();pos1=pos3-e.clientX;pos2=pos4-e.clientY;pos3=e.clientX;pos4=e.clientY;frm.style.top=frm.offsetTop-pos2+"px";frm.style.left=frm.offsetLeft-pos1+"px"}function closeDragElement(){document.onmouseup=null;document.onmousemove=null}}var mffCharKeys=[186,187,188,189,190,191,192,219,220,221,222,226];["keydown","keypress","keyup"].forEach(function(type){window.addEventListener(type,function(e){var el=e.target;if(el&&(el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="SELECT"||el.isContentEditable)||type=="keydown"&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&mffCharKeys.indexOf(e.keyCode)>=0){e.mffPreventDefault=e.preventDefault;e.preventDefault=function(){}}},true)});document.addEventListener("focusin",function(e){for(var el=e.target;el&&el!==document.body;el=el.parentElement){if(/^\d+$/.test(el.id)){if(!el.mffGotFocusEvent)mff.call("ONGOTFOCUS",[Number(el.id)]);return}}},true);