jinrai 1.0.4 → 1.0.6

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.
Files changed (74) hide show
  1. package/config.ts +1 -0
  2. package/front.config.json +24 -0
  3. package/index.ts +6 -1
  4. package/lib/bin/bin.js +12 -0
  5. package/lib/config/config.d.ts +1 -0
  6. package/lib/config/config.js +1 -0
  7. package/lib/{src → config/src/bin}/config/userConfig.d.ts +0 -2
  8. package/lib/index.d.ts +6 -1
  9. package/lib/index.js +6 -1
  10. package/lib/src/front/server-state/DataProxy.d.ts +8 -0
  11. package/lib/src/front/server-state/DataProxy.js +104 -0
  12. package/lib/src/front/server-state/SSR.d.ts +4 -0
  13. package/lib/src/front/server-state/SSR.js +6 -0
  14. package/lib/src/front/server-state/real.d.ts +1 -0
  15. package/lib/src/front/server-state/real.js +36 -0
  16. package/lib/src/front/server-state/serverStates.d.ts +5 -0
  17. package/lib/src/front/server-state/serverStates.js +29 -0
  18. package/lib/src/front/server-state/useServerState.d.ts +10 -0
  19. package/lib/src/front/server-state/useServerState.js +28 -0
  20. package/lib/src/front/url/JinraiContext.d.ts +6 -0
  21. package/lib/src/front/url/JinraiContext.js +8 -0
  22. package/lib/src/front/url/adapter/def.d.ts +2 -0
  23. package/lib/src/front/url/adapter/def.js +9 -0
  24. package/lib/src/front/url/adapter/rrd6.d.ts +2 -0
  25. package/lib/src/front/url/adapter/rrd6.js +12 -0
  26. package/lib/src/front/url/adapter/rrd7.d.ts +2 -0
  27. package/lib/src/front/url/adapter/rrd7.js +11 -0
  28. package/lib/src/front/url/params/useParamsIndex.d.ts +1 -0
  29. package/lib/src/front/url/params/useParamsIndex.js +15 -0
  30. package/lib/src/front/url/search/useSearch.d.ts +1 -0
  31. package/lib/src/front/url/search/useSearch.js +15 -0
  32. package/lib/src/front/url/search/useSearchValue.d.ts +16 -0
  33. package/lib/src/front/url/search/useSearchValue.js +49 -0
  34. package/lib/src/front/wrapper/Custom.d.ts +8 -0
  35. package/lib/src/front/wrapper/Custom.js +9 -0
  36. package/lib/vite/plugin.js +1 -0
  37. package/package.json +38 -6
  38. package/readme.md +11 -0
  39. package/rollup.front.config.mjs +57 -0
  40. package/src/bin/bin.ts +10 -0
  41. package/src/bin/build/build.ts +69 -0
  42. package/src/{config → bin/config}/userConfig.ts +0 -2
  43. package/src/bin/playwright/pageCollector.ts +11 -0
  44. package/src/{templates.ts → bin/playwright/templates.ts} +16 -25
  45. package/src/{routes → bin/routes}/Parser.ts +3 -3
  46. package/src/{routes → bin/routes}/getRoutes.ts +4 -4
  47. package/src/front/server-state/DataProxy.ts +120 -0
  48. package/src/front/server-state/SSR.ts +4 -0
  49. package/src/front/server-state/real.ts +41 -0
  50. package/src/front/server-state/serverStates.ts +36 -0
  51. package/src/front/server-state/useServerState.ts +44 -0
  52. package/src/front/url/JinraiContext.tsx +10 -0
  53. package/src/front/url/adapter/def.tsx +10 -0
  54. package/src/front/url/adapter/rrd6.tsx +16 -0
  55. package/src/front/url/adapter/rrd7.tsx +15 -0
  56. package/src/front/url/params/useParamsIndex.ts +16 -0
  57. package/src/front/url/search/useSearch.ts +15 -0
  58. package/src/front/url/search/useSearchValue.ts +72 -0
  59. package/src/front/wrapper/Custom.tsx +14 -0
  60. package/tests/custom.test.ts +2 -2
  61. package/tests/parse.test.ts +3 -3
  62. package/tsconfig.json +2 -2
  63. package/vite/plugin.ts +83 -0
  64. package/lib/bin.js +0 -12
  65. package/lib/generate.js +0 -26
  66. package/src/bin.ts +0 -66
  67. /package/lib/{src → config/src/bin}/config/define.d.ts +0 -0
  68. /package/src/{config → bin/config}/defaultIndexHtml.ts +0 -0
  69. /package/src/{config → bin/config}/define.ts +0 -0
  70. /package/src/{content/normolizeContent.ts → bin/content/normalizeContent.ts} +0 -0
  71. /package/src/{routes → bin/routes}/replaceDevScripts.ts +0 -0
  72. /package/src/{server → bin/server}/vitePreview.ts +0 -0
  73. /package/src/{types → bin/types}/shims.d.ts +0 -0
  74. /package/src/{ui → bin/ui}/task.tsx +0 -0
