@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +185 -159
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
  5. package/dist/aiChat/components/utils.d.ts +1 -0
  6. package/dist/aiChat/components/utilsTw.d.ts +11 -0
  7. package/dist/aiChat/index.cjs.js +75 -75
  8. package/dist/aiChat/index.es.js +9122 -8628
  9. package/dist/aiChat/index.js +75 -75
  10. package/dist/aiChat/index.umd.js +75 -75
  11. package/dist/aiChat/projectGeneration.d.ts +17 -0
  12. package/dist/animationComponent/index.cjs.js +3 -3
  13. package/dist/animationComponent/index.es.js +221 -195
  14. package/dist/animationComponent/index.umd.js +3 -3
  15. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  16. package/dist/canvasAbsoluteMode/index.es.js +199 -173
  17. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  18. package/dist/canvasEmptyState/index.cjs.js +1 -1
  19. package/dist/canvasEmptyState/index.es.js +149 -123
  20. package/dist/canvasEmptyState/index.umd.js +1 -1
  21. package/dist/canvasFullSize/index.cjs.js +9 -9
  22. package/dist/canvasFullSize/index.es.js +186 -160
  23. package/dist/canvasFullSize/index.umd.js +9 -9
  24. package/dist/canvasGridMode/index.cjs.js +5 -5
  25. package/dist/canvasGridMode/index.es.js +263 -237
  26. package/dist/canvasGridMode/index.umd.js +2 -2
  27. package/dist/canvasScreenshot/index.cjs.js +1 -1
  28. package/dist/canvasScreenshot/index.es.js +168 -142
  29. package/dist/canvasScreenshot/index.umd.js +1 -1
  30. package/dist/dataSourceEjs/index.cjs.js +9 -9
  31. package/dist/dataSourceEjs/index.es.js +271 -245
  32. package/dist/dataSourceEjs/index.umd.js +9 -9
  33. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  34. package/dist/dataSourceHandlebars/index.es.js +232 -206
  35. package/dist/dataSourceHandlebars/index.umd.js +8 -8
  36. package/dist/dialogComponent/index.cjs.js +14 -14
  37. package/dist/dialogComponent/index.es.js +157 -131
  38. package/dist/dialogComponent/index.umd.js +14 -14
  39. package/dist/flexComponent/index.cjs.js +13 -13
  40. package/dist/flexComponent/index.es.js +497 -471
  41. package/dist/flexComponent/index.umd.js +13 -13
  42. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  43. package/dist/fsLightboxComponent/index.es.js +189 -163
  44. package/dist/fsLightboxComponent/index.umd.js +3 -3
  45. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  46. package/dist/googleFontsAssetProvider/index.es.js +175 -149
  47. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  48. package/dist/iconifyComponent/index.cjs.js +2 -2
  49. package/dist/iconifyComponent/index.es.js +207 -181
  50. package/dist/iconifyComponent/index.umd.js +2 -2
  51. package/dist/index.cjs.js +36 -36
  52. package/dist/index.es.js +917 -891
  53. package/dist/index.umd.js +36 -36
  54. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  55. package/dist/layoutSidebarButtons/index.es.js +192 -166
  56. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  57. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  58. package/dist/lightGalleryComponent/index.es.js +265 -239
  59. package/dist/lightGalleryComponent/index.umd.js +1 -1
  60. package/dist/linkImageComponent/index.cjs.js +2 -2
  61. package/dist/linkImageComponent/index.es.js +121 -95
  62. package/dist/linkImageComponent/index.umd.js +2 -2
  63. package/dist/listPagesComponent/index.cjs.js +5 -5
  64. package/dist/listPagesComponent/index.es.js +171 -145
  65. package/dist/listPagesComponent/index.umd.js +5 -5
  66. package/dist/presetPrintable/index.cjs.js +3 -3
  67. package/dist/presetPrintable/index.es.js +227 -201
  68. package/dist/presetPrintable/index.umd.js +3 -3
  69. package/dist/prosemirror/index.cjs.js +7 -7
  70. package/dist/prosemirror/index.es.js +457 -431
  71. package/dist/prosemirror/index.umd.js +8 -8
  72. package/dist/rendererReact/index.cjs.js +1 -1
  73. package/dist/rendererReact/index.es.js +248 -223
  74. package/dist/rendererReact/index.js +1 -1
  75. package/dist/rendererReact/index.umd.js +1 -1
  76. package/dist/rteTinyMce/index.cjs.js +2 -2
  77. package/dist/rteTinyMce/index.es.js +150 -124
  78. package/dist/rteTinyMce/index.umd.js +2 -2
  79. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  80. package/dist/shapeDividerComponent/index.es.js +143 -117
  81. package/dist/shapeDividerComponent/index.umd.js +4 -4
  82. package/dist/swiperComponent/index.cjs.js +9 -9
  83. package/dist/swiperComponent/index.es.js +218 -192
  84. package/dist/swiperComponent/index.umd.js +7 -7
  85. package/dist/tableComponent/index.cjs.js +1 -1
  86. package/dist/tableComponent/index.es.js +275 -249
  87. package/dist/tableComponent/index.umd.js +1 -1
  88. package/dist/types.d.ts +1 -1
  89. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  90. package/dist/youtubeAssetProvider/index.es.js +134 -108
  91. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  92. package/package.json +2 -2
@@ -1,117 +1,143 @@
1
- const H = "app.grapesjs.com", T = "app-stage.grapesjs.com", R = "app2.grapesjs.com", L = "app-stage2.grapesjs.com", z = [
2
- H,
3
- R,
4
- T,
1
+ const L = "app.grapesjs.com", H = "app-stage.grapesjs.com", k = "app2.grapesjs.com", G = "app-stage2.grapesjs.com", z = [
5
2
  L,
3
+ k,
4
+ H,
5
+ G,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
9
9
  // For stackblitz.com demos
10
10
  ".local.webcontainer.io",
11
11
  // For stackblitz.com demos
12
- "-sandpack.codesandbox.io"
12
+ "-sandpack.codesandbox.io",
13
13
  // For Sandpack demos
14
- ], E = "license:check:start", I = "license:check:end", P = () => typeof window < "u", N = ({
14
+ ".claudemcpcontent.com",
15
+ // For Claude mcp app
16
+ ".web-sandbox.oaiusercontent.com"
17
+ // For OpenAI mcp app
18
+ ], E = "license:check:end", I = () => typeof window < "u", O = ({
15
19
  isDev: e,
16
- isStage: i,
17
- isPlatform: l
18
- }) => `${e ? "" : `https://${i ? T : H}`}/${l ? "platform-api" : "api"}`, k = () => {
19
- const e = P() && window.location.hostname;
20
- return !!e && (z.includes(e) || z.some((i) => e.endsWith(i)));
20
+ isStage: a,
21
+ isPlatform: i
22
+ }) => `${e ? "" : `https://${a ? H : L}`}/${i ? "platform-api" : "api"}`, F = () => {
23
+ if (!I()) return "";
24
+ const { hostname: e } = window.location;
25
+ if (e) return e;
26
+ try {
27
+ return window.parent.location.hostname || "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }, N = () => {
32
+ const e = F();
33
+ return !!e && (z.includes(e) || z.some((a) => e.endsWith(a)));
21
34
  };
