@lightspeed/crane 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.1 - 2025-10-23
4
+
5
+ ### Added
6
+
7
+ - Add support for extended ISO 639-1 language codes in the format of [ISO 639-1]\_[ISO 3166-1].
8
+ - Add `showcaseOverrides` support to custom header/footer inside multipage templates.
9
+
10
+ ### Changed
11
+
12
+ - Update version of several dependencies.
13
+
3
14
  ## 1.4.0 - 2025-10-06
4
15
 
5
16
  ### Changed
package/dist/app.d.mts CHANGED
@@ -152,16 +152,16 @@ declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
152
152
  items: {
153
153
  performAction: (() => void) | undefined;
154
154
  id: string;
155
- title?: string | undefined;
156
- type?: ActionLinkType | undefined;
157
- link?: string | undefined;
158
- email?: string | undefined;
159
- phone?: string | undefined;
160
- tileIdForScroll?: string | undefined;
161
- pageIdForNavigate?: string | undefined;
162
- showStoreCategories?: boolean | undefined;
163
- isSubmenuOpened?: boolean | undefined;
164
- categoryId?: number | undefined;
155
+ title?: string;
156
+ type?: ActionLinkType;
157
+ link?: string;
158
+ email?: string;
159
+ phone?: string;
160
+ tileIdForScroll?: string;
161
+ pageIdForNavigate?: string;
162
+ showStoreCategories?: boolean;
163
+ isSubmenuOpened?: boolean;
164
+ categoryId?: number;
165
165
  }[];
166
166
  };
167
167
 
@@ -170,16 +170,16 @@ declare function useNavigationMenuElementContent<CONTENT>(): {
170
170
  items: {
171
171
  performAction: (() => void) | undefined;
172
172
  id: string;
173
- title?: string | undefined;
174
- type?: ActionLinkType | undefined;
175
- link?: string | undefined;
176
- email?: string | undefined;
177
- phone?: string | undefined;
178
- tileIdForScroll?: string | undefined;
179
- pageIdForNavigate?: string | undefined;
180
- showStoreCategories?: boolean | undefined;
181
- isSubmenuOpened?: boolean | undefined;
182
- categoryId?: number | undefined;
173
+ title?: string;
174
+ type?: ActionLinkType;
175
+ link?: string;
176
+ email?: string;
177
+ phone?: string;
178
+ tileIdForScroll?: string;
179
+ pageIdForNavigate?: string;
180
+ showStoreCategories?: boolean;
181
+ isSubmenuOpened?: boolean;
182
+ categoryId?: number;
183
183
  }[];
184
184
  };
185
185
 
@@ -204,14 +204,14 @@ declare function useDeckElementContent<CONTENT>(elementName: keyof CONTENT): {
204
204
  getReactiveRef: typeof getReactiveRef;
205
205
  };
