var ft=Object.defineProperty,dt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var bt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable;var z=(n,t,e)=>t in n?ft(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,y=(n,t)=>{for(var e in t||(t={}))bt.call(t,e)&&z(n,e,t[e]);if(J)for(var e of J(t))St.call(t,e)&&z(n,e,t[e]);return n},T=(n,t)=>dt(n,mt(t));var u=(n,t)=>()=>(n&&(t=n(n=0)),t);var xt,h,F=u(()=>{xt=!0,h=new Proxy(console,{get(n,t,e){return t=="important"?n.error:xt&&t!="do-nothing"?n[t]:()=>{}}})});import{Dirent as zt,promises as p}from"fs";import _ from"path";function f(n,t){return new Promise(async e=>{try{e(t(null,await n))}catch(r){e(t(r))}})}function E(n,...t){return f(p[n](...t),e=>(e&&h.error(e),!e))}function yt(n){return f(p.stat(n),(t,e)=>Boolean(e))}function K(n,t,e,r={}){return f(p.stat(n),(i,o)=>(i&&!e&&h.error(i),t&&o?o[t]:o||r))}async function Tt(n,t=!0){return(await K(n,void 0,!0)).isFile?.()&&t}function At(n){return E("mkdir",n)}function wt(n){return E("rmdir",n)}function kt(n){return E("unlink",n)}async function Ct(n){return f(p.unlink(n),t=>!t)}function Dt(n,t={}){return f(p.readdir(n,t),(e,r)=>(e&&h.error(e),r||[]))}async function Lt(n){return f(p.mkdir(n),t=>!t)}function Q(n,t){return f(p.writeFile(n,t),e=>(e&&h.error(e),!e))}async function vt(n,t){try{return await Q(n,JSON.stringify(t))}catch(e){h.error(e)}return!1}function X(n,t="utf8",e=!1){return f(p.readFile(n,{encoding:t}),(r,i)=>(r&&!e&&h.error(r),i||""))}async function Mt(n,t){try{return JSON.parse(await X(n,t))}catch(e){h.error(e)}return{}}async function It(n,t=""){return n=_.dirname(n),f(p.mkdir(_.join(t,n),{recursive:!0}),e=>!e)}var g,N=u(()=>{F();g=T(y({},p),{exists:yt,existsFile:Tt,stat:K,mkdir:At,mkdirIfNotExists:Lt,writeFile:Q,writeJsonFile:vt,readFile:X,readJsonFile:Mt,rmdir:wt,unlink:kt,unlinkIfExists:Ct,readdir:Dt,makePathReal:It})});function W(n,t){let e=t.indexOf(n);return e==-1?[t]:[t.substring(0,e),t.substring(e+n.length)]}var O=u(()=>{});import{cwd as Pt}from"process";import S from"path";import{fileURLToPath as Rt}from"url";function Ft(n){return S.dirname(Rt(n))}function q(){return S.join(C,$,"/")}function b(n){return S.join(q(),n,"/")}function U(n){return S.join(Et,n+"Compile","/")}var Et,$,x,w,j,Y,Z,C,A,B,k,m,c,D=u(()=>{N();O();Et=S.join(Ft(import.meta.url),"/SystemData"),$="WebSite",x="WWW",w="Logs",j="node_modules",Y="Models",Z="Components",C=Pt()+"/";A=q(),B=U(x),k={Static:[b(x),B,x],Logs:[b(w),U(w),w],Models:[b(Y),B,Y],Components:[b(Z),B,Z],node_modules:[b(j),U(j),j],get[x](){return k.Static}},m={page:"page",model:"model",component:"integ"},c={pageTypes:m,pageTypesArray:[],pageCodeFile:{page:[m.page+".js",m.page+".ts"],model:[m.model+".js",m.model+".ts"],component:[m.component+".js",m.component+".ts"]},pageCodeFileArray:[],partExtensions:["serv","api"],ReqFileTypes:{js:"serv.js",ts:"serv.ts","api-ts":"api.js","api-js":"api.ts"},ReqFileTypesArray:[],get WebSiteFolder(){return $},get fullWebSitePath(){return A},set WebSiteFolder(n){$=n,A=q(),k.Static[0]=b(x),k.Logs[0]=b(w)},get tsConfig(){return A+"tsconfig.json"},async tsConfigFile(){if(await g.existsFile(this.tsConfig))return await g.readFile(this.tsConfig)},relative(n){return S.relative(A,n)}};c.pageTypesArray=Object.values(c.pageTypes);c.pageCodeFileArray=Object.values(c.pageCodeFile).flat();c.ReqFileTypesArray=Object.values(c.ReqFileTypes)});import{SourceMapConsumer as se,SourceMapGenerator as le}from"source-map";function V(n,t){let e=`sourceMappingURL=data:application/json;charset=utf-8;base64,${Buffer.from(n.toString()).toString("base64")}`;return t?e=`/*# ${e}*/`:e="//# "+e,`\r
`+e}var tt=u(()=>{});import{SourceMapGenerator as Nt,SourceMapConsumer as ge}from"source-map";import L from"path";var v,et=u(()=>{D();O();tt();v=class{constructor(t,e=!0,r=!1,i=!1){this.filePath=t;this.httpSource=e;this.relative=r;this.isCss=i;this.lineCount=0;this.map=new Nt({file:t.split(/\/|\\/).pop()}),e||(this.fileDirName=L.dirname(this.filePath))}getSource(t){return t=t.split("<line>").pop().trim(),this.httpSource?(c.pageTypesArray.includes(L.extname(t).substring(1))?t+=".source":t=W("/",t).pop()+"?source=true",L.normalize((this.relative?"":"/")+t.replace(/\\/gi,"/"))):L.relative(this.fileDirName,c.fullWebSitePath+t)}getRowSourceMap(){return this.map.toJSON()}mapAsURLComment(){return V(this.map,this.isCss)}}});function rt(n,t,e,r){let i=new M(t,e,r);return i.addMappingFromTrack(n),i.getRowSourceMap()}function nt(n,t){let e=new M(t);return e.addMappingFromTrack(n),n.eq+e.mapAsURLComment()}var M,it=u(()=>{et();M=class extends v{constructor(t,e=!1,r=!1){super(t,e,r),this.lineCount=1}addMappingFromTrack(t){let e=t.getDataArray(),r=e.length,i=!0;for(let o=0;o<r;o++){let{text:a,line:l,info:d}=e[o];if(a==`
`){this.lineCount++,i=!1;continue}!i&&l&&d&&a.trim()&&(i=!0,this.map.addMapping({original:{line:l,column:0},generated:{line:this.lineCount,column:0},source:this.getSource(d)}))}}}});var s,ot=u(()=>{D();it();s=class{constructor(t,e){this.DataArray=[];this.InfoText=null;this.OnLine=1;this.OnChar=1;typeof t=="string"?this.InfoText=t:t&&this.setDefault(t),e&&this.AddFileText(e,this.InfoText)}static get emptyInfo(){return{info:"",line:0,char:0}}setDefault(t=this.DefaultInfoText){this.InfoText=t.info,this.OnLine=t.line,this.OnChar=t.char}getDataArray(){return this.DataArray}get DefaultInfoText(){return this.DataArray.find(t=>t.info)??s.emptyInfo}get DefaultInfoTextLast(){for(let t=this.DataArray.length-1;t>=0;t--)if(this.DataArray[t].info)return this.DataArray[t];return s.emptyInfo}get StartInfo(){return this.DataArray[0]??this.DefaultInfoText}get OneString(){let t="";for(let e of this.DataArray)t+=e.text;return t}get eq(){return this.OneString}get originalLineInfo(){let t=this.DefaultInfoText;return`${t.info}:${t.line}:${t.char}`}get lineInfo(){let t=this.originalLineInfo.split("<line>");return t.push(c.fullWebSitePath+t.pop()),t.join("<line>")}get length(){return this.DataArray.length}Clone(){let t=new s(this.StartInfo);for(let e of this.DataArray)t.AddTextAfter(e.text,e.info,e.line,e.char);return t}AddClone(t){this.DataArray=this.DataArray.concat(t.DataArray),this.setDefault({info:t.InfoText,line:t.OnLine,char:t.OnChar})}static concat(...t){let e=new s;for(let r of t)r instanceof s?e.AddClone(r):e.AddTextAfter(String(r));return e}ClonePlus(...t){return s.concat(this.Clone(),...t)}Plus(...t){for(let e of t)e instanceof s?this.AddClone(e):this.AddTextAfterNoTrack(String(e));return this}Plus$(t,...e){for(let r in e){let i=t[r],o=e[r];this.AddTextAfterNoTrack(i),o instanceof s?this.AddClone(o):o!=null&&this.AddTextAfterNoTrack(String(o))}return this.AddTextAfterNoTrack(t[t.length-1]),this}AddTextAction(t,e,r=this.DefaultInfoText.info,i=0,o=1){let a=[];for(let l of[...t])a.push({text:l,info:r,line:i,char:o}),o++,l==`
`&&(i++,o=1);this.DataArray[e](...a)}AddTextAfter(t,e,r,i){return this.AddTextAction(t,"push",e,r,i),this}AddTextAfterNoTrack(t,e=""){for(let r of t)this.DataArray.push({text:r,info:e,line:0,char:0});return this}AddTextBefore(t,e,r,i){return this.AddTextAction(t,"unshift",e,r,i),this}AddTextBeforeNoTrack(t,e=""){let r=[];for(let i of t)r.push({text:i,info:e,line:0,char:0});return this.DataArray.unshift(...r),this}AddFileText(t,e=this.DefaultInfoText.info){let r=1,i=1;for(let o of[...t])this.DataArray.push({text:o,info:e,line:r,char:i}),i++,o==`
`&&(r++,i=1)}CutString(t=0,e=this.length){let r=new s(this.StartInfo);return r.DataArray=r.DataArray.concat(this.DataArray.slice(t,e)),r}substring(t,e){return isNaN(e)?e=void 0:e=Math.abs(e),isNaN(t)?t=void 0:t=Math.abs(t),this.CutString(t,e)}substr(t,e){return t<0&&(t=this.length-t),this.substring(t,e!=null?e+t:e)}slice(t,e){return t<0&&(t=this.length-t),e<0&&(t=this.length-t),this.substring(t,e)}charAt(t){return t||(t=0),this.CutString(t,t+1)}at(t){return this.charAt(t)}charCodeAt(t){return this.charAt(t).OneString.charCodeAt(0)}codePointAt(t){return this.charAt(t).OneString.codePointAt(0)}*[Symbol.iterator](){for(let t of this.DataArray){let e=new s;e.DataArray.push(t),yield e}}getLine(t,e=!0){return this.split(`
`)[t-+e]}charLength(t){if(t<=0)return t;let e=0;for(let r of this.DataArray)if(e++,t-=r.text.length,t<=0)return e;return e}indexOf(t){return this.charLength(this.OneString.indexOf(t))}lastIndexOf(t){return this.charLength(this.OneString.lastIndexOf(t))}unicodeMe(t){let e="";for(let r of t)e+="\\u"+("000"+r.charCodeAt(0).toString(16)).slice(-4);return e}get unicode(){let t=new s;for(let e of this.DataArray)t.AddTextAfter(this.unicodeMe(e.text),e.info,e.line,e.char);return t}search(t){return this.charLength(this.OneString.search(t))}startsWith(t,e){return this.OneString.startsWith(t,e)}endsWith(t,e){return this.OneString.endsWith(t,e)}includes(t,e){return this.OneString.includes(t,e)}trimStart(){let t=this.Clone();t.setDefault();for(let e=0;e<t.DataArray.length;e++){let r=t.DataArray[e];if(r.text.trim()=="")t.DataArray.shift(),e--;else{r.text=r.text.trimStart();break}}return t}trimLeft(){return this.trimStart()}trimEnd(){let t=this.Clone();t.setDefault();for(let e=t.DataArray.length-1;e>=0;e--){let r=t.DataArray[e];if(r.text.trim()=="")t.DataArray.pop();else{r.text=r.text.trimEnd();break}}return t}trimRight(){return this.trimEnd()}trim(){return this.trimStart().trimEnd()}SpaceOne(t){let e=this.at(0),r=this.at(this.length-1),i=this.Clone().trim();return e.eq&&i.AddTextBefore(t||e.eq,e.DefaultInfoText.info,e.DefaultInfoText.line,e.DefaultInfoText.char),r.eq&&i.AddTextAfter(t||r.eq,r.DefaultInfoText.info,r.DefaultInfoText.line,r.DefaultInfoText.char),i}ActionString(t){let e=this.Clone();for(let r of e.DataArray)r.text=t(r.text);return e}toLocaleLowerCase(t){return this.ActionString(e=>e.toLocaleLowerCase(t))}toLocaleUpperCase(t){return this.ActionString(e=>e.toLocaleUpperCase(t))}toUpperCase(){return this.ActionString(t=>t.toUpperCase())}toLowerCase(){return this.ActionString(t=>t.toLowerCase())}normalize(){return this.ActionString(t=>t.normalize())}StringIndexer(t,e){t instanceof RegExp&&(t=new RegExp(t,t.flags.replace("g","")));let r=[],i=this.OneString,o=i.match(t),a=0,l=0,d=this.Clone();for(;(e==null||l<e)&&o?.[0]?.length;){let P=[...o[0]].length,R=d.charLength(o.index);r.push({index:R+a,length:P}),i=i.slice(o.index+o[0].length),d=d.CutString(R+P),a+=R+P,o=i.match(t),l++}return r}RegexInString(t){return t instanceof RegExp?t:new s("n",t).unicode.eq}split(t,e){let r=this.StringIndexer(this.RegexInString(t),e),i=[],o=0;for(let a of r)i.push(this.CutString(o,a.index)),o=a.index+a.length;return i.push(this.CutString(o)),i}repeat(t){let e=this.Clone();for(let r=0;r<t;r++)e.AddClone(this.Clone());return e}static join(t){let e=new s;for(let r of t)e.AddClone(r);return e}replaceWithTimes(t,e,r){let i=this.StringIndexer(t,r),o=new s,a=0;for(let l of i)o=o.ClonePlus(this.CutString(a,l.index),e),a=l.index+l.length;return o.AddClone(this.CutString(a)),o}replace(t,e){return this.replaceWithTimes(this.RegexInString(t),e,t instanceof RegExp?void 0:1)}replacer(t,e){let r=this.Clone(),i;function o(){i=r.match(t)}o();let a=new s(r.StartInfo);for(;i;)a.Plus(r.substring(0,i.index)),a.Plus(e(i)),r=r.substring(i.index+i[0].length),o();return a.Plus(r),a}async replacerAsync(t,e){let r=this.Clone(),i;function o(){i=r.match(t)}o();let a=new s(r.StartInfo);for(;i;)a.Plus(r.substring(0,i.index)),a.Plus(await e(i)),r=r.substring(i.index+i[0].length),o();return a.Plus(r),a}replaceAll(t,e){return this.replaceWithTimes(this.RegexInString(t),e)}matchAll(t){let e=this.StringIndexer(t),r=[];for(let i of e)r.push(this.substr(i.index,i.length));return r}match(t){if(t instanceof RegExp&&t.global)return this.matchAll(t);let e=this.OneString.match(t);if(e==null)return null;let r=[];r[0]=this.substr(e.index,e.shift().length),r.index=e.index,r.input=this.Clone();let i=r[0].Clone();for(let o in e){if(isNaN(Number(o)))break;let a=e[o];if(a==null){r.push(a);continue}let l=i.indexOf(a);r.push(i.substr(l,a.length)),i=i.substring(l)}return r}toString(){return this.OneString}extractInfo(t="<line>"){return this.DefaultInfoText.info.split(t).pop().trim()}originalPositionFor(t,e){let r=this.getLine(t);return r.startsWith("//")&&(r=this.getLine(t-1),e=0),T(y({},r.at(e-1).DefaultInfoText),{searchLine:r})}debugLine({message:t,text:e,location:r,line:i,col:o}){let a=this.originalPositionFor(i??r?.line??1,o??r?.column??0);return`${e||t}, on file -><color>${c.fullWebSitePath+a.searchLine.extractInfo()}:${a.line}:${a.char}${r?.lineText?`
Line: "`+r.lineText.trim()+'"':""}`}StringWithTack(t){return nt(this,t)}StringTack(t,e,r){return rt(this,t,e,r)}}});import Ce from"chalk";var G,De,at=u(()=>{G=class{constructor(){this.events=[];this.eventLog=[];this.logAll=!1}event(t,e){this.events.push({name:t,func:e})}dispatch(t,e={}){e.date=new Date,this.eventLog.push(e),this.events.forEach(r=>r.name==t&&r.func(e)),this.simpleLog(t,e)}simpleLog(t,e){this.logAll&&console.log(t,e)}},De=new G});function H(n){for(;n.includes("  ");)n=n.replace(/ {2}/gi," ");return n=n.replace(/\r\n|\n/gi,""),n=n.replace(/, /gi,","),n=n.replace(/: /gi,":"),n=n.replace(/ \{/gi,"{"),n=n.replace(/\{ /gi,"{"),n=n.replace(/; /gi,";"),n=n.replace(/\/\*.*?\*\//gms,""),n.trim()}var st=u(()=>{});import Re from"markdown-it";import Ee from"highlight.js";import Be from"markdown-it-anchor";import Ue from"@sindresorhus/slugify";import Ge from"markdown-it-attrs";import Je from"markdown-it-abbr";async function ct(){for(let n of Wt){let t=(await g.readFile(lt+n+".css")).replace(/(\n\.markdown-body {)|(^.markdown-body {)/gm,e=>e+"padding:20px;")+`
            .code-copy>div>a{
                margin-top: 25px;
                margin-right: 10px;
                position: relative;
                bottom: -7px;        
            }
            .code-copy>div {
                text-align:right;
                opacity:0;
                height:0;
            }
            .code-copy:hover>div {
                opacity:1;
            }
            .code-copy>div a:focus {
                color:#6bb86a
            }
            `;await g.writeFile(lt+n+".min.css",H(t))}}function Ot(n,t){let[e,r,i]=n.split(/(}|\*\/).hljs{/),o=n[e.length]=="}"?"}":"*/";return[e+o,".hljs{"+(i??r),".hljs{"+t.split(/(}|\*\/).hljs{/).pop()]}async function jt(n){let t=n.split("|");if(t.length==1)return n;let e=t[2]||t.slice(0,2).join("~").replace("/","-");if(await g.existsFile(I+e+".css"))return e;let r=await g.readFile(I+t[0]+".css"),i=await g.readFile(I+t[1]+".css"),[o,a,l]=Ot(i,r),d=`${o}@media(prefers-color-scheme:dark){${a}}@media(prefers-color-scheme:light){${l}}`;return await g.writeFile(I+e+".css",d),e}function ut(){return jt("atom-one-light|atom-one-dark|atom-one")}var Wt,lt,I,pt=u(()=>{ot();at();N();D();st();F();Wt=["","-dark","-light"],lt=C+"node_modules/github-markdown-css/github-markdown";I=C+"node_modules/highlight.js/styles/"});var Bt={};var gt=u(async()=>{pt();await ct();await ut()});import{chdir as $t,cwd as Ut}from"process";var qt=Ut().split("/");function ht(n){if(qt.at(-n)=="node_modules")return $t("../".repeat(n)),!0}ht(2)||ht(3);gt();
