likec4 0.42.0 → 0.42.1
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/README.md +108 -0
- package/dist/cli/index.js +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
1
|
# LikeC4
|
|
2
2
|
|
|
3
|
+
`likec4` is a CLI tool for various operations and automation over LikeC4 projects, such as:
|
|
4
|
+
|
|
5
|
+
1. LikeC4
|
|
6
|
+
1. Install
|
|
7
|
+
1. Local installation
|
|
8
|
+
2. Global installation
|
|
9
|
+
2. Usage
|
|
10
|
+
1. Preview diagrams
|
|
11
|
+
2. Build static website
|
|
12
|
+
3. Export to PNG
|
|
13
|
+
4. Export to Mermaid, Dot, D2
|
|
14
|
+
5. Generate React components
|
|
15
|
+
6. Generate structured data
|
|
16
|
+
3. Support
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
> **Compatibility Note:**
|
|
21
|
+
> LikeC4 requires [Node.js](https://nodejs.org/en/) version 18+, 20+
|
|
22
|
+
|
|
23
|
+
### Local installation
|
|
24
|
+
|
|
25
|
+
If you're using it in an npm project, install it as a development dependency:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install --save-dev likec4
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You can reference it directly in the `package.json#scripts` object:
|
|
32
|
+
|
|
33
|
+
```json5
|
|
34
|
+
{
|
|
35
|
+
scripts: {
|
|
36
|
+
dev: 'likec4 serve ...',
|
|
37
|
+
build: 'likec4 build ...'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> Check out the template repository [likec4/template](https://github.com/likec4/template)
|
|
43
|
+
> with pre-configured CI for building and deploying to github pages.
|
|
44
|
+
|
|
45
|
+
To use the binary, you can call it with [`npx`](https://docs.npmjs.com/cli/v10/commands/npx) while in the project directory:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npx likec4 ...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Global installation
|
|
52
|
+
|
|
53
|
+
If you want to use it in any arbitrary project without [`npx`](https://docs.npmjs.com/cli/v10/commands/npx), install it globally:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
npm install --global likec4
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then, you can call `likec4` directly:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
likec4 ...
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
### Preview diagrams
|
|
68
|
+
|
|
69
|
+
In a folder with LikeC4 sources:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
likec4 serve
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This will recursively search for `*.c4`, `*.likec4` files and serve them in a local web server.
|
|
76
|
+
|
|
77
|
+
Any changes to the sources will trigger a live-update of diagrams.
|
|
78
|
+
|
|
79
|
+
Refer to the help for more options:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
likec4 serve --help
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Build static website
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
likec4 build -o ./dist
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The output folder will contain a static website (single-page application).
|
|
92
|
+
|
|
93
|
+
### Export to PNG
|
|
94
|
+
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
### Export to Mermaid, Dot, D2
|
|
98
|
+
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
### Generate React components
|
|
102
|
+
|
|
3
103
|
...
|
|
104
|
+
|
|
105
|
+
### Generate structured data
|
|
106
|
+
|
|
107
|
+
...
|
|
108
|
+
|
|
109
|
+
## Support
|
|
110
|
+
|
|
111
|
+
If there's a problem you're encountering or something you need help with, don't hesitate to take advantage of my [_Priority Support_ service](https://github.com/sponsors/davydkov) where you can ask me questions in an exclusive forum. I'm well equppied to assist you with this project and would be happy to help you out! 🙂
|
package/dist/cli/index.js
CHANGED
|
@@ -362,7 +362,7 @@ ${a}`)}}return i!==!0}}async function gv({workspaceDir:t,logValidationErrors:e=!
|
|
|
362
362
|
} from '@likec4/core'
|
|
363
363
|
`.append(ke,ke),qn(e))}var TD,wX=y(()=>{"use strict";TD=le(MS(),1);$r();US();o(WS,"generateViewsDataJs");o(VS,"generateViewsDataTs")});var KS=y(()=>{"use strict";US();FX();xX();wX()});function bX({languageServices:t}){let e=null,r;async function n(){let s=await t.getViews();return WS(s)}o(n,"generateCode");async function i(){let s=await t.getViews(),u=`export const LikeC4Views = {
|
|
364
364
|
`;for(let a of s)u+=` ${JSON.stringify(a.id)}: {width: ${a.width},height: ${a.height}},
|
|
365
|
-
`;return u+="}",u}return o(i,"generateDimensionsCode"),{name:"vite-plugin-likec4",configResolved(s){r=s.logger},resolveId(s){if(s===bwe)return AX;if(s===Awe)return YS},async load(s){return s===AX?await i():s===YS?e??=await n():null},configureServer(s){let u=o(()=>{e=null;let f=s.moduleGraph.getModuleById(YS);f?(r.info(`trigger HMR: ${f.url}`),s.reloadModule(f)):r.warn("LikeC4 HMR is not available because the module has not been loaded yet.")},"triggerHMR"),a,l=o(()=>{clearTimeout(a),a=setTimeout(u,300)},"scheduleHMR"),c=o(f=>{clearTimeout(a),f.then(d=>d&&l(),()=>({}))},"handleUpdate");s.watcher.on("add",f=>{XS(f)&&c(t.notifyUpdate({changed:f}))}).on("change",f=>{XS(f)&&c(t.notifyUpdate({changed:f}))}).on("unlink",f=>{XS(f)&&c(t.notifyUpdate({removed:f}))})}}}var Awe,YS,bwe,AX,XS,RX=y(()=>{"use strict";KS();Awe="~likec4",YS="/@vite-plugin-likec4/likec4-generated",bwe="~likec4-dimensions",AX="/@vite-plugin-likec4/likec4-dimensions",XS=o(t=>{let e=t.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")},"isTarget");o(bX,"likec4Plugin")});import Rwe from"@vitejs/plugin-react";import QS from"node:fs";import{dirname as Twe,resolve as qu}from"node:path";import{fileURLToPath as _we}from"node:url";function Pwe(t,e){let r={};return Array.from(Object.entries(t)).forEach(([n,i])=>{if(!QS.existsSync(i)){e.error(`${$p.default.bgRed($p.default.white(n))} does not exist ${i}`);return}e.info(`${n} ${$p.default.dim("resolve to")} ${i}`),Object.assign(r,{[n]:i})}),r}var $p,TX,Op,Swe,Lp,vv=y(()=>{"use strict";wD();$p=le(Qi(),1),TX=le(Zn(),1);fc();RX();Op=Twe(_we(import.meta.url)),Swe=o(()=>{let t=qu(Op,"../__app__");return QS.existsSync(t)?[t,!1]:[qu(Op,"../../app"),!0]},"getAppRoot");o(Pwe,"resolveAliases");Lp=o(async t=>{let e=qa("c4:vite"),[r,n]=Swe();if(!QS.existsSync(r))throw e.error(`app root does not exist: ${r}`),new Error(`app root does not exist: ${r}`);e.info(`${$p.default.dim("app root")} ${r}`);let i=t?.languageServices??await gv({workspaceDir:t?.workspaceDir??process.cwd(),logValidationErrors:!0}),s,u;n?(s=qu(Op,"../../../core/src/index.ts"),u=qu(Op,"../../../diagrams/src/index.ts")):(s=qu(Op,"../@likec4/core/index.js"),u=qu(Op,"../@likec4/diagrams/index.js"));let a=Pwe({"@likec4/core":s,"@likec4/diagrams":u},e),l="/";return t?.base&&(l=t.base,l.startsWith("/")||(l="/"+l),l.endsWith("/")||(l=l+"/"),e.info(`${$p.default.dim("app base url")} ${l}`)),{root:r,languageServices:i,resolve:{dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime"],alias:{"~":qu(r,"./src"),...a}},clearScreen:!1,base:l,build:{outDir:t?.outputDir??qu(i.workspace,"dist"),emptyOutDir:(0,TX.isNil)(t?.outputDir),assetsInlineLimit:500*1e3,cssMinify:!0,minify:!0,sourcemap:!1,cssCodeSplit:!1,chunkSizeWarningLimit:5*1e3*1e3,commonjsOptions:{esmExternals:!0,sourceMap:!1}},css:{postcss:qu(r,"postcss.config.cjs"),modules:{localsConvention:"camelCaseOnly"}},customLogger:e,optimizeDeps:{include:n?[]:["@radix-ui/react-icons","@radix-ui/themes","@likec4/core","@likec4/diagrams","@react-spring/konva","@use-gesture/react","classnames","remeda","rambdax","jotai","konva","react-accessible-treeview","react-dom","react-dom/client","react-konva","react-konva/es/ReactKonvaCore","konva/lib/Core","konva/lib/shapes/Rect","konva/lib/shapes/Text","konva/lib/shapes/Path","konva/lib/shapes/Circle","konva/lib/shapes/Line","konva/lib/shapes/Image","konva/lib/shapes/Ellipse","react","react/jsx-dev-runtime","react/jsx-runtime"]},plugins:[Rwe({}),bX({languageServices:i})]}},"viteConfig")});import{build as _X,mergeConfig as kwe}from"vite";var xv,ZS=y(()=>{"use strict";vv();xv=o(async t=>{let e=await Lp(t);await _X({...e,configFile:!1,mode:"production"}),await _X(kwe(e,{configFile:!1,mode:"production",build:{lib:{entry:"src/likec4-views.ts",name:"LikeC4",fileName:()=>"likec4-views.js",formats:["umd"]}}}))},"viteBuild")});var SX={};Ka(SX,{handler:()=>Bwe});async function Bwe({path:t,output:e,...r}){let n=await qo.get({workspaceDir:t});await xv({...r,languageServices:n,outputDir:e})}var PX=y(()=>{"use strict";fc();ZS();o(Bwe,"handler")});var IX=O((zmt,t3)=>{"use strict";var Nwe=Object.prototype.hasOwnProperty,Ni="~";function _D(){}o(_D,"Events");Object.create&&(_D.prototype=Object.create(null),new _D().__proto__||(Ni=!1));function Owe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}o(Owe,"EE");function BX(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new Owe(r,n||t,i),u=Ni?Ni+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}o(BX,"addListener");function wv(t,e){--t._eventsCount===0?t._events=new _D:delete t._events[e]}o(wv,"clearEvent");function Ei(){this._events=new _D,this._eventsCount=0}o(Ei,"EventEmitter");Ei.prototype.eventNames=o(function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)Nwe.call(r,n)&&e.push(Ni?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},"eventNames");Ei.prototype.listeners=o(function(e){var r=Ni?Ni+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,u=new Array(s);i<s;i++)u[i]=n[i].fn;return u},"listeners");Ei.prototype.listenerCount=o(function(e){var r=Ni?Ni+e:e,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");Ei.prototype.emit=o(function(e,r,n,i,s,u){var a=Ni?Ni+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,f,d;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,r),!0;case 3:return l.fn.call(l.context,r,n),!0;case 4:return l.fn.call(l.context,r,n,i),!0;case 5:return l.fn.call(l.context,r,n,i,s),!0;case 6:return l.fn.call(l.context,r,n,i,s,u),!0}for(d=1,f=new Array(c-1);d<c;d++)f[d-1]=arguments[d];l.fn.apply(l.context,f)}else{var h=l.length,m;for(d=0;d<h;d++)switch(l[d].once&&this.removeListener(e,l[d].fn,void 0,!0),c){case 1:l[d].fn.call(l[d].context);break;case 2:l[d].fn.call(l[d].context,r);break;case 3:l[d].fn.call(l[d].context,r,n);break;case 4:l[d].fn.call(l[d].context,r,n,i);break;default:if(!f)for(m=1,f=new Array(c-1);m<c;m++)f[m-1]=arguments[m];l[d].fn.apply(l[d].context,f)}}return!0},"emit");Ei.prototype.on=o(function(e,r,n){return BX(this,e,r,n,!1)},"on");Ei.prototype.once=o(function(e,r,n){return BX(this,e,r,n,!0)},"once");Ei.prototype.removeListener=o(function(e,r,n,i){var s=Ni?Ni+e:e;if(!this._events[s])return this;if(!r)return wv(this,s),this;var u=this._events[s];if(u.fn)u.fn===r&&(!i||u.once)&&(!n||u.context===n)&&wv(this,s);else{for(var a=0,l=[],c=u.length;a<c;a++)(u[a].fn!==r||i&&!u[a].once||n&&u[a].context!==n)&&l.push(u[a]);l.length?this._events[s]=l.length===1?l[0]:l:wv(this,s)}return this},"removeListener");Ei.prototype.removeAllListeners=o(function(e){var r;return e?(r=Ni?Ni+e:e,this._events[r]&&wv(this,r)):(this._events=new _D,this._eventsCount=0),this},"removeAllListeners");Ei.prototype.off=Ei.prototype.removeListener;Ei.prototype.addListener=Ei.prototype.on;Ei.prefixed=Ni;Ei.EventEmitter=Ei;typeof t3<"u"&&(t3.exports=Ei)});var r3,NX=y(()=>{r3=le(IX(),1)});function i3(t,e,r,n){let i,s=new Promise((u,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){u(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:l}=n;l.aborted&&a($X(l)),l.addEventListener("abort",()=>{a($X(l))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{u(r())}catch(f){a(f)}return}let l=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,c=r instanceof Error?r:new SD(l);typeof t.cancel=="function"&&t.cancel(),a(c)},e),(async()=>{try{u(await t)}catch(l){a(l)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return s.clear=()=>{clearTimeout(i),i=void 0},s}var SD,n3,OX,$X,LX=y(()=>{SD=class extends Error{static{o(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}},n3=class extends Error{static{o(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}},OX=o(t=>globalThis.DOMException===void 0?new n3(t):new DOMException(t),"getDOMException"),$X=o(t=>{let e=t.reason===void 0?OX("This operation was aborted."):t.reason;return e instanceof Error?e:OX(e)},"getAbortedReason");o(i3,"pTimeout")});function o3(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),u=n+s;r(t[u],e)<=0?(n=++u,i-=s+1):i=s}return n}var MX=y(()=>{o(o3,"lowerBound")});var mc,Gu,s3,jX,qX=y(()=>{MX();mc=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s3=class{static{o(this,"PriorityQueue")}constructor(){Gu.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&mc(this,Gu,"f")[this.size-1].priority>=r.priority){mc(this,Gu,"f").push(n);return}let i=o3(mc(this,Gu,"f"),n,(s,u)=>u.priority-s.priority);mc(this,Gu,"f").splice(i,0,n)}dequeue(){let e=mc(this,Gu,"f").shift();return e?.run}filter(e){return mc(this,Gu,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return mc(this,Gu,"f").length}};Gu=new WeakMap;jX=s3});var nn,Le,Cn,kD,BD,za,Sv,ID,Av,Es,PD,ho,bv,Do,ND,Ua,Rv,GX,UX,WX,zX,HX,Tv,u3,a3,Pv,VX,_v,kv,l3,KX,YX=y(()=>{NX();LX();qX();nn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kv=class extends Error{static{o(this,"AbortError")}},l3=class extends r3.default{static{o(this,"PQueue")}constructor(e){var r,n,i,s;if(super(),Cn.add(this),kD.set(this,void 0),BD.set(this,void 0),za.set(this,0),Sv.set(this,void 0),ID.set(this,void 0),Av.set(this,0),Es.set(this,void 0),PD.set(this,void 0),ho.set(this,void 0),bv.set(this,void 0),Do.set(this,0),ND.set(this,void 0),Ua.set(this,void 0),Rv.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:jX,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);nn(this,kD,e.carryoverConcurrencyCount,"f"),nn(this,BD,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),nn(this,Sv,e.intervalCap,"f"),nn(this,ID,e.interval,"f"),nn(this,ho,new e.queueClass,"f"),nn(this,bv,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,nn(this,Rv,e.throwOnTimeout===!0,"f"),nn(this,Ua,e.autoStart===!1,"f")}get concurrency(){return Le(this,ND,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);nn(this,ND,e,"f"),Le(this,Cn,"m",Pv).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:Le(this,Rv,"f"),...r},new Promise((n,i)=>{Le(this,ho,"f").enqueue(async()=>{var s,u,a;nn(this,Do,(u=Le(this,Do,"f"),u++,u),"f"),nn(this,za,(a=Le(this,za,"f"),a++,a),"f");try{if(!((s=r.signal)===null||s===void 0)&&s.aborted)throw new kv("The task was aborted.");let l=e({signal:r.signal});r.timeout&&(l=i3(Promise.resolve(l),r.timeout)),r.signal&&(l=Promise.race([l,Le(this,Cn,"m",VX).call(this,r.signal)]));let c=await l;n(c),this.emit("completed",c)}catch(l){if(l instanceof SD&&!r.throwOnTimeout){n();return}i(l),this.emit("error",l)}finally{Le(this,Cn,"m",WX).call(this)}},r),this.emit("add"),Le(this,Cn,"m",Tv).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return Le(this,Ua,"f")?(nn(this,Ua,!1,"f"),Le(this,Cn,"m",Pv).call(this),this):this}pause(){nn(this,Ua,!0,"f")}clear(){nn(this,ho,new(Le(this,bv,"f")),"f")}async onEmpty(){Le(this,ho,"f").size!==0&&await Le(this,Cn,"m",_v).call(this,"empty")}async onSizeLessThan(e){Le(this,ho,"f").size<e||await Le(this,Cn,"m",_v).call(this,"next",()=>Le(this,ho,"f").size<e)}async onIdle(){Le(this,Do,"f")===0&&Le(this,ho,"f").size===0||await Le(this,Cn,"m",_v).call(this,"idle")}get size(){return Le(this,ho,"f").size}sizeBy(e){return Le(this,ho,"f").filter(e).length}get pending(){return Le(this,Do,"f")}get isPaused(){return Le(this,Ua,"f")}};kD=new WeakMap,BD=new WeakMap,za=new WeakMap,Sv=new WeakMap,ID=new WeakMap,Av=new WeakMap,Es=new WeakMap,PD=new WeakMap,ho=new WeakMap,bv=new WeakMap,Do=new WeakMap,ND=new WeakMap,Ua=new WeakMap,Rv=new WeakMap,Cn=new WeakSet,GX=o(function(){return Le(this,BD,"f")||Le(this,za,"f")<Le(this,Sv,"f")},"_PQueue_doesIntervalAllowAnother_get"),UX=o(function(){return Le(this,Do,"f")<Le(this,ND,"f")},"_PQueue_doesConcurrentAllowAnother_get"),WX=o(function(){var e;nn(this,Do,(e=Le(this,Do,"f"),e--,e),"f"),Le(this,Cn,"m",Tv).call(this),this.emit("next")},"_PQueue_next"),zX=o(function(){Le(this,Cn,"m",a3).call(this),Le(this,Cn,"m",u3).call(this),nn(this,PD,void 0,"f")},"_PQueue_onResumeInterval"),HX=o(function(){let e=Date.now();if(Le(this,Es,"f")===void 0){let r=Le(this,Av,"f")-e;if(r<0)nn(this,za,Le(this,kD,"f")?Le(this,Do,"f"):0,"f");else return Le(this,PD,"f")===void 0&&nn(this,PD,setTimeout(()=>{Le(this,Cn,"m",zX).call(this)},r),"f"),!0}return!1},"_PQueue_isIntervalPaused_get"),Tv=o(function(){if(Le(this,ho,"f").size===0)return Le(this,Es,"f")&&clearInterval(Le(this,Es,"f")),nn(this,Es,void 0,"f"),this.emit("empty"),Le(this,Do,"f")===0&&this.emit("idle"),!1;if(!Le(this,Ua,"f")){let e=!Le(this,Cn,"a",HX);if(Le(this,Cn,"a",GX)&&Le(this,Cn,"a",UX)){let r=Le(this,ho,"f").dequeue();return r?(this.emit("active"),r(),e&&Le(this,Cn,"m",u3).call(this),!0):!1}}return!1},"_PQueue_tryToStartAnother"),u3=o(function(){Le(this,BD,"f")||Le(this,Es,"f")!==void 0||(nn(this,Es,setInterval(()=>{Le(this,Cn,"m",a3).call(this)},Le(this,ID,"f")),"f"),nn(this,Av,Date.now()+Le(this,ID,"f"),"f"))},"_PQueue_initializeIntervalIfNeeded"),a3=o(function(){Le(this,za,"f")===0&&Le(this,Do,"f")===0&&Le(this,Es,"f")&&(clearInterval(Le(this,Es,"f")),nn(this,Es,void 0,"f")),nn(this,za,Le(this,kD,"f")?Le(this,Do,"f"):0,"f"),Le(this,Cn,"m",Pv).call(this)},"_PQueue_onInterval"),Pv=o(function(){for(;Le(this,Cn,"m",Tv).call(this););},"_PQueue_processQueue"),VX=o(async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new kv("The task was aborted."))},{once:!0})})},"_PQueue_throwOnAbort"),_v=o(async function(e,r){return new Promise(n=>{let i=o(()=>{r&&!r()||(this.off(e,i),n())},"listener");this.on(e,i)})},"_PQueue_onEvent");KX=l3});var XX=O((oht,$we)=>{$we.exports=[{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var JX=O(go=>{"use strict";var ZX=XX(),On=process.env;Object.defineProperty(go,"_vendors",{value:ZX.map(function(t){return t.constant})});go.name=null;go.isPR=null;ZX.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return QX(n)});if(go[t.constant]=r,!!r)switch(go.name=t.name,typeof t.pr){case"string":go.isPR=!!On[t.pr];break;case"object":"env"in t.pr?go.isPR=t.pr.env in On&&On[t.pr.env]!==t.pr.ne:"any"in t.pr?go.isPR=t.pr.any.some(function(n){return!!On[n]}):go.isPR=QX(t.pr);break;default:go.isPR=null}});go.isCI=!!(On.CI!=="false"&&(On.BUILD_ID||On.BUILD_NUMBER||On.CI||On.CI_APP_ID||On.CI_BUILD_ID||On.CI_BUILD_NUMBER||On.CI_NAME||On.CONTINUOUS_INTEGRATION||On.RUN_ID||go.name));function QX(t){return typeof t=="string"?!!On[t]:"env"in t?On[t.env]&&On[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!On[e]}):Object.keys(t).every(function(e){return On[e]===t[e]})}o(QX,"checkEnv")});import Lwe from"node:net";import Mwe from"node:os";async function jp(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){let i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}OD===void 0&&(OD=setTimeout(()=>{OD=void 0,Mp.old=Mp.young,Mp.young=new Set},jwe),OD.unref&&OD.unref());let n=qwe();for(let i of Gwe(e))try{if(r.has(i))continue;let s=await tQ({...t,port:i},n);for(;Mp.old.has(s)||Mp.young.has(s);){if(i!==0)throw new Nv(i);s=await tQ({...t,port:i},n)}return Mp.young.add(s),s}catch(s){if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Nv))throw s}throw new Error("No available ports found")}function rQ(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Bv||t>Iv)throw new RangeError(`'from' must be between ${Bv} and ${Iv}`);if(e<Bv||e>Iv)throw new RangeError(`'to' must be between ${Bv} and ${Iv}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return o(function*(n,i){for(let s=n;s<=i;s++)yield s},"generator")(t,e)}var Nv,Mp,jwe,Bv,Iv,OD,qwe,eQ,tQ,Gwe,c3=y(()=>{Nv=class extends Error{static{o(this,"Locked")}constructor(e){super(`${e} is locked`)}},Mp={old:new Set,young:new Set},jwe=1e3*15,Bv=1024,Iv=65535,qwe=o(()=>{let t=Mwe.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(t))for(let n of r)e.add(n.address);return e},"getLocalHosts"),eQ=o(t=>new Promise((e,r)=>{let n=Lwe.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{let{port:i}=n.address();n.close(()=>{e(i)})})}),"checkAvailablePort"),tQ=o(async(t,e)=>{if(t.host||t.port===0)return eQ(t);for(let r of e)try{await eQ({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},"getAvailablePort"),Gwe=o(function*(t){t&&(yield*t),yield 0},"portCheckSequence");o(jp,"getPorts");o(rQ,"portNumbers")});import{mergeConfig as Uwe,preview as zwe}from"vite";async function Ov(t){let e=await Lp(t),r=await jp({port:rQ(62001,62020)}),n=t?.open??!1;return await zwe(Uwe(e,{configFile:!1,mode:"production",preview:{host:"0.0.0.0",port:r,open:n}}))}var f3=y(()=>{"use strict";c3();vv();o(Ov,"vitePreview")});import{resolve as Hwe}from"node:path";function nQ({browser:t,pageUrl:e,outputDir:r,logger:n}){return o(async function(s){let a=e(s)+"e=e&padding=20";n.info(`${$v.default.dim("export")} ${s.id} ${$v.default.underline($v.default.dim(a))}`);let l=await t.newPage({deviceScaleFactor:2,viewport:{width:s.width+20*2,height:s.height+20*2}});try{await l.goto(a)}catch(f){f instanceof Error&&f.name==="TimeoutError"?n.error(`Timeout while loading page: ${a}`):n.error(`Page loading failed: ${a}
|
|
365
|
+
`;return u+="}",u}return o(i,"generateDimensionsCode"),{name:"vite-plugin-likec4",configResolved(s){r=s.logger},resolveId(s){if(s===bwe)return AX;if(s===Awe)return YS},async load(s){return s===AX?await i():s===YS?e??=await n():null},configureServer(s){let u=o(()=>{e=null;let f=s.moduleGraph.getModuleById(YS);f?(r.info(`trigger HMR: ${f.url}`),s.reloadModule(f)):r.warn("LikeC4 HMR is not available because the module has not been loaded yet.")},"triggerHMR"),a,l=o(()=>{clearTimeout(a),a=setTimeout(u,300)},"scheduleHMR"),c=o(f=>{clearTimeout(a),f.then(d=>d&&l(),()=>({}))},"handleUpdate");s.watcher.on("add",f=>{XS(f)&&c(t.notifyUpdate({changed:f}))}).on("change",f=>{XS(f)&&c(t.notifyUpdate({changed:f}))}).on("unlink",f=>{XS(f)&&c(t.notifyUpdate({removed:f}))})}}}var Awe,YS,bwe,AX,XS,RX=y(()=>{"use strict";KS();Awe="~likec4",YS="/@vite-plugin-likec4/likec4-generated",bwe="~likec4-dimensions",AX="/@vite-plugin-likec4/likec4-dimensions",XS=o(t=>{let e=t.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")},"isTarget");o(bX,"likec4Plugin")});import Rwe from"@vitejs/plugin-react";import QS from"node:fs";import{dirname as Twe,resolve as qu}from"node:path";import{fileURLToPath as _we}from"node:url";function Pwe(t,e){let r={};return Array.from(Object.entries(t)).forEach(([n,i])=>{if(!QS.existsSync(i)){e.error(`${$p.default.bgRed($p.default.white(n))} does not exist ${i}`);return}e.info(`${n} ${$p.default.dim("resolve to")} ${i}`),Object.assign(r,{[n]:i})}),r}var $p,TX,Op,Swe,Lp,vv=y(()=>{"use strict";wD();$p=le(Qi(),1),TX=le(Zn(),1);fc();RX();Op=Twe(_we(import.meta.url)),Swe=o(()=>{let t=qu(Op,"../__app__");return QS.existsSync(t)?[t,!1]:[qu(Op,"../../app"),!0]},"getAppRoot");o(Pwe,"resolveAliases");Lp=o(async t=>{let e=qa("c4:vite"),[r,n]=Swe();if(!QS.existsSync(r))throw e.error(`app root does not exist: ${r}`),new Error(`app root does not exist: ${r}`);e.info(`${$p.default.dim("app root")} ${r}`);let i=t?.languageServices??await gv({workspaceDir:t?.workspaceDir??process.cwd(),logValidationErrors:!0}),s,u;n?(s=qu(Op,"../../../core/src/index.ts"),u=qu(Op,"../../../diagrams/src/index.ts")):(s=qu(Op,"../@likec4/core/index.js"),u=qu(Op,"../@likec4/diagrams/index.js"));let a=Pwe({"@likec4/core":s,"@likec4/diagrams":u},e),l="/";return t?.base&&(l=t.base,l.startsWith("/")||(l="/"+l),l.endsWith("/")||(l=l+"/"),e.info(`${$p.default.dim("app base url")} ${l}`)),{isDev:n,root:r,languageServices:i,resolve:{dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime"],alias:{"~":qu(r,"./src"),...a}},clearScreen:!1,base:l,build:{outDir:t?.outputDir??qu(i.workspace,"dist"),emptyOutDir:(0,TX.isNil)(t?.outputDir),assetsInlineLimit:500*1e3,cssMinify:!0,minify:!0,sourcemap:!1,cssCodeSplit:!1,chunkSizeWarningLimit:5*1e3*1e3,commonjsOptions:{esmExternals:!0,sourceMap:!1}},css:{postcss:qu(r,"postcss.config.cjs"),modules:{localsConvention:"camelCaseOnly"}},customLogger:e,optimizeDeps:{include:n?[]:["@radix-ui/react-icons","@radix-ui/themes","@likec4/core","@likec4/diagrams","@react-spring/konva","@use-gesture/react","classnames","remeda","rambdax","jotai","konva","react-accessible-treeview","react-dom","react-dom/client","react-konva","react-konva/es/ReactKonvaCore","konva/lib/Core","konva/lib/shapes/Rect","konva/lib/shapes/Text","konva/lib/shapes/Path","konva/lib/shapes/Circle","konva/lib/shapes/Line","konva/lib/shapes/Image","konva/lib/shapes/Ellipse","react","react/jsx-dev-runtime","react/jsx-runtime"]},plugins:[Rwe({}),bX({languageServices:i})]}},"viteConfig")});import{build as _X,mergeConfig as kwe}from"vite";var xv,ZS=y(()=>{"use strict";vv();xv=o(async t=>{let{isDev:e,...r}=await Lp(t);await _X({...r,configFile:!1,mode:"production"}),await _X(kwe(r,{configFile:!1,mode:"production",build:{lib:{entry:`src/likec4-views.${e?"ts":"js"}`,name:"LikeC4",fileName:()=>"likec4-views.js",formats:["umd"]}}}))},"viteBuild")});var SX={};Ka(SX,{handler:()=>Bwe});async function Bwe({path:t,output:e,...r}){let n=await qo.get({workspaceDir:t});await xv({...r,languageServices:n,outputDir:e})}var PX=y(()=>{"use strict";fc();ZS();o(Bwe,"handler")});var IX=O((zmt,t3)=>{"use strict";var Nwe=Object.prototype.hasOwnProperty,Ni="~";function _D(){}o(_D,"Events");Object.create&&(_D.prototype=Object.create(null),new _D().__proto__||(Ni=!1));function Owe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}o(Owe,"EE");function BX(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new Owe(r,n||t,i),u=Ni?Ni+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}o(BX,"addListener");function wv(t,e){--t._eventsCount===0?t._events=new _D:delete t._events[e]}o(wv,"clearEvent");function Ei(){this._events=new _D,this._eventsCount=0}o(Ei,"EventEmitter");Ei.prototype.eventNames=o(function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)Nwe.call(r,n)&&e.push(Ni?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},"eventNames");Ei.prototype.listeners=o(function(e){var r=Ni?Ni+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,u=new Array(s);i<s;i++)u[i]=n[i].fn;return u},"listeners");Ei.prototype.listenerCount=o(function(e){var r=Ni?Ni+e:e,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");Ei.prototype.emit=o(function(e,r,n,i,s,u){var a=Ni?Ni+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,f,d;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,r),!0;case 3:return l.fn.call(l.context,r,n),!0;case 4:return l.fn.call(l.context,r,n,i),!0;case 5:return l.fn.call(l.context,r,n,i,s),!0;case 6:return l.fn.call(l.context,r,n,i,s,u),!0}for(d=1,f=new Array(c-1);d<c;d++)f[d-1]=arguments[d];l.fn.apply(l.context,f)}else{var h=l.length,m;for(d=0;d<h;d++)switch(l[d].once&&this.removeListener(e,l[d].fn,void 0,!0),c){case 1:l[d].fn.call(l[d].context);break;case 2:l[d].fn.call(l[d].context,r);break;case 3:l[d].fn.call(l[d].context,r,n);break;case 4:l[d].fn.call(l[d].context,r,n,i);break;default:if(!f)for(m=1,f=new Array(c-1);m<c;m++)f[m-1]=arguments[m];l[d].fn.apply(l[d].context,f)}}return!0},"emit");Ei.prototype.on=o(function(e,r,n){return BX(this,e,r,n,!1)},"on");Ei.prototype.once=o(function(e,r,n){return BX(this,e,r,n,!0)},"once");Ei.prototype.removeListener=o(function(e,r,n,i){var s=Ni?Ni+e:e;if(!this._events[s])return this;if(!r)return wv(this,s),this;var u=this._events[s];if(u.fn)u.fn===r&&(!i||u.once)&&(!n||u.context===n)&&wv(this,s);else{for(var a=0,l=[],c=u.length;a<c;a++)(u[a].fn!==r||i&&!u[a].once||n&&u[a].context!==n)&&l.push(u[a]);l.length?this._events[s]=l.length===1?l[0]:l:wv(this,s)}return this},"removeListener");Ei.prototype.removeAllListeners=o(function(e){var r;return e?(r=Ni?Ni+e:e,this._events[r]&&wv(this,r)):(this._events=new _D,this._eventsCount=0),this},"removeAllListeners");Ei.prototype.off=Ei.prototype.removeListener;Ei.prototype.addListener=Ei.prototype.on;Ei.prefixed=Ni;Ei.EventEmitter=Ei;typeof t3<"u"&&(t3.exports=Ei)});var r3,NX=y(()=>{r3=le(IX(),1)});function i3(t,e,r,n){let i,s=new Promise((u,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){u(t);return}if(n={customTimers:{setTimeout,clearTimeout},...n},n.signal){let{signal:l}=n;l.aborted&&a($X(l)),l.addEventListener("abort",()=>{a($X(l))})}i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof r=="function"){try{u(r())}catch(f){a(f)}return}let l=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,c=r instanceof Error?r:new SD(l);typeof t.cancel=="function"&&t.cancel(),a(c)},e),(async()=>{try{u(await t)}catch(l){a(l)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return s.clear=()=>{clearTimeout(i),i=void 0},s}var SD,n3,OX,$X,LX=y(()=>{SD=class extends Error{static{o(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}},n3=class extends Error{static{o(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}},OX=o(t=>globalThis.DOMException===void 0?new n3(t):new DOMException(t),"getDOMException"),$X=o(t=>{let e=t.reason===void 0?OX("This operation was aborted."):t.reason;return e instanceof Error?e:OX(e)},"getAbortedReason");o(i3,"pTimeout")});function o3(t,e,r){let n=0,i=t.length;for(;i>0;){let s=Math.trunc(i/2),u=n+s;r(t[u],e)<=0?(n=++u,i-=s+1):i=s}return n}var MX=y(()=>{o(o3,"lowerBound")});var mc,Gu,s3,jX,qX=y(()=>{MX();mc=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s3=class{static{o(this,"PriorityQueue")}constructor(){Gu.set(this,[])}enqueue(e,r){r={priority:0,...r};let n={priority:r.priority,run:e};if(this.size&&mc(this,Gu,"f")[this.size-1].priority>=r.priority){mc(this,Gu,"f").push(n);return}let i=o3(mc(this,Gu,"f"),n,(s,u)=>u.priority-s.priority);mc(this,Gu,"f").splice(i,0,n)}dequeue(){let e=mc(this,Gu,"f").shift();return e?.run}filter(e){return mc(this,Gu,"f").filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return mc(this,Gu,"f").length}};Gu=new WeakMap;jX=s3});var nn,Le,Cn,kD,BD,za,Sv,ID,Av,Es,PD,ho,bv,Do,ND,Ua,Rv,GX,UX,WX,zX,HX,Tv,u3,a3,Pv,VX,_v,kv,l3,KX,YX=y(()=>{NX();LX();qX();nn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kv=class extends Error{static{o(this,"AbortError")}},l3=class extends r3.default{static{o(this,"PQueue")}constructor(e){var r,n,i,s;if(super(),Cn.add(this),kD.set(this,void 0),BD.set(this,void 0),za.set(this,0),Sv.set(this,void 0),ID.set(this,void 0),Av.set(this,0),Es.set(this,void 0),PD.set(this,void 0),ho.set(this,void 0),bv.set(this,void 0),Do.set(this,0),ND.set(this,void 0),Ua.set(this,void 0),Rv.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:jX,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);nn(this,kD,e.carryoverConcurrencyCount,"f"),nn(this,BD,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),nn(this,Sv,e.intervalCap,"f"),nn(this,ID,e.interval,"f"),nn(this,ho,new e.queueClass,"f"),nn(this,bv,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,nn(this,Rv,e.throwOnTimeout===!0,"f"),nn(this,Ua,e.autoStart===!1,"f")}get concurrency(){return Le(this,ND,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);nn(this,ND,e,"f"),Le(this,Cn,"m",Pv).call(this)}async add(e,r={}){return r={timeout:this.timeout,throwOnTimeout:Le(this,Rv,"f"),...r},new Promise((n,i)=>{Le(this,ho,"f").enqueue(async()=>{var s,u,a;nn(this,Do,(u=Le(this,Do,"f"),u++,u),"f"),nn(this,za,(a=Le(this,za,"f"),a++,a),"f");try{if(!((s=r.signal)===null||s===void 0)&&s.aborted)throw new kv("The task was aborted.");let l=e({signal:r.signal});r.timeout&&(l=i3(Promise.resolve(l),r.timeout)),r.signal&&(l=Promise.race([l,Le(this,Cn,"m",VX).call(this,r.signal)]));let c=await l;n(c),this.emit("completed",c)}catch(l){if(l instanceof SD&&!r.throwOnTimeout){n();return}i(l),this.emit("error",l)}finally{Le(this,Cn,"m",WX).call(this)}},r),this.emit("add"),Le(this,Cn,"m",Tv).call(this)})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return Le(this,Ua,"f")?(nn(this,Ua,!1,"f"),Le(this,Cn,"m",Pv).call(this),this):this}pause(){nn(this,Ua,!0,"f")}clear(){nn(this,ho,new(Le(this,bv,"f")),"f")}async onEmpty(){Le(this,ho,"f").size!==0&&await Le(this,Cn,"m",_v).call(this,"empty")}async onSizeLessThan(e){Le(this,ho,"f").size<e||await Le(this,Cn,"m",_v).call(this,"next",()=>Le(this,ho,"f").size<e)}async onIdle(){Le(this,Do,"f")===0&&Le(this,ho,"f").size===0||await Le(this,Cn,"m",_v).call(this,"idle")}get size(){return Le(this,ho,"f").size}sizeBy(e){return Le(this,ho,"f").filter(e).length}get pending(){return Le(this,Do,"f")}get isPaused(){return Le(this,Ua,"f")}};kD=new WeakMap,BD=new WeakMap,za=new WeakMap,Sv=new WeakMap,ID=new WeakMap,Av=new WeakMap,Es=new WeakMap,PD=new WeakMap,ho=new WeakMap,bv=new WeakMap,Do=new WeakMap,ND=new WeakMap,Ua=new WeakMap,Rv=new WeakMap,Cn=new WeakSet,GX=o(function(){return Le(this,BD,"f")||Le(this,za,"f")<Le(this,Sv,"f")},"_PQueue_doesIntervalAllowAnother_get"),UX=o(function(){return Le(this,Do,"f")<Le(this,ND,"f")},"_PQueue_doesConcurrentAllowAnother_get"),WX=o(function(){var e;nn(this,Do,(e=Le(this,Do,"f"),e--,e),"f"),Le(this,Cn,"m",Tv).call(this),this.emit("next")},"_PQueue_next"),zX=o(function(){Le(this,Cn,"m",a3).call(this),Le(this,Cn,"m",u3).call(this),nn(this,PD,void 0,"f")},"_PQueue_onResumeInterval"),HX=o(function(){let e=Date.now();if(Le(this,Es,"f")===void 0){let r=Le(this,Av,"f")-e;if(r<0)nn(this,za,Le(this,kD,"f")?Le(this,Do,"f"):0,"f");else return Le(this,PD,"f")===void 0&&nn(this,PD,setTimeout(()=>{Le(this,Cn,"m",zX).call(this)},r),"f"),!0}return!1},"_PQueue_isIntervalPaused_get"),Tv=o(function(){if(Le(this,ho,"f").size===0)return Le(this,Es,"f")&&clearInterval(Le(this,Es,"f")),nn(this,Es,void 0,"f"),this.emit("empty"),Le(this,Do,"f")===0&&this.emit("idle"),!1;if(!Le(this,Ua,"f")){let e=!Le(this,Cn,"a",HX);if(Le(this,Cn,"a",GX)&&Le(this,Cn,"a",UX)){let r=Le(this,ho,"f").dequeue();return r?(this.emit("active"),r(),e&&Le(this,Cn,"m",u3).call(this),!0):!1}}return!1},"_PQueue_tryToStartAnother"),u3=o(function(){Le(this,BD,"f")||Le(this,Es,"f")!==void 0||(nn(this,Es,setInterval(()=>{Le(this,Cn,"m",a3).call(this)},Le(this,ID,"f")),"f"),nn(this,Av,Date.now()+Le(this,ID,"f"),"f"))},"_PQueue_initializeIntervalIfNeeded"),a3=o(function(){Le(this,za,"f")===0&&Le(this,Do,"f")===0&&Le(this,Es,"f")&&(clearInterval(Le(this,Es,"f")),nn(this,Es,void 0,"f")),nn(this,za,Le(this,kD,"f")?Le(this,Do,"f"):0,"f"),Le(this,Cn,"m",Pv).call(this)},"_PQueue_onInterval"),Pv=o(function(){for(;Le(this,Cn,"m",Tv).call(this););},"_PQueue_processQueue"),VX=o(async function(e){return new Promise((r,n)=>{e.addEventListener("abort",()=>{n(new kv("The task was aborted."))},{once:!0})})},"_PQueue_throwOnAbort"),_v=o(async function(e,r){return new Promise(n=>{let i=o(()=>{r&&!r()||(this.off(e,i),n())},"listener");this.on(e,i)})},"_PQueue_onEvent");KX=l3});var XX=O((oht,$we)=>{$we.exports=[{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var JX=O(go=>{"use strict";var ZX=XX(),On=process.env;Object.defineProperty(go,"_vendors",{value:ZX.map(function(t){return t.constant})});go.name=null;go.isPR=null;ZX.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return QX(n)});if(go[t.constant]=r,!!r)switch(go.name=t.name,typeof t.pr){case"string":go.isPR=!!On[t.pr];break;case"object":"env"in t.pr?go.isPR=t.pr.env in On&&On[t.pr.env]!==t.pr.ne:"any"in t.pr?go.isPR=t.pr.any.some(function(n){return!!On[n]}):go.isPR=QX(t.pr);break;default:go.isPR=null}});go.isCI=!!(On.CI!=="false"&&(On.BUILD_ID||On.BUILD_NUMBER||On.CI||On.CI_APP_ID||On.CI_BUILD_ID||On.CI_BUILD_NUMBER||On.CI_NAME||On.CONTINUOUS_INTEGRATION||On.RUN_ID||go.name));function QX(t){return typeof t=="string"?!!On[t]:"env"in t?On[t.env]&&On[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!On[e]}):Object.keys(t).every(function(e){return On[e]===t[e]})}o(QX,"checkEnv")});import Lwe from"node:net";import Mwe from"node:os";async function jp(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){let i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}OD===void 0&&(OD=setTimeout(()=>{OD=void 0,Mp.old=Mp.young,Mp.young=new Set},jwe),OD.unref&&OD.unref());let n=qwe();for(let i of Gwe(e))try{if(r.has(i))continue;let s=await tQ({...t,port:i},n);for(;Mp.old.has(s)||Mp.young.has(s);){if(i!==0)throw new Nv(i);s=await tQ({...t,port:i},n)}return Mp.young.add(s),s}catch(s){if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Nv))throw s}throw new Error("No available ports found")}function rQ(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Bv||t>Iv)throw new RangeError(`'from' must be between ${Bv} and ${Iv}`);if(e<Bv||e>Iv)throw new RangeError(`'to' must be between ${Bv} and ${Iv}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return o(function*(n,i){for(let s=n;s<=i;s++)yield s},"generator")(t,e)}var Nv,Mp,jwe,Bv,Iv,OD,qwe,eQ,tQ,Gwe,c3=y(()=>{Nv=class extends Error{static{o(this,"Locked")}constructor(e){super(`${e} is locked`)}},Mp={old:new Set,young:new Set},jwe=1e3*15,Bv=1024,Iv=65535,qwe=o(()=>{let t=Mwe.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(t))for(let n of r)e.add(n.address);return e},"getLocalHosts"),eQ=o(t=>new Promise((e,r)=>{let n=Lwe.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{let{port:i}=n.address();n.close(()=>{e(i)})})}),"checkAvailablePort"),tQ=o(async(t,e)=>{if(t.host||t.port===0)return eQ(t);for(let r of e)try{await eQ({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},"getAvailablePort"),Gwe=o(function*(t){t&&(yield*t),yield 0},"portCheckSequence");o(jp,"getPorts");o(rQ,"portNumbers")});import{mergeConfig as Uwe,preview as zwe}from"vite";async function Ov(t){let{isDev:e,...r}=await Lp(t),n=await jp({port:rQ(62001,62020)}),i=t?.open??!1;return await zwe(Uwe(r,{configFile:!1,mode:"production",preview:{host:"0.0.0.0",port:n,open:i}}))}var f3=y(()=>{"use strict";c3();vv();o(Ov,"vitePreview")});import{resolve as Hwe}from"node:path";function nQ({browser:t,pageUrl:e,outputDir:r,logger:n}){return o(async function(s){let a=e(s)+"e=e&padding=20";n.info(`${$v.default.dim("export")} ${s.id} ${$v.default.underline($v.default.dim(a))}`);let l=await t.newPage({deviceScaleFactor:2,viewport:{width:s.width+20*2,height:s.height+20*2}});try{await l.goto(a)}catch(f){f instanceof Error&&f.name==="TimeoutError"?n.error(`Timeout while loading page: ${a}`):n.error(`Page loading failed: ${a}
|
|
366
366
|
${f}`,{error:f}),await l.close();return}try{await l.waitForLoadState(),await l.waitForLoadState("networkidle",{timeout:1e4})}catch(f){n.error(`Timeout while waiting for page load state: ${a}
|
|
367
367
|
${f}`,{error:f}),await l.close();return}let c=Hwe(r,s.relativePath??".",`${s.id}.png`);try{await l.screenshot({path:c,animations:"disabled",timeout:1e4,omitBackground:!0})}catch(f){n.error(`Error when taking screenshot: ${a}
|
|
368
368
|
${f}`,{error:f}),await l.close();return}},"takeScreenshot")}var $v,iQ=y(()=>{"use strict";$v=le(Qi(),1);o(nQ,"mkTakeScreenshotFn")});var sQ={};Ka(sQ,{handler:()=>Xwe});import{rm as Wwe}from"fs/promises";import{availableParallelism as Vwe}from"node:os";import{resolve as Kwe}from"node:path";import{chromium as Ywe}from"playwright-core";async function Xwe({path:t,output:e}){let r=qa("c4:export"),n=hv(r),i=await qo.get({workspaceDir:t}),s=await i.getViews();s.length===0&&(r.warn("no views found"),process.exit(0));let u=Kwe(e,".build-cache");r.info("build"),await xv({languageServices:i,outputDir:u}),r.info("start preview server");let a=await Ov({languageServices:i,outputDir:u,open:!1});a.resolvedUrls;let l=oQ.isCI?"172.17.0.1":"localhost",c=o(w=>`http://${l}:${a.config.preview.port}/export/${encodeURIComponent(w.id)}?`,"pageUrl");r.info("start chromium");let f=await Ywe.launch(),d=nQ({browser:f,pageUrl:c,outputDir:e,logger:r}),h=Vwe();r.info(`${d3.default.dim("concurrency")} ${h}`),r.info(`${d3.default.dim("output")} ${e}`),await new KX({concurrency:h}).addAll(s.map(w=>()=>d(w)),{throwOnTimeout:!0,timeout:6e4}),await Wwe(u,{recursive:!0,force:!0}),r.info("close browser"),await f.close(),r.info("stop preview server"),await new Promise((w,E)=>{a.httpServer.close(F=>F?E(F):w())}),n.stopAndLog("\u2713 export in ")}var d3,oQ,uQ=y(()=>{"use strict";YX();d3=le(Qi(),1),oQ=le(JX(),1);fc();wD();ZS();f3();iQ();o(Xwe,"handler")});function h3({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var cQ=y(()=>{o(h3,"ansiRegex")});function D3(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Jwe,"")}var Jwe,fQ=y(()=>{cQ();Jwe=h3();o(D3,"stripAnsi")});var Lv=O((jht,g3)=>{var Ha={};typeof g3>"u"?window.eastasianwidth=Ha:g3.exports=Ha;Ha.eastAsianWidth=function(t){var e=t.charCodeAt(0),r=t.length==2?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=r&&r<=57343&&(e&=1023,r&=1023,n=e<<10|r,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};Ha.characterLength=function(t){var e=this.eastAsianWidth(t);return e=="F"||e=="W"||e=="A"?2:1};function dQ(t){return t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}o(dQ,"stringToArray");Ha.length=function(t){for(var e=dQ(t),r=0,n=0;n<e.length;n++)r=r+this.characterLength(e[n]);return r};Ha.slice=function(t,e,r){textLen=Ha.length(t),e=e||0,r=r||1,e<0&&(e=textLen+e),r<0&&(r=textLen+r);for(var n="",i=0,s=dQ(t),u=0;u<s.length;u++){var a=s[u],l=Ha.length(a);if(i>=e-(l==2?1:0))if(i+l<=r)n+=a;else break;i+=l}return n}});var mQ=O((Ght,pQ)=>{"use strict";pQ.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});function Ys(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=D3(t),t.length===0))return 0;t=t.replace((0,DQ.default)()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(s<=31||s>=127&&s<=159||s>=768&&s<=879)continue;switch(hQ.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var hQ,DQ,gQ=y(()=>{fQ();hQ=le(Lv(),1),DQ=le(mQ(),1);o(Ys,"stringWidth")});function r2e(){let t=new Map;for(let[e,r]of Object.entries(Vr)){for(let[n,i]of Object.entries(r))Vr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Vr[n],t.set(i[0],i[1]);Object.defineProperty(Vr,e,{value:r,enumerable:!1})}return Object.defineProperty(Vr,"codes",{value:t,enumerable:!1}),Vr.color.close="\x1B[39m",Vr.bgColor.close="\x1B[49m",Vr.color.ansi=yQ(),Vr.color.ansi256=EQ(),Vr.color.ansi16m=CQ(),Vr.bgColor.ansi=yQ(10),Vr.bgColor.ansi256=EQ(10),Vr.bgColor.ansi16m=CQ(10),Object.defineProperties(Vr,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Vr.rgbToAnsi256(...Vr.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let u=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Vr.ansi256ToAnsi(Vr.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Vr.ansi256ToAnsi(Vr.hexToAnsi256(e)),enumerable:!1}}),Vr}var yQ,EQ,CQ,Vr,Wht,e2e,t2e,Vht,n2e,Cs,FQ=y(()=>{yQ=o((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),EQ=o((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),CQ=o((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Vr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Wht=Object.keys(Vr.modifier),e2e=Object.keys(Vr.color),t2e=Object.keys(Vr.bgColor),Vht=[...e2e,...t2e];o(r2e,"assembleStyles");n2e=r2e(),Cs=n2e});import y3 from"node:process";import i2e from"node:os";import vQ from"node:tty";function Go(t,e=globalThis.Deno?globalThis.Deno.args:y3.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}function o2e(){if("FORCE_COLOR"in on)return on.FORCE_COLOR==="true"?1:on.FORCE_COLOR==="false"?0:on.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(on.FORCE_COLOR,10),3)}function s2e(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function u2e(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=o2e();n!==void 0&&(Mv=n);let i=r?Mv:n;if(i===0)return 0;if(r){if(Go("color=16m")||Go("color=full")||Go("color=truecolor"))return 3;if(Go("color=256"))return 2}if("TF_BUILD"in on&&"AGENT_NAME"in on)return 1;if(t&&!e&&i===void 0)return 0;let s=i||0;if(on.TERM==="dumb")return s;if(y3.platform==="win32"){let u=i2e.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in on)return"GITHUB_ACTIONS"in on||"GITEA_ACTIONS"in on?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in on)||on.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in on)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(on.TEAMCITY_VERSION)?1:0;if(on.COLORTERM==="truecolor"||on.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in on){let u=Number.parseInt((on.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(on.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(on.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(on.TERM)||"COLORTERM"in on?1:s}function xQ(t,e={}){let r=u2e(t,{streamIsTTY:t&&t.isTTY,...e});return s2e(r)}var on,Mv,a2e,wQ,AQ=y(()=>{o(Go,"hasFlag");({env:on}=y3);Go("no-color")||Go("no-colors")||Go("color=false")||Go("color=never")?Mv=0:(Go("color")||Go("colors")||Go("color=true")||Go("color=always"))&&(Mv=1);o(o2e,"envForceColor");o(s2e,"translateLevel");o(u2e,"_supportsColor");o(xQ,"createSupportsColor");a2e={stdout:xQ({isTTY:vQ.isatty(1)}),stderr:xQ({isTTY:vQ.isatty(2)})},wQ=a2e});function bQ(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,s=0,u="";do u+=t.slice(s,n)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return u+=t.slice(s),u}function RQ(t,e,r,n){let i=0,s="";do{let u=t[n-1]==="\r";s+=t.slice(i,u?n-1:n)+e+(u?`\r
|
|
@@ -383,7 +383,7 @@ ${f}`,{error:f}),await l.close();return}},"takeScreenshot")}var $v,iQ=y(()=>{"us
|
|
|
383
383
|
`+"".padEnd(8," "));e+=`
|
|
384
384
|
|
|
385
385
|
`,e+=M3.default.dim("Remote: ")+t.resolvedUrls.network.join(`
|
|
386
|
-
`+"".padEnd(8," ")),console.log(L3(e,{padding:1,margin:1,title:"LikeC4 served at:",borderStyle:"round",borderColor:"yellow"}))}var M3,j3=y(()=>{"use strict";RZ();M3=le(Qi(),1);o(Hv,"printServerUrls")});var TZ={};Ka(TZ,{handler:()=>Y2e});async function Y2e({path:t,output:e,...r}){let n=await qo.get({workspaceDir:t}),i=await Ov({...r,languageServices:n,outputDir:e,open:!0});Hv(i)}var _Z=y(()=>{"use strict";fc();j3();f3();o(Y2e,"handler")});var zp={};Ka(zp,{handler:()=>rAe});import{mkdir as GD,writeFile as G3}from"node:fs/promises";import{dirname as Q2e,extname as Z2e,relative as U3,resolve as UD}from"node:path";async function J2e(t,e,r,n){let i=e==="react"?".tsx":".ts";r=r??UD(t.workspace,"likec4.generated"+i),Z2e(r)!==i&&(r=r+i),await GD(Q2e(r),{recursive:!0});let s=await t.getViews(),a=(e==="react"?GS:VS)(s);await G3(r,a),n.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),r)}`)}async function eAe(t,e,r){await GD(e,{recursive:!0}),r.info(`${Uo.default.dim("format")} ${Uo.default.green("dot")}`),r.info(`${Uo.default.dim("outdir")} ${e}`);let n=new Set,i=t.getModel()?.views;if(!i)throw new Error("no views found");let s=0;for(let u of Object.values(i))try{let a=u.relativePath??"";a!==""&&!n.has(a)&&(await GD(UD(e,a),{recursive:!0}),n.add(a));let l=UD(e,a,u.id+".dot"),c=CD(u);await G3(l,c),r.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),l)}`),s++}catch(a){r.error(`error while generating ${u.id}`,{error:a})}s>0&&r.info(`${Uo.default.dim("total")} ${s} files`)}async function tAe(t,e,r,n){await GD(r,{recursive:!0}),n.info(`${Uo.default.dim("format")} ${Uo.default.green(e)}`),n.info(`${Uo.default.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=zS;break;case"mermaid":i=".mmd",s=HS;break;default:un(e)}let u=new Set,a=await t.getViews(),l=0;for(let c of a)try{let f=c.relativePath??"";f!==""&&!u.has(f)&&(await GD(UD(r,f),{recursive:!0}),u.add(f));let d=UD(r,f,c.id+i),h=s(c);await G3(d,h),n.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),d)}`),l++}catch(f){n.error(`error while generating ${c.id}`,{error:f})}l>0&&n.info(`${Uo.default.dim("total")} ${l} files`)}async function rAe({path:t,...e}){let r=qa("c4:codegen"),n=hv(r),i=await qo.get({workspaceDir:t}),s=i.getModel()?.views;switch((!s||Object.keys(s).length===0)&&(r.warn("no views found"),process.exit(0)),e.format){case"react":case"views":{await J2e(i,e.format,e.outfile,r);break}case"dot":{await eAe(i,e.outdir??t,r);break}case"d2":case"mermaid":{await tAe(i,e.format,e.outdir??t,r);break}default:un(e)}n.stopAndLog()}var Uo,Hp=y(()=>{"use strict";vr();KS();bS();Uo=le(Qi(),1);fc();wD();o(J2e,"singleFileCodegenAction");o(eAe,"dotCodegenAction");o(tAe,"multipleFilesCodegenAction");o(rAe,"handler")});import{createServer as iAe,mergeConfig as oAe,searchForWorkspaceRoot as sAe}from"vite";var BZ,IZ=y(()=>{"use strict";c3();vv();BZ=o(async t=>{let
|
|
386
|
+
`+"".padEnd(8," ")),console.log(L3(e,{padding:1,margin:1,title:"LikeC4 served at:",borderStyle:"round",borderColor:"yellow"}))}var M3,j3=y(()=>{"use strict";RZ();M3=le(Qi(),1);o(Hv,"printServerUrls")});var TZ={};Ka(TZ,{handler:()=>Y2e});async function Y2e({path:t,output:e,...r}){let n=await qo.get({workspaceDir:t}),i=await Ov({...r,languageServices:n,outputDir:e,open:!0});Hv(i)}var _Z=y(()=>{"use strict";fc();j3();f3();o(Y2e,"handler")});var zp={};Ka(zp,{handler:()=>rAe});import{mkdir as GD,writeFile as G3}from"node:fs/promises";import{dirname as Q2e,extname as Z2e,relative as U3,resolve as UD}from"node:path";async function J2e(t,e,r,n){let i=e==="react"?".tsx":".ts";r=r??UD(t.workspace,"likec4.generated"+i),Z2e(r)!==i&&(r=r+i),await GD(Q2e(r),{recursive:!0});let s=await t.getViews(),a=(e==="react"?GS:VS)(s);await G3(r,a),n.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),r)}`)}async function eAe(t,e,r){await GD(e,{recursive:!0}),r.info(`${Uo.default.dim("format")} ${Uo.default.green("dot")}`),r.info(`${Uo.default.dim("outdir")} ${e}`);let n=new Set,i=t.getModel()?.views;if(!i)throw new Error("no views found");let s=0;for(let u of Object.values(i))try{let a=u.relativePath??"";a!==""&&!n.has(a)&&(await GD(UD(e,a),{recursive:!0}),n.add(a));let l=UD(e,a,u.id+".dot"),c=CD(u);await G3(l,c),r.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),l)}`),s++}catch(a){r.error(`error while generating ${u.id}`,{error:a})}s>0&&r.info(`${Uo.default.dim("total")} ${s} files`)}async function tAe(t,e,r,n){await GD(r,{recursive:!0}),n.info(`${Uo.default.dim("format")} ${Uo.default.green(e)}`),n.info(`${Uo.default.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=zS;break;case"mermaid":i=".mmd",s=HS;break;default:un(e)}let u=new Set,a=await t.getViews(),l=0;for(let c of a)try{let f=c.relativePath??"";f!==""&&!u.has(f)&&(await GD(UD(r,f),{recursive:!0}),u.add(f));let d=UD(r,f,c.id+i),h=s(c);await G3(d,h),n.info(`${Uo.default.dim("generated")} ${U3(process.cwd(),d)}`),l++}catch(f){n.error(`error while generating ${c.id}`,{error:f})}l>0&&n.info(`${Uo.default.dim("total")} ${l} files`)}async function rAe({path:t,...e}){let r=qa("c4:codegen"),n=hv(r),i=await qo.get({workspaceDir:t}),s=i.getModel()?.views;switch((!s||Object.keys(s).length===0)&&(r.warn("no views found"),process.exit(0)),e.format){case"react":case"views":{await J2e(i,e.format,e.outfile,r);break}case"dot":{await eAe(i,e.outdir??t,r);break}case"d2":case"mermaid":{await tAe(i,e.format,e.outdir??t,r);break}default:un(e)}n.stopAndLog()}var Uo,Hp=y(()=>{"use strict";vr();KS();bS();Uo=le(Qi(),1);fc();wD();o(J2e,"singleFileCodegenAction");o(eAe,"dotCodegenAction");o(tAe,"multipleFilesCodegenAction");o(rAe,"handler")});import{createServer as iAe,mergeConfig as oAe,searchForWorkspaceRoot as sAe}from"vite";var BZ,IZ=y(()=>{"use strict";c3();vv();BZ=o(async t=>{let{isDev:e,...r}=await Lp(t),n=await jp({port:[5173,61e3,61001,62002,62003,62004,62005]}),i=await jp({port:[24678,24679,24680,24681,24682,24683,24684,24685]}),s=await iAe(oAe(r,{configFile:!1,mode:"development",server:{host:"0.0.0.0",port:n,hmr:{host:"localhost",port:i},fs:{allow:[sAe(process.cwd()),r.root,r.languageServices.workspace]},open:!0}}));if(!r.languageServices.workspace.startsWith(r.root)){let u=r.languageServices.workspace;s.config.logger.info(`add to watcher: ${u}`),s.watcher.add(u)}return await s.listen(),s.config.logger.clearScreen("info"),s},"viteDev")});var NZ={};Ka(NZ,{handler:()=>uAe});async function uAe({path:t,...e}){let r=await qo.get({workspaceDir:t}),n=await BZ({...e,languageServices:r});Hv(n)}var OZ=y(()=>{"use strict";fc();j3();IZ();o(uAe,"handler")});var zD=le(Qi(),1),MZ=le(Js(),1);import{notStrictEqual as pre,strictEqual as mre}from"assert";var Ute={right:Kte,center:Yte},zte=0,fg=1,Hte=2,dg=3,Tx=class{static{o(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
|
|
387
387
|
`).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Zi.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Zi.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((s,u)=>({text:s.trim(),padding:this.measurePadding(s),width:u===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Zi.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
|
|
388
388
|
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((u,a)=>{let{width:l}=e[a],c=this.negatePadding(e[a]),f=u;if(c>Zi.stringWidth(u)&&(f+=" ".repeat(c-Zi.stringWidth(u))),e[a].align&&e[a].align!=="left"&&this.wrap){let h=Ute[e[a].align];f=h(f,c),Zi.stringWidth(f)<c&&(f+=" ".repeat((l||0)-Zi.stringWidth(f)-1))}let d=e[a].padding||[0,0,0,0];d[dg]&&(s+=" ".repeat(d[dg])),s+=Sk(e[a],f,"| "),s+=f,s+=Sk(e[a],f," |"),d[fg]&&(s+=" ".repeat(d[fg])),i===0&&r.length>0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,s=r.text,u=Zi.stringWidth(s.trimRight());return r.span?this.wrap?i<u?e:(r.hidden=!0,s.trimRight()+" ".repeat(i-u)+e.trimLeft()):(r.hidden=!0,s+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((s,u)=>{s.width=n[u],this.wrap?i=Zi.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
389
389
|
`):i=s.text.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"vite": "^4.5.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@likec4/core": "0.42.
|
|
85
|
-
"@likec4/diagrams": "0.42.
|
|
86
|
-
"@likec4/generators": "0.42.
|
|
87
|
-
"@likec4/language-server": "0.42.
|
|
88
|
-
"@likec4/layouts": "0.42.
|
|
84
|
+
"@likec4/core": "0.42.1",
|
|
85
|
+
"@likec4/diagrams": "0.42.1",
|
|
86
|
+
"@likec4/generators": "0.42.1",
|
|
87
|
+
"@likec4/language-server": "0.42.1",
|
|
88
|
+
"@likec4/layouts": "0.42.1",
|
|
89
89
|
"@types/node": "^20.8.7",
|
|
90
90
|
"@types/prop-types": "^15.7.9",
|
|
91
91
|
"@types/react": "^18.2.0",
|