package/config.ts ADDED
@@ -0,0 +1 @@
1
+ export { defineConfig } from "./src/bin/config/define"
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "outDir": "./lib",
6
+ "moduleResolution": "node",
7
+ "declaration": true,
8
+ "esModuleInterop": true,
9
+ "jsx": "react-jsx",
10
+
11
+ "baseUrl": ".",
12
+ "paths": {
13
+ "react": ["node_modules/react"],
14
+ "react-dom": ["node_modules/react-dom"]
15
+ },
16
+ "skipLibCheck": true
17
+ },
18
+ "include": [
19
+ "index.ts",
20
+ "src/front/url/adapter/rrd6.tsx",
21
+ "src/front/url/adapter/rrd7.tsx",
22
+ "src/front/url/adapter/def.tsx"
23
+ ]
24
+ }
package/index.ts CHANGED
@@ -1 +1,6 @@
1
- export { defineConfig } from "./src/config/define"
1
+ export { useServerState } from "./src/front/server-state/useServerState"
2
+ export { real } from "./src/front/server-state/real"
3
+ export { useParamsIndex } from "./src/front/url/params/useParamsIndex"
4
+ export { useSearchValue, useSearchArray } from "./src/front/url/search/useSearchValue"
5
+ export { useSearch } from "./src/front/url/search/useSearch"
6
+ export { Custom } from "./src/front/wrapper/Custom"
package/lib/bin/bin.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ var qt=Object.defineProperty;var zt=(t,e)=>{for(var r in e)qt(t,r,{get:e[r],enumerable:!0})};import{writeFile as ct}from"node:fs/promises";import{createJiti as Kt}from"jiti";import{pathToFileURL as Jt}from"url";import{resolve as Xt}from"path";var ft=async t=>{let e=Kt(import.meta.url,{debug:!1}),r=Jt(Xt(process.cwd(),t)).href;return(await e.import(r)).default};var O=t=>t.replace(/\r?\n|\r/g," ").replace(/\s+/g," ").replace(/>\s+</g,"><").trim();import{createHash as Zt}from"node:crypto";var S=class{options;openVar="{{";createVar="}}";createArray="</loopwrapper";createCustom="</custom";deepUp="<loopwrapper";deepUp2="<custom";templates={};constructor(e){this.options=e}parse(e){let r=[];return this.handle(this.options?.normalize?O(e):e,r),r}handle(e,r){let i,s=0,n=0,o=new RegExp("(<loopwrapper(\\s+[^>]*)?>|</loopwrapper>|{{|}}|<custom(\\s+[^>]*)?>|</custom>)","gi");for(;(i=o.exec(e))!==null;){let l=i[0],u=e.substring(n,i.index);if(l.startsWith(this.createArray)){if(s--,s>0)continue;this.createElement(r,u)}else if(l.startsWith(this.deepUp)){if(s++,s>1)continue;this.createElement(r,u)}else if(l.startsWith(this.createCustom)){if(s--,s!=0)continue;this.createCustomElement(r,u)}else if(l.startsWith(this.deepUp2)){if(s++,s>1)continue;this.createElement(r,u)}else if(l==this.createVar){if(s!=0)continue;this.createElement(r,u,!0)}else{if(s!=0)continue;this.createElement(r,u)}n=i.index+l.length}if(n<e.length){let l=e.substring(n);this.createElement(r,l)}}createCustomElement(e,r){let[i,...s]=r.trimStart().split("|");r=s.join("|"),e.push({type:"custom",name:i,props:r})}createElement(e,r,i){if(i)return e.push({type:"value",key:r});if(r.trimStart().startsWith("ArrayDataKey=")){let[s,...n]=r.trimStart().substring(13).split("|");r=n.join("|");let o=[];return this.handle(r,o),e.push({type:"array",data:o,key:s})}r&&e.push({type:"html",content:this.options?.templates?this.createTemplate(r):r})}createTemplate(e){return e in this.templates||(this.templates[e]=Zt("md5").update(Object.keys(this.templates).length.toString()).digest("hex")),this.templates[e]}};var ut=(t,e=!0,r=!0)=>{let i=[],s=new S({normalize:e,templates:r});for(let[n,o]of t.entries()){let l=s.parse(o.root),u=o.mask.replaceAll("/","\\/").replace(/{(.*?)}/,".+?");i.push({id:n,content:l,mask:u,requests:o.input})}return{routes:i,templates:s.templates}};import{chromium as Lt}from"playwright";import L from"node:process";var mt=(t=0)=>e=>`\x1B[${e+t}m`,ht=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,pt=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,c={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]}},ar=Object.keys(c.modifier),Qt=Object.keys(c.color),te=Object.keys(c.bgColor),lr=[...Qt,...te];function ee(){let t=new Map;for(let[e,r]of Object.entries(c)){for(let[i,s]of Object.entries(r))c[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=c[i],t.set(s[0],s[1]);Object.defineProperty(c,e,{value:r,enumerable:!1})}return Object.defineProperty(c,"codes",{value:t,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",c.color.ansi=mt(),c.color.ansi256=ht(),c.color.ansi16m=pt(),c.bgColor.ansi=mt(10),c.bgColor.ansi256=ht(10),c.bgColor.ansi16m=pt(10),Object.defineProperties(c,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?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(i/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[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>c.rgbToAnsi256(...c.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,i=Math.floor(l/6)/5,s=l%6/5}let n=Math.max(r,i,s)*2;if(n===0)return 30;let o=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>c.ansi256ToAnsi(c.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>c.ansi256ToAnsi(c.hexToAnsi256(e)),enumerable:!1}}),c}var re=ee(),p=re;import U from"node:process";import ie from"node:os";import dt from"node:tty";function m(t,e=globalThis.Deno?globalThis.Deno.args:U.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:f}=U,R;m("no-color")||m("no-colors")||m("color=false")||m("color=never")?R=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(R=1);function se(){if("FORCE_COLOR"in f)return f.FORCE_COLOR==="true"?1:f.FORCE_COLOR==="false"?0:f.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(f.FORCE_COLOR,10),3)}function ne(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function oe(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=se();i!==void 0&&(R=i);let s=r?R:i;if(s===0)return 0;if(r){if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2}if("TF_BUILD"in f&&"AGENT_NAME"in f)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(f.TERM==="dumb")return n;if(U.platform==="win32"){let o=ie.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in f)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in f)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in f)||f.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor"||f.TERM==="xterm-kitty"||f.TERM==="xterm-ghostty"||f.TERM==="wezterm")return 3;if("TERM_PROGRAM"in f){let o=Number.parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:n}function gt(t,e={}){let r=oe(t,{streamIsTTY:t&&t.isTTY,...e});return ne(r)}var ae={stdout:gt({isTTY:dt.isatty(1)}),stderr:gt({isTTY:dt.isatty(2)})},_t=ae;function Ft(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,o="";do o+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return o+=t.slice(n),o}function xt(t,e,r,i){let s=0,n="";do{let o=t[i-1]==="\r";n+=t.slice(s,o?i-1:i)+e+(o?`\r
3
+ `:`
4
+ `)+r,s=i+1,i=t.indexOf(`
5
+ `,s)}while(i!==-1);return n+=t.slice(s),n}var{stdout:bt,stderr:Et}=_t,$=Symbol("GENERATOR"),C=Symbol("STYLER"),w=Symbol("IS_EMPTY"),Ct=["ansi","ansi","ansi256","ansi16m"],y=Object.create(null),le=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=bt?bt.level:0;t.level=e.level===void 0?r:e.level};var ce=t=>{let e=(...r)=>r.join(" ");return le(e,t),Object.setPrototypeOf(e,T.prototype),e};function T(t){return ce(t)}Object.setPrototypeOf(T.prototype,Function.prototype);for(let[t,e]of Object.entries(p))y[t]={get(){let r=D(this,H(e.open,e.close,this[C]),this[w]);return Object.defineProperty(this,t,{value:r}),r}};y.visible={get(){let t=D(this,this[C],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Y=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?p[r].ansi16m(...i):e==="ansi256"?p[r].ansi256(p.rgbToAnsi256(...i)):p[r].ansi(p.rgbToAnsi(...i)):t==="hex"?Y("rgb",e,r,...p.hexToRgb(...i)):p[r][t](...i),fe=["rgb","hex","ansi256"];for(let t of fe){y[t]={get(){let{level:r}=this;return function(...i){let s=H(Y(t,Ct[r],"color",...i),p.color.close,this[C]);return D(this,s,this[w])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);y[e]={get(){let{level:r}=this;return function(...i){let s=H(Y(t,Ct[r],"bgColor",...i),p.bgColor.close,this[C]);return D(this,s,this[w])}}}}var ue=Object.defineProperties(()=>{},{...y,level:{enumerable:!0,get(){return this[$].level},set(t){this[$].level=t}}}),H=(t,e,r)=>{let i,s;return r===void 0?(i=t,s=e):(i=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:s,parent:r}},D=(t,e,r)=>{let i=(...s)=>me(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,ue),i[$]=t,i[C]=e,i[w]=r,i},me=(t,e)=>{if(t.level<=0||!e)return t[w]?"":e;let r=t[C];if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Ft(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
6
+ `);return n!==-1&&(e=xt(e,s,i,n)),i+e+s};Object.defineProperties(T.prototype,y);var he=T(),Fr=T({level:Et?Et.level:0});var yt=he;import Ot from"node:process";import N from"node:process";var pe=(t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!de(s,n)&&i||Object.defineProperty(t,r,n)},de=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},ge=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},_e=(t,e)=>`/* Wrapped ${t}*/
7
+ ${e}`,Fe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),be=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=_e.bind(null,i,e.toString());Object.defineProperty(s,"name",xe);let{writable:n,enumerable:o,configurable:l}=Fe;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:o,configurable:l})};function V(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))pe(t,e,s,r);return ge(t,e),be(t,e,i),t}var I=new WeakMap,vt=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...o){if(I.set(n,++i),i===1)r=t.apply(this,o),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return V(n,t),I.set(n,i),n};vt.callCount=t=>{if(!I.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return I.get(t)};var wt=vt;var x=[];x.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&x.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&x.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var P=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",q=Symbol.for("signal-exit emitter"),z=globalThis,Ee=Object.defineProperty.bind(Object),K=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(z[q])return z[q];Ee(z,q,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let i=this.listeners[e],s=i.indexOf(r);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let n of this.listeners[e])s=n(r,i)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,i)||s),s}},M=class{},Ce=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),J=class extends M{onExit(){return()=>{}}load(){}unload(){}},X=class extends M{#n=Z.platform==="win32"?"SIGINT":"SIGHUP";#i=new K;#t;#s;#h;#u={};#e=!1;constructor(e){super(),this.#t=e,this.#u={};for(let r of x)this.#u[r]=()=>{let i=this.#t.listeners(r),{count:s}=this.#i,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let o=this.#i.emit("exit",null,r),l=r==="SIGHUP"?this.#n:r;o||e.kill(e.pid,l)}};this.#h=e.reallyExit,this.#s=e.emit}onExit(e,r){if(!P(this.#t))return()=>{};this.#e===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#i.on(i,e),()=>{this.#i.removeListener(i,e),this.#i.listeners.exit.length===0&&this.#i.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#e){this.#e=!0,this.#i.count+=1;for(let e of x)try{let r=this.#u[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#r(e,...r),this.#t.reallyExit=e=>this.#o(e)}}unload(){this.#e&&(this.#e=!1,x.forEach(e=>{let r=this.#u[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#s,this.#t.reallyExit=this.#h,this.#i.count-=1)}#o(e){return P(this.#t)?(this.#t.exitCode=e||0,this.#i.emit("exit",this.#t.exitCode,null),this.#h.call(this.#t,this.#t.exitCode)):0}#r(e,...r){let i=this.#s;if(e==="exit"&&P(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let s=i.call(this.#t,e,...r);return this.#i.emit("exit",this.#t.exitCode,null),s}else return i.call(this.#t,e,...r)}},Z=globalThis.process,{onExit:Tt,load:wr,unload:Tr}=Ce(P(Z)?new X(Z):new J);var At=N.stderr.isTTY?N.stderr:N.stdout.isTTY?N.stdout:void 0,ye=At?wt(()=>{Tt(()=>{At.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Bt=ye;var j=!1,v={};v.show=(t=Ot.stderr)=>{t.isTTY&&(j=!1,t.write("\x1B[?25h"))};v.hide=(t=Ot.stderr)=>{t.isTTY&&(Bt(),j=!0,t.write("\x1B[?25l"))};v.toggle=(t,e)=>{t!==void 0&&(j=t),j?v.show(e):v.hide(e)};var Q=v;var tt={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var _=tt,jr=Object.keys(tt);var b={};zt(b,{error:()=>Se,info:()=>Ae,success:()=>Be,warning:()=>Oe});import we from"node:tty";var Te=we?.WriteStream?.prototype?.hasColors?.()??!1,a=(t,e)=>{if(!Te)return s=>s;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return s=>{let n=s+"",o=n.indexOf(i);if(o===-1)return r+n+i;let l=r,u=0,g=(e===22?i:"")+r;for(;o!==-1;)l+=n.slice(u,o)+g,u=o+i.length,o=n.indexOf(i,u);return l+=n.slice(u)+i,l}},Gr=a(0,0),Wr=a(1,22),Ur=a(2,22),$r=a(3,23),Yr=a(4,24),Hr=a(53,55),Vr=a(7,27),qr=a(8,28),zr=a(9,29),Kr=a(30,39),St=a(31,39),Rt=a(32,39),Dt=a(33,39),It=a(34,39),Jr=a(35,39),Xr=a(36,39),Zr=a(37,39),Qr=a(90,39),ti=a(40,49),ei=a(41,49),ri=a(42,49),ii=a(43,49),si=a(44,49),ni=a(45,49),oi=a(46,49),ai=a(47,49),li=a(100,49),ci=a(91,39),fi=a(92,39),ui=a(93,39),mi=a(94,39),hi=a(95,39),pi=a(96,39),di=a(97,39),gi=a(101,49),_i=a(102,49),Fi=a(103,49),xi=a(104,49),bi=a(105,49),Ei=a(106,49),Ci=a(107,49);import Pt from"node:process";function A(){let{env:t}=Pt,{TERM:e,TERM_PROGRAM:r}=t;return Pt.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var k=A(),Ae=It(k?"\u2139":"i"),Be=Rt(k?"\u2714":"\u221A"),Oe=Dt(k?"\u26A0":"\u203C"),Se=St(k?"\u2716":"\xD7");function et({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var Re=et();function B(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Re,"")}function Mt(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Nt(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function jt(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function De(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function rt(t,{ambiguousAsWide:e=!1}={}){return De(t),Nt(t)||jt(t)||e&&Mt(t)?2:1}var Ie=new Intl.Segmenter,Pe=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,Me=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Ne=/^\p{RGI_Emoji}$/v;function je(t){return t.replace(Me,"")}function ke(t){return Pe.test(t)}function Le(t,e){let r=0;if(t.length>1)for(let i of t.slice(1))i>="\uFF00"&&i<="\uFFEF"&&(r+=rt(i.codePointAt(0),e));return r}function it(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,s=t;if(i||(s=B(s)),s.length===0)return 0;let n=0,o={ambiguousAsWide:!r};for(let{segment:l}of Ie.segment(s)){if(ke(l))continue;if(Ne.test(l)){n+=2;continue}let u=je(l).codePointAt(0);n+=rt(u,o),n+=Le(l,o)}return n}function st({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import d from"node:process";var Ge=3,nt=class{#n=0;start(){this.#n++,this.#n===1&&this.#i()}stop(){if(this.#n<=0)throw new Error("`stop` called more times than `start`");this.#n--,this.#n===0&&this.#t()}#i(){d.platform==="win32"||!d.stdin.isTTY||(d.stdin.setRawMode(!0),d.stdin.on("data",this.#s),d.stdin.resume())}#t(){d.stdin.isTTY&&(d.stdin.off("data",this.#s),d.stdin.pause(),d.stdin.setRawMode(!1))}#s(e){e[0]===Ge&&d.emit("SIGINT")}},We=new nt,ot=We;var at=class{#n=0;#i=!1;#t=0;#s=-1;#h=0;#u=0;#e;#o;#r;#p;#_;#a;#m;#l;#d;#c;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#e={color:"cyan",stream:L.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#e.color,this.spinner=this.#e.spinner,this.#_=this.#e.interval,this.#r=this.#e.stream,this.#a=typeof this.#e.isEnabled=="boolean"?this.#e.isEnabled:st({stream:this.#r}),this.#m=typeof this.#e.isSilent=="boolean"?this.#e.isSilent:!1,this.text=this.#e.text,this.prefixText=this.#e.prefixText,this.suffixText=this.#e.suffixText,this.indent=this.#e.indent,L.env.NODE_ENV==="test"&&(this._stream=this.#r,this._isEnabled=this.#a,Object.defineProperty(this,"_linesToClear",{get(){return this.#n},set(r){this.#n=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#t}}))}get indent(){return this.#l}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#l=e,this.#g()}get interval(){return this.#_??this.#o.interval??100}get spinner(){return this.#o}set spinner(e){if(this.#s=-1,this.#_=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#o=e}else if(!A())this.#o=_.line;else if(e===void 0)this.#o=_.dots;else if(e!=="default"&&_[e])this.#o=_[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#d}set text(e=""){this.#d=e,this.#g()}get prefixText(){return this.#c}set prefixText(e=""){this.#c=e,this.#g()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#g()}get isSpinning(){return this.#p!==void 0}#E(e,r,i=!1){let s=typeof e=="function"?e():e;return typeof s=="string"&&s!==""?i?r+s:s+r:""}#F(e=this.#c,r=" "){return this.#E(e,r,!1)}#x(e=this.#f,r=" "){return this.#E(e,r,!0)}#b(e,r){let i=0;for(let s of B(e).split(`
8
+ `))i+=Math.max(1,Math.ceil(it(s)/r));return i}#g(){let e=this.#r.columns??80,r=typeof this.#c=="function"?"":this.#c,i=typeof this.#f=="function"?"":this.#f,s=typeof r=="string"&&r!==""?r+" ":"",n=typeof i=="string"&&i!==""?" "+i:"",l=" ".repeat(this.#l)+s+"-"+(typeof this.#d=="string"?" "+this.#d:"")+n;this.#t=this.#b(l,e)}get isEnabled(){return this.#a&&!this.#m}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#a=e}get isSilent(){return this.#m}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#m=e}frame(){let e=Date.now();(this.#s===-1||e-this.#h>=this.interval)&&(this.#s=++this.#s%this.#o.frames.length,this.#h=e);let{frames:r}=this.#o,i=r[this.#s];this.color&&(i=yt[this.color](i));let s=this.#F(this.#c," "),n=typeof this.text=="string"?" "+this.text:"",o=this.#x(this.#f," ");return s+i+n+o}clear(){if(!this.#a||!this.#r.isTTY)return this;this.#r.cursorTo(0);for(let e=0;e<this.#n;e++)e>0&&this.#r.moveCursor(0,-1),this.#r.clearLine(1);return(this.#l||this.#u!==this.#l)&&this.#r.cursorTo(this.#l),this.#u=this.#l,this.#n=0,this}render(){if(!this.#a||this.#m)return this;this.clear();let e=this.frame(),r=this.#r.columns??80,i=this.#b(e,r),s=this.#r.rows;if(s&&s>1&&i>s){let n=e.split(`
9
+ `),o=s-1;e=[...n.slice(0,o),"... (content truncated to fit terminal)"].join(`
10
+ `)}return this.#r.write(e),this.#n=this.#b(e,r),this}start(e){if(e&&(this.text=e),this.#m)return this;if(!this.#a){let r=" ".repeat(this.#l)+this.#F(this.#c," ")+(this.text?`- ${this.text}`:"")+this.#x(this.#f," ");return r.trim()!==""&&this.#r.write(r+`
11
+ `),this}return this.isSpinning?this:(this.#e.hideCursor&&Q.hide(this.#r),this.#e.discardStdin&&L.stdin.isTTY&&(this.#i=!0,ot.start()),this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#p),this.#p=void 0,this.#s=0,this.#a&&(this.clear(),this.#e.hideCursor&&Q.show(this.#r)),this.#e.discardStdin&&L.stdin.isTTY&&this.#i&&(ot.stop(),this.#i=!1),this}succeed(e){return this.stopAndPersist({symbol:b.success,text:e})}fail(e){return this.stopAndPersist({symbol:b.error,text:e})}warn(e){return this.stopAndPersist({symbol:b.warning,text:e})}info(e){return this.stopAndPersist({symbol:b.info,text:e})}stopAndPersist(e={}){if(this.#m)return this;let r=e.prefixText??this.#c,i=this.#F(r," "),s=e.symbol??" ",n=e.text??this.text,l=typeof n=="string"?(s?" ":"")+n:"",u=e.suffixText??this.#f,F=this.#x(u," "),g=i+s+l+F+`
12
+ `;return this.stop(),this.#r.write(g),this}};function lt(t){return new at(t)}import{stdin as Ue,stdout as $e}from"node:process";import Ye from"node:readline/promises";var E=class{spiner=void 0;do(e,r,i,s){this.spiner=lt({text:e,color:r,spinner:i,prefixText:s}).start()}next(e,r,i,s=0){this.success(),this.do(e,r,i,s?" ".repeat(s)+"\u2514\u2500":void 0)}success(){this.spiner&&this.spiner.succeed()}fail(){this.spiner&&this.spiner.fail()}async ask(e,r=""){this.spiner&&(this.spiner.spinner={interval:100,frames:["?","."," ","."]});let i=Ye.createInterface({input:Ue,output:$e}),s=(await i.question("")).trim();return i.close(),s||r}};var kt=async t=>{let e=await t.evaluate(()=>window.__page_requests),r=await t.locator("#root").innerHTML();return{state:e,root:r}};var Gt=async(t,e,r=!1,i=!1)=>{let s=new E;s.next("Router analysis","yellow",_.dotsCircle);let n=[],o=await Lt.launch({headless:!i,devtools:!0}),l=await Lt.launch({headless:!0}),u=await o.newContext({userAgent:"____fast-ssr-tool___",locale:"ru-RU"});for await(let[F,g]of e.entries()){s.next(g,"yellow",_.dotsCircle,1);let h=await u.newPage(),W=g.replaceAll("{","").replaceAll("}","");await h.goto(t+W),await h.waitForLoadState("networkidle"),await h.waitForTimeout(1e3);let{state:Yt,root:Ht}=await kt(h),Vt;i&&await s.ask("continue?"),h.close(),n.push({id:F,input:Yt,mask:g,root:Ht,test:Vt})}return await o.close(),await l.close(),s.success(),n};import G from"node:path";import{mkdir as Ve}from"node:fs/promises";import{preview as He}from"vite";var Wt=async()=>{let t=await He({preview:{port:8084}});if(!t.resolvedUrls?.local?.length)throw new Error("vite is not defined");return[t.resolvedUrls?.local[0].slice(0,-1),()=>t.close()]};var Ut=async t=>{let e=new E,r=t.customConfig??"jinrai.config";e.do("Init");let i=await ft(r);e.success();let[s,n]=await Wt(),o=await Gt(s,i.pages,i.test,t.debug);n();let l=G.join(i.dist??"dist",".cached");e.do("Format");let{routes:u,templates:F}=ut(o);e.next(`Export: (${F.length})`),await Ve(l,{recursive:!0}),console.log("dev");let g={routes:u,proxy:i.proxy,meta:i.meta};await ct(G.join(l,"config.json"),JSON.stringify(g,null,2));for await(let[h,W]of Object.entries(F))await ct(G.join(l,`${W}.html`),h);if(i.test){e.next("Tests");for await(let h of o)h.test&&await ct(G.join(l,`test_${h.id}.html`),O(h.test))}e.success()};var $t=process.argv.slice(2),qe=$t.includes("--debug"),ze=$t.find(t=>t.startsWith("--config="))?.substring(9);Ut({debug:qe,customConfig:ze});
@@ -0,0 +1 @@
1
+ export { defineConfig } from "./src/bin/config/define";
@@ -0,0 +1 @@
1
+ var e=o=>o;export{e as defineConfig};
@@ -6,10 +6,8 @@ export interface Config {
6
6
  url?: string;
7
7
  preview?: string;
8
8
  pages: string[];
9
- debug?: boolean;
10
9
  test?: boolean;
11
10
  dist?: string;
12
- index?: (props: IndexProps) => string;
13
11
  proxy?: Record<string, string>;
14
12
  meta?: string;
15
13
  }
package/lib/index.d.ts CHANGED
@@ -1 +1,6 @@
1
- export { defineConfig } from "./src/config/define";
1
+ export { useServerState } from "./src/front/server-state/useServerState";
2
+ export { real } from "./src/front/server-state/real";
3
+ export { useParamsIndex } from "./src/front/url/params/useParamsIndex";
4
+ export { useSearchValue, useSearchArray } from "./src/front/url/search/useSearchValue";
5
+ export { useSearch } from "./src/front/url/search/useSearch";
6
+ export { Custom } from "./src/front/wrapper/Custom";
package/lib/index.js CHANGED
@@ -1 +1,6 @@
1
- var e=o=>o;export{e as defineConfig};
1
+ export { useServerState } from './src/front/server-state/useServerState.js';
2
+ export { real } from './src/front/server-state/real.js';
3
+ export { useParamsIndex } from './src/front/url/params/useParamsIndex.js';
4
+ export { useSearchArray, useSearchValue } from './src/front/url/search/useSearchValue.js';
5
+ export { useSearch } from './src/front/url/search/useSearch.js';
6
+ export { Custom } from './src/front/wrapper/Custom.js';
@@ -0,0 +1,8 @@
1
+ export interface DataProxy {
2
+ map: (callback: () => DataProxy) => any[];
3
+ getKey: () => string;
4
+ getValue: () => any;
5
+ }
6
+ export declare const sources: Map<string, any>;
7
+ declare const createDataProxy: (data: any, path?: string) => DataProxy;
8
+ export default createDataProxy;
@@ -0,0 +1,104 @@
1
+ import React from 'react';
2
+ import { ssr } from './SSR.js';
3
+
4
+ const sources = new Map();
5
+ const getTarget = (data, path) => {
6
+ if (Array.isArray(data))
7
+ return { __array__: data };
8
+ switch (typeof data) {
9
+ case "object":
10
+ case "string":
11
+ // case "number":
12
+ case "boolean":
13
+ case "undefined":
14
+ case "symbol":
15
+ // эти типы можно просто завернуть
16
+ return { value: data };
17
+ default:
18
+ return () => `{{${path}}}`;
19
+ }
20
+ };
21
+ const createDataProxy = (data, path = "") => {
22
+ if (path.endsWith("@"))
23
+ sources.set(path.slice(0, -1), data);
24
+ return new Proxy(getTarget(data, path), {
25
+ get: (_, prop) => {
26
+ // if (typeof prop == "symbol") return data[prop]
27
+ if (!(typeof data == "object" && data !== null && prop in data))
28
+ // DEV TOOLS
29
+ switch (prop) {
30
+ // @ts-ignore
31
+ case Symbol.toPrimitive:
32
+ return (hint) => {
33
+ console.log("PROXYDATA", hint);
34
+ return `{{${path}}}`;
35
+ };
36
+ // @ts-ignore
37
+ case Symbol.toStringTag:
38
+ return "Object";
39
+ // @ts-ignore
40
+ case Symbol.iterator:
41
+ return data[Symbol.iterator];
42
+ case "$$typeof":
43
+ case "type":
44
+ return undefined;
45
+ case "_debugInfo":
46
+ return {
47
+ note: `State From Request (${path})`,
48
+ kind: typeof data,
49
+ timestamp: Date.now(),
50
+ preview: data,
51
+ };
52
+ }
53
+ // SELF
54
+ if (prop.startsWith("$"))
55
+ return (key) => `{{${path + "/" + key}${"\\" + prop}}}`;
56
+ // TYPES
57
+ switch (typeof data) {
58
+ case "string":
59
+ switch (prop) {
60
+ case "length":
61
+ case "entries":
62
+ return undefined;
63
+ }
64
+ case "number":
65
+ switch (prop) {
66
+ case "@@iterator":
67
+ return undefined;
68
+ }
69
+ default:
70
+ switch (prop) {
71
+ case "then":
72
+ return undefined;
73
+ }
74
+ }
75
+ // OTHER
76
+ switch (prop) {
77
+ case "find":
78
+ return data[prop];
79
+ case "map":
80
+ case "forEach":
81
+ return (callback) => React.createElement("loopwrapper", null, [
82
+ `ArrayDataKey=${path}|`,
83
+ Object.entries(data)
84
+ .slice(0, 1)
85
+ .map(([key, itm]) => callback(createDataProxy(itm, `${path}/[ITEM=${key}]`))),
86
+ ]);
87
+ case "getValue":
88
+ return () => data;
89
+ case "toJSON":
90
+ return () => {
91
+ console.log("dataproxy toJSON", path, data);
92
+ return ssr.exportParams ? `{{${path}}}` : data;
93
+ };
94
+ default:
95
+ if (data && (typeof data[prop] == "object" || Array.isArray(data[prop]))) {
96
+ return createDataProxy(data[prop], path + "/" + prop);
97
+ }
98
+ return `{{${path + "/" + prop}}}`;
99
+ }
100
+ },
101
+ });
102
+ };
103
+
104
+ export { createDataProxy as default, sources };
@@ -0,0 +1,4 @@
1
+ export declare const ssr: {
2
+ current: boolean;
3
+ exportParams: boolean;
4
+ };
@@ -0,0 +1,6 @@
1
+ const ssr = {
2
+ current: navigator.userAgent == "____JINRAI_CLIENT____",
3
+ exportParams: false,
4
+ };
5
+
6
+ export { ssr };
@@ -0,0 +1 @@
1
+ export declare function real<T>(value: T): T;
@@ -0,0 +1,36 @@
1
+ import { ssr } from './SSR.js';
2
+ import { sources } from './DataProxy.js';
3
+
4
+ function real(value) {
5
+ if (!ssr.current)
6
+ return value;
7
+ switch (typeof value) {
8
+ case "number":
9
+ return value;
10
+ case "string":
11
+ return value.startsWith("{{") && value.endsWith("}}") ? getArrayByPath(value.slice(2, -2)) : value;
12
+ case "object":
13
+ // @ts-ignore
14
+ if (value && typeof value.getValue === "function") {
15
+ // @ts-ignore
16
+ return value.getValue();
17
+ }
18
+ return value;
19
+ default:
20
+ return value;
21
+ }
22
+ }
23
+ const getArrayByPath = (path) => {
24
+ const [sourceIndex, requestPath] = path.split("@", 2);
25
+ const keys = requestPath.split("/");
26
+ keys.shift();
27
+ let link = sources.get(sourceIndex);
28
+ for (let key of keys) {
29
+ if (key.startsWith("[ITEM="))
30
+ key = key.slice(6, -1);
31
+ link = link[key];
32
+ }
33
+ return link;
34
+ };
35
+
36
+ export { real };
@@ -0,0 +1,5 @@
1
+ import { ServerStateOptions } from "./useServerState";
2
+ export type ServerValue = any;
3
+ export declare const serverStates: Map<string, string>;
4
+ export declare const getServerValue: (key: string, def?: ServerValue) => any[];
5
+ export declare const setServerValue: (key: string, value: ServerValue, options?: ServerStateOptions) => import("./DataProxy").DataProxy;
@@ -0,0 +1,29 @@
1
+ import createDataProxy from './DataProxy.js';
2
+ import { ssr } from './SSR.js';
3
+
4
+ const serverStates = new Map();
5
+ if (window != undefined) {
6
+ // @ts-ignore
7
+ window.__serverExportStates__ = serverStates;
8
+ }
9
+ const getServerValue = (key, def) => {
10
+ if (key == "") {
11
+ return [def, false];
12
+ }
13
+ // @ts-ignore
14
+ if (window != undefined && window?.__serverInitialStates__ && key in window.__serverInitialStates__) {
15
+ // @ts-ignore
16
+ return [window.__serverInitialStates__[key], true];
17
+ }
18
+ return [serverStates.get(key) ?? def, false];
19
+ };
20
+ const setServerValue = (key, value, options) => {
21
+ ssr.exportParams = true;
22
+ const json = JSON.stringify({ value, options });
23
+ ssr.exportParams = false;
24
+ console.log(key, json);
25
+ serverStates.set(key, json);
26
+ return createDataProxy(value, `${key}@`);
27
+ };
28
+
29
+ export { getServerValue, serverStates, setServerValue };
@@ -0,0 +1,10 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { ServerValue } from "./serverStates";
3
+ export interface ServerStateOptions {
4
+ source: {
5
+ method: string;
6
+ url: string;
7
+ input: any;
8
+ };
9
+ }
10
+ export declare const useServerState: <T extends ServerValue>(serverKey: string, initialValue: T, options?: ServerStateOptions) => [T, Dispatch<SetStateAction<T>>, () => boolean];
@@ -0,0 +1,28 @@
1
+ import { useState } from 'react';
2
+ import { ssr } from './SSR.js';
3
+ import { getServerValue, setServerValue } from './serverStates.js';
4
+
5
+ const useServerState = (serverKey, initialValue, options) => {
6
+ const [serverValue, isInitOnServer] = getServerValue(serverKey, initialValue);
7
+ const [value, setStateValue] = useState(serverValue);
8
+ const [isInit, setIsInit] = useState(isInitOnServer);
9
+ const setValue = (value) => {
10
+ setStateValue((prev) => {
11
+ const result = value instanceof Function ? value(prev) : value;
12
+ if (serverKey && ssr.current) {
13
+ return setServerValue(serverKey, result, options);
14
+ }
15
+ return result;
16
+ });
17
+ };
18
+ const initOnServer = () => {
19
+ if (isInit) {
20
+ setIsInit(false);
21
+ return true;
22
+ }
23
+ return false;
24
+ };
25
+ return [value, setValue, initOnServer];
26
+ };
27
+
28
+ export { useServerState };
@@ -0,0 +1,6 @@
1
+ import { DependencyList, ReactNode } from "react";
2
+ export interface JinraiProps {
3
+ deps?: DependencyList;
4
+ children?: ReactNode;
5
+ }
6
+ export declare const JinraiContext: import("react").Context<JinraiProps>;
@@ -0,0 +1,8 @@
1
+ import { createContext } from 'react';
2
+
3
+ const JinraiContext = createContext({
4
+ deps: [],
5
+ children: undefined,
6
+ });
7
+
8
+ export { JinraiContext };
@@ -0,0 +1,2 @@
1
+ import { JinraiProps } from "../JinraiContext";
2
+ export declare const Adapter: (props: JinraiProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { JinraiContext } from '../JinraiContext.js';
3
+ import { NuqsAdapter } from 'nuqs/adapters/react';
4
+
5
+ const Adapter = (props) => {
6
+ return (jsx(NuqsAdapter, { children: jsx(JinraiContext.Provider, { value: { deps: props.deps ?? [] }, ...props }) }));
7
+ };
8
+
9
+ export { Adapter };
@@ -0,0 +1,2 @@
1
+ import { JinraiProps } from "../JinraiContext";
2
+ export declare const Adapter: (props: JinraiProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { NuqsAdapter } from 'nuqs/adapters/react-router/v6';
3
+ import { useLocation } from 'react-router-dom';
4
+ import { JinraiContext } from '../JinraiContext.js';
5
+
6
+ const Adapter = (props) => {
7
+ console.log("LOAD ADAPTER");
8
+ const { pathname } = useLocation();
9
+ return (jsx(NuqsAdapter, { children: jsx(JinraiContext.Provider, { value: { deps: [...(props.deps ?? [], [pathname])] }, ...props }) }));
10
+ };
11
+
12
+ export { Adapter };
@@ -0,0 +1,2 @@
1
+ import { JinraiProps } from "../JinraiContext";
2
+ export declare const Adapter: (props: JinraiProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { NuqsAdapter } from 'nuqs/adapters/react-router/v7';
3
+ import { useLocation } from 'react-router-dom';
4
+ import { JinraiContext } from '../JinraiContext.js';
5
+
6
+ const Adapter = (props) => {
7
+ const { pathname } = useLocation();
8
+ return (jsx(NuqsAdapter, { children: jsx(JinraiContext.Provider, { value: { deps: [...(props.deps ?? [], [pathname])] }, ...props }) }));
9
+ };
10
+
11
+ export { Adapter };
@@ -0,0 +1 @@
1
+ export declare const useParamsIndex: (index: number, def?: string) => string;
@@ -0,0 +1,15 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { getJinraiValue } from '../search/useSearchValue.js';
3
+ import { JinraiContext } from '../JinraiContext.js';
4
+ import { ssr } from '../../server-state/SSR.js';
5
+
6
+ const useParamsIndex = (index, def = "") => {
7
+ const { deps } = useContext(JinraiContext);
8
+ const value = useMemo(() => location.pathname.split("/")[index + 1] ?? def, deps ? deps : []);
9
+ const stableValue = useMemo(() => {
10
+ return ssr.current ? value.bindSource(getJinraiValue(index.toString(), "paramsIndex", "", def)) : value;
11
+ }, [value]);
12
+ return stableValue;
13
+ };
14
+
15
+ export { useParamsIndex };
@@ -0,0 +1 @@
1
+ export declare const useSearch: () => string;
@@ -0,0 +1,15 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { JinraiContext } from '../JinraiContext.js';
3
+ import { ssr } from '../../server-state/SSR.js';
4
+ import { getJinraiValue } from './useSearchValue.js';
5
+
6
+ const useSearch = () => {
7
+ const { deps } = useContext(JinraiContext);
8
+ const value = useMemo(() => location.search.substring(1), deps ? deps : []);
9
+ const stableValue = useMemo(() => {
10
+ return ssr.current ? value.bindSource(getJinraiValue("", "search", "", "")) : value;
11
+ }, [value]);
12
+ return stableValue;
13
+ };
14
+
15
+ export { useSearch };