22
- async function D({
35
+ async function U({
23
36
  path: e,
24
- baseApiUrl: i,
25
- method: l = "GET",
37
+ baseApiUrl: a,
38
+ method: i = "GET",
26
39
  headers: c = {},
27
40
  params: n,
28
- body: o
41
+ body: r
29
42
  }) {
30
- const v = `${i || N({ isDev: !1, isStage: !1 })}${e}`, t = {
31
- method: l,
43
+ const o = `${a || O({ isDev: !1, isStage: !1 })}${e}`, t = {
44
+ method: i,
32
45
  headers: {
33
46
  "Content-Type": "application/json",
34
47
  ...c
35
48
  }
36
49
  };
37
- o && (t.body = JSON.stringify(o));
38
- const r = n ? new URLSearchParams(n).toString() : "", g = r ? `?${r}` : "", s = await fetch(`${v}${g}`, t);
39
- if (!s.ok)
40
- throw new Error(`HTTP error! status: ${s.status}`);
41
- return s.json();
50
+ r && (t.body = JSON.stringify(r));
51
+ const g = n ? new URLSearchParams(n).toString() : "", h = g ? `?${g}` : "", l = await fetch(`${o}${h}`, t);
52
+ if (!l.ok)
53
+ throw new Error(`HTTP error! status: ${l.status}`);
54
+ return l.json();
42
55
  }
43
- var w = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(w || {});
44
- const C = {
45
- [w.free]: 0,
46
- [w.startup]: 10,
47
- [w.business]: 20,
48
- [w.enterprise]: 30
56
+ var y = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(y || {}), V = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.toastRemove = "studio:toastRemove", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.dialogExportCode = "studio:dialogExportCode", e.dialogImportCode = "studio:dialogImportCode", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.clearPage = "studio:clearPage", e.projectFiles = "studio:projectFiles", e.validateCode = "studio:validateCode", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.getStateContextMenu = "studio:getStateContextMenu", e.setStateContextMenu = "studio:setStateContextMenu", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e.layoutUpdate = "studio:layoutUpdate", e.layoutGet = "studio:layoutGet", e.layoutConfigGet = "studio:layoutConfigGet", e.layoutConfigSet = "studio:layoutConfigSet", e.layoutComponentAdd = "studio:layoutComponentAdd", e.layoutComponentGet = "studio:layoutComponentGet", e.layoutComponentRemove = "studio:layoutComponentRemove", e.layoutComponentRender = "studio:layoutComponentRender", e.getStateTheme = "studio:getStateTheme", e.setStateTheme = "studio:setStateTheme", e.settings = "studio:settings", e.assetProviderGet = "studio:assetProviderGet", e.assetProviderAdd = "studio:assetProviderAdd", e.assetProviderRemove = "studio:assetProviderRemove", e.fontGet = "studio:fontGet", e.fontAdd = "studio:fontAdd", e.fontRemove = "studio:fontRemove", e.fontManagerOpen = "studio:fontManagerOpen", e.menuFontLoad = "studio:menuFontLoad", e.toggleStateDataSource = "studio:toggleStateDataSource", e.getStateDataSource = "studio:getStateDataSource", e.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", e.dataSourceSetImporter = "studio:dataSourceSetImporter", e.dataSourceSetExporter = "studio:dataSourceSetExporter", e.setDragAbsolute = "studio:setDragAbsolute", e))(V || {});
57
+ const T = {
58
+ [y.free]: 0,
59
+ [y.startup]: 10,
60
+ [y.business]: 20,
61
+ [y.enterprise]: 30
49
62
  };
50
- function W(e) {
51
- const i = e;
52
- return i.init = (l) => (c) => e(c, l), i;
63
+ function C(e) {
64
+ const a = e;
65
+ return a.init = (i) => (c) => e(c, i), a;
53
66
  }
54
- const _ = (e) => /* @__PURE__ */ W(e);
55
- async function U({
67
+ const W = (e) => /* @__PURE__ */ C(e);
68
+ async function _({
56
69
  editor: e,
57
- plan: i,
58
- pluginName: l,
70
+ plan: a,
71
+ pluginName: i,
59
72
  licenseKey: c,
60
73
  onLicenseCheckResponse: n,
61
- cleanup: o
74
+ cleanup: r
62
75
  }) {
63
- let p = "", v = !1;
64
- const t = k(), r = (s) => {
65
- console.warn("Cleanup plugin:", l, "Reason:", s), o();
66
- }, g = (s = {}) => {
67
- var y;
68
- const { error: m, sdkLicense: b } = s, f = (y = s.plan) == null ? void 0 : y.category;
69
- if (!(b || s.license) || m)
70
- r(m || "Invalid license");
71
- else if (f) {
72
- const M = C[i], V = C[f];
73
- M > V && r({ pluginRequiredPlan: i, licensePlan: f });
76
+ let p = "", o;
77
+ const t = (l) => {
78
+ console.warn("Cleanup plugin:", i, "Reason:", l), r();
79
+ }, g = (l = {}) => {
80
+ var w;
81
+ const { error: A, sdkLicense: b } = l, u = (w = l.plan) == null ? void 0 : w.category;
82
+ if (!(b || l.license) || A)
83
+ t(A || "Invalid license");
84
+ else if (u) {
85
+ const R = T[a], x = T[u];
86
+ R > x && t({ pluginRequiredPlan: a, licensePlan: u });
74
87
  }
75
88
  };
76
- e.on(E, (s) => {
77
- p = s == null ? void 0 : s.baseApiUrl, v = !0;
78
- }), e.on(I, (s) => {
79
- n == null || n(s), g(s);
80
- }), setTimeout(async () => {
81
- if (!v) {
82
- if (t) return;
83
- if (c) {
84
- const s = await F({ licenseKey: c, pluginName: l, baseApiUrl: p });
85
- n == null || n(s), s && g(s);
86
- } else
87
- r("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
89
+ e.Commands.has(V.settings) && (o = e.runCommand(V.settings), p = (o == null ? void 0 : o.baseUrl) || "");
90
+ const h = (l) => {
91
+ n == null || n(l), l && g(l);
92
+ };
93
+ if (!o) {
94
+ e.onReady(async () => {
95
+ if (!N())
96
+ if (c) {
97
+ const l = await Y({ licenseKey: c, pluginName: i, baseApiUrl: p });
98
+ h(l);
99
+ } else
100
+ t("The `licenseKey` option not provided");
101
+ });
102
+ return;
103
+ }
104
+ if (o.licensePlan || o.licenseError) {
105
+ const l = j(o);
106
+ h(l);
107
+ return;
108
+ }
109
+ e.on(E, (l) => h(l));
90
110
  }
91
- async function F(e) {
92
- const { licenseKey: i, pluginName: l, baseApiUrl: c } = e;
111
+ const j = (e) => ({
112
+ sdkLicense: e.license,
113
+ license: e.license,
114
+ error: e.licenseError,
115
+ plan: e.licensePlan
116
+ });
117
+ async function Y(e) {
118
+ const { licenseKey: a, pluginName: i, baseApiUrl: c } = e;
93
119
  try {
94
- return (await D({
120
+ return (await U({
95
121
  baseApiUrl: c,
96
- path: `/sdk/${i || "na"}`,
122
+ path: `/sdk/${a || "na"}`,
97
123
  method: "POST",
98
124
  params: {
99
125
  d: window.location.hostname,
100
- pn: l
126
+ pn: i
101
127
  }
102
128
  })).result || {};
103
129
  } catch (n) {
104
130
  return console.error("Error during SDK license check:", n), !1;
105
131
  }
106
132
  }
107
- const O = (e, i) => {
108
- var l;
109
- return !!((l = e == null ? void 0 : e.classList) != null && l.contains(i));
110
- }, x = (e) => (i) => {
111
- var l;
112
- return ((l = i.getAttribute) == null ? void 0 : l.call(i, $)) === e;
113
- }, B = "gjs-plg-", $ = "data-type-role", Y = "shapeDividerComponent", K = w.startup, j = function(e, i = {}) {
114
- const { Components: l, Blocks: c, Selectors: n } = e, o = "shape-divider", p = `${o}-cnt`, v = `${B}${o}`, t = `${B}${p}`, r = [
133
+ const K = (e, a) => {
134
+ var i;
135
+ return !!((i = e == null ? void 0 : e.classList) != null && i.contains(a));
136
+ }, P = (e) => (a) => {
137
+ var i;
138
+ return ((i = a.getAttribute) == null ? void 0 : i.call(a, $)) === e;
139
+ }, B = "gjs-plg-", $ = "data-type-role", X = "shapeDividerComponent", Z = y.startup, q = function(e, a = {}) {
140
+ const { Components: i, Blocks: c, Selectors: n } = e, r = "shape-divider", p = `${r}-cnt`, o = `${B}${r}`, t = `${B}${p}`, g = [
115
141
  {
116
142
  id: "tilt",
117
143
  label: "Tilt",
@@ -282,7 +308,7 @@ const O = (e, i) => {
282
308
  <path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
283
309
  </svg>`
284
310
  }
285
- ], g = {
311
+ ], h = {
286
312
  tl: !1,
287
313
  tc: !1,
288
314
  tr: !1,
@@ -291,31 +317,31 @@ const O = (e, i) => {
291
317
  bl: !1,
292
318
  bc: !1,
293
319
  br: !1
294
- }, s = { ...g, bc: !0 }, m = { ...g, tc: !0 }, b = "shape", f = "flip-y", A = "flip-x", y = "Shape Divider", M = `<svg viewBox="0 0 22 22">
320
+ }, l = { ...h, bc: !0 }, A = { ...h, tc: !0 }, b = "shape", u = "flip-y", M = "flip-x", w = "Shape Divider", R = `<svg viewBox="0 0 22 22">
295
321
  <path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
296
- </svg>`, { block: V = {} } = i;
297
- e.on(n.events.add, (a) => {
298
- a.getFullName().startsWith(`.${v}`) && a.set({ private: !0 });
299
- }), l.addType(o, {
300
- isComponent: (a) => x(o)(a) || O(a, v),
301
- block: V && {
302
- label: y,
303
- media: M,
322
+ </svg>`, { block: x = {} } = a;
323
+ e.on(n.events.add, (s) => {
324
+ s.getFullName().startsWith(`.${o}`) && s.set({ private: !0 });
325
+ }), i.addType(r, {
326
+ isComponent: (s) => P(r)(s) || K(s, o),
327
+ block: x && {
328
+ label: w,
329
+ media: R,
304
330
  category: "Extra",
305
331
  select: !0,
306
- ...V
332
+ ...x
307
333
  },
308
334
  model: {
309
335
  defaults: {
310
336
  droppable: !1,
311
337
  highlightable: !1,
312
- classes: v,
313
- attributes: { [$]: o },
338
+ classes: o,
339
+ attributes: { [$]: r },
314
340
  components: { type: p },
315
- styles: `.${v} { position: relative; }`,
341
+ styles: `.${o} { position: relative; }`,
316
342
  delegate: {
317
- select: (a) => a.findFirstType(p),
318
- layer: (a) => a.findFirstType(p)
343
+ select: (s) => s.findFirstType(p),
344
+ layer: (s) => s.findFirstType(p)
319
345
  }
320
346
  }
321
347
  },
@@ -324,24 +350,24 @@ const O = (e, i) => {
324
350
  this.el.style.height = "1px";
325
351
  }
326
352
  }
327
- }), l.addType(p, {
328
- isComponent: x(p),
353
+ }), i.addType(p, {
354
+ isComponent: P(p),
329
355
  model: {
330
356
  defaults: {
331
357
  droppable: !1,
332
358
  highlightable: !1,
333
359
  classes: t,
334
360
  emptyState: !0,
335
- icon: M,
336
- name: y,
361
+ icon: R,
362
+ name: w,
337
363
  delegate: {
338
- remove: (a) => a.parent(),
339
- move: (a) => a.parent(),
340
- copy: (a) => a.parent()
364
+ remove: (s) => s.parent(),
365
+ move: (s) => s.parent(),
366
+ copy: (s) => s.parent()
341
367
  },
342
368
  attributes: { [$]: p },
343
- [b]: r[0].id,
344
- resizable: s,
369
+ [b]: g[0].id,
370
+ resizable: l,
345
371
  stylable: ["height", "width", "color"],
346
372
  styles: `
347
373
  .${t} {
@@ -384,49 +410,49 @@ const O = (e, i) => {
384
410
  name: b,
385
411
  label: "Shape",
386
412
  changeProp: !0,
387
- options: r.map(({ id: a, label: d, value: h }) => ({
388
- id: a,
413
+ options: g.map(({ id: s, label: d, value: v }) => ({
414
+ id: s,
389
415
  label: d,
390
- icon: { icon: h.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
416
+ icon: { icon: v.replace("<svg ", '<svg style="width: 35px; height: 7px; fill: currentColor;"') }
391
417
  }))
392
418
  },
393
419
  {
394
420
  type: "checkbox",
395
- name: f,
421
+ name: u,
396
422
  label: "Flip vertically",
397
423
  changeProp: !0
398
424
  },
399
425
  {
400
426
  type: "checkbox",
401
- name: A,
427
+ name: M,
402
428
  label: "flip horizontally",
403
429
  changeProp: !0
404
430
  }
405
431
  ]
406
432
  },
407
433
  init() {
408
- this.on(`change:${b}`, this.onShapeChange), this.on(`change:${A} change:${f}`, this.onFlip), this.onShapeChange();
434
+ this.on(`change:${b}`, this.onShapeChange), this.on(`change:${M} change:${u}`, this.onFlip), this.onShapeChange();
409
435
  },
410
436
  onShapeChange() {
411
- const a = this.get(b), d = r.find((u) => u.id === a), h = (d == null ? void 0 : d.value) || this.getInnerHTML().trim();
412
- this.components(""), h && this.set("content", h);
437
+ const s = this.get(b), d = g.find((f) => f.id === s), v = (d == null ? void 0 : d.value) || this.getInnerHTML().trim();
438
+ this.components(""), v && this.set("content", v);
413
439
  },
414
440
  onFlip() {
415
- const a = this.get(f), d = this.get(A), h = ["fl-v", "fl-h", "fl-v-h"].map((S) => `${t}--${S}`);
416
- let u;
417
- a && d ? u = h[2] : d ? u = h[1] : a && (u = h[0]), this.removeClass(h), u && this.addClass(u), this.set("resizable", a ? m : s);
441
+ const s = this.get(u), d = this.get(M), v = ["fl-v", "fl-h", "fl-v-h"].map((D) => `${t}--${D}`);
442
+ let f;
443
+ s && d ? f = v[2] : d ? f = v[1] : s && (f = v[0]), this.removeClass(v), f && this.addClass(f), this.set("resizable", s ? A : l);
418
444
  }
419
445
  }
420
- }), U({
446
+ }), _({
421
447
  editor: e,
422
- licenseKey: i.licenseKey,
423
- plan: K,
424
- pluginName: Y,
448
+ licenseKey: a.licenseKey,
449
+ plan: Z,
450
+ pluginName: X,
425
451
  cleanup: () => {
426
- l.removeType(o), c.remove(o);
452
+ i.removeType(r), c.remove(r);
427
453
  }
428
454
  });
429
- }, G = _(j);
455
+ }, J = W(q);
430
456
  export {
431
- G as default
457
+ J as default
432
458
  };
@@ -1,4 +1,4 @@
1
- (function(b,m){typeof exports=="object"&&typeof module<"u"?module.exports=m():typeof define=="function"&&define.amd?define(m):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_shapeDividerComponent=m())})(this,function(){"use strict";const b="app.grapesjs.com",m="app-stage.grapesjs.com",x=[b,"app2.grapesjs.com",m,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],S="license:check:start",R="license:check:end",I=()=>typeof window<"u",P=({isDev:e,isStage:a,isPlatform:l})=>`${e?"":`https://${a?m:b}`}/${l?"platform-api":"api"}`,E=()=>{const e=I()&&window.location.hostname;return!!e&&(x.includes(e)||x.some(a=>e.endsWith(a)))};async function L({path:e,baseApiUrl:a,method:l="GET",headers:c={},params:n,body:o}){const v=`${a||P({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...c}};o&&(t.body=JSON.stringify(o));const r=n?new URLSearchParams(n).toString():"",g=r?`?${r}`:"",s=await fetch(`${v}${g}`,t);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var y=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(y||{});const T={[y.free]:0,[y.startup]:10,[y.business]:20,[y.enterprise]:30};function D(e){const a=e;return a.init=l=>c=>e(c,l),a}const N=e=>D(e);async function _({editor:e,plan:a,pluginName:l,licenseKey:c,onLicenseCheckResponse:n,cleanup:o}){let p="",v=!1;const t=E(),r=s=>{console.warn("Cleanup plugin:",l,"Reason:",s),o()},g=(s={})=>{var A;const{error:M,sdkLicense:w}=s,u=(A=s.plan)==null?void 0:A.category;if(!(w||s.license)||M)r(M||"Invalid license");else if(u){const $=T[a],z=T[u];$>z&&r({pluginRequiredPlan:a,licensePlan:u})}};e.on(S,s=>{p=s==null?void 0:s.baseApiUrl,v=!0}),e.on(R,s=>{n==null||n(s),g(s)}),setTimeout(async()=>{if(!v){if(t)return;if(c){const s=await k({licenseKey:c,pluginName:l,baseApiUrl:p});n==null||n(s),s&&g(s)}else r("The `licenseKey` option not provided")}},2e3)}async function k(e){const{licenseKey:a,pluginName:l,baseApiUrl:c}=e;try{return(await L({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const O=(e,a)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(a))},B=e=>a=>{var l;return((l=a.getAttribute)==null?void 0:l.call(a,C))===e},H="gjs-plg-",C="data-type-role",W="shapeDividerComponent",U=y.startup;return N(function(e,a={}){const{Components:l,Blocks:c,Selectors:n}=e,o="shape-divider",p=`${o}-cnt`,v=`${H}${o}`,t=`${H}${p}`,r=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
1
+ (function(b,y){typeof exports=="object"&&typeof module<"u"?module.exports=y():typeof define=="function"&&define.amd?define(y):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_shapeDividerComponent=y())})(this,function(){"use strict";const b="app.grapesjs.com",y="app-stage.grapesjs.com",z=[b,"app2.grapesjs.com",y,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],D="license:check:end",k=()=>typeof window<"u",G=({isDev:e,isStage:a,isPlatform:l})=>`${e?"":`https://${a?y:b}`}/${l?"platform-api":"api"}`,I=()=>{if(!k())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},E=()=>{const e=I();return!!e&&(z.includes(e)||z.some(a=>e.endsWith(a)))};async function O({path:e,baseApiUrl:a,method:l="GET",headers:c={},params:n,body:r}){const o=`${a||G({isDev:!1,isStage:!1})}${e}`,t={method:l,headers:{"Content-Type":"application/json",...c}};r&&(t.body=JSON.stringify(r));const g=n?new URLSearchParams(n).toString():"",h=g?`?${g}`:"",i=await fetch(`${o}${h}`,t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}var w=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(w||{}),$=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))($||{});const B={[w.free]:0,[w.startup]:10,[w.business]:20,[w.enterprise]:30};function N(e){const a=e;return a.init=l=>c=>e(c,l),a}const F=e=>N(e);async function _({editor:e,plan:a,pluginName:l,licenseKey:c,onLicenseCheckResponse:n,cleanup:r}){let p="",o;const t=i=>{console.warn("Cleanup plugin:",l,"Reason:",i),r()},g=(i={})=>{var M;const{error:R,sdkLicense:A}=i,u=(M=i.plan)==null?void 0:M.category;if(!(A||i.license)||R)t(R||"Invalid license");else if(u){const T=B[a],V=B[u];T>V&&t({pluginRequiredPlan:a,licensePlan:u})}};e.Commands.has($.settings)&&(o=e.runCommand($.settings),p=(o==null?void 0:o.baseUrl)||"");const h=i=>{n==null||n(i),i&&g(i)};if(!o){e.onReady(async()=>{if(!E())if(c){const i=await U({licenseKey:c,pluginName:l,baseApiUrl:p});h(i)}else t("The `licenseKey` option not provided")});return}if(o.licensePlan||o.licenseError){const i=C(o);h(i);return}e.on(D,i=>h(i))}const C=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function U(e){const{licenseKey:a,pluginName:l,baseApiUrl:c}=e;try{return(await O({baseApiUrl:c,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:l}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const W=(e,a)=>{var l;return!!((l=e==null?void 0:e.classList)!=null&&l.contains(a))},L=e=>a=>{var l;return((l=a.getAttribute)==null?void 0:l.call(a,P))===e},H="gjs-plg-",P="data-type-role",j="shapeDividerComponent",Y=w.startup;return F(function(e,a={}){const{Components:l,Blocks:c,Selectors:n}=e,r="shape-divider",p=`${r}-cnt`,o=`${H}${r}`,t=`${H}${p}`,g=[{id:"tilt",label:"Tilt",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
2
2
  <path d="M240 24V0L0 24h240z"/>
3
3
  </svg>`},{id:"tilt-split",label:"Tilt split",value:`<svg preserveAspectRatio="none" viewBox="0 0 240 24">
4
4
  <path fill-opacity=".3" d="M240 24V0L0 24h240z"/>
@@ -58,9 +58,9 @@
58
58
  <path fill-opacity=".3" d="M0 0v18C21.5 7 49.6 2.2 64.8 6.4 82 11.2 75.4 25.2 91.7 23.9c14.2-1.1 25.8-12.3 40-12.3 10.4 0 7.8 6 18.8 6.9 11.5.8 21.6-5 37.2-9 19.9-5 42.1-5.3 52.3 0V0H0z"/>
59
59
  </svg>`},{id:"zigzag",label:"Zigzag",value:`<svg class="${t}-inv" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1000 38">
60
60
  <path d="M75 38l25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25 25 25 25-25V.0H0V13l25 25 25-25z"/>
61
- </svg>`}],g={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},s={...g,bc:!0},M={...g,tc:!0},w="shape",u="flip-y",V="flip-x",A="Shape Divider",$=`<svg viewBox="0 0 22 22">
61
+ </svg>`}],h={tl:!1,tc:!1,tr:!1,cl:!1,cr:!1,bl:!1,bc:!1,br:!1},i={...h,bc:!0},R={...h,tc:!0},A="shape",u="flip-y",x="flip-x",M="Shape Divider",T=`<svg viewBox="0 0 22 22">
62
62
  <path fill="currentColor" d="M2 2v18h18V2H2zm0-2h18a2 2 0 012 2v18a2 2 0 01-2 2H2a2 2 0 01-2-2V2C0 .9.9 0 2 0zM1 13L2 0h18l1 9-20 4z"/>
63
- </svg>`,{block:z={}}=a;e.on(n.events.add,i=>{i.getFullName().startsWith(`.${v}`)&&i.set({private:!0})}),l.addType(o,{isComponent:i=>B(o)(i)||O(i,v),block:z&&{label:A,media:$,category:"Extra",select:!0,...z},model:{defaults:{droppable:!1,highlightable:!1,classes:v,attributes:{[C]:o},components:{type:p},styles:`.${v} { position: relative; }`,delegate:{select:i=>i.findFirstType(p),layer:i=>i.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(p,{isComponent:B(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:$,name:A,delegate:{remove:i=>i.parent(),move:i=>i.parent(),copy:i=>i.parent()},attributes:{[C]:p},[w]:r[0].id,resizable:s,stylable:["height","width","color"],styles:`
63
+ </svg>`,{block:V={}}=a;e.on(n.events.add,s=>{s.getFullName().startsWith(`.${o}`)&&s.set({private:!0})}),l.addType(r,{isComponent:s=>L(r)(s)||W(s,o),block:V&&{label:M,media:T,category:"Extra",select:!0,...V},model:{defaults:{droppable:!1,highlightable:!1,classes:o,attributes:{[P]:r},components:{type:p},styles:`.${o} { position: relative; }`,delegate:{select:s=>s.findFirstType(p),layer:s=>s.findFirstType(p)}}},view:{onRender(){this.el.style.height="1px"}}}),l.addType(p,{isComponent:L(p),model:{defaults:{droppable:!1,highlightable:!1,classes:t,emptyState:!0,icon:T,name:M,delegate:{remove:s=>s.parent(),move:s=>s.parent(),copy:s=>s.parent()},attributes:{[P]:p},[A]:g[0].id,resizable:i,stylable:["height","width","color"],styles:`
64
64
  .${t} {
65
65
  position: absolute;
66
66
  width: 100%;
@@ -94,4 +94,4 @@
94
94
  .${t}-inv > path {
95
95
  transform: scale(-1, -1) translate(-100%, -100%);
96
96
  }
97
- `,traits:[{type:"select",name:w,label:"Shape",changeProp:!0,options:r.map(({id:i,label:d,value:h})=>({id:i,label:d,icon:{icon:h.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:V,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${w}`,this.onShapeChange),this.on(`change:${V} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const i=this.get(w),d=r.find(f=>f.id===i),h=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),h&&this.set("content",h)},onFlip(){const i=this.get(u),d=this.get(V),h=["fl-v","fl-h","fl-v-h"].map(F=>`${t}--${F}`);let f;i&&d?f=h[2]:d?f=h[1]:i&&(f=h[0]),this.removeClass(h),f&&this.addClass(f),this.set("resizable",i?M:s)}}}),_({editor:e,licenseKey:a.licenseKey,plan:U,pluginName:W,cleanup:()=>{l.removeType(o),c.remove(o)}})})});
97
+ `,traits:[{type:"select",name:A,label:"Shape",changeProp:!0,options:g.map(({id:s,label:d,value:v})=>({id:s,label:d,icon:{icon:v.replace("<svg ",'<svg style="width: 35px; height: 7px; fill: currentColor;"')}}))},{type:"checkbox",name:u,label:"Flip vertically",changeProp:!0},{type:"checkbox",name:x,label:"flip horizontally",changeProp:!0}]},init(){this.on(`change:${A}`,this.onShapeChange),this.on(`change:${x} change:${u}`,this.onFlip),this.onShapeChange()},onShapeChange(){const s=this.get(A),d=g.find(f=>f.id===s),v=(d==null?void 0:d.value)||this.getInnerHTML().trim();this.components(""),v&&this.set("content",v)},onFlip(){const s=this.get(u),d=this.get(x),v=["fl-v","fl-h","fl-v-h"].map(K=>`${t}--${K}`);let f;s&&d?f=v[2]:d?f=v[1]:s&&(f=v[0]),this.removeClass(v),f&&this.addClass(f),this.set("resizable",s?R:i)}}}),_({editor:e,licenseKey:a.licenseKey,plan:Y,pluginName:j,cleanup:()=>{l.removeType(r),c.remove(r)}})})});
@@ -1,4 +1,4 @@
1
- "use strict";const ee="app.grapesjs.com",te="app-stage.grapesjs.com",ae="app2.grapesjs.com",le="app-stage2.grapesjs.com",G=[ee,ae,te,le,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],ie="license:check:start",se="license:check:end",ne=()=>typeof window<"u",oe=({isDev:e,isStage:l,isPlatform:a})=>`${e?"":`https://${l?te:ee}`}/${a?"platform-api":"api"}`,re=()=>{const e=ne()&&window.location.hostname;return!!e&&(G.includes(e)||G.some(l=>e.endsWith(l)))},ce=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(l,a)=>(a?"-":"")+l.toLowerCase()),de=e=>typeof e<"u";async function pe({path:e,baseApiUrl:l,method:a="GET",headers:i={},params:s,body:f}){const u=`${l||oe({isDev:!1,isStage:!1})}${e}`,b={method:a,headers:{"Content-Type":"application/json",...i}};f&&(b.body=JSON.stringify(f));const d=s?new URLSearchParams(s).toString():"",m=d?`?${d}`:"",n=await fetch(`${u}${m}`,b);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var x=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(x||{});const U={[x.free]:0,[x.startup]:10,[x.business]:20,[x.enterprise]:30};function ue(e){const l=e;return l.init=a=>i=>e(i,a),l}const be=e=>ue(e);async function fe({editor:e,plan:l,pluginName:a,licenseKey:i,onLicenseCheckResponse:s,cleanup:f}){let c="",u=!1;const b=re(),d=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),f()},m=(n={})=>{var C;const{error:t,sdkLicense:o}=n,y=(C=n.plan)==null?void 0:C.category;if(!(o||n.license)||t)d(t||"Invalid license");else if(y){const B=U[l],R=U[y];B>R&&d({pluginRequiredPlan:l,licensePlan:y})}};e.on(ie,n=>{c=n==null?void 0:n.baseApiUrl,u=!0}),e.on(se,n=>{s==null||s(n),m(n)}),setTimeout(async()=>{if(!u){if(b)return;if(i){const n=await he({licenseKey:i,pluginName:a,baseApiUrl:c});s==null||s(n),n&&m(n)}else d("The `licenseKey` option not provided")}},2e3)}async function he(e){const{licenseKey:l,pluginName:a,baseApiUrl:i}=e;try{return(await pe({baseApiUrl:i,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const E=(e,l)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(l))},ve=(e,l={})=>{var f;const a={},i=[],s=[];for(const c in e){const{value:u,...b}=e[c];i.push({id:c,name:c,changeProp:!0,category:l.category,...b}),a[c]=u,!de(u)&&s.push(c);const{subTraits:d={}}=b;for(const m in b.subTraits)(f=d[m])==null||f.forEach(n=>{const t=n.id||n.name;a[t]=n.value})}return{propKeys:Object.keys(a),propsNoValues:s,props:a,traits:i}},me=(e,l)=>{l.forEach(a=>{if(a.subTraits){const i=`${a.id||a.name}`,s=a.changeProp?`change:${i}`:`change:attributes:${i}`;e.on(s,()=>j(e,i)),j(e,i)}})},j=(e,l)=>{const a=e.getTrait(l),i=a.get("category"),s=a.get("subTraits")||{},c=(Object.values(s).flat()||[]).map(d=>d.id||d.name);e.removeTrait(c);const u=s[a.getValue()],b=e.getTraitIndex(l)+1;u&&e.addTrait(u.map(d=>({category:i,...d})),{at:b})},ge=(e,l)=>{l.forEach(a=>{const i=ce(a);i!==a&&e.has(i)&&e.set({[a]:e.get(i),[i]:void 0})})},v="swiper",O=`${v}-slide`,A=`${v}-wrapper`,L=`${v}-nav-prev`,$=`${v}-nav-next`,k=`${v}-pagination`,M=`${v}-scrollbar`,p={slider:`<svg viewBox="0 0 24 24">
1
+ "use strict";const te="app.grapesjs.com",ae="app-stage.grapesjs.com",le="app2.grapesjs.com",oe="app-stage2.grapesjs.com",U=[te,le,ae,oe,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],se="license:check:end",ie=()=>typeof window<"u",ne=({isDev:e,isStage:l,isPlatform:a})=>`${e?"":`https://${l?ae:te}`}/${a?"platform-api":"api"}`,re=()=>{if(!ie())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},ce=()=>{const e=re();return!!e&&(U.includes(e)||U.some(l=>e.endsWith(l)))},de=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(l,a)=>(a?"-":"")+l.toLowerCase()),pe=e=>typeof e<"u";async function ue({path:e,baseApiUrl:l,method:a="GET",headers:o={},params:s,body:f}){const d=`${l||ne({isDev:!1,isStage:!1})}${e}`,p={method:a,headers:{"Content-Type":"application/json",...o}};f&&(p.body=JSON.stringify(f));const b=s?new URLSearchParams(s).toString():"",g=b?`?${b}`:"",i=await fetch(`${d}${g}`,p);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}var x=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(x||{}),q=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(q||{});const j={[x.free]:0,[x.startup]:10,[x.business]:20,[x.enterprise]:30};function be(e){const l=e;return l.init=a=>o=>e(o,a),l}const fe=e=>be(e);async function ge({editor:e,plan:l,pluginName:a,licenseKey:o,onLicenseCheckResponse:s,cleanup:f}){let c="",d;const p=i=>{console.warn("Cleanup plugin:",a,"Reason:",i),f()},b=(i={})=>{var _;const{error:t,sdkLicense:n}=i,w=(_=i.plan)==null?void 0:_.category;if(!(n||i.license)||t)p(t||"Invalid license");else if(w){const B=j[l],$=j[w];B>$&&p({pluginRequiredPlan:l,licensePlan:w})}};e.Commands.has(q.settings)&&(d=e.runCommand(q.settings),c=(d==null?void 0:d.baseUrl)||"");const g=i=>{s==null||s(i),i&&b(i)};if(!d){e.onReady(async()=>{if(!ce())if(o){const i=await ve({licenseKey:o,pluginName:a,baseApiUrl:c});g(i)}else p("The `licenseKey` option not provided")});return}if(d.licensePlan||d.licenseError){const i=he(d);g(i);return}e.on(se,i=>g(i))}const he=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function ve(e){const{licenseKey:l,pluginName:a,baseApiUrl:o}=e;try{return(await ue({baseApiUrl:o,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const E=(e,l)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(l))},ye=(e,l={})=>{var f;const a={},o=[],s=[];for(const c in e){const{value:d,...p}=e[c];o.push({id:c,name:c,changeProp:!0,category:l.category,...p}),a[c]=d,!pe(d)&&s.push(c);const{subTraits:b={}}=p;for(const g in p.subTraits)(f=b[g])==null||f.forEach(i=>{const t=i.id||i.name;a[t]=i.value})}return{propKeys:Object.keys(a),propsNoValues:s,props:a,traits:o}},we=(e,l)=>{l.forEach(a=>{if(a.subTraits){const o=`${a.id||a.name}`,s=a.changeProp?`change:${o}`:`change:attributes:${o}`;e.on(s,()=>Z(e,o)),Z(e,o)}})},Z=(e,l)=>{const a=e.getTrait(l),o=a.get("category"),s=a.get("subTraits")||{},c=(Object.values(s).flat()||[]).map(b=>b.id||b.name);e.removeTrait(c);const d=s[a.getValue()],p=e.getTraitIndex(l)+1;d&&e.addTrait(d.map(b=>({category:o,...b})),{at:p})},me=(e,l)=>{l.forEach(a=>{const o=de(a);o!==a&&e.has(o)&&e.set({[a]:e.get(o),[o]:void 0})})},v="swiper",O=`${v}-slide`,L=`${v}-wrapper`,A=`${v}-nav-prev`,I=`${v}-nav-next`,k=`${v}-pagination`,M=`${v}-scrollbar`,u={slider:`<svg viewBox="0 0 24 24">
2
2
  <path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
3
3
  <path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
4
4
  </svg>`,effect:`<svg viewBox="0 0 24 24">
@@ -21,25 +21,25 @@
21
21
  <path d="M2 12c0 5 4 9 9 9 2.4 0 4.7-1 6.4-2.6l-1.5-1.5A6.7 6.7 0 0 1 11 19a7 7 0 1 1 7-7h-3l4 4h.1l3.9-4h-3a9 9 0 0 0-18 0Z"/>
22
22
  </svg>`,prev:'<svg viewBox="0 0 24 24"><path d="M15.4 16.6 10.8 12l4.6-4.6L14 6l-6 6 6 6 1.4-1.4Z"/></svg>',next:'<svg viewBox="0 0 24 24"><path d="m8.6 16.6 4.6-4.6-4.6-4.6L10 6l6 6-6 6-1.4-1.4Z"/></svg>',add:`<svg viewBox="0 0 24 24">
23
23
  <path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
24
- </svg>`},K={id:"swiper-responsive",label:"Responsive",icon:p.responsive},Z={id:"swiper-extra",label:"Extra",icon:p.extra},ye={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:p.reload},{id:"p",label:"Previous slide",icon:p.prev},{id:"n",label:"Next slide",icon:p.next},{id:"a",label:"Add new slide",icon:p.add}],setValue:({component:e,value:l})=>{var i;const a=(i=e.getView())==null?void 0:i.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(L),setValue:({component:e,value:l})=>{var a,i;l?e.append([{type:L},{type:$}]):((a=e.findFirstType(L))==null||a.remove(),(i=e.findFirstType($))==null||i.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:p.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:p.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"checkbox",name:"autoplayEditor",label:"Autoplay in editor",tip:"Allow autoplay to run while editing in the canvas. Note: this may make selecting and editing slides difficult as they will automatically change.",changeProp:!0,value:!1},{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:p.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(k)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(k);a==null||a.remove(),l!=="none"&&e.append({type:k}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:p.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(M),setValue:({component:e,value:l})=>{const a=e.findFirstType(M);a==null||a.remove(),l&&e.append({type:M}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:p.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:K,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:K,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:Z,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:Z,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},Y="Slider",z="swiper",_=`${z}-`,Se=(e,l)=>{const{Components:a,Blocks:i,Commands:s}=e,{block:f}=l,c=ve(ye),u="core:preview",b=s.events,d=function(t){const o=this,y=window,N=o.__onLoad,C=o.__activeSlide,B=o.__inPreview,R=y._isEditor&&!B?t.autoplayEditor:!0,{cdnScript:I,cdnStyle:W,slidesPerView:F}=t||{},r=S=>isNaN(S)?void 0:parseFloat(S),H=()=>{const S=o.parentElement;S&&(S.style.minWidth="0");const P={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(F)?F:r(F),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:o.querySelector(".swiper-button-next"),prevEl:o.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:o.querySelector(".swiper-pagination")},scrollbar:{el:o.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&R&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:T,tabletSlidesPerView:g}=t,h=r(T);P.breakpoints[h]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:T,mobileSlidesPerView:g}=t,h=r(T);P.breakpoints[h]={slidesPerView:isNaN(g)?g:r(g),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}N&&!B&&(P.simulateTouch=!1),C&&(P.initialSlide=C);const q=new y.Swiper(o,P);N==null||N(q)};if(y.Swiper)H();else{const{head:S}=document,P=Array.isArray(I)?[...I]:[I],q=Array.isArray(W)?[...W]:[W],T=h=>{if(h.length){const w=document.createElement("link");w.href=h.shift(),w.rel="stylesheet",S.prepend(w),T(h)}},g=h=>{if(h.length){const w=document.createElement("script");w.src=h.shift(),w.onerror=w.onload=g.bind(null,h),S.appendChild(w)}else H()};T(q),g(P)}},m=(t=0)=>({type:O,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),n=a.getType("default").model;return a.addType(v,{block:f&&{label:Y,media:p.slider,category:"Extra",select:!0,...l.block},isComponent:t=>E(t,z),model:{defaults:()=>({name:Y,icon:p.slider,classes:z,draggable:(t,o)=>!o.is(v),components:[{type:A,components:[m(1),m(2),m(3)]},{type:k}],script:d,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;me(this,c.traits),ge(this,c.propKeys),this.listenTo(t,`${b.runCommand}${u}`,this.onPreviewOn),this.listenTo(t,`${b.stopCommand}${u}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(A);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var o;const t=((o=this.findFirstType(A))==null?void 0:o.components().length)||0;return{type:O,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const o=n.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(y=>delete o[y]),delete o["script-props"],o}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=o=>o.on("slideChange",()=>this.__activeSlide=o.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(v),i.remove(v)}},we="Nav Prev",Pe="Nav Next",V=`${_}button-prev`,D=`${_}button-next`,Ee=e=>{const{Components:l}=e,a=i=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:i,fill:"currentColor"}}});return l.addType(L,{isComponent:i=>E(i,V),model:{defaults:{name:we,classes:V,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
25
- .${V} {
24
+ </svg>`},K={id:"swiper-responsive",label:"Responsive",icon:u.responsive},Y={id:"swiper-extra",label:"Extra",icon:u.extra},Se={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:u.reload},{id:"p",label:"Previous slide",icon:u.prev},{id:"n",label:"Next slide",icon:u.next},{id:"a",label:"Add new slide",icon:u.add}],setValue:({component:e,value:l})=>{var o;const a=(o=e.getView())==null?void 0:o.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(A),setValue:({component:e,value:l})=>{var a,o;l?e.append([{type:A},{type:I}]):((a=e.findFirstType(A))==null||a.remove(),(o=e.findFirstType(I))==null||o.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:u.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:u.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"checkbox",name:"autoplayEditor",label:"Autoplay in editor",tip:"Allow autoplay to run while editing in the canvas. Note: this may make selecting and editing slides difficult as they will automatically change.",changeProp:!0,value:!1},{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:u.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(k)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(k);a==null||a.remove(),l!=="none"&&e.append({type:k}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:u.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(M),setValue:({component:e,value:l})=>{const a=e.findFirstType(M);a==null||a.remove(),l&&e.append({type:M}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:u.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:K,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:K,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:Y,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:Y,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},X="Slider",z="swiper",R=`${z}-`,Pe=(e,l)=>{const{Components:a,Blocks:o,Commands:s}=e,{block:f}=l,c=ye(Se),d="core:preview",p=s.events,b=function(t){const n=this,w=window,N=n.__onLoad,_=n.__activeSlide,B=n.__inPreview,$=w._isEditor&&!B?t.autoplayEditor:!0,{cdnScript:G,cdnStyle:F,slidesPerView:C}=t||{},r=m=>isNaN(m)?void 0:parseFloat(m),H=()=>{const m=n.parentElement;m&&(m.style.minWidth="0");const P={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(C)?C:r(C),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:n.querySelector(".swiper-pagination")},scrollbar:{el:n.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&$&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:T,tabletSlidesPerView:y}=t,h=r(T);P.breakpoints[h]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:T,mobileSlidesPerView:y}=t,h=r(T);P.breakpoints[h]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}N&&!B&&(P.simulateTouch=!1),_&&(P.initialSlide=_);const W=new w.Swiper(n,P);N==null||N(W)};if(w.Swiper)H();else{const{head:m}=document,P=Array.isArray(G)?[...G]:[G],W=Array.isArray(F)?[...F]:[F],T=h=>{if(h.length){const S=document.createElement("link");S.href=h.shift(),S.rel="stylesheet",m.prepend(S),T(h)}},y=h=>{if(h.length){const S=document.createElement("script");S.src=h.shift(),S.onerror=S.onload=y.bind(null,h),m.appendChild(S)}else H()};T(W),y(P)}},g=(t=0)=>({type:O,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),i=a.getType("default").model;return a.addType(v,{block:f&&{label:X,media:u.slider,category:"Extra",select:!0,...l.block},isComponent:t=>E(t,z),model:{defaults:()=>({name:X,icon:u.slider,classes:z,draggable:(t,n)=>!n.is(v),components:[{type:L,components:[g(1),g(2),g(3)]},{type:k}],script:b,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;we(this,c.traits),me(this,c.propKeys),this.listenTo(t,`${p.runCommand}${d}`,this.onPreviewOn),this.listenTo(t,`${p.stopCommand}${d}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(L);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var n;const t=((n=this.findFirstType(L))==null?void 0:n.components().length)||0;return{type:O,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const n=i.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(w=>delete n[w]),delete n["script-props"],n}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=n=>n.on("slideChange",()=>this.__activeSlide=n.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(v),o.remove(v)}},Ee="Nav Prev",Te="Nav Next",D=`${R}button-prev`,V=`${R}button-next`,xe=e=>{const{Components:l}=e,a=o=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:o,fill:"currentColor"}}});return l.addType(A,{isComponent:o=>E(o,D),model:{defaults:{name:Ee,classes:D,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
25
+ .${D} {
26
26
  color: inherit;
27
27
  }
28
- .${V}:after {
28
+ .${D}:after {
29
29
  content: none;
30
30
  }
31
- `}}}),l.addType($,{extend:L,isComponent:i=>E(i,D),model:{defaults:{name:Pe,classes:D,components:a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
32
- .${D} {
31
+ `}}}),l.addType(I,{extend:A,isComponent:o=>E(o,V),model:{defaults:{name:Te,classes:V,components:a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
32
+ .${V} {
33
33
  color: inherit;
34
34
  }
35
- .${D}:after {
35
+ .${V}:after {
36
36
  content: none;
37
37
  }
38
- `}}}),()=>{l.removeType(L),l.removeType($)}},Te=e=>{const{Components:l}=e,a=`${_}pagination`;return l.addType(k,{isComponent:i=>E(i,a),model:{defaults:{name:"Pagination",classes:a,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
38
+ `}}}),()=>{l.removeType(A),l.removeType(I)}},Le=e=>{const{Components:l}=e,a=`${R}pagination`;return l.addType(k,{isComponent:o=>E(o,a),model:{defaults:{name:"Pagination",classes:a,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
39
39
  .${a}-bullet-active {
40
40
  background-color: currentColor;
41
41
  }
42
42
  .${a}-progressbar-fill {
43
43
  --swiper-pagination-color: currentColor;
44
44
  }
45
- `}}}),()=>{l.removeType(k)}},xe="Scrollbar",X=`${_}scrollbar`,Ae=e=>{const{Components:l}=e;return l.addType(M,{isComponent:a=>E(a,X),model:{defaults:{name:xe,classes:X,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{l.removeType(M)}},Le="Slide",J=`${_}slide`,ke=e=>{const{Components:l}=e;return l.addType(O,{isComponent:a=>E(a,J),model:{defaults:{name:Le,classes:J,icon:p.slider,draggable:(a,i)=>i.is(A)}}}),()=>{l.removeType(O)}},_e="Wrapper",Q=`${_}wrapper`,Ne=e=>{const{Components:l}=e,{events:a}=l;return l.addType(A,{isComponent:i=>E(i,Q),model:{defaults:{name:_e,icon:p.slider,classes:Q,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:i=>i.is(O)},init(){const i=this.components();this.listenTo(i,"add remove",this.updateSlider)},updateSlider(i){const s=this.closestType(v);if(s){const f=s.getView();s.reloadSlider(),this.em.once(a.scriptMount,()=>{setTimeout(()=>{var c;return(c=f.getSwiper())==null?void 0:c.slideTo(i.index())},100)})}}}}),()=>{l.removeType(A)}},Ce="swiperComponent",Me=x.startup,Oe=function(e,l={}){const a={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...l},i=[Se(e,a),Ee(e),Ne(e),ke(e),Te(e),Ae(e)];fe({editor:e,plan:Me,licenseKey:a.licenseKey,pluginName:Ce,cleanup:()=>{i.forEach(s=>s())}})},Be=be(Oe);module.exports=Be;
45
+ `}}}),()=>{l.removeType(k)}},Ae="Scrollbar",J=`${R}scrollbar`,ke=e=>{const{Components:l}=e;return l.addType(M,{isComponent:a=>E(a,J),model:{defaults:{name:Ae,classes:J,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{l.removeType(M)}},Re="Slide",Q=`${R}slide`,Ne=e=>{const{Components:l}=e;return l.addType(O,{isComponent:a=>E(a,Q),model:{defaults:{name:Re,classes:Q,icon:u.slider,draggable:(a,o)=>o.is(L)}}}),()=>{l.removeType(O)}},_e="Wrapper",ee=`${R}wrapper`,Me=e=>{const{Components:l}=e,{events:a}=l;return l.addType(L,{isComponent:o=>E(o,ee),model:{defaults:{name:_e,icon:u.slider,classes:ee,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:o=>o.is(O)},init(){const o=this.components();this.listenTo(o,"add remove",this.updateSlider)},updateSlider(o){const s=this.closestType(v);if(s){const f=s.getView();s.reloadSlider(),this.em.once(a.scriptMount,()=>{setTimeout(()=>{var c;return(c=f.getSwiper())==null?void 0:c.slideTo(o.index())},100)})}}}}),()=>{l.removeType(L)}},Oe="swiperComponent",Be=x.startup,De=function(e,l={}){const a={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...l},o=[Pe(e,a),xe(e),Me(e),Ne(e),Le(e),ke(e)];ge({editor:e,plan:Be,licenseKey:a.licenseKey,pluginName:Oe,cleanup:()=>{o.forEach(s=>s())}})},Ve=fe(De);module.exports=Ve;