@cxl/build 1.0.0-beta.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/spec.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { Package } from './npm.js';
2
+ export declare function generateEsmTestFile(dirName: string, pkgName: string, testFile: string, importmap: string): Buffer<ArrayBuffer>;
3
+ export declare function generateTestFile({ appId, pkgJson, rootPkg, testFile, outFile, }: {
4
+ appId: string;
5
+ pkgJson: Package;
6
+ rootPkg: Package;
7
+ testFile?: string;
8
+ outFile?: string;
9
+ }): import("../rx/index.js").Observable<{
10
+ path: string;
11
+ source: Buffer<ArrayBuffer>;
12
+ }, "none" | "emit1">;
13
+ export declare function runTests({ appId, outputDir, node, entryFile, ignoreCoverage, }: {
14
+ appId: string;
15
+ outputDir: string;
16
+ node?: boolean;
17
+ entryFile?: string;
18
+ ignoreCoverage?: boolean;
19
+ }): import("../rx/index.js").Observable<never, "none" | "emit1">;
package/tsc.d.ts CHANGED
@@ -1,9 +1,17 @@
1
1
  import { Observable, Subscriber } from '../rx/index.js';
2
2
  import type { BuilderProgram, BuildOptions, Diagnostic, FormatDiagnosticsHost, Program, ParsedCommandLine } from 'typescript';
3
3
  import { Output } from './builder.js';
4
+ export interface TsconfigJson {
5
+ compilerOptions?: {
6
+ outDir?: string;
7
+ };
8
+ files?: string[];
9
+ include?: string[];
10
+ exclude?: string[];
11
+ }
4
12
  export declare const tscVersion: string;
5
13
  export declare function buildDiagnostics(program: Program | BuilderProgram): Diagnostic[];
6
14
  export declare function printDiagnostics(diagnostics: readonly Diagnostic[], host?: FormatDiagnosticsHost): void;
7
15
  export declare function tsbuild(tsconfig: string | undefined, subs: Subscriber<Output>, defaultOptions?: BuildOptions): void;
8
- export declare function tsconfig(tsconfig?: string, options?: BuildOptions): Observable<Output, "none">;
16
+ export declare function tsconfig(tsconfig?: string, options?: BuildOptions): Observable<Output, "none" | "emit1">;
9
17
  export declare function parseTsConfig(tsconfig: string): ParsedCommandLine;