206
206
  declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes, contentElementName: string): {
207
- hasContent: boolean;
208
- value: string | undefined;
209
- } | {
210
207
  hasContent: boolean;
211
208
  lowResolutionMobileImage: string;
212
209
  highResolutionMobileImage: string;
213
210
  lowResolutionDesktopImage: string;
214
211
  highResolutionDesktopImage: string;
212
+ } | {
213
+ hasContent: boolean;
214
+ value: string | undefined;
215
215
  } | {
216
216
  hasContent: boolean;
217
217
  value: boolean | undefined;
@@ -314,7 +314,7 @@ interface VueClientAppExtensions {
314
314
  declare function createVueClientApp<C, D>(appComponent: Component, extensions?: VueClientAppExtensions): {
315
315
  init: () => {
316
316
  mount: <S extends AppBaseState<C, D>>(rootContainer: string, state: S) => void;
317
- update: <S_1 extends AppBaseState<C, D>>(state: S_1) => void;
317
+ update: <S extends AppBaseState<C, D>>(state: S) => void;
318
318
  unmount: () => void;
319
319
  };
320
320
  };
package/dist/app.d.ts CHANGED
@@ -152,16 +152,16 @@ declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
152
152
  items: {
153
153
  performAction: (() => void) | undefined;
154
154
  id: string;
155
- title?: string | undefined;
156
- type?: ActionLinkType | undefined;
157
- link?: string | undefined;
158
- email?: string | undefined;
159
- phone?: string | undefined;
160
- tileIdForScroll?: string | undefined;
161
- pageIdForNavigate?: string | undefined;
162
- showStoreCategories?: boolean | undefined;
163
- isSubmenuOpened?: boolean | undefined;
164
- categoryId?: number | undefined;
155
+ title?: string;
156
+ type?: ActionLinkType;
157
+ link?: string;
158
+ email?: string;
159
+ phone?: string;
160
+ tileIdForScroll?: string;
161
+ pageIdForNavigate?: string;
162
+ showStoreCategories?: boolean;
163
+ isSubmenuOpened?: boolean;
164
+ categoryId?: number;
165
165
  }[];
166
166
  };
167
167
 
@@ -170,16 +170,16 @@ declare function useNavigationMenuElementContent<CONTENT>(): {
170
170
  items: {
171
171
  performAction: (() => void) | undefined;
172
172
  id: string;
173
- title?: string | undefined;
174
- type?: ActionLinkType | undefined;
175
- link?: string | undefined;
176
- email?: string | undefined;
177
- phone?: string | undefined;
178
- tileIdForScroll?: string | undefined;
179
- pageIdForNavigate?: string | undefined;
180
- showStoreCategories?: boolean | undefined;
181
- isSubmenuOpened?: boolean | undefined;
182
- categoryId?: number | undefined;
173
+ title?: string;
174
+ type?: ActionLinkType;
175
+ link?: string;
176
+ email?: string;
177
+ phone?: string;
178
+ tileIdForScroll?: string;
179
+ pageIdForNavigate?: string;
180
+ showStoreCategories?: boolean;
181
+ isSubmenuOpened?: boolean;
182
+ categoryId?: number;
183
183
  }[];
184
184
  };
185
185
 
@@ -204,14 +204,14 @@ declare function useDeckElementContent<CONTENT>(elementName: keyof CONTENT): {
204
204
  getReactiveRef: typeof getReactiveRef;
205
205
  };
206
206
  declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes, contentElementName: string): {
207
- hasContent: boolean;
208
- value: string | undefined;
209
- } | {
210
207
  hasContent: boolean;
211
208
  lowResolutionMobileImage: string;
212
209
  highResolutionMobileImage: string;
213
210
  lowResolutionDesktopImage: string;
214
211
  highResolutionDesktopImage: string;
212
+ } | {
213
+ hasContent: boolean;
214
+ value: string | undefined;
215
215
  } | {
216
216
  hasContent: boolean;
217
217
  value: boolean | undefined;
@@ -314,7 +314,7 @@ interface VueClientAppExtensions {
314
314
  declare function createVueClientApp<C, D>(appComponent: Component, extensions?: VueClientAppExtensions): {
315
315
  init: () => {
316
316
  mount: <S extends AppBaseState<C, D>>(rootContainer: string, state: S) => void;
317
- update: <S_1 extends AppBaseState<C, D>>(state: S_1) => void;
317
+ update: <S extends AppBaseState<C, D>>(state: S) => void;
318
318
  unmount: () => void;
319
319
  };
320
320
  };
package/dist/cli.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import Js from"cac";import*as re from"path";import g,{resolve as d,parse as M,sep as Le,dirname as Zs}from"path";import{red as Qs,yellow as en,green as U}from"kolorist";import Ne from"prompts";import h from"node:fs";import x from"node:path";import w from"node:process";import*as ae from"fs";import u,{existsSync as S,statSync as tn,rename as xe,unlink as Re,promises as me,writeFileSync as ke,readFileSync as on,createReadStream as sn}from"fs";import{pathToFileURL as Fe}from"url";import{fileURLToPath as nn}from"node:url";import rn from"adm-zip";import{glob as l,globSync as Ge}from"glob";import{defineConfig as Be,build as ce,createServer as an}from"vite";import cn from"tinycolor2";import ln from"ajv/dist/2020.js";import pn from"ajv-formats";import dn from"node:zlib";import{promisify as fn}from"node:util";import{JSONPath as un}from"jsonpath-plus";import{builtinModules as Me}from"module";import{viteExternalsPlugin as Ue}from"vite-plugin-externals";import mn from"vite-plugin-compression";import yn from"@vitejs/plugin-vue";import gn from"vite-tsconfig-paths";import hn from"vite-plugin-checker";import $n,{AxiosError as qe}from"axios";import{ConcurrencyManager as bn}from"axios-concurrency";import{readFile as ze}from"fs/promises";import*as R from"process";import D from"process";import{inc as En}from"semver";import Tn from"cli-progress";function Y(e,t=2){if(!+e)return"0 Bytes";const o=1024,s=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(o));return`${parseFloat((e/o**i).toFixed(s))} ${n[i]}`}const a={error:e=>console.log(Qs(e)),warn:e=>console.log(en(e)),info:e=>console.log(U(e))},L="_temp",$="dist/sections",W="dist/headers",J="dist/footers",A="dist/templates",q="layouts",Xe="preview",I=`dist/${q}`,Ke=2*1024*1024,He=500*1024;function le(e){return!!e}function Ve(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}const wn="Resource name can only contain alphanumeric characters, dashes, and underscores";function Sn(e){if(typeof e=="string"||typeof e=="number"){const t=/^[a-zA-Z0-9_-]+$/.test(e.toString());if(t)return{isValid:t,errorMessage:null}}return{isValid:!1,errorMessage:wn}}function On(e){return e===!0?!0:typeof e=="string"&&e.trim().length===0}async function z(e,t){try{const o=d(process.cwd(),t?`${e}${L}.mjs`:`${e}.mjs`),s=`?timestamp=${Date.now()}`;return(await import(Fe(o).href+s)).default}catch(o){const s=`File [${e}${t?L:""}.mjs] is either invalid or undefined`,n=o instanceof Error?o.message:s;throw new Error(n)}}function Ye(e){return Object.keys(e).length===0}function jn(e){return g.parse(e).name}function We(e,t){ae.statSync(e).isDirectory()?(ae.mkdirSync(t,{recursive:!0}),ae.readdirSync(e).forEach(o=>{const s=re.resolve(e,o),n=re.resolve(t,o);We(s,n)})):ae.copyFileSync(e,t)}function k(e,t,o,s){const n=re.join(e,s?.[o]??o);We(re.join(t,o),n)}function _n(e){return{renameFiles:{"example-template":`${e}`},targetPath:e,sourcePath:"template/page-templates",onTemplateCreated:()=>a.info(`Template [${e}] with pages structure named has been created`)}}function F(e){return x.resolve(nn(import.meta.url),"../..",e)}function In(){const e=F("package.json");return e!==""?JSON.parse(h.readFileSync(e,"utf8")):{}}async function vn(e){try{const t=e,o=w.cwd(),s=x.join(o,t),n=["templates","headers","footers","reference","page-templates","layouts"],i={_gitignore:".gitignore"};h.existsSync(s)?(a.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(s);const r=F("template");h.readdirSync(r).filter(T=>T!=="package.json").filter(T=>!n.includes(T)).forEach(async T=>k(s,r,T,i));const c=JSON.parse(h.readFileSync(x.join(r,"package.json"),"utf-8"));c.name=e;const m=In();m.version&&(c.dependencies["@lightspeed/crane"]=m.version),m.dependencies["@lightspeed/eslint-config-crane"]&&(c.dependencies["@lightspeed/eslint-config-crane"]=m.dependencies["@lightspeed/eslint-config-crane"]);const y=x.join(s,"package.json");h.writeFileSync(y,`${JSON.stringify(c,null,2)}
2
- `),a.info(`App ${e} created`)}catch(t){a.error(`Error while creating app: ${t.message}`),w.exit(1)}}function ye(e,t,o,s){try{const n=w.cwd(),i=g.join(n,t);u.existsSync(i)||u.mkdirSync(i);const r=g.join(n,t,o);u.existsSync(r)?(a.error(`${s} with the name: ${o} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):u.mkdirSync(r);const c=F(e);u.readdirSync(c).forEach(async m=>k(r,c,m)),a.info(`${s} ${o} created`)}catch(n){a.error(`Error while creating ${s}: ${n.message}`),w.exit(1)}}function ge(e){const t=w.cwd(),o=F(`template/${e}`),s=g.join(t,e);u.existsSync(s)||(u.mkdirSync(s),u.readdirSync(o).forEach(async n=>k(s,o,n)))}function Dn(e,t,o){if(!u.existsSync(o)){u.copyFileSync(t,o);return}const s=u.readFileSync(t),n=u.readFileSync(o);s.equals(n)||a.warn(`File "${e.name}" exists but differs from template. File will be skipped, this may lead to issues.`)}function Je(e,t){const o=u.readdirSync(e,{withFileTypes:!0});u.existsSync(t)||u.mkdirSync(t,{recursive:!0}),o.forEach(s=>{const n=g.join(e,s.name),i=g.join(t,s.name);s.isDirectory()?Je(n,i):Dn(s,n,i)})}function he(){try{const e=w.cwd(),t=g.join(e,"shared"),o=F("template/shared");if(!u.existsSync(o))return;Je(o,t)}catch(e){a.error(`Error while processing shared folder: ${e.message}`),w.exit(1)}}async function An(e){he(),ye("template/sections/example-section","sections",e,"Section")}async function Cn(e){const{targetPath:t,renameFiles:o,sourcePath:s,onTemplateCreated:n}=_n(e);try{const i=w.cwd(),r=x.join(i,"templates"),c=F(s),m=h.readdirSync(c);h.existsSync(r)?h.existsSync(x.join(r,t))&&(a.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(r),m.forEach(y=>k(r,c,y,o)),ge("headers"),ge("footers"),ge("layouts"),n()}catch(i){a.error(`Error while creating template descriptors: ${i.message}`),w.exit(1)}}async function Pn(){try{const e=w.cwd(),t=F("template/reference"),o=h.readdirSync(t);let s=!1;for(const n of o){const i=x.join(t,n),r=x.join(e,n);h.existsSync(r)||h.mkdirSync(r,{recursive:!0});const c=h.readdirSync(i),m=h.readdirSync(r);if(n==="shared"){c.forEach(y=>{k(r,i,y)});continue}for(const y of c){if(y==="assets"){k(r,i,y);continue}if(m.includes(y)){const{name:T}=await Ne({type:"text",name:"name",message:`The "${y}" already exists in ${n} directory: provide a new name to keep both or press Esc to skip this one.`});T?(k(r,i,y,{[y]:T}),s=!0):a.info(`Skipped: ${y}`)}else k(r,i,y)}}a.info("Reference templates have been added to the app"),s&&a.warn("Some files or folders were renamed to avoid conflicts. Template files may need to be updated to reflect these changes.")}catch(e){a.error(`Error while creating template descriptors: ${e.message}`),w.exit(1)}}var Ln=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(Ln||{}),Z=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e.NONE="NONE",e))(Z||{}),Ze=(e=>(e.SOLID="SOLID",e.OUTLINE="OUTLINE",e.TEXT="TEXT",e))(Ze||{}),Qe=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(Qe||{}),et=(e=>(e.ROUND_CORNER="ROUND_CORNER",e.RECTANGLE="RECTANGLE",e.PILL="PILL",e))(et||{}),pe=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e))(pe||{}),b=(e=>(e.SECTION="SECTION",e.HEADER="HEADER",e.FOOTER="FOOTER",e))(b||{}),C=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e[e.Layout=3]="Layout",e))(C||{}),f=(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.PageTemplateDescriptor=6]="PageTemplateDescriptor",e[e.TemplateAsset=7]="TemplateAsset",e[e.Layout=8]="Layout",e[e.LayoutSettings=9]="LayoutSettings",e[e.LayoutAsset=10]="LayoutAsset",e[e.SlotServer=11]="SlotServer",e[e.SlotClient=12]="SlotClient",e))(f||{}),Nn=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE="GO_TO_STORE",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(Nn||{}),xn=(e=>(e.TEXTAREA="TEXTAREA",e.INPUTBOX="INPUTBOX",e.SELECTBOX="SELECTBOX",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.BUTTON="BUTTON",e.DECK="DECK",e.MENU="MENU",e.NAVIGATION_MENU="NAVIGATION_MENU",e.LOGO="LOGO",e.INFO="INFO",e.DIVIDER="DIVIDER",e))(xn||{}),N=(e=>(e.TEXT="TEXT",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e.BACKGROUND="BACKGROUND",e.COLOR_PICKER="COLOR_PICKER",e.LOGO="LOGO",e.DIVIDER="DIVIDER",e))(N||{}),O=(e=>(e.PRODUCT="PRODUCT",e.CATALOG="CATALOG",e.CATEGORY="CATEGORY",e.HOME="HOME",e.CUSTOM="CUSTOM",e))(O||{}),Q=(e=>(e.CONTENT="Content",e.DESIGN="Design",e))(Q||{});const E={[b.SECTION]:{source:"sections",dist:"dist/sections"},[b.HEADER]:{source:"headers",dist:"dist/headers"},[b.FOOTER]:{source:"footers",dist:"dist/footers"}};var p=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientChunks=2]="ClientChunks",e[e.ClientAsset=3]="ClientAsset",e[e.Asset=4]="Asset",e[e.TemplateAsset=5]="TemplateAsset",e[e.Dependency=6]="Dependency",e[e.SourceCode=7]="SourceCode",e[e.LayoutClient=8]="LayoutClient",e[e.LayoutAsset=9]="LayoutAsset",e[e.SlotServer=10]="SlotServer",e[e.SlotClient=11]="SlotClient",e[e.SlotClientChunks=12]="SlotClientChunks",e[e.SlotClientAsset=13]="SlotClientAsset",e))(p||{}),Rn=(e=>(e.ORIGINAL="original",e.WEBP_LOW_RES="webp-200x200",e.WEBP_HI_2X_RES="webp-2000x2000",e.MOBILE_WEBP_LOW_RES="cropped-webp-100x200",e.MOBILE_WEBP_HI_RES="cropped-webp-1000x2000",e))(Rn||{}),kn=(e=>(e.TILE_LOADED="tile-loaded",e.TILE_UNLOADED="tile-unloaded",e))(kn||{});const Fn="https://blockbuster.ecwid.com",Gn="/api/v1/custom-apps/resources/sections/upload",Bn="/api/v1/custom-apps/resources/templates/upload",Mn="/api/v1/custom-apps/manifests/sections",Un="/api/v1/custom-apps/manifests/templates",qn=5,zn=3,Xn=[p.Server,p.Client,p.ClientChunks,p.ClientAsset,p.Asset],Kn=[p.LayoutClient,p.LayoutAsset],Hn=[p.SlotServer,p.SlotClient,p.SlotClientChunks,p.SlotClientAsset],Vn=[p.Dependency,p.TemplateAsset,p.SourceCode],X={DEFAULT:"Error while deploying:",ASSET_FILES_UPLOAD:"Error while uploading asset files:",MANIFEST_DEPLOYMENT:"Error while deploying manifest file:",DEPRECATED_VERSION_DEPLOYMENT:"You are using a non-supported version of crane. Please update to the latest crane version to continue.",DISTRIBUTION_FOLDER_NOT_FOUND:e=>`Distribution folder [${e}] not found, please execute the build command first.`},tt={catalog:"products",category:"category",product:"product"},Yn=e=>tt[e],ot=e=>e in tt;async function G(e){return(await import(Fe(e).href)).default}function $e(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function v(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=cn(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function st(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)}}function Wn(e){if(e!==void 0)return{...e,color:v(e.color)}}function be(e){return Object.fromEntries(Object.entries(e).filter(([t,o])=>o!==void 0))}function Jn(e){if(e!==void 0)switch(e){case pe.COLOR:return"solid";case pe.GRADIENT:return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(pe)}`)}}function Zn({style:e,color:t}){const o=Array.isArray(t)?t:[t,t];return{background:{type:Jn(e),solid:{color:v(o.at(0))},gradient:{fromColor:v(o.at(0)),toColor:v(o.at(1))}}}}function Qn(e){if(e!==void 0)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(Ze)}`)}}function ei(e){if(e!==void 0)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(Qe)}`)}}function ti(e){if(e!==void 0)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(et)}`)}}function oi(e){const t=Qn(e.appearance),o=ei(e.size),s=ti(e.shape),n=$e(e.font),i=v(e.color);return be({appearance:t,size:o,style:s,font:n,color:i})}function si(e){if(e!==void 0)switch(e){case Z.COLOR:return"solid";case Z.GRADIENT:return"gradient";case Z.NONE:return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(Z)}`)}}function ni(e){const t=e.color,o=Array.isArray(t)?t:[t,t];return{overlay:{type:si(e.overlay),solid:{color:v(o.at(0))},gradient:{fromColor:v(o.at(0)),toColor:v(o.at(1))}}}}function ii(e){const t=$e(e.font),o=v(e.color),s=st(e.size);return be({font:t,color:o,size:s})}function ri(e){const t=v(e.color);return be({color:t})}function ai(e){const t=$e(e.font),o=v(e.color),s=st(e.size);return{font:t,color:o,size:s,frame:Wn(e.frame)}}function Ee(e,t){if(t.defaults===void 0)return;let o={};switch(e){case N.TEXT:{o=ii(t.defaults);break}case N.BUTTON:{o=oi(t.defaults);break}case N.IMAGE:{o=ni(t.defaults);break}case N.BACKGROUND:{o=Zn(t.defaults);break}case N.COLOR_PICKER:{o=ri(t.defaults);break}case N.LOGO:{o=ai(t.defaults);break}case N.TOGGLE:case N.SELECTBOX:break;default:throw new Error(`Unknown design editor type: ${e}`)}return o}function nt(e){Object.keys(e).forEach(t=>{const o=e[t],s=o.type,n=Ee(s,o);n&&(e[t].defaults=n)})}function ci(e){e!==void 0&&e.forEach(t=>{if(t.type!==void 0&&t.defaults!==void 0){const o=Ee(t.type,t);o&&(t.defaults=o,t.defaults.type=t.type)}})}function it(e){e!==void 0&&Object.keys(e).forEach(t=>{const o=e[t],s=o.type,n=Ee(s,{defaults:o});n&&(e[t]={...e[t],...n})})}function li(e,t){if(!t)return;const o=e[t];return o===void 0?{en:t}:o}function pi(e){const t={};for(const o in e){const s=e[o];for(const n in s){const i=t[n],r=s[n];if(i===void 0){const c={};c[o]=r,t[n]=c}else i[o]=r}}return t}function B(e,t){if(!e||typeof e!="object")return;const o=e;for(const s in o){const n=o[s];typeof n=="string"&&n.startsWith("$")&&!Array.isArray(e)?o[s]=li(t,n):typeof n=="object"&&B(n,t)}}async function Te(e){const t=d(process.cwd(),e),o=await G(t);return pi(o)}function di(e){return e.replace(/\\/g,"/")}function fi(e){return e.replace(/^dist\/layouts\//,"").replace(/^layouts\//,"")}function we(e){return fi(di(e))}function rt(e){const t=we(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[o,s]=t;if(!ot(o))throw new Error(`Layout cannot be placed in a non-storefront section: ${o}`);const n=Yn(o);return{id:s,sectionId:o,pageId:n}}async function ui(){const e=`${I}/{product,catalog,category}/*`;return(await l(e,{ignore:["node_modules/**"]})).map(rt)}async function mi(e){return Te(`${I}/${e.sectionId}/${e.layoutId}/js/settings/translations.mjs`)}async function yi(e){try{const t=d(process.cwd(),`${I}/${e.sectionId}/${e.layoutId}/js/settings/content.mjs`),o=await G(t);return B(o,e.translations),o}catch(t){throw new Error(`Content descriptor for layout [${e.layoutId}] is either invalid or undefined: ${t}`)}}async function gi(e){try{const t=d(process.cwd(),`${I}/${e.sectionId}/${e.layoutId}/js/settings/design.mjs`),o=await G(t);return nt(o),B(o,e.translations),o}catch(t){throw new Error(`Design descriptor for layout [${e.layoutId}] is either invalid or undefined: ${t}`)}}function K(e,t,...o){if(!e||!t)throw new Error(`Cannot build layout path. Invalid parameters - sectionId: "${e}", layoutId: "${t}"`);return`${I}/${e}/${t}/${o.join("/")}`}const ee=(e=b.SECTION)=>E[e].dist,H={[p.Server]:{type:"server_js_compressed",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/server/`},[p.Client]:{type:"client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/`},[p.ClientChunks]:{type:"client_js_chunks",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/chunks/`,fileName:"*"},[p.ClientAsset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/assets/`},[p.Asset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/assets/`},[p.TemplateAsset]:{type:"template_assets",fileName:"*",isSingleton:!1,toPath:()=>`${A}/assets/`},[p.Dependency]:{type:"dependencies",fileName:"package.json",isSingleton:!0,toPath:()=>{}},[p.SourceCode]:{type:"source_code",fileName:"source-code.zip",isSingleton:!0,toPath:()=>{}},[p.LayoutClient]:{type:"layout_client_js",fileName:"index.mjs",isSingleton:!0,toPath:({sectionId:e,layoutId:t})=>K(e,t,"")},[p.LayoutAsset]:{type:"layout_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t})=>K(e,t,"assets/")},[p.SlotServer]:{type:"slot_server_js",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/server/")},[p.SlotClient]:{type:"slot_client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/")},[p.SlotClientChunks]:{type:"slot_client_js_chunks",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/chunks/")},[p.SlotClientAsset]:{type:"slot_client_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/assets/")}},at="https://json-schema.org/draft/2020-12/schema",ct="https://lightspeedhq.com/template-default.schema.json",lt="Default Section",pt="Default section for a Custom Template",dt="object",ft={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"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})?)$"},showcase_id:{description:"Showcase id of the section",type:"string"}},required:["type","id"],additionalProperties:!1}},hi={$schema:at,$id:ct,title:lt,description:pt,type:dt,$defs:ft},ut={__proto__:null,$defs:ft,$id:ct,$schema:at,default:hi,description:pt,title:lt,type:dt},mt="https://json-schema.org/draft/2020-12/schema",yt="https://lightspeedhq.com/template-custom.schema.json",gt="Custom Section",ht="Custom section for a Custom Template",$t="object",bt={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"custom"},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{$ref:"showcase_overrides.schema.json"}},required:["type","id"],additionalProperties:!1}},$i={$schema:mt,$id:yt,title:gt,description:ht,type:$t,$defs:bt},Et={__proto__:null,$defs:bt,$id:yt,$schema:mt,default:$i,description:ht,title:gt,type:$t},Tt="https://json-schema.org/draft/2020-12/schema",wt="https://lightspeedhq.com/template-custom-content.schema.json",St="Custom Section :: Content Configuration",Ot="Content tab configuration of a Custom Section for a Custom Template",jt="object",_t={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"INPUTBOX"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TEXTAREA"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"BUTTON"},title:{$ref:"common.schema.json#/$defs/label_type"},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","buttonType"],additionalProperties:!0},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"IMAGE"},imageData:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{type:"object"},MOBILE_WEBP_HI_RES:{type:"object"},WEBP_LOW_RES:{type:"object"},WEBP_HI_2X_RES:{type:"object"},ORIGINAL:{type:"object"}},additionalProperties:!1,minProperties:1},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",const:"TOGGLE"},enabled:{type:"boolean"}},required:["type"],additionalProperties:!0},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"SELECTBOX"},value:{type:"string"}},required:["type"],additionalProperties:!0},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"LOGO"},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",$ref:"common.schema.json#/$defs/label_type"},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",const:"MENU"}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"DECK"},cards:{type:"array",items:{type:"object",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"]}},required:["type"],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}},required:["settings"]}}},required:["type","cards"]}},bi={$schema:Tt,$id:wt,title:St,description:Ot,type:jt,$defs:_t},It={__proto__:null,$defs:_t,$id:wt,$schema:Tt,default:bi,description:Ot,title:St,type:jt},vt="https://json-schema.org/draft/2020-12/schema",Dt="https://lightspeedhq.com/template-custom-design.schema.json",At="Custom Section :: Design Configuration",Ct="Design tab configuration of a Custom Section for a Custom Template",Pt="object",Lt={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",const:"TEXT"},font:{description:"Default font for the text",type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",const:"BUTTON"},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:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",const:"IMAGE"},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 overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",const:"TOGGLE"},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},info:{type:"object",properties:{type:{description:"Type of the info",type:"string",const:"INFO"},font:{description:"Default font for the info",type:"string"},size:{description:"Default size for the info",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the info",type:"boolean"},italic:{description:"Default italic style for the info",type:"boolean"},color:{description:"Default color for the info",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the info",type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",const:"SELECTBOX"},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",const:"LOGO"},font:{description:"Default font for the text logo",type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},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:{oneOf:[{description:"Default color for frame on logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for frame on logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},Ei={$schema:vt,$id:Dt,title:At,description:Ct,type:Pt,$defs:Lt},Nt={__proto__:null,$defs:Lt,$id:Dt,$schema:vt,default:Ei,description:Ct,title:At,type:Pt},xt="https://json-schema.org/draft/2020-12/schema",Rt="https://lightspeedhq.com/section-content.schema.json",kt="Custom Section - Content",Ft="The content of a custom section",Gt="object",Bt={"^.*$":{type:"object",properties:{type:{type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","INFO","DECK","MENU","NAVIGATION_MENU","LOGO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"#/$defs/Deck"}},{if:{properties:{type:{const:"MENU"}}},then:{$ref:"#/$defs/Menu"}},{if:{properties:{type:{const:"NAVIGATION_MENU"}}},then:{$ref:"#/$defs/NavigationMenu"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}]}},Mt={Inputbox:{type:"object",properties:{type:{const:"INPUTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/InputboxDefaults"}},required:["type","label","placeholder"]},Textarea:{type:"object",properties:{type:{const:"TEXTAREA"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/TextareaDefaults"}},required:["type","label","placeholder"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ButtonDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"section-commons.schema.json#/$defs/Image"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDefaults"}},required:["type","label","description"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label","placeholder","description","options"]},Menu:{type:"object",properties:{type:{const:"MENU"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},NavigationMenu:{type:"object",properties:{type:{const:"NAVIGATION_MENU"}},required:["type"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoEditorButton"},defaults:{$ref:"#/$defs/InfoDefaults"}},required:["type","label","description"]},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},InputboxDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},TextareaDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},ButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},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:["title"]},ImageDefaults:{type:"object",properties:{imageData:{$ref:"section-commons.schema.json#/$defs/Image"}}},ToggleDefaults:{type:"object",properties:{enabled:{type:"boolean"}}},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}}},InfoDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoButtonDefaults"}}},SelectboxOption:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},value:{type:"string"}}},InfoEditorButton:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string"}}},InfoButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string",minLength:0}}},Deck:{type:"object",properties:{type:{const:"DECK"},cards:{description:"Cards of the content configuration element",type:"object",properties:{defaultCardContent:{type:"object",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"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/ButtonDefaults"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}}]}},minProperties:1}}}}},label:{$ref:"../common.schema.json#/$defs/label_type"},addButtonLabel:{$ref:"../common.schema.json#/$defs/label_type"},maxCards:{type:"number"}},required:["cards","maxCards","label","addButtonLabel","type"]}},Ut=!1,Ti={$schema:xt,$id:Rt,title:kt,description:Ft,type:Gt,patternProperties:Bt,$defs:Mt,additionalProperties:Ut},qt={__proto__:null,$defs:Mt,$id:Rt,$schema:xt,additionalProperties:Ut,default:Ti,description:Ft,patternProperties:Bt,title:kt,type:Gt},zt="https://json-schema.org/draft/2020-12/schema",Xt="https://lightspeedhq.com/sections/section-translation.schema.json",Kt="Custom Section - Translations",Ht="The translation of the section's labels",Vt="object",Yt={"^[a-z]{2}$":{type:"object",patternProperties:{"^\\$.*$":{type:"string"}},additionalProperties:!1}},Wt=!1,wi={$schema:zt,$id:Xt,title:Kt,description:Ht,type:Vt,patternProperties:Yt,additionalProperties:Wt},Jt={__proto__:null,$id:Xt,$schema:zt,additionalProperties:Wt,default:wi,description:Ht,patternProperties:Yt,title:Kt,type:Vt},Zt="https://json-schema.org/draft/2020-12/schema",Qt="https://lightspeedhq.com/section-design.schema.json",eo="Custom Section - Design",to="The design of a custom section",oo="object",so={"^.*$":{type:"object",properties:{type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"#/$defs/Text"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"#/$defs/Background"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"COLOR_PICKER"}}},then:{$ref:"#/$defs/Color"}},{if:{properties:{type:{const:"RATING"}}},then:{$ref:"#/$defs/Rating"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"SOCIAL_PROFILES"}}},then:{$ref:"#/$defs/SocialProfile"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}],additionalProperties:!0}},no={Text:{type:"object",properties:{type:{const:"TEXT"},label:{$ref:"../common.schema.json#/$defs/label_type"},sizes:{type:"array",items:{type:"integer"}},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/TextDesignDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ImageDesignDefaults"}},required:["type","label"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAutoColor:{type:["boolean","null"]},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ButtonDesignDefaults"}},required:["type","label"]},Background:{type:"object",properties:{type:{const:"BACKGROUND"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/BackgroundDesignDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDesignDefaults"}},required:["type","label"]},Color:{type:"object",properties:{type:{const:"COLOR_PICKER"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ColorPickerDefaults"}},required:["type","label"]},Rating:{type:"object",properties:{type:{const:"RATING"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/RatingDefaults"}},required:["type","label"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label"]},SocialProfile:{type:"object",properties:{type:{const:"SOCIAL_PROFILES"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SocialProfilesDefaults"}},required:["type","label"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},sizes:{type:"array",items:{type:"integer"}},defaults:{$ref:"#/$defs/LogoDesignDefaults"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},text:{type:"string"},button:{type:"object",properties:{title:{type:"string"},link:{type:"string"}},additionalProperties:!0}},required:["type","text"],additionalProperties:!0},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},TextDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},ImageDesignDefaults:{type:"object",properties:{overlay:{type:"string"},visible:{type:"boolean"}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}},required:[]},ButtonDesignDefaults:{type:"object",properties:{appearance:{type:"string",enum:["SOLID","OUTLINE","TEXT"]},font:{type:"string"},size:{type:"string",enum:["SMALL","MEDIUM","LARGE"]},style:{type:"string",enum:["round-corner","rectangle","pill"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},BackgroundDesignDefaults:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},ToggleDesignDefaults:{type:"object",properties:{enabled:{type:"boolean"}},required:[]},ColorPickerDefaults:{type:"object",properties:{appearance:{$ref:"section-commons.schema.json#/$defs/Color"}},required:[]},RatingDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},style:{type:"string"}},required:[]},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}},required:[]},SocialProfilesDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},appearance:{type:"string"}},required:[]},LogoDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},SelectboxOption:{type:"object",properties:{value:{type:"string"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:[]}},Si={$schema:Zt,$id:Qt,title:eo,description:to,type:oo,patternProperties:so,$defs:no},io={__proto__:null,$defs:no,$id:Qt,$schema:Zt,default:Si,description:to,patternProperties:so,title:eo,type:oo},ro="https://json-schema.org/draft/2020-12/schema",ao="https://lightspeedhq.com/section-commons.schema.json",co="Custom Section - Content",lo="The content of a custom section",po="object",fo={Image:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},MOBILE_WEBP_HI_RES:{$ref:"#/$defs/ImageInfo"},WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},WEBP_HI_2X_RES:{$ref:"#/$defs/ImageInfo"},ORIGINAL:{$ref:"#/$defs/ImageInfo"}},additionalProperties:!1,minProperties:1},borderInfo:{$ref:"#/$defs/BorderInfo"}},additionalProperties:!1,required:["set"]},ImageInfo:{type:"object",properties:{url:{type:"string"},width:{type:"integer",minimum:0},height:{type:"integer",minimum:0}}},BorderInfo:{type:"object",properties:{homogeneity:{type:"boolean"},color:{$ref:"#/$defs/RGBA"}}},RGBA:{type:"object",properties:{r:{type:"integer",minimum:0,maximum:255},g:{type:"integer",minimum:0,maximum:255},b:{type:"integer",minimum:0,maximum:255},a:{type:"number",format:"double",minimum:0,maximum:1}},required:["r","g","b","a"]},HSL:{type:"object",properties:{h:{type:"number",format:"double"},s:{type:"number",format:"double"},l:{type:"number",format:"double"},a:{type:"number",format:"double"}},required:["h","s","l","a"]},Overlay:{type:"object",properties:{type:{type:"string",enum:["solid","gradient","none"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Solid:{type:"object",properties:{color:{$ref:"#/$defs/Color"}}},Gradient:{type:"object",properties:{fromColor:{$ref:"#/$defs/Color"},toColor:{$ref:"#/$defs/Color"}}},Background:{type:"object",properties:{type:{type:"string",enum:["solid","gradient"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Color:{type:"object",properties:{raw:{type:"string"},hex:{type:"string"},auto:{type:"boolean"},rgba:{$ref:"#/$defs/RGBA"},hsl:{$ref:"#/$defs/HSL"}}}},uo=!1,Oi={$schema:ro,$id:ao,title:co,description:lo,type:po,$defs:fo,additionalProperties:uo},mo={__proto__:null,$defs:fo,$id:ao,$schema:ro,additionalProperties:uo,default:Oi,description:lo,title:co,type:po},yo="https://json-schema.org/draft/2020-12/schema",go="https://lightspeedhq.com/section-showcase.schema.json",ho="Custom Section - Showcase settings",$o="The setting of a showcase",bo="object",Eo=["showcaseId","previewImage"],To=[{properties:{showcaseId:{description:"Showcase id of the section",type:"string"},previewImage:{$ref:"section-commons.schema.json#/$defs/Image"}}},{$ref:"../showcase_overrides.schema.json"}],ji={$schema:yo,$id:go,title:ho,description:$o,type:bo,required:Eo,allOf:To},wo={__proto__:null,$id:go,$schema:yo,allOf:To,default:ji,description:$o,required:Eo,title:ho,type:bo},So="https://json-schema.org/draft/2020-12/schema",Oo="https://lightspeedhq.com/template.schema.json",jo="Custom Template",_o="A custom template enclosing the necessary custom and default blocks",Io="object",vo={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|ecwid\\.qa)($|/[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}},Do=["metadata","sections"],_i={$schema:So,$id:Oo,title:jo,description:_o,type:Io,properties:vo,required:Do},Ao={__proto__:null,$id:Oo,$schema:So,default:_i,description:_o,properties:vo,required:Do,title:jo,type:Io},Co="https://json-schema.org/draft/2020-12/schema",Po="https://lightspeedhq.com/showcase_overrides.schema.json",Lo="Showcase overrides",No="Overrides for the showcase",xo="object",Ro={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","MENU","NAVIGATION_MENU","INFO"]}},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"}}]}}},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"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/info"}}]}}},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",$ref:"common.schema.json#/$defs/label_type"}},Ii={$schema:Co,$id:Po,title:Lo,description:No,type:xo,properties:Ro},ko={__proto__:null,$id:Po,$schema:Co,default:Ii,description:No,properties:Ro,title:Lo,type:xo},Fo="https://json-schema.org/draft/2020-12/schema",Go="https://lightspeedhq.com/common.schema.json",Bo="Common Type Definitions",Mo="Common type definitions, used throughout other schemas",Uo="object",qo={label_type:{type:"string",pattern:"^\\$.+"}},vi={$schema:Fo,$id:Go,title:Bo,description:Mo,type:Uo,$defs:qo},zo={__proto__:null,$defs:qo,$id:Go,$schema:Fo,default:vi,description:Mo,title:Bo,type:Uo};function te(e){return S(`${W}/${e}`)?b.HEADER:S(`${J}/${e}`)?b.FOOTER:b.SECTION}function Xo(e){const t=te(e);return E[t].dist}const Di={menu:{type:"NAVIGATION_MENU"},logo:{type:"LOGO"}},Ai={logo:{type:"LOGO",colors:["#FFFFFF66","#0000004D","#00000099","#64C7FF66","#F9947266","#C794CD66","#FFD17466"],sizes:[18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60],defaults:{font:"global.fontFamily.body",size:40,bold:!0,italic:!1,color:"#313131",visible:!0,spacing:2,capitalization:"all",frame:{visible:!0,width:3,color:"#313131"}}}};function Ko(e){switch(e){case b.HEADER:return Di;default:return{}}}function Ho(e){switch(e){case b.HEADER:return Ai;default:return{}}}function Ci({validationType:e,sectionType:t}){switch(e){case Q.CONTENT:return Ko(t);case Q.DESIGN:return Ho(t);default:return{}}}function Pi({sectionSettings:e,mandatorySettings:t}){const o=[];return Object.entries(e).filter(([s])=>t[s]!==void 0).forEach(([s,n])=>{const i=t[s];n.type!==i.type&&o.push({instancePath:s,keyword:"type-mismatch",message:`Editor type "${n.type}" for reserved key "${s}" does not match the required type "${i.type}".`})}),o}function Li({type:e,mandatorySettings:t}){return Object.keys(t).find(o=>t[o].type===e)}function Ni({sectionSettings:e,mandatorySettings:t}){const o=[];return Object.entries(e).forEach(([s,n])=>{const i=Li({type:n.type,mandatorySettings:t});i&&s!==i&&o.push({instancePath:s,keyword:"key-mismatch",message:`Editor key "${s}" for overriden content type "${n.type}" does not match the required key name "${i}".`})}),o}function xi({type:e,mandatorySettings:t}){return Object.keys(t).findLast(o=>t[o].type===e)}function Ri({sectionSettings:e,mandatorySettings:t}){const o=[],s=Object.values(t).map(({type:i})=>i),n=Object.values(e).map(({type:i})=>i);return new Set(n.filter(i=>s.includes(i))).forEach(i=>{if(n.filter(r=>r===i).length>1){const r=xi({type:i,mandatorySettings:t});o.push({instancePath:r,keyword:"duplicate-type",message:`Editor type "${i}" can only be used once.`})}}),o}function ki(e,t){const{sectionSettings:o,sectionType:s}=t,n=Ci({validationType:e,sectionType:s});return n===void 0||Ye(n)?[]:[...Pi({sectionSettings:o,mandatorySettings:n}),...Ni({sectionSettings:o,mandatorySettings:n}),...Ri({sectionSettings:o,mandatorySettings:n})]}const oe=[mo,io,qt,wo,Ao,ut,Et,It,Nt,ko,zo];function V(e,t){const o=new ln({allErrors:!0,schemas:e});return pn(o),o.getSchema(t.$id)||o.compile(t)}function Fi(){return V(oe,Ao)}function Se(e){return e.map(t=>({instancePath:t.instancePath,message:t.message??"",keyword:t.keyword}))}const Gi=e=>(()=>{const t=Xo(e.name),o=t.split("/").pop()?.toLowerCase();return[{source:`./${o}/${e.name}/settings/content.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/content`),ajv:V(oe,qt),validationType:Q.CONTENT,sectionName:e.name,type:e.type},{source:`./${o}/${e.name}/settings/design.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/design`),ajv:V(oe,io),validationType:Q.DESIGN,sectionName:e.name,type:e.type},{source:`./${o}/${e.name}/settings/translations.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/translations`),ajv:V(oe,Jt),type:e.type},...e.showcaseEntryPoints.map(s=>({source:`./${o}/${e.name}/showcases/${M(s).name}.ts`,dist:g.resolve(`${t}/${e.name}/js/showcases/${M(s).name}`),ajv:V(oe,s.indexOf("translations")===-1?wo:Jt),type:e.type,sectionName:e.name}))]})();function Bi(e){const t=n=>{const i=(n??"").split("/").filter(r=>r.length>0);return i.length===0?"$":`$${i.map(r=>`.${r}`).join("")}`};let o=0,s=0;Object.keys(e).forEach(n=>{const i=e[n];o=Math.max(o,Math.max(...i.map(r=>t(r.instancePath).length))),s=Math.max(s,Math.max(...i.map(r=>r.message.length)))}),Object.keys(e).forEach(n=>{const i=e[n].filter((r,c,m)=>c===m.findIndex(y=>`${r.instancePath}${r.message}${r.keyword}`==`${y.instancePath}${y.message}${y.keyword}`));a.error(n),i.filter(r=>r.keyword!=="if").forEach(r=>{a.error(`${t(r.instancePath).padEnd(o," ")} | ${r.message.padEnd(s," ")} | ${r.keyword||"-"}`)})})}function Mi(e,t){if(e.validationType===void 0||e.sectionName===void 0)return[];const{sectionName:o,validationType:s}=e,n=te(o);return[...ki(s,{sectionSettings:t,sectionType:n})]}function Vo(e,t){return un({path:"$..set..url",json:t,resultType:"value"}).map(o=>{if(new RegExp(/^https?:\/\//).test(o))return null;const s=`${e}/assets/${o}`;return S(s)?null:{message:`Image ${o} is missing from assets folder`,keyword:"missing-asset"}}).filter(o=>o!==null)}async function Ui(e){const t=await z(e.dist,!1),o={},s=[],n=Xo(e.sectionName??"").split("/").pop()?.toLowerCase();return e.ajv(t)||s.push(...Se(e.ajv.errors??[])),s.push(...Mi(e,t),...Vo(`${n}/${e.sectionName}`,t)),s.length>0&&(o[e.source]=s),o}async function qi(e){const t=fn(dn.gunzip),o=await u.promises.readFile(e);return(await t(o)).length}async function Yo(e,t){const o=H[e],s=g.resolve(`${o.toPath(t)}${o.fileName}`),n=await qi(s);if(n>He)throw a.error(`Size of individual server file must not exceed threshold [${Y(He)}]!`),a.error(`${`File: ${s}`.padEnd(s.length+10)}| ${Y(n)}`),new Error("Invalid server file size")}function Wo(e){const t=e.reduce((o,s)=>{const n=tn(s);return n.size>Ke&&(o[s]=Y(n.size)),o},{});if(Object.keys(t).length!==0){const o=Math.max(...Object.keys(t).map(s=>s.length));a.error(`Size of individual assets must not exceed threshold [${Y(Ke)}]!`);for(const s in t)a.error(`${`File: ${s}`.padEnd(o+10)}| ${t[s]}`);throw new Error("Invalid asset file size")}}function zi(e,t,o,s){const n={};return e(t)&&s===void 0?xe(`${o}${L}.mjs`,`${o}.mjs`,()=>{}):(Re(`${o}${L}.mjs`,()=>{}),n[g.resolve(`./templates/${M(o).name}.ts`)]=[...Se(e.errors??[]),...s??[]]),n}const Jo={"process.env":{NODE_ENV:"production"}},Xi=[...Me,...Me.map(e=>`node:${e}`)],Ki=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],Zo=e=>({pluginType:C.Server,define:Jo,ssr:!0,ssrOptions:{noExternal:!0},entryFileNames:"server.js",externalOption:[...Xi,...Ki],inlineDynamicImports:!0,...e,outDir:e.outDir}),Qo=e=>({pluginType:C.Client,define:Jo,ssr:!1,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",chunkFileNames:"chunks/[name].js",inlineDynamicImports:!1,...e,outDir:e.outDir}),se=e=>({pluginType:C.Misc,ssr:!1,...e,entryFileNames:e.entryFileNames,outDir:e.outDir}),Hi=e=>({pluginType:C.Layout,ssr:!1,entryFileNames:"index.mjs",...e,outDir:e.outDir}),Oe=e=>({pluginType:C.Misc,ssr:!1,assetFileNames:"[name].[ext]",...e,outDir:e.outDir}),Vi=()=>mn({ext:".gz",algorithm:"gzip",deleteOriginFile:!0}),Yi="/* EXTERNAL_IMPORTS_START */",Wi="/* EXTERNAL_IMPORTS_END */",Ji=()=>({name:"external-imports-wrapper-plugin",enforce:"post",apply:"build",generateBundle(e,t){for(const o of Object.keys(t)){const s=t[o];if(s.type==="chunk"){const n=/import.*\?commonjs-external["'];/g,i=s.code.match(n);if(i!==null){const r=i.join(""),c=Yi+r+Wi,m=s.code.replace(n,"");s.code=c+m}}}}}),Zi=()=>{const e=process.env.npm_lifecycle_event;return hn({typescript:!0,vueTsc:!1,eslint:e==="test"?!1:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},P={VUE:yn(),TS_CONFIG_PATHS:gn(),CHECKER:Zi()},Qi={[C.Server]:[P.VUE,P.TS_CONFIG_PATHS,Ji(),Vi()],[C.Client]:[P.VUE,P.TS_CONFIG_PATHS,P.CHECKER,Ue({vue:"EcVue"})],[C.Misc]:[P.TS_CONFIG_PATHS,P.CHECKER],[C.Layout]:[P.VUE,P.TS_CONFIG_PATHS,P.CHECKER,Ue({vue:["EcExternals","Vue"]})]},er={[f.Server]:Zo({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/main/server`}),[f.Client]:Qo({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/main/client`}),[f.SectionSetting]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/settings`}),[f.SectionShowcase]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/showcases`}),[f.SectionAsset]:Oe({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/assets`}),[f.TemplateDescriptor]:se({entryFileNames:`[name]${L}.mjs`,outDir:()=>`./${A}/js`}),[f.PageTemplateDescriptor]:se({entryFileNames:`[name]${L}.mjs`,outDir:({name:e})=>`./${A}/${e}`}),[f.TemplateAsset]:Oe({outDir:()=>`./${A}/assets`}),[f.Layout]:Hi({outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}`}),[f.LayoutSettings]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}/js/settings`}),[f.LayoutAsset]:Oe({outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}/assets`}),[f.SlotServer]:Zo({outDir:({name:e,layoutId:t,sectionId:o})=>`./${I}/${o}/${t}/slots/${e}/js/main/server`}),[f.SlotClient]:Qo({outDir:({name:e,layoutId:t,sectionId:o})=>`./${I}/${o}/${t}/slots/${e}/js/main/client`})};function tr(e){switch(typeof e){case"string":return[d(process.cwd(),e)];case"object":return e.map(t=>d(process.cwd(),t));default:return[]}}function es({name:e,entryPoints:t,configType:o,layoutId:s,sectionId:n,sectionType:i=b.SECTION}){const r=er[o],c=r.define,m=r.ssrOptions,y=r.entryFileNames,T=r.chunkFileNames,fe=r.assetFileNames,ue=r.inlineDynamicImports,Ws=r.externalOption;return{plugins:Qi[r.pluginType],ssr:m,define:c,resolve:{alias:{"@":"/src"}},css:{preprocessorOptions:{scss:{api:"modern-compiler"}}},build:{ssr:r.ssr,outDir:r.outDir({name:e,sectionType:i,layoutId:s,sectionId:n}),emptyOutDir:!0,minify:"terser",terserOptions:{compress:{drop_console:!1,pure_getters:!0}},rollupOptions:{external:Ws,preserveEntrySignatures:"strict",input:tr(t),treeshake:{moduleSideEffects:!1},output:{validate:!0,inlineDynamicImports:ue,entryFileNames:y,chunkFileNames:T,assetFileNames:fe}}}}}async function or(){const e={ignore:["node_modules/**","dist/**"]},t=await l(`./${q}/{product,category,catalog}/*/Main.vue`,e);return await Promise.all(t.map(async o=>{const{id:s,sectionId:n,pageId:i}=rt(o),[r,c]=await Promise.all([l(`./${q}/${n}/${s}/settings/{content,design,translations}.{js,ts}`,e),l(`./${q}/${n}/${s}/assets/*`,e)]);return{name:s,sectionId:n,pageId:i,clientEntrypoint:o,settingsEntryPoints:r,assetsEntrypoints:c}}))}async function sr(e){Wo(e.assetsEntrypoints),await j({entryPoints:[e.clientEntrypoint],configType:f.Layout,name:e.name,sectionId:e.sectionId}),await Promise.all([j({entryPoints:e.settingsEntryPoints,configType:f.LayoutSettings,name:e.name,sectionId:e.sectionId}),j({entryPoints:e.assetsEntrypoints,configType:f.LayoutAsset,name:e.name,sectionId:e.sectionId})])}async function nr(e){e===void 0||e.length===0||await Promise.all(e.map(t=>sr(t)))}async function ir(e){const t=Be(es({name:e.name,entryPoints:e.serverEntrypoint,configType:f.Server,sectionType:e.type}));return Wo(e.assetEntryPoints),await ce({configFile:!1,...t}),await Yo(p.Server,{sectionId:e.name,sectionType:e.type}),await Promise.all([j({entryPoints:e.clientEntrypoint,configType:f.Client,name:e.name,sectionType:e.type}),j({entryPoints:e.settingsEntryPoints,configType:f.SectionSetting,name:e.name,sectionType:e.type}),j({entryPoints:e.showcaseEntryPoints,configType:f.SectionShowcase,name:e.name,sectionType:e.type}),j({entryPoints:e.assetEntryPoints,configType:f.SectionAsset,name:e.name,sectionType:e.type})]),await Gi(e).reduce(async(o,s)=>{const n=await o,i=await Ui(s);return{...n,...i}},Promise.resolve({}))}async function rr(e){return e.reduce(async(t,o)=>{const s=await t,n=await ir(o);return{...s,...n}},Promise.resolve({}))}function ts(e){const t=we(e).split("/");if(t.length<4||t[2]!=="slots")throw new Error(`Invalid slot path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/slots/{slotId}/[...path]`);const[o,s,,n]=t;if(!ot(o))throw new Error(`Slot cannot be placed in a non-storefront section: ${o}`);return{id:n,sectionId:o,layoutId:s}}async function ar(e){const t=await mi(e),[o,s]=await Promise.all([yi({...e,translations:t}),gi({...e,translations:t})]);return{...e,contentEditors:o,designEditors:s}}async function cr(){const e=`${I}/{product,catalog,category}/*/slots/*`,t=await l(e,{ignore:["node_modules/**"]});return await Promise.all(t.map(ts).map(ar))}async function lr(){const e={ignore:["node_modules/**","dist/**"]},t=await l(`${q}/{product,category,catalog}/*/slots/*/server.ts`,e);return Promise.all(t.map(async o=>{const{id:s,sectionId:n,layoutId:i}=ts(o),r=(await l(`${q}/${n}/${i}/slots/${s}/client.{js,ts}`,e))[0];if(r===void 0)throw new Error(`Cannot find client entrypoint file for slot ${s} of section ${n}`);return{id:s,sectionId:n,layoutId:i,serverEntrypoint:o,clientEntrypoint:r}}))}async function pr(e){const t={name:e.id,layoutId:e.layoutId,sectionId:e.sectionId};await j({entryPoints:[e.serverEntrypoint],configType:f.SlotServer,...t}),await Yo(p.SlotServer,{slotId:e.id,layoutId:e.layoutId,sectionId:e.sectionId}),await j({entryPoints:[e.clientEntrypoint],configType:f.SlotClient,...t})}async function dr(e){e===void 0||e.length===0||await e.reduce(async(t,o)=>{await t,await pr(o)},Promise.resolve())}const os="https://json-schema.org/draft/2020-12/schema",ss="https://lightspeedhq.com/metadata.schema.json",ns="Custom Multi Page Template metadata",is="Metadata of a multi page template",rs="object",as={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},header:{$ref:"./header_footer.schema.json"},footer:{$ref:"./header_footer.schema.json"}},cs=["metadata","header","footer"],ls=!1,fr={$schema:os,$id:ss,title:ns,description:is,type:rs,properties:as,required:cs,additionalProperties:ls},ur={__proto__:null,$id:ss,$schema:os,additionalProperties:ls,default:fr,description:is,properties:as,required:cs,title:ns,type:rs},ps="https://json-schema.org/draft/2020-12/schema",ds="https://lightspeedhq.com/header_footer.schema.json",fs="Header/Footer definition for a page template",us="object",ms=["type","id"],ys={type:{type:"string",enum:["custom","default"]},id:{type:"string"}},gs=!1,hs=[{if:{properties:{type:{const:"default"}}},then:{properties:{id:{enum:["header","footer"]}}}}],mr={$schema:ps,$id:ds,title:fs,type:us,required:ms,properties:ys,additionalProperties:gs,allOf:hs},yr={__proto__:null,$id:ds,$schema:ps,additionalProperties:gs,allOf:hs,default:mr,properties:ys,required:ms,title:fs,type:us},$s="https://json-schema.org/draft/2020-12/schema",bs="https://lightspeedhq.com/page.schema.json",Es="Homepage",Ts="Homepage enclosing the necessary custom and default blocks",ws="object",Ss={sections:{description:"List of sections contained by this page",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"custom"}}},then:{$ref:"../template-custom.schema.json#/$defs/custom-section"}},{if:{properties:{type:{const:"default"}}},then:{$ref:"../template-default.schema.json#/$defs/default-section"}},{not:{properties:{id:{enum:["header","footer"]}},required:["id"]}}]},minItems:1,uniqueItems:!1}},Os=!1,js=["sections"],gr={$schema:$s,$id:bs,title:Es,description:Ts,type:ws,properties:Ss,additionalProperties:Os,required:js},hr={__proto__:null,$id:bs,$schema:$s,additionalProperties:Os,default:gr,description:Ts,properties:Ss,required:js,title:Es,type:ws},_s="https://json-schema.org/draft/2020-12/schema",Is="https://lightspeedhq.com/page.schema.json",vs="Custom Page",Ds="A custom page enclosing the necessary custom and default blocks",As="object",Cs={sections:{description:"List of sections contained by this page",type:"array",minItems:1,maxItems:1,uniqueItems:!1,contains:{type:"object",properties:{type:{const:"store"}},required:["type"]},items:{type:"object",required:["type"],allOf:[{if:{properties:{type:{const:"store"}}},then:{$ref:"./store-section.schema.json"},else:{properties:{type:{description:"Type of the section",type:"string"},id:{description:"Unique identifier for the section",type:"string"}},required:["type","id"]}}]}}},Ps=!1,Ls=["sections"],$r={$schema:_s,$id:Is,title:vs,description:Ds,type:As,properties:Cs,additionalProperties:Ps,required:Ls},je={__proto__:null,$id:Is,$schema:_s,additionalProperties:Ps,default:$r,description:Ds,properties:Cs,required:Ls,title:vs,type:As},Ns="https://json-schema.org/draft/2020-12/schema",xs="https://lightspeedhq.com/store-section.schema.json",Rs="Store Section",ks="Store section for a custom page",Fs="object",Gs=[{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"store"},id:{description:"Layout identifier of the section. When not provided, the section will use the default layout.",type:"string"}},required:["type"],additionalProperties:!1}],br={$schema:Ns,$id:xs,title:Rs,description:ks,type:Fs,allOf:Gs},Er={__proto__:null,$id:xs,$schema:Ns,allOf:Gs,default:br,description:ks,title:Rs,type:Fs};function Tr(e){switch(e){case O.PRODUCT:return"product";case O.CATALOG:return"catalog";case O.CATEGORY:return"category";default:return null}}const wr=[mo,ut,Et,ko,Nt,It,Er,yr,zo],Sr=e=>{const t=[],o={},s=(n,i,r,c)=>{if(!n){o[e.name]||(o[e.name]=[]),o[e.name].push({instancePath:`/templates/${e.name}/${i}`,message:`Missing file: ${i}`,keyword:"required"});return}t.push({templateName:e.name,source:n,dist:g.resolve(`dist/templates/${e.name}/${i}`),ajv:V(wr,r),templatePageType:c})};return s(e.catalogEntrypoint,"catalog",je,O.CATALOG),s(e.productEntrypoint,"product",je,O.PRODUCT),s(e.homeEntrypoint,"home",hr,O.HOME),s(e.categoryEntrypoint,"category",je,O.CATEGORY),s(e.configurationEntrypoint,"configuration",ur,O.CUSTOM),[t,o]};function Or({section:e,context:t,normalizedPaths:o}){const s=Tr(t.templatePageType);if(s===null)return{instancePath:`/sections/${e.id}/id`,message:`Source folder not found for template page type "${t.templatePageType}".`,keyword:"source_folder_not_found"};const n=`${s}/${e.id}`;return o.some(i=>i.startsWith(n))?null:{instancePath:`/sections/${e.id}/id`,message:`Source layout for section "${e.id}" not found in "layouts/${s}/${e.id}".`,keyword:"layout_not_found"}}function jr(e){const{type:t,id:o}=e;return t==="store"&&o!==void 0&&o!==""}async function _r({content:e,context:t,layoutBuildConfigs:o}){const s=o.map(n=>we(n.clientEntrypoint));return e.sections.filter(jr).map(n=>Or({section:n,context:t,normalizedPaths:s})).filter(n=>n!==null)}function Ir(e){return"sections"in e}async function vr(e,t){const o=await z(e.dist,!0),s={},n=[];if(e.ajv(o)?xe(`${e.dist}${L}.mjs`,`${e.dist}.mjs`,()=>{}):(n.push(...Se(e.ajv.errors??[])),Re(`${e.dist}${L}.mjs`,()=>{})),Ir(o)&&t!==void 0){const i=await _r({content:o,context:e,layoutBuildConfigs:t});n.push(...i)}return n.length>0&&(s[e.source]=n),s}const Dr=async(e,t)=>{const[o,s]=Sr(e);return(await Promise.all(o.map(n=>vr(n,t)))).reduce((n,i)=>(Object.entries(i).forEach(([r,c])=>{n[r]=n[r]?[...n[r],...c]:[...c]}),n),{...s})};async function Ar(e,t,o,s=$){if(t.showcase_overrides?.content!==void 0)if(!S(`${s}/${t.id}/js/settings/content.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/content`,!1),i=new Set(Object.keys(n));Object.keys(t.showcase_overrides.content).every(r=>i.has(r))||e.push({instancePath:`/sections/${o}/showcase_overrides/content`,message:"Content descriptor must be a subset of the default content descriptor",keyword:"type"})}}async function Cr(e,t,o,s=$){if(t.showcase_overrides?.design!==void 0)if(!S(`${s}/${t.id}/js/settings/design.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/design`,!1),i=new Set(Object.keys(n));Object.keys(t.showcase_overrides.design).every(r=>i.has(r))||e.push({instancePath:`/sections/${o}/showcase_overrides/design`,message:"Design descriptor must be a subset of the default design descriptor",keyword:"type"})}}async function Pr(e,t,o,s=$){if(t.showcase_overrides?.layoutId!==void 0)if(!S(`${s}/${t.id}/js/settings/layout.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/layout`,message:"Layout id descriptor is set, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/layout`,!1);new Set(n.map(i=>i.layoutId)).has(t.showcase_overrides.layoutId)||e.push({instancePath:`/sections/${o}/showcase_overrides/layout`,message:"Layout id descriptor must be a valid id in the default layout descriptor",keyword:"type"})}}async function _e(e,t,o,s=$){t.showcase_overrides!==void 0&&(await Ar(e,t,o,s),await Cr(e,t,o,s),await Pr(e,t,o,s))}function Ie(e,t,o,s=$){t.showcase_id!==void 0&&(S(`${s}/${t.id}/js/showcases/${t.showcase_id}.mjs`)||e.push({instancePath:`/sections/${o}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified",keyword:"required"}))}async function Lr(e,t){const o=t.id==="header"&&t.type==="default",s=S(`${W}/${t.id}`);!o&&!s&&e.push({instancePath:"/sections/0/id",message:"The first section must be a `header`",keyword:"required"}),s&&(await _e(e,t,0,W),Ie(e,t,0,W))}async function Nr(e,t,o){const s=t.id==="footer"&&t.type==="default",n=S(`${J}/${t.id}`);!s&&!n&&e.push({instancePath:`/sections/${o}/id`,message:"The last section must be a `footer`",keyword:"required"}),n&&(await _e(e,t,o,J),Ie(e,t,o,J))}async function xr(e,t){t.showcase_overrides&&e.push(...Vo(`sections/${t.id}`,t.showcase_overrides))}async function Rr(e){const t=await e.sections.reduce(async(o,s,n)=>{const i=await o;return n===0?await Lr(i,s):n===e.sections.length-1?await Nr(i,s,e.sections.length-1):s.type==="custom"?S(`${$}/${s.id}`)?(await _e(i,s,n),Ie(i,s,n),await xr(i,s)):i.push({instancePath:`/sections/${n}/id`,message:"Custom section must have a corresponding block defined",keyword:"required"}):s.type==="default"&&(s.id==="header"&&i.push({instancePath:`/sections/${n}/id`,message:"Header can only be placed as the first section",keyword:"required"}),s.id==="footer"&&i.push({instancePath:`/sections/${n}/id`,message:"Footer can only be placed as the last section",keyword:"required"})),i},Promise.resolve([]));return t.length>0?t:void 0}async function kr(){const e=await l("./templates/*",{ignore:["templates/assets/**","templates/**.{js,ts}","node_modules/**","dist/**"]}).catch(t=>(a.error(`Error while getting page template entry points: ${t}`),[]));return Promise.all(e.map(async t=>{const o=t.split(Le),s=o.pop()??"default";if(o.pop()===void 0)throw new Error("Cannot determine template with custom pages, outer directory is undefined");const n=await l(`**/${s}/configuration.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await l(`**/${s}/pages/home.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),r=await l(`**/${s}/pages/category.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await l(`**/${s}/pages/catalog.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),m=await l(`**/${s}/pages/product.{js,ts}`,{ignore:["node_modules/**","dist/**"]});return{name:s,configurationEntrypoint:n.at(0),homeEntrypoint:i.at(0),categoryEntrypoint:r.at(0),catalogEntrypoint:c.at(0),productEntrypoint:m.at(0)}}))}async function Fr(){const e=await l("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await l("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{pageTemplates:await kr(),templates:e,assets:t}}async function Gr(e){if(e.templates.length===0&&e.pageTemplates?.length===0)return{};const t=Fi();return await Promise.all([j({entryPoints:e.assets,configType:f.TemplateAsset}),j({entryPoints:e.templates,configType:f.TemplateDescriptor})]),e.templates.reduce(async(o,s)=>{const n=await o,i=`${A}/js/${M(s).name}`,r=await z(i,!0);return{...n,...zi(t,r,i,await Rr(r))}},Promise.resolve({}))}async function Br({templateBuildConfig:e,layoutBuildConfigs:t}){return e.pageTemplates?.reduce(async(o,s)=>{const n=await o,i=[s.configurationEntrypoint,s.homeEntrypoint,s.categoryEntrypoint,s.catalogEntrypoint,s.productEntrypoint].filter(le);if(i.length===0)throw new Error("No entry points provided for page template");return await j({entryPoints:i,configType:f.PageTemplateDescriptor,name:s.name}),{...n,...await Dr(s,t)}},Promise.resolve({}))??{}}async function Mr(e){const t=await Fr(),o=await Promise.all([Gr(t),Br({templateBuildConfig:t,layoutBuildConfigs:e})]);return o.some(s=>!Ye(s))?o.reduce((s,n)=>({...s,...n}),{}):{}}function Ur(e){return{name:e.name,type:e.type,serverEntrypoint:e.serverEntrypoint,clientEntrypoint:[e.clientEntrypoint].filter(le).flat(),settingsEntryPoints:[e.contentSettingsEntrypoint,e.designSettingsEntrypoint,e.layoutSettingsEntrypoint,e.settingsTranslationsEntrypoint].filter(le),showcaseEntryPoints:[...e.showcasesEntrypoints??[],e.showcasesTranslationsEntrypoint].filter(le),assetEntryPoints:e.assetsEntrypoints??[]}}function qr(e){return Object.entries(E).find(t=>t[1].source===e)?.[0]}async function zr(){const e=await l("**/server.{js,ts}",{ignore:["node_modules/**","dist/**","templates/**","layouts/**"]});return Promise.all(e.map(async t=>{const o=Zs(t).split(Le),s=o.pop()??"default",n=o.pop();if(n===void 0)throw new Error("Cannot determine type of section, outer directory is undefined");const i=await l(`**/${s}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),r=await l(`**/${s}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await l(`**/${s}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),m=await l(`**/${s}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),y=await l(`**/${s}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),T=await l(`**/${s}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${s}/showcases/translations.{js,ts}`]}),fe=await l(`**/${s}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),ue=await l(`**/${s}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:s,type:qr(n),serverEntrypoint:t,clientEntrypoint:i.at(0),contentSettingsEntrypoint:r.at(0),designSettingsEntrypoint:c.at(0),layoutSettingsEntrypoint:m.at(0),settingsTranslationsEntrypoint:y.at(0),showcasesEntrypoints:T,showcasesTranslationsEntrypoint:fe.at(0),assetsEntrypoints:ue}}))}function Xr(){return Promise.all([me.rm("dist",{recursive:!0,force:!0}),me.rm("source-code",{recursive:!0,force:!0}),me.rm("source-code.zip",{force:!0})])}async function Kr(){const e=new rn,t=["node_modules/**/*","dist/**/*","build/**/*",".git/**/*","**/assets/**/*","crane.config.json"],o=await l("**/*",{cwd:d(process.cwd()),ignore:t,dot:!0,nodir:!0});try{o.forEach(i=>{const r=d(process.cwd(),i);e.addLocalFile(r,M(i).dir)});const s=H[p.SourceCode].fileName,n=d(process.cwd(),s);await e.writeZipPromise(n)}catch(s){throw a.error("Error while zipping source files"),s}}async function ve(e=!1){await Xr();try{const[t,o,s]=await Promise.all([or(),zr(),lr()]),n=o.map(Ur),i={...await rr(n),...await Mr(t)};Object.keys(i).length===0?(await Promise.all([dr(s),nr(t),Kr()]),a.info(`Build successful:
1
+ import Js from"cac";import*as re from"path";import g,{resolve as d,parse as M,sep as Le,dirname as Zs}from"path";import{red as Qs,yellow as en,green as U}from"kolorist";import Ne from"prompts";import h from"node:fs";import x from"node:path";import w from"node:process";import*as ae from"fs";import u,{existsSync as S,statSync as tn,rename as xe,unlink as Re,promises as me,writeFileSync as ke,readFileSync as on,createReadStream as sn}from"fs";import{pathToFileURL as Fe}from"url";import{fileURLToPath as nn}from"node:url";import rn from"adm-zip";import{glob as l,globSync as Ge}from"glob";import{defineConfig as Be,build as ce,createServer as an}from"vite";import cn from"tinycolor2";import ln from"ajv/dist/2020.js";import pn from"ajv-formats";import dn from"node:zlib";import{promisify as fn}from"node:util";import{JSONPath as un}from"jsonpath-plus";import{builtinModules as Me}from"module";import{viteExternalsPlugin as Ue}from"vite-plugin-externals";import mn from"vite-plugin-compression";import yn from"@vitejs/plugin-vue";import gn from"vite-tsconfig-paths";import hn from"vite-plugin-checker";import $n,{AxiosError as qe}from"axios";import{ConcurrencyManager as bn}from"axios-concurrency";import{readFile as ze}from"fs/promises";import*as R from"process";import D from"process";import{inc as En}from"semver";import Tn from"cli-progress";function Y(e,t=2){if(!+e)return"0 Bytes";const o=1024,s=t<0?0:t,n=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(o));return`${parseFloat((e/o**i).toFixed(s))} ${n[i]}`}const a={error:e=>console.log(Qs(e)),warn:e=>console.log(en(e)),info:e=>console.log(U(e))},L="_temp",$="dist/sections",W="dist/headers",J="dist/footers",A="dist/templates",q="layouts",Xe="preview",I=`dist/${q}`,Ke=2*1024*1024,He=500*1024;function le(e){return!!e}function Ve(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}const wn="Resource name can only contain alphanumeric characters, dashes, and underscores";function Sn(e){if(typeof e=="string"||typeof e=="number"){const t=/^[a-zA-Z0-9_-]+$/.test(e.toString());if(t)return{isValid:t,errorMessage:null}}return{isValid:!1,errorMessage:wn}}function On(e){return e===!0?!0:typeof e=="string"&&e.trim().length===0}async function z(e,t){try{const o=d(process.cwd(),t?`${e}${L}.mjs`:`${e}.mjs`),s=`?timestamp=${Date.now()}`;return(await import(Fe(o).href+s)).default}catch(o){const s=`File [${e}${t?L:""}.mjs] is either invalid or undefined`,n=o instanceof Error?o.message:s;throw new Error(n)}}function Ye(e){return Object.keys(e).length===0}function _n(e){return g.parse(e).name}function We(e,t){ae.statSync(e).isDirectory()?(ae.mkdirSync(t,{recursive:!0}),ae.readdirSync(e).forEach(o=>{const s=re.resolve(e,o),n=re.resolve(t,o);We(s,n)})):ae.copyFileSync(e,t)}function k(e,t,o,s){const n=re.join(e,s?.[o]??o);We(re.join(t,o),n)}function jn(e){return{renameFiles:{"example-template":`${e}`},targetPath:e,sourcePath:"template/page-templates",onTemplateCreated:()=>a.info(`Template [${e}] with pages structure named has been created`)}}function F(e){return x.resolve(nn(import.meta.url),"../..",e)}function In(){const e=F("package.json");return e!==""?JSON.parse(h.readFileSync(e,"utf8")):{}}async function vn(e){try{const t=e,o=w.cwd(),s=x.join(o,t),n=["templates","headers","footers","reference","page-templates","layouts"],i={_gitignore:".gitignore"};h.existsSync(s)?(a.error(`App with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(s);const r=F("template");h.readdirSync(r).filter(T=>T!=="package.json").filter(T=>!n.includes(T)).forEach(async T=>k(s,r,T,i));const c=JSON.parse(h.readFileSync(x.join(r,"package.json"),"utf-8"));c.name=e;const m=In();m.version&&(c.dependencies["@lightspeed/crane"]=m.version),m.dependencies["@lightspeed/eslint-config-crane"]&&(c.dependencies["@lightspeed/eslint-config-crane"]=m.dependencies["@lightspeed/eslint-config-crane"]);const y=x.join(s,"package.json");h.writeFileSync(y,`${JSON.stringify(c,null,2)}
2
+ `),a.info(`App ${e} created`)}catch(t){a.error(`Error while creating app: ${t.message}`),w.exit(1)}}function ye(e,t,o,s){try{const n=w.cwd(),i=g.join(n,t);u.existsSync(i)||u.mkdirSync(i);const r=g.join(n,t,o);u.existsSync(r)?(a.error(`${s} with the name: ${o} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):u.mkdirSync(r);const c=F(e);u.readdirSync(c).forEach(async m=>k(r,c,m)),a.info(`${s} ${o} created`)}catch(n){a.error(`Error while creating ${s}: ${n.message}`),w.exit(1)}}function ge(e){const t=w.cwd(),o=F(`template/${e}`),s=g.join(t,e);u.existsSync(s)||(u.mkdirSync(s),u.readdirSync(o).forEach(async n=>k(s,o,n)))}function Dn(e,t,o){if(!u.existsSync(o)){u.copyFileSync(t,o);return}const s=u.readFileSync(t),n=u.readFileSync(o);s.equals(n)||a.warn(`File "${e.name}" exists but differs from template. File will be skipped, this may lead to issues.`)}function Je(e,t){const o=u.readdirSync(e,{withFileTypes:!0});u.existsSync(t)||u.mkdirSync(t,{recursive:!0}),o.forEach(s=>{const n=g.join(e,s.name),i=g.join(t,s.name);s.isDirectory()?Je(n,i):Dn(s,n,i)})}function he(){try{const e=w.cwd(),t=g.join(e,"shared"),o=F("template/shared");if(!u.existsSync(o))return;Je(o,t)}catch(e){a.error(`Error while processing shared folder: ${e.message}`),w.exit(1)}}async function An(e){he(),ye("template/sections/example-section","sections",e,"Section")}async function Cn(e){const{targetPath:t,renameFiles:o,sourcePath:s,onTemplateCreated:n}=jn(e);try{const i=w.cwd(),r=x.join(i,"templates"),c=F(s),m=h.readdirSync(c);h.existsSync(r)?h.existsSync(x.join(r,t))&&(a.error(`Template with the name: ${e} already exists. If you'd like to override it, delete previous version first`),w.exit(1)):h.mkdirSync(r),m.forEach(y=>k(r,c,y,o)),ge("headers"),ge("footers"),ge("layouts"),n()}catch(i){a.error(`Error while creating template descriptors: ${i.message}`),w.exit(1)}}async function Pn(){try{const e=w.cwd(),t=F("template/reference"),o=h.readdirSync(t);let s=!1;for(const n of o){const i=x.join(t,n),r=x.join(e,n);h.existsSync(r)||h.mkdirSync(r,{recursive:!0});const c=h.readdirSync(i),m=h.readdirSync(r);if(n==="shared"){c.forEach(y=>{k(r,i,y)});continue}for(const y of c){if(y==="assets"){k(r,i,y);continue}if(m.includes(y)){const{name:T}=await Ne({type:"text",name:"name",message:`The "${y}" already exists in ${n} directory: provide a new name to keep both or press Esc to skip this one.`});T?(k(r,i,y,{[y]:T}),s=!0):a.info(`Skipped: ${y}`)}else k(r,i,y)}}a.info("Reference templates have been added to the app"),s&&a.warn("Some files or folders were renamed to avoid conflicts. Template files may need to be updated to reflect these changes.")}catch(e){a.error(`Error while creating template descriptors: ${e.message}`),w.exit(1)}}var Ln=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(Ln||{}),Z=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e.NONE="NONE",e))(Z||{}),Ze=(e=>(e.SOLID="SOLID",e.OUTLINE="OUTLINE",e.TEXT="TEXT",e))(Ze||{}),Qe=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(Qe||{}),et=(e=>(e.ROUND_CORNER="ROUND_CORNER",e.RECTANGLE="RECTANGLE",e.PILL="PILL",e))(et||{}),pe=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e))(pe||{}),b=(e=>(e.SECTION="SECTION",e.HEADER="HEADER",e.FOOTER="FOOTER",e))(b||{}),C=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e[e.Layout=3]="Layout",e))(C||{}),f=(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.PageTemplateDescriptor=6]="PageTemplateDescriptor",e[e.TemplateAsset=7]="TemplateAsset",e[e.Layout=8]="Layout",e[e.LayoutSettings=9]="LayoutSettings",e[e.LayoutAsset=10]="LayoutAsset",e[e.SlotServer=11]="SlotServer",e[e.SlotClient=12]="SlotClient",e))(f||{}),Nn=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE="GO_TO_STORE",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(Nn||{}),xn=(e=>(e.TEXTAREA="TEXTAREA",e.INPUTBOX="INPUTBOX",e.SELECTBOX="SELECTBOX",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.BUTTON="BUTTON",e.DECK="DECK",e.MENU="MENU",e.NAVIGATION_MENU="NAVIGATION_MENU",e.LOGO="LOGO",e.INFO="INFO",e.DIVIDER="DIVIDER",e))(xn||{}),N=(e=>(e.TEXT="TEXT",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e.BACKGROUND="BACKGROUND",e.COLOR_PICKER="COLOR_PICKER",e.LOGO="LOGO",e.DIVIDER="DIVIDER",e))(N||{}),O=(e=>(e.PRODUCT="PRODUCT",e.CATALOG="CATALOG",e.CATEGORY="CATEGORY",e.HOME="HOME",e.CUSTOM="CUSTOM",e))(O||{}),Q=(e=>(e.CONTENT="Content",e.DESIGN="Design",e))(Q||{});const E={[b.SECTION]:{source:"sections",dist:"dist/sections"},[b.HEADER]:{source:"headers",dist:"dist/headers"},[b.FOOTER]:{source:"footers",dist:"dist/footers"}};var p=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientChunks=2]="ClientChunks",e[e.ClientAsset=3]="ClientAsset",e[e.Asset=4]="Asset",e[e.TemplateAsset=5]="TemplateAsset",e[e.Dependency=6]="Dependency",e[e.SourceCode=7]="SourceCode",e[e.LayoutClient=8]="LayoutClient",e[e.LayoutAsset=9]="LayoutAsset",e[e.SlotServer=10]="SlotServer",e[e.SlotClient=11]="SlotClient",e[e.SlotClientChunks=12]="SlotClientChunks",e[e.SlotClientAsset=13]="SlotClientAsset",e))(p||{}),Rn=(e=>(e.ORIGINAL="original",e.WEBP_LOW_RES="webp-200x200",e.WEBP_HI_2X_RES="webp-2000x2000",e.MOBILE_WEBP_LOW_RES="cropped-webp-100x200",e.MOBILE_WEBP_HI_RES="cropped-webp-1000x2000",e))(Rn||{}),kn=(e=>(e.TILE_LOADED="tile-loaded",e.TILE_UNLOADED="tile-unloaded",e))(kn||{});const Fn="https://blockbuster.ecwid.com",Gn="/api/v1/custom-apps/resources/sections/upload",Bn="/api/v1/custom-apps/resources/templates/upload",Mn="/api/v1/custom-apps/manifests/sections",Un="/api/v1/custom-apps/manifests/templates",qn=5,zn=3,Xn=[p.Server,p.Client,p.ClientChunks,p.ClientAsset,p.Asset],Kn=[p.LayoutClient,p.LayoutAsset],Hn=[p.SlotServer,p.SlotClient,p.SlotClientChunks,p.SlotClientAsset],Vn=[p.Dependency,p.TemplateAsset,p.SourceCode],X={DEFAULT:"Error while deploying:",ASSET_FILES_UPLOAD:"Error while uploading asset files:",MANIFEST_DEPLOYMENT:"Error while deploying manifest file:",DEPRECATED_VERSION_DEPLOYMENT:"You are using a non-supported version of crane. Please update to the latest crane version to continue.",DISTRIBUTION_FOLDER_NOT_FOUND:e=>`Distribution folder [${e}] not found, please execute the build command first.`},tt={catalog:"products",category:"category",product:"product"},Yn=e=>tt[e],ot=e=>e in tt;async function G(e){return(await import(Fe(e).href)).default}function $e(e){if(e!==void 0)return e.startsWith("global.")?{type:"GLOBAL_FONT",font:e}:{type:"PRESET_FONT",font:e}}function v(e){if(e===void 0)return;if(e.startsWith("global."))return{type:"GLOBAL_COLOR",raw:e};const t=cn(e);return{type:"STRUCTURED_COLOR",raw:e,hex:t.toHex8String(),hsl:t.toHsl(),rgba:t.toRgb(),auto:!1}}function st(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)}}function Wn(e){if(e!==void 0)return{...e,color:v(e.color)}}function be(e){return Object.fromEntries(Object.entries(e).filter(([t,o])=>o!==void 0))}function Jn(e){if(e!==void 0)switch(e){case pe.COLOR:return"solid";case pe.GRADIENT:return"gradient";default:throw new Error(`Unknown background type: ${e}. Right options: ${Object.keys(pe)}`)}}function Zn({style:e,color:t}){const o=Array.isArray(t)?t:[t,t];return{background:{type:Jn(e),solid:{color:v(o.at(0))},gradient:{fromColor:v(o.at(0)),toColor:v(o.at(1))}}}}function Qn(e){if(e!==void 0)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(Ze)}`)}}function ei(e){if(e!==void 0)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(Qe)}`)}}function ti(e){if(e!==void 0)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(et)}`)}}function oi(e){const t=Qn(e.appearance),o=ei(e.size),s=ti(e.shape),n=$e(e.font),i=v(e.color);return be({appearance:t,size:o,style:s,font:n,color:i})}function si(e){if(e!==void 0)switch(e){case Z.COLOR:return"solid";case Z.GRADIENT:return"gradient";case Z.NONE:return"none";default:throw new Error(`Unknown image overlay type: ${e}. Right options: ${Object.keys(Z)}`)}}function ni(e){const t=e.color,o=Array.isArray(t)?t:[t,t];return{overlay:{type:si(e.overlay),solid:{color:v(o.at(0))},gradient:{fromColor:v(o.at(0)),toColor:v(o.at(1))}}}}function ii(e){const t=$e(e.font),o=v(e.color),s=st(e.size);return be({font:t,color:o,size:s})}function ri(e){const t=v(e.color);return be({color:t})}function ai(e){const t=$e(e.font),o=v(e.color),s=st(e.size);return{font:t,color:o,size:s,frame:Wn(e.frame)}}function Ee(e,t){if(t.defaults===void 0)return;let o={};switch(e){case N.TEXT:{o=ii(t.defaults);break}case N.BUTTON:{o=oi(t.defaults);break}case N.IMAGE:{o=ni(t.defaults);break}case N.BACKGROUND:{o=Zn(t.defaults);break}case N.COLOR_PICKER:{o=ri(t.defaults);break}case N.LOGO:{o=ai(t.defaults);break}case N.TOGGLE:case N.SELECTBOX:break;default:throw new Error(`Unknown design editor type: ${e}`)}return o}function nt(e){Object.keys(e).forEach(t=>{const o=e[t],s=o.type,n=Ee(s,o);n&&(e[t].defaults=n)})}function ci(e){e!==void 0&&e.forEach(t=>{if(t.type!==void 0&&t.defaults!==void 0){const o=Ee(t.type,t);o&&(t.defaults=o,t.defaults.type=t.type)}})}function it(e){e!==void 0&&Object.keys(e).forEach(t=>{const o=e[t],s=o.type,n=Ee(s,{defaults:o});n&&(e[t]={...e[t],...n})})}function li(e,t){if(!t)return;const o=e[t];return o===void 0?{en:t}:o}function pi(e){const t={};for(const o in e){const s=e[o];for(const n in s){const i=t[n],r=s[n];if(i===void 0){const c={};c[o]=r,t[n]=c}else i[o]=r}}return t}function B(e,t){if(!e||typeof e!="object")return;const o=e;for(const s in o){const n=o[s];typeof n=="string"&&n.startsWith("$")&&!Array.isArray(e)?o[s]=li(t,n):typeof n=="object"&&B(n,t)}}async function Te(e){const t=d(process.cwd(),e),o=await G(t);return pi(o)}function di(e){return e.replace(/\\/g,"/")}function fi(e){return e.replace(/^dist\/layouts\//,"").replace(/^layouts\//,"")}function we(e){return fi(di(e))}function rt(e){const t=we(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[o,s]=t;if(!ot(o))throw new Error(`Layout cannot be placed in a non-storefront section: ${o}`);const n=Yn(o);return{id:s,sectionId:o,pageId:n}}async function ui(){const e=`${I}/{product,catalog,category}/*`;return(await l(e,{ignore:["node_modules/**"]})).map(rt)}async function mi(e){return Te(`${I}/${e.sectionId}/${e.layoutId}/js/settings/translations.mjs`)}async function yi(e){try{const t=d(process.cwd(),`${I}/${e.sectionId}/${e.layoutId}/js/settings/content.mjs`),o=await G(t);return B(o,e.translations),o}catch(t){throw new Error(`Content descriptor for layout [${e.layoutId}] is either invalid or undefined: ${t}`)}}async function gi(e){try{const t=d(process.cwd(),`${I}/${e.sectionId}/${e.layoutId}/js/settings/design.mjs`),o=await G(t);return nt(o),B(o,e.translations),o}catch(t){throw new Error(`Design descriptor for layout [${e.layoutId}] is either invalid or undefined: ${t}`)}}function K(e,t,...o){if(!e||!t)throw new Error(`Cannot build layout path. Invalid parameters - sectionId: "${e}", layoutId: "${t}"`);return`${I}/${e}/${t}/${o.join("/")}`}const ee=(e=b.SECTION)=>E[e].dist,H={[p.Server]:{type:"server_js_compressed",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/server/`},[p.Client]:{type:"client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/`},[p.ClientChunks]:{type:"client_js_chunks",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/chunks/`,fileName:"*"},[p.ClientAsset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/js/main/client/assets/`},[p.Asset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${ee(t)}/${e}/assets/`},[p.TemplateAsset]:{type:"template_assets",fileName:"*",isSingleton:!1,toPath:()=>`${A}/assets/`},[p.Dependency]:{type:"dependencies",fileName:"package.json",isSingleton:!0,toPath:()=>{}},[p.SourceCode]:{type:"source_code",fileName:"source-code.zip",isSingleton:!0,toPath:()=>{}},[p.LayoutClient]:{type:"layout_client_js",fileName:"index.mjs",isSingleton:!0,toPath:({sectionId:e,layoutId:t})=>K(e,t,"")},[p.LayoutAsset]:{type:"layout_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t})=>K(e,t,"assets/")},[p.SlotServer]:{type:"slot_server_js",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/server/")},[p.SlotClient]:{type:"slot_client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/")},[p.SlotClientChunks]:{type:"slot_client_js_chunks",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/chunks/")},[p.SlotClientAsset]:{type:"slot_client_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:o})=>K(e,t,"slots",o,"js/main/client/assets/")}},at="https://json-schema.org/draft/2020-12/schema",ct="https://lightspeedhq.com/template-default.schema.json",lt="Default Section",pt="Default section for a Custom Template",dt="object",ft={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"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})?)$"},showcase_id:{description:"Showcase id of the section",type:"string"}},required:["type","id"],additionalProperties:!1}},hi={$schema:at,$id:ct,title:lt,description:pt,type:dt,$defs:ft},ut={__proto__:null,$defs:ft,$id:ct,$schema:at,default:hi,description:pt,title:lt,type:dt},mt="https://json-schema.org/draft/2020-12/schema",yt="https://lightspeedhq.com/template-custom.schema.json",gt="Custom Section",ht="Custom section for a Custom Template",$t="object",bt={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"custom"},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{$ref:"showcase_overrides.schema.json"}},required:["type","id"],additionalProperties:!1}},$i={$schema:mt,$id:yt,title:gt,description:ht,type:$t,$defs:bt},Et={__proto__:null,$defs:bt,$id:yt,$schema:mt,default:$i,description:ht,title:gt,type:$t},Tt="https://json-schema.org/draft/2020-12/schema",wt="https://lightspeedhq.com/template-custom-content.schema.json",St="Custom Section :: Content Configuration",Ot="Content tab configuration of a Custom Section for a Custom Template",_t="object",jt={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"INPUTBOX"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TEXTAREA"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"BUTTON"},title:{$ref:"common.schema.json#/$defs/label_type"},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","buttonType"],additionalProperties:!0},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"IMAGE"},imageData:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{type:"object"},MOBILE_WEBP_HI_RES:{type:"object"},WEBP_LOW_RES:{type:"object"},WEBP_HI_2X_RES:{type:"object"},ORIGINAL:{type:"object"}},additionalProperties:!1,minProperties:1},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",const:"TOGGLE"},enabled:{type:"boolean"}},required:["type"],additionalProperties:!0},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"SELECTBOX"},value:{type:"string"}},required:["type"],additionalProperties:!0},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"LOGO"},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",$ref:"common.schema.json#/$defs/label_type"},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",const:"MENU"}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"DECK"},cards:{type:"array",items:{type:"object",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"]}},required:["type"],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}},required:["settings"]}}},required:["type","cards"]}},bi={$schema:Tt,$id:wt,title:St,description:Ot,type:_t,$defs:jt},It={__proto__:null,$defs:jt,$id:wt,$schema:Tt,default:bi,description:Ot,title:St,type:_t},vt="https://json-schema.org/draft/2020-12/schema",Dt="https://lightspeedhq.com/template-custom-design.schema.json",At="Custom Section :: Design Configuration",Ct="Design tab configuration of a Custom Section for a Custom Template",Pt="object",Lt={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",const:"TEXT"},font:{description:"Default font for the text",type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",const:"BUTTON"},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:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",const:"IMAGE"},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 overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",const:"TOGGLE"},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},info:{type:"object",properties:{type:{description:"Type of the info",type:"string",const:"INFO"},font:{description:"Default font for the info",type:"string"},size:{description:"Default size for the info",type:"integer",minimum:1,exclusiveMaximum:50},bold:{description:"Default boldness for the info",type:"boolean"},italic:{description:"Default italic style for the info",type:"boolean"},color:{description:"Default color for the info",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the info",type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",const:"SELECTBOX"},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",const:"LOGO"},font:{description:"Default font for the text logo",type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},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:{oneOf:[{description:"Default color for frame on logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for frame on logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},Ei={$schema:vt,$id:Dt,title:At,description:Ct,type:Pt,$defs:Lt},Nt={__proto__:null,$defs:Lt,$id:Dt,$schema:vt,default:Ei,description:Ct,title:At,type:Pt},xt="https://json-schema.org/draft/2020-12/schema",Rt="https://lightspeedhq.com/section-content.schema.json",kt="Custom Section - Content",Ft="The content of a custom section",Gt="object",Bt={"^.*$":{type:"object",properties:{type:{type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","INFO","DECK","MENU","NAVIGATION_MENU","LOGO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"#/$defs/Deck"}},{if:{properties:{type:{const:"MENU"}}},then:{$ref:"#/$defs/Menu"}},{if:{properties:{type:{const:"NAVIGATION_MENU"}}},then:{$ref:"#/$defs/NavigationMenu"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}]}},Mt={Inputbox:{type:"object",properties:{type:{const:"INPUTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/InputboxDefaults"}},required:["type","label","placeholder"]},Textarea:{type:"object",properties:{type:{const:"TEXTAREA"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/TextareaDefaults"}},required:["type","label","placeholder"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ButtonDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"section-commons.schema.json#/$defs/Image"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDefaults"}},required:["type","label","description"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label","placeholder","description","options"]},Menu:{type:"object",properties:{type:{const:"MENU"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},NavigationMenu:{type:"object",properties:{type:{const:"NAVIGATION_MENU"}},required:["type"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoEditorButton"},defaults:{$ref:"#/$defs/InfoDefaults"}},required:["type","label","description"]},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},InputboxDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},TextareaDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},ButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},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:["title"]},ImageDefaults:{type:"object",properties:{imageData:{$ref:"section-commons.schema.json#/$defs/Image"}}},ToggleDefaults:{type:"object",properties:{enabled:{type:"boolean"}}},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}}},InfoDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoButtonDefaults"}}},SelectboxOption:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},value:{type:"string"}}},InfoEditorButton:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string"}}},InfoButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string",minLength:0}}},Deck:{type:"object",properties:{type:{const:"DECK"},cards:{description:"Cards of the content configuration element",type:"object",properties:{defaultCardContent:{type:"object",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"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/ButtonDefaults"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}}]}},minProperties:1}}}}},label:{$ref:"../common.schema.json#/$defs/label_type"},addButtonLabel:{$ref:"../common.schema.json#/$defs/label_type"},maxCards:{type:"number"}},required:["cards","maxCards","label","addButtonLabel","type"]}},Ut=!1,Ti={$schema:xt,$id:Rt,title:kt,description:Ft,type:Gt,patternProperties:Bt,$defs:Mt,additionalProperties:Ut},qt={__proto__:null,$defs:Mt,$id:Rt,$schema:xt,additionalProperties:Ut,default:Ti,description:Ft,patternProperties:Bt,title:kt,type:Gt},zt="https://json-schema.org/draft/2020-12/schema",Xt="https://lightspeedhq.com/sections/section-translation.schema.json",Kt="Custom Section - Translations",Ht="The translation of the section's labels",Vt="object",Yt={"^[a-z]{2}(_([a-z]{2}|[A-Z]{2}|[0-9]{3}))?$":{type:"object",patternProperties:{"^\\$.*$":{type:"string"}},additionalProperties:!1}},Wt=!1,wi={$schema:zt,$id:Xt,title:Kt,description:Ht,type:Vt,patternProperties:Yt,additionalProperties:Wt},Jt={__proto__:null,$id:Xt,$schema:zt,additionalProperties:Wt,default:wi,description:Ht,patternProperties:Yt,title:Kt,type:Vt},Zt="https://json-schema.org/draft/2020-12/schema",Qt="https://lightspeedhq.com/section-design.schema.json",eo="Custom Section - Design",to="The design of a custom section",oo="object",so={"^.*$":{type:"object",properties:{type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"#/$defs/Text"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"#/$defs/Background"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"COLOR_PICKER"}}},then:{$ref:"#/$defs/Color"}},{if:{properties:{type:{const:"RATING"}}},then:{$ref:"#/$defs/Rating"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"SOCIAL_PROFILES"}}},then:{$ref:"#/$defs/SocialProfile"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}],additionalProperties:!0}},no={Text:{type:"object",properties:{type:{const:"TEXT"},label:{$ref:"../common.schema.json#/$defs/label_type"},sizes:{type:"array",items:{type:"integer"}},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/TextDesignDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ImageDesignDefaults"}},required:["type","label"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAutoColor:{type:["boolean","null"]},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ButtonDesignDefaults"}},required:["type","label"]},Background:{type:"object",properties:{type:{const:"BACKGROUND"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/BackgroundDesignDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDesignDefaults"}},required:["type","label"]},Color:{type:"object",properties:{type:{const:"COLOR_PICKER"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ColorPickerDefaults"}},required:["type","label"]},Rating:{type:"object",properties:{type:{const:"RATING"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/RatingDefaults"}},required:["type","label"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label"]},SocialProfile:{type:"object",properties:{type:{const:"SOCIAL_PROFILES"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SocialProfilesDefaults"}},required:["type","label"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},sizes:{type:"array",items:{type:"integer"}},defaults:{$ref:"#/$defs/LogoDesignDefaults"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},text:{type:"string"},button:{type:"object",properties:{title:{type:"string"},link:{type:"string"}},additionalProperties:!0}},required:["type","text"],additionalProperties:!0},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},TextDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},ImageDesignDefaults:{type:"object",properties:{overlay:{type:"string"},visible:{type:"boolean"}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}},required:[]},ButtonDesignDefaults:{type:"object",properties:{appearance:{type:"string",enum:["SOLID","OUTLINE","TEXT"]},font:{type:"string"},size:{type:"string",enum:["SMALL","MEDIUM","LARGE"]},style:{type:"string",enum:["round-corner","rectangle","pill"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},BackgroundDesignDefaults:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},ToggleDesignDefaults:{type:"object",properties:{enabled:{type:"boolean"}},required:[]},ColorPickerDefaults:{type:"object",properties:{appearance:{$ref:"section-commons.schema.json#/$defs/Color"}},required:[]},RatingDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},style:{type:"string"}},required:[]},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}},required:[]},SocialProfilesDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},appearance:{type:"string"}},required:[]},LogoDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1,exclusiveMaximum:50},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},SelectboxOption:{type:"object",properties:{value:{type:"string"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:[]}},Si={$schema:Zt,$id:Qt,title:eo,description:to,type:oo,patternProperties:so,$defs:no},io={__proto__:null,$defs:no,$id:Qt,$schema:Zt,default:Si,description:to,patternProperties:so,title:eo,type:oo},ro="https://json-schema.org/draft/2020-12/schema",ao="https://lightspeedhq.com/section-commons.schema.json",co="Custom Section - Content",lo="The content of a custom section",po="object",fo={Image:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},MOBILE_WEBP_HI_RES:{$ref:"#/$defs/ImageInfo"},WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},WEBP_HI_2X_RES:{$ref:"#/$defs/ImageInfo"},ORIGINAL:{$ref:"#/$defs/ImageInfo"}},additionalProperties:!1,minProperties:1},borderInfo:{$ref:"#/$defs/BorderInfo"}},additionalProperties:!1,required:["set"]},ImageInfo:{type:"object",properties:{url:{type:"string"},width:{type:"integer",minimum:0},height:{type:"integer",minimum:0}}},BorderInfo:{type:"object",properties:{homogeneity:{type:"boolean"},color:{$ref:"#/$defs/RGBA"}}},RGBA:{type:"object",properties:{r:{type:"integer",minimum:0,maximum:255},g:{type:"integer",minimum:0,maximum:255},b:{type:"integer",minimum:0,maximum:255},a:{type:"number",format:"double",minimum:0,maximum:1}},required:["r","g","b","a"]},HSL:{type:"object",properties:{h:{type:"number",format:"double"},s:{type:"number",format:"double"},l:{type:"number",format:"double"},a:{type:"number",format:"double"}},required:["h","s","l","a"]},Overlay:{type:"object",properties:{type:{type:"string",enum:["solid","gradient","none"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Solid:{type:"object",properties:{color:{$ref:"#/$defs/Color"}}},Gradient:{type:"object",properties:{fromColor:{$ref:"#/$defs/Color"},toColor:{$ref:"#/$defs/Color"}}},Background:{type:"object",properties:{type:{type:"string",enum:["solid","gradient"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Color:{type:"object",properties:{raw:{type:"string"},hex:{type:"string"},auto:{type:"boolean"},rgba:{$ref:"#/$defs/RGBA"},hsl:{$ref:"#/$defs/HSL"}}}},uo=!1,Oi={$schema:ro,$id:ao,title:co,description:lo,type:po,$defs:fo,additionalProperties:uo},mo={__proto__:null,$defs:fo,$id:ao,$schema:ro,additionalProperties:uo,default:Oi,description:lo,title:co,type:po},yo="https://json-schema.org/draft/2020-12/schema",go="https://lightspeedhq.com/section-showcase.schema.json",ho="Custom Section - Showcase settings",$o="The setting of a showcase",bo="object",Eo=["showcaseId","previewImage"],To=[{properties:{showcaseId:{description:"Showcase id of the section",type:"string"},previewImage:{$ref:"section-commons.schema.json#/$defs/Image"}}},{$ref:"../showcase_overrides.schema.json"}],_i={$schema:yo,$id:go,title:ho,description:$o,type:bo,required:Eo,allOf:To},wo={__proto__:null,$id:go,$schema:yo,allOf:To,default:_i,description:$o,required:Eo,title:ho,type:bo},So="https://json-schema.org/draft/2020-12/schema",Oo="https://lightspeedhq.com/template.schema.json",_o="Custom Template",jo="A custom template enclosing the necessary custom and default blocks",Io="object",vo={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|ecwid\\.qa)($|/[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}},Do=["metadata","sections"],ji={$schema:So,$id:Oo,title:_o,description:jo,type:Io,properties:vo,required:Do},Ao={__proto__:null,$id:Oo,$schema:So,default:ji,description:jo,properties:vo,required:Do,title:_o,type:Io},Co="https://json-schema.org/draft/2020-12/schema",Po="https://lightspeedhq.com/showcase_overrides.schema.json",Lo="Showcase overrides",No="Overrides for the showcase",xo="object",Ro={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","MENU","NAVIGATION_MENU","INFO"]}},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"}}]}}},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"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/info"}}]}}},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",$ref:"common.schema.json#/$defs/label_type"}},Ii={$schema:Co,$id:Po,title:Lo,description:No,type:xo,properties:Ro},ko={__proto__:null,$id:Po,$schema:Co,default:Ii,description:No,properties:Ro,title:Lo,type:xo},Fo="https://json-schema.org/draft/2020-12/schema",Go="https://lightspeedhq.com/common.schema.json",Bo="Common Type Definitions",Mo="Common type definitions, used throughout other schemas",Uo="object",qo={label_type:{type:"string",pattern:"^\\$.+"}},vi={$schema:Fo,$id:Go,title:Bo,description:Mo,type:Uo,$defs:qo},zo={__proto__:null,$defs:qo,$id:Go,$schema:Fo,default:vi,description:Mo,title:Bo,type:Uo};function te(e){return S(`${W}/${e}`)?b.HEADER:S(`${J}/${e}`)?b.FOOTER:b.SECTION}function Xo(e){const t=te(e);return E[t].dist}const Di={menu:{type:"NAVIGATION_MENU"},logo:{type:"LOGO"}},Ai={logo:{type:"LOGO",colors:["#FFFFFF66","#0000004D","#00000099","#64C7FF66","#F9947266","#C794CD66","#FFD17466"],sizes:[18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60],defaults:{font:"global.fontFamily.body",size:40,bold:!0,italic:!1,color:"#313131",visible:!0,spacing:2,capitalization:"all",frame:{visible:!0,width:3,color:"#313131"}}}};function Ko(e){switch(e){case b.HEADER:return Di;default:return{}}}function Ho(e){switch(e){case b.HEADER:return Ai;default:return{}}}function Ci({validationType:e,sectionType:t}){switch(e){case Q.CONTENT:return Ko(t);case Q.DESIGN:return Ho(t);default:return{}}}function Pi({sectionSettings:e,mandatorySettings:t}){const o=[];return Object.entries(e).filter(([s])=>t[s]!==void 0).forEach(([s,n])=>{const i=t[s];n.type!==i.type&&o.push({instancePath:s,keyword:"type-mismatch",message:`Editor type "${n.type}" for reserved key "${s}" does not match the required type "${i.type}".`})}),o}function Li({type:e,mandatorySettings:t}){return Object.keys(t).find(o=>t[o].type===e)}function Ni({sectionSettings:e,mandatorySettings:t}){const o=[];return Object.entries(e).forEach(([s,n])=>{const i=Li({type:n.type,mandatorySettings:t});i&&s!==i&&o.push({instancePath:s,keyword:"key-mismatch",message:`Editor key "${s}" for overriden content type "${n.type}" does not match the required key name "${i}".`})}),o}function xi({type:e,mandatorySettings:t}){return Object.keys(t).findLast(o=>t[o].type===e)}function Ri({sectionSettings:e,mandatorySettings:t}){const o=[],s=Object.values(t).map(({type:i})=>i),n=Object.values(e).map(({type:i})=>i);return new Set(n.filter(i=>s.includes(i))).forEach(i=>{if(n.filter(r=>r===i).length>1){const r=xi({type:i,mandatorySettings:t});o.push({instancePath:r,keyword:"duplicate-type",message:`Editor type "${i}" can only be used once.`})}}),o}function ki(e,t){const{sectionSettings:o,sectionType:s}=t,n=Ci({validationType:e,sectionType:s});return n===void 0||Ye(n)?[]:[...Pi({sectionSettings:o,mandatorySettings:n}),...Ni({sectionSettings:o,mandatorySettings:n}),...Ri({sectionSettings:o,mandatorySettings:n})]}const oe=[mo,io,qt,wo,Ao,ut,Et,It,Nt,ko,zo];function V(e,t){const o=new ln({allErrors:!0,schemas:e});return pn(o),o.getSchema(t.$id)||o.compile(t)}function Fi(){return V(oe,Ao)}function Se(e){return e.map(t=>({instancePath:t.instancePath,message:t.message??"",keyword:t.keyword}))}const Gi=e=>(()=>{const t=Xo(e.name),o=t.split("/").pop()?.toLowerCase();return[{source:`./${o}/${e.name}/settings/content.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/content`),ajv:V(oe,qt),validationType:Q.CONTENT,sectionName:e.name,type:e.type},{source:`./${o}/${e.name}/settings/design.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/design`),ajv:V(oe,io),validationType:Q.DESIGN,sectionName:e.name,type:e.type},{source:`./${o}/${e.name}/settings/translations.ts`,dist:g.resolve(`${t}/${e.name}/js/settings/translations`),ajv:V(oe,Jt),type:e.type},...e.showcaseEntryPoints.map(s=>({source:`./${o}/${e.name}/showcases/${M(s).name}.ts`,dist:g.resolve(`${t}/${e.name}/js/showcases/${M(s).name}`),ajv:V(oe,s.indexOf("translations")===-1?wo:Jt),type:e.type,sectionName:e.name}))]})();function Bi(e){const t=n=>{const i=(n??"").split("/").filter(r=>r.length>0);return i.length===0?"$":`$${i.map(r=>`.${r}`).join("")}`};let o=0,s=0;Object.keys(e).forEach(n=>{const i=e[n];o=Math.max(o,Math.max(...i.map(r=>t(r.instancePath).length))),s=Math.max(s,Math.max(...i.map(r=>r.message.length)))}),Object.keys(e).forEach(n=>{const i=e[n].filter((r,c,m)=>c===m.findIndex(y=>`${r.instancePath}${r.message}${r.keyword}`==`${y.instancePath}${y.message}${y.keyword}`));a.error(n),i.filter(r=>r.keyword!=="if").forEach(r=>{a.error(`${t(r.instancePath).padEnd(o," ")} | ${r.message.padEnd(s," ")} | ${r.keyword||"-"}`)})})}function Mi(e,t){if(e.validationType===void 0||e.sectionName===void 0)return[];const{sectionName:o,validationType:s}=e,n=te(o);return[...ki(s,{sectionSettings:t,sectionType:n})]}function Vo(e,t){return un({path:"$..set..url",json:t,resultType:"value"}).map(o=>{if(new RegExp(/^https?:\/\//).test(o))return null;const s=`${e}/assets/${o}`;return S(s)?null:{message:`Image ${o} is missing from assets folder`,keyword:"missing-asset"}}).filter(o=>o!==null)}async function Ui(e){const t=await z(e.dist,!1),o={},s=[],n=Xo(e.sectionName??"").split("/").pop()?.toLowerCase();return e.ajv(t)||s.push(...Se(e.ajv.errors??[])),s.push(...Mi(e,t),...Vo(`${n}/${e.sectionName}`,t)),s.length>0&&(o[e.source]=s),o}async function qi(e){const t=fn(dn.gunzip),o=await u.promises.readFile(e);return(await t(o)).length}async function Yo(e,t){const o=H[e],s=g.resolve(`${o.toPath(t)}${o.fileName}`),n=await qi(s);if(n>He)throw a.error(`Size of individual server file must not exceed threshold [${Y(He)}]!`),a.error(`${`File: ${s}`.padEnd(s.length+10)}| ${Y(n)}`),new Error("Invalid server file size")}function Wo(e){const t=e.reduce((o,s)=>{const n=tn(s);return n.size>Ke&&(o[s]=Y(n.size)),o},{});if(Object.keys(t).length!==0){const o=Math.max(...Object.keys(t).map(s=>s.length));a.error(`Size of individual assets must not exceed threshold [${Y(Ke)}]!`);for(const s in t)a.error(`${`File: ${s}`.padEnd(o+10)}| ${t[s]}`);throw new Error("Invalid asset file size")}}function zi(e,t,o,s){const n={};return e(t)&&s===void 0?xe(`${o}${L}.mjs`,`${o}.mjs`,()=>{}):(Re(`${o}${L}.mjs`,()=>{}),n[g.resolve(`./templates/${M(o).name}.ts`)]=[...Se(e.errors??[]),...s??[]]),n}const Jo={"process.env":{NODE_ENV:"production"}},Xi=[...Me,...Me.map(e=>`node:${e}`)],Ki=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],Zo=e=>({pluginType:C.Server,define:Jo,ssr:!0,ssrOptions:{noExternal:!0},entryFileNames:"server.js",externalOption:[...Xi,...Ki],inlineDynamicImports:!0,...e,outDir:e.outDir}),Qo=e=>({pluginType:C.Client,define:Jo,ssr:!1,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",chunkFileNames:"chunks/[name].js",inlineDynamicImports:!1,...e,outDir:e.outDir}),se=e=>({pluginType:C.Misc,ssr:!1,...e,entryFileNames:e.entryFileNames,outDir:e.outDir}),Hi=e=>({pluginType:C.Layout,ssr:!1,entryFileNames:"index.mjs",...e,outDir:e.outDir}),Oe=e=>({pluginType:C.Misc,ssr:!1,assetFileNames:"[name].[ext]",...e,outDir:e.outDir}),Vi=()=>mn({ext:".gz",algorithm:"gzip",deleteOriginFile:!0}),Yi="/* EXTERNAL_IMPORTS_START */",Wi="/* EXTERNAL_IMPORTS_END */",Ji=()=>({name:"external-imports-wrapper-plugin",enforce:"post",apply:"build",generateBundle(e,t){for(const o of Object.keys(t)){const s=t[o];if(s.type==="chunk"){const n=/import.*\?commonjs-external["'];/g,i=s.code.match(n);if(i!==null){const r=i.join(""),c=Yi+r+Wi,m=s.code.replace(n,"");s.code=c+m}}}}}),Zi=()=>{const e=process.env.npm_lifecycle_event;return hn({typescript:!0,vueTsc:!1,eslint:e==="test"?!1:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},P={VUE:yn(),TS_CONFIG_PATHS:gn(),CHECKER:Zi()},Qi={[C.Server]:[P.VUE,P.TS_CONFIG_PATHS,Ji(),Vi()],[C.Client]:[P.VUE,P.TS_CONFIG_PATHS,P.CHECKER,Ue({vue:"EcVue"})],[C.Misc]:[P.TS_CONFIG_PATHS,P.CHECKER],[C.Layout]:[P.VUE,P.TS_CONFIG_PATHS,P.CHECKER,Ue({vue:["EcExternals","Vue"]})]},er={[f.Server]:Zo({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/main/server`}),[f.Client]:Qo({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/main/client`}),[f.SectionSetting]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/settings`}),[f.SectionShowcase]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/js/showcases`}),[f.SectionAsset]:Oe({outDir:({name:e,sectionType:t})=>`./${E[t].dist}/${e}/assets`}),[f.TemplateDescriptor]:se({entryFileNames:`[name]${L}.mjs`,outDir:()=>`./${A}/js`}),[f.PageTemplateDescriptor]:se({entryFileNames:`[name]${L}.mjs`,outDir:({name:e})=>`./${A}/${e}`}),[f.TemplateAsset]:Oe({outDir:()=>`./${A}/assets`}),[f.Layout]:Hi({outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}`}),[f.LayoutSettings]:se({entryFileNames:"[name].mjs",outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}/js/settings`}),[f.LayoutAsset]:Oe({outDir:({name:e,sectionId:t})=>`./${I}/${t}/${e}/assets`}),[f.SlotServer]:Zo({outDir:({name:e,layoutId:t,sectionId:o})=>`./${I}/${o}/${t}/slots/${e}/js/main/server`}),[f.SlotClient]:Qo({outDir:({name:e,layoutId:t,sectionId:o})=>`./${I}/${o}/${t}/slots/${e}/js/main/client`})};function tr(e){switch(typeof e){case"string":return[d(process.cwd(),e)];case"object":return e.map(t=>d(process.cwd(),t));default:return[]}}function es({name:e,entryPoints:t,configType:o,layoutId:s,sectionId:n,sectionType:i=b.SECTION}){const r=er[o],c=r.define,m=r.ssrOptions,y=r.entryFileNames,T=r.chunkFileNames,fe=r.assetFileNames,ue=r.inlineDynamicImports,Ws=r.externalOption;return{plugins:Qi[r.pluginType],ssr:m,define:c,resolve:{alias:{"@":"/src"}},css:{preprocessorOptions:{scss:{api:"modern-compiler"}}},build:{ssr:r.ssr,outDir:r.outDir({name:e,sectionType:i,layoutId:s,sectionId:n}),emptyOutDir:!0,minify:"terser",terserOptions:{compress:{drop_console:!1,pure_getters:!0}},rollupOptions:{external:Ws,preserveEntrySignatures:"strict",input:tr(t),treeshake:{moduleSideEffects:!1},output:{validate:!0,inlineDynamicImports:ue,entryFileNames:y,chunkFileNames:T,assetFileNames:fe}}}}}async function or(){const e={ignore:["node_modules/**","dist/**"]},t=await l(`./${q}/{product,category,catalog}/*/Main.vue`,e);return await Promise.all(t.map(async o=>{const{id:s,sectionId:n,pageId:i}=rt(o),[r,c]=await Promise.all([l(`./${q}/${n}/${s}/settings/{content,design,translations}.{js,ts}`,e),l(`./${q}/${n}/${s}/assets/*`,e)]);return{name:s,sectionId:n,pageId:i,clientEntrypoint:o,settingsEntryPoints:r,assetsEntrypoints:c}}))}async function sr(e){Wo(e.assetsEntrypoints),await _({entryPoints:[e.clientEntrypoint],configType:f.Layout,name:e.name,sectionId:e.sectionId}),await Promise.all([_({entryPoints:e.settingsEntryPoints,configType:f.LayoutSettings,name:e.name,sectionId:e.sectionId}),_({entryPoints:e.assetsEntrypoints,configType:f.LayoutAsset,name:e.name,sectionId:e.sectionId})])}async function nr(e){e===void 0||e.length===0||await Promise.all(e.map(t=>sr(t)))}async function ir(e){const t=Be(es({name:e.name,entryPoints:e.serverEntrypoint,configType:f.Server,sectionType:e.type}));return Wo(e.assetEntryPoints),await ce({configFile:!1,...t}),await Yo(p.Server,{sectionId:e.name,sectionType:e.type}),await Promise.all([_({entryPoints:e.clientEntrypoint,configType:f.Client,name:e.name,sectionType:e.type}),_({entryPoints:e.settingsEntryPoints,configType:f.SectionSetting,name:e.name,sectionType:e.type}),_({entryPoints:e.showcaseEntryPoints,configType:f.SectionShowcase,name:e.name,sectionType:e.type}),_({entryPoints:e.assetEntryPoints,configType:f.SectionAsset,name:e.name,sectionType:e.type})]),await Gi(e).reduce(async(o,s)=>{const n=await o,i=await Ui(s);return{...n,...i}},Promise.resolve({}))}async function rr(e){return e.reduce(async(t,o)=>{const s=await t,n=await ir(o);return{...s,...n}},Promise.resolve({}))}function ts(e){const t=we(e).split("/");if(t.length<4||t[2]!=="slots")throw new Error(`Invalid slot path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/slots/{slotId}/[...path]`);const[o,s,,n]=t;if(!ot(o))throw new Error(`Slot cannot be placed in a non-storefront section: ${o}`);return{id:n,sectionId:o,layoutId:s}}async function ar(e){const t=await mi(e),[o,s]=await Promise.all([yi({...e,translations:t}),gi({...e,translations:t})]);return{...e,contentEditors:o,designEditors:s}}async function cr(){const e=`${I}/{product,catalog,category}/*/slots/*`,t=await l(e,{ignore:["node_modules/**"]});return await Promise.all(t.map(ts).map(ar))}async function lr(){const e={ignore:["node_modules/**","dist/**"]},t=await l(`${q}/{product,category,catalog}/*/slots/*/server.ts`,e);return Promise.all(t.map(async o=>{const{id:s,sectionId:n,layoutId:i}=ts(o),r=(await l(`${q}/${n}/${i}/slots/${s}/client.{js,ts}`,e))[0];if(r===void 0)throw new Error(`Cannot find client entrypoint file for slot ${s} of section ${n}`);return{id:s,sectionId:n,layoutId:i,serverEntrypoint:o,clientEntrypoint:r}}))}async function pr(e){const t={name:e.id,layoutId:e.layoutId,sectionId:e.sectionId};await _({entryPoints:[e.serverEntrypoint],configType:f.SlotServer,...t}),await Yo(p.SlotServer,{slotId:e.id,layoutId:e.layoutId,sectionId:e.sectionId}),await _({entryPoints:[e.clientEntrypoint],configType:f.SlotClient,...t})}async function dr(e){e===void 0||e.length===0||await e.reduce(async(t,o)=>{await t,await pr(o)},Promise.resolve())}const os="https://json-schema.org/draft/2020-12/schema",ss="https://lightspeedhq.com/metadata.schema.json",ns="Custom Multi Page Template metadata",is="Metadata of a multi page template",rs="object",as={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},header:{$ref:"./header_footer.schema.json"},footer:{$ref:"./header_footer.schema.json"}},cs=["metadata","header","footer"],ls=!1,fr={$schema:os,$id:ss,title:ns,description:is,type:rs,properties:as,required:cs,additionalProperties:ls},ur={__proto__:null,$id:ss,$schema:os,additionalProperties:ls,default:fr,description:is,properties:as,required:cs,title:ns,type:rs},ps="https://json-schema.org/draft/2020-12/schema",ds="https://lightspeedhq.com/header_footer.schema.json",fs="Header/Footer definition for a page template",us="object",ms=["type","id"],ys={type:{type:"string",enum:["custom","default"]},id:{type:"string"},showcase_id:{type:"string"},showcase_overrides:{$ref:"../showcase_overrides.schema.json"}},gs=!1,hs=[{if:{properties:{type:{const:"default"}}},then:{properties:{id:{enum:["header","footer"]}}}},{if:{properties:{type:{const:"custom"}}},then:{properties:{showcase_id:{type:"string"},showcase_overrides:{$ref:"../showcase_overrides.schema.json"}}}}],mr={$schema:ps,$id:ds,title:fs,type:us,required:ms,properties:ys,additionalProperties:gs,allOf:hs},yr={__proto__:null,$id:ds,$schema:ps,additionalProperties:gs,allOf:hs,default:mr,properties:ys,required:ms,title:fs,type:us},$s="https://json-schema.org/draft/2020-12/schema",bs="https://lightspeedhq.com/page.schema.json",Es="Homepage",Ts="Homepage enclosing the necessary custom and default blocks",ws="object",Ss={sections:{description:"List of sections contained by this page",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"custom"}}},then:{$ref:"../template-custom.schema.json#/$defs/custom-section"}},{if:{properties:{type:{const:"default"}}},then:{$ref:"../template-default.schema.json#/$defs/default-section"}},{not:{properties:{id:{enum:["header","footer"]}},required:["id"]}}]},minItems:1,uniqueItems:!1}},Os=!1,_s=["sections"],gr={$schema:$s,$id:bs,title:Es,description:Ts,type:ws,properties:Ss,additionalProperties:Os,required:_s},hr={__proto__:null,$id:bs,$schema:$s,additionalProperties:Os,default:gr,description:Ts,properties:Ss,required:_s,title:Es,type:ws},js="https://json-schema.org/draft/2020-12/schema",Is="https://lightspeedhq.com/page.schema.json",vs="Custom Page",Ds="A custom page enclosing the necessary custom and default blocks",As="object",Cs={sections:{description:"List of sections contained by this page",type:"array",minItems:1,maxItems:1,uniqueItems:!1,contains:{type:"object",properties:{type:{const:"store"}},required:["type"]},items:{type:"object",required:["type"],allOf:[{if:{properties:{type:{const:"store"}}},then:{$ref:"./store-section.schema.json"},else:{properties:{type:{description:"Type of the section",type:"string"},id:{description:"Unique identifier for the section",type:"string"}},required:["type","id"]}}]}}},Ps=!1,Ls=["sections"],$r={$schema:js,$id:Is,title:vs,description:Ds,type:As,properties:Cs,additionalProperties:Ps,required:Ls},_e={__proto__:null,$id:Is,$schema:js,additionalProperties:Ps,default:$r,description:Ds,properties:Cs,required:Ls,title:vs,type:As},Ns="https://json-schema.org/draft/2020-12/schema",xs="https://lightspeedhq.com/store-section.schema.json",Rs="Store Section",ks="Store section for a custom page",Fs="object",Gs=[{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"store"},id:{description:"Layout identifier of the section. When not provided, the section will use the default layout.",type:"string"}},required:["type"],additionalProperties:!1}],br={$schema:Ns,$id:xs,title:Rs,description:ks,type:Fs,allOf:Gs},Er={__proto__:null,$id:xs,$schema:Ns,allOf:Gs,default:br,description:ks,title:Rs,type:Fs};function Tr(e){switch(e){case O.PRODUCT:return"product";case O.CATALOG:return"catalog";case O.CATEGORY:return"category";default:return null}}const wr=[mo,ut,Et,ko,Nt,It,Er,yr,zo],Sr=e=>{const t=[],o={},s=(n,i,r,c)=>{if(!n){o[e.name]||(o[e.name]=[]),o[e.name].push({instancePath:`/templates/${e.name}/${i}`,message:`Missing file: ${i}`,keyword:"required"});return}t.push({templateName:e.name,source:n,dist:g.resolve(`dist/templates/${e.name}/${i}`),ajv:V(wr,r),templatePageType:c})};return s(e.catalogEntrypoint,"catalog",_e,O.CATALOG),s(e.productEntrypoint,"product",_e,O.PRODUCT),s(e.homeEntrypoint,"home",hr,O.HOME),s(e.categoryEntrypoint,"category",_e,O.CATEGORY),s(e.configurationEntrypoint,"configuration",ur,O.CUSTOM),[t,o]};function Or({section:e,context:t,normalizedPaths:o}){const s=Tr(t.templatePageType);if(s===null)return{instancePath:`/sections/${e.id}/id`,message:`Source folder not found for template page type "${t.templatePageType}".`,keyword:"source_folder_not_found"};const n=`${s}/${e.id}`;return o.some(i=>i.startsWith(n))?null:{instancePath:`/sections/${e.id}/id`,message:`Source layout for section "${e.id}" not found in "layouts/${s}/${e.id}".`,keyword:"layout_not_found"}}function _r(e){const{type:t,id:o}=e;return t==="store"&&o!==void 0&&o!==""}async function jr({content:e,context:t,layoutBuildConfigs:o}){const s=o.map(n=>we(n.clientEntrypoint));return e.sections.filter(_r).map(n=>Or({section:n,context:t,normalizedPaths:s})).filter(n=>n!==null)}function Ir(e){return"sections"in e}async function vr(e,t){const o=await z(e.dist,!0),s={},n=[];if(e.ajv(o)?xe(`${e.dist}${L}.mjs`,`${e.dist}.mjs`,()=>{}):(n.push(...Se(e.ajv.errors??[])),Re(`${e.dist}${L}.mjs`,()=>{})),Ir(o)&&t!==void 0){const i=await jr({content:o,context:e,layoutBuildConfigs:t});n.push(...i)}return n.length>0&&(s[e.source]=n),s}const Dr=async(e,t)=>{const[o,s]=Sr(e);return(await Promise.all(o.map(n=>vr(n,t)))).reduce((n,i)=>(Object.entries(i).forEach(([r,c])=>{n[r]=n[r]?[...n[r],...c]:[...c]}),n),{...s})};async function Ar(e,t,o,s=$){if(t.showcase_overrides?.content!==void 0)if(!S(`${s}/${t.id}/js/settings/content.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/content`,message:"Content descriptor is overridden, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/content`,!1),i=new Set(Object.keys(n));Object.keys(t.showcase_overrides.content).every(r=>i.has(r))||e.push({instancePath:`/sections/${o}/showcase_overrides/content`,message:"Content descriptor must be a subset of the default content descriptor",keyword:"type"})}}async function Cr(e,t,o,s=$){if(t.showcase_overrides?.design!==void 0)if(!S(`${s}/${t.id}/js/settings/design.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/design`,message:"Design descriptor is overridden, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/design`,!1),i=new Set(Object.keys(n));Object.keys(t.showcase_overrides.design).every(r=>i.has(r))||e.push({instancePath:`/sections/${o}/showcase_overrides/design`,message:"Design descriptor must be a subset of the default design descriptor",keyword:"type"})}}async function Pr(e,t,o,s=$){if(t.showcase_overrides?.layoutId!==void 0)if(!S(`${s}/${t.id}/js/settings/layout.mjs`))e.push({instancePath:`/sections/${o}/showcase_overrides/layout`,message:"Layout id descriptor is set, please provide a default descriptor in the block's settings folder",keyword:"required"});else{const n=await z(`${s}/${t.id}/js/settings/layout`,!1);new Set(n.map(i=>i.layoutId)).has(t.showcase_overrides.layoutId)||e.push({instancePath:`/sections/${o}/showcase_overrides/layout`,message:"Layout id descriptor must be a valid id in the default layout descriptor",keyword:"type"})}}async function je(e,t,o,s=$){t.showcase_overrides!==void 0&&(await Ar(e,t,o,s),await Cr(e,t,o,s),await Pr(e,t,o,s))}function Ie(e,t,o,s=$){t.showcase_id!==void 0&&(S(`${s}/${t.id}/js/showcases/${t.showcase_id}.mjs`)||e.push({instancePath:`/sections/${o}/showcase-id`,message:"Custom section must have a corresponding showcase defined in case showcase_id is specified",keyword:"required"}))}async function Lr(e,t){const o=t.id==="header"&&t.type==="default",s=S(`${W}/${t.id}`);!o&&!s&&e.push({instancePath:"/sections/0/id",message:"The first section must be a `header`",keyword:"required"}),s&&(await je(e,t,0,W),Ie(e,t,0,W))}async function Nr(e,t,o){const s=t.id==="footer"&&t.type==="default",n=S(`${J}/${t.id}`);!s&&!n&&e.push({instancePath:`/sections/${o}/id`,message:"The last section must be a `footer`",keyword:"required"}),n&&(await je(e,t,o,J),Ie(e,t,o,J))}async function xr(e,t){t.showcase_overrides&&e.push(...Vo(`sections/${t.id}`,t.showcase_overrides))}async function Rr(e){const t=await e.sections.reduce(async(o,s,n)=>{const i=await o;return n===0?await Lr(i,s):n===e.sections.length-1?await Nr(i,s,e.sections.length-1):s.type==="custom"?S(`${$}/${s.id}`)?(await je(i,s,n),Ie(i,s,n),await xr(i,s)):i.push({instancePath:`/sections/${n}/id`,message:"Custom section must have a corresponding block defined",keyword:"required"}):s.type==="default"&&(s.id==="header"&&i.push({instancePath:`/sections/${n}/id`,message:"Header can only be placed as the first section",keyword:"required"}),s.id==="footer"&&i.push({instancePath:`/sections/${n}/id`,message:"Footer can only be placed as the last section",keyword:"required"})),i},Promise.resolve([]));return t.length>0?t:void 0}async function kr(){const e=await l("./templates/*",{ignore:["templates/assets/**","templates/**.{js,ts}","node_modules/**","dist/**"]}).catch(t=>(a.error(`Error while getting page template entry points: ${t}`),[]));return Promise.all(e.map(async t=>{const o=t.split(Le),s=o.pop()??"default";if(o.pop()===void 0)throw new Error("Cannot determine template with custom pages, outer directory is undefined");const n=await l(`**/${s}/configuration.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),i=await l(`**/${s}/pages/home.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),r=await l(`**/${s}/pages/category.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await l(`**/${s}/pages/catalog.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),m=await l(`**/${s}/pages/product.{js,ts}`,{ignore:["node_modules/**","dist/**"]});return{name:s,configurationEntrypoint:n.at(0),homeEntrypoint:i.at(0),categoryEntrypoint:r.at(0),catalogEntrypoint:c.at(0),productEntrypoint:m.at(0)}}))}async function Fr(){const e=await l("./templates/**.{js,ts}",{ignore:["node_modules/**","dist/**"]}),t=await l("./templates/assets/*",{ignore:["node_modules/**","dist/**"]});return{pageTemplates:await kr(),templates:e,assets:t}}async function Gr(e){if(e.templates.length===0&&e.pageTemplates?.length===0)return{};const t=Fi();return await Promise.all([_({entryPoints:e.assets,configType:f.TemplateAsset}),_({entryPoints:e.templates,configType:f.TemplateDescriptor})]),e.templates.reduce(async(o,s)=>{const n=await o,i=`${A}/js/${M(s).name}`,r=await z(i,!0);return{...n,...zi(t,r,i,await Rr(r))}},Promise.resolve({}))}async function Br({templateBuildConfig:e,layoutBuildConfigs:t}){return e.pageTemplates?.reduce(async(o,s)=>{const n=await o,i=[s.configurationEntrypoint,s.homeEntrypoint,s.categoryEntrypoint,s.catalogEntrypoint,s.productEntrypoint].filter(le);if(i.length===0)throw new Error("No entry points provided for page template");return await _({entryPoints:i,configType:f.PageTemplateDescriptor,name:s.name}),{...n,...await Dr(s,t)}},Promise.resolve({}))??{}}async function Mr(e){const t=await Fr(),o=await Promise.all([Gr(t),Br({templateBuildConfig:t,layoutBuildConfigs:e})]);return o.some(s=>!Ye(s))?o.reduce((s,n)=>({...s,...n}),{}):{}}function Ur(e){return{name:e.name,type:e.type,serverEntrypoint:e.serverEntrypoint,clientEntrypoint:[e.clientEntrypoint].filter(le).flat(),settingsEntryPoints:[e.contentSettingsEntrypoint,e.designSettingsEntrypoint,e.layoutSettingsEntrypoint,e.settingsTranslationsEntrypoint].filter(le),showcaseEntryPoints:[...e.showcasesEntrypoints??[],e.showcasesTranslationsEntrypoint].filter(le),assetEntryPoints:e.assetsEntrypoints??[]}}function qr(e){return Object.entries(E).find(t=>t[1].source===e)?.[0]}async function zr(){const e=await l("**/server.{js,ts}",{ignore:["node_modules/**","dist/**","templates/**","layouts/**"]});return Promise.all(e.map(async t=>{const o=Zs(t).split(Le),s=o.pop()??"default",n=o.pop();if(n===void 0)throw new Error("Cannot determine type of section, outer directory is undefined");const i=await l(`**/${s}/client.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),r=await l(`**/${s}/settings/content.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),c=await l(`**/${s}/settings/design.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),m=await l(`**/${s}/settings/layout.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),y=await l(`**/${s}/settings/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),T=await l(`**/${s}/showcases/*.{js,ts}`,{ignore:["node_modules/**","dist/**",`**/${s}/showcases/translations.{js,ts}`]}),fe=await l(`**/${s}/showcases/translations.{js,ts}`,{ignore:["node_modules/**","dist/**"]}),ue=await l(`**/${s}/assets/*`,{ignore:["node_modules/**","dist/**"]});return{name:s,type:qr(n),serverEntrypoint:t,clientEntrypoint:i.at(0),contentSettingsEntrypoint:r.at(0),designSettingsEntrypoint:c.at(0),layoutSettingsEntrypoint:m.at(0),settingsTranslationsEntrypoint:y.at(0),showcasesEntrypoints:T,showcasesTranslationsEntrypoint:fe.at(0),assetsEntrypoints:ue}}))}function Xr(){return Promise.all([me.rm("dist",{recursive:!0,force:!0}),me.rm("source-code",{recursive:!0,force:!0}),me.rm("source-code.zip",{force:!0})])}async function Kr(){const e=new rn,t=["node_modules/**/*","dist/**/*","build/**/*",".git/**/*","**/assets/**/*","crane.config.json"],o=await l("**/*",{cwd:d(process.cwd()),ignore:t,dot:!0,nodir:!0});try{o.forEach(i=>{const r=d(process.cwd(),i);e.addLocalFile(r,M(i).dir)});const s=H[p.SourceCode].fileName,n=d(process.cwd(),s);await e.writeZipPromise(n)}catch(s){throw a.error("Error while zipping source files"),s}}async function ve(e=!1){await Xr();try{const[t,o,s]=await Promise.all([or(),zr(),lr()]),n=o.map(Ur),i={...await rr(n),...await Mr(t)};Object.keys(i).length===0?(await Promise.all([dr(s),nr(t),Kr()]),a.info(`Build successful:
3
3
  For preview run: npx @lightspeed/crane@latest preview
4
- For deploy run: npx @lightspeed/crane@latest deploy`)):(a.error("Error during build:"),Bi(i))}catch(t){a.error(`Error while building: ${t.message}`),e||process.exit(1)}}async function j({entryPoints:e,configType:t,name:o,sectionType:s,sectionId:n,layoutId:i}){if(e.length!==0){const r=Be(es({name:o,entryPoints:e,configType:t,sectionType:s,sectionId:n,layoutId:i}));await ce({configFile:!1,...r})}}async function Bs(e){await new Promise(t=>setTimeout(t,e))}function de({deploymentContext:e,sectionType:t=b.SECTION}){const o=e.pathContext,s=o.toPath({sectionId:e.currentSection,sectionType:t,layoutId:e.layoutId,slotId:e.slotId}),n=s===void 0?Ge(o.fileName):Ge(o.fileName,{cwd:d(process.cwd(),s),ignore:o.ignore});return(o.isSingleton?n.splice(0):n).map(i=>({url:i,sectionType:t,context:e}))}const Hr=e=>e.app.sections.flatMap(t=>Xn.flatMap(o=>{const s={config:e,currentSection:t.id,pathContext:H[o]};return de({deploymentContext:s,sectionType:t.type})})),Vr=e=>Vn.flatMap(t=>{const o={config:e,pathContext:H[t]};return de({deploymentContext:o})}),Yr=e=>e.app.layouts.flatMap(t=>Kn.flatMap(o=>{const s={config:e,pathContext:H[o],currentSection:t.sectionId,layoutId:t.id};return de({deploymentContext:s})})),Wr=e=>e.app.slots.flatMap(t=>Hn.flatMap(o=>{const s={config:e,pathContext:H[o],currentSection:t.sectionId,layoutId:t.layoutId,slotId:t.id};return de({deploymentContext:s})})),Jr=e=>`\x1B[32m${e}\x1B[0m`,Zr=(e,t,o,s,n)=>{if(!e.total)return;const{loaded:i}=e,r=(Date.now()-n)/1e3;o.value+=i-s.value,s.value=i,t.update({speed:`${Y(o.value/r,2)}/s`})},Qr=()=>new Tn.SingleBar({format:`|${Jr("{bar}")}| {status} || {percentage}% || {value}/{total} Files || Speed: {speed}`,barCompleteChar:"\u2588",barIncompleteChar:"\u2591"});function De(e,t){return Object.keys(e).reduce((o,s)=>{const n=e[s],i=t[s];return Ve(n)&&Ve(i)?o[s]=De(n,i):o[s]=n,o},{...t})}function ea({contentSettings:e,sectionType:t}){const o=Ko(t);return De(e,o)}function ta({designSettings:e,sectionType:t}){const o=Ho(t);return De(e,o)}async function oa(e,t,o=$){try{const s=d(D.cwd(),`${o}/${e}/js/settings/content.mjs`),n=await G(s),i=te(e),r=ea({contentSettings:n,sectionType:i});return B(r,t),r}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function sa(e,t,o=$){try{const s=d(D.cwd(),`${o}/${e}/js/settings/design.mjs`),n=await G(s),i=te(e),r=ta({designSettings:n,sectionType:i});return nt(r),B(r,t),r}catch(s){const n=s;throw new Error(`Design settings is invalid or undefined. Error ${n.stack}`)}}async function na(e,t,o=$){try{const s=await l("*.mjs",{cwd:d(D.cwd(),`${o}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(s.map(async n=>{const i=d(D.cwd(),`${o}/${e}/js/showcases/${n}`),r=await G(i);return it(r.design),B(r,t),r}))}catch(s){throw new Error(`Showcases is invalid or undefined. Error ${s}`)}}async function ia(e,t=$){try{const o=d(D.cwd(),`${t}/${e}/js/settings/layout.mjs`);if(!S(o))return[];const s=await G(o);return s.forEach(n=>ci(n.selectedDesignSettings)),s}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function ra(e,t=$){return Te(`${t}/${e}/js/settings/translations.mjs`)}async function Ms(e,t=$){return Te(`${t}/${e}/js/showcases/translations.mjs`)}function aa(e){let t={};const o=d(D.cwd(),`${Xe}/shared/analytics.json`);if(!S(o))return 0;try{const s=on(o,"utf-8");t=JSON.parse(s)}catch(s){console.warn("Error processing analytics.json file",s)}return t[e]||0}function ca(){try{const e=d(D.cwd(),`${Xe}/shared/analytics.json`);S(e)&&ke(e,JSON.stringify({},null,2),"utf-8")}catch(e){console.warn("Can not clean up preview analytics.json file",e)}}async function Ae(e,t){const o=await ra(e,E[t].dist),s=await Ms(e,E[t].dist),n=await oa(e,o,E[t].dist),i=await sa(e,o,E[t].dist),r=await na(e,s,E[t].dist),c=await ia(e,E[t].dist),m=aa(e);return{id:e,type:t,name:{en:e},contentEditors:n,designEditors:i,layouts:c,showcases:r,previewCount:m}}async function la(){const e=await l("*/",{cwd:d(D.cwd(),`${$}/`)}),t=await l("*/",{cwd:d(D.cwd(),`${W}/`)}),o=await l("*/",{cwd:d(D.cwd(),`${J}/`)});return Promise.all([...e.map(async s=>Ae(s,b.SECTION)),...t.map(async s=>Ae(s,b.HEADER)),...o.map(async s=>Ae(s,b.FOOTER))])}async function Ce(e){if(!e||e.type!=="custom")return;const t=te(e.id),o=await Ms(e.id,E[t].dist);e.showcase_overrides!==void 0&&(B(e.showcase_overrides,o),e.showcase_overrides.design&&it(e.showcase_overrides.design))}async function Us(e){const t=e.filter(o=>o.type==="custom");await Promise.all(t.map(o=>Ce(o)))}async function Pe(e){try{return await G(d(process.cwd(),e))}catch{throw new Error(`Template file [${e}] is either invalid or undefined`)}}async function pa(e){const t=await l(`${A}/js/**.mjs`,{ignore:[`${A}/js/**${L}.mjs`]});return Promise.all(t.map(async o=>{const s=await Pe(o);return await Us(s.sections),{id:`${e}_${M(o).name}`,descriptor:s}}))}function da(e){return e in O?O[e]:O.CUSTOM}async function fa(e){const t=await l(`${A}/${e}/*.mjs`,{ignore:[`${A}/${e}/configuration*.mjs`]});return Promise.all(t.map(async o=>{const{sections:s}=await Pe(o),n=jn(o);return await Us(s),{sections:s,id:n,type:da(n.toUpperCase())}}))}async function ua(e){const t=await l(`${A}/**/configuration*.mjs`,{});return Promise.all(t.map(async o=>{const s=await Pe(o);await Ce(s.header),await Ce(s.footer);const n=g.basename(g.dirname(o)),i=await fa(n);return{id:`${e}_${n}`,descriptor:{...s,pages:i}}}))}async function ma(e){return[...await pa(e),...await ua(e)]}const ya={value:0},_=Qr();let qs=Date.now();const zs=e=>2**e*500;async function ga(){const e=await ze(d(R.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}function ha(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function $a(){const e=d(R.cwd(),"package.json"),t=await ze(e),o=JSON.parse(t.toString());if(ha(o))return o;throw new Error(`Package file located at path: ${e} does not contain a version field`)}async function ba(e){const t=En(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,ke(d(R.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
5
- `)}function Ea(e){return e instanceof qe&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function Xs(e,t){return e<zn&&Ea(t)}async function Ks(e,t,o,s){const n={value:0},i=e.config.app.templates.length>0?Bn:Gn;return e.config.axios.post(i,{file:sn(d(R.cwd(),o!==void 0?o+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.layoutId!==void 0&&{layoutId:e.layoutId},...e.slotId!==void 0&&{slotId:e.slotId},...!["dependencies","source_code"].includes(e.pathContext.type)&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`},onUploadProgress:r=>Zr(r,_,ya,n,qs)}).then(r=>(_.increment(),r)).catch(async r=>{if(Xs(s,r))return await Bs(zs(s)),Ks(e,t,o,s+1);throw _.increment(),r})}function Ta(e){return _.start(e.length+1,0,{speed:"N/A",status:"Deployment in progress"}),e.map(t=>{const o=t.context,s=o.pathContext.toPath({sectionId:o.currentSection,sectionType:t.sectionType,layoutId:o.layoutId,slotId:o.slotId});return Ks(o,t.url,s,0)})}function wa(e){const t=[...Hr(e),...Vr(e),...Yr(e),...Wr(e)];return Ta(t)}function Sa(e){return e.includes(`
4
+ For deploy run: npx @lightspeed/crane@latest deploy`)):(a.error("Error during build:"),Bi(i))}catch(t){a.error(`Error while building: ${t.message}`),e||process.exit(1)}}async function _({entryPoints:e,configType:t,name:o,sectionType:s,sectionId:n,layoutId:i}){if(e.length!==0){const r=Be(es({name:o,entryPoints:e,configType:t,sectionType:s,sectionId:n,layoutId:i}));await ce({configFile:!1,...r})}}async function Bs(e){await new Promise(t=>setTimeout(t,e))}function de({deploymentContext:e,sectionType:t=b.SECTION}){const o=e.pathContext,s=o.toPath({sectionId:e.currentSection,sectionType:t,layoutId:e.layoutId,slotId:e.slotId}),n=s===void 0?Ge(o.fileName):Ge(o.fileName,{cwd:d(process.cwd(),s),ignore:o.ignore});return(o.isSingleton?n.splice(0):n).map(i=>({url:i,sectionType:t,context:e}))}const Hr=e=>e.app.sections.flatMap(t=>Xn.flatMap(o=>{const s={config:e,currentSection:t.id,pathContext:H[o]};return de({deploymentContext:s,sectionType:t.type})})),Vr=e=>Vn.flatMap(t=>{const o={config:e,pathContext:H[t]};return de({deploymentContext:o})}),Yr=e=>e.app.layouts.flatMap(t=>Kn.flatMap(o=>{const s={config:e,pathContext:H[o],currentSection:t.sectionId,layoutId:t.id};return de({deploymentContext:s})})),Wr=e=>e.app.slots.flatMap(t=>Hn.flatMap(o=>{const s={config:e,pathContext:H[o],currentSection:t.sectionId,layoutId:t.layoutId,slotId:t.id};return de({deploymentContext:s})})),Jr=e=>`\x1B[32m${e}\x1B[0m`,Zr=(e,t,o,s,n)=>{if(!e.total)return;const{loaded:i}=e,r=(Date.now()-n)/1e3;o.value+=i-s.value,s.value=i,t.update({speed:`${Y(o.value/r,2)}/s`})},Qr=()=>new Tn.SingleBar({format:`|${Jr("{bar}")}| {status} || {percentage}% || {value}/{total} Files || Speed: {speed}`,barCompleteChar:"\u2588",barIncompleteChar:"\u2591"});function De(e,t){return Object.keys(e).reduce((o,s)=>{const n=e[s],i=t[s];return Ve(n)&&Ve(i)?o[s]=De(n,i):o[s]=n,o},{...t})}function ea({contentSettings:e,sectionType:t}){const o=Ko(t);return De(e,o)}function ta({designSettings:e,sectionType:t}){const o=Ho(t);return De(e,o)}async function oa(e,t,o=$){try{const s=d(D.cwd(),`${o}/${e}/js/settings/content.mjs`),n=await G(s),i=te(e),r=ea({contentSettings:n,sectionType:i});return B(r,t),r}catch{throw new Error(`Content descriptor for section [${e}] is either invalid or undefined`)}}async function sa(e,t,o=$){try{const s=d(D.cwd(),`${o}/${e}/js/settings/design.mjs`),n=await G(s),i=te(e),r=ta({designSettings:n,sectionType:i});return nt(r),B(r,t),r}catch(s){const n=s;throw new Error(`Design settings is invalid or undefined. Error ${n.stack}`)}}async function na(e,t,o=$){try{const s=await l("*.mjs",{cwd:d(D.cwd(),`${o}/${e}/js/showcases/`),ignore:"**/translations.mjs"});return Promise.all(s.map(async n=>{const i=d(D.cwd(),`${o}/${e}/js/showcases/${n}`),r=await G(i);return it(r.design),B(r,t),r}))}catch(s){throw new Error(`Showcases is invalid or undefined. Error ${s}`)}}async function ia(e,t=$){try{const o=d(D.cwd(),`${t}/${e}/js/settings/layout.mjs`);if(!S(o))return[];const s=await G(o);return s.forEach(n=>ci(n.selectedDesignSettings)),s}catch{throw new Error(`Layout descriptor for section [${e}] is either invalid or undefined`)}}async function ra(e,t=$){return Te(`${t}/${e}/js/settings/translations.mjs`)}async function Ms(e,t=$){return Te(`${t}/${e}/js/showcases/translations.mjs`)}function aa(e){let t={};const o=d(D.cwd(),`${Xe}/shared/analytics.json`);if(!S(o))return 0;try{const s=on(o,"utf-8");t=JSON.parse(s)}catch(s){console.warn("Error processing analytics.json file",s)}return t[e]||0}function ca(){try{const e=d(D.cwd(),`${Xe}/shared/analytics.json`);S(e)&&ke(e,JSON.stringify({},null,2),"utf-8")}catch(e){console.warn("Can not clean up preview analytics.json file",e)}}async function Ae(e,t){const o=await ra(e,E[t].dist),s=await Ms(e,E[t].dist),n=await oa(e,o,E[t].dist),i=await sa(e,o,E[t].dist),r=await na(e,s,E[t].dist),c=await ia(e,E[t].dist),m=aa(e);return{id:e,type:t,name:{en:e},contentEditors:n,designEditors:i,layouts:c,showcases:r,previewCount:m}}async function la(){const e=await l("*/",{cwd:d(D.cwd(),`${$}/`)}),t=await l("*/",{cwd:d(D.cwd(),`${W}/`)}),o=await l("*/",{cwd:d(D.cwd(),`${J}/`)});return Promise.all([...e.map(async s=>Ae(s,b.SECTION)),...t.map(async s=>Ae(s,b.HEADER)),...o.map(async s=>Ae(s,b.FOOTER))])}async function Ce(e){if(!e||e.type!=="custom")return;const t=te(e.id),o=await Ms(e.id,E[t].dist);e.showcase_overrides!==void 0&&(B(e.showcase_overrides,o),e.showcase_overrides.design&&it(e.showcase_overrides.design))}async function Us(e){const t=e.filter(o=>o.type==="custom");await Promise.all(t.map(o=>Ce(o)))}async function Pe(e){try{return await G(d(process.cwd(),e))}catch{throw new Error(`Template file [${e}] is either invalid or undefined`)}}async function pa(e){const t=await l(`${A}/js/**.mjs`,{ignore:[`${A}/js/**${L}.mjs`]});return Promise.all(t.map(async o=>{const s=await Pe(o);return await Us(s.sections),{id:`${e}_${M(o).name}`,descriptor:s}}))}function da(e){return e in O?O[e]:O.CUSTOM}async function fa(e){const t=await l(`${A}/${e}/*.mjs`,{ignore:[`${A}/${e}/configuration*.mjs`]});return Promise.all(t.map(async o=>{const{sections:s}=await Pe(o),n=_n(o);return await Us(s),{sections:s,id:n,type:da(n.toUpperCase())}}))}async function ua(e){const t=await l(`${A}/**/configuration*.mjs`,{});return Promise.all(t.map(async o=>{const s=await Pe(o);await Ce(s.header),await Ce(s.footer);const n=g.basename(g.dirname(o)),i=await fa(n);return{id:`${e}_${n}`,descriptor:{...s,pages:i}}}))}async function ma(e){return[...await pa(e),...await ua(e)]}const ya={value:0},j=Qr();let qs=Date.now();const zs=e=>2**e*500;async function ga(){const e=await ze(d(R.cwd(),"crane.config.json")),t=JSON.parse(e.toString());return{appClientId:t.app_client_id,appSecretKey:btoa(t.app_secret_key)}}function ha(e){return typeof e=="object"&&e!==null&&"version"in e&&typeof e.version=="string"}async function $a(){const e=d(R.cwd(),"package.json"),t=await ze(e),o=JSON.parse(t.toString());if(ha(o))return o;throw new Error(`Package file located at path: ${e} does not contain a version field`)}async function ba(e){const t=En(e.version,"patch");if(t===null)throw Error("Error while incrementing app version");e.version=t,ke(d(R.cwd(),"package.json"),`${JSON.stringify(e,null,2)}
5
+ `)}function Ea(e){return e instanceof qe&&(e.code==="ECONNRESET"||e.response?.status!==void 0&&e.response?.status>=500&&e.response?.status<600)}function Xs(e,t){return e<zn&&Ea(t)}async function Ks(e,t,o,s){const n={value:0},i=e.config.app.templates.length>0?Bn:Gn;return e.config.axios.post(i,{file:sn(d(R.cwd(),o!==void 0?o+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.layoutId!==void 0&&{layoutId:e.layoutId},...e.slotId!==void 0&&{slotId:e.slotId},...!["dependencies","source_code"].includes(e.pathContext.type)&&{fileName:t}},headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e.config.app.crane.appSecretKey}`},onUploadProgress:r=>Zr(r,j,ya,n,qs)}).then(r=>(j.increment(),r)).catch(async r=>{if(Xs(s,r))return await Bs(zs(s)),Ks(e,t,o,s+1);throw j.increment(),r})}function Ta(e){return j.start(e.length+1,0,{speed:"N/A",status:"Deployment in progress"}),e.map(t=>{const o=t.context,s=o.pathContext.toPath({sectionId:o.currentSection,sectionType:t.sectionType,layoutId:o.layoutId,slotId:o.slotId});return Ks(o,t.url,s,0)})}function wa(e){const t=[...Hr(e),...Vr(e),...Yr(e),...Wr(e)];return Ta(t)}function Sa(e){return e.includes(`
6
6
  `)}function Oa(e,t,o){return e.split(`
7
7
  `).map((s,n)=>n>=o?t+s:s).join(`
8
8
  `)}function ne(e,t){const o=[];if(e instanceof qe){e.response?.status!==void 0&&o.push(` HTTP Status Code: ${e.response.status}`);const i=e.response?.data;if(i?.errorCode&&o.push(` Error Code: ${i.errorCode}`),i?.errorMessage){const r=Sa(i.errorMessage)?Oa(i.errorMessage," ",1):i.errorMessage;o.push(` Error Message: ${r}`)}}const s=o.length>0?o.join(`
9
9
  `):e?.message??"Unknown error";if(!t||t.length===0)return s;const n=o.length>0?`
10
- `:" ";return`${t}${n}${s}`}async function Hs(e,t=0){const o=e.app.templates.length>0?Un:Mn;return e.axios.post(o,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates,layouts:e.app.layouts,slots:e.app.slots,compressionEnabled:!0,externalizationEnabled:!0,vueVersion:e.app.packageJson.dependencies.vue},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async s=>{if(Xs(t,s))return await Bs(zs(t)),Hs(e,t+1);throw s})}async function ja(e){try{if(!S(d(R.cwd(),$)))throw new Error(X.DISTRIBUTION_FOLDER_NOT_FOUND($));const t=e??Fn;a.info("Custom application deployment :: Started");const o=$n.create({baseURL:t});bn(o,qn),a.info("Loading configuration files ...");const s=await Promise.all([ga(),$a(),la(),ui(),cr()]).then(async([r,c,m,y,T])=>({axios:o,app:{crane:r,packageJson:c,sections:m,layouts:y,slots:T,templates:await ma(r.appClientId)}}));a.info("Uploading files ..."),qs=Date.now(),await Promise.all(wa(s)).catch(r=>{_.stop(),r.response?.status===404?a.error(ne(r,X.DEPRECATED_VERSION_DEPLOYMENT)):a.error(ne(r,X.ASSET_FILES_UPLOAD)),R.exit(1)}).finally(()=>{_.increment(),_.stop()}),_.update({speed:"N/A",status:"Finalising deployment"}),await Hs(s).catch(r=>{_.stop(),r.response?.status===404?a.error(ne(r,X.DEPRECATED_VERSION_DEPLOYMENT)):a.error(ne(r,X.MANIFEST_DEPLOYMENT)),R.exit(1)}).finally(()=>{_.increment(),_.stop()});const n=s.app.sections.map(r=>r.id),i=s.app.packageJson.version;a.info("Custom application deployment :: Successful"),a.info(`Current app version: ${i}`),a.info(`Deployed sections: ${n.join(", ")}`),await ba(s.app.packageJson),s.app.templates.length>0&&a.info(`Deployed templates: ${s.app.templates.map(r=>r.id).join(", ")}`),s.app.slots.length>0&&a.info(`Deployed slots: ${s.app.slots.map(r=>r.id).join(", ")}`)}catch(t){_.stop(),a.error(ne(t,X.DEFAULT)),R.exit(1)}finally{ca()}}const _a="1.3.3";async function Ia(e){he(),ye("template/headers/example-header","headers",e,"Header")}async function va(e){he(),ye("template/footers/example-footer","footers",e,"Footer")}const Da={deploy:["url"],init:[""],build:["generatePreview"]};function Aa(e,t){return e.options.length!==0&&Object.keys(t).length===1}function Ca(e){return e.includes("-h")||e.includes("--help")}function Pa(e,t){return Object.keys(t).some(o=>o!=="--"&&!e.hasOption(o)&&!Da[e.rawName]?.includes(o))}function La(e){return e.length!==0}function Na(e,t,o){return e.matchedCommand!==void 0&&(Aa(e.matchedCommand,o)||Ca(e.rawArgs)||Pa(e.matchedCommand,e.options)||La(t))}function xa(e,t,o){e.matchedCommand&&!Na(e,t,o)?e.runMatchedCommand():e.outputHelp()}async function Ra(e,t){const o=d(`${e}/shared/preview.ts`),s=d(`${e}/shared/mock.ts`);await ce({build:{lib:{entry:o,formats:["es"],fileName:()=>"preview.js"},outDir:d(t),emptyOutDir:!1,rollupOptions:{output:{entryFileNames:"preview.js"}},target:"esnext"}});const n=d(t,"mock.js");u.existsSync(n)||await ce({build:{lib:{entry:s,formats:["es"],fileName:()=>"mock.js"},outDir:d(t),emptyOutDir:!1,minify:!1,rollupOptions:{output:{entryFileNames:"mock.js"}},target:"esnext"}})}async function ka(){const e="preview",t=`${e}/shared`,o="vite.config.js",s=`${e}/sections`,n=`${s}/preview.html`;[e,s].forEach(r=>{u.existsSync(r)||u.mkdirSync(r,{recursive:!0})});const i=F("template/preview");u.existsSync(`${e}/${o}`)||u.copyFileSync(`${i}/${o}`,`${e}/${o}`),u.existsSync(n)||u.copyFileSync(`${i}/sections/preview.html`,n),u.existsSync(t)||(u.mkdirSync(t),await Ra(i,t))}function Fa(){return{timeout:null,inProgress:!1,hasPending:!1}}function Ga(e,t){const o=async()=>{e.inProgress=!0;try{await ve(!0),t.ws.send({type:"full-reload",path:"*"})}catch(s){console.error("Build error:",s)}finally{e.inProgress=!1,e.hasPending&&(e.hasPending=!1,setTimeout(()=>o(),0))}};return async()=>{if(e.inProgress){e.hasPending=!0;return}await o()}}function Ba(e){const t=e.replace(/\\/g,"/"),o=t.match(/sections\/([^/]+)/),s=t.match(/shared\/components/);return!!(o||s)}function Ma(e,t){return async o=>{Ba(o)&&(e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(async()=>{await t()},1e3))}}function Ua(e,t){const o=Fa(),s=Ga(o,e),n=Ma(o,s);e.watcher.add(t),e.watcher.on("add",n),e.watcher.on("change",n),e.watcher.on("unlink",n)}async function qa(){const e=g.resolve(process.cwd(),"preview/vite.config.js"),t=g.resolve(process.cwd(),"/sections/**/*"),o=g.resolve(process.cwd(),"/shared/components/*"),s=await an({configFile:e,root:process.cwd()});return await s.listen(),Ua(s,[t,o]),s}async function za(){return await ve(),await ka(),qa()}function Vs(e){if(On(e))return console.log("Please specify a name for your resource."),!1;const{isValid:t,errorMessage:o}=Sn(e);return o&&console.log(o),t}async function Ys(e,t,o,s){const n=(await Ne({type:"text",name:"name",message:`Please specify a name for your ${t}:`})).name;if(n===void 0)return console.log(`You can use ${o} to directly specify the name of the ${t}.`),e.outputHelp();const i=g.basename(n);return Vs(i)?s(i):Ys(e,t,o,s)}async function ie(e,t,o,s,n){if(n!==void 0)if(!Vs(n))await Ys(e,t,o,s);else{const i=g.basename(n.toString());await s(i)}}async function Xa(e,t){try{const{app:o,section:s,header:n,footer:i,template:r,referenceTemplate:c}=e;await ie(t,"app",U("init --app <name>"),vn,o),await ie(t,"section",U("init --section <name>"),An,s),await ie(t,"header",U("init --header <name>"),Ia,n),await ie(t,"footer",U("init --footer <name>"),va,i),await ie(t,"template",U("init --template <name>"),Cn,r),c&&await Pn()}catch(o){a.error(`Error while executing init operation: ${o.message}`),process.exit(1)}}function Ka(){try{const e=Js("crane");e.option("-h, --help","Display this message"),e.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("--header [name]","Creates the files necessary for one custom header with the given name, this can be repeated for each header.").option("--footer [name]","Creates the files necessary for one custom footer with the given name, this can be repeated for each footer.").option("--template [name]","Creates the directory and files necessary to build a custom template inside your app folder.").option("--reference-template","Adds files necessary for the reference templates inside your app folder. ").allowUnknownOptions().action(async o=>Xa(o,e)),e.command("build","Builds your resource code").allowUnknownOptions().action(()=>ve()),e.command("preview","Runs a local server to preview resources").allowUnknownOptions().action(()=>za()),e.command("deploy","Deploys your resource code").allowUnknownOptions().action(()=>ja(e.options.url)),e.version(_a),e.usage("<action> <resource>");const t=e.parse(process.argv,{run:!1});xa(e,t.args,t.options)}catch(e){a.error(`Error while parsing input: ${e.message}`),process.exit(1)}}export{Ka as run};
10
+ `:" ";return`${t}${n}${s}`}async function Hs(e,t=0){const o=e.app.templates.length>0?Un:Mn;return e.axios.post(o,{version:e.app.packageJson.version,name:"Custom Block App",blocks:e.app.sections,templates:e.app.templates,layouts:e.app.layouts,slots:e.app.slots,compressionEnabled:!0,externalizationEnabled:!0,vueVersion:e.app.packageJson.dependencies.vue},{params:{appClientId:e.app.crane.appClientId},headers:{Authorization:`Bearer ${e.app.crane.appSecretKey}`}}).catch(async s=>{if(Xs(t,s))return await Bs(zs(t)),Hs(e,t+1);throw s})}async function _a(e){try{if(!S(d(R.cwd(),$)))throw new Error(X.DISTRIBUTION_FOLDER_NOT_FOUND($));const t=e??Fn;a.info("Custom application deployment :: Started");const o=$n.create({baseURL:t});bn(o,qn),a.info("Loading configuration files ...");const s=await Promise.all([ga(),$a(),la(),ui(),cr()]).then(async([r,c,m,y,T])=>({axios:o,app:{crane:r,packageJson:c,sections:m,layouts:y,slots:T,templates:await ma(r.appClientId)}}));a.info("Uploading files ..."),qs=Date.now(),await Promise.all(wa(s)).catch(r=>{j.stop(),r.response?.status===404?a.error(ne(r,X.DEPRECATED_VERSION_DEPLOYMENT)):a.error(ne(r,X.ASSET_FILES_UPLOAD)),R.exit(1)}).finally(()=>{j.increment(),j.stop()}),j.update({speed:"N/A",status:"Finalising deployment"}),await Hs(s).catch(r=>{j.stop(),r.response?.status===404?a.error(ne(r,X.DEPRECATED_VERSION_DEPLOYMENT)):a.error(ne(r,X.MANIFEST_DEPLOYMENT)),R.exit(1)}).finally(()=>{j.increment(),j.stop()});const n=s.app.sections.map(r=>r.id),i=s.app.packageJson.version;a.info("Custom application deployment :: Successful"),a.info(`Current app version: ${i}`),a.info(`Deployed sections: ${n.join(", ")}`),await ba(s.app.packageJson),s.app.templates.length>0&&a.info(`Deployed templates: ${s.app.templates.map(r=>r.id).join(", ")}`),s.app.slots.length>0&&a.info(`Deployed slots: ${s.app.slots.map(r=>r.id).join(", ")}`)}catch(t){j.stop(),a.error(ne(t,X.DEFAULT)),R.exit(1)}finally{ca()}}const ja="1.4.0";async function Ia(e){he(),ye("template/headers/example-header","headers",e,"Header")}async function va(e){he(),ye("template/footers/example-footer","footers",e,"Footer")}const Da={deploy:["url"],init:[""],build:["generatePreview"]};function Aa(e,t){return e.options.length!==0&&Object.keys(t).length===1}function Ca(e){return e.includes("-h")||e.includes("--help")}function Pa(e,t){return Object.keys(t).some(o=>o!=="--"&&!e.hasOption(o)&&!Da[e.rawName]?.includes(o))}function La(e){return e.length!==0}function Na(e,t,o){return e.matchedCommand!==void 0&&(Aa(e.matchedCommand,o)||Ca(e.rawArgs)||Pa(e.matchedCommand,e.options)||La(t))}function xa(e,t,o){e.matchedCommand&&!Na(e,t,o)?e.runMatchedCommand():e.outputHelp()}async function Ra(e,t){const o=d(`${e}/shared/preview.ts`),s=d(`${e}/shared/mock.ts`);await ce({build:{lib:{entry:o,formats:["es"],fileName:()=>"preview.js"},outDir:d(t),emptyOutDir:!1,rollupOptions:{output:{entryFileNames:"preview.js"}},target:"esnext"}});const n=d(t,"mock.js");u.existsSync(n)||await ce({build:{lib:{entry:s,formats:["es"],fileName:()=>"mock.js"},outDir:d(t),emptyOutDir:!1,minify:!1,rollupOptions:{output:{entryFileNames:"mock.js"}},target:"esnext"}})}async function ka(){const e="preview",t=`${e}/shared`,o="vite.config.js",s=`${e}/sections`,n=`${s}/preview.html`;[e,s].forEach(r=>{u.existsSync(r)||u.mkdirSync(r,{recursive:!0})});const i=F("template/preview");u.existsSync(`${e}/${o}`)||u.copyFileSync(`${i}/${o}`,`${e}/${o}`),u.existsSync(n)||u.copyFileSync(`${i}/sections/preview.html`,n),u.existsSync(t)||(u.mkdirSync(t),await Ra(i,t))}function Fa(){return{timeout:null,inProgress:!1,hasPending:!1}}function Ga(e,t){const o=async()=>{e.inProgress=!0;try{await ve(!0),t.ws.send({type:"full-reload",path:"*"})}catch(s){console.error("Build error:",s)}finally{e.inProgress=!1,e.hasPending&&(e.hasPending=!1,setTimeout(()=>o(),0))}};return async()=>{if(e.inProgress){e.hasPending=!0;return}await o()}}function Ba(e){const t=e.replace(/\\/g,"/"),o=t.match(/sections\/([^/]+)/),s=t.match(/shared\/components/);return!!(o||s)}function Ma(e,t){return async o=>{Ba(o)&&(e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(async()=>{await t()},1e3))}}function Ua(e,t){const o=Fa(),s=Ga(o,e),n=Ma(o,s);e.watcher.add(t),e.watcher.on("add",n),e.watcher.on("change",n),e.watcher.on("unlink",n)}async function qa(){const e=g.resolve(process.cwd(),"preview/vite.config.js"),t=g.resolve(process.cwd(),"/sections/**/*"),o=g.resolve(process.cwd(),"/shared/components/*"),s=await an({configFile:e,root:process.cwd()});return await s.listen(),Ua(s,[t,o]),s}async function za(){return await ve(),await ka(),qa()}function Vs(e){if(On(e))return console.log("Please specify a name for your resource."),!1;const{isValid:t,errorMessage:o}=Sn(e);return o&&console.log(o),t}async function Ys(e,t,o,s){const n=(await Ne({type:"text",name:"name",message:`Please specify a name for your ${t}:`})).name;if(n===void 0)return console.log(`You can use ${o} to directly specify the name of the ${t}.`),e.outputHelp();const i=g.basename(n);return Vs(i)?s(i):Ys(e,t,o,s)}async function ie(e,t,o,s,n){if(n!==void 0)if(!Vs(n))await Ys(e,t,o,s);else{const i=g.basename(n.toString());await s(i)}}async function Xa(e,t){try{const{app:o,section:s,header:n,footer:i,template:r,referenceTemplate:c}=e;await ie(t,"app",U("init --app <name>"),vn,o),await ie(t,"section",U("init --section <name>"),An,s),await ie(t,"header",U("init --header <name>"),Ia,n),await ie(t,"footer",U("init --footer <name>"),va,i),await ie(t,"template",U("init --template <name>"),Cn,r),c&&await Pn()}catch(o){a.error(`Error while executing init operation: ${o.message}`),process.exit(1)}}function Ka(){try{const e=Js("crane");e.option("-h, --help","Display this message"),e.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("--header [name]","Creates the files necessary for one custom header with the given name, this can be repeated for each header.").option("--footer [name]","Creates the files necessary for one custom footer with the given name, this can be repeated for each footer.").option("--template [name]","Creates the directory and files necessary to build a custom template inside your app folder.").option("--reference-template","Adds files necessary for the reference templates inside your app folder. ").allowUnknownOptions().action(async o=>Xa(o,e)),e.command("build","Builds your resource code").allowUnknownOptions().action(()=>ve()),e.command("preview","Runs a local server to preview resources").allowUnknownOptions().action(()=>za()),e.command("deploy","Deploys your resource code").allowUnknownOptions().action(()=>_a(e.options.url)),e.version(ja),e.usage("<action> <resource>");const t=e.parse(process.argv,{run:!1});xa(e,t.args,t.options)}catch(e){a.error(`Error while parsing input: ${e.message}`),process.exit(1)}}export{Ka as run};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/crane",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "bin": "bin/crane.js",
6
6
  "main": "./dist/app.mjs",
@@ -55,50 +55,50 @@
55
55
  "mock-fs": "^5.5.0",
56
56
  "ts-jest": "^29.4.0",
57
57
  "ts-node": "^10.9.2",
58
- "typescript": "5.4.5",
58
+ "typescript": "5.9.2",
59
59
  "unbuild": "^3.5.0",
60
60
  "vite-plugin-dts": "^4.5.4",
61
61
  "vite-plugin-static-copy": "^3.1.0"
62
62
  },
63
63
  "dependencies": {
64
- "@jridgewell/sourcemap-codec": "^1.4.15",
65
- "@lightspeed/eslint-config-crane": "1.1.2",
64
+ "@jridgewell/sourcemap-codec": "^1.5.4",
65
+ "@lightspeed/eslint-config-crane": "1.1.3",
66
66
  "@types/prompts": "^2.4.2",
67
- "@vitejs/plugin-vue": "^4.1.0",
67
+ "@vitejs/plugin-vue": "^6.0.1",
68
68
  "adm-zip": "^0.5.16",
69
- "ajv": "^8.12.0",
70
- "ajv-formats": "^2.1.1",
69
+ "ajv": "^8.17.1",
70
+ "ajv-formats": "^3.0.1",
71
71
  "axios": "^1.11.0",
72
72
  "axios-concurrency": "^1.0.4",
73
73
  "cac": "^6.7.14",
74
74
  "cli-progress": "^3.12.0",
75
75
  "eslint": "^9.33.0",
76
- "fs-extra": "^11.1.1",
77
- "glob": "^9.3.5",
76
+ "fs-extra": "^11.3.1",
77
+ "glob": "^11.0.3",
78
78
  "jsonpath-plus": "^10.3.0",
79
79
  "kolorist": "^1.8.0",
80
80
  "prompts": "^2.4.2",
81
- "semver": "^7.5.4",
82
- "terser": "^5.35.0",
81
+ "semver": "^7.7.2",
82
+ "terser": "^5.44.0",
83
83
  "tinycolor2": "^1.6.0",
84
- "typescript": "5.4.5",
85
- "vite": "^6.3.5",
86
- "vite-plugin-checker": "^0.6.1",
84
+ "typescript": "5.9.2",
85
+ "vite": "^7.1.4",
86
+ "vite-plugin-checker": "^0.10.3",
87
87
  "vite-plugin-compression": "^0.5.1",
88
88
  "vite-plugin-externals": "^0.6.2",
89
- "vite-tsconfig-paths": "^4.2.0",
90
- "vue": "^3.4.0",
91
- "vue-tsc": "^1.8.0"
89
+ "vite-tsconfig-paths": "^5.1.4",
90
+ "vue": "^3.5.21",
91
+ "vue-tsc": "^3.0.6"
92
92
  },
93
93
  "peerDependencies": {
94
- "vue": "^3.4.0"
94
+ "vue": "^3.5.21"
95
95
  },
96
96
  "overrides": {
97
97
  "axios-concurrency": {
98
98
  "axios": "1.11.0"
99
99
  },
100
100
  "magic-string": "0.30.10",
101
- "glob": "^9.3.5",
102
- "stylus": "^0.63.0"
101
+ "glob": "^11.0.3",
102
+ "stylus": "^0.64.0"
103
103
  }
104
104
  }
@@ -16,7 +16,6 @@ export default {
16
16
  },
17
17
  menu: {
18
18
  type: 'NAVIGATION_MENU',
19
- text: '$label.showcase_1.menu.text',
20
19
  },
21
20
  },
22
21
  design: {
@@ -11,7 +11,6 @@ export default {
11
11
  content: {
12
12
  menu: {
13
13
  type: 'NAVIGATION_MENU',
14
- text: '$label.showcase_2.menu.text',
15
14
  },
16
15
  logo: {
17
16
  type: 'LOGO',
@@ -10,13 +10,13 @@
10
10
  "@lightspeed/crane": "latest",
11
11
  "@lightspeed/eslint-config-crane": "latest",
12
12
  "vue": "^3.4.0",
13
- "eslint": "9.22.0"
13
+ "eslint": "9.33.0"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=22"
17
17
  },
18
18
  "overrides": {
19
- "glob": "^9.3.5",
20
- "stylus": "^0.63.0"
19
+ "glob": "^11.0.3",
20
+ "stylus": "^0.64.0"
21
21
  }
22
22
  }