@lightspeed/crane 1.1.1 → 1.1.2

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/dist/cli.mjs CHANGED
@@ -1,23 +1,23 @@
1
- import bn from"cac";import S from"node:fs";import F from"node:path";import{fileURLToPath as J}from"node:url";import*as V from"fs";import de,{existsSync as R,rename as Cn,unlink as En,statSync as wn,promises as $n,writeFileSync as vn,createReadStream as Tn}from"fs";import*as Q from"path";import ee,{resolve as E,parse as te,dirname as On,sep as jn}from"path";import{red as Sn,yellow as An,green as ne}from"kolorist";import*as Ge from"node:process";import M from"node:process";import{glob as O,globSync as Ue}from"glob";import{normalizePath as Xe,build as ze,defineConfig as qe}from"vite";import{pathToFileURL as G}from"url";import{builtinModules as Ke}from"module";import He from"@vitejs/plugin-vue";import me from"vite-tsconfig-paths";import{viteExternalsPlugin as kn}from"vite-plugin-externals";import se from"fs-extra";import Fn from"os";import Je from"tty";import B from"zlib";import xn from"util";import _n from"vite-plugin-checker";import Rn from"ajv/dist/2020.js";import In from"ajv-formats";import{readFile as We}from"fs/promises";import Nn,{AxiosError as Ye}from"axios";import{inc as Ln}from"semver";import*as C from"process";import{ConcurrencyManager as Mn}from"axios-concurrency";import Dn from"tinycolor2";import Bn from"prompts";function Ze(e,t){V.statSync(e).isDirectory()?(V.mkdirSync(t,{recursive:!0}),V.readdirSync(e).forEach(s=>{const r=Q.resolve(e,s),n=Q.resolve(t,s);Ze(r,n)})):V.copyFileSync(e,t)}function oe(e,t,s,r){const n=Q.join(e,r?.[s]??s);Ze(Q.join(t,s),n)}function Ve(e,t=2){if(!+e)return"0 Bytes";const s=1024,r=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],o=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/Math.pow(s,o)).toFixed(r))} ${n[o]}`}const b={error:e=>console.log(Sn(e)),warn:e=>console.log(An(e)),info:e=>console.log(ne(e))},X="_temp",A="dist/sections",he="dist/headers",ye="dist/footers",z="dist/templates",Qe=2*1024*1024;function ge(e){return!!e}function et(){const e=["|","/","-","\\"];let t=0;return setInterval(()=>{process.stdout.write(`\r${e[t]}`),t=(t+1)%e.length},100)}function be(e){clearInterval(e),process.stdout.write("\r")}async function tt(e){try{const t=e,s=M.cwd(),r=F.join(s,t),n=["templates","headers","footers"],o={_gitignore:".gitignore"};S.existsSync(r)?(b.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),M.exit(1)):S.mkdirSync(r);const i=F.resolve(J(import.meta.url),"../..","template");S.readdirSync(i).filter(u=>u!=="package.json").filter(u=>!n.includes(u)).forEach(async u=>oe(r,i,u,o));const c=JSON.parse(S.readFileSync(F.join(i,"package.json"),"utf-8"));c.name=e;const a=F.join(r,"package.json");S.writeFileSync(a,`${JSON.stringify(c,null,2)}
2
- `),b.info(`App ${e} created`)}catch(t){b.error(`Error while creating app: ${t.message}`),M.exit(1)}}async function nt(e){try{const t=e,s=M.cwd(),r=F.join(s,"sections",t);S.existsSync(r)?(b.error(`Section with the name: ${e} already exists. If you'd like to override it, delete previous version first`),M.exit(1)):S.mkdirSync(r);const n=F.resolve(J(import.meta.url),"../..","template/sections/example-section");S.readdirSync(n).forEach(async o=>oe(r,n,o)),b.info(`Section ${e} created`)}catch(t){b.error(`Error while creating section: ${t.message}`),M.exit(1)}}async function st(e,t=!1){try{const s=M.cwd(),r=F.join(s,"templates"),n={"template.ts":`${e}.ts`};S.existsSync(r)?S.existsSync(F.join(r,`${e}.ts`))&&(b.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),M.exit(1)):S.mkdirSync(r);const o=F.resolve(J(import.meta.url),"../..","template/templates");if(S.readdirSync(o).forEach(async i=>oe(r,o,i,n)),t){const i={headers:F.resolve(J(import.meta.url),"../..","template/headers"),footers:F.resolve(J(import.meta.url),"../..","template/footers")};["headers","footers"].forEach(c=>{const a=F.join(s,c);if(!S.existsSync(a)){S.mkdirSync(a);const u=i[c];S.readdirSync(u).forEach(async p=>oe(a,u,p))}})}b.info(`Template descriptor file [${e}.ts] has been created`)}catch(s){b.error(`Error while creating template descriptors: ${s.message}`),M.exit(1)}}var j=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.TemplateAsset=6]="TemplateAsset",e))(j||{}),_=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e))(_||{});function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce={exports:{}},Ee,rt;function Pn(){return rt||(rt=1,Ee={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Ee}var we,it;function at(){if(it)return we;it=1;const e=Pn(),t={};for(const n of Object.keys(e))t[e[n]]=n;const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};we=s;for(const n of Object.keys(s)){if(!("channels"in s[n]))throw new Error("missing channels property: "+n);if(!("labels"in s[n]))throw new Error("missing channel labels property: "+n);if(s[n].labels.length!==s[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:o,labels:i}=s[n];delete s[n].channels,delete s[n].labels,Object.defineProperty(s[n],"channels",{value:o}),Object.defineProperty(s[n],"labels",{value:i})}s.rgb.hsl=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(o,i,c),u=Math.max(o,i,c),p=u-a;let l,f;u===a?l=0:o===u?l=(i-c)/p:i===u?l=2+(c-o)/p:c===u&&(l=4+(o-i)/p),l=Math.min(l*60,360),l<0&&(l+=360);const d=(a+u)/2;return u===a?f=0:d<=.5?f=p/(u+a):f=p/(2-u-a),[l,f*100,d*100]},s.rgb.hsv=function(n){let o,i,c,a,u;const p=n[0]/255,l=n[1]/255,f=n[2]/255,d=Math.max(p,l,f),m=d-Math.min(p,l,f),h=function(g){return(d-g)/6/m+1/2};return m===0?(a=0,u=0):(u=m/d,o=h(p),i=h(l),c=h(f),p===d?a=c-i:l===d?a=1/3+o-c:f===d&&(a=2/3+i-o),a<0?a+=1:a>1&&(a-=1)),[a*360,u*100,d*100]},s.rgb.hwb=function(n){const o=n[0],i=n[1];let c=n[2];const a=s.rgb.hsl(n)[0],u=1/255*Math.min(o,Math.min(i,c));return c=1-1/255*Math.max(o,Math.max(i,c)),[a,u*100,c*100]},s.rgb.cmyk=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(1-o,1-i,1-c),u=(1-o-a)/(1-a)||0,p=(1-i-a)/(1-a)||0,l=(1-c-a)/(1-a)||0;return[u*100,p*100,l*100,a*100]};function r(n,o){return(n[0]-o[0])**2+(n[1]-o[1])**2+(n[2]-o[2])**2}return s.rgb.keyword=function(n){const o=t[n];if(o)return o;let i=1/0,c;for(const a of Object.keys(e)){const u=e[a],p=r(n,u);p<i&&(i=p,c=a)}return c},s.keyword.rgb=function(n){return e[n]},s.rgb.xyz=function(n){let o=n[0]/255,i=n[1]/255,c=n[2]/255;o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;const a=o*.4124+i*.3576+c*.1805,u=o*.2126+i*.7152+c*.0722,p=o*.0193+i*.1192+c*.9505;return[a*100,u*100,p*100]},s.rgb.lab=function(n){const o=s.rgb.xyz(n);let i=o[0],c=o[1],a=o[2];i/=95.047,c/=100,a/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const u=116*c-16,p=500*(i-c),l=200*(c-a);return[u,p,l]},s.hsl.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;let a,u,p;if(i===0)return p=c*255,[p,p,p];c<.5?a=c*(1+i):a=c+i-c*i;const l=2*c-a,f=[0,0,0];for(let d=0;d<3;d++)u=o+1/3*-(d-1),u<0&&u++,u>1&&u--,6*u<1?p=l+(a-l)*6*u:2*u<1?p=a:3*u<2?p=l+(a-l)*(2/3-u)*6:p=l,f[d]=p*255;return f},s.hsl.hsv=function(n){const o=n[0];let i=n[1]/100,c=n[2]/100,a=i;const u=Math.max(c,.01);c*=2,i*=c<=1?c:2-c,a*=u<=1?u:2-u;const p=(c+i)/2,l=c===0?2*a/(u+a):2*i/(c+i);return[o,l*100,p*100]},s.hsv.rgb=function(n){const o=n[0]/60,i=n[1]/100;let c=n[2]/100;const a=Math.floor(o)%6,u=o-Math.floor(o),p=255*c*(1-i),l=255*c*(1-i*u),f=255*c*(1-i*(1-u));switch(c*=255,a){case 0:return[c,f,p];case 1:return[l,c,p];case 2:return[p,c,f];case 3:return[p,l,c];case 4:return[f,p,c];case 5:return[c,p,l]}},s.hsv.hsl=function(n){const o=n[0],i=n[1]/100,c=n[2]/100,a=Math.max(c,.01);let u,p;p=(2-i)*c;const l=(2-i)*a;return u=i*a,u/=l<=1?l:2-l,u=u||0,p/=2,[o,u*100,p*100]},s.hwb.rgb=function(n){const o=n[0]/360;let i=n[1]/100,c=n[2]/100;const a=i+c;let u;a>1&&(i/=a,c/=a);const p=Math.floor(6*o),l=1-c;u=6*o-p,p&1&&(u=1-u);const f=i+u*(l-i);let d,m,h;switch(p){default:case 6:case 0:d=l,m=f,h=i;break;case 1:d=f,m=l,h=i;break;case 2:d=i,m=l,h=f;break;case 3:d=i,m=f,h=l;break;case 4:d=f,m=i,h=l;break;case 5:d=l,m=i,h=f;break}return[d*255,m*255,h*255]},s.cmyk.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100,a=n[3]/100,u=1-Math.min(1,o*(1-a)+a),p=1-Math.min(1,i*(1-a)+a),l=1-Math.min(1,c*(1-a)+a);return[u*255,p*255,l*255]},s.xyz.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100;let a,u,p;return a=o*3.2406+i*-1.5372+c*-.4986,u=o*-.9689+i*1.8758+c*.0415,p=o*.0557+i*-.204+c*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,a=Math.min(Math.max(0,a),1),u=Math.min(Math.max(0,u),1),p=Math.min(Math.max(0,p),1),[a*255,u*255,p*255]},s.xyz.lab=function(n){let o=n[0],i=n[1],c=n[2];o/=95.047,i/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const a=116*i-16,u=500*(o-i),p=200*(i-c);return[a,u,p]},s.lab.xyz=function(n){const o=n[0],i=n[1],c=n[2];let a,u,p;u=(o+16)/116,a=i/500+u,p=u-c/200;const l=u**3,f=a**3,d=p**3;return u=l>.008856?l:(u-16/116)/7.787,a=f>.008856?f:(a-16/116)/7.787,p=d>.008856?d:(p-16/116)/7.787,a*=95.047,u*=100,p*=108.883,[a,u,p]},s.lab.lch=function(n){const o=n[0],i=n[1],c=n[2];let a;a=Math.atan2(c,i)*360/2/Math.PI,a<0&&(a+=360);const p=Math.sqrt(i*i+c*c);return[o,p,a]},s.lch.lab=function(n){const o=n[0],i=n[1],a=n[2]/360*2*Math.PI,u=i*Math.cos(a),p=i*Math.sin(a);return[o,u,p]},s.rgb.ansi16=function(n,o=null){const[i,c,a]=n;let u=o===null?s.rgb.hsv(n)[2]:o;if(u=Math.round(u/50),u===0)return 30;let p=30+(Math.round(a/255)<<2|Math.round(c/255)<<1|Math.round(i/255));return u===2&&(p+=60),p},s.hsv.ansi16=function(n){return s.rgb.ansi16(s.hsv.rgb(n),n[2])},s.rgb.ansi256=function(n){const o=n[0],i=n[1],c=n[2];return o===i&&i===c?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(i/255*5)+Math.round(c/255*5)},s.ansi16.rgb=function(n){let o=n%10;if(o===0||o===7)return n>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const i=(~~(n>50)+1)*.5,c=(o&1)*i*255,a=(o>>1&1)*i*255,u=(o>>2&1)*i*255;return[c,a,u]},s.ansi256.rgb=function(n){if(n>=232){const u=(n-232)*10+8;return[u,u,u]}n-=16;let o;const i=Math.floor(n/36)/5*255,c=Math.floor((o=n%36)/6)/5*255,a=o%6/5*255;return[i,c,a]},s.rgb.hex=function(n){const i=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i},s.hex.rgb=function(n){const o=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!o)return[0,0,0];let i=o[0];o[0].length===3&&(i=i.split("").map(l=>l+l).join(""));const c=parseInt(i,16),a=c>>16&255,u=c>>8&255,p=c&255;return[a,u,p]},s.rgb.hcg=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.max(Math.max(o,i),c),u=Math.min(Math.min(o,i),c),p=a-u;let l,f;return p<1?l=u/(1-p):l=0,p<=0?f=0:a===o?f=(i-c)/p%6:a===i?f=2+(c-o)/p:f=4+(o-i)/p,f/=6,f%=1,[f*360,p*100,l*100]},s.hsl.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=i<.5?2*o*i:2*o*(1-i);let a=0;return c<1&&(a=(i-.5*c)/(1-c)),[n[0],c*100,a*100]},s.hsv.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=o*i;let a=0;return c<1&&(a=(i-c)/(1-c)),[n[0],c*100,a*100]},s.hcg.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;if(i===0)return[c*255,c*255,c*255];const a=[0,0,0],u=o%1*6,p=u%1,l=1-p;let f=0;switch(Math.floor(u)){case 0:a[0]=1,a[1]=p,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=p;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=p,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return f=(1-i)*c,[(i*a[0]+f)*255,(i*a[1]+f)*255,(i*a[2]+f)*255]},s.hcg.hsv=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);let a=0;return c>0&&(a=o/c),[n[0],a*100,c*100]},s.hcg.hsl=function(n){const o=n[1]/100,c=n[2]/100*(1-o)+.5*o;let a=0;return c>0&&c<.5?a=o/(2*c):c>=.5&&c<1&&(a=o/(2*(1-c))),[n[0],a*100,c*100]},s.hcg.hwb=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);return[n[0],(c-o)*100,(1-c)*100]},s.hwb.hcg=function(n){const o=n[1]/100,c=1-n[2]/100,a=c-o;let u=0;return a<1&&(u=(c-a)/(1-a)),[n[0],a*100,u*100]},s.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]},s.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]},s.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]},s.gray.hsl=function(n){return[0,0,n[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(n){return[0,100,n[0]]},s.gray.cmyk=function(n){return[0,0,0,n[0]]},s.gray.lab=function(n){return[n[0],0,0]},s.gray.hex=function(n){const o=Math.round(n[0]/100*255)&255,c=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".substring(c.length)+c},s.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]},we}var $e,ct;function Gn(){if(ct)return $e;ct=1;const e=at();function t(){const o={},i=Object.keys(e);for(let c=i.length,a=0;a<c;a++)o[i[a]]={distance:-1,parent:null};return o}function s(o){const i=t(),c=[o];for(i[o].distance=0;c.length;){const a=c.pop(),u=Object.keys(e[a]);for(let p=u.length,l=0;l<p;l++){const f=u[l],d=i[f];d.distance===-1&&(d.distance=i[a].distance+1,d.parent=a,c.unshift(f))}}return i}function r(o,i){return function(c){return i(o(c))}}function n(o,i){const c=[i[o].parent,o];let a=e[i[o].parent][o],u=i[o].parent;for(;i[u].parent;)c.unshift(i[u].parent),a=r(e[i[u].parent][u],a),u=i[u].parent;return a.conversion=c,a}return $e=function(o){const i=s(o),c={},a=Object.keys(i);for(let u=a.length,p=0;p<u;p++){const l=a[p];i[l].parent!==null&&(c[l]=n(l,i))}return c},$e}var ve,lt;function Un(){if(lt)return ve;lt=1;const e=at(),t=Gn(),s={},r=Object.keys(e);function n(i){const c=function(...a){const u=a[0];return u==null?u:(u.length>1&&(a=u),i(a))};return"conversion"in i&&(c.conversion=i.conversion),c}function o(i){const c=function(...a){const u=a[0];if(u==null)return u;u.length>1&&(a=u);const p=i(a);if(typeof p=="object")for(let l=p.length,f=0;f<l;f++)p[f]=Math.round(p[f]);return p};return"conversion"in i&&(c.conversion=i.conversion),c}return r.forEach(i=>{s[i]={},Object.defineProperty(s[i],"channels",{value:e[i].channels}),Object.defineProperty(s[i],"labels",{value:e[i].labels});const c=t(i);Object.keys(c).forEach(u=>{const p=c[u];s[i][u]=o(p),s[i][u].raw=n(p)})}),ve=s,ve}Ce.exports,function(e){const t=(p,l)=>(...f)=>`\x1B[${p(...f)+l}m`,s=(p,l)=>(...f)=>{const d=p(...f);return`\x1B[${38+l};5;${d}m`},r=(p,l)=>(...f)=>{const d=p(...f);return`\x1B[${38+l};2;${d[0]};${d[1]};${d[2]}m`},n=p=>p,o=(p,l,f)=>[p,l,f],i=(p,l,f)=>{Object.defineProperty(p,l,{get:()=>{const d=f();return Object.defineProperty(p,l,{value:d,enumerable:!0,configurable:!0}),d},enumerable:!0,configurable:!0})};let c;const a=(p,l,f,d)=>{c===void 0&&(c=Un());const m=d?10:0,h={};for(const[g,y]of Object.entries(c)){const T=g==="ansi16"?"ansi":g;g===l?h[T]=p(f,m):typeof y=="object"&&(h[T]=p(y[l],m))}return h};function u(){const p=new Map,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};l.color.gray=l.color.blackBright,l.bgColor.bgGray=l.bgColor.bgBlackBright,l.color.grey=l.color.blackBright,l.bgColor.bgGrey=l.bgColor.bgBlackBright;for(const[f,d]of Object.entries(l)){for(const[m,h]of Object.entries(d))l[m]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[m]=l[m],p.set(h[0],h[1]);Object.defineProperty(l,f,{value:d,enumerable:!1})}return Object.defineProperty(l,"codes",{value:p,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",i(l.color,"ansi",()=>a(t,"ansi16",n,!1)),i(l.color,"ansi256",()=>a(s,"ansi256",n,!1)),i(l.color,"ansi16m",()=>a(r,"rgb",o,!1)),i(l.bgColor,"ansi",()=>a(t,"ansi16",n,!0)),i(l.bgColor,"ansi256",()=>a(s,"ansi256",n,!0)),i(l.bgColor,"ansi16m",()=>a(r,"rgb",o,!0)),l}Object.defineProperty(e,"exports",{enumerable:!0,get:u})}(Ce);var Xn=Ce.exports,zn=(e,t=process.argv)=>{const s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),n=t.indexOf("--");return r!==-1&&(n===-1||r<n)};const qn=Fn,ut=Je,x=zn,{env:$}=process;let P;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?P=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(P=1),"FORCE_COLOR"in $&&($.FORCE_COLOR==="true"?P=1:$.FORCE_COLOR==="false"?P=0:P=$.FORCE_COLOR.length===0?1:Math.min(parseInt($.FORCE_COLOR,10),3));function Te(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Oe(e,t){if(P===0)return 0;if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2;if(e&&!t&&P===void 0)return 0;const s=P||0;if($.TERM==="dumb")return s;if(process.platform==="win32"){const r=qn.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in $)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in $)||$.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0;if($.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $){const r=parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:s}function Kn(e){const t=Oe(e,e&&e.isTTY);return Te(t)}var pt={supportsColor:Kn,stdout:Te(Oe(!0,ut.isatty(1))),stderr:Te(Oe(!0,ut.isatty(2)))};const Hn=(e,t,s)=>{let r=e.indexOf(t);if(r===-1)return e;const n=t.length;let o=0,i="";do i+=e.substr(o,r-o)+t+s,o=r+n,r=e.indexOf(t,o);while(r!==-1);return i+=e.substr(o),i},Jn=(e,t,s,r)=>{let n=0,o="";do{const i=e[r-1]==="\r";o+=e.substr(n,(i?r-1:r)-n)+t+(i?`\r
1
+ import En from"cac";import Cn from"prompts";import{red as On,yellow as wn,green as Z}from"kolorist";import A from"node:fs";import k from"node:path";import*as Ue from"node:process";import D from"node:process";import{fileURLToPath as V}from"node:url";import*as Q from"fs";import de,{existsSync as L,rename as vn,unlink as $n,statSync as Tn,promises as jn,writeFileSync as An,createReadStream as Sn}from"fs";import*as ee from"path";import te,{resolve as C,parse as ne,dirname as Nn,sep as kn}from"path";import{glob as T,globSync as Xe}from"glob";import{normalizePath as ze,build as qe,defineConfig as Ke}from"vite";import{pathToFileURL as P}from"url";import{builtinModules as He}from"module";import Ve from"@vitejs/plugin-vue";import me from"vite-tsconfig-paths";import{viteExternalsPlugin as xn}from"vite-plugin-externals";import se from"fs-extra";import In from"os";import Je from"tty";import G from"zlib";import Fn from"util";import Ln from"vite-plugin-checker";import _n from"ajv/dist/2020.js";import Rn from"ajv-formats";import{readFile as We}from"fs/promises";import Mn,{AxiosError as Ye}from"axios";import{inc as Dn}from"semver";import*as E from"process";import{ConcurrencyManager as Gn}from"axios-concurrency";import Bn from"tinycolor2";function Ze(e,t){Q.statSync(e).isDirectory()?(Q.mkdirSync(t,{recursive:!0}),Q.readdirSync(e).forEach(s=>{const r=ee.resolve(e,s),n=ee.resolve(t,s);Ze(r,n)})):Q.copyFileSync(e,t)}function oe(e,t,s,r){const n=ee.join(e,r?.[s]??s);Ze(ee.join(t,s),n)}function Qe(e,t=2){if(!+e)return"0 Bytes";const s=1024,r=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],o=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**o).toFixed(r))} ${n[o]}`}const b={error:e=>console.log(On(e)),warn:e=>console.log(wn(e)),info:e=>console.log(Z(e))},X="_temp",S="dist/sections",he="dist/headers",ye="dist/footers",z="dist/templates",et=2*1024*1024;function ge(e){return!!e}function tt(){const e=["|","/","-","\\"];let t=0;return setInterval(()=>{process.stdout.write(`\r${e[t]}`),t=(t+1)%e.length},100)}function be(e){clearInterval(e),process.stdout.write("\r")}async function nt(e){try{const t=e,s=D.cwd(),r=k.join(s,t),n=["templates","headers","footers"],o={_gitignore:".gitignore"};A.existsSync(r)?(b.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const i=k.resolve(V(import.meta.url),"../..","template");A.readdirSync(i).filter(p=>p!=="package.json").filter(p=>!n.includes(p)).forEach(async p=>oe(r,i,p,o));const c=JSON.parse(A.readFileSync(k.join(i,"package.json"),"utf-8"));c.name=e;const a=k.join(r,"package.json");A.writeFileSync(a,`${JSON.stringify(c,null,2)}
2
+ `),b.info(`App ${e} created`)}catch(t){b.error(`Error while creating app: ${t.message}`),D.exit(1)}}async function st(e){try{const t=e,s=D.cwd(),r=k.join(s,"sections",t);A.existsSync(r)?(b.error(`Section with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const n=k.resolve(V(import.meta.url),"../..","template/sections/example-section");A.readdirSync(n).forEach(async o=>oe(r,n,o)),b.info(`Section ${e} created`)}catch(t){b.error(`Error while creating section: ${t.message}`),D.exit(1)}}async function ot(e,t=!1){try{const s=D.cwd(),r=k.join(s,"templates"),n={"template.ts":`${e}.ts`};A.existsSync(r)?A.existsSync(k.join(r,`${e}.ts`))&&(b.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),D.exit(1)):A.mkdirSync(r);const o=k.resolve(V(import.meta.url),"../..","template/templates");if(A.readdirSync(o).forEach(async i=>oe(r,o,i,n)),t){const i={headers:k.resolve(V(import.meta.url),"../..","template/headers"),footers:k.resolve(V(import.meta.url),"../..","template/footers")};["headers","footers"].forEach(c=>{const a=k.join(s,c);if(!A.existsSync(a)){A.mkdirSync(a);const p=i[c];A.readdirSync(p).forEach(async u=>oe(a,p,u))}})}b.info(`Template descriptor file [${e}.ts] has been created`)}catch(s){b.error(`Error while creating template descriptors: ${s.message}`),D.exit(1)}}var j=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.TemplateAsset=6]="TemplateAsset",e))(j||{}),I=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e))(I||{});function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}},Ce,it;function Pn(){return it||(it=1,Ce={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Ce}var Oe,at;function ct(){if(at)return Oe;at=1;const e=Pn(),t={};for(const n of Object.keys(e))t[e[n]]=n;const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Oe=s;for(const n of Object.keys(s)){if(!("channels"in s[n]))throw new Error("missing channels property: "+n);if(!("labels"in s[n]))throw new Error("missing channel labels property: "+n);if(s[n].labels.length!==s[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:o,labels:i}=s[n];delete s[n].channels,delete s[n].labels,Object.defineProperty(s[n],"channels",{value:o}),Object.defineProperty(s[n],"labels",{value:i})}s.rgb.hsl=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(o,i,c),p=Math.max(o,i,c),u=p-a;let l,f;p===a?l=0:o===p?l=(i-c)/u:i===p?l=2+(c-o)/u:c===p&&(l=4+(o-i)/u),l=Math.min(l*60,360),l<0&&(l+=360);const d=(a+p)/2;return p===a?f=0:d<=.5?f=u/(p+a):f=u/(2-p-a),[l,f*100,d*100]},s.rgb.hsv=function(n){let o,i,c,a,p;const u=n[0]/255,l=n[1]/255,f=n[2]/255,d=Math.max(u,l,f),m=d-Math.min(u,l,f),h=function(g){return(d-g)/6/m+1/2};return m===0?(a=0,p=0):(p=m/d,o=h(u),i=h(l),c=h(f),u===d?a=c-i:l===d?a=1/3+o-c:f===d&&(a=2/3+i-o),a<0?a+=1:a>1&&(a-=1)),[a*360,p*100,d*100]},s.rgb.hwb=function(n){const o=n[0],i=n[1];let c=n[2];const a=s.rgb.hsl(n)[0],p=1/255*Math.min(o,Math.min(i,c));return c=1-1/255*Math.max(o,Math.max(i,c)),[a,p*100,c*100]},s.rgb.cmyk=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.min(1-o,1-i,1-c),p=(1-o-a)/(1-a)||0,u=(1-i-a)/(1-a)||0,l=(1-c-a)/(1-a)||0;return[p*100,u*100,l*100,a*100]};function r(n,o){return(n[0]-o[0])**2+(n[1]-o[1])**2+(n[2]-o[2])**2}return s.rgb.keyword=function(n){const o=t[n];if(o)return o;let i=1/0,c;for(const a of Object.keys(e)){const p=e[a],u=r(n,p);u<i&&(i=u,c=a)}return c},s.keyword.rgb=function(n){return e[n]},s.rgb.xyz=function(n){let o=n[0]/255,i=n[1]/255,c=n[2]/255;o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;const a=o*.4124+i*.3576+c*.1805,p=o*.2126+i*.7152+c*.0722,u=o*.0193+i*.1192+c*.9505;return[a*100,p*100,u*100]},s.rgb.lab=function(n){const o=s.rgb.xyz(n);let i=o[0],c=o[1],a=o[2];i/=95.047,c/=100,a/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const p=116*c-16,u=500*(i-c),l=200*(c-a);return[p,u,l]},s.hsl.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;let a,p,u;if(i===0)return u=c*255,[u,u,u];c<.5?a=c*(1+i):a=c+i-c*i;const l=2*c-a,f=[0,0,0];for(let d=0;d<3;d++)p=o+1/3*-(d-1),p<0&&p++,p>1&&p--,6*p<1?u=l+(a-l)*6*p:2*p<1?u=a:3*p<2?u=l+(a-l)*(2/3-p)*6:u=l,f[d]=u*255;return f},s.hsl.hsv=function(n){const o=n[0];let i=n[1]/100,c=n[2]/100,a=i;const p=Math.max(c,.01);c*=2,i*=c<=1?c:2-c,a*=p<=1?p:2-p;const u=(c+i)/2,l=c===0?2*a/(p+a):2*i/(c+i);return[o,l*100,u*100]},s.hsv.rgb=function(n){const o=n[0]/60,i=n[1]/100;let c=n[2]/100;const a=Math.floor(o)%6,p=o-Math.floor(o),u=255*c*(1-i),l=255*c*(1-i*p),f=255*c*(1-i*(1-p));switch(c*=255,a){case 0:return[c,f,u];case 1:return[l,c,u];case 2:return[u,c,f];case 3:return[u,l,c];case 4:return[f,u,c];case 5:return[c,u,l]}},s.hsv.hsl=function(n){const o=n[0],i=n[1]/100,c=n[2]/100,a=Math.max(c,.01);let p,u;u=(2-i)*c;const l=(2-i)*a;return p=i*a,p/=l<=1?l:2-l,p=p||0,u/=2,[o,p*100,u*100]},s.hwb.rgb=function(n){const o=n[0]/360;let i=n[1]/100,c=n[2]/100;const a=i+c;let p;a>1&&(i/=a,c/=a);const u=Math.floor(6*o),l=1-c;p=6*o-u,u&1&&(p=1-p);const f=i+p*(l-i);let d,m,h;switch(u){default:case 6:case 0:d=l,m=f,h=i;break;case 1:d=f,m=l,h=i;break;case 2:d=i,m=l,h=f;break;case 3:d=i,m=f,h=l;break;case 4:d=f,m=i,h=l;break;case 5:d=l,m=i,h=f;break}return[d*255,m*255,h*255]},s.cmyk.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100,a=n[3]/100,p=1-Math.min(1,o*(1-a)+a),u=1-Math.min(1,i*(1-a)+a),l=1-Math.min(1,c*(1-a)+a);return[p*255,u*255,l*255]},s.xyz.rgb=function(n){const o=n[0]/100,i=n[1]/100,c=n[2]/100;let a,p,u;return a=o*3.2406+i*-1.5372+c*-.4986,p=o*-.9689+i*1.8758+c*.0415,u=o*.0557+i*-.204+c*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,a=Math.min(Math.max(0,a),1),p=Math.min(Math.max(0,p),1),u=Math.min(Math.max(0,u),1),[a*255,p*255,u*255]},s.xyz.lab=function(n){let o=n[0],i=n[1],c=n[2];o/=95.047,i/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const a=116*i-16,p=500*(o-i),u=200*(i-c);return[a,p,u]},s.lab.xyz=function(n){const o=n[0],i=n[1],c=n[2];let a,p,u;p=(o+16)/116,a=i/500+p,u=p-c/200;const l=p**3,f=a**3,d=u**3;return p=l>.008856?l:(p-16/116)/7.787,a=f>.008856?f:(a-16/116)/7.787,u=d>.008856?d:(u-16/116)/7.787,a*=95.047,p*=100,u*=108.883,[a,p,u]},s.lab.lch=function(n){const o=n[0],i=n[1],c=n[2];let a;a=Math.atan2(c,i)*360/2/Math.PI,a<0&&(a+=360);const u=Math.sqrt(i*i+c*c);return[o,u,a]},s.lch.lab=function(n){const o=n[0],i=n[1],a=n[2]/360*2*Math.PI,p=i*Math.cos(a),u=i*Math.sin(a);return[o,p,u]},s.rgb.ansi16=function(n,o=null){const[i,c,a]=n;let p=o===null?s.rgb.hsv(n)[2]:o;if(p=Math.round(p/50),p===0)return 30;let u=30+(Math.round(a/255)<<2|Math.round(c/255)<<1|Math.round(i/255));return p===2&&(u+=60),u},s.hsv.ansi16=function(n){return s.rgb.ansi16(s.hsv.rgb(n),n[2])},s.rgb.ansi256=function(n){const o=n[0],i=n[1],c=n[2];return o===i&&i===c?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(i/255*5)+Math.round(c/255*5)},s.ansi16.rgb=function(n){let o=n%10;if(o===0||o===7)return n>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const i=(~~(n>50)+1)*.5,c=(o&1)*i*255,a=(o>>1&1)*i*255,p=(o>>2&1)*i*255;return[c,a,p]},s.ansi256.rgb=function(n){if(n>=232){const p=(n-232)*10+8;return[p,p,p]}n-=16;let o;const i=Math.floor(n/36)/5*255,c=Math.floor((o=n%36)/6)/5*255,a=o%6/5*255;return[i,c,a]},s.rgb.hex=function(n){const i=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i},s.hex.rgb=function(n){const o=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!o)return[0,0,0];let i=o[0];o[0].length===3&&(i=i.split("").map(l=>l+l).join(""));const c=parseInt(i,16),a=c>>16&255,p=c>>8&255,u=c&255;return[a,p,u]},s.rgb.hcg=function(n){const o=n[0]/255,i=n[1]/255,c=n[2]/255,a=Math.max(Math.max(o,i),c),p=Math.min(Math.min(o,i),c),u=a-p;let l,f;return u<1?l=p/(1-u):l=0,u<=0?f=0:a===o?f=(i-c)/u%6:a===i?f=2+(c-o)/u:f=4+(o-i)/u,f/=6,f%=1,[f*360,u*100,l*100]},s.hsl.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=i<.5?2*o*i:2*o*(1-i);let a=0;return c<1&&(a=(i-.5*c)/(1-c)),[n[0],c*100,a*100]},s.hsv.hcg=function(n){const o=n[1]/100,i=n[2]/100,c=o*i;let a=0;return c<1&&(a=(i-c)/(1-c)),[n[0],c*100,a*100]},s.hcg.rgb=function(n){const o=n[0]/360,i=n[1]/100,c=n[2]/100;if(i===0)return[c*255,c*255,c*255];const a=[0,0,0],p=o%1*6,u=p%1,l=1-u;let f=0;switch(Math.floor(p)){case 0:a[0]=1,a[1]=u,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=u;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=u,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return f=(1-i)*c,[(i*a[0]+f)*255,(i*a[1]+f)*255,(i*a[2]+f)*255]},s.hcg.hsv=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);let a=0;return c>0&&(a=o/c),[n[0],a*100,c*100]},s.hcg.hsl=function(n){const o=n[1]/100,c=n[2]/100*(1-o)+.5*o;let a=0;return c>0&&c<.5?a=o/(2*c):c>=.5&&c<1&&(a=o/(2*(1-c))),[n[0],a*100,c*100]},s.hcg.hwb=function(n){const o=n[1]/100,i=n[2]/100,c=o+i*(1-o);return[n[0],(c-o)*100,(1-c)*100]},s.hwb.hcg=function(n){const o=n[1]/100,c=1-n[2]/100,a=c-o;let p=0;return a<1&&(p=(c-a)/(1-a)),[n[0],a*100,p*100]},s.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]},s.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]},s.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]},s.gray.hsl=function(n){return[0,0,n[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(n){return[0,100,n[0]]},s.gray.cmyk=function(n){return[0,0,0,n[0]]},s.gray.lab=function(n){return[n[0],0,0]},s.gray.hex=function(n){const o=Math.round(n[0]/100*255)&255,c=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".substring(c.length)+c},s.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]},Oe}var we,lt;function Un(){if(lt)return we;lt=1;const e=ct();function t(){const o={},i=Object.keys(e);for(let c=i.length,a=0;a<c;a++)o[i[a]]={distance:-1,parent:null};return o}function s(o){const i=t(),c=[o];for(i[o].distance=0;c.length;){const a=c.pop(),p=Object.keys(e[a]);for(let u=p.length,l=0;l<u;l++){const f=p[l],d=i[f];d.distance===-1&&(d.distance=i[a].distance+1,d.parent=a,c.unshift(f))}}return i}function r(o,i){return function(c){return i(o(c))}}function n(o,i){const c=[i[o].parent,o];let a=e[i[o].parent][o],p=i[o].parent;for(;i[p].parent;)c.unshift(i[p].parent),a=r(e[i[p].parent][p],a),p=i[p].parent;return a.conversion=c,a}return we=function(o){const i=s(o),c={},a=Object.keys(i);for(let p=a.length,u=0;u<p;u++){const l=a[u];i[l].parent!==null&&(c[l]=n(l,i))}return c},we}var ve,pt;function Xn(){if(pt)return ve;pt=1;const e=ct(),t=Un(),s={},r=Object.keys(e);function n(i){const c=function(...a){const p=a[0];return p==null?p:(p.length>1&&(a=p),i(a))};return"conversion"in i&&(c.conversion=i.conversion),c}function o(i){const c=function(...a){const p=a[0];if(p==null)return p;p.length>1&&(a=p);const u=i(a);if(typeof u=="object")for(let l=u.length,f=0;f<l;f++)u[f]=Math.round(u[f]);return u};return"conversion"in i&&(c.conversion=i.conversion),c}return r.forEach(i=>{s[i]={},Object.defineProperty(s[i],"channels",{value:e[i].channels}),Object.defineProperty(s[i],"labels",{value:e[i].labels});const c=t(i);Object.keys(c).forEach(p=>{const u=c[p];s[i][p]=o(u),s[i][p].raw=n(u)})}),ve=s,ve}Ee.exports,function(e){const t=(u,l)=>(...f)=>`\x1B[${u(...f)+l}m`,s=(u,l)=>(...f)=>{const d=u(...f);return`\x1B[${38+l};5;${d}m`},r=(u,l)=>(...f)=>{const d=u(...f);return`\x1B[${38+l};2;${d[0]};${d[1]};${d[2]}m`},n=u=>u,o=(u,l,f)=>[u,l,f],i=(u,l,f)=>{Object.defineProperty(u,l,{get:()=>{const d=f();return Object.defineProperty(u,l,{value:d,enumerable:!0,configurable:!0}),d},enumerable:!0,configurable:!0})};let c;const a=(u,l,f,d)=>{c===void 0&&(c=Xn());const m=d?10:0,h={};for(const[g,y]of Object.entries(c)){const $=g==="ansi16"?"ansi":g;g===l?h[$]=u(f,m):typeof y=="object"&&(h[$]=u(y[l],m))}return h};function p(){const u=new Map,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};l.color.gray=l.color.blackBright,l.bgColor.bgGray=l.bgColor.bgBlackBright,l.color.grey=l.color.blackBright,l.bgColor.bgGrey=l.bgColor.bgBlackBright;for(const[f,d]of Object.entries(l)){for(const[m,h]of Object.entries(d))l[m]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},d[m]=l[m],u.set(h[0],h[1]);Object.defineProperty(l,f,{value:d,enumerable:!1})}return Object.defineProperty(l,"codes",{value:u,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",i(l.color,"ansi",()=>a(t,"ansi16",n,!1)),i(l.color,"ansi256",()=>a(s,"ansi256",n,!1)),i(l.color,"ansi16m",()=>a(r,"rgb",o,!1)),i(l.bgColor,"ansi",()=>a(t,"ansi16",n,!0)),i(l.bgColor,"ansi256",()=>a(s,"ansi256",n,!0)),i(l.bgColor,"ansi16m",()=>a(r,"rgb",o,!0)),l}Object.defineProperty(e,"exports",{enumerable:!0,get:p})}(Ee);var zn=Ee.exports,qn=(e,t=process.argv)=>{const s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),n=t.indexOf("--");return r!==-1&&(n===-1||r<n)};const Kn=In,ut=Je,x=qn,{env:w}=process;let B;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?B=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(B=1),"FORCE_COLOR"in w&&(w.FORCE_COLOR==="true"?B=1:w.FORCE_COLOR==="false"?B=0:B=w.FORCE_COLOR.length===0?1:Math.min(parseInt(w.FORCE_COLOR,10),3));function $e(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Te(e,t){if(B===0)return 0;if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2;if(e&&!t&&B===void 0)return 0;const s=B||0;if(w.TERM==="dumb")return s;if(process.platform==="win32"){const r=Kn.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in w)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in w)||w.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in w){const r=parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:s}function Hn(e){const t=Te(e,e&&e.isTTY);return $e(t)}var ft={supportsColor:Hn,stdout:$e(Te(!0,ut.isatty(1))),stderr:$e(Te(!0,ut.isatty(2)))};const Vn=(e,t,s)=>{let r=e.indexOf(t);if(r===-1)return e;const n=t.length;let o=0,i="";do i+=e.substr(o,r-o)+t+s,o=r+n,r=e.indexOf(t,o);while(r!==-1);return i+=e.substr(o),i},Jn=(e,t,s,r)=>{let n=0,o="";do{const i=e[r-1]==="\r";o+=e.substr(n,(i?r-1:r)-n)+t+(i?`\r
3
3
  `:`
4
4
  `)+s,n=r+1,r=e.indexOf(`
5
- `,n)}while(r!==-1);return o+=e.substr(n),o};var Wn={stringReplaceAll:Hn,stringEncaseCRLFWithFirstIndex:Jn},je,ft;function Yn(){if(ft)return je;ft=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,n=new Map([["n",`
6
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function o(u){const p=u[0]==="u",l=u[1]==="{";return p&&!l&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):p&&l?String.fromCodePoint(parseInt(u.slice(2,-1),16)):n.get(u)||u}function i(u,p){const l=[],f=p.trim().split(/\s*,\s*/g);let d;for(const m of f){const h=Number(m);if(!Number.isNaN(h))l.push(h);else if(d=m.match(s))l.push(d[2].replace(r,(g,y,T)=>y?o(y):T));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return l}function c(u){t.lastIndex=0;const p=[];let l;for(;(l=t.exec(u))!==null;){const f=l[1];if(l[2]){const d=i(f,l[2]);p.push([f].concat(d))}else p.push([f])}return p}function a(u,p){const l={};for(const d of p)for(const m of d.styles)l[m[0]]=d.inverse?null:m.slice(1);let f=u;for(const[d,m]of Object.entries(l))if(Array.isArray(m)){if(!(d in f))throw new Error(`Unknown Chalk style: ${d}`);f=m.length>0?f[d](...m):f[d]}return f}return je=(u,p)=>{const l=[],f=[];let d=[];if(p.replace(e,(m,h,g,y,T,N)=>{if(h)d.push(o(h));else if(y){const L=d.join("");d=[],f.push(l.length===0?L:a(u,l)(L)),l.push({inverse:g,styles:c(y)})}else if(T){if(l.length===0)throw new Error("Found extraneous } in Chalk template literal");f.push(a(u,l)(d.join(""))),d=[],l.pop()}else d.push(N)}),f.push(d.join("")),l.length>0){const m=`Chalk template literal is missing ${l.length} closing bracket${l.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return f.join("")},je}const W=Xn,{stdout:Se,stderr:Ae}=pt,{stringReplaceAll:Zn,stringEncaseCRLFWithFirstIndex:Vn}=Wn,{isArray:re}=Array,dt=["ansi","ansi","ansi256","ansi16m"],q=Object.create(null),Qn=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const s=Se?Se.level:0;e.level=t.level===void 0?s:t.level};class es{constructor(t){return mt(t)}}const mt=e=>{const t={};return Qn(t,e),t.template=(...s)=>gt(t.template,...s),Object.setPrototypeOf(t,ie.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=es,t.template};function ie(e){return mt(e)}for(const[e,t]of Object.entries(W))q[e]={get(){const s=ae(this,ke(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:s}),s}};q.visible={get(){const e=ae(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const ht=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of ht)q[e]={get(){const{level:t}=this;return function(...s){const r=ke(W.color[dt[t]][e](...s),W.color.close,this._styler);return ae(this,r,this._isEmpty)}}};for(const e of ht){const t="bg"+e[0].toUpperCase()+e.slice(1);q[t]={get(){const{level:s}=this;return function(...r){const n=ke(W.bgColor[dt[s]][e](...r),W.bgColor.close,this._styler);return ae(this,n,this._isEmpty)}}}}const ts=Object.defineProperties(()=>{},{...q,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ke=(e,t,s)=>{let r,n;return s===void 0?(r=e,n=t):(r=s.openAll+e,n=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:s}},ae=(e,t,s)=>{const r=(...n)=>re(n[0])&&re(n[0].raw)?yt(r,gt(r,...n)):yt(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,ts),r._generator=e,r._styler=t,r._isEmpty=s,r},yt=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let s=e._styler;if(s===void 0)return t;const{openAll:r,closeAll:n}=s;if(t.indexOf("\x1B")!==-1)for(;s!==void 0;)t=Zn(t,s.close,s.open),s=s.parent;const o=t.indexOf(`
7
- `);return o!==-1&&(t=Vn(t,n,r,o)),r+t+n};let Fe;const gt=(e,...t)=>{const[s]=t;if(!re(s)||!re(s.raw))return t.join(" ");const r=t.slice(1),n=[s.raw[0]];for(let o=1;o<s.length;o++)n.push(String(r[o-1]).replace(/[{}\\]/g,"\\$&"),String(s.raw[o]));return Fe===void 0&&(Fe=Yn()),Fe(e,n.join(""))};Object.defineProperties(ie.prototype,q);const ce=ie();ce.supportsColor=Se,ce.stderr=ie({level:Ae?Ae.level:0}),ce.stderr.supportsColor=Ae;var ns=ce;const le=ot(ns);var xe={exports:{}},ue={exports:{}},_e,bt;function ss(){if(bt)return _e;bt=1;var e=1e3,t=e*60,s=t*60,r=s*24,n=r*7,o=r*365.25;_e=function(p,l){l=l||{};var f=typeof p;if(f==="string"&&p.length>0)return i(p);if(f==="number"&&isFinite(p))return l.long?a(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function i(p){if(p=String(p),!(p.length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(l){var f=parseFloat(l[1]),d=(l[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*n;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*s;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(p){var l=Math.abs(p);return l>=r?Math.round(p/r)+"d":l>=s?Math.round(p/s)+"h":l>=t?Math.round(p/t)+"m":l>=e?Math.round(p/e)+"s":p+"ms"}function a(p){var l=Math.abs(p);return l>=r?u(p,l,r,"day"):l>=s?u(p,l,s,"hour"):l>=t?u(p,l,t,"minute"):l>=e?u(p,l,e,"second"):p+" ms"}function u(p,l,f,d){var m=l>=f*1.5;return Math.round(p/f)+" "+d+(m?"s":"")}return _e}var Re,Ct;function Et(){if(Ct)return Re;Ct=1;function e(t){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=o,r.enabled=c,r.humanize=ss(),r.destroy=p,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function s(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=s;function r(l){let f,d=null,m,h;function g(...y){if(!g.enabled)return;const T=g,N=Number(new Date),L=N-(f||N);T.diff=L,T.prev=f,T.curr=N,f=N,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let U=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(Z,yn)=>{if(Z==="%%")return"%";U++;const Pe=r.formatters[yn];if(typeof Pe=="function"){const gn=y[U];Z=Pe.call(T,gn),y.splice(U,1),U--}return Z}),r.formatArgs.call(T,y),(T.log||r.log).apply(T,y)}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==r.namespaces&&(m=r.namespaces,h=r.enabled(l)),h),set:y=>{d=y}}),typeof r.init=="function"&&r.init(g),g}function n(l,f){const d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const d=(typeof l=="string"?l:"").split(/[\s,]+/),m=d.length;for(f=0;f<m;f++)d[f]&&(l=d[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function i(){const l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function c(l){if(l[l.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f<d;f++)if(r.skips[f].test(l))return!1;for(f=0,d=r.names.length;f<d;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return Re=e,Re}var wt;function os(){return wt||(wt=1,function(e,t){t.formatArgs=r,t.save=n,t.load=o,t.useColors=s,t.storage=i(),t.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;a.splice(1,0,u,"color: inherit");let p=0,l=0;a[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(p++,f==="%c"&&(l=p))}),a.splice(l,0,u)}t.log=console.debug||console.log||(()=>{});function n(a){try{a?t.storage.setItem("debug",a):t.storage.removeItem("debug")}catch{}}function o(){let a;try{a=t.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function i(){try{return localStorage}catch{}}e.exports=Et()(t);const{formatters:c}=e.exports;c.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}}(ue,ue.exports)),ue.exports}var pe={exports:{}},$t;function rs(){return $t||($t=1,function(e,t){const s=Je,r=xn;t.init=p,t.log=c,t.formatArgs=o,t.save=a,t.load=u,t.useColors=n,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const f=pt;f&&(f.stderr||f).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(f=>/^debug_/i.test(f)).reduce((f,d)=>{const m=d.substring(6).toLowerCase().replace(/_([a-z])/g,(g,y)=>y.toUpperCase());let h=process.env[d];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),f[m]=h,f},{});function n(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:s.isatty(process.stderr.fd)}function o(f){const{namespace:d,useColors:m}=this;if(m){const h=this.color,g="\x1B[3"+(h<8?h:"8;5;"+h),y=` ${g};1m${d} \x1B[0m`;f[0]=y+f[0].split(`
5
+ `,n)}while(r!==-1);return o+=e.substr(n),o};var Wn={stringReplaceAll:Vn,stringEncaseCRLFWithFirstIndex:Jn},je,dt;function Yn(){if(dt)return je;dt=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,n=new Map([["n",`
6
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function o(p){const u=p[0]==="u",l=p[1]==="{";return u&&!l&&p.length===5||p[0]==="x"&&p.length===3?String.fromCharCode(parseInt(p.slice(1),16)):u&&l?String.fromCodePoint(parseInt(p.slice(2,-1),16)):n.get(p)||p}function i(p,u){const l=[],f=u.trim().split(/\s*,\s*/g);let d;for(const m of f){const h=Number(m);if(!Number.isNaN(h))l.push(h);else if(d=m.match(s))l.push(d[2].replace(r,(g,y,$)=>y?o(y):$));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${p}')`)}return l}function c(p){t.lastIndex=0;const u=[];let l;for(;(l=t.exec(p))!==null;){const f=l[1];if(l[2]){const d=i(f,l[2]);u.push([f].concat(d))}else u.push([f])}return u}function a(p,u){const l={};for(const d of u)for(const m of d.styles)l[m[0]]=d.inverse?null:m.slice(1);let f=p;for(const[d,m]of Object.entries(l))if(Array.isArray(m)){if(!(d in f))throw new Error(`Unknown Chalk style: ${d}`);f=m.length>0?f[d](...m):f[d]}return f}return je=(p,u)=>{const l=[],f=[];let d=[];if(u.replace(e,(m,h,g,y,$,R)=>{if(h)d.push(o(h));else if(y){const M=d.join("");d=[],f.push(l.length===0?M:a(p,l)(M)),l.push({inverse:g,styles:c(y)})}else if($){if(l.length===0)throw new Error("Found extraneous } in Chalk template literal");f.push(a(p,l)(d.join(""))),d=[],l.pop()}else d.push(R)}),f.push(d.join("")),l.length>0){const m=`Chalk template literal is missing ${l.length} closing bracket${l.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return f.join("")},je}const J=zn,{stdout:Ae,stderr:Se}=ft,{stringReplaceAll:Zn,stringEncaseCRLFWithFirstIndex:Qn}=Wn,{isArray:re}=Array,mt=["ansi","ansi","ansi256","ansi16m"],q=Object.create(null),es=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const s=Ae?Ae.level:0;e.level=t.level===void 0?s:t.level};class ts{constructor(t){return ht(t)}}const ht=e=>{const t={};return es(t,e),t.template=(...s)=>bt(t.template,...s),Object.setPrototypeOf(t,ie.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=ts,t.template};function ie(e){return ht(e)}for(const[e,t]of Object.entries(J))q[e]={get(){const s=ae(this,Ne(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:s}),s}};q.visible={get(){const e=ae(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const yt=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of yt)q[e]={get(){const{level:t}=this;return function(...s){const r=Ne(J.color[mt[t]][e](...s),J.color.close,this._styler);return ae(this,r,this._isEmpty)}}};for(const e of yt){const t="bg"+e[0].toUpperCase()+e.slice(1);q[t]={get(){const{level:s}=this;return function(...r){const n=Ne(J.bgColor[mt[s]][e](...r),J.bgColor.close,this._styler);return ae(this,n,this._isEmpty)}}}}const ns=Object.defineProperties(()=>{},{...q,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ne=(e,t,s)=>{let r,n;return s===void 0?(r=e,n=t):(r=s.openAll+e,n=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:s}},ae=(e,t,s)=>{const r=(...n)=>re(n[0])&&re(n[0].raw)?gt(r,bt(r,...n)):gt(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,ns),r._generator=e,r._styler=t,r._isEmpty=s,r},gt=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let s=e._styler;if(s===void 0)return t;const{openAll:r,closeAll:n}=s;if(t.indexOf("\x1B")!==-1)for(;s!==void 0;)t=Zn(t,s.close,s.open),s=s.parent;const o=t.indexOf(`
7
+ `);return o!==-1&&(t=Qn(t,n,r,o)),r+t+n};let ke;const bt=(e,...t)=>{const[s]=t;if(!re(s)||!re(s.raw))return t.join(" ");const r=t.slice(1),n=[s.raw[0]];for(let o=1;o<s.length;o++)n.push(String(r[o-1]).replace(/[{}\\]/g,"\\$&"),String(s.raw[o]));return ke===void 0&&(ke=Yn()),ke(e,n.join(""))};Object.defineProperties(ie.prototype,q);const ce=ie();ce.supportsColor=Ae,ce.stderr=ie({level:Se?Se.level:0}),ce.stderr.supportsColor=Se;var ss=ce;const le=rt(ss);var xe={exports:{}},pe={exports:{}},Ie,Et;function os(){if(Et)return Ie;Et=1;var e=1e3,t=e*60,s=t*60,r=s*24,n=r*7,o=r*365.25;Ie=function(u,l){l=l||{};var f=typeof u;if(f==="string"&&u.length>0)return i(u);if(f==="number"&&isFinite(u))return l.long?a(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function i(u){if(u=String(u),!(u.length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(l){var f=parseFloat(l[1]),d=(l[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*n;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*s;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var l=Math.abs(u);return l>=r?Math.round(u/r)+"d":l>=s?Math.round(u/s)+"h":l>=t?Math.round(u/t)+"m":l>=e?Math.round(u/e)+"s":u+"ms"}function a(u){var l=Math.abs(u);return l>=r?p(u,l,r,"day"):l>=s?p(u,l,s,"hour"):l>=t?p(u,l,t,"minute"):l>=e?p(u,l,e,"second"):u+" ms"}function p(u,l,f,d){var m=l>=f*1.5;return Math.round(u/f)+" "+d+(m?"s":"")}return Ie}var Fe,Ct;function Ot(){if(Ct)return Fe;Ct=1;function e(t){r.debug=r,r.default=r,r.coerce=p,r.disable=i,r.enable=o,r.enabled=c,r.humanize=os(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function s(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=s;function r(l){let f,d=null,m,h;function g(...y){if(!g.enabled)return;const $=g,R=Number(new Date),M=R-(f||R);$.diff=M,$.prev=f,$.curr=R,f=R,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let U=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(Y,gn)=>{if(Y==="%%")return"%";U++;const Pe=r.formatters[gn];if(typeof Pe=="function"){const bn=y[U];Y=Pe.call($,bn),y.splice(U,1),U--}return Y}),r.formatArgs.call($,y),($.log||r.log).apply($,y)}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==r.namespaces&&(m=r.namespaces,h=r.enabled(l)),h),set:y=>{d=y}}),typeof r.init=="function"&&r.init(g),g}function n(l,f){const d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const d=(typeof l=="string"?l:"").split(/[\s,]+/),m=d.length;for(f=0;f<m;f++)d[f]&&(l=d[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function i(){const l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function c(l){if(l[l.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f<d;f++)if(r.skips[f].test(l))return!1;for(f=0,d=r.names.length;f<d;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function p(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return Fe=e,Fe}var wt;function rs(){return wt||(wt=1,function(e,t){t.formatArgs=r,t.save=n,t.load=o,t.useColors=s,t.storage=i(),t.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;a.splice(1,0,p,"color: inherit");let u=0,l=0;a[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(l=u))}),a.splice(l,0,p)}t.log=console.debug||console.log||(()=>{});function n(a){try{a?t.storage.setItem("debug",a):t.storage.removeItem("debug")}catch{}}function o(){let a;try{a=t.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function i(){try{return localStorage}catch{}}e.exports=Ot()(t);const{formatters:c}=e.exports;c.j=function(a){try{return JSON.stringify(a)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}}(pe,pe.exports)),pe.exports}var ue={exports:{}},vt;function is(){return vt||(vt=1,function(e,t){const s=Je,r=Fn;t.init=u,t.log=c,t.formatArgs=o,t.save=a,t.load=p,t.useColors=n,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const f=ft;f&&(f.stderr||f).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(f=>/^debug_/i.test(f)).reduce((f,d)=>{const m=d.substring(6).toLowerCase().replace(/_([a-z])/g,(g,y)=>y.toUpperCase());let h=process.env[d];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),f[m]=h,f},{});function n(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:s.isatty(process.stderr.fd)}function o(f){const{namespace:d,useColors:m}=this;if(m){const h=this.color,g="\x1B[3"+(h<8?h:"8;5;"+h),y=` ${g};1m${d} \x1B[0m`;f[0]=y+f[0].split(`
8
8
  `).join(`
9
9
  `+y),f.push(g+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else f[0]=i()+d+" "+f[0]}function i(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function c(...f){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...f)+`
10
- `)}function a(f){f?process.env.DEBUG=f:delete process.env.DEBUG}function u(){return process.env.DEBUG}function p(f){f.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let m=0;m<d.length;m++)f.inspectOpts[d[m]]=t.inspectOpts[d[m]]}e.exports=Et()(t);const{formatters:l}=e.exports;l.o=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts).split(`
11
- `).map(d=>d.trim()).join(" ")},l.O=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts)}}(pe,pe.exports)),pe.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xe.exports=os():xe.exports=rs();var is=xe.exports;const as=ot(is),cs=e=>typeof e=="function",ls=e=>Object.prototype.toString.call(e)==="[object RegExp]";function vt(e,t){let s=[];try{de.existsSync(e)&&(de.lstatSync(e).isDirectory()?de.readdirSync(e).forEach(function(o){const i=vt(ee.join(e,"/",o),t);s=s.concat(i)}):t!==void 0||s.push(e))}catch(r){throw r}return s}const Ie=as.debug("vite-plugin-compression"),us=/\.(js|mjs|json|css|html)$/i,Tt=new Map;function ps(e={}){let t,s;const r={name:"vite:compression"},{disable:n=!1,filter:o=us,verbose:i=!0,threshold:c=1025,compressionOptions:a={},deleteOriginFile:u=!1,success:p=()=>{}}=e;let{ext:l=""}=e;const{algorithm:f="gzip"}=e;return f==="gzip"&&!l&&(l=".gz"),f==="brotliCompress"&&!l&&(l=".br"),n?r:(Ie("plugin options:",e),{...r,apply:"build",enforce:"post",configResolved(d){s=d,t=ee.isAbsolute(s.build.outDir)?s.build.outDir:ee.join(s.root,s.build.outDir),Ie("resolvedConfig:",d)},async closeBundle(){let d=vt(t)||[];if(Ie("files:",d),!d.length)return;d=fs(d,o);const m=ds(f,a),h=new Map,g=d.map(async y=>{const{mtimeMs:T,size:N}=await se.stat(y);if(T<=(Tt.get(y)||0)||N<c)return;let L=await se.readFile(y);u&&se.remove(y);try{L=await ms(L,f,m)}catch{s.logger.error("compress error:"+y)}const U=L.byteLength,fe=hs(y,l);h.set(y,{size:U/1024,oldSize:N/1024,cname:fe}),await se.writeFile(fe,L),Tt.set(y,Date.now())});return Promise.all(g).then(()=>{i&&(ys(s,h,f),p())})}})}function fs(e,t){if(t){const s=ls(t),r=cs(t);e=e.filter(n=>s?t.test(n):r?t(n):!0)}return e}function ds(e="",t={}){return{...{gzip:{level:B.constants.Z_BEST_COMPRESSION},deflate:{level:B.constants.Z_BEST_COMPRESSION},deflateRaw:{level:B.constants.Z_BEST_COMPRESSION},brotliCompress:{params:{[B.constants.BROTLI_PARAM_QUALITY]:B.constants.BROTLI_MAX_QUALITY,[B.constants.BROTLI_PARAM_MODE]:B.constants.BROTLI_MODE_TEXT}}}[e],...t}}function ms(e,t,s={}){return new Promise((r,n)=>{B[t](e,s,(o,i)=>o?n(o):r(i))})}function hs(e,t){const s=t.startsWith(".")?t:`.${t}`;return`${e}${s}`}function ys(e,t,s){e.logger.info(`
12
- ${le.cyan("\u2728 [vite-plugin-compression]:algorithm="+s)} - compressed file successfully: `);const r=Array.from(t.keys(),o=>o.length),n=Math.max(...r);t.forEach((o,i)=>{const{size:c,oldSize:a,cname:u}=o,p=Xe(u).replace(Xe(`${e.build.outDir}/`),""),l=`${a.toFixed(2)}kb / ${s}: ${c.toFixed(2)}kb`;e.logger.info(le.dim(ee.basename(e.build.outDir)+"/")+le.blueBright(p)+" ".repeat(2+n-i.length)+" "+le.dim(l))}),e.logger.info(`
13
- `)}const gs=()=>ps({ext:".gz",algorithm:"gzip",deleteOriginFile:!0}),Ot=()=>{const e=process.env.npm_lifecycle_event;return _n({typescript:!0,vueTsc:!1,eslint:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},bs={[_.Server]:[He(),me(),gs()],[_.Client]:[He(),me(),Ot(),kn({vue:"EcVue"})],[_.Misc]:[me(),Ot()]},v={SECTION:{source:"sections",dist:"dist/sections"},HEADER:{source:"headers",dist:"dist/headers"},FOOTER:{source:"footers",dist:"dist/footers"}};function Cs(e){return R(`${he}/${e}`)?"HEADER":R(`${ye}/${e}`)?"FOOTER":"SECTION"}const jt={"process.env":{NODE_ENV:"production"}},Es=[...Ke,...Ke.map(e=>`node:${e}`)],ws=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],I={[j.Server]:{pluginType:_.Server,define:jt,ssr:!0,ssrOptions:{noExternal:!0},outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/server`,externalOption:[...Es],entryFileNames:"server.js",inlineDynamicImports:!0},[j.Client]:{pluginType:_.Client,define:jt,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/client`,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",inlineDynamicImports:!0},[j.SectionSetting]:{pluginType:_.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/settings`,entryFileNames:"[name].mjs"},[j.SectionShowcase]:{pluginType:_.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/showcases`,entryFileNames:"[name].mjs"},[j.SectionAsset]:{pluginType:_.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/assets`,assetFileNames:"[name].[ext]"},[j.TemplateDescriptor]:{pluginType:_.Misc,ssr:!1,outDir:()=>`./${z}/js`,entryFileNames:`[name]${X}.mjs`},[j.TemplateAsset]:{pluginType:_.Misc,ssr:!1,outDir:()=>`./${z}/assets`,assetFileNames:"[name].[ext]"}};function $s(e){switch(typeof e){case"string":return[E(process.cwd(),e)];case"object":return e.map(t=>E(process.cwd(),t));default:return[]}}function vs(e,t){const{externalOption:s}=I[e];return t?.externalizeVue&&e===j.Server?[...s??[],...ws]:s}function St(e,t,s,r,n){const o=I[s].define,i=I[s].ssrOptions,c=I[s].entryFileNames,a=I[s].chunkFileNames,u=I[s].assetFileNames,p=I[s].inlineDynamicImports,l=vs(s,n);return{plugins:bs[I[s].pluginType],...o!=null&&{define:o},...i!=null&&{ssr:i},resolve:{alias:{"@":"/src"}},build:{ssr:I[s].ssr,outDir:I[s].outDir(e,r),emptyOutDir:!0,minify:"terser",terserOptions:{compress:{drop_console:!1}},rollupOptions:{...l!=null&&{external:l},preserveEntrySignatures:"strict",input:$s(t),output:{validate:!0,inlineDynamicImports:p,...c!=null&&{entryFileNames:c},...a!=null&&{chunkFileNames:a},...u!=null&&{assetFileNames:u}}}}}}const At="https://json-schema.org/draft/2020-12/schema",kt="https://lightspeedhq.com/template.schema.json",Ft="Custom Template",xt="A custom template enclosing the necessary custom and default blocks",_t="object",Rt={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)company\\.site($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},It=["metadata","sections"],Ts={$schema:At,$id:kt,title:Ft,description:xt,type:_t,properties:Rt,required:It},Nt={__proto__:null,$id:kt,$schema:At,default:Ts,description:xt,properties:Rt,required:It,title:Ft,type:_t},Lt="https://json-schema.org/draft/2020-12/schema",Mt="https://lightspeedhq.com/template-default.schema.json",Dt="Default Section",Bt="Default section for a Custom Template",Pt="object",Gt={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"}},required:["type","id"],additionalProperties:!1}},Os={$schema:Lt,$id:Mt,title:Dt,description:Bt,type:Pt,$defs:Gt},js={__proto__:null,$defs:Gt,$id:Mt,$schema:Lt,default:Os,description:Bt,title:Dt,type:Pt},Ut="https://json-schema.org/draft/2020-12/schema",Xt="https://lightspeedhq.com/template-custom.schema.json",zt="Custom Section",qt="Custom section for a Custom Template",Kt="object",Ht={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{type:"object",description:"Overrides for the showcase",properties:{content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"template-custom-content.schema.json#/$defs/deck"}}]}},minProperties:1},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}}]}},minProperties:1},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",type:"string"}},required:["content","design"]}},required:["type","id"],additionalProperties:!1}},Ss={$schema:Ut,$id:Xt,title:zt,description:qt,type:Kt,$defs:Ht},As={__proto__:null,$defs:Ht,$id:Xt,$schema:Ut,default:Ss,description:qt,title:zt,type:Kt},Jt="https://json-schema.org/draft/2020-12/schema",Wt="https://lightspeedhq.com/template-custom-content.schema.json",Yt="Custom Section :: Content Configuration",Zt="Content tab configuration of a Custom Section for a Custom Template",Vt="object",Qt={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},title:{type:"string"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title"],additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},enabled:{type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},value:{type:"string"}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK"]},cards:{description:"Cards of the content configuration element",type:"array",items:{type:"object",required:["settings"]},properties:{settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1}}}}}},ks={$schema:Jt,$id:Wt,title:Yt,description:Zt,type:Vt,$defs:Qt},Fs={__proto__:null,$defs:Qt,$id:Wt,$schema:Jt,default:ks,description:Zt,title:Yt,type:Vt},en="https://json-schema.org/draft/2020-12/schema",tn="https://lightspeedhq.com/template-custom-design.schema.json",nn="Custom Section :: Design Configuration",sn="Design tab configuration of a Custom Section for a Custom Template",on="object",rn={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},font:{description:"Default font for the text",type:"string"},size:{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND"]},style:{description:"Default style for the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string"}}}}},xs={$schema:en,$id:tn,title:nn,description:sn,type:on,$defs:rn},_s={__proto__:null,$defs:rn,$id:tn,$schema:en,default:xs,description:sn,title:nn,type:on};function Rs(e){return Object.entries(v).find(t=>t[1].source===e)?.[0]}async function Is(){const e=await O("**/server.{js,ts}",{ignore:["node_modules/**","dist/**"]});return Promise.all(e.map(async t=>{const s=On(t).split(jn),r=s.pop()??"default",n=s.pop();if(n===void 0)throw new Error("Cannot determine type of section, outer directory is undefined");const o=await O(`**/${r}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await O(`**/${r}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await O(`**/${r}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),a=await O(`**/${r}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),u=await O(`**/${r}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),p=await O(`**/${r}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${r}/showcases/translations.{js,ts}`]}),l=await O(`**/${r}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),f=await O(`**/${r}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:r,type:Rs(n),serverEntrypoint:t,clientEntrypoint:o.at(0),contentSettingsEntrypoint:i.at(0),designSettingsEntrypoint:c.at(0),layoutSettingsEntrypoint:a.at(0),settingsTranslationsEntrypoint:u.at(0),showcasesEntrypoints:p,showcasesTranslationsEntrypoint:l.at(0),assetsEntrypoints:f}}))}async function Ns(){const e=await O("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await O("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{templates:e,assets:t}}async function Ne(e,t){try{const s=E(Ge.cwd(),t?`${e}${X}.mjs`:`${e}.mjs`);return(await import(G(s).href)).default}catch{throw new Error(`File [${e}${X}.mjs] is either invalid or undefined`)}}async function Ls(){let e=new Rn({allErrors:!0,schemas:[Nt,js,As,Fs,_s]});return In(e),e.compile(Nt)}async function Ms(e,t,s,r){if(e(t)&&r===void 0)new Promise(n=>{Cn(`${s}${X}.mjs`,`${s}.mjs`,function(o){o&&n(o)})});else throw new Promise(n=>{En(`${s}${X}.mjs`,function(o){o&&n(o)})}),new Error(`Invalid file [${te(s).name}].
10
+ `)}function a(f){f?process.env.DEBUG=f:delete process.env.DEBUG}function p(){return process.env.DEBUG}function u(f){f.inspectOpts={};const d=Object.keys(t.inspectOpts);for(let m=0;m<d.length;m++)f.inspectOpts[d[m]]=t.inspectOpts[d[m]]}e.exports=Ot()(t);const{formatters:l}=e.exports;l.o=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts).split(`
11
+ `).map(d=>d.trim()).join(" ")},l.O=function(f){return this.inspectOpts.colors=this.useColors,r.inspect(f,this.inspectOpts)}}(ue,ue.exports)),ue.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xe.exports=rs():xe.exports=is();var as=xe.exports;const cs=rt(as),ls=e=>typeof e=="function",ps=e=>Object.prototype.toString.call(e)==="[object RegExp]";function $t(e,t){let s=[];try{de.existsSync(e)&&(de.lstatSync(e).isDirectory()?de.readdirSync(e).forEach(function(o){const i=$t(te.join(e,"/",o),t);s=s.concat(i)}):t!==void 0||s.push(e))}catch(r){throw r}return s}const Le=cs.debug("vite-plugin-compression"),us=/\.(js|mjs|json|css|html)$/i,Tt=new Map;function fs(e={}){let t,s;const r={name:"vite:compression"},{disable:n=!1,filter:o=us,verbose:i=!0,threshold:c=1025,compressionOptions:a={},deleteOriginFile:p=!1,success:u=()=>{}}=e;let{ext:l=""}=e;const{algorithm:f="gzip"}=e;return f==="gzip"&&!l&&(l=".gz"),f==="brotliCompress"&&!l&&(l=".br"),n?r:(Le("plugin options:",e),{...r,apply:"build",enforce:"post",configResolved(d){s=d,t=te.isAbsolute(s.build.outDir)?s.build.outDir:te.join(s.root,s.build.outDir),Le("resolvedConfig:",d)},async closeBundle(){let d=$t(t)||[];if(Le("files:",d),!d.length)return;d=ds(d,o);const m=ms(f,a),h=new Map,g=d.map(async y=>{const{mtimeMs:$,size:R}=await se.stat(y);if($<=(Tt.get(y)||0)||R<c)return;let M=await se.readFile(y);p&&se.remove(y);try{M=await hs(M,f,m)}catch{s.logger.error("compress error:"+y)}const U=M.byteLength,fe=ys(y,l);h.set(y,{size:U/1024,oldSize:R/1024,cname:fe}),await se.writeFile(fe,M),Tt.set(y,Date.now())});return Promise.all(g).then(()=>{i&&(gs(s,h,f),u())})}})}function ds(e,t){if(t){const s=ps(t),r=ls(t);e=e.filter(n=>s?t.test(n):r?t(n):!0)}return e}function ms(e="",t={}){return{...{gzip:{level:G.constants.Z_BEST_COMPRESSION},deflate:{level:G.constants.Z_BEST_COMPRESSION},deflateRaw:{level:G.constants.Z_BEST_COMPRESSION},brotliCompress:{params:{[G.constants.BROTLI_PARAM_QUALITY]:G.constants.BROTLI_MAX_QUALITY,[G.constants.BROTLI_PARAM_MODE]:G.constants.BROTLI_MODE_TEXT}}}[e],...t}}function hs(e,t,s={}){return new Promise((r,n)=>{G[t](e,s,(o,i)=>o?n(o):r(i))})}function ys(e,t){const s=t.startsWith(".")?t:`.${t}`;return`${e}${s}`}function gs(e,t,s){e.logger.info(`
12
+ ${le.cyan("\u2728 [vite-plugin-compression]:algorithm="+s)} - compressed file successfully: `);const r=Array.from(t.keys(),o=>o.length),n=Math.max(...r);t.forEach((o,i)=>{const{size:c,oldSize:a,cname:p}=o,u=ze(p).replace(ze(`${e.build.outDir}/`),""),l=`${a.toFixed(2)}kb / ${s}: ${c.toFixed(2)}kb`;e.logger.info(le.dim(te.basename(e.build.outDir)+"/")+le.blueBright(u)+" ".repeat(2+n-i.length)+" "+le.dim(l))}),e.logger.info(`
13
+ `)}const bs=()=>fs({ext:".gz",algorithm:"gzip",deleteOriginFile:!0}),jt=()=>{const e=process.env.npm_lifecycle_event;return Ln({typescript:!0,vueTsc:!1,eslint:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},Es={[I.Server]:[Ve(),me(),bs()],[I.Client]:[Ve(),me(),jt(),xn({vue:"EcVue"})],[I.Misc]:[me(),jt()]},v={SECTION:{source:"sections",dist:"dist/sections"},HEADER:{source:"headers",dist:"dist/headers"},FOOTER:{source:"footers",dist:"dist/footers"}};function Cs(e){return L(`${he}/${e}`)?"HEADER":L(`${ye}/${e}`)?"FOOTER":"SECTION"}const At={"process.env":{NODE_ENV:"production"}},Os=[...He,...He.map(e=>`node:${e}`)],ws=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],_={[j.Server]:{pluginType:I.Server,define:At,ssr:!0,ssrOptions:{noExternal:!0},outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/server`,externalOption:[...Os],entryFileNames:"server.js",inlineDynamicImports:!0},[j.Client]:{pluginType:I.Client,define:At,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/main/client`,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",inlineDynamicImports:!0},[j.SectionSetting]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/settings`,entryFileNames:"[name].mjs"},[j.SectionShowcase]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/js/showcases`,entryFileNames:"[name].mjs"},[j.SectionAsset]:{pluginType:I.Misc,ssr:!1,outDir:(e,t)=>`./${v[t].dist}/${e}/assets`,assetFileNames:"[name].[ext]"},[j.TemplateDescriptor]:{pluginType:I.Misc,ssr:!1,outDir:()=>`./${z}/js`,entryFileNames:`[name]${X}.mjs`},[j.TemplateAsset]:{pluginType:I.Misc,ssr:!1,outDir:()=>`./${z}/assets`,assetFileNames:"[name].[ext]"}};function vs(e){switch(typeof e){case"string":return[C(process.cwd(),e)];case"object":return e.map(t=>C(process.cwd(),t));default:return[]}}function $s(e,t){const{externalOption:s}=_[e];return t?.externalizeVue&&e===j.Server?[...s??[],...ws]:s}function St(e,t,s,r,n){const o=_[s].define,i=_[s].ssrOptions,c=_[s].entryFileNames,a=_[s].chunkFileNames,p=_[s].assetFileNames,u=_[s].inlineDynamicImports,l=$s(s,n);return{plugins:Es[_[s].pluginType],...o!=null&&{define:o},...i!=null&&{ssr:i},resolve:{alias:{"@":"/src"}},build:{ssr:_[s].ssr,outDir:_[s].outDir(e,r),emptyOutDir:!0,minify:"terser",terserOptions:{compress:{drop_console:!1}},rollupOptions:{...l!=null&&{external:l},preserveEntrySignatures:"strict",input:vs(t),output:{validate:!0,inlineDynamicImports:u,...c!=null&&{entryFileNames:c},...a!=null&&{chunkFileNames:a},...p!=null&&{assetFileNames:p}}}}}}const Nt="https://json-schema.org/draft/2020-12/schema",kt="https://lightspeedhq.com/template.schema.json",xt="Custom Template",It="A custom template enclosing the necessary custom and default blocks",Ft="object",Lt={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)company\\.site($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},_t=["metadata","sections"],Ts={$schema:Nt,$id:kt,title:xt,description:It,type:Ft,properties:Lt,required:_t},Rt={__proto__:null,$id:kt,$schema:Nt,default:Ts,description:It,properties:Lt,required:_t,title:xt,type:Ft},Mt="https://json-schema.org/draft/2020-12/schema",Dt="https://lightspeedhq.com/template-default.schema.json",Gt="Default Section",Bt="Default section for a Custom Template",Pt="object",Ut={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"}},required:["type","id"],additionalProperties:!1}},js={$schema:Mt,$id:Dt,title:Gt,description:Bt,type:Pt,$defs:Ut},As={__proto__:null,$defs:Ut,$id:Dt,$schema:Mt,default:js,description:Bt,title:Gt,type:Pt},Xt="https://json-schema.org/draft/2020-12/schema",zt="https://lightspeedhq.com/template-custom.schema.json",qt="Custom Section",Kt="Custom section for a Custom Template",Ht="object",Vt={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{type:"object",description:"Overrides for the showcase",properties:{content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","LOGO","DECK"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-content.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"template-custom-content.schema.json#/$defs/deck"}}]}},minProperties:1},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/logo"}}]}},minProperties:1},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",type:"string"}},required:["content","design"]}},required:["type","id"],additionalProperties:!1}},Ss={$schema:Xt,$id:zt,title:qt,description:Kt,type:Ht,$defs:Vt},Ns={__proto__:null,$defs:Vt,$id:zt,$schema:Xt,default:Ss,description:Kt,title:qt,type:Ht},Jt="https://json-schema.org/draft/2020-12/schema",Wt="https://lightspeedhq.com/template-custom-content.schema.json",Yt="Custom Section :: Content Configuration",Zt="Content tab configuration of a Custom Section for a Custom Template",Qt="object",en={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},text:{type:"string"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},title:{type:"string"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title"],additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},enabled:{type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]},value:{type:"string"}},required:["type"],additionalProperties:!1},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","LOGO"]},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",type:"string"},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},menu:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","MENU","NAVIGATION_MENU","LOGO"]}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","DECK","LOGO"]},cards:{description:"Cards of the content configuration element",type:"array",items:{type:"object",required:["settings"]},properties:{settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1}}}}}},ks={$schema:Jt,$id:Wt,title:Yt,description:Zt,type:Qt,$defs:en},xs={__proto__:null,$defs:en,$id:Wt,$schema:Jt,default:ks,description:Zt,title:Yt,type:Qt},tn="https://json-schema.org/draft/2020-12/schema",nn="https://lightspeedhq.com/template-custom-design.schema.json",sn="Custom Section :: Design Configuration",on="Design tab configuration of a Custom Section for a Custom Template",rn="object",an={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the text",type:"string"},size:{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},style:{description:"Default style for the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image",type:"array",items:{type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},minItems:2,maxItems:2}}},else:{properties:{color:{description:"Default color for the image",type:"string"}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]},font:{description:"Default font for the text logo",type:"string"},size:{description:"Default size for the text logo",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{description:"Default color for the text logo",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the logo",type:"boolean"},spacing:{description:"Default spacing size for the text logo",type:"integer",minimum:1,exclusiveMaximum:10},capitalization:{description:"Default capitalization style for the text logo",type:"string",enum:["none","all","small"]},frame:{description:"Default frame for the text logo",type:"object",properties:{visible:{description:"Default visibility for the frame on text logo",type:"boolean"},width:{description:"Default width size for the frame on text logo",type:"integer",minimum:1,exclusiveMaximum:50},color:{description:"Default color for the frame on text logo",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},Is={$schema:tn,$id:nn,title:sn,description:on,type:rn,$defs:an},Fs={__proto__:null,$defs:an,$id:nn,$schema:tn,default:Is,description:on,title:sn,type:rn};function Ls(e){return Object.entries(v).find(t=>t[1].source===e)?.[0]}async function _s(){const e=await T("**/server.{js,ts}",{ignore:["node_modules/**","dist/**"]});return Promise.all(e.map(async t=>{const s=Nn(t).split(kn),r=s.pop()??"default",n=s.pop();if(n===void 0)throw new Error("Cannot determine type of section, outer directory is undefined");const o=await T(`**/${r}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await T(`**/${r}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await T(`**/${r}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),a=await T(`**/${r}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),p=await T(`**/${r}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),u=await T(`**/${r}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${r}/showcases/translations.{js,ts}`]}),l=await T(`**/${r}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),f=await T(`**/${r}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:r,type:Ls(n),serverEntrypoint:t,clientEntrypoint:o.at(0),contentSettingsEntrypoint:i.at(0),designSettingsEntrypoint:c.at(0),layoutSettingsEntrypoint:a.at(0),settingsTranslationsEntrypoint:p.at(0),showcasesEntrypoints:u,showcasesTranslationsEntrypoint:l.at(0),assetsEntrypoints:f}}))}async function Rs(){const e=await T("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await T("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{templates:e,assets:t}}async function _e(e,t){try{const s=C(Ue.cwd(),t?`${e}${X}.mjs`:`${e}.mjs`);return(await import(P(s).href)).default}catch{throw new Error(`File [${e}${X}.mjs] is either invalid or undefined`)}}async function Ms(){let e=new _n({allErrors:!0,schemas:[Rt,As,Ns,xs,Fs]});return Rn(e),e.compile(Rt)}async function Ds(e,t,s,r){if(e(t)&&r===void 0)new Promise(n=>{vn(`${s}${X}.mjs`,`${s}.mjs`,function(o){o&&n(o)})});else throw new Promise(n=>{$n(`${s}${X}.mjs`,function(o){o&&n(o)})}),new Error(`Invalid file [${ne(s).name}].
14
14
  Note: Errors regarding failingKeyword: "then" can sometimes be false negatives. Please focus on fixing other errors first!
15
- Errors: ${JSON.stringify([...e.errors??[],...r??[]],null,2)}`)}async function Ds(e){const t=[];for(const s of e.sections){const r=e.sections.indexOf(s);if(r===0){const n=s.id==="header"&&s.type==="default",o=R(`${he}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The first section must be a `header`"})}else if(r===e.sections.length-1){const n=s.id==="footer"&&s.type==="default",o=R(`${ye}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The last section must be a `footer`"})}else if(s.type==="custom")if(!R(`${A}/${s.id}`))t.push({instancePath:`/sections/${r}/id`,message:"Custom section must have a corresponding block defined"});else{if(s.content!==void 0)if(!R(`${A}/${s.id}/js/settings/content.mjs`))t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await Ne(`${A}/${s.id}/js/settings/content`,!1),o=new Set(Object.keys(n));Object.keys(s.content).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor must be a subset of the default content descriptor"})}if(s.design!==void 0)if(!R(`${A}/${s.id}/js/settings/design.mjs`))t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await Ne(`${A}/${s.id}/js/settings/design`,!1),o=new Set(Object.keys(n));Object.keys(s.design).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor must be a subset of the default design descriptor"})}s.showcase_id!==void 0&&(R(`${A}/${s.id}/js/showcases/${s.showcase_id}.mjs`)||t.push({instancePath:`/sections/${r}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified"}))}}return t.length===0?void 0:t}function Bs(e){const t=e.reduce((s,r)=>{const n=wn(r);return n.size>Qe&&(s[r]=Ve(n.size)),s},{});if(Object.keys(t).length!==0){const s=Math.max(...Object.keys(t).map(r=>r.length));b.error(`Size of individual assets must not exceed threshold [${Ve(Qe)}]!`);for(let r in t)b.error(`File: ${r}`.padEnd(s+10)+`| ${t[r]}`);throw new Error("Invalid asset file size")}}function Ps(){return $n.rm("dist",{recursive:!0,force:!0})}async function Gs(e){async function t(s,r,n,o="SECTION"){r.length!==0&&await ze({configFile:!1,...qe(St(s,r,n,o,e))})}try{const[s,r]=await Promise.all([Is(),Ns(),Ps()]),n=s.map(o=>({name:o.name,type:o.type,serverEntrypoint:o.serverEntrypoint,clientEntrypoint:[o.clientEntrypoint].filter(ge).flat(),settingsEntryPoints:[o.contentSettingsEntrypoint,o.designSettingsEntrypoint,o.layoutSettingsEntrypoint,o.settingsTranslationsEntrypoint].filter(ge),showcaseEntryPoints:[...o.showcasesEntrypoints??[],o.showcasesTranslationsEntrypoint].filter(ge),assetsEntrypoints:o.assetsEntrypoints??[]}));for(const o of n)Bs(o.assetsEntrypoints),await Promise.all([ze({configFile:!1,...qe(St(o.name,o.serverEntrypoint,j.Server,o.type,e))}),t(o.name,o.clientEntrypoint,j.Client,o.type),t(o.name,o.settingsEntryPoints,j.SectionSetting,o.type),t(o.name,o.showcaseEntryPoints,j.SectionShowcase,o.type),t(o.name,o.assetsEntrypoints,j.SectionAsset,o.type)]);if(r.templates.length!==0){const[o]=await Promise.all([Ls(),t(void 0,r.assets,j.TemplateAsset),t(void 0,r.templates,j.TemplateDescriptor)]);for(const i of r.templates){const c=`${z}/js/${te(i).name}`,a=await Ne(c,!0);await Ms(o,a,c,await Ds(a))}}b.info("Build successful. For deploy run: npx @lightspeed/crane@latest deploy")}catch(s){b.error(`Error while building: ${s.message}`),Ge.exit(1)}}function an(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function D(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=Dn(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function Us(e){if(e!==void 0)return typeof e=="string"&&e.startsWith("global.")?{type:"GLOBAL_TEXT_SIZE",size:e}:{type:"NUMERIC_TEXT_SIZE",size:e}}const Xs={COLOR:"COLOR",GRADIENT:"GRADIENT"};function zs(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(Xs)}`)}}function qs(e){const t=e.style,s=e.color,r=Array.isArray(s)?s:[s,s];return e.background={type:zs(t),solid:{color:D(r.at(0))},gradient:{fromColor:D(r.at(0)),toColor:D(r.at(1))}},e.style=void 0,e.color=void 0,e}const Ks={SOLID:"SOLID",OUTLINE:"OUTLINE",TEXT:"TEXT"};function Hs(e){switch(e){case"SOLID":return"solid-button";case"OUTLINE":return"outline-button";case"TEXT":return"text-link";default:throw new Error(`Unknown button appearance: ${e}. Right options: ${Object.keys(Ks)}`)}}const Js={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"};function Ws(e){switch(e){case"SMALL":return"small";case"MEDIUM":return"medium";case"LARGE":return"large";default:throw new Error(`Unknown button size: ${e}. Right options: ${Object.keys(Js)}`)}}const Ys={ROUND_CORNER:"ROUND_CORNER",RECTANGLE:"RECTANGLE",PILL:"PILL"};function Zs(e){switch(e){case"ROUND_CORNER":return"round-corner";case"RECTANGLE":return"rectangle";case"PILL":return"pill";default:throw new Error(`Unknown button shape: ${e}. Right options: ${Object.keys(Ys)}`)}}function Vs(e){const t=e.appearance;t!==void 0&&(e.appearance=Hs(t));const s=e.size;s!==void 0&&(e.size=Ws(s));const r=e.shape;r!==void 0&&(e.style=Zs(r),e.shape=void 0);const n=e.font;e.font=an(n);const o=e.color;return e.color=D(o),e}const Qs={COLOR:"COLOR",GRADIENT:"GRADIENT",NONE:"NONE"};function eo(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";case"NONE":return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(Qs)}`)}}function to(e){const t=e.overlay,s=e.color,r=Array.isArray(s)?s:[s,s];return e.overlay={type:eo(t),solid:{color:D(r.at(0))},gradient:{fromColor:D(r.at(0)),toColor:D(r.at(1))}},e.color=void 0,e}function no(e){const t=e.font;e.font=an(t);const s=e.color;e.color=D(s);const r=e.size;return e.size=Us(r),e}function so(e){const t=e.color;return e.color=D(t),e}function oo(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Le(r,s.defaults)})}function ro(e){e.forEach(t=>{t.type!==void 0&&t.defaults!==void 0&&(Le(t.type,t.defaults),t.defaults.type=t.type)})}function cn(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Le(r,s)})}function Le(e,t){switch(e){case"TEXT":{no(t);break}case"BUTTON":{Vs(t);break}case"IMAGE":{to(t);break}case"BACKGROUND":{qs(t);break}case"COLOR_PICKER":{so(t);break}case"TOGGLE":case"SELECTBOX":break;default:throw new Error(`Unknown design editor type: ${e}`)}return t}const io=200;var k=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientAsset=2]="ClientAsset",e[e.Asset=3]="Asset",e[e.TemplateAsset=4]="TemplateAsset",e[e.Dependency=5]="Dependency",e))(k||{});const K={[k.Server]:{type:"server_js_compressed",isSingleton:!0,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/server/`,fileName:"server.js.gz"},[k.Client]:{type:"client_js",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/`,fileName:"client.js"},[k.ClientAsset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/assets/`,fileName:"*"},[k.Asset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/assets/`,fileName:"*"},[k.TemplateAsset]:{type:"template_assets",isSingleton:!1,toPath:()=>`${z}/assets/`,fileName:"*"},[k.Dependency]:{type:"dependencies",isSingleton:!0,toPath:()=>{},fileName:"package.json"}},ao="https://blockbuster.ecwid.com",co="/api/v1/custom-apps/resources/sections/upload",lo="/api/v1/custom-apps/resources/templates/upload",uo="/api/v1/custom-apps/manifests/sections",po="/api/v1/custom-apps/manifests/templates",fo=5,mo=3;async function ho(){const e=await We(E(C.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}async function yo(){const e=E(C.cwd(),"package.json"),t=await We(e),s=JSON.parse(t.toString());if(go(s))return s;throw new Error(`Package file located at path: ${e} does not contain a version field`)}function go(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function bo(e){const t=Ln(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,vn(E(C.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
16
- `)}async function Co(e,t,s=A){try{const r=E(C.cwd(),`${s}/${e}/js/settings/content.mjs`),n=(await import(G(r).href)).default;return Y(n,t),n}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function Eo(e,t,s=A){try{const r=E(C.cwd(),`${s}/${e}/js/settings/design.mjs`),n=(await import(G(r).href)).default;return oo(n),Y(n,t),n}catch(r){const n=r;throw new Error(`Design settings is invalid or undefined. Error ${n.stack}`)}}async function wo(e,t,s=A){try{const r=await O("*.mjs",{cwd:E(C.cwd(),`${s}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(r.map(async n=>{const o=E(C.cwd(),`${s}/${e}/js/showcases/${n}`),i=(await import(G(o).href)).default;return cn(i.design),Y(i,t),i}))}catch(r){throw new Error(`Showcases is invalid or undefined. Error ${r}`)}}async function $o(e,t=A){try{const s=E(C.cwd(),`${t}/${e}/js/settings/layout.mjs`);if(!R(s))return[];const r=(await import(G(s).href)).default;return r.forEach(n=>ro(n.selectedDesignSettings)),r}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function vo(e,t=A){return await un(`${t}/${e}/js/settings/translations.mjs`)}async function ln(e,t=A){return await un(`${t}/${e}/js/showcases/translations.mjs`)}async function un(e){const t=E(C.cwd(),e),s=(await import(G(t).href)).default;return Oo(s)}function Y(e,t){if(e&&typeof e=="object"){const s=e;for(let r in s){const n=s[r];typeof n=="string"&&n.startsWith("$")&&(s[r]=To(t,n)),typeof n=="object"&&Y(n,t)}}}function To(e,t){if(!t)return;const s=e[t];return s===void 0?{en:t}:s}function Oo(e){const t={};for(let s in e){const r=e[s];for(let n in r){const o=t[n],i=r[n];if(o===void 0){const c={};c[s]=i,t[n]=c}else o[s]=i}}return t}async function Me(e,t){const s=await vo(e,v[t].dist),r=await ln(e,v[t].dist),n=await Co(e,s,v[t].dist),o=await Eo(e,s,v[t].dist),i=await wo(e,r,v[t].dist),c=await $o(e,v[t].dist);return{id:e,type:t,name:{en:e},contentEditors:n,designEditors:o,layouts:c,showcases:i}}async function jo(){const e=await O("*/",{cwd:E(C.cwd(),`${A}/`)}),t=await O("*/",{cwd:E(C.cwd(),`${he}/`)}),s=await O("*/",{cwd:E(C.cwd(),`${ye}/`)});return Promise.all([...e.map(async r=>Me(r,"SECTION")),...t.map(async r=>Me(r,"HEADER")),...s.map(async r=>Me(r,"FOOTER"))])}async function So(e){try{return(await import(G(E(C.cwd(),e)).href)).default}catch{throw new Error(`Template descriptor [${e}] is either invalid or undefined`)}}async function Ao(){const e=await O(`${z}/js/**.mjs`,{ignore:[`${z}/js/**${X}.mjs`]});return Promise.all(e.map(async t=>{const s=await So(t),r=s.sections.filter(n=>n.type==="custom");for(const n of r){const o=Cs(n.id),i=await ln(n.id,v[o].dist);n.showcase_overrides!==void 0&&(Y(n.showcase_overrides,i),cn(n.showcase_overrides.design))}return{id:`${te(C.cwd()).name.replace(/[^a-zA-Z0-9]/g,"_")}_${te(t).name}`,descriptor:s}}))}function ko(e,t){const s=e.pathContext,r=s.toPath(e.currentSection,t),n=r===void 0?Ue(s.fileName):Ue(s.fileName,{cwd:E(C.cwd(),r),ignore:s.ignore});return s.isSingleton?n.splice(0):n}function Fo(e){return e instanceof Ye&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function pn(e,t){return e<mo&&Fo(t)}async function fn(e){await new Promise(t=>{setTimeout(t,2**e*500)})}function dn(e,t,s,r){const n=e.config.app.templates.length>0?lo:co;return e.config.axios.post(n,{file:Tn(E(C.cwd(),s!==void 0?s+t:t))},{params:{appClientId:e.config.app.crane.appClientId,type:e.pathContext.type,version:e.config.app.packageJson.version,...e.currentSection!==void 0&&{block:e.currentSection},...e.pathContext.type!=="dependencies"&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`}}).then(o=>({status:o.status})).catch(async o=>pn(r,o)?(await fn(r),dn(e,t,s,r+1)):{status:o.response?.status,message:o.message})}function H(e,t="SECTION"){const s=ko(e,t),r=e.pathContext.toPath(e.currentSection,t);return s.map(n=>dn(e,n,r,0))}function xo(e){return[...e.app.sections.flatMap(t=>[...H({config:e,currentSection:t.id,pathContext:K[k.Server]},t.type),...H({config:e,currentSection:t.id,pathContext:K[k.Client]},t.type),...H({config:e,currentSection:t.id,pathContext:K[k.ClientAsset]},t.type),...H({config:e,currentSection:t.id,pathContext:K[k.Asset]},t.type)]),...H({config:e,pathContext:K[k.Dependency]}),...H({config:e,pathContext:K[k.TemplateAsset]})]}function _o(e){return e.includes(`
17
- `)}function Ro(e,t,s){return e.split(`
15
+ Errors: ${JSON.stringify([...e.errors??[],...r??[]],null,2)}`)}async function Gs(e){const t=[];for(const s of e.sections){const r=e.sections.indexOf(s);if(r===0){const n=s.id==="header"&&s.type==="default",o=L(`${he}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The first section must be a `header`"})}else if(r===e.sections.length-1){const n=s.id==="footer"&&s.type==="default",o=L(`${ye}/${s.id}`);!n&&!o&&t.push({instancePath:`/sections/${r}/id`,message:"The last section must be a `footer`"})}else if(s.type==="custom")if(!L(`${S}/${s.id}`))t.push({instancePath:`/sections/${r}/id`,message:"Custom section must have a corresponding block defined"});else{if(s.content!==void 0)if(!L(`${S}/${s.id}/js/settings/content.mjs`))t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await _e(`${S}/${s.id}/js/settings/content`,!1),o=new Set(Object.keys(n));Object.keys(s.content).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/content`,message:"Content descriptor must be a subset of the default content descriptor"})}if(s.design!==void 0)if(!L(`${S}/${s.id}/js/settings/design.mjs`))t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder"});else{const n=await _e(`${S}/${s.id}/js/settings/design`,!1),o=new Set(Object.keys(n));Object.keys(s.design).every(i=>o.has(i))||t.push({instancePath:`/sections/${r}/design`,message:"Design descriptor must be a subset of the default design descriptor"})}s.showcase_id!==void 0&&(L(`${S}/${s.id}/js/showcases/${s.showcase_id}.mjs`)||t.push({instancePath:`/sections/${r}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified"}))}}return t.length===0?void 0:t}function Bs(e){const t=e.reduce((s,r)=>{const n=Tn(r);return n.size>et&&(s[r]=Qe(n.size)),s},{});if(Object.keys(t).length!==0){const s=Math.max(...Object.keys(t).map(r=>r.length));b.error(`Size of individual assets must not exceed threshold [${Qe(et)}]!`);for(let r in t)b.error(`File: ${r}`.padEnd(s+10)+`| ${t[r]}`);throw new Error("Invalid asset file size")}}function Ps(){return jn.rm("dist",{recursive:!0,force:!0})}async function Us(e){async function t(s,r,n,o="SECTION"){r.length!==0&&await qe({configFile:!1,...Ke(St(s,r,n,o,e))})}try{const[s,r]=await Promise.all([_s(),Rs(),Ps()]),n=s.map(o=>({name:o.name,type:o.type,serverEntrypoint:o.serverEntrypoint,clientEntrypoint:[o.clientEntrypoint].filter(ge).flat(),settingsEntryPoints:[o.contentSettingsEntrypoint,o.designSettingsEntrypoint,o.layoutSettingsEntrypoint,o.settingsTranslationsEntrypoint].filter(ge),showcaseEntryPoints:[...o.showcasesEntrypoints??[],o.showcasesTranslationsEntrypoint].filter(ge),assetsEntrypoints:o.assetsEntrypoints??[]}));for(const o of n)Bs(o.assetsEntrypoints),await Promise.all([qe({configFile:!1,...Ke(St(o.name,o.serverEntrypoint,j.Server,o.type,e))}),t(o.name,o.clientEntrypoint,j.Client,o.type),t(o.name,o.settingsEntryPoints,j.SectionSetting,o.type),t(o.name,o.showcaseEntryPoints,j.SectionShowcase,o.type),t(o.name,o.assetsEntrypoints,j.SectionAsset,o.type)]);if(r.templates.length!==0){const[o]=await Promise.all([Ms(),t(void 0,r.assets,j.TemplateAsset),t(void 0,r.templates,j.TemplateDescriptor)]);for(const i of r.templates){const c=`${z}/js/${ne(i).name}`,a=await _e(c,!0);await Ds(o,a,c,await Gs(a))}}b.info("Build successful. For deploy run: npx @lightspeed/crane@latest deploy")}catch(s){b.error(`Error while building: ${s.message}`),Ue.exit(1)}}function Re(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function F(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=Bn(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function cn(e){if(e!==void 0)return typeof e=="string"&&e.startsWith("global.")?{type:"GLOBAL_TEXT_SIZE",size:e}:{type:"NUMERIC_TEXT_SIZE",size:Number(e)}}const Xs={COLOR:"COLOR",GRADIENT:"GRADIENT"};function zs(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(Xs)}`)}}function qs(e){const t=e.style,s=e.color,r=Array.isArray(s)?s:[s,s];return e.background={type:zs(t),solid:{color:F(r.at(0))},gradient:{fromColor:F(r.at(0)),toColor:F(r.at(1))}},e.style=void 0,e.color=void 0,e}const Ks={SOLID:"SOLID",OUTLINE:"OUTLINE",TEXT:"TEXT"};function Hs(e){switch(e){case"SOLID":return"solid-button";case"OUTLINE":return"outline-button";case"TEXT":return"text-link";default:throw new Error(`Unknown button appearance: ${e}. Right options: ${Object.keys(Ks)}`)}}const Vs={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"};function Js(e){switch(e){case"SMALL":return"small";case"MEDIUM":return"medium";case"LARGE":return"large";default:throw new Error(`Unknown button size: ${e}. Right options: ${Object.keys(Vs)}`)}}const Ws={ROUND_CORNER:"ROUND_CORNER",RECTANGLE:"RECTANGLE",PILL:"PILL"};function Ys(e){switch(e){case"ROUND_CORNER":return"round-corner";case"RECTANGLE":return"rectangle";case"PILL":return"pill";default:throw new Error(`Unknown button shape: ${e}. Right options: ${Object.keys(Ws)}`)}}function Zs(e){const t=e.appearance;t!==void 0&&(e.appearance=Hs(t));const s=e.size;s!==void 0&&(e.size=Js(s));const r=e.shape;r!==void 0&&(e.style=Ys(r),e.shape=void 0);const n=e.font;e.font=Re(n);const o=e.color;return e.color=F(o),e}const Qs={COLOR:"COLOR",GRADIENT:"GRADIENT",NONE:"NONE"};function eo(e){switch(e){case"COLOR":return"solid";case"GRADIENT":return"gradient";case"NONE":return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(Qs)}`)}}function to(e){const t=e.overlay,s=e.color,r=Array.isArray(s)?s:[s,s];return e.overlay={type:eo(t),solid:{color:F(r.at(0))},gradient:{fromColor:F(r.at(0)),toColor:F(r.at(1))}},e.color=void 0,e}function no(e){const t=e.font;e.font=Re(t);const s=e.color;e.color=F(s);const r=e.size;return e.size=cn(r),e}function so(e){const t=e.color;return e.color=F(t),e}function oo(e){const t=e.font;e.font=Re(t);const s=e.color;e.color=F(s);const r=e.size;if(e.size=cn(r),e.frame!==void 0){const n=e.frame.color;e.frame.color=F(n)}return e}function Me(e,t){switch(e){case"TEXT":{no(t);break}case"BUTTON":{Zs(t);break}case"IMAGE":{to(t);break}case"BACKGROUND":{qs(t);break}case"COLOR_PICKER":{so(t);break}case"LOGO":{oo(t);break}case"TOGGLE":case"SELECTBOX":break;default:throw new Error(`Unknown design editor type: ${e}`)}return t}function ro(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Me(r,s.defaults)})}function io(e){e.forEach(t=>{t.type!==void 0&&t.defaults!==void 0&&(Me(t.type,t.defaults),t.defaults.type=t.type)})}function ln(e){Object.keys(e).forEach(t=>{const s=e[t],r=s.type;Me(r,s)})}const ao=200;var N=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientAsset=2]="ClientAsset",e[e.Asset=3]="Asset",e[e.TemplateAsset=4]="TemplateAsset",e[e.Dependency=5]="Dependency",e))(N||{});const K={[N.Server]:{type:"server_js_compressed",isSingleton:!0,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/server/`,fileName:"server.js.gz"},[N.Client]:{type:"client_js",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/`,fileName:"client.js"},[N.ClientAsset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/js/main/client/assets/`,fileName:"*"},[N.Asset]:{type:"assets",isSingleton:!1,toPath:(e,t)=>`${v[t].dist}/${e}/assets/`,fileName:"*"},[N.TemplateAsset]:{type:"template_assets",isSingleton:!1,toPath:()=>`${z}/assets/`,fileName:"*"},[N.Dependency]:{type:"dependencies",isSingleton:!0,toPath:()=>{},fileName:"package.json"}},co="https://blockbuster.ecwid.com",lo="/api/v1/custom-apps/resources/sections/upload",po="/api/v1/custom-apps/resources/templates/upload",uo="/api/v1/custom-apps/manifests/sections",fo="/api/v1/custom-apps/manifests/templates",mo=5,ho=3;async function yo(){const e=await We(C(E.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}async function go(){const e=C(E.cwd(),"package.json"),t=await We(e),s=JSON.parse(t.toString());if(bo(s))return s;throw new Error(`Package file located at path: ${e} does not contain a version field`)}function bo(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function Eo(e){const t=Dn(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,An(C(E.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
16
+ `)}async function Co(e,t,s=S){try{const r=C(E.cwd(),`${s}/${e}/js/settings/content.mjs`),n=(await import(P(r).href)).default;return W(n,t),n}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function Oo(e,t,s=S){try{const r=C(E.cwd(),`${s}/${e}/js/settings/design.mjs`),n=(await import(P(r).href)).default;return ro(n),W(n,t),n}catch(r){const n=r;throw new Error(`Design settings is invalid or undefined. Error ${n.stack}`)}}async function wo(e,t,s=S){try{const r=await T("*.mjs",{cwd:C(E.cwd(),`${s}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(r.map(async n=>{const o=C(E.cwd(),`${s}/${e}/js/showcases/${n}`),i=(await import(P(o).href)).default;return ln(i.design),W(i,t),i}))}catch(r){throw new Error(`Showcases is invalid or undefined. Error ${r}`)}}async function vo(e,t=S){try{const s=C(E.cwd(),`${t}/${e}/js/settings/layout.mjs`);if(!L(s))return[];const r=(await import(P(s).href)).default;return r.forEach(n=>io(n.selectedDesignSettings)),r}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function $o(e,t=S){return await un(`${t}/${e}/js/settings/translations.mjs`)}async function pn(e,t=S){return await un(`${t}/${e}/js/showcases/translations.mjs`)}async function un(e){const t=C(E.cwd(),e),s=(await import(P(t).href)).default;return jo(s)}function W(e,t){if(e&&typeof e=="object"){const s=e;for(const r in s){const n=s[r];typeof n=="string"&&n.startsWith("$")&&(s[r]=To(t,n)),typeof n=="object"&&W(n,t)}}}function To(e,t){if(!t)return;const s=e[t];return s===void 0?{en:t}:s}function jo(e){const t={};for(const s in e){const r=e[s];for(const n in r){const o=t[n],i=r[n];if(o===void 0){const c={};c[s]=i,t[n]=c}else o[s]=i}}return t}async function De(e,t){const s=await $o(e,v[t].dist),r=await pn(e,v[t].dist),n=await Co(e,s,v[t].dist),o=await Oo(e,s,v[t].dist),i=await wo(e,r,v[t].dist),c=await vo(e,v[t].dist);return{id:e,type:t,name:{en:e},contentEditors:n,designEditors:o,layouts:c,showcases:i}}async function Ao(){const e=await T("*/",{cwd:C(E.cwd(),`${S}/`)}),t=await T("*/",{cwd:C(E.cwd(),`${he}/`)}),s=await T("*/",{cwd:C(E.cwd(),`${ye}/`)});return Promise.all([...e.map(async r=>De(r,"SECTION")),...t.map(async r=>De(r,"HEADER")),...s.map(async r=>De(r,"FOOTER"))])}async function So(e){try{return(await import(P(C(E.cwd(),e)).href)).default}catch{throw new Error(`Template descriptor [${e}] is either invalid or undefined`)}}async function No(){const e=await T(`${z}/js/**.mjs`,{ignore:[`${z}/js/**${X}.mjs`]});return Promise.all(e.map(async t=>{const s=await So(t),r=s.sections.filter(n=>n.type==="custom");for(const n of r){const o=Cs(n.id),i=await pn(n.id,v[o].dist);n.showcase_overrides!==void 0&&(W(n.showcase_overrides,i),ln(n.showcase_overrides.design))}return{id:`${ne(E.cwd()).name.replace(/[^a-zA-Z0-9]/g,"_")}_${ne(t).name}`,descriptor:s}}))}function ko(e,t){const s=e.pathContext,r=s.toPath(e.currentSection,t),n=r===void 0?Xe(s.fileName):Xe(s.fileName,{cwd:C(E.cwd(),r),ignore:s.ignore});return s.isSingleton?n.splice(0):n}function xo(e){return e instanceof Ye&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function fn(e,t){return e<ho&&xo(t)}async function dn(e){await new Promise(t=>{setTimeout(t,2**e*500)})}function mn(e,t,s,r){const n=e.config.app.templates.length>0?po:lo;return e.config.axios.post(n,{file:Sn(C(E.cwd(),s!==void 0?s+t:t))},{params:{appClientId:e.config.app.crane.appClientId,type:e.pathContext.type,version:e.config.app.packageJson.version,...e.currentSection!==void 0&&{block:e.currentSection},...e.pathContext.type!=="dependencies"&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`}}).then(o=>({status:o.status})).catch(async o=>fn(r,o)?(await dn(r),mn(e,t,s,r+1)):{status:o.response?.status,message:o.message})}function H(e,t="SECTION"){const s=ko(e,t),r=e.pathContext.toPath(e.currentSection,t);return s.map(n=>mn(e,n,r,0))}function Io(e){return[...e.app.sections.flatMap(t=>[...H({config:e,currentSection:t.id,pathContext:K[N.Server]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.Client]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.ClientAsset]},t.type),...H({config:e,currentSection:t.id,pathContext:K[N.Asset]},t.type)]),...H({config:e,pathContext:K[N.Dependency]}),...H({config:e,pathContext:K[N.TemplateAsset]})]}function Fo(e){return e.includes(`
17
+ `)}function Lo(e,t,s){return e.split(`
18
18
  `).map((r,n)=>n>=s?t+r:r).join(`
19
- `)}function mn(e,t){const s=[];if(e instanceof Ye){e.response?.status!==void 0&&s.push(` HTTP Status Code: ${e.response.status}`);const o=e.response?.data;if(o?.errorCode&&s.push(` Error Code: ${o.errorCode}`),o?.errorMessage){const i=_o(o.errorMessage)?Ro(o.errorMessage," ",1):o.errorMessage;s.push(` Error Message: ${i}`)}}const r=s.length>0?s.join(`
19
+ `)}function hn(e,t){const s=[];if(e instanceof Ye){e.response?.status!==void 0&&s.push(` HTTP Status Code: ${e.response.status}`);const o=e.response?.data;if(o?.errorCode&&s.push(` Error Code: ${o.errorCode}`),o?.errorMessage){const i=Fo(o.errorMessage)?Lo(o.errorMessage," ",1):o.errorMessage;s.push(` Error Message: ${i}`)}}const r=s.length>0?s.join(`
20
20
  `):e?.message??"Unknown error";if(!t||t.length===0)return r;const n=s.length>0?`
21
- `:" ";return`${t}${n}${r}`}async function hn(e,t=0){const s=e.app.templates.length>0?po:uo;return e.axios.post(s,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates,compressionEnabled:!0},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async r=>{if(pn(t,r))return await fn(t),hn(e,t+1);throw r})}async function Io(e){try{R(E(C.cwd(),A))||(b.error(`Distribution folder [${A}] not found, please execute the build command first.`),C.exit(1));const t=e??ao;b.info("Custom application deployment :: Started");const s=Nn.create({baseURL:t});Mn(s,fo),b.info("Loading configuration files ...");const r=await Promise.all([ho(),yo(),jo(),Ao()]).then(([c,a,u,p])=>({axios:s,app:{crane:c,packageJson:a,sections:u,templates:p}}));b.info("Uploading asset files ...");let n=et();const o=await Promise.all(xo(r)).finally(()=>{be(n)});o.every(c=>c.status===io)||(o.map(c=>c.message).filter((c,a,u)=>u.indexOf(c)===a).forEach(c=>b.error(`Error while uploading asset files: ${c}`)),C.exit(1)),b.info("Uploading manifest files ..."),n=et(),await hn(r).catch(c=>{be(n),b.error(mn(c,"Error while deploying manifest file:")),C.exit(1)}).finally(()=>{be(n)});const i=r.app.sections.map(c=>c.id);b.info(`Custom application deployment :: Successful
21
+ `:" ";return`${t}${n}${r}`}async function yn(e,t=0){const s=e.app.templates.length>0?fo:uo;return e.axios.post(s,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates,compressionEnabled:!0},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async r=>{if(fn(t,r))return await dn(t),yn(e,t+1);throw r})}async function _o(e){try{L(C(E.cwd(),S))||(b.error(`Distribution folder [${S}] not found, please execute the build command first.`),E.exit(1));const t=e??co;b.info("Custom application deployment :: Started");const s=Mn.create({baseURL:t});Gn(s,mo),b.info("Loading configuration files ...");const r=await Promise.all([yo(),go(),Ao(),No()]).then(([c,a,p,u])=>({axios:s,app:{crane:c,packageJson:a,sections:p,templates:u}}));b.info("Uploading asset files ...");let n=tt();const o=await Promise.all(Io(r)).finally(()=>{be(n)});o.every(c=>c.status===ao)||(o.map(c=>c.message).filter((c,a,p)=>p.indexOf(c)===a).forEach(c=>b.error(`Error while uploading asset files: ${c}`)),E.exit(1)),b.info("Uploading manifest files ..."),n=tt(),await yn(r).catch(c=>{be(n),b.error(hn(c,"Error while deploying manifest file:")),E.exit(1)}).finally(()=>{be(n)});const i=r.app.sections.map(c=>c.id);b.info(`Custom application deployment :: Successful
22
22
  Current app version: ${r.app.packageJson.version}
23
- Deployed sections: ${i.join(", ")}`),await bo(r.app.packageJson),r.app.templates.length>0&&b.info(`Deployed templates: ${r.app.templates.map(c=>c.id).join(", ")}`)}catch(t){b.error(mn(t,"Error while deploying:")),C.exit(1)}}const No="1.1.1",w=bn("crane");function Lo(){w.command("init","Initialize a new resource in the form of a directory.").option("--app <name>","Creates an app folder inside your current directory.").option("--section <name>","Creates the files necessary for one custom section with the given name, this can be repeated for each section.").option("--template <name>","Creates the directory and files necessary to build a custom template inside your app folder.").option("--custom-headers-footers","Creates the directories and files necessary to build a custom header and footer inside your app folder.").action(e=>{if(e.app)return tt(e.app);if(e.section)return nt(e.section);if(e.template)return st(e.template,e.customHeadersFooters);w.outputHelp()}),w.command("build","Builds your resource code").option("--externalize-vue","Externalize @vue core libraries to reduce the bundle size").action(Gs),w.command("deploy","Deploys your resource code into Ecwid"),w.on("command:*",()=>{console.error("Invalid command: %s",w.args.join(" ")),w.outputHelp(),process.exit(1)}),w.on("command:init",()=>{const e=w.options.section,t=w.options.app,s=w.options.template,r=w.options.customHeadersFooters||!1;Be(t)?De("app",ne("init --app <name>"),tt):Be(e)?De("section",ne("init --section <name>"),nt):Be(s)&&De("template",ne("init --template <name>"),st,r)}),w.on("command:deploy",()=>Io(w.options.url)),w.help(),w.usage("<action> <resource>"),w.version(No),w.parse()}try{Lo()}catch{}async function De(e,t,s,r){const n=`You can use ${t} to directly specify the name of the ${e}.`;console.log(n);const o=await Bn({type:"text",name:"name",message:`Please specify a name for your ${e}:`});if(o.name)return e==="template"?s(o.name,r):s(o.name);console.log("Please provide a name for the template."),w.outputHelp()}function Be(e){return e&&(typeof e!="string"||e.trim().length==0)}
23
+ Deployed sections: ${i.join(", ")}`),await Eo(r.app.packageJson),r.app.templates.length>0&&b.info(`Deployed templates: ${r.app.templates.map(c=>c.id).join(", ")}`)}catch(t){b.error(hn(t,"Error while deploying:")),E.exit(1)}}const Ro="1.1.2",O=En("crane");async function Ge(e,t,s,r){const n=`You can use ${t} to directly specify the name of the ${e}.`;console.log(n);const o=await Cn({type:"text",name:"name",message:`Please specify a name for your ${e}:`});return o.name?e==="template"?s(o.name,r):s(o.name):(console.log("Please provide a name for the template."),O.outputHelp())}function Be(e){return e&&(typeof e!="string"||e.trim().length===0)}function Mo(){O.command("init","Initialize a new resource in the form of a directory.").option("--app <name>","Creates an app folder inside your current directory.").option("--section <name>","Creates the files necessary for one custom section with the given name, this can be repeated for each section.").option("--template <name>","Creates the directory and files necessary to build a custom template inside your app folder.").option("--custom-headers-footers","Creates the directories and files necessary to build a custom header and footer inside your app folder.").action(e=>e.app?nt(e.app):e.section?st(e.section):e.template?ot(e.template,e.customHeadersFooters):O.outputHelp()),O.command("build","Builds your resource code").option("--externalize-vue","Externalize @vue core libraries to reduce the bundle size").action(Us),O.command("deploy","Deploys your resource code into Ecwid"),O.on("command:*",()=>{console.error("Invalid command: %s",O.args.join(" ")),O.outputHelp(),process.exit(1)}),O.on("command:init",()=>{const e=O.options.section,t=O.options.app,s=O.options.template,r=O.options.customHeadersFooters||!1;Be(t)?Ge("app",Z("init --app <name>"),nt):Be(e)?Ge("section",Z("init --section <name>"),st):Be(s)&&Ge("template",Z("init --template <name>"),ot,r)}),O.on("command:deploy",()=>_o(O.options.url)),O.help(),O.usage("<action> <resource>"),O.version(Ro),O.parse()}try{Mo()}catch(e){console.error(e)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/crane",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "bin": "bin/crane.js",
6
6
  "main": "./dist/app.mjs",
@@ -1,11 +1,14 @@
1
1
  <template>
2
2
  <div
3
- class="custom-block"
3
+ class="custom-footer"
4
4
  :style="backgroundStyle"
5
5
  >
6
6
  <div>
7
7
  <ReportAbuse />
8
8
  <div class="custom-block__blank_space" />
9
+ <LegalLinks />
10
+ <div class="custom-footer__blank_space" />
11
+ <LanguageSelector />
9
12
  </div>
10
13
  </div>
11
14
  </template>
@@ -15,6 +18,8 @@ import { computed } from 'vue';
15
18
  import { useBackgroundElementDesign } from '@lightspeed/crane';
16
19
  import ReportAbuse from './component/ReportAbuse.vue';
17
20
  import { Design } from './type.ts';
21
+ import LanguageSelector from '../../shared/LanguageSelector.vue';
22
+ import LegalLinks from './component/LegalLinks.vue';
18
23
 
19
24
  const backgroundDesign = useBackgroundElementDesign<Design>('background');
20
25
  const background = computed(() => ({
@@ -33,7 +38,7 @@ const backgroundStyle = computed(() => {
33
38
  </script>
34
39
 
35
40
  <style scoped lang="scss">
36
- .custom-block {
41
+ .custom-footer {
37
42
  padding: 50px;
38
43
 
39
44
  @media screen and (min-width: 700px) {
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div>
3
+ <span v-for="(link, index) in legalLinks" :key="index">
4
+ <a :href="link.url">{{ link.title }}</a>
5
+ <span v-if="index < legalLinks.length - 1"> | </span>
6
+ </span>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { useVueBaseProps } from '@lightspeed/crane';
12
+ import { Design } from '../type.ts';
13
+
14
+ const baseProps = useVueBaseProps<unknown, Design>();
15
+ const externalContent: ExternalContentData = baseProps.externalContent?.value;
16
+ const legalLinks = externalContent.legalLinks ?? [];
17
+ </script>
18
+
19
+ <style lang="scss" scoped>
20
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <a :href="externalContent?.reportAbuse?.url" target="{{ externalContent?.reportAbuseData?.target }}}">
3
+ <a :href="externalContent?.reportAbuse?.url" target="{{ externalContent?.reportAbuse?.target }}}">
4
4
  {{ externalContent?.reportAbuse?.title }}
5
5
  </a>
6
6
  </div>
@@ -1,30 +1,49 @@
1
1
  <template>
2
2
  <div class="custom-header">
3
- <div class="custom-header__left" />
3
+ <div class="custom-header__left">
4
+ <Logo />
5
+ <NavigationMenu />
6
+ </div>
4
7
  <div class="custom-header__right">
5
8
  <SearchForm />
9
+ <LanguageSelector />
10
+ <Account />
6
11
  <CartIcon />
7
12
  </div>
8
13
  </div>
9
14
  </template>
10
15
 
11
16
  <script setup lang="ts">
17
+ import NavigationMenu from './component/NavigationMenu.vue';
18
+ import LanguageSelector from '../../shared/LanguageSelector.vue';
12
19
  import CartIcon from './component/Cart.vue';
20
+ import Logo from './component/Logo.vue';
13
21
  import SearchForm from './component/SearchForm.vue';
22
+ import Account from './component/Account.vue';
14
23
  </script>
15
24
 
16
25
  <style scoped lang="scss">
17
- .custom-header{
26
+ .custom-header {
18
27
  display: flex;
19
28
  justify-content: space-between;
20
- padding: 10px;
29
+ padding: 5px 10px;
21
30
  .custom-header__right{
22
31
  display: flex;
23
32
  flex: 0 0 auto;
33
+ gap: 10px;
24
34
  align-items: center;
25
35
  justify-content: flex-end;
26
36
  order: 3;
27
37
  text-align: right;
28
38
  }
29
39
  }
40
+ .header-content {
41
+ padding: 0 12px;
42
+ height: 48px;
43
+ width: min(1280px, 100%);
44
+ margin: auto;
45
+ display: flex;
46
+ justify-content: space-between;
47
+ align-items: center;
48
+ }
30
49
  </style>
@@ -0,0 +1,11 @@
1
+ <svg
2
+ width="24"
3
+ height="24"
4
+ viewBox="0 0 24 24"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ >
7
+ <path
8
+ d="M23.5 12.0037C23.5012 10.0898 23.0244 8.20585 22.1129 6.52281C21.2014 4.83976 19.884 3.41084 18.2802 2.36565C16.6764 1.32047 14.8369 0.692104 12.9287 0.537549C11.0204 0.382995 9.10378 0.707143 7.35258 1.48059C5.60138 2.25404 4.07105 3.45232 2.9004 4.96672C1.72975 6.48113 0.955821 8.26374 0.64882 10.1529C0.34182 12.042 0.511461 13.9779 1.14235 15.7848C1.77325 17.5918 2.84543 19.2128 4.26165 20.5006C4.28966 20.5338 4.32226 20.5629 4.35848 20.5869C6.46141 22.4631 9.18149 23.5 12.0001 23.5C14.8188 23.5 17.5388 22.463 19.6417 20.5867C19.6778 20.5628 19.7102 20.5338 19.7381 20.5007C20.9235 19.4252 21.8705 18.1135 22.5184 16.6501C23.1663 15.1867 23.5007 13.604 23.5 12.0037ZM1.42 12.0037C1.41878 10.2648 1.84643 8.55248 2.66509 7.01827C3.48375 5.48405 4.66817 4.17528 6.11348 3.20782C7.55879 2.24035 9.22042 1.64404 10.9512 1.47168C12.6821 1.29931 14.4287 1.55621 16.0365 2.21963C17.6444 2.88305 19.0638 3.93252 20.1691 5.27513C21.2744 6.61775 22.0316 8.21209 22.3735 9.91701C22.7155 11.6219 22.6317 13.3848 22.1295 15.0496C21.6274 16.7145 20.7224 18.2298 19.4947 19.4616C18.3528 17.55 16.5208 16.1493 14.3764 15.5482C15.373 15.0182 16.1638 14.1702 16.6228 13.1392C17.0819 12.1081 17.1828 10.9532 16.9096 9.85816C16.6364 8.76314 16.0047 7.79091 15.1151 7.09614C14.2254 6.40136 13.1289 6.02395 12 6.02395C10.8711 6.02395 9.77458 6.40136 8.88494 7.09614C7.9953 7.79091 7.36363 8.76314 7.09042 9.85816C6.8172 10.9532 6.91814 12.1081 7.37717 13.1392C7.8362 14.1702 8.62696 15.0182 9.62364 15.5482C7.4792 16.1493 5.64721 17.55 4.50533 19.4616C3.52633 18.4819 2.74996 17.3191 2.22057 16.0394C1.69119 14.7598 1.41915 13.3884 1.42 12.0037ZM12 15.2226C11.1812 15.2226 10.3808 14.9799 9.69994 14.5252C9.01912 14.0704 8.48848 13.424 8.17514 12.6678C7.86179 11.9115 7.77981 11.0794 7.93955 10.2765C8.09929 9.4737 8.49359 8.73626 9.07258 8.15745C9.65157 7.57864 10.3892 7.18447 11.1923 7.02478C11.9954 6.86509 12.8278 6.94705 13.5843 7.26029C14.3408 7.57354 14.9874 8.10401 15.4423 8.78461C15.8972 9.46522 16.14 10.2654 16.14 11.084C16.1388 12.1812 15.7022 13.2332 14.9261 14.0091C14.1499 14.785 13.0976 15.2214 12 15.2226ZM5.19947 20.0991C5.88217 18.8976 6.87116 17.8985 8.06574 17.2035C9.26032 16.5084 10.6178 16.1422 12 16.1422C13.3822 16.1422 14.7397 16.5084 15.9343 17.2035C17.1288 17.8985 18.1178 18.8976 18.8005 20.0991C16.897 21.7015 14.4885 22.5803 12 22.5803C9.51148 22.5803 7.10295 21.7015 5.19947 20.0991Z"
9
+ fill="currentColor"
10
+ />
11
+ </svg>