package/chunk-FSRPMVAS.js DELETED
@@ -1 +0,0 @@
1
- var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
package/chunk-KPQXDQIW.js DELETED
@@ -1,44 +0,0 @@
1
- import{a as x,b as ae,c as g,d as ue,e as le,h as fe}from"./chunk-SWJCWBGM.js";import{basename as Fr,join as _}from"path";import{readFileSync as q}from"fs";var b={},Lr=Symbol("terminator");function He(e,t){let r=!1,n={error:o,unsubscribe:i,get closed(){return r},signal:I(),next(s){if(!r)try{e.next?.(s)}catch(c){o(c)}},complete(){if(!r)try{e.complete?.()}finally{i()}}};e.signal?.subscribe(i);function o(s){if(r)throw s;if(!e.error)throw i(),s;try{e.error(s)}finally{i()}}function i(){r||(r=!0,n.signal.next())}try{if(t?.(n))throw new Error("Unsubscribe function result is deprectaed")}catch(s){o(s)}return n}function de(...e){return t=>e.reduce((r,n)=>n(r),t)}var l=class{__subscribe;constructor(t){this.__subscribe=t}then(t,r){return Xe(this).then(t,r)}pipe(...t){return t.reduce((r,n)=>n(r),this)}subscribe(t){return He(!t||typeof t=="function"?{next:t}:t,this.__subscribe)}},T=class extends l{closed=!1;signal=I();observers=new Set;constructor(){super(t=>this.onSubscribe(t))}next(t){if(!this.closed)for(let r of Array.from(this.observers))r.closed||r.next(t)}error(t){if(!this.closed){this.closed=!0;let r=!1,n;for(let o of Array.from(this.observers))try{o.error(t)}catch(i){r=!0,n=i}if(r)throw n}}complete(){this.closed||(this.closed=!0,Array.from(this.observers).forEach(t=>t.complete()),this.observers.clear())}onSubscribe(t){this.closed?t.complete():(this.observers.add(t),t.signal.subscribe(()=>this.observers.delete(t)))}},z=class extends l{closed=!1;observers=new Set;constructor(){super(t=>{this.closed?(t.next(),t.complete()):this.observers.add(t)})}next(){if(!this.closed){this.closed=!0;for(let t of Array.from(this.observers))t.closed||(t.next(),t.complete());this.observers.clear()}}};var W=class extends T{bufferSize;buffer=[];hasError=!1;lastError;constructor(t=1/0){super(),this.bufferSize=t}error(t){this.hasError=!0,this.lastError=t,super.error(t)}next(t){return this.buffer.length===this.bufferSize&&this.buffer.shift(),this.buffer.push(t),super.next(t)}onSubscribe(t){this.observers.add(t),this.buffer.forEach(r=>t.next(r)),this.hasError?t.error(this.lastError):this.closed&&t.complete(),t.signal.subscribe(()=>this.observers.delete(t))}},H=class extends T{$value=b;get hasValue(){return this.$value!==b}get value(){if(this.$value===b)throw new Error("Reference not initialized");return this.$value}next(t){return this.$value=t,super.next(t)}onSubscribe(t){!this.closed&&this.$value!==b&&t.next(this.$value),super.onSubscribe(t)}},Y=class extends Error{message="No elements in sequence"};function I(){return new z}function k(e){return new l(t=>{e().subscribe(t)})}function me(e){return new l(t=>{for(let r of e)t.closed||t.next(r);t.complete()})}function ge(e){return new l(t=>{e.then(r=>{t.closed||t.next(r),t.complete()}).catch(r=>t.error(r))})}function M(e){return k(()=>ge(e()))}function Ye(e){return new l(t=>{for(let r of e)t.closed||t.next(r);t.complete()})}function he(e){return e instanceof l?e:Array.isArray(e)?me(e):e instanceof Promise?ge(e):Ye(e)}function R(...e){return me(e)}function Ke(e){return new Promise((t,r)=>{let n=b;e.subscribe({next:o=>n=o,error:o=>r(o),complete:()=>t(n)})})}function Xe(e){return Ke(e).then(t=>t===b?void 0:t)}function j(e,t){return $(r=>({next:e(r),unsubscribe:t}))}function $(e){return t=>new l(r=>{let n=e(r,t);r.signal.subscribe(()=>n.unsubscribe?.()),n.error||(n.error=r.error),n.complete||(n.complete=r.complete),n.signal=r.signal,t.subscribe(n)})}function K(e){return j(t=>r=>t.next(e(r)))}function X(e,t){return $(r=>{let n=t,o=0;return{next(i){n=e(n,i,o++)},complete(){r.next(n),r.complete()}}})}function Qe(e){return $(t=>{let r=!0,n;return{next(o){r&&(r=!1,t.next(o),n=setTimeout(()=>r=!0,e))},unsubscribe:()=>clearTimeout(n)}})}function Ze(e){return new l(t=>{let r=setTimeout(()=>{t.next(),t.complete()},e);t.signal.subscribe(()=>clearTimeout(r))})}function et(e,t=Ze){return xe(r=>t(e).map(()=>r))}function xe(e){return t=>v(r=>{let n=!1,o=!1,i,s=()=>{i?.next(),n=!1,o&&r.complete()},c=I();r.signal.subscribe(()=>{s(),c.next()}),t.subscribe({next(a){s(),i=I(),n=!0,e(a).subscribe({next:r.next,error:r.error,complete:s,signal:i})},error:r.error,complete(){o=!0,n||r.complete()},signal:c})})}function tt(e){return t=>v(r=>{let n=r.signal,o=0,i=0,s=!1;t.subscribe({next:c=>{o++,e(c).subscribe({next:r.next,error:r.error,complete:()=>{i++,s&&i===o&&r.complete()},signal:n})},error:r.error,complete(){s=!0,i===o&&r.complete()},signal:n})})}function rt(e){return $(t=>{let r=!0;return{next(n){r&&(r=!1,e(n).subscribe({next:t.next,error:t.error,complete:()=>r=!0,signal:t.signal}))}}})}function Q(e){return j(t=>r=>{e(r)&&t.next(r)})}function nt(e){return j(t=>r=>{e-- >0&&!t.closed&&t.next(r),(e<=0||t.closed)&&t.complete()})}function ot(e){return j(t=>r=>{!t.closed&&e(r)?t.next(r):t.complete()})}function st(){let e=!1;return $(t=>({next(r){e||(e=!0,t.next(r),t.complete())},complete(){t.closed||t.error(new Y)}}))}function Z(e){return j(t=>r=>{e(r),t.next(r)})}function it(e){return $((t,r)=>{let n,o={next:t.next,error(i){try{if(t.closed)return;let s=e(i,r);s&&(n?.next(),n=I(),s.subscribe({...o,signal:n}))}catch(s){t.error(s)}},unsubscribe:()=>n?.next()};return o})}function ct(){return j(e=>{let t=b;return r=>{r!==t&&(t=r,e.next(r))}})}function at(){return e=>{let t=new W(1),r=!1;return v(n=>{t.subscribe(n),r||(r=!0,e.subscribe(t))})}}function ut(){return e=>{let t,r=0;function n(){--r===0&&t?.signal.next()}return v(o=>{o.signal.subscribe(n),r++===0?(t=dt(),t.subscribe(o),e.subscribe(t)):t.subscribe(o)})}}function lt(){return e=>{let t=new T,r,n,o=!1,i=!1;return v(s=>{i?(s.next(n),s.complete()):t.subscribe(s),r??=e.subscribe({next:c=>{o=!0,n=c},error:s.error,complete(){i=!0,o&&t.next(n),t.complete()},signal:s.signal})})}}function we(...e){return e.length===1?e[0]:new l(t=>{let r=e.length;for(let n of e)t.closed||n.subscribe({next:t.next,error:t.error,complete(){r--===1&&t.complete()},signal:t.signal})})}function ft(e){return $(t=>({next:t.next,unsubscribe:e}))}function pt(){return Q(()=>!1)}var L=new l(e=>e.complete());function v(e){return new l(e)}function dt(){return new H}var pe={catchError:it,debounceTime:et,distinctUntilChanged:ct,exhaustMap:rt,filter:Q,finalize:ft,first:st,ignoreElements:pt,map:K,mergeMap:tt,publishLast:lt,reduce:X,share:ut,shareLatest:at,switchMap:xe,take:nt,takeWhile:ot,tap:Z,throttleTime:Qe};for(let e in pe)l.prototype[e]=function(...t){return this.pipe(pe[e](...t))};import{resolve as ht}from"path";import*as w from"inspector";function mt(e){let t=[];for(let r of e){let n=0,o=0;for(let i of r.functions)for(let s of i.ranges){let c=s.endOffset-s.startOffset;n+=c,s.count&&(o+=c)}t.push({url:r.url,functions:r.functions,blockTotal:n,blockCovered:o})}return t}async function gt(e){let t=[],r=/\/node_modules\//;for(let n of e){let o=n.url;r.test(o)||t.push({url:o,functions:n.functions})}return mt(t)}function ye(e){let t=0,r=e.results.map(o=>(o.success===!1&&t++,{message:o.message,success:o.success,data:o.data,stack:o.stack})),n=(e.only.length?e.only:e.tests).map(o=>{let i=ye(o);return t+=i.failureCount,i});return r.length===0&&e.tests.length===0&&(t++,r.push({success:!1,message:"No assertions found"})),{name:e.name,failureCount:t,results:r,tests:n,runTime:e.runTime,timeout:e.timeout}}async function O(e,t){let r=ye(e),n=t&&await gt(t);return{success:r.failureCount===0,testReport:r,coverage:n}}function A(e,t,r={}){return new Promise((n,o)=>{e.post(t,r,(i,s)=>i?o(i):n(s))})}async function xt(e,t){await A(e,"Profiler.enable"),await A(e,"Profiler.startPreciseCoverage",{detailed:!0});let r=await t(),n=await A(e,"Profiler.takePreciseCoverage");return await A(e,"Profiler.stopPreciseCoverage"),await A(e,"Profiler.disable"),{coverage:n.result,result:r}}async function ee(e){async function t(){let i=(await import(o)).default;return i.run().then(()=>i)}let r=e.entryFile,n=new w.Session;e.log(`Runner: Node ${process.version}`);let o=ht(r);if(e.log(`Suite: ${o}`),e.inspect&&(w.open(),console.log(`Waiting for debugger (${w.url()})`),w.waitForDebugger()),n.connect(),e.ignoreCoverage){let i=await t();return O(i)}else{let{result:i,coverage:s}=await xt(n,t);return process.argv.includes("--inspect")&&(console.log("Press any key to continue"),await new Promise(c=>process.stdin.once("data",c))),O(i,s)}}import*as Se from"puppeteer";import{readFile as De,writeFile as be,mkdir as $e}from"fs/promises";import{resolve as wt,relative as ke,join as yt,extname as bt}from"path";import{createRequire as $t}from"module";async function vt(e){await Promise.all([e.coverage.startJSCoverage({reportAnonymousScripts:!0})])}async function Et(e,t){let r=e.type(),{url:n,lineNumber:o}=e.location(),i=o!==void 0?` (${o})`:"";t.log(`console ${r}: ${n}${i}`);for(let s of e.args())try{console.log(await s.evaluate(c=>c instanceof Error?{message:c.message,stack:c.stack}:JSON.stringify(c,null,2)))}catch{console.log(s.toString())}}async function St(e){return await(await e.createBrowserContext()).newPage()}async function Dt(e,t,r){function n(a){let u=a.type;if(u==="figure")try{return Nt(o,a,e)}catch(p){return{success:!1,message:String(p)||"Unknown Error"}}else{if(u==="hover"||u==="tap"||u==="click")return o.$(a.element).then(p=>{if(!p)throw new Error(`Element for selector "${a.element}" not found.`);return p[u]()}).then(()=>({success:!0,message:"Element"}));if(u==="type"||u==="press")return o.$(a.element).then(p=>{if(!p)throw new Error(`Element for selector "${a.element}" not found.`);return p[u](a.value)}).then(()=>({success:!0,message:"Element"}));if(u==="testElement")return{success:!0,message:"testElement supported"};if(u==="concurrency")return{success:!0,message:"Concurrency",concurrency:r}}return{success:!1,message:`Feature not supported: ${u}`}}let o=await St(t),i=e.vfsRoot?`./${ke(e.vfsRoot,e.entryFile)}`:e.entryFile;o.on("console",a=>Et(a,e)),o.on("pageerror",a=>e.log(a)),o.on("requestfailed",a=>{e.log(`requestfailed: ${a.method()} ${a.url()} ${a.failure()?.errorText}`)}),o.exposeFunction("__cxlRunner",n),await vt(o),e.browserUrl&&await je(e,o,e.browserUrl),await o.bringToFront();let s=await jt(o,e,i);if(!s)throw new Error("Invalid suite");let c=e.ignoreCoverage?void 0:await Pt(o,e);return{suite:s,coverage:c}}function kt(e,t){let r=t.vfsRoot?wt(t.vfsRoot):process.cwd(),n=$t(r+"/");function o(i){try{let s=n.resolve(i.slice(1));if(s)return ke(r,s)}catch{}return i}e.on("request",async i=>{try{let s=new URL(i.url());if(i.method()==="GET"&&s.hostname==="cxl-tester"){if(s.pathname==="/"||s.pathname==="/favicon.ico")return i.respond({status:200,body:""});let c=o(s.pathname);if(c!==s.pathname)return i.respond({status:301,headers:{location:"/"+c}});let a=await De(yt(r,c),"utf8"),u=bt(c);u===".js"&&!t.sources.has(s.href)&&t.sources.set(s.href,{path:c,source:a}),i.respond({status:200,contentType:u===".js"?"text/javascript":"text/plain",body:a})}else i.continue()}catch{t.log(`Error handling request ${i.method()} ${i.url()}`),i.respond({status:500})}})}function je(e,t,r){return t.goto(r)}async function jt(e,t,r){return await e.setRequestInterception(!0),kt(e,t),await je(t,e,"https://cxl-tester"),t.importmap&&await e.addScriptTag({type:"importmap",content:t.importmap}),e.evaluate(`(async entry => {
2
- const r = (await import(entry)).default;
3
- await r.run();
4
- return r.toJSON();
5
- })('${r}')`)}function te(e,t,r){return{startOffset:e,endOffset:t,count:r}}function Ct(e){let t=[],r=0;for(let n of e.ranges)n.start>r&&t.push(te(r,n.start,0)),t.push(te(n.start,n.end,1)),r=n.end;return r<e.text.length&&t.push(te(r,e.text.length,0)),t}async function Pt(e,t){return(await e.coverage.stopJSCoverage()).flatMap(n=>{let o=t.sources.get(n.url);return o?{url:o.path,functions:[{functionName:"",ranges:Ct(n),isBlockCoverage:!0}]}:[]})}var ve=Promise.resolve();async function Ee(e){let t=(await import("./png-BPHNXF4V.js")).PNG;return new Promise((r,n)=>{new t().parse(Buffer.from(e),(i,s)=>{i?n(i):r(s)})})}function Ft(e,t,r){return new Promise((n,o)=>{let i=`#${t}`;ve=ve.then(()=>e.$eval(i,(s,c)=>{s.innerHTML=c,s.style.zIndex="10",s.getRootNode()?.activeElement?.blur?.()},r).then(async()=>(await e.waitForNetworkIdle({idleTime:120,timeout:5e3}),await e.waitForFunction("document.fonts?.ready"),await e.mouse.move(350,-100),(await e.$(i))?.screenshot({type:"png",encoding:"binary"}))).then(s=>{ArrayBuffer.isView(s)?n(s):o("Invalid value returned by screenshot()")},s=>o(s)))})}async function Nt(e,t,r){let{name:n,domId:o,html:i}=t,s=t.baseline=`${r.baselinePath||"spec"}/${n}.png`,c=`spec/${n}.png`,[a,u]=await Promise.all([De(s).catch(()=>{}),Ft(e,o,i)]);if(u&&$e("spec").catch(()=>!1).then(()=>be(c,u)),(!a||r.updateBaselines)&&u&&r.baselinePath)$e(r.baselinePath).catch(()=>!1).then(()=>be(s,u));else if(a&&u&&r.baselinePath){let[p,S]=await Promise.all([Ee(a),Ee(u)]),N=p.data,J=S.data,m=N.length;if(m!==J.length)return{success:!1,message:`Screenshot should match baseline: Different Size (${p.width}x${p.height} vs ${S.width}x${S.height})`,data:t};for(let D=0;D<m;D++)if(N.readUInt8(D)!==J.readUInt8(D))return{success:!1,message:"Screenshot should match baseline",data:t}}return{success:!0,message:"Screenshot should match baseline",data:t}}async function re(e){let t=["--no-sandbox","--disable-setuid-sandbox","--disable-gpu","--font-render-hinting=none","--disable-font-subpixel-positioning","--animation-duration-scale=0","--force-device-scale-factor=1","--window-size=1280,1024","--disable-infobars","--hide-scrollbars","--blink-settings=imagesEnabled=true","--enable-font-antialiasing","--disable-features=Translate,BackForwardCache,ColorPicker,SharedArrayBuffer,InterestCohort,NotificationIndicator,Prerender2","--disable-background-timer-throttling","--disable-backgrounding-occluded-windows","--disable-renderer-backgrounding","--mute-audio","--disable-extensions"];e.disableSecurity&&t.push("--disable-web-security");let r=await Se.launch({headless:!0,args:t,timeout:5e3});try{e.log(`Puppeteer ${await r.version()}`);let{suite:n,coverage:o}=await Dt(e,r,0);return O(n,o)}finally{await r.close()}}function Ce(e){return e.node?ee(e):re(e)}function Tt(e,t){let r=t.message;console.error(e,x.red(r)),t.stack&&console.error(t.stack)}function Pe(e){let t="",r=e.results.filter(o=>(t+=o.success?x.green("."):x.red("X"),o.success===!1)),n=e.runTime>e.timeout?"brightYellow":e.runTime>e.timeout/2?"yellow":"gray";return console.group(`${e.name} ${x[n](`(${e.runTime.toFixed(2)} ms)`)} ${t}`),r.forEach(o=>Tt(e.name,o)),e.tests.forEach(Pe),console.groupEnd(),r}function It(e){console.log("Coverage Report:");for(let t of e){let r=(t.blockCovered/t.blockTotal*100).toFixed(2);console.log(`${t.url}: ${r}% (${t.blockTotal}/${t.blockCovered})`)}}function ne(e){e.coverage&&It(e.coverage),Pe(e.testReport)}import{dirname as Wt,relative as Ht,resolve as Yt}from"path";import{existsSync as Kt,utimesSync as Xt,writeFileSync as Qt}from"fs";import{spawn as Zt,execSync as Ae}from"child_process";import{createRequire as er}from"module";import{existsSync as At,readFileSync as Re}from"fs";import{join as Bt,resolve as Jt}from"path";import{promises as Rt,readFileSync as Zr}from"fs";import{basename as Lt,dirname as tn,resolve as Ot}from"path";async function Ne(e){let t=await Rt.readFile(e);return{path:e,source:t}}function E(e,t){return k(()=>he(Ne(e).then(r=>({path:t||Ot(e),source:r.source}))))}function nn(e){return Z(t=>t.path=(e||"")+Lt(t.path))}function on(e,t=`
6
- `){return de(X((r,n)=>`${r}${t}${n.source}`,""),K(r=>({path:e,source:Buffer.from(r)})))}function sn(e){return new l(t=>{Promise.all(e.map(Ne)).then(r=>{r.forEach(n=>t.next(n)),t.complete()},r=>t.error(r))})}function Te(e,t,r=""){return U(`mkdir -p ${t} && rsync -au -i --delete ${e}/${r} ${t}`)}function cn(e,t){return Fe(`zip - ${e.join(" ")}`).map(r=>({path:t,source:r}))}import{execSync as Mt}from"child_process";import*as Le from"esbuild";var Ut=process.cwd(),C=Mt("npm prefix",{cwd:Ut}).toString().trim(),Gt={"GPL-3.0":"license-GPL-3.0.md","GPL-3.0-only":"license-GPL-3.0.md","Apache-2.0":"license-Apache-2.0.md","SEE LICENSE IN LICENSE.md":"",UNLICENSED:""};function Ie(e,t,r){for(let n of e)if(!t[n])throw new Error(`Field "${n}" missing in "${r}"`)}function oe(e){return new l(t=>{Le.build({minify:!0,bundle:!0,splitting:!0,format:"esm",tsconfig:"tsconfig.json",platform:"browser",define:{CXL_DEBUG:"false"},...e}).then(()=>t.complete())})}function G(e=C){let t=Jt(e,"package.json");if(!At(t))throw new Error(`"${t}" not found`);let r=JSON.parse(Re(t,"utf8"));return Ie(["name","version","description"],r,t),r.private||Ie(["license"],r,t),r}function Vt(e,t){return R({path:"package.json",source:Buffer.from(JSON.stringify({name:e.name,version:e.version,description:e.description,private:e.private,license:e.license,files:e.files||["*.js","*.d.ts","*.css","LICENSE.md","*.md"],main:t??e.main??"index.js",exports:e.exports,browser:e.browser,homepage:e.homepage,bugs:e.bugs,bin:e.bin,sideEffects:e.sideEffects,repository:e.repository,dependencies:e.dependencies,peerDependencies:e.peerDependencies,bundledDependencies:e.bundledDependencies,type:e.type},null,2))})}function _t(e){if(e==="UNLICENSED"||e==="SEE LICENSE IN LICENSE.md")return L;let t=Gt[e];if(!t)throw new Error(`Invalid license: "${e}"`);return E(Bt(import.meta.dirname,t),"LICENSE")}function qt(e,t){return`https://npmjs.com/package/${e}/v/${t}`}function zt(e){try{return Re(e,"utf8")}catch{return""}}function Oe(){return k(()=>{let e=G(C),t=zt("USAGE.md"),r=encodeURIComponent(e.name);return R({path:"README.md",source:Buffer.from(`# ${e.name}
7
-
8
- [![npm version](https://badge.fury.io/js/${r}.svg)](https://badge.fury.io/js/${r})
9
-
10
- ${e.description}
11
-
12
- ## Project Details
13
-
14
- - Branch Version: [${e.version}](${qt(e.name,e.version)})
15
- - License: ${e.license}
16
- - Documentation: [Link](${e.homepage})
17
- - Report Issues: [Github](${e.bugs})
18
-
19
- ## Installation
20
-
21
- npm install ${e.name}
22
-
23
- ${t}`)})})}function se(e){return k(()=>{let t=G(),r=t.license,n=[Vt(t,e)];return r&&n.push(_t(r)),we(...n)})}var tr=x.green("build"),y=ue.bind(null,tr),Be=er(import.meta.dirname);function rr(e){return(e/1e3).toFixed(2)+"kb"}function nr(e){let t=Number(e)/1e9,r=t.toFixed(4)+"s";return t>.1?t>.5?x.red(r):x.yellow(r):r}function V(e){return Be(Be.resolve(e,{paths:[process.cwd(),import.meta.dirname]}))}async function Je(...e){if(!e)throw new Error("Invalid configuration");C!==process.cwd()&&(process.chdir(C),y(`chdir "${C}"`));let t=G();y(`${t.name} ${t.version}`);let r=[void 0,...process.argv];try{for(let n of r)for(let o of e)o.target===n&&await new ie(y,o).build()}catch(n){console.error(n),process.exit(1)}}function U(e,t){return new l(r=>{y(`sh ${e}`),ae(le(e,t)).then(n=>{y(`sh ${e}`,nr(n.time)),n.result&&console.log(n.result),r.complete()},n=>{r.error(n)})})}function Fe(e,t={}){return new l(r=>{let n=Zt(e,[],{shell:!0,...t}),o,i;n.stdout?.on("data",s=>o=o?Buffer.concat([o,Buffer.from(s)]):Buffer.from(s)),n.stderr?.on("data",s=>i=i?Buffer.concat([i,Buffer.from(s)]):Buffer.from(s)),n.on("close",s=>{s?r.error(i||o):(r.next(o),r.complete())})})}var ie=class{log;config;outputDir;constructor(t,r){this.log=t,this.config=r,this.outputDir=r.outputDir||"."}async build(){try{let t=this.config.target||"";t&&this.log(`target ${t}`),Ae(`mkdir -p ${this.outputDir}`),await Promise.all(this.config.tasks.map(r=>this.runTask(r)))}catch(t){throw console.log("BUILD: ",t),"Build finished with errors"}}async runTask(t){await t.tap(r=>{let n=Yt(this.outputDir,r.path),o=r.source,i=Wt(n);Kt(i)||Ae(`mkdir -p ${i}`),Qt(n,o),r.mtime&&Xt(n,r.mtime,r.mtime);let s=Ht(process.cwd(),n);this.log(`${s} ${rr((r.source||"").length)}`)})}};import{relative as or,join as sr}from"path";function ir(e){let t=[],r=!1;if(e.forEach(n=>{let o=n.errorCount,i=or(process.cwd(),n.filePath);y(`eslint ${i}`),o&&(r=!0,n.messages.forEach(s=>console.error(`${i}#${s.line}:${s.column}: ${s.message} (${s.ruleId})`)))}),r)throw new Error("eslint errors found.");return t}function Me(e){return new l(t=>{(async()=>{let{ESLint:r}=V("eslint");y(`eslint ${r.version}`),new r({cache:!0,cwd:process.cwd(),overrideConfigFile:sr(import.meta.dirname,"eslint-config.js"),...e}).lintFiles(["**/*.ts?(x)"]).then(ir).then(()=>t.complete(),o=>t.error(o))})()})}import{relative as cr}from"path";var h=V("typescript"),P=h.sys,ar={useCaseSensitiveFileNames:!0,readDirectory:P.readDirectory,getCurrentDirectory:P.getCurrentDirectory,fileExists:P.fileExists,readFile:P.readFile,onUnRecoverableConfigFileDiagnostic(e){throw e}},ur={getCurrentDirectory:P.getCurrentDirectory,getNewLine:()=>`
24
- `,getCanonicalFileName:e=>e},Fn=h.version;function lr(e){return[...e.getConfigFileParsingDiagnostics(),...e.getOptionsDiagnostics(),...e.getGlobalDiagnostics(),...e.getDeclarationDiagnostics()]}function Ue(e,t=ur){throw console.error(h.formatDiagnosticsWithColorAndContext(e,t)),new Error("Typescript compilation failed")}function fr(e="tsconfig.json",t={module:h.ModuleKind.CommonJS}){let r=h.createSolutionBuilderHost(P),n=dr(e);n.errors?.length&&Ue(n.errors);let o=n.options.outDir;if(!o)throw new Error(`No outDir field set in ${e}`);let i=h.createSolutionBuilder(r,[e],t);return{outputDir:o,builder:i,options:n}}function pr(e="tsconfig.json",t,r={module:h.ModuleKind.CommonJS}){let{outputDir:n,builder:o}=fr(e,r),i,s="";function c(a,u){s&&a.startsWith(s)?(a=cr(n,a),t.next({path:a,source:Buffer.from(u)})):console.warn(`File "${a}" is outside of outDir. Ignoring.`)}for(;i=o.getNextInvalidatedProject();){if(i.kind===h.InvalidatedProjectKind.Build){let u=i.getProgram();if(s=i.getCompilerOptions().outDir??"",u){let p=lr(u);p.length&&Ue(p)}}if(i.done(void 0,c)!==h.ExitStatus.Success)throw`${i.project}: Typescript compilation failed`}}function Ge(e="tsconfig.json",t){return new l(r=>{pr(e,r,t),r.complete()})}function dr(e){let t;try{t=h.getParsedCommandLineOfConfigFile(e,{},ar)}catch(r){if(r instanceof Error)throw r;let n=r?.message||r?.messageText||"Unknown Error";throw new Error(n)}if(!t)throw console.log(process.cwd()),new Error(`Could not parse config file "${e}"`);return t}import*as F from"path";import{promises as d}from"fs";import*as _e from"child_process";var mr="https://github.com/cxlio/cxl/issues",Ve=F.resolve("."),gr=["name","version","description","license","homepage","bugs"],hr=["build","test"],xr=["GPL-3.0","GPL-3.0-only","Apache-2.0","SEE LICENSE IN LICENSE.md"];async function wr({projectPath:e,rootPkg:t}){let r=`${e}/package.json`,n=await g(r),o=JSON.stringify(n,null," ");for(let s in n.dependencies){let c=t.devDependencies?.[s]||t.dependencies?.[s];c&&n.dependencies[s]!==c&&(n.dependencies[s]=c)}let i=JSON.stringify(n,null," ");o!==i&&await d.writeFile(r,i)}async function yr({projectPath:e,name:t}){let r=`${e}/package.json`,n=await g(r),o=await g(`${e}/tsconfig.json`,!1),i=JSON.stringify(n,null," ");o||(o={extends:"../tsconfig.json",compilerOptions:{outDir:`../dist/${t}`},files:[],references:[]},await d.writeFile(`${e}/tsconfig.json`,JSON.stringify(o,null," ")));let s=JSON.stringify(n,null," ");i!==s&&await d.writeFile(r,s)}async function br({projectPath:e,name:t}){let r=`${e}/tsconfig.test.json`,n=`${e}/test.ts`,o=!1;await B(r)||await d.writeFile(r,`{
25
- "extends": "./tsconfig.json",
26
- "include": ["test.ts"],
27
- "references": [{ "path": "." }, { "path": "../spec" }]
28
- }
29
- `);let i=await g(`${e}/tsconfig.test.json`,null)||{};(!i.extends||i.extends!=="./tsconfig.json")&&(i.extends="./tsconfig.json",o=!0),i.compilerOptions&&(delete i.compilerOptions,o=!0),o&&await d.writeFile(`${e}/tsconfig.test.json`,JSON.stringify(i,null," ")),await B(n)||await d.writeFile(n,`import { spec } from '@cxl/spec';
30
- import { } from './index.js';
31
-
32
- export default spec('${t}', s => {
33
- s.test('should load', a => {
34
- a.ok(get);
35
- });
36
- });
37
- `)}function B(e){return d.stat(e).catch(()=>!1)}function f(e,t){return{valid:e,message:t}}async function $r({projectPath:e,name:t,rootPkg:r}){let n=`${e}/package.json`,o=await g(n),i=JSON.stringify(o,null," "),s=r.devDependencies?.["@cxl/build"]?"cxl-build":"node ../dist/build",c="npm run build test",a="./index.bundle.js";o.scripts||(o.scripts={}),o.scripts.test||(o.scripts.test=c),o.scripts.build||(o.scripts.build=s),o.homepage||(o.homepage=`${r.homepage}/${t}`),o.license||(o.license="GPL-3.0"),(!o.bugs||o.bugs!==r.bugs)&&(o.bugs=r.bugs||mr),!o.browser&&o.devDependencies&&delete o.devDependencies,o.browser&&o.dependencies&&delete o.dependencies,o.peerDependencies&&delete o.peerDependencies,o.browser&&(o.browser=a),!o.repository&&r.repository&&(typeof r.repository=="string"&&(r.repository={type:"git",url:r.repository}),o.repository={...r.repository,directory:t}),o.scripts.test!==c&&(o.scripts.test=c);let u=JSON.stringify(o,null," ");i!==u&&await d.writeFile(n,u)}async function vr({pkg:e,name:t,rootPkg:r}){let n=gr.map(s=>f(s in e,`Field "${s}" required in package.json`)),o="./index.bundle.js";if(e.scripts){let s=e.scripts;n.push(...hr.map(c=>f(c in s,`Script "${c}" required in package.json`)))}else n.push(f("scripts"in e,'Field "scripts" required in package.json'));return n.push(f(xr.includes(e.license),`"${e.license}" is not a valid license.`),f(!!e.browser||!e.devDependencies,"Package should not have devDependencies."),f(!e.browser||!e.dependencies,"Browser package should only have devDependencies."),f(!e.peerDependencies,"Package should not have peerDependencies."),f(!e.browser||e.browser===o,`Package "browser" property should be "${o}"`),f(e.bugs===r.bugs,`Package "bugs" property must match root package "${r.bugs}"`),f(e?.scripts?.test==="npm run build test","Valid test script in package.json"),f(!!e.repository,'Package "repository" field must be set'),f(typeof e.repository!="string",'"repository" must be an object')),{id:"package",project:t,fix:$r,rules:n}}async function Er({projectPath:e}){let t=await g(`${e}/tsconfig.test.json`);return{id:"test",fix:br,project:e,rules:[f(!!await B(`${e}/tsconfig.test.json`),'Missing "tsconfig.test.json" file.'),f(t?.extends==="./tsconfig.json",'tsconfig.test.json extends should be "./tsconfig.json"'),f(!!(await B(`${e}/test.ts`)||await B(`${e}/test.tsx`)),'Missing "test.ts" file.'),f(!t.compilerOptions,"tsconfig.test.json should not have compilerOptions")]}}async function Sr({name:e,rootPkg:t,pkg:r}){let n=[];for(let o in r.dependencies){let i=r.dependencies[o],s=t.devDependencies?.[o]||t.dependencies?.[o];n.push(f(!!(o.startsWith(t.name)||s),`Dependency "${o}" must be included in root package.json`),f(i!=="*",`Dependency "${o}" must be a valid version. pkg:${i}`),f(o.startsWith(t.name)||s===i,`Conflicting versions "${o}". root: ${s}, dep: ${i}`))}return{id:"dependencies",project:e,fix:wr,rules:n}}async function Dr({projectPath:e,name:t}){let r=await g(`${e}/tsconfig.json`,null),n=[f(!!r,"tsconfig.json should be present"),f(!!r?.compilerOptions,"tsconfig.json should have compilerOptions"),f(r?.compilerOptions?.outDir===`../dist/${t}`,"tsconfig.json should have a valid outDir compiler option")];return{id:"tsconfig",project:t,fix:yr,rules:n}}var kr=/(.+):(.+)/g;async function jr({name:e}){let r=_e.spawnSync("git",["grep",`"from '\\.\\.\\/"`,e],{encoding:"utf8"}).stdout.trim(),n=[],o;for(;o=kr.exec(r);){let[,i,s]=o,c=s.replace(/'\.\.\/([^/]+)\/index\.js/,"'@cxl/$1");if(c!==s){n.push({file:i,line:s,newLine:c});let a=await d.readFile(i,"utf8");await d.writeFile(i,a.replace(s,c))}}return{id:"imports",project:e,rules:[f(n.length===0,"Should not have local imports")],async fix(){for(let i of n){let s=await d.readFile(i.file,"utf8");await d.writeFile(i.file,s.replace(i.line,i.newLine))}}}}var Cr=[vr,Er,Sr,Dr,jr];async function Pr(e){let t=Ve,r=await d.stat(t),n=F.basename(t);if(!r.isDirectory())return[];let o=await g(F.join(t,"package.json"),!1);if(!o)return[];let i={projectPath:t,name:n,pkg:o,rootPkg:e,baseDir:Ve},s=(await Promise.all(Cr.map(c=>c(i)))).flat();return s.forEach(c=>c.data=i),s}async function qe(){function e(i,s){console.error(`${i}: ${s}`)}let t=await g("../package.json"),r=await Pr(t),n=!1,o=[];for(let i of r){for(let s of i.rules)s.valid||(i.hasErrors=n=!0,e(i.data?.name||"root",s.message));if(i.hasErrors&&i.fix&&i.data){let{data:s,fix:c}=i;o.push(()=>(console.log(`${i.data?.name}: Attempting fix for "${i.id}"`),c(s)))}}for(let i of o)await i();if(n)throw new Error("Errors detected, check logs for details.")}var Nr;function ze(e,t={}){for(let r in e)t[r]=`/${r}`;return t}function We(e,t){let r={};return e.devDependencies&&ze(e.devDependencies,r),t.dependencies&&ze(t.dependencies,r),r}function Tr(e,t){let r=We(e,t);return JSON.stringify({imports:r})}function Ir(e,t){let r=We(e,t);for(let n in r)r[`${n}/`]=`../../node_modules${r[n]}/`;return r["@cxl/spec"]="../../node_modules/@cxl/spec/index.bundle.js",JSON.stringify({imports:r})}function Rr(e,t,r,n){return Buffer.from(`<!DOCTYPE html>
38
- <title>${t} Test Suite</title>
39
- <script type="importmap">${n}</script>
40
- <script type="module">
41
- import suite from '${r}';
42
- ${Nr??=q(_(import.meta.dirname,"spec-browser.js"),"utf8")}
43
- browserRunner.run([suite], '../../${e}/spec');
44
- </script>`)}function Wn(...e){let t=process.cwd(),n=JSON.parse(q(t+"/tsconfig.json","utf8"))?.compilerOptions?.outDir,o=Fr(n),i=_(n,"package"),s=JSON.parse(q("package.json","utf8")),c=JSON.parse(q("../package.json","utf8")),a=!!s.browser,u=s.browser==="./index.bundle.js"&&s.exports,p=s.browser??s.exports?.["."]??"./index.bundle.js",S=[...Object.keys(s.dependencies??{}),...Object.keys(s.peerDependencies??{})],N=[{out:"index.bundle",in:_(n,"index.js")}],J=s.exports?Object.values(s.exports).flatMap(m=>m?[_(n,m)]:[]):N;return Je({outputDir:n,tasks:[E("test-screenshot.html","test-screenshot.html").catchError(()=>L),E("test.html","test.html").catchError(()=>R({path:"test.html",source:Rr(o,s.name,"./test.js",Ir(c,s))})),Ge("tsconfig.test.json"),se("index.js")]},{target:"test",outputDir:n,tasks:[M(async()=>{try{process.chdir(n);let m=await Ce({node:!a,mjs:!0,vfsRoot:"../..",entryFile:"./test.js",importmap:a?Tr(c,s):void 0,sources:new Map,log:console.log.bind(console)});ne(m)}finally{process.chdir(t)}}).ignoreElements()]},{target:"audit",outputDir:n,tasks:[M(qe).ignoreElements()]},{target:"docs",outputDir:`../docs/${o}`,tasks:[v(m=>{import("./render-WEE5MH6Y.js").then(({buildDocs:D})=>D({$:[],clean:!0,summary:!0,markdown:!0,cxlExtensions:!0,outputDir:`../docs/${o}`},ce=>{m.next({path:ce.name,source:Buffer.from(ce.content)})}).then(()=>m.complete()))})]},{target:"package",outputDir:".",tasks:[Oe(),Me(),U(`rm -rf ${i}`)]},{target:"package",outputDir:i,tasks:[E("README.md","README.md"),E("LICENSE.md","LICENSE.md").catchError(()=>L),se(p),Te(n,i,"*.d.ts"),oe({entryPoints:J,platform:a?"browser":"node",outdir:i,external:S}),...u?[oe({entryPoints:N,platform:"browser",outdir:i,external:S})]:[]]},{target:"publish",outputDir:n,tasks:[M(async()=>{await fe(".",i)}).ignoreElements()]},...e)}export{oe as a,Oe as b,se as c,Je as d,U as e,Fe as f,E as g,nn as h,on as i,sn as j,Te as k,cn as l,Wn as m};
package/chunk-SWJCWBGM.js DELETED
@@ -1 +0,0 @@
1
- import{readFile as y,stat as V,mkdir as A}from"fs/promises";import{spawn as $}from"child_process";var p={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]},C=Object.keys(p).reduce((t,n)=>{let r=p[n],s="\x1B["+r[0]+"m",e="\x1B["+r[1]+"m";return t[n]=i=>s+i+e,t},{}),f='"(?:[^"\\\\]|\\\\.)*"',x="-(\\w\\w+)",d=`\\s*=?\\s*(${f}|[^-][^\\s]*)?`,B=`-(\\w)${d}`,k=`--(\\w+)${d}`,N=new RegExp(`\\s*(?:${x}|${B}|${k}|(${f}|[^\\s]+))`,"g");function h(){return process.hrtime.bigint()}async function I(t){let n=h(),r=await(typeof t=="function"?t():t),s=0,e=h(),i={start:n,tasks:++s,time:e-n,result:r};return n=e,i}async function M(t,n){try{return JSON.parse(await y(t,"utf8"))}catch(r){if(n!==void 0)return n;throw r}}function R(t,...n){console.log(typeof t=="string"?t:t(),...n)}function o(t,n={}){return new Promise((r,s)=>{let e=$(t,[],{shell:!0,...n}),i="";e.stdout?.on("data",a=>i+=a?.toString()||""),e.stderr?.on("data",a=>i+=a?.toString()||""),e.on("exit",a=>{a!==0?s(i):r(i)})})}import{readFile as v}from"fs/promises";async function m(t){return(await o("git rev-parse --abbrev-ref HEAD",{cwd:t})).trim()}async function w(t){return(await o("git remote show origin",{cwd:t})).match(/HEAD branch:\s+(\S+)/)?.[1]}import{resolve as P}from"path";async function S(t){return JSON.parse(await v(t,"utf8"))}async function F(t,n="latest"){return(await b(t))?.["dist-tags"][n]||void 0}async function G(t,n){let r=P(n);try{await o("npm install --production",{cwd:r}),await o("npm test",{cwd:t})}finally{await o(`rm -rf ${r}/node_modules ${r}/package-lock.json`)}}async function H(t,n){let r=await m(process.cwd()),s=await w(process.cwd());if(r!==s)throw`Active branch "${r}" is not main branch`;let e=await S(`${t}/package.json`),i=e.name.split("/")[1],a=await b(e.name);if(a.versions.includes(e.version))console.log(`Package "${e.name}" version "${e.version}" already published. Skipping.`);else{console.log(`Building ${e.name} ${e.version}`),await o(`npm run build package --prefix ${t}`),await G(t,n);let c=e.version.includes("beta")?"beta":e.version.includes("alpha")?"alpha":"latest",l=c==="alpha"?a["dist-tags"].alpha:void 0;if(console.log(await o(`npm publish --access=public --tag ${c}`,{cwd:n})),c==="beta"||c==="alpha"){let u=`${e.version.split(".")[0]}-${c}`;console.log(await o(`npm dist-tag add ${e.name}@${e.version} ${u}`))}if(l)try{console.log(await o(`npm unpublish ${e.name}@${l}`))}catch(u){console.error(`Removing old version ${e.name}@${l} failed.`),console.error(u)}}let g=`${i}/${e.version}`;(await o(`git tag -l ${g}`)).trim()||(console.log(`Creating tag "${g}"`),await o(`git tag ${g} && git push origin ${g}`))}async function b(t){return JSON.parse((await o(`npm show ${t} --json`)).trim())}export{C as a,I as b,M as c,R as d,o as e,S as f,F as g,H as h};
package/chunk-TMHR6BIT.js DELETED
@@ -1,4 +0,0 @@
1
- import{existsSync as Ae}from"fs";import{dirname as q,join as Ne,resolve as Le}from"path";import{readFile as Ie,stat as Re,mkdir as $e}from"fs/promises";import{join as zt,resolve as je}from"path";import{spawn as Oe}from"child_process";import{relative as ae,resolve as Ge}from"path";import{createRequire as Je}from"module";var z={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]},Yt=Object.keys(z).reduce((e,t)=>{let n=z[t],i="\x1B["+n[0]+"m",a="\x1B["+n[1]+"m";return e[t]=s=>i+s+a,e},{}),re='"(?:[^"\\\\]|\\\\.)*"',Me="-(\\w\\w+)",ie=`\\s*=?\\s*(${re}|[^-][^\\s]*)?`,Be=`-(\\w)${ie}`,Ue=`--(\\w+)${ie}`,_t=new RegExp(`\\s*(?:${Me}|${Be}|${Ue}|(${re}|[^\\s]+))`,"g");async function O(e){await Re(e).catch(()=>O(je(e,"..")).then(()=>$e(e)))}async function Q(e,t){try{return JSON.parse(await Ie(e,"utf8"))}catch(n){if(t!==void 0)return t;throw n}}function Ke(e,t={}){return new Promise((n,i)=>{let a=Oe(e,[],{shell:!0,...t}),s="";a.stdout?.on("data",c=>s+=c?.toString()||""),a.stderr?.on("data",c=>s+=c?.toString()||""),a.on("exit",c=>{c!==0?i(s):n(s)})})}var o;(function(e){e[e.Unknown=0]="Unknown",e[e.Variable=1]="Variable",e[e.TypeAlias=2]="TypeAlias",e[e.TypeParameter=3]="TypeParameter",e[e.Interface=4]="Interface",e[e.TypeUnion=5]="TypeUnion",e[e.Reference=6]="Reference",e[e.Module=7]="Module",e[e.Class=8]="Class",e[e.Parameter=9]="Parameter",e[e.Property=10]="Property",e[e.Method=11]="Method",e[e.Getter=12]="Getter",e[e.Setter=13]="Setter",e[e.Constructor=14]="Constructor",e[e.Array=15]="Array",e[e.Function=16]="Function",e[e.FunctionType=17]="FunctionType",e[e.ConditionalType=18]="ConditionalType",e[e.Parenthesized=19]="Parenthesized",e[e.Infer=20]="Infer",e[e.IndexedType=21]="IndexedType",e[e.Enum=22]="Enum",e[e.Literal=23]="Literal",e[e.IndexSignature=24]="IndexSignature",e[e.Export=25]="Export",e[e.Keyof=26]="Keyof",e[e.Typeof=27]="Typeof",e[e.ConstructorType=28]="ConstructorType",e[e.Tuple=29]="Tuple",e[e.ThisType=30]="ThisType",e[e.Constant=31]="Constant",e[e.BaseType=32]="BaseType",e[e.ClassType=33]="ClassType",e[e.ObjectType=34]="ObjectType",e[e.Component=35]="Component",e[e.Attribute=36]="Attribute",e[e.Namespace=37]="Namespace",e[e.CallSignature=38]="CallSignature",e[e.ConstructSignature=39]="ConstructSignature",e[e.MappedType=40]="MappedType",e[e.TypeIntersection=41]="TypeIntersection",e[e.ReadonlyKeyword=42]="ReadonlyKeyword",e[e.UnknownType=43]="UnknownType",e[e.Event=44]="Event",e[e.Spread=45]="Spread",e[e.ImportType=46]="ImportType",e[e.Symbol=47]="Symbol"})(o||(o={}));var p;(function(e){e[e.None=0]="None",e[e.Export=1]="Export",e[e.Ambient=2]="Ambient",e[e.Public=4]="Public",e[e.Private=8]="Private",e[e.Protected=16]="Protected",e[e.Static=32]="Static",e[e.Readonly=64]="Readonly",e[e.Abstract=128]="Abstract",e[e.Async=256]="Async",e[e.Default=512]="Default",e[e.Deprecated=8192]="Deprecated",e[e.Overload=16384]="Overload",e[e.External=32768]="External",e[e.DefaultLibrary=65536]="DefaultLibrary",e[e.DeclarationMerge=131072]="DeclarationMerge",e[e.Rest=262144]="Rest",e[e.Optional=524288]="Optional",e[e.Internal=1048576]="Internal"})(p||(p={}));var oe=Je(import.meta.dirname),Ve=oe.resolve("typescript",{paths:[".",import.meta.dirname]}),l=oe(Ve),{getParsedCommandLineOfConfigFile:He,NodeFlags:Y,sys:A}=l,r=l.SyntaxKind,f=l.TypeFlags,le={[r.Unknown]:o.Unknown,[r.VariableDeclaration]:o.Variable,[r.TypeAliasDeclaration]:o.TypeAlias,[r.TypeParameter]:o.TypeParameter,[r.InterfaceDeclaration]:o.Interface,[r.UnionType]:o.TypeUnion,[r.TypeReference]:o.Reference,[r.SourceFile]:o.Module,[r.ClassDeclaration]:o.Class,[r.Parameter]:o.Parameter,[r.PropertyDeclaration]:o.Property,[r.MethodDeclaration]:o.Method,[r.GetAccessor]:o.Getter,[r.SetAccessor]:o.Setter,[r.Constructor]:o.Constructor,[r.ArrayType]:o.Array,[r.FunctionDeclaration]:o.Function,[r.FunctionType]:o.FunctionType,[r.ConditionalType]:o.ConditionalType,[r.ParenthesizedType]:o.Parenthesized,[r.InferType]:o.Infer,[r.IndexedAccessType]:o.IndexedType,[r.EnumDeclaration]:o.Enum,[r.LiteralType]:o.Literal,[r.TemplateLiteralType]:o.Literal,[r.IndexSignature]:o.IndexSignature,[r.ExportSpecifier]:o.Export,[r.KeyOfKeyword]:o.Keyof,[r.TypeQuery]:o.Typeof,[r.ConstructorType]:o.ConstructorType,[r.TupleType]:o.Tuple,[r.ThisType]:o.ThisType,[r.ModuleDeclaration]:o.Namespace,[r.CallSignature]:o.CallSignature,[r.ConstructSignature]:o.ConstructSignature,[r.MappedType]:o.MappedType,[r.IntersectionType]:o.TypeIntersection,[r.ReadonlyKeyword]:o.ReadonlyKeyword,[r.UnknownKeyword]:o.UnknownType,[r.SpreadAssignment]:o.Spread,[r.ImportType]:o.ImportType,[r.SymbolKeyword]:o.Symbol},se={exportsOnly:!0,rootDir:void 0,cxlExtensions:!1},ce=v("number"),pe=v("string"),ue=v("boolean"),de=v("undefined"),fe=v("null"),ye=v("void"),me=v("any"),We=v("unknown"),qe=v("BigInt"),ge=v("never"),k=Symbol("dtsNode"),ze=l.createPrinter(),he,g,C,M,u,Qe=1,P,I,h,E,B,U={useCaseSensitiveFileNames:!0,readDirectory:A.readDirectory,getCurrentDirectory:A.getCurrentDirectory,getNewLine:()=>`
2
- `,fileExists:A.fileExists,getCanonicalFileName:e=>e,readFile:A.readFile,onUnRecoverableConfigFileDiagnostic(e){let t=l.formatDiagnosticsWithColorAndContext([e],U);throw new Error(t)}};function v(e){return{name:e,kind:o.BaseType,flags:0}}function Te(e,t){let n;try{n=He(e,{},U)}catch(i){if(i instanceof Error)throw i;let a=typeof i=="string"?i:String(i);throw new Error(a)}if(!n)throw new Error(`Could not parse config file "${e}"`);return n}function Ye(e){switch(e.kind){case r.BindingElement:return e.parent.parent.parent.flags&Y.Const?o.Constant:o.Variable;case r.VariableDeclaration:return e.parent.flags&Y.Const?o.Constant:o.Variable;case r.TypeLiteral:case r.ObjectLiteralExpression:return o.ObjectType;case r.PropertySignature:case r.PropertyAssignment:case r.EnumMember:return o.Property}return le[e.kind]||o.Unknown}function K(e,t){return Qe++}function _e(e){let t=h.packageRoot||process.cwd(),n=e.getSourceFile(),i=n?{name:ae(t,n.fileName),index:e.pos,tsconfig:g.getCompilerOptions().configFilePath}:void 0;return i&&Object.defineProperty(i,"sourceFile",{value:n,enumerable:!1}),i}function G(e){return l.isSourceFile(e)?W(e.fileName):(e.name?e=e.name:e.typeName&&(e=e.typeName),e.escapedText!==void 0?e.escapedText:e.pos!==-1&&l.isStringLiteral(e)?e.getText():l.isTemplateLiteralTypeNode(e)||l.isLiteralTypeNode(e)||l.isLiteralExpression(e)?ze.printNode(l.EmitHint.Unspecified,e,e.getSourceFile()):e.text?e.text:l.isComputedPropertyName(e)||l.isQualifiedName(e)?e.pos===-1?e.text||"":e.getText():e.moduleName||"")}function y(e,t){let n=e[k]||{};n.source??=_e(e),n.kind=t?.kind??n.kind??Ye(e),n.name||=t?.name||G(e),n.flags??=nt(e);let i=lt(e,n);return i&&(n.docs=i),t&&Object.assign(n,t),e[k]=n}function J(e,t){let n=t[k];if(!n){let i=t.getSourceFile();if(!g.isSourceFileDefaultLibrary(i)&&!g.isSourceFileFromExternalLibrary(i)&&i.isDeclarationFile&&e){let a=H(e),s=I[a];if(s?.source)return s}return y(t)}return n.id??=K(t),n}function Xe(e){return e.kind===r.PropertyDeclaration||e.kind===r.MethodDeclaration||e.kind===r.GetAccessor||e.kind===r.SetAccessor||e.kind===r.PropertySignature||e.kind===r.MethodSignature}function d(e){return(Ot[e.kind]||y)(e)}function Ze(e){return e.getText()}function et(e,t){let n=e;if(e.kind===r.ModuleDeclaration)return!1;do{if(n.$$internal)return!0;if(n.$$internal===!1)continue;let i=l.getLeadingCommentRanges(t,n.pos);if(i){for(let a of i)if(t.substring(a.pos,a.end).indexOf("@internal")!==-1)return n.$$internal=!0}}while(n=n.parent);return e.$$internal=!1}function tt(e,t){let n=l.ModifierFlags,i=e.getSourceFile()?.isDeclarationFile,a=0;return(t&n.Export||i||e.kind===r.NamespaceExport)&&(a|=p.Export),t&n.Ambient&&(a|=p.Ambient),t&n.Public&&(a|=p.Public),t&n.Private&&(a|=p.Private),t&n.Protected&&(a|=p.Protected),t&n.Static&&(a|=p.Static),t&n.Readonly&&(a|=p.Readonly),t&n.Abstract&&(a|=p.Abstract),t&n.Async&&(a|=p.Async),t&n.Default&&(a|=p.Default),t&n.Deprecated&&(a|=p.Deprecated),Xe(e)&&(l.isPrivateIdentifier(e.name)?a|=p.Private:a&(p.Private|p.Protected)||(a|=p.Public)),a}function nt(e){let t=0;e.questionToken&&(t|=p.Optional);let n=l.isSourceFile(e)?e:e.getSourceFile();return n&&(et(e,n.getFullText())&&(t|=p.Internal),g.isSourceFileDefaultLibrary(n)&&(t|=p.DefaultLibrary),g.isSourceFileFromExternalLibrary(n)&&(t|=p.External)),t}function V(e){if(e.$$resolvedType)return;let t=u.getWidenedType(e);if(t===e)try{let n=u.typeToTypeNode(t,void 0,l.NodeBuilderFlags.NoTypeReduction|l.NodeBuilderFlags.InTypeAlias|l.NodeBuilderFlags.NoTruncation);return n&&(n.$$resolvedType=!0),n?d(n):void 0}catch(n){console.error(n);return}else t.$$resolvedType=!0;return T(t)}var rt=/<!--(.*?)-->/g;function _(e){return e.replace(rt,"")}function X(e){if(e)return typeof e=="string"?_(e):e.map(t=>t.kind===r.JSDocLink?{tag:"link",value:`${t.name?.getText()||""}${t.text}`}:{value:_(t.text)})}var it=/^\s*\*\s/gm;function at(e){return e.getText().replace(it,"")}function ot(e,t){let n=`
3
- ${at(t)}`;if(e.length>0){let i=e[e.length-1].value||"";typeof i=="string"?e[e.length-1].value=i+n:i.push({value:n})}else e.push({value:n})}function lt(e,t){let n=e.jsDoc,i=[],a={content:i};return n?.forEach(s=>{let c=X(s.comment);c&&i.push({value:c})}),l.getJSDocTags(e).forEach(s=>{let c=s.tagName.escapedText==="description"?void 0:s.tagName.escapedText,b=s.name?.getText(),w=s.comment?X(s.comment):b;if(h.cxlExtensions&&c==="tagName"){a.tagName=String(w);return}if(s.comment&&c&&!h?.customJsDocTags?.includes(c)&&c!==c.toLowerCase()&&i.length>0){ot(i,s);return}c==="deprecated"&&(t.flags|=p.Deprecated),c==="see"&&s.comment==="*"&&(w=b),c==="beta"&&(a.beta=!0),c==="alpha"&&(a.alpha=!0),h.cxlExtensions&&(c==="attribute"?t.kind=o.Attribute:c==="event"&&(t.kind=o.Event)),w&&!(c==="param"&&e.kind!==r.Parameter)&&i.push({tag:c==="desc"||c==="description"?void 0:c,value:w})}),i.length?a:void 0}function D(e){let t=y(e);t.id===void 0&&(t.id=K(e,t)),t.flags|=tt(e,l.getCombinedModifierFlags(e));let n=t.id,i=e.typeParameters;return i&&(t.typeParameters=i.map(d)),l.isEnumMember(e)?t.value=JSON.stringify(u.getConstantValue(e)):e.initializer&&(t.value=Ze(e.initializer)),n&&(he[n]=t),t}function st(e){let t=D(e);return e.default&&e.getSourceFile()&&(t.value=e.default.getText()),e.constraint&&(t.children=[d(e.constraint)]),t}function ct(e){return{name:e.name,kind:o.Unknown,flags:0}}function pt(e){let t=e.valueDeclaration;if(!t)return ct(e);let n=m(t);return n.name||(n.name=t.name.getText()),n.flags&(p.Private|p.Public|p.Protected)&&(n.kind=o.Property),t.dotDotDotToken&&(n.flags=n.flags|p.Rest),t.questionToken&&(n.flags=n.flags|p.Optional),n}function N(e,t){let n=e.declarations?.[0]||e.valueDeclaration,i=e.flags&l.SymbolFlags.Namespace||n?.kind===r.EnumMember?Se(e):e.getName();return n?{name:i,flags:0,kind:o.Reference,type:J(e,n),typeParameters:t&&t.length?t.map(T):void 0}:{name:i,flags:0,kind:o.Reference,typeParameters:t&&t.length?t.map(T):void 0}}function ut(e){return e.flags&f.Enum||e.flags&f.EnumLiteral||e.flags&f.UniqueESSymbol||e.isClassOrInterface()||e.isTypeParameter()||e.objectFlags&l.ObjectFlags.Reference}function dt(e){return{name:"",kind:o.IndexedType,flags:0,children:[T(e.objectType),T(e.indexType)]}}function R(e){return e&&(e.declarations?.[0]||e.valueDeclaration)}function be(e){let t=R(e),n=t?d(t):{name:e.name,kind:o.Unknown,flags:0};return n.kind!==o.Namespace&&(n.name=e.name),n}function ft(e){return{name:u.typeToString(e),kind:o.Keyof,type:T(e.type),resolvedType:V(e),flags:0}}function yt(e,t){return{name:u.typeToString(e),kind:o.Literal,type:t!==e?T(t):void 0,flags:0}}function Z(e){let t=u.typeToTypeNode(e,void 0,l.NodeBuilderFlags.InObjectTypeLiteral|l.NodeBuilderFlags.NoTruncation);return t?d(t):{name:u.typeToString(e),kind:o.ObjectType,flags:0}}function mt(e){return u.isArrayType(e)}function T(e){if(e.aliasSymbol)return N(e.aliasSymbol,e.aliasTypeArguments);if(e.flags&f.Any)return me;if(e.flags&f.Unknown)return We;if(e.flags&f.Void)return ye;if(e.flags&f.Boolean)return ue;if(e.flags&f.BigInt)return qe;if(e.flags&f.Null)return fe;if(e.flags&f.Number)return ce;if(e.flags&f.String)return pe;if(e.flags&f.Undefined)return de;if(e.flags&f.Never)return ge;if(e.flags&f.Index)return ft(e);if(e.flags&f.IndexedAccess)return dt(e);if(mt(e))return Z(e);if(e.symbol?.flags&l.SymbolFlags.Namespace){let t=N(e.symbol);return t.kind=o.ImportType,t}if(ut(e)&&e.symbol)return N(e.symbol,u.getTypeArguments(e));if(e.flags&f.Literal||e.flags&f.TemplateLiteral){let t=u.getBaseTypeOfLiteralType(e);return e.isStringLiteral()||e.isNumberLiteral()||e.isLiteral()||e.flags&f.TemplateLiteral?yt(e,t):T(t)}return e.isUnionOrIntersection()?{name:"",flags:0,kind:e.isUnion()?o.TypeUnion:o.TypeIntersection,children:e.types.map(T)}:e.flags&f.Object?Z(e):e.symbol?be(e.symbol):{name:u.typeToString(e),kind:o.Unknown,flags:0}}function S(e){let t=D(e),n=u.getSignatureFromDeclaration(e);e.kind===r.ArrowFunction||e.kind===r.FunctionExpression?t.kind=o.Function:e.kind===r.MethodSignature&&(t.kind=o.Method),e.type&&(t.type=d(e.type)),e.typeParameters&&(t.typeParameters=e.typeParameters.map(d)),t.parameters=n?n.getParameters().map(pt):e.parameters.map(d);let i=u.getTypeAtLocation(e);if(u.getSignaturesOfType(i,l.SignatureKind.Call)?.length>1&&!u.isImplementationOfOverload(e)&&(t.flags=t.flags|p.Overload),n&&!t.type){let a=n.getReturnType();t.type=a&&T(a)}return t}function gt(e){let t=y(e,{name:"Array"});return t.type=d(e.elementType),t}function xe(e,t){if(!l.canHaveDecorators(e))return;let n=l.getDecorators(e);return n&&n.find(i=>l.isCallExpression(i.expression)&&l.isIdentifier(i.expression.expression)&&i.expression.expression.escapedText.endsWith(t))}function ht(e,t){let n=xe(e,"Attribute");if(n){let i=n.expression.expression.escapedText;t.kind=i==="EventAttribute"?o.Event:o.Attribute}}function Tt(e){let t=e.arguments[0];return l.isStringLiteral(t)?t.text:""}function bt(e){let t=u.getTypeAtLocation(e);for(;t;){let n=t.symbol.valueDeclaration;if(!n||!l.isClassDeclaration(n))return!1;let i=n.heritageClauses?.find(s=>s.token===l.SyntaxKind.ExtendsKeyword)?.types?.[0]?.expression,a=i&&u.getTypeAtLocation(i);if(!a||t===a)break;if(a.symbol?.name==="Component")return!0;t=a}}function xt(e,t,n){let i=xe(e,"Augment"),a=i?.expression?.arguments,s=n.docs||{};if(i||t&&bt(e))n.kind=o.Component;else return!1;if(n.children){let c=n.children.find(b=>b.name==="tagName"&&b.kind===o.Property&&b.flags&p.Static);c&&c.value&&(s.tagName=c.value.slice(1,-1))}return a&&a.forEach((c,b)=>{b===0&&l.isStringLiteral(c)?s.tagName=c.text:l.isCallExpression(c)&&l.isIdentifier(c.expression)&&c.expression.escapedText==="role"&&(s.role=Tt(c))}),(s.tagName||s.role)&&(n.docs=s),!!i}function m(e){let t=D(e);if(l.isVariableDeclaration(e)&&(l.isArrayBindingPattern(e.name)||l.isObjectBindingPattern(e.name))&&(t.children=e.name.elements.map(d)),h.cxlExtensions&&ht(e,t),!t.type){let n=e.type;if(n)t.type=d(n);else if(l.isFunctionDeclaration(e)||l.isMethodDeclaration(e)){let i=u.getSignatureFromDeclaration(e);i&&(t.type=T(i.getReturnType()))}else try{let i=u.getTypeAtLocation(e);i&&(t.type=T(i))}catch(i){console.error(i)}}if(l.isTypeAliasDeclaration(e)){let n=u.getTypeAtLocation(e);t.resolvedType=V(n)}return t}function F(e,t){e.children||=[];for(let n of t)n.parent||(Object.defineProperty(n,"parent",{value:e,enumerable:!1}),e.children.push(n))}function ee(e){let t=y(e);if(!t.children){let n=l.isObjectLiteralExpression(e)?e.properties.map(d):e.members.map(d);F(t,n)}return t}function St(e){let t=R(e),n=t&&ke(t);return n?E[n]:void 0}function H(e){if(e.$$fqn)return e.$$fqn;let t=e.getDeclarations()?.[0]?.getSourceFile()?.path;return t?e.$$fqn=`${t}.${e.getName()}`:e.$$fqn=u.getFullyQualifiedName(e)}function vt(e){if(!e)return;if(h.followReferences){let n=St(e);if(n){let i=n.children?.find(a=>a.name===e.name);if(i)return i}}let t=e&&I[H(e)];return t?.source?t:void 0}function j(e){let t=u.getSymbolAtLocation(e)||e.name&&u.getSymbolAtLocation(e.name),n;if(e.kind===r.InterfaceDeclaration&&t&&!(t.flags&l.SymbolFlags.Class)){if(n=t[k],!n&&t.declarations){let i=t.declarations.find(a=>a[k]);i&&(n=D(i))}n??=vt(t),n&&!(n.flags&p.Export)&&l.getCombinedModifierFlags(e)&l.ModifierFlags.Export&&(n.flags|=p.Export),t&&(t[k]??=n)}if(n??=D(e),e.members&&(!n.children||e.kind===r.InterfaceDeclaration)&&F(n,e.members.map(d)),n.children){for(let i of n.children)if(i.kind===o.Constructor&&i.parameters)for(let a of i.parameters)a.kind===o.Property&&F(n,[a])}if(t&&l.isInterfaceDeclaration(e)&&t.flags&l.SymbolFlags.Class){let i=t.declarations?.[0]||t.valueDeclaration;if(n.flags|=p.DeclarationMerge,n.children&&i){let a=J(t,i);a&&F(a,n.children.map(s=>({...s})))}}if(l.isClassDeclaration(e)&&h.cxlExtensions&&xt(e,t,n),e.heritageClauses?.length){let i=n.type={flags:0,kind:o.ClassType,name:"",type:n};if(e.heritageClauses.forEach(a=>F(i,a.types.map(d))),i.children)for(let a of i.children)a.kind===o.Reference&&a.type&&(a.type.extendedBy||(a.type.extendedBy=[])).push({name:n.name,type:n,kind:o.Reference,flags:0})}return n}function kt(e,t){let n=l.ObjectFlags,i=e.objectFlags&n.Interface?r.InterfaceDeclaration:void 0;return i?t.declarations?.find(a=>a.kind===i):t.declarations?.[0]||t.valueDeclaration}function te(e){let t=u.getTypeFromTypeNode(e),n=t.aliasSymbol||t.symbol;!n&&l.isTypeReferenceNode(e)&&(n=u.getSymbolAtLocation(e.typeName)),n&&n.flags&l.SymbolFlags.Alias&&(n=u.getAliasedSymbol(n)??n);let i=n&&kt(t,n),a=i&&n?J(n,i):e.flags&l.NodeFlags.Synthesized?void 0:T(t),s=G(l.isTypeReferenceNode(e)?e.typeName:e.expression);return a&&!a.name&&(a.name=s),y(e,{name:s,kind:o.Reference,type:a,typeParameters:e.typeArguments?.map(d)})}function Dt(e){return y(e,{children:[d(e.checkType),d(e.extendsType),d(e.trueType),d(e.falseType)]})}function ne(e){let t=S(e);return t.name="constructor",t}function wt(e){return y(e,{children:[d(e.objectType),d(e.indexType)]})}function Et(e){return y(e,{id:K(e),name:"__index",parameters:e.parameters.map(d),type:e.type&&d(e.type)})}function Ft(e){let t=y(e,{kind:le[e.operator],type:d(e.type)}),n=e.flags&l.NodeFlags.Synthesized?void 0:u.getTypeFromTypeNode(e);if(n){let i=n&&T(n);i&&i.kind!==t.kind&&(t.resolvedType=i)}return t}function Ct(e){let t=y(e);return t.name=G(e.exprName),t}function Pt(e){return y(e,{children:e.elements.map(d)})}function At(e){let t=d(e.type);return t.flags|=p.Rest,t}function Nt(e){let t=y(e);if(e.typeParameter){let n=d(e.typeParameter);t.children=[n],n.children?.[0]&&(t.children.push(n.children?.[0]),n.children=void 0)}return e.type&&(t.type=d(e.type)),t}function Lt(e){let t=u.getExportSpecifierLocalTargetSymbol(e);if(t){let n=be(t);return n.name=e.name.text,n.flags|=p.Export,n.kind===o.Unknown&&(n.kind=o.Export),n}return m(e)}function W(e){let t=h.rootDir??C?.options.rootDir??"";return ae(t,e)}function Se(e){let t=e,n=[e.valueDeclaration?.kind===r.SourceFile&&e.name.startsWith('"')?`"${W(e.name.slice(1,-1))}"`:e.name];for(;t=t.parent;)t.valueDeclaration?.kind!==r.SourceFile&&n.unshift(t.name);return n.join(".")}function It(e,t){let n=t?Se(t):void 0;if(t){if(t.$$moduleResult)return t.$$moduleResult;if(n&&h.followReferences){let a=De(t,e.getSourceFile())||E[n];if(a)return t.$$moduleResult=a}}let i=D(e);return t&&(t.$$moduleResult=i),n&&(h.forceExports?.includes(n)&&(i.flags|=p.Export),i.name=n,E[n]=i),i}function Rt(e,t){if(!e||P.includes(t))return!1;if(h.exportsOnly){let n=e;do{if(n.valueDeclaration?.kind===r.SourceFile)break;let i=n.$$moduleResult;if(!i||!(i.flags&p.Export))return!1}while(n=n.parent)}return!0}function ve(e){let t=u.getSymbolAtLocation(e)||e.name&&u.getSymbolAtLocation(e.name),n=It(e,t);return e.body?.forEachChild(i=>we(i,n)),t&&n.flags&p.Export&&Ee(t),Rt(t,n)&&P.push(n),n}function $t(e){let t=u.getSymbolAtLocation(e);if(t){let n=N(t);return n.kind=o.ImportType,n}return y(e,{})}function jt(e){let t=y(e);return t.children=[d(e.expression)],t}var Ot={[r.AnyKeyword]:()=>me,[r.StringKeyword]:()=>pe,[r.NumberKeyword]:()=>ce,[r.BooleanKeyword]:()=>ue,[r.VoidKeyword]:()=>ye,[r.NeverKeyword]:()=>ge,[r.NullKeyword]:()=>fe,[r.FunctionType]:S,[r.CallSignature]:S,[r.ConstructSignature]:S,[r.UndefinedKeyword]:()=>de,[r.ArrayType]:gt,[r.FunctionDeclaration]:S,[r.ArrowFunction]:S,[r.FunctionExpression]:S,[r.TypeReference]:te,[r.ExpressionWithTypeArguments]:te,[r.ConditionalType]:Dt,[r.ParenthesizedType]:m,[r.InferType](e){return y(e,{type:d(e.typeParameter)})},[r.TypeQuery]:Ct,[r.IndexedAccessType]:wt,[r.IntersectionType](e){return y(e,{kind:o.TypeIntersection,children:e.types.map(d)})},[r.UnionType](e){let t=e.$$resolvedType?void 0:u.getTypeAtLocation(e);return y(e,{kind:o.TypeUnion,children:e.types.map(d),resolvedType:t&&V(t)})},[r.TupleType]:Pt,[r.EnumDeclaration]:j,[r.EnumMember]:m,[r.RestType]:At,[r.PropertySignature]:m,[r.Constructor]:ne,[r.Parameter]:m,[r.PropertyDeclaration]:m,[r.MethodDeclaration]:S,[r.MethodSignature]:S,[r.ClassDeclaration]:j,[r.TypeAliasDeclaration]:m,[r.TypeParameter]:st,[r.InterfaceDeclaration]:j,[r.VariableDeclaration]:m,[r.BindingElement]:m,[r.ConstructorType]:ne,[r.GetAccessor]:S,[r.SetAccessor]:S,[r.TypeOperator]:Ft,[r.TypeLiteral]:ee,[r.TemplateLiteralType]:D,[r.ObjectLiteralExpression]:ee,[r.PropertyAssignment]:m,[r.ShorthandPropertyAssignment]:m,[r.IndexSignature]:Et,[r.MappedType]:Nt,[r.SpreadAssignment]:jt,[r.ModuleDeclaration]:ve,[r.NamespaceExport]:m,[r.NamespaceImport]:m,[r.ExportSpecifier]:Lt,[r.ImportType]:$t,[r.SymbolKeyword]:D};function Mt({options:e,errors:t,fileNames:n,projectReferences:i},a,s){e.noEmit=!0,s||(s=l.createCompilerHost(e)),g=l.createProgram({configFileParsingDiagnostics:t,rootNames:n,projectReferences:i,options:e,host:s}),u=g.getTypeChecker()}function ke(e){let t=e.kind===r.SourceFile?e:e.getSourceFile();return t.isDeclarationFile?t.originalFileName:void 0}function Bt(e){let t=g.getResolvedProjectReferences();if(t)return t.find(n=>n?.commandLine.fileNames.includes(e))}function De(e,t){let n=R(e);if(n&&l.isSourceFile(n)&&!M.includes(n))if(n.isDeclarationFile){if(h.followReferences){let i=ke(n),a=i&&Bt(i);if(a){Ce(a.commandLine);let s=W(i);return P.find(c=>c.name===s)}}if(t.isDeclarationFile)return L(n)}else return L(n)}function we(e,t){function n(i){let a=d(i);(!h.exportsOnly||a.flags&p.Export)&&F(t,[a])}if(l.isVariableStatement(e))e.declarationList.declarations.map(n);else if(l.isExportDeclaration(e)){if(e.exportClause)l.isNamedExports(e.exportClause)?e.exportClause.elements.forEach(n):n(e.exportClause);else if(e.moduleSpecifier){let i=u.getSymbolAtLocation(e.moduleSpecifier);i&&De(i,e.getSourceFile())}}else switch(e.kind){case r.InterfaceDeclaration:case r.TypeAliasDeclaration:case r.FunctionDeclaration:case r.EnumDeclaration:case r.VariableDeclaration:case r.ClassDeclaration:n(e);break;case r.ModuleDeclaration:ve(e)}}function Ee(e){e.exports?.forEach(t=>{let n=R(t);n?.[k]?.source&&!(n[k].flags&p.Internal)&&(I[H(t)]=n[k])})}function L(e){if(E[e.fileName])return E[e.fileName];let t=y(e);if(E[e.fileName]=t,t.flags&p.Internal)return t;e.forEachChild(i=>we(i,t));let n=u.getSymbolAtLocation(e);return n&&Ee(n),e.isDeclarationFile&&e.referencedFiles.forEach(i=>{let a=i.fileName;if(C?.fileNames.includes(a))return;let s=g.getSourceFile(a);s&&!g.isSourceFileDefaultLibrary(s)&&!g.isSourceFileFromExternalLibrary(s)&&L(s)}),t.children?.length&&P.push(t),t}function Fe(e){Mt(e),M=e.fileNames.flatMap(t=>g.getSourceFile(t)||[]),M.forEach(L)}function Ce(e){let t=e.options.configFilePath;if(!B.includes(t)){let n=g,i=u;B.push(t),Fe(e),g=n,u=i}}function Pe(e,t){h=t,E={},I={},B=[];let n={modules:P||=[],index:he||={},config:e,env:{typescript:l.version}};return e.projectReferences?.forEach(i=>{i.prepend&&Ce(Te(l.resolveProjectReferencePath(i)))}),Fe(e),n}function Ut(e,t,n){return C=l.parseJsonConfigFileContent(e,U,t),Pe(C,{...se,...n})}function Kt(e=Ge("tsconfig.json"),t){let n={...se,...t};return C=Te(e,n),Pe(C,n)}var en={repository:{type:"string",help:"URL of the source code repository (e.g., GitHub repository URL)"},clean:{help:"Removes all existing files from the output directory before generating documentation."},outputDir:{short:"o",type:"string",help:"Specifies the output directory where the generated documentation will be saved."},scripts:{type:"string",many:!0,help:"List of additional scripts (paths) to include in the generated documentation HTML."},demoScripts:{type:"string",many:!0,help:"List of scripts (paths) to include in the generated documentation demo output."},demoStyles:{type:"string",help:"CSS styles to include in the generated demo output."},packageJson:{help:'Path to the package.json file. Defaults to "./package.json" if not specified.',type:"string"},packageName:{help:"Sets the title of the generated documentation. Defaults to the name property in package.json.",type:"string"},summary:{help:'Enables generation of a "summary.json" file.',type:"boolean"},sitemap:{help:"Generates a sitemap for the documentation using the provided value as the base URL.",type:"string"},file:{help:"Allows parsing of a single file instead of an entire project.",type:"string",many:!0},tsconfig:{help:'Path to the tsconfig.json file used for TypeScript compilation. Defaults to "./tsconfig.json" if not specified.',type:"string"},markdown:{help:"Enables rendering of markdown syntax within symbol descriptions.",type:"boolean"},typeRoots:{help:"Specify additional type root directories (paths) for TypeScript projects (can be used multiple times).",type:"string",many:!0},docsJson:{help:'Path to a custom "docs.json" file for configuring documentation generation.',type:"string"},baseHref:{help:"Sets the base URL for markdown links within the generated documentation.",type:"string"},exclude:{help:"List of modules (paths) to exclude from documentation generation (can be used multiple times).",type:"string",many:!0},rootDir:{help:"Overrides the default root directory used for resolving TypeScript project file names.",type:"string"},customJsDocTags:{help:"Allows declaration of custom jsdoc tags for documentation (can be used multiple times).",type:"string",many:!0},cxlExtensions:{help:"Enables support for Coaxial UI extensions within the generated documentation.",type:"boolean"},exports:{help:"Treats specific symbols (paths) as exported even if not explicitly marked.",type:"string",many:!0},followReferences:{help:"Includes documentation from symbols referenced in project references.",type:"boolean"},headHtml:{help:"Path to a file containing custom HTML to be added to the `<head>` element of the generated page.",type:"string"},noHtml:{help:"Do not generate HTML",type:"boolean"},debug:{help:"Enables debug mode to print detailed output during documentation generation.",type:"boolean"}},Gt=/[&<"]/g,Jt={"&":"&amp;","<":"&lt;",'"':"&quot;"};function tn(e){return e.replace(Gt,t=>Jt[t])}function nn(e){if(e.startsWith("<caption>")){let t=e.indexOf(`
4
- `);return{title:e.slice(0,t).trim().replace("</caption>",""),value:e=e.slice(t).trim()}}return{title:"",value:e}}async function rn(e,t){let n={outputDir:"./docs",clean:!1,debug:!1,spa:!1,tsconfig:"tsconfig.json",packageJson:"package.json",packageRoot:"",summary:!1,...e};(n.docsJson||Ae("3doc.json"))&&Object.assign(n,await Q(n.docsJson||"3doc.json"));function i(x){return Ke(`rm -f ${x}/*.html ${x}/*.json ${x}/*.js`)}let a=n.outputDir,s=await Q(n.packageJson);if(n.packageRoot??=q(Le(n.packageJson)),await O(a),await O(a+"/"+s.version),n.clean&&(await i(a),await i(Ne(a,s.version))),n.repository===void 0&&s?.repository){let x=s.repository;n.repository=typeof x=="string"?x:x.url}let c={rootDir:n.rootDir,exportsOnly:!0,customJsDocTags:n.customJsDocTags,cxlExtensions:n.cxlExtensions||!1,forceExports:n.exports,followReferences:n.followReferences},b=n.file?.length?Ut({compilerOptions:{allowJs:!0,rootDir:q(n.file[0]),sourceMap:!1,typeRoots:n.typeRoots||[],noEmit:!0,lib:["es2021"]},files:n.file},process.cwd(),c):Kt(n.tsconfig,c),w={...n,modulePackage:s,repositoryLink:n.repository};if(n.summary){let x=await import("./render-summary-LMSHEX67-C5I3XNGJ.js");await Promise.all(x.render(w,b).map($=>t($,a)))}if(!n.noHtml){let x=await import("./render-html-3KIHSJJY-VNYRPRM7.js");await Promise.all(x.render(w,b).map($=>t($,a)))}}export{o as a,p as b,en as c,tn as d,nn as e,rn as f};
package/hljs.css DELETED
@@ -1,104 +0,0 @@
1
- .hljs {
2
- display: block;
3
- overflow-x: auto;
4
- padding: 0.5em;
5
- color: #fff;
6
- background-color: #102027;
7
- }
8
-
9
- .hljs-keyword {
10
- color: rgba(255, 110, 64, 1);
11
- }
12
- .hljs-operator {
13
- color: rgba(255, 204, 188, 1);
14
- }
15
- .hljs-pattern-match {
16
- color: rgba(255, 110, 64, 1);
17
- }
18
- .hljs-pattern-match .hljs-constructor {
19
- color: rgba(255, 110, 64, 1);
20
- }
21
- .hljs-function {
22
- color: rgba(176, 190, 197, 1);
23
- }
24
- .hljs-function .hljs-params {
25
- color: rgba(236, 239, 241, 1);
26
- }
27
- .hljs-function .hljs-params .hljs-typing {
28
- color: rgba(222, 193, 106);
29
- }
30
- .hljs-module-access .hljs-module {
31
- color: rgba(176, 190, 197, 1);
32
- }
33
- .hljs-constructor {
34
- color: rgba(176, 190, 197, 1);
35
- }
36
- .hljs-constructor .hljs-string {
37
- color: rgba(255, 158, 128, 1);
38
- }
39
- .hljs-comment,
40
- .hljs-quote {
41
- color: rgba(207, 216, 220, 1);
42
- font-style: italic;
43
- }
44
- .hljs-doctag,
45
- .hljs-formula {
46
- color: rgba(222, 193, 106);
47
- }
48
- .hljs-tag {
49
- color: rgba(255, 204, 188, 1);
50
- }
51
- .hljs-tag .hljs-name {
52
- color: rgba(222, 193, 106);
53
- }
54
- .hljs-section,
55
- .hljs-name,
56
- .hljs-selector-tag,
57
- .hljs-deletion,
58
- .hljs-subst {
59
- color: rgba(236, 239, 241, 1);
60
- }
61
- .hljs-literal {
62
- color: rgba(255, 110, 64, 1);
63
- }
64
- .hljs-string,
65
- .hljs-regexp,
66
- .hljs-addition,
67
- .hljs-attribute,
68
- .hljs-meta-string {
69
- color: rgba(255, 158, 128, 1);
70
- }
71
- .hljs-built_in,
72
- .hljs-class .hljs-title {
73
- color: rgba(255, 110, 64, 1);
74
- }
75
- .hljs-attr {
76
- color: rgba(176, 190, 197, 1);
77
- }
78
-
79
- .hljs-variable,
80
- .hljs-template-variable,
81
- .hljs-type,
82
- .hljs-selector-class,
83
- .hljs-selector-attr,
84
- .hljs-selector-pseudo,
85
- .hljs-number {
86
- color: rgba(236, 239, 241, 1);
87
- }
88
- .hljs-symbol,
89
- .hljs-bullet,
90
- .hljs-link,
91
- .hljs-meta,
92
- .hljs-selector-id,
93
- .hljs-title {
94
- color: #ffb300;
95
- }
96
- .hljs-emphasis {
97
- font-style: italic;
98
- }
99
- .hljs-strong {
100
- font-weight: bold;
101
- }
102
- .hljs-link {
103
- text-decoration: underline;
104
- }
package/index.bundle.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e,b as o,c as r,d as t,e as a,f as m,g as p,h as l,i as s,j as n,k as b,l as f,m as c}from"./chunk-KPQXDQIW.js";import"./chunk-SWJCWBGM.js";import"./chunk-FSRPMVAS.js";import{existsSync as d}from"fs";if(import.meta.main)if(d("./project.json")){let{buildRoot:i}=await import("./root-G5JDVI4D.js");await i()}else{let{buildLibrary:i}=await import("./library-PNA444FE.js");await i()}export{l as basename,t as build,c as buildLibrary,s as concatFile,b as copyDir,e as esbuild,a as exec,p as file,n as files,r as pkg,o as readme,m as shell,f as zip};
@@ -1 +0,0 @@
1
- import{m as a}from"./chunk-KPQXDQIW.js";import"./chunk-SWJCWBGM.js";import"./chunk-FSRPMVAS.js";export{a as buildLibrary};
package/png-BPHNXF4V.js DELETED
@@ -1 +0,0 @@
1
- import{a as w,b as m}from"./chunk-FSRPMVAS.js";var x=m(($t,$)=>{"use strict";var Ve=w("util"),Q=w("stream"),I=$.exports=function(){Q.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};Ve.inherits(I,Q);I.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};I.prototype.write=function(e,t){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let i;return Buffer.isBuffer(e)?i=e:i=Buffer.from(e,t||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};I.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};I.prototype.destroySoon=I.prototype.end;I.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};I.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};I.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))};I.prototype._processRead=function(e){this._reads.shift();let t=0,i=0,r=Buffer.alloc(e.length);for(;t<e.length;){let l=this._buffers[i++],n=Math.min(l.length,e.length-t);l.copy(r,t,0,n),t+=n,n!==l.length&&(this._buffers[--i]=l.slice(n))}i>0&&this._buffers.splice(0,i),this._buffered-=e.length,e.func.call(this,r)};I.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else if(this._buffered>=e.length)this._processRead(e);else break}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}});var N=m(q=>{"use strict";var A=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];q.getImagePasses=function(e,t){let i=[],r=e%8,l=t%8,n=(e-r)/8,s=(t-l)/8;for(let h=0;h<A.length;h++){let f=A[h],o=n*f.x.length,a=s*f.y.length;for(let u=0;u<f.x.length&&f.x[u]<r;u++)o++;for(let u=0;u<f.y.length&&f.y[u]<l;u++)a++;o>0&&a>0&&i.push({width:o,height:a,index:h})}return i};q.getInterlaceIterator=function(e){return function(t,i,r){let l=t%A[r].x.length,n=(t-l)/A[r].x.length*8+A[r].x[l],s=i%A[r].y.length,h=(i-s)/A[r].y.length*8+A[r].y[s];return n*4+h*e*4}}});var U=m((ei,X)=>{"use strict";X.exports=function(t,i,r){let l=t+i-r,n=Math.abs(l-t),s=Math.abs(l-i),h=Math.abs(l-r);return n<=s&&n<=h?t:s<=h?i:r}});var H=m((ti,te)=>{"use strict";var We=N(),Ke=U();function ee(e,t,i){let r=e*t;return i!==8&&(r=Math.ceil(r/(8/i))),r}var P=te.exports=function(e,t){let i=e.width,r=e.height,l=e.interlace,n=e.bpp,s=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],l){let h=We.getImagePasses(i,r);for(let f=0;f<h.length;f++)this._images.push({byteWidth:ee(h[f].width,n,s),height:h[f].height,lineIndex:0})}else this._images.push({byteWidth:ee(i,n,s),height:r,lineIndex:0});s===8?this._xComparison=n:s===16?this._xComparison=n*2:this._xComparison=1};P.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};P.prototype._unFilterType1=function(e,t,i){let r=this._xComparison,l=r-1;for(let n=0;n<i;n++){let s=e[1+n],h=n>l?t[n-r]:0;t[n]=s+h}};P.prototype._unFilterType2=function(e,t,i){let r=this._lastLine;for(let l=0;l<i;l++){let n=e[1+l],s=r?r[l]:0;t[l]=n+s}};P.prototype._unFilterType3=function(e,t,i){let r=this._xComparison,l=r-1,n=this._lastLine;for(let s=0;s<i;s++){let h=e[1+s],f=n?n[s]:0,o=s>l?t[s-r]:0,a=Math.floor((o+f)/2);t[s]=h+a}};P.prototype._unFilterType4=function(e,t,i){let r=this._xComparison,l=r-1,n=this._lastLine;for(let s=0;s<i;s++){let h=e[1+s],f=n?n[s]:0,o=s>l?t[s-r]:0,a=s>l&&n?n[s-r]:0,u=Ke(o,f,a);t[s]=h+u}};P.prototype._reverseFilterLine=function(e){let t=e[0],i,r=this._images[this._imageIndex],l=r.byteWidth;if(t===0)i=e.slice(1,l+1);else switch(i=Buffer.alloc(l),t){case 1:this._unFilterType1(e,i,l);break;case 2:this._unFilterType2(e,i,l);break;case 3:this._unFilterType3(e,i,l);break;case 4:this._unFilterType4(e,i,l);break;default:throw new Error("Unrecognised filter type - "+t)}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var ne=m((ii,re)=>{"use strict";var Je=w("util"),ie=x(),Qe=H(),$e=re.exports=function(e){ie.call(this);let t=[],i=this;this._filter=new Qe(e,{read:this.read.bind(this),write:function(r){t.push(r)},complete:function(){i.emit("complete",Buffer.concat(t))}}),this._filter.start()};Je.inherits($e,ie)});var S=m((ri,le)=>{"use strict";le.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var G=m((ni,se)=>{"use strict";var D=[];(function(){for(let e=0;e<256;e++){let t=e;for(let i=0;i<8;i++)t&1?t=3988292384^t>>>1:t=t>>>1;D[e]=t}})();var v=se.exports=function(){this._crc=-1};v.prototype.write=function(e){for(let t=0;t<e.length;t++)this._crc=D[(this._crc^e[t])&255]^this._crc>>>8;return!0};v.prototype.crc32=function(){return this._crc^-1};v.crc32=function(e){let t=-1;for(let i=0;i<e.length;i++)t=D[(t^e[i])&255]^t>>>8;return t^-1}});var F=m((li,he)=>{"use strict";var b=S(),Xe=G(),E=he.exports=function(e,t){this._options=e,e.checkCRC=e.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[b.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[b.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[b.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[b.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[b.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[b.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};E.prototype.start=function(){this.read(b.PNG_SIGNATURE.length,this._parseSignature.bind(this))};E.prototype._parseSignature=function(e){let t=b.PNG_SIGNATURE;for(let i=0;i<t.length;i++)if(e[i]!==t[i]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};E.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0),i=e.readUInt32BE(4),r="";for(let n=4;n<8;n++)r+=String.fromCharCode(e[n]);let l=!!(e[4]&32);if(!this._hasIHDR&&i!==b.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new Xe,this._crc.write(Buffer.from(r)),this._chunks[i])return this._chunks[i](t);if(!l){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(t+4,this._skipChunk.bind(this))};E.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};E.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};E.prototype._parseChunkEnd=function(e){let t=e.readInt32BE(0),i=this._crc.crc32();if(this._options.checkCRC&&i!==t){this.error(new Error("Crc error - "+t+" - "+i));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};E.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))};E.prototype._parseIHDR=function(e){this._crc.write(e);let t=e.readUInt32BE(0),i=e.readUInt32BE(4),r=e[8],l=e[9],n=e[10],s=e[11],h=e[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(l in b.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(n!==0){this.error(new Error("Unsupported compression method"));return}if(s!==0){this.error(new Error("Unsupported filter method"));return}if(h!==0&&h!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=l;let f=b.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:i,depth:r,interlace:!!h,palette:!!(l&b.COLORTYPE_PALETTE),color:!!(l&b.COLORTYPE_COLOR),alpha:!!(l&b.COLORTYPE_ALPHA),bpp:f,colorType:l}),this._handleChunkEnd()};E.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))};E.prototype._parsePLTE=function(e){this._crc.write(e);let t=Math.floor(e.length/3);for(let i=0;i<t;i++)this._palette.push([e[i*3],e[i*3+1],e[i*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};E.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))};E.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===b.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(e.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===b.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===b.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()};E.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))};E.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/b.GAMMA_DIVISION),this._handleChunkEnd()};E.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))};E.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===b.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(t);let i=e-t.length;i>0?this._handleIDAT(i):this._handleChunkEnd()};E.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))};E.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var z=m(oe=>{"use strict";var fe=N(),et=[function(){},function(e,t,i,r){if(r===t.length)throw new Error("Ran out of data");let l=t[r];e[i]=l,e[i+1]=l,e[i+2]=l,e[i+3]=255},function(e,t,i,r){if(r+1>=t.length)throw new Error("Ran out of data");let l=t[r];e[i]=l,e[i+1]=l,e[i+2]=l,e[i+3]=t[r+1]},function(e,t,i,r){if(r+2>=t.length)throw new Error("Ran out of data");e[i]=t[r],e[i+1]=t[r+1],e[i+2]=t[r+2],e[i+3]=255},function(e,t,i,r){if(r+3>=t.length)throw new Error("Ran out of data");e[i]=t[r],e[i+1]=t[r+1],e[i+2]=t[r+2],e[i+3]=t[r+3]}],tt=[function(){},function(e,t,i,r){let l=t[0];e[i]=l,e[i+1]=l,e[i+2]=l,e[i+3]=r},function(e,t,i){let r=t[0];e[i]=r,e[i+1]=r,e[i+2]=r,e[i+3]=t[1]},function(e,t,i,r){e[i]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=r},function(e,t,i){e[i]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=t[3]}];function it(e,t){let i=[],r=0;function l(){if(r===e.length)throw new Error("Ran out of data");let n=e[r];r++;let s,h,f,o,a,u,c,p;switch(t){default:throw new Error("unrecognised depth");case 16:c=e[r],r++,i.push((n<<8)+c);break;case 4:c=n&15,p=n>>4,i.push(p,c);break;case 2:a=n&3,u=n>>2&3,c=n>>4&3,p=n>>6&3,i.push(p,c,u,a);break;case 1:s=n&1,h=n>>1&1,f=n>>2&1,o=n>>3&1,a=n>>4&1,u=n>>5&1,c=n>>6&1,p=n>>7&1,i.push(p,c,u,a,o,f,h,s);break}}return{get:function(n){for(;i.length<n;)l();let s=i.slice(0,n);return i=i.slice(n),s},resetAfterLine:function(){i.length=0},end:function(){if(r!==e.length)throw new Error("extra data found")}}}function rt(e,t,i,r,l,n){let s=e.width,h=e.height,f=e.index;for(let o=0;o<h;o++)for(let a=0;a<s;a++){let u=i(a,o,f);et[r](t,l,u,n),n+=r}return n}function nt(e,t,i,r,l,n){let s=e.width,h=e.height,f=e.index;for(let o=0;o<h;o++){for(let a=0;a<s;a++){let u=l.get(r),c=i(a,o,f);tt[r](t,u,c,n)}l.resetAfterLine()}}oe.dataToBitMap=function(e,t){let i=t.width,r=t.height,l=t.depth,n=t.bpp,s=t.interlace,h;l!==8&&(h=it(e,l));let f;l<=8?f=Buffer.alloc(i*r*4):f=new Uint16Array(i*r*4);let o=Math.pow(2,l)-1,a=0,u,c;if(s)u=fe.getImagePasses(i,r),c=fe.getInterlaceIterator(i,r);else{let p=0;c=function(){let d=p;return p+=4,d},u=[{width:i,height:r}]}for(let p=0;p<u.length;p++)l===8?a=rt(u[p],f,c,n,e,a):nt(u[p],f,c,n,h,o);if(l===8){if(a!==e.length)throw new Error("extra data found")}else h.end();return f}});var j=m((hi,ae)=>{"use strict";function lt(e,t,i,r,l){let n=0;for(let s=0;s<r;s++)for(let h=0;h<i;h++){let f=l[e[n]];if(!f)throw new Error("index "+e[n]+" not in palette");for(let o=0;o<4;o++)t[n+o]=f[o];n+=4}}function st(e,t,i,r,l){let n=0;for(let s=0;s<r;s++)for(let h=0;h<i;h++){let f=!1;if(l.length===1?l[0]===e[n]&&(f=!0):l[0]===e[n]&&l[1]===e[n+1]&&l[2]===e[n+2]&&(f=!0),f)for(let o=0;o<4;o++)t[n+o]=0;n+=4}}function ht(e,t,i,r,l){let n=255,s=Math.pow(2,l)-1,h=0;for(let f=0;f<r;f++)for(let o=0;o<i;o++){for(let a=0;a<4;a++)t[h+a]=Math.floor(e[h+a]*n/s+.5);h+=4}}ae.exports=function(e,t,i=!1){let r=t.depth,l=t.width,n=t.height,s=t.colorType,h=t.transColor,f=t.palette,o=e;return s===3?lt(e,o,l,n,f):(h&&st(e,o,l,n,h),r!==8&&!i&&(r===16&&(o=Buffer.alloc(l*n*4)),ht(e,o,l,n,r))),o}});var _e=m((fi,ce)=>{"use strict";var ft=w("util"),Z=w("zlib"),ue=x(),ot=ne(),at=F(),ut=z(),ct=j(),k=ce.exports=function(e){ue.call(this),this._parser=new at(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};ft.inherits(k,ue);k.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};k.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=Z.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let i=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(i,Z.Z_MIN_CHUNK);this._inflate=Z.createInflate({chunkSize:r});let l=i,n=this.emit.bind(this,"error");this._inflate.on("error",function(h){l&&n(h)}),this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(h){l&&(h.length>l&&(h=h.slice(0,l)),l-=h.length,s(h))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)};k.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new ot(this._bitmapInfo)};k.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e};k.prototype._handlePalette=function(e){this._bitmapInfo.palette=e};k.prototype._simpleTransparency=function(){this._metaData.alpha=!0};k.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};k.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};k.prototype._complete=function(e){if(this.errord)return;let t;try{let i=ut.dataToBitMap(e,this._bitmapInfo);t=ct(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",t)}});var de=m((oi,pe)=>{"use strict";var L=S();pe.exports=function(e,t,i,r){let l=[L.COLORTYPE_COLOR_ALPHA,L.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let d=(function(){let y=new ArrayBuffer(2);return new DataView(y).setInt16(0,256,!0),new Int16Array(y)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&d)return e}let n=r.bitDepth!==16?e:new Uint16Array(e.buffer),s=255,h=L.COLORTYPE_TO_BPP_MAP[r.inputColorType];h===4&&!r.inputHasAlpha&&(h=3);let f=L.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,f*=2);let o=Buffer.alloc(t*i*f),a=0,u=0,c=r.bgColor||{};c.red===void 0&&(c.red=s),c.green===void 0&&(c.green=s),c.blue===void 0&&(c.blue=s);function p(){let d,y,_,g=s;switch(r.inputColorType){case L.COLORTYPE_COLOR_ALPHA:g=n[a+3],d=n[a],y=n[a+1],_=n[a+2];break;case L.COLORTYPE_COLOR:d=n[a],y=n[a+1],_=n[a+2];break;case L.COLORTYPE_ALPHA:g=n[a+1],d=n[a],y=d,_=d;break;case L.COLORTYPE_GRAYSCALE:d=n[a],y=d,_=d;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(l||(g/=s,d=Math.min(Math.max(Math.round((1-g)*c.red+g*d),0),s),y=Math.min(Math.max(Math.round((1-g)*c.green+g*y),0),s),_=Math.min(Math.max(Math.round((1-g)*c.blue+g*_),0),s))),{red:d,green:y,blue:_,alpha:g}}for(let d=0;d<i;d++)for(let y=0;y<t;y++){let _=p(n,a);switch(r.colorType){case L.COLORTYPE_COLOR_ALPHA:case L.COLORTYPE_COLOR:r.bitDepth===8?(o[u]=_.red,o[u+1]=_.green,o[u+2]=_.blue,l&&(o[u+3]=_.alpha)):(o.writeUInt16BE(_.red,u),o.writeUInt16BE(_.green,u+2),o.writeUInt16BE(_.blue,u+4),l&&o.writeUInt16BE(_.alpha,u+6));break;case L.COLORTYPE_ALPHA:case L.COLORTYPE_GRAYSCALE:{let g=(_.red+_.green+_.blue)/3;r.bitDepth===8?(o[u]=g,l&&(o[u+1]=_.alpha)):(o.writeUInt16BE(g,u),l&&o.writeUInt16BE(_.alpha,u+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}a+=h,u+=f}return o}});var me=m((ai,ye)=>{"use strict";var ge=U();function _t(e,t,i,r,l){for(let n=0;n<i;n++)r[l+n]=e[t+n]}function pt(e,t,i){let r=0,l=t+i;for(let n=t;n<l;n++)r+=Math.abs(e[n]);return r}function dt(e,t,i,r,l,n){for(let s=0;s<i;s++){let h=s>=n?e[t+s-n]:0,f=e[t+s]-h;r[l+s]=f}}function gt(e,t,i,r){let l=0;for(let n=0;n<i;n++){let s=n>=r?e[t+n-r]:0,h=e[t+n]-s;l+=Math.abs(h)}return l}function yt(e,t,i,r,l){for(let n=0;n<i;n++){let s=t>0?e[t+n-i]:0,h=e[t+n]-s;r[l+n]=h}}function mt(e,t,i){let r=0,l=t+i;for(let n=t;n<l;n++){let s=t>0?e[n-i]:0,h=e[n]-s;r+=Math.abs(h)}return r}function bt(e,t,i,r,l,n){for(let s=0;s<i;s++){let h=s>=n?e[t+s-n]:0,f=t>0?e[t+s-i]:0,o=e[t+s]-(h+f>>1);r[l+s]=o}}function Et(e,t,i,r){let l=0;for(let n=0;n<i;n++){let s=n>=r?e[t+n-r]:0,h=t>0?e[t+n-i]:0,f=e[t+n]-(s+h>>1);l+=Math.abs(f)}return l}function wt(e,t,i,r,l,n){for(let s=0;s<i;s++){let h=s>=n?e[t+s-n]:0,f=t>0?e[t+s-i]:0,o=t>0&&s>=n?e[t+s-(i+n)]:0,a=e[t+s]-ge(h,f,o);r[l+s]=a}}function Tt(e,t,i,r){let l=0;for(let n=0;n<i;n++){let s=n>=r?e[t+n-r]:0,h=t>0?e[t+n-i]:0,f=t>0&&n>=r?e[t+n-(i+r)]:0,o=e[t+n]-ge(s,h,f);l+=Math.abs(o)}return l}var Ct={0:_t,1:dt,2:yt,3:bt,4:wt},Ot={0:pt,1:gt,2:mt,3:Et,4:Tt};ye.exports=function(e,t,i,r,l){let n;if(!("filterType"in r)||r.filterType===-1)n=[0,1,2,3,4];else if(typeof r.filterType=="number")n=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(l*=2);let s=t*l,h=0,f=0,o=Buffer.alloc((s+1)*i),a=n[0];for(let u=0;u<i;u++){if(n.length>1){let c=1/0;for(let p=0;p<n.length;p++){let d=Ot[n[p]](e,f,s,l);d<c&&(a=n[p],c=d)}}o[h]=a,h++,Ct[a](e,f,s,o,h,l),h+=s,f+=s}return o}});var V=m((ui,be)=>{"use strict";var T=S(),Lt=G(),It=de(),kt=me(),At=w("zlib"),R=be.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32*1024,e.deflateLevel=e.deflateLevel!=null?e.deflateLevel:9,e.deflateStrategy=e.deflateStrategy!=null?e.deflateStrategy:3,e.inputHasAlpha=e.inputHasAlpha!=null?e.inputHasAlpha:!0,e.deflateFactory=e.deflateFactory||At.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType=typeof e.colorType=="number"?e.colorType:T.COLORTYPE_COLOR_ALPHA,e.inputColorType=typeof e.inputColorType=="number"?e.inputColorType:T.COLORTYPE_COLOR_ALPHA,[T.COLORTYPE_GRAYSCALE,T.COLORTYPE_COLOR,T.COLORTYPE_COLOR_ALPHA,T.COLORTYPE_ALPHA].indexOf(e.colorType)===-1)throw new Error("option color type:"+e.colorType+" is not supported at present");if([T.COLORTYPE_GRAYSCALE,T.COLORTYPE_COLOR,T.COLORTYPE_COLOR_ALPHA,T.COLORTYPE_ALPHA].indexOf(e.inputColorType)===-1)throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(e.bitDepth!==8&&e.bitDepth!==16)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};R.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};R.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};R.prototype.filterData=function(e,t,i){let r=It(e,t,i,this._options),l=T.COLORTYPE_TO_BPP_MAP[this._options.colorType];return kt(r,t,i,this._options,l)};R.prototype._packChunk=function(e,t){let i=t?t.length:0,r=Buffer.alloc(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(e,4),t&&t.copy(r,8),r.writeInt32BE(Lt.crc32(r.slice(4,r.length-4)),r.length-4),r};R.prototype.packGAMA=function(e){let t=Buffer.alloc(4);return t.writeUInt32BE(Math.floor(e*T.GAMMA_DIVISION),0),this._packChunk(T.TYPE_gAMA,t)};R.prototype.packIHDR=function(e,t){let i=Buffer.alloc(13);return i.writeUInt32BE(e,0),i.writeUInt32BE(t,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(T.TYPE_IHDR,i)};R.prototype.packIDAT=function(e){return this._packChunk(T.TYPE_IDAT,e)};R.prototype.packIEND=function(){return this._packChunk(T.TYPE_IEND,null)}});var Ce=m((ci,Te)=>{"use strict";var Rt=w("util"),Ee=w("stream"),Bt=S(),Pt=V(),we=Te.exports=function(e){Ee.call(this);let t=e||{};this._packer=new Pt(t),this._deflate=this._packer.createDeflate(),this.readable=!0};Rt.inherits(we,Ee);we.prototype.pack=function(e,t,i,r){this.emit("data",Buffer.from(Bt.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,i)),r&&this.emit("data",this._packer.packGAMA(r));let l=this._packer.filterData(e,t,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(n){this.emit("data",this._packer.packIDAT(n))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(l)}});var Re=m((Y,Ae)=>{"use strict";var Oe=w("assert").ok,M=w("zlib"),St=w("util"),Le=w("buffer").kMaxLength;function B(e){if(!(this instanceof B))return new B(e);e&&e.chunkSize<M.Z_MIN_CHUNK&&(e.chunkSize=M.Z_MIN_CHUNK),M.Inflate.call(this,e),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&e.maxLength!=null&&(this._maxLength=e.maxLength)}function Mt(e){return new B(e)}function Ie(e,t){t&&process.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}B.prototype._processChunk=function(e,t,i){if(typeof i=="function")return M.Inflate._processChunk.call(this,e,t,i);let r=this,l=e&&e.length,n=this._chunkSize-this._offset,s=this._maxLength,h=0,f=[],o=0,a;this.on("error",function(d){a=d});function u(d,y){if(r._hadError)return;let _=n-y;if(Oe(_>=0,"have should not go down"),_>0){let g=r._buffer.slice(r._offset,r._offset+_);if(r._offset+=_,g.length>s&&(g=g.slice(0,s)),f.push(g),o+=g.length,s-=g.length,s===0)return!1}return(y===0||r._offset>=r._chunkSize)&&(n=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),y===0?(h+=l-d,l=d,!0):!1}Oe(this._handle,"zlib binding closed");let c;do c=this._handle.writeSync(t,e,h,l,this._buffer,this._offset,n),c=c||this._writeState;while(!this._hadError&&u(c[0],c[1]));if(this._hadError)throw a;if(o>=Le)throw Ie(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+Le.toString(16)+" bytes");let p=Buffer.concat(f,o);return Ie(this),p};St.inherits(B,M.Inflate);function Yt(e,t){if(typeof t=="string"&&(t=Buffer.from(t)),!(t instanceof Buffer))throw new TypeError("Not a string or buffer");let i=e._finishFlushFlag;return i==null&&(i=M.Z_FINISH),e._processChunk(t,i)}function ke(e,t){return Yt(new B(t),e)}Ae.exports=Y=ke;Y.Inflate=B;Y.createInflate=Mt;Y.inflateSync=ke});var W=m((_i,Pe)=>{"use strict";var Be=Pe.exports=function(e){this._buffer=e,this._reads=[]};Be.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})};Be.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var Me=m(Se=>{"use strict";var xt=W(),qt=H();Se.process=function(e,t){let i=[],r=new xt(e);return new qt(t,{read:r.read.bind(r),write:function(n){i.push(n)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var Ne=m((di,qe)=>{"use strict";var Ye=!0,xe=w("zlib"),Nt=Re();xe.deflateSync||(Ye=!1);var Ut=W(),Ht=Me(),Dt=F(),vt=z(),Gt=j();qe.exports=function(e,t){if(!Ye)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i;function r(O){i=O}let l;function n(O){l=O}function s(O){l.transColor=O}function h(O){l.palette=O}function f(){l.alpha=!0}let o;function a(O){o=O}let u=[];function c(O){u.push(O)}let p=new Ut(e);if(new Dt(t,{read:p.read.bind(p),error:r,metadata:n,gamma:a,palette:h,transColor:s,inflateData:c,simpleTransparency:f}).start(),p.process(),i)throw i;let y=Buffer.concat(u);u.length=0;let _;if(l.interlace)_=xe.inflateSync(y);else{let J=((l.width*l.bpp*l.depth+7>>3)+1)*l.height;_=Nt(y,{chunkSize:J,maxLength:J})}if(y=null,!_||!_.length)throw new Error("bad png - invalid inflate data response");let g=Ht.process(_,l);y=null;let je=vt.dataToBitMap(g,l);g=null;let Ze=Gt(je,l,t.skipRescale);return l.data=Ze,l.gamma=o||0,l}});var ve=m((gi,De)=>{"use strict";var Ue=!0,He=w("zlib");He.deflateSync||(Ue=!1);var Ft=S(),zt=V();De.exports=function(e,t){if(!Ue)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=t||{},r=new zt(i),l=[];l.push(Buffer.from(Ft.PNG_SIGNATURE)),l.push(r.packIHDR(e.width,e.height)),e.gamma&&l.push(r.packGAMA(e.gamma));let n=r.filterData(e.data,e.width,e.height),s=He.deflateSync(n,r.getDeflateOptions());if(n=null,!s||!s.length)throw new Error("bad png - invalid compressed data response");return l.push(r.packIDAT(s)),l.push(r.packIEND()),Buffer.concat(l)}});var Ge=m(K=>{"use strict";var jt=Ne(),Zt=ve();K.read=function(e,t){return jt(e,t||{})};K.write=function(e,t){return Zt(e,t)}});var Qt=m(ze=>{var Vt=w("util"),Fe=w("stream"),Wt=_e(),Kt=Ce(),Jt=Ge(),C=ze.PNG=function(e){Fe.call(this),e=e||{},this.width=e.width|0,this.height=e.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new Wt(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new Kt(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};Vt.inherits(C,Fe);C.sync=Jt;C.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};C.prototype.parse=function(e,t){if(t){let i,r;i=function(l){this.removeListener("error",r),this.data=l,t(null,this)}.bind(this),r=function(l){this.removeListener("parsed",i),t(l,null)}.bind(this),this.once("parsed",i),this.once("error",r)}return this.end(e),this};C.prototype.write=function(e){return this._parser.write(e),!0};C.prototype.end=function(e){this._parser.end(e)};C.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)};C.prototype._gamma=function(e){this.gamma=e};C.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};C.bitblt=function(e,t,i,r,l,n,s,h){if(i|=0,r|=0,l|=0,n|=0,s|=0,h|=0,i>e.width||r>e.height||i+l>e.width||r+n>e.height)throw new Error("bitblt reading outside image");if(s>t.width||h>t.height||s+l>t.width||h+n>t.height)throw new Error("bitblt writing outside image");for(let f=0;f<n;f++)e.data.copy(t.data,(h+f)*t.width+s<<2,(r+f)*e.width+i<<2,(r+f)*e.width+i+l<<2)};C.prototype.bitblt=function(e,t,i,r,l,n,s){return C.bitblt(this,e,t,i,r,l,n,s),this};C.adjustGamma=function(e){if(e.gamma){for(let t=0;t<e.height;t++)for(let i=0;i<e.width;i++){let r=e.width*t+i<<2;for(let l=0;l<3;l++){let n=e.data[r+l]/255;n=Math.pow(n,1/2.2/e.gamma),e.data[r+l]=Math.round(n*255)}}e.gamma=0}};C.prototype.adjustGamma=function(){C.adjustGamma(this)}});export default Qt();
@@ -1 +0,0 @@
1
- import{c as a,d as s,e,f as r}from"./chunk-TMHR6BIT.js";import"./chunk-FSRPMVAS.js";export{a as Parameters,r as buildDocs,s as escape,e as parseExample};
@@ -1 +0,0 @@
1
- import{a as e,b as o,d as u}from"./chunk-TMHR6BIT.js";import"./chunk-FSRPMVAS.js";import{basename as h}from"path";import{existsSync as C}from"fs";var R=/<\/?[^>]+>/g;function E(n){return n.replace(R,"").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function T(n,r){return(n.name??"")<(r.name??"")?-1:1}function v(n){return n.kind===e.Class||n.kind===e.Interface||n.kind===e.Module||n.kind===e.Enum||n.kind===e.Component||n.kind===e.Namespace||n.kind===e.Function&&n.flags===o.Ambient&&n.children?.length}function w(n){let r=[],t=[];return n.children?.forEach(i=>{let d=a(i),s=i.type;return n.type?.kind===e.Interface||s&&(s.kind===e.Interface||s.kind===e.Class||s.kind===e.Component)?r.push(d):t.push(d)}),`<cxl-t h6 inline>${(r.length?`extends ${r.join(", ")}`:"")+(t.length?` implements ${t.join(", ")}`:"")}</cxl-t>`}function b(n){if(!n.children)return"";let[r,t,i,d]=n.children;return`${a(r)} extends ${a(t)} ? ${a(i)} : ${a(d)}`}function A(n){return n.kind===e.Reference||n.kind===e.ImportType}function f(n,r){return n.type&&(n.kind===e.Reference||n.kind===e.Export||n.kind===e.ImportType)?f(n.type):v(n)?M(n):(n.parent&&(!r||n.parent.name!==r.name)?f(n.parent):"")+(n.id?"#s"+n.id.toString():"")}function l(n,r=".html"){return n.replace(/\.([tj]sx?|md)$/,r).replace(/[/"]/g,"--")}function M(n){if(n.kind===e.Module){let t=l(n.name);return t==="index.html"&&C("README.md")?"index-api.html":t}if(n.kind===e.Namespace)return`ns--${l(n.name)}.html`;let r=Array.isArray(n.source)?n.source[0]:n.source;if(!r)throw new Error(`Source not found for page node "${n.name}"`);return`${l(r.name,"--")}${n.name}.html`}function g(n,r,t){let i=r||(n.name?u(n.name):n.flags&o.Default?"<i>default</i>":"(Unknown)");return n.type&&A(n)&&(n=n.type),n.id?`<a href="${f(n,t)}">${i}</a>`:i}function m(n){return n?"&lt;"+n.map(r=>a(r)+(r.kind!==e.Reference&&r.type?` extends ${a(r.type)}`:"")).join(", ")+"&gt;":""}function _(n){switch(n.kind){case e.ClassType:return w(n);case e.Infer:return`infer ${a(n.type)}`;case e.Parenthesized:return`(${a(n.type)})`;case e.ConditionalType:return b(n);case e.IndexedType:if(!n.children)throw new Error("Invalid node");return`${a(n.children[0])}[${a(n.children[1])}]`;case e.TypeUnion:return n.children?.map(a).join(" | ")||"";case e.TypeIntersection:return n.children?.map(a).join(" & ")||"";case e.Tuple:return`[${n.children?.map(a).join(", ")||""}]`;case e.Array:return`${a(n.type)}[]`;case e.Reference:return`${g(n)}${m(n.typeParameters)}`;case e.FunctionType:case e.Function:case e.Method:return k(n);case e.MappedType:return O(n);case e.ObjectType:return H(n);case e.Literal:return n.name;case e.TypeAlias:case e.BaseType:return n.name;case e.TypeParameter:return F(n);case e.ConstructorType:return`new ${k(n)}`;case e.Keyof:return n.resolvedType?`<doc-more><x slot="off"> keyof ${a(n.type)}</x> ${a(n.resolvedType)}</doc-more>`:`keyof ${a(n.type)}`;case e.Typeof:return`typeof ${n.name}`;case e.ThisType:return"this";case e.Class:case e.Interface:return g(n);case e.ReadonlyKeyword:return`readonly ${a(n.type)}`;case e.Symbol:return"Symbol";case e.UnknownType:return"unknown"}return I(n)}function k(n){let{parameters:r,typeParameters:t,type:i}=n;return`${x(n)}${m(t)}${S(r)} => ${a(i)}`}function x({flags:n,kind:r,name:t}){return!t&&r===e.ConstructSignature?"new":(t?u(t):"")+(n&o.Optional?"?":"")}function S(n){return n?`(${n.map(N).join(", ")})`:""}function N(n){return`${`${n.flags&o.Public?"public ":n.flags&o.Private?"private":n.flags&o.Protected?"protected ":""}${n.flags&o.Rest?"...":""}${n.name}${n.flags&o.Optional?"?":""}`}: ${a(n.type)}${n.value?` = ${n.value}`:""}`}function O(n){if(!n.children?.length||!n.type)return"?";let[r,t]=n.children;return`{ [${c(r)} in ${c(t)}]: ${c(n.type)} }`}function F(n){let r=n.children?.[0];return r?`${n.name} extends ${a(r)}`:n.name}function j(n){return`[${n.parameters?.map(I).join("")||""}]: ${n.type?c(n.type):"?"}`}function U({type:n,kind:r,name:t}){return n?r===e.Class||r===e.Interface||r===e.Component?` ${a(n)}`:`${D(r,t)}${a(n)}`:""}function D(n,r){return n===e.TypeAlias?" = ":r||n===e.Constructor?": ":n===e.CallSignature?" => ":n===e.ReadonlyKeyword?"readonly ":" => "}function K(n){return n&&n.length>50?"":n?` = ${u(n)}`:""}function y(n){if(n.kind===e.Module)return u(n.name);if(n.kind===e.IndexSignature)return j(n);let{value:r,parameters:t,typeParameters:i}=n;return`${x(n)}${m(i)}${S(t)}${U(n)}${K(r)}`}function B(n){return n.kind===e.IndexSignature?j(n):n.kind===e.Spread&&n.children?.[0]?`...${a(n.children[0])}`:y(n)}function H(n){return`{ ${`${n.children?.map(B).join("; ")||""}`} }`}function L(n){return n.__3docHtmlType??=_(n)}function a(n){return n?`${n.flags&o.Rest?"...":""}${L(n)}`:""}function I(n){return n.kind===e.Module||n.kind===e.IndexSignature?y(n):`${y(n)}`}function c(n){if(n.kind===e.Reference&&n.type&&(n=n.type),n.kind===e.ClassType){let i=[];return n.children?.forEach(d=>{d.kind===e.Reference&&i.push({kind:e.Reference,type:d.type?.id})}),{kind:n.kind,children:i,type:n.type?.id}}if(n.kind===e.BaseType)return n.name;if(n.flags&o.External||n.flags&o.DefaultLibrary||n.kind!==e.ObjectType&&n.kind!==e.FunctionType&&n.kind!==e.Function&&n.kind!==e.Method&&n.kind!==e.TypeUnion&&n.kind!==e.Interface)return E(a(n));let r=n.typeParameters?.length?n.typeParameters.map(P):void 0,t=n.parameters?.length?n.parameters.map(p):void 0;return{id:n.id,name:n.name||void 0,parameters:t,kind:n.kind,flags:n.flags||void 0,docs:n.docs,type:n.type?.id,typeP:r,tsconfig:n.flags&o.Export&&n.source?.tsconfig?h(n.source?.tsconfig):void 0}}function P(n){let r=n?n.kind===e.Reference&&n.type?.id!==void 0&&n.type.flags&o.Export?n.type.id:c(n):void 0;return{id:n.id,name:n.name,kind:n.kind,flags:n.flags||void 0,docs:n.docs,type:r}}function p(n){if(n.__3docSummaryNode)return n.__3docSummaryNode;let r=n.children?.length?n.children.map(p).sort(T):void 0,t=n.parameters?.length?n.parameters.map(p):void 0,i=n.typeParameters?.length?n.typeParameters.map(P):void 0,d=n.type,s;d&&(d.kind===e.Reference&&d.type?.id!==void 0&&d.type.flags&&d.type.flags&o.Export?s=d.type.id:s=c(d));let $=n.resolvedType?n.resolvedType?.type?.type===n?n.resolvedType.name:c(n.resolvedType):void 0;return n.__3docSummaryNode={id:n.id,name:n.name||void 0,parameters:t,kind:n.kind,flags:n.flags||void 0,docs:n.docs,type:s,typeP:i,resolvedType:$===s?void 0:$,children:r,tsconfig:n.flags&o.Export&&n.source?.tsconfig?h(n.source?.tsconfig):void 0}}function z(n){return v(n)||n.kind===e.TypeAlias}function q(n,r){let t=Object.values(r.index).filter(z).map(p).sort(T),i=n.modulePackage?.version;return[{name:i?`${i}/summary.json`:"summary.json",content:JSON.stringify({index:t})}]}export{I as Signature,y as SignatureText,a as Type,f as getHref,q as render};
package/root-G5JDVI4D.js DELETED
@@ -1,9 +0,0 @@
1
- import{e as i,f as a,g as s}from"./chunk-SWJCWBGM.js";import"./chunk-FSRPMVAS.js";import p from"fs/promises";import c from"path";async function h(){let e=await p.readdir("."),n=[];for(let r of e)n.push(await u(r));let t=`${(await a("./package.json")).description}
2
-
3
- ## Packages
4
-
5
- | Name | Version | License | Description | Links |
6
- | -------------- | ------- | ------- | ------------------------------------ | ---------------------------------------------- |
7
- ${n.join("")}
8
- `;await d("README.md",t)}async function g(e){let n=c.join(".",e),o=c.resolve(n,"./package.json"),t;try{t=await a(o)}catch{return}if(t.private)return;if(!(t.description&&t.license&&t.homepage))throw new Error(`Invalid package: ${t.name}`);return t}function d(e,n){if(console.log(`Writing ${e}`),!n)throw new Error("No content");return p.writeFile(e,n)}function m(e,n){return`https://npmjs.com/package/${e}/v/${n}`}async function u(e){let n=await g(e);if(!n)return"";console.log(`Package: ${e}`),await i(`npm run build audit test package docs --prefix ${e}`);let o=await s(n.name).catch(()=>""),t=o?`[${o}](${m(n.name,o)})`:`${n.version}`;return`| ${n.name.padEnd(20)} | ${t} | ${n.license.padEnd(10)} | ${n.description} | ${n.homepage?`[Docs](${n.homepage}/${n.version}/)`:""} |
9
- `}export{h as buildRoot};