@grapesjs/studio-sdk-plugins 1.0.36 → 1.0.38-rc.0

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 (97) hide show
  1. package/dist/accordionComponent/index.cjs.js +4 -4
  2. package/dist/accordionComponent/index.es.js +83 -70
  3. package/dist/accordionComponent/index.umd.js +5 -5
  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 +85 -85
  8. package/dist/aiChat/index.es.js +11151 -10258
  9. package/dist/aiChat/index.js +85 -85
  10. package/dist/aiChat/index.umd.js +86 -86
  11. package/dist/aiChat/locales/en.d.ts +11 -0
  12. package/dist/aiChat/projectGeneration.d.ts +17 -0
  13. package/dist/aiChat/server/index.cjs.js +1 -1
  14. package/dist/aiChat/server/index.es.js +1 -1
  15. package/dist/aiChat/server/index.js +1 -1
  16. package/dist/aiChat/server/index.umd.js +1 -1
  17. package/dist/aiChat/types.d.ts +1 -1
  18. package/dist/animationComponent/index.cjs.js +3 -3
  19. package/dist/animationComponent/index.es.js +57 -44
  20. package/dist/animationComponent/index.umd.js +3 -3
  21. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  22. package/dist/canvasAbsoluteMode/index.es.js +63 -50
  23. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  24. package/dist/canvasEmptyState/index.cjs.js +1 -1
  25. package/dist/canvasEmptyState/index.es.js +60 -47
  26. package/dist/canvasEmptyState/index.umd.js +1 -1
  27. package/dist/canvasFullSize/index.cjs.js +3 -3
  28. package/dist/canvasFullSize/index.es.js +49 -36
  29. package/dist/canvasFullSize/index.umd.js +5 -5
  30. package/dist/canvasGridMode/index.cjs.js +2 -2
  31. package/dist/canvasGridMode/index.es.js +251 -233
  32. package/dist/canvasGridMode/index.umd.js +4 -4
  33. package/dist/canvasScreenshot/index.cjs.js +1 -1
  34. package/dist/canvasScreenshot/index.es.js +42 -29
  35. package/dist/canvasScreenshot/index.umd.js +1 -1
  36. package/dist/dataSourceEjs/index.cjs.js +3 -3
  37. package/dist/dataSourceEjs/index.es.js +51 -38
  38. package/dist/dataSourceEjs/index.umd.js +3 -3
  39. package/dist/dataSourceHandlebars/index.cjs.js +2 -2
  40. package/dist/dataSourceHandlebars/index.es.js +152 -139
  41. package/dist/dataSourceHandlebars/index.umd.js +4 -4
  42. package/dist/dialogComponent/index.cjs.js +9 -9
  43. package/dist/dialogComponent/index.es.js +73 -60
  44. package/dist/dialogComponent/index.umd.js +3 -3
  45. package/dist/flexComponent/index.cjs.js +6 -6
  46. package/dist/flexComponent/index.es.js +83 -70
  47. package/dist/flexComponent/index.umd.js +6 -6
  48. package/dist/fsLightboxComponent/index.cjs.js +2 -2
  49. package/dist/fsLightboxComponent/index.es.js +67 -54
  50. package/dist/fsLightboxComponent/index.umd.js +2 -2
  51. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  52. package/dist/googleFontsAssetProvider/index.es.js +92 -79
  53. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  54. package/dist/iconifyComponent/index.cjs.js +2 -2
  55. package/dist/iconifyComponent/index.es.js +52 -39
  56. package/dist/iconifyComponent/index.umd.js +2 -2
  57. package/dist/index.cjs.js +42 -42
  58. package/dist/index.es.js +1167 -1149
  59. package/dist/index.umd.js +42 -42
  60. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  61. package/dist/layoutSidebarButtons/index.es.js +82 -69
  62. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  63. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  64. package/dist/lightGalleryComponent/index.es.js +98 -85
  65. package/dist/lightGalleryComponent/index.umd.js +1 -1
  66. package/dist/linkImageComponent/index.cjs.js +2 -2
  67. package/dist/linkImageComponent/index.es.js +71 -58
  68. package/dist/linkImageComponent/index.umd.js +2 -2
  69. package/dist/listPagesComponent/index.cjs.js +3 -3
  70. package/dist/listPagesComponent/index.es.js +49 -36
  71. package/dist/listPagesComponent/index.umd.js +3 -3
  72. package/dist/presetPrintable/index.cjs.js +5 -5
  73. package/dist/presetPrintable/index.es.js +126 -113
  74. package/dist/presetPrintable/index.umd.js +4 -4
  75. package/dist/prosemirror/index.cjs.js +1 -1
  76. package/dist/prosemirror/index.es.js +97 -84
  77. package/dist/prosemirror/index.umd.js +1 -1
  78. package/dist/rendererReact/index.cjs.js +1 -1
  79. package/dist/rendererReact/index.es.js +149 -137
  80. package/dist/rendererReact/index.js +1 -1
  81. package/dist/rendererReact/index.umd.js +1 -1
  82. package/dist/rteTinyMce/index.cjs.js +2 -2
  83. package/dist/rteTinyMce/index.es.js +92 -79
  84. package/dist/rteTinyMce/index.umd.js +2 -2
  85. package/dist/shapeDividerComponent/index.cjs.js +3 -3
  86. package/dist/shapeDividerComponent/index.es.js +38 -25
  87. package/dist/shapeDividerComponent/index.umd.js +3 -3
  88. package/dist/swiperComponent/index.cjs.js +5 -5
  89. package/dist/swiperComponent/index.es.js +106 -93
  90. package/dist/swiperComponent/index.umd.js +5 -5
  91. package/dist/tableComponent/index.cjs.js +1 -1
  92. package/dist/tableComponent/index.es.js +167 -154
  93. package/dist/tableComponent/index.umd.js +1 -1
  94. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  95. package/dist/youtubeAssetProvider/index.es.js +35 -22
  96. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  97. package/package.json +2 -2
@@ -56,6 +56,7 @@ declare const en: {
56
56
  moveComponent: string;
57
57
  getPageContent: string;
58
58
  listPages: string;
59
+ fetchWebsite: string;
59
60
  generateImage: string;
60
61
  runCommand: string;
61
62
  addComponentCode: string;
@@ -72,6 +73,12 @@ declare const en: {
72
73
  imageAlt: string;
73
74
  useImage: string;
74
75
  };
76
+ fetchWebsite: {
77
+ pending: string;
78
+ done: string;
79
+ missingContent: string;
80
+ defaultPageName: string;
81
+ };
75
82
  command: {
76
83
  notFound: string;
77
84
  missingHandler: string;
@@ -87,6 +94,10 @@ declare const en: {
87
94
  pending: string;
88
95
  done: string;
89
96
  };
97
+ publish: {
98
+ pending: string;
99
+ done: string;
100
+ };
90
101
  pageSettings: {
91
102
  pending: string;
92
103
  done: string;
@@ -0,0 +1,17 @@
1
+ import { Component, Editor } from 'grapesjs';
2
+ export declare const commandMjmlToHtml = "mjml-code-to-html";
3
+ export declare function resolveProjectGenerationPreviewContent(props: {
4
+ editor: Editor;
5
+ content: string;
6
+ isEmail: boolean;
7
+ }): any;
8
+ export declare function updateProjectGenerationPreview(props: {
9
+ editor: Editor;
10
+ component?: Component;
11
+ content: string;
12
+ isEmail: boolean;
13
+ scrollDocument?: boolean;
14
+ }): void;
15
+ export declare function completeProjectGeneration(editor: Editor, content: string, name: string): void;
16
+ export declare function startProjectGenerationPreview(editor: Editor): void;
17
+ export declare function stopProjectGenerationPreview(editor: Editor): void;
@@ -151,7 +151,7 @@ Plan: ${e.plan}`,!!e.imageUrls.length&&`
151
151
  Image refs: ${e.imageUrls.join(", ")}`)}],buildResult:()=>({success:!0})},t)}const ve=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q),imageUrls:c.z.array(c.z.string()).describe(le)}),Ne=P({description:"Creates a new page in the project with the full content.",inputSchema:ve});function Ae(t){return Q({description:Ne.description,inputSchema:ve,agentCodeName:T.ADD_PAGE_CODE,getSystemPrompt:Ye,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
152
152
  Page Name: ${e.name}`,!!e.imageUrls.length&&`
153
153
  Image refs: ${e.imageUrls.join(", ")}`,e.plan&&`
154
- Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const Ce=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q)}),Me=P({description:`Create a page in empty project with content based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,inputSchema:Ce});function Re(t){return Q({description:Me.description,inputSchema:Ce,agentCodeName:T.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Je,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
154
+ Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const Ce=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q)}),Me=P({description:`Creates a page in an empty project with content generated based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,inputSchema:Ce});function Re(t){return Q({description:Me.description,inputSchema:Ce,agentCodeName:T.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Je,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
155
155
  Page Name: ${e.name}`,e.plan&&`
156
156
  Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const V={[b.SHOW_CODE]:"Open the code panel to review and export current project code.",[b.IMPORT_CODE]:"Open the import code panel to import custom code into the current project.",[b.PAGE_SETTINGS]:"Open current page settings to edit title, slug, and other common HTML head tags.",[b.PREVIEW]:"Open fullscreen preview mode to see the current page rendered."};function ut({isEmail:t}={}){const e={[b.SHOW_CODE]:{description:V[b.SHOW_CODE]},[b.IMPORT_CODE]:{description:V[b.IMPORT_CODE]},[b.PREVIEW]:{description:V[b.PREVIEW]}};return t||(e[b.PAGE_SETTINGS]={description:V[b.PAGE_SETTINGS]}),e}function pt(t={}){const{projectContext:e,skipDefault:n,commands:r={}}=t,o=new Map(Object.entries(n?{}:ut(e)));return Object.entries(r).forEach(([i,s])=>{var p;if(!s)return;const l=i,m=(p=s.description)==null?void 0:p.trim();if(o.get(l)&&!m){o.delete(l);return}m&&o.set(l,{description:m})}),o}function $e(t={}){const e=pt(t),n=Array.from(e.keys());if(!n.length)throw new Error("`createCommandTool` requires at least one command");const r=n,o=`Run one of the available commands. Below the list with commandId and description:
157
157
  `+Array.from(e.entries()).map(([i,s])=>`- ${i}
@@ -686,7 +686,7 @@ const Ee = c.object({
686
686
  name: c.string().describe("Name of the new page"),
687
687
  plan: c.string().describe(B)
688
688
  }), at = I({
689
- description: `Create a page in empty project with content based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,
689
+ description: `Creates a page in an empty project with content generated based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,
690
690
  inputSchema: Ee
691
691
  });
692
692
  function it(t) {
@@ -151,7 +151,7 @@ Plan: ${e.plan}`,!!e.imageUrls.length&&`
151
151
  Image refs: ${e.imageUrls.join(", ")}`)}],buildResult:()=>({success:!0})},t)}const ve=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q),imageUrls:c.z.array(c.z.string()).describe(le)}),Ne=P({description:"Creates a new page in the project with the full content.",inputSchema:ve});function Ae(t){return Q({description:Ne.description,inputSchema:ve,agentCodeName:T.ADD_PAGE_CODE,getSystemPrompt:Ye,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
152
152
  Page Name: ${e.name}`,!!e.imageUrls.length&&`
153
153
  Image refs: ${e.imageUrls.join(", ")}`,e.plan&&`
154
- Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const Ce=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q)}),Me=P({description:`Create a page in empty project with content based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,inputSchema:Ce});function Re(t){return Q({description:Me.description,inputSchema:Ce,agentCodeName:T.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Je,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
154
+ Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const Ce=c.z.object({name:c.z.string().describe("Name of the new page"),plan:c.z.string().describe(q)}),Me=P({description:`Creates a page in an empty project with content generated based on a plan. IMPORTANT: This should be called only when ${C.IS_PROJECT_EMPTY} is true.`,inputSchema:Ce});function Re(t){return Q({description:Me.description,inputSchema:Ce,agentCodeName:T.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Je,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
155
155
  Page Name: ${e.name}`,e.plan&&`
156
156
  Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const V={[b.SHOW_CODE]:"Open the code panel to review and export current project code.",[b.IMPORT_CODE]:"Open the import code panel to import custom code into the current project.",[b.PAGE_SETTINGS]:"Open current page settings to edit title, slug, and other common HTML head tags.",[b.PREVIEW]:"Open fullscreen preview mode to see the current page rendered."};function ut({isEmail:t}={}){const e={[b.SHOW_CODE]:{description:V[b.SHOW_CODE]},[b.IMPORT_CODE]:{description:V[b.IMPORT_CODE]},[b.PREVIEW]:{description:V[b.PREVIEW]}};return t||(e[b.PAGE_SETTINGS]={description:V[b.PAGE_SETTINGS]}),e}function pt(t={}){const{projectContext:e,skipDefault:n,commands:r={}}=t,o=new Map(Object.entries(n?{}:ut(e)));return Object.entries(r).forEach(([i,s])=>{var p;if(!s)return;const l=i,m=(p=s.description)==null?void 0:p.trim();if(o.get(l)&&!m){o.delete(l);return}m&&o.set(l,{description:m})}),o}function $e(t={}){const e=pt(t),n=Array.from(e.keys());if(!n.length)throw new Error("`createCommandTool` requires at least one command");const r=n,o=`Run one of the available commands. Below the list with commandId and description:
157
157
  `+Array.from(e.entries()).map(([i,s])=>`- ${i}
@@ -151,7 +151,7 @@ Plan: ${e.plan}`,!!e.imageUrls.length&&`
151
151
  Image refs: ${e.imageUrls.join(", ")}`)}],buildResult:()=>({success:!0})},t)}const Ie=i.z.object({name:i.z.string().describe("Name of the new page"),plan:i.z.string().describe(q),imageUrls:i.z.array(i.z.string()).describe(oe)}),De=S({description:"Creates a new page in the project with the full content.",inputSchema:Ie});function _e(t){return x({description:De.description,inputSchema:Ie,agentCodeName:w.ADD_PAGE_CODE,getSystemPrompt:je,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
152
152
  Page Name: ${e.name}`,!!e.imageUrls.length&&`
153
153
  Image refs: ${e.imageUrls.join(", ")}`,e.plan&&`
154
- Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const ve=i.z.object({name:i.z.string().describe("Name of the new page"),plan:i.z.string().describe(q)}),Ae=S({description:`Create a page in empty project with content based on a plan. IMPORTANT: This should be called only when ${M.IS_PROJECT_EMPTY} is true.`,inputSchema:ve});function Ne(t){return x({description:Ae.description,inputSchema:ve,agentCodeName:w.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Le,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
154
+ Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const ve=i.z.object({name:i.z.string().describe("Name of the new page"),plan:i.z.string().describe(q)}),Ae=S({description:`Creates a page in an empty project with content generated based on a plan. IMPORTANT: This should be called only when ${M.IS_PROJECT_EMPTY} is true.`,inputSchema:ve});function Ne(t){return x({description:Ae.description,inputSchema:ve,agentCodeName:w.ADD_PROJECT_PAGE_CODE,getSystemPrompt:Le,buildUserPrompt:(e,n)=>[n,{role:"assistant",content:Y(e.name&&`
155
155
  Page Name: ${e.name}`,e.plan&&`
156
156
  Plan: ${e.plan}`)}],buildResult:e=>({createdPage:e.name})},t)}const F={[b.SHOW_CODE]:"Open the code panel to review and export current project code.",[b.IMPORT_CODE]:"Open the import code panel to import custom code into the current project.",[b.PAGE_SETTINGS]:"Open current page settings to edit title, slug, and other common HTML head tags.",[b.PREVIEW]:"Open fullscreen preview mode to see the current page rendered."};function nt({isEmail:t}={}){const e={[b.SHOW_CODE]:{description:F[b.SHOW_CODE]},[b.IMPORT_CODE]:{description:F[b.IMPORT_CODE]},[b.PREVIEW]:{description:F[b.PREVIEW]}};return t||(e[b.PAGE_SETTINGS]={description:F[b.PAGE_SETTINGS]}),e}function at(t={}){const{projectContext:e,skipDefault:n,commands:s={}}=t,o=new Map(Object.entries(n?{}:nt(e)));return Object.entries(s).forEach(([c,r])=>{var g;if(!r)return;const d=c,u=(g=r.description)==null?void 0:g.trim();if(o.get(d)&&!u){o.delete(d);return}u&&o.set(d,{description:u})}),o}function Ce(t={}){const e=at(t),n=Array.from(e.keys());if(!n.length)throw new Error("`createCommandTool` requires at least one command");const s=n,o=`Run one of the available commands. Below the list with commandId and description:
157
157
  `+Array.from(e.entries()).map(([c,r])=>`- ${c}
@@ -259,7 +259,7 @@ export interface AiChatToolContext {
259
259
  /**
260
260
  * Default tools type
261
261
  */
262
- export type AiChatDefaultToolName = AiChatToolName.REMOVE_COMPONENT | AiChatToolName.MOVE_COMPONENT | AiChatToolName.GET_PAGE_CONTENT | AiChatToolName.LIST_PAGES | AiChatToolName.GENERATE_IMAGE | AiChatToolName.RUN_COMMAND;
262
+ export type AiChatDefaultToolName = AiChatToolName.REMOVE_COMPONENT | AiChatToolName.MOVE_COMPONENT | AiChatToolName.GET_PAGE_CONTENT | AiChatToolName.LIST_PAGES | AiChatToolName.FETCH_WEBSITE | AiChatToolName.GENERATE_IMAGE | AiChatToolName.RUN_COMMAND;
263
263
  export type AiChatDefaultTools = Record<AiChatDefaultToolName, AiChatClientTool>;
264
264
  /**
265
265
  * Custom tools type
@@ -1,5 +1,5 @@
1
- "use strict";const G="app.grapesjs.com",z="app-stage.grapesjs.com",F="app2.grapesjs.com",N="app-stage2.grapesjs.com",D=[G,F,z,N,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],V="license:check:end",X=()=>typeof window<"u",j=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?z:G}`}/${a?"platform-api":"api"}`,$=()=>{const t=X()&&window.location.hostname;return!!t&&(D.includes(t)||D.some(e=>t.endsWith(e)))};async function Y({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||j({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const m=i?new URLSearchParams(i).toString():"",d=m?`?${m}`:"",n=await fetch(`${s}${d}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var b=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(b||{}),P=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(P||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function C(t){const e=t;return e.init=a=>r=>t(r,a),e}const W=t=>C(t);async function _({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o()},m=(n={})=>{var R;const{error:c,sdkLicense:f}=n,h=(R=n.plan)==null?void 0:R.category;if(!(f||n.license)||c)p(c||"Invalid license");else if(h){const E=L[e],M=L[h];E>M&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(P.settings)&&(s=t.runCommand(P.settings),l=(s==null?void 0:s.baseUrl)||"");const d=n=>{i==null||i(n),n&&m(n)};if(!s){t.onReady(async()=>{if(!$())if(r){const n=await K({licenseKey:r,pluginName:a,baseApiUrl:l});d(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=H(s);d(n);return}t.on(V,n=>d(n))}const H=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function K(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await Y({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const q=(...t)=>e=>t.some(a=>e.is(a));var u=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(u||{}),v=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(v||{});const y="animation",I="animation-group",T="animation:update",w="animation-group:update",B={category:{id:"animations",label:"Animations"},select:!0},k=t=>(t==null?void 0:t.getType())===y,A=t=>(t==null?void 0:t.getType())===I,O=t=>k(t)||A(t),x={isVisible:({component:t})=>k(t)},J={isVisible:({component:t})=>A(t)},Q={isVisible:({component:t})=>k(t)&&A(t==null?void 0:t.parent())?!1:O(t)},S={isVisible:({component:t,sector:e})=>{var a;return k(t)&&A(t==null?void 0:t.parent())?!1:O(t)&&((a=e.getProperty(v.onScroll))==null?void 0:a.getValue())==="true"}},Z={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},tt=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{const l=getComputedStyle(e),s=l.getPropertyValue("animation-name").trim(),p=l.getPropertyValue("--animation-on-scroll").trim()!=="false",m=parseFloat(l.getPropertyValue("--animation-threshold").trim())||.2,d=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(f=>{f.isIntersecting&&(n(),!d&&r())})},{threshold:m}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},et=(t,e)=>{const{Components:a,Blocks:r,Canvas:i}=t,{block:o={},animationList:l=[]}=e,s=t.Components.events,p="Animation",m=Object.values(v),d=Object.values(u);return a.addType(y,{block:o?{label:p,media:Z.animation,content:{type:y},...B,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:tt,animationUpdateEvent:T,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
2
- `)},init(){const{em:n}=this;this.addStyle({[u.name]:"fadeIn",[u.duration]:"1s",[u.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||m.forEach(g=>this.removeStyle(g))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(T))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(g=>d.includes(g)||m.includes(g))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),a.removeType(y)}},nt=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),m=p.getPropertyValue(a).trim()!=="false",d=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(f=>{f instanceof HTMLElement&&typeof f.dispatchEvent=="function"&&f.dispatchEvent(new CustomEvent(w,{bubbles:!1}))})};if(!m){c();return}o=new IntersectionObserver(f=>{f.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(g=>{g instanceof HTMLElement&&getComputedStyle(g).getPropertyValue(a).trim()!=="false"&&(g.style.opacity="0",g.style.animationPlayState="paused")})})},{threshold:d}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},at=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(I,{block:i?{label:o,media:Z.animationGroup,content:{type:I,components:[{type:y},{type:y},{type:y}]},...B,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:nt,animationGroupUpdateEvent:w,"script-props":["animationGroupUpdateEvent"],droppable:q(y)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(y)&&l.addStyle({"--stagger-index":s.toString(),[u.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(w))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(I),a.removeType(I)}},ot="animationComponent",it=b.startup,U=[{id:"flash",name:"Flash",css:`@keyframes flash {
1
+ "use strict";const G="app.grapesjs.com",z="app-stage.grapesjs.com",F="app2.grapesjs.com",N="app-stage2.grapesjs.com",D=[G,F,z,N,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],V="license:check:end",X=()=>typeof window<"u",j=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?z:G}`}/${a?"platform-api":"api"}`,$=()=>{if(!X())return"";const{hostname:t}=window.location;if(t)return t;try{return window.parent.location.hostname||""}catch{return""}},C=()=>{const t=$();return!!t&&(D.includes(t)||D.some(e=>t.endsWith(e)))};async function Y({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||j({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const m=i?new URLSearchParams(i).toString():"",d=m?`?${m}`:"",n=await fetch(`${s}${d}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var b=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(b||{}),R=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.openEditCode="studio:openEditCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(R||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function H(t){const e=t;return e.init=a=>r=>t(r,a),e}const W=t=>H(t);async function _({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o()},m=(n={})=>{var A;const{error:c,sdkLicense:f}=n,h=(A=n.plan)==null?void 0:A.category;if(!(f||n.license)||c)p(c||"Invalid license");else if(h){const E=L[e],M=L[h];E>M&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(R.settings)&&(s=t.runCommand(R.settings),l=(s==null?void 0:s.baseUrl)||"");const d=n=>{i==null||i(n),n&&m(n)};if(!s){t.onReady(async()=>{if(!C())if(r){const n=await q({licenseKey:r,pluginName:a,baseApiUrl:l});d(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=K(s);d(n);return}t.on(V,n=>d(n))}const K=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function q(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await Y({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const J=(...t)=>e=>t.some(a=>e.is(a));var u=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(u||{}),v=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(v||{});const y="animation",I="animation-group",T="animation:update",P="animation-group:update",B={category:{id:"animations",label:"Animations"},select:!0},k=t=>(t==null?void 0:t.getType())===y,w=t=>(t==null?void 0:t.getType())===I,O=t=>k(t)||w(t),x={isVisible:({component:t})=>k(t)},Q={isVisible:({component:t})=>w(t)},tt={isVisible:({component:t})=>k(t)&&w(t==null?void 0:t.parent())?!1:O(t)},U={isVisible:({component:t,sector:e})=>{var a;return k(t)&&w(t==null?void 0:t.parent())?!1:O(t)&&((a=e.getProperty(v.onScroll))==null?void 0:a.getValue())==="true"}},Z={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},et=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{const l=getComputedStyle(e),s=l.getPropertyValue("animation-name").trim(),p=l.getPropertyValue("--animation-on-scroll").trim()!=="false",m=parseFloat(l.getPropertyValue("--animation-threshold").trim())||.2,d=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(f=>{f.isIntersecting&&(n(),!d&&r())})},{threshold:m}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},nt=(t,e)=>{const{Components:a,Blocks:r,Canvas:i}=t,{block:o={},animationList:l=[]}=e,s=t.Components.events,p="Animation",m=Object.values(v),d=Object.values(u);return a.addType(y,{block:o?{label:p,media:Z.animation,content:{type:y},...B,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:et,animationUpdateEvent:T,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
2
+ `)},init(){const{em:n}=this;this.addStyle({[u.name]:"fadeIn",[u.duration]:"1s",[u.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||m.forEach(g=>this.removeStyle(g))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(T))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(g=>d.includes(g)||m.includes(g))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),a.removeType(y)}},at=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),m=p.getPropertyValue(a).trim()!=="false",d=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(f=>{f instanceof HTMLElement&&typeof f.dispatchEvent=="function"&&f.dispatchEvent(new CustomEvent(P,{bubbles:!1}))})};if(!m){c();return}o=new IntersectionObserver(f=>{f.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(g=>{g instanceof HTMLElement&&getComputedStyle(g).getPropertyValue(a).trim()!=="false"&&(g.style.opacity="0",g.style.animationPlayState="paused")})})},{threshold:d}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},ot=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(I,{block:i?{label:o,media:Z.animationGroup,content:{type:I,components:[{type:y},{type:y},{type:y}]},...B,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:at,animationGroupUpdateEvent:P,"script-props":["animationGroupUpdateEvent"],droppable:J(y)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(y)&&l.addStyle({"--stagger-index":s.toString(),[u.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(P))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(I),a.removeType(I)}},it="animationComponent",st=b.startup,S=[{id:"flash",name:"Flash",css:`@keyframes flash {
3
3
  0%, 50%, to {
4
4
  opacity:1
5
5
  }
@@ -516,4 +516,4 @@
516
516
  transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0);
517
517
  animation-timing-function:cubic-bezier(.175, .885, .32, 1)
518
518
  }
519
- }`}],st=function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:U}))||U,r=[et(t,{...e,animationList:a}),at(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...x,name:"Type",property:u.name,type:"select",full:!0,default:"fadeIn",options:a},{...x,name:"Duration",property:u.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...x,name:"Delay",property:u.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...x,name:"Iteration Count",property:u.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...x,name:"Timing",property:u.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...J,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...Q,name:"Animate on Scroll",property:v.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...S,name:"Scroll Threshold",property:v.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...S,name:"Repeat on Scroll",property:v.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),_({editor:t,licenseKey:e.licenseKey,plan:it,pluginName:ot,cleanup:()=>{r.forEach(o=>o())}})},rt=W(st);module.exports=rt;
519
+ }`}],rt=function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:S}))||S,r=[nt(t,{...e,animationList:a}),ot(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...x,name:"Type",property:u.name,type:"select",full:!0,default:"fadeIn",options:a},{...x,name:"Duration",property:u.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...x,name:"Delay",property:u.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...x,name:"Iteration Count",property:u.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...x,name:"Timing",property:u.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...Q,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...tt,name:"Animate on Scroll",property:v.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...U,name:"Scroll Threshold",property:v.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...U,name:"Repeat on Scroll",property:v.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),_({editor:t,licenseKey:e.licenseKey,plan:st,pluginName:it,cleanup:()=>{r.forEach(o=>o())}})},lt=W(rt);module.exports=lt;
@@ -9,14 +9,27 @@ const G = "app.grapesjs.com", z = "app-stage.grapesjs.com", F = "app2.grapesjs.c
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
+ ".claudemcpcontent.com",
15
+ // For Claude mcp app
16
+ ".web-sandbox.oaiusercontent.com"
17
+ // For OpenAI mcp app
14
18
  ], V = "license:check:end", X = () => typeof window < "u", j = ({
15
19
  isDev: t,
16
20
  isStage: e,
17
21
  isPlatform: a
18
22
  }) => `${t ? "" : `https://${e ? z : G}`}/${a ? "platform-api" : "api"}`, $ = () => {
19
- const t = X() && window.location.hostname;
23
+ if (!X()) return "";
24
+ const { hostname: t } = window.location;
25
+ if (t) return t;
26
+ try {
27
+ return window.parent.location.hostname || "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }, C = () => {
32
+ const t = $();
20
33
  return !!t && (D.includes(t) || D.some((e) => t.endsWith(e)));
21
34
  };
22
35
  async function Y({
@@ -40,18 +53,18 @@ async function Y({
40
53
  throw new Error(`HTTP error! status: ${n.status}`);
41
54
  return n.json();
42
55
  }
43
- var b = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(b || {}), P = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", t.dialogExportCode = "studio:dialogExportCode", t.dialogImportCode = "studio:dialogImportCode", t.sidebarLeftSet = "studio:sidebarLeft:set", t.sidebarLeftGet = "studio:sidebarLeft:get", t.sidebarLeftToggle = "studio:sidebarLeft:toggle", t.sidebarRightSet = "studio:sidebarRight:set", t.sidebarRightGet = "studio:sidebarRight:get", t.sidebarRightToggle = "studio:sidebarRight:toggle", t.sidebarTopSet = "studio:sidebarTop:set", t.sidebarTopGet = "studio:sidebarTop:get", t.sidebarTopToggle = "studio:sidebarTop:toggle", t.sidebarBottomSet = "studio:sidebarBottom:set", t.sidebarBottomGet = "studio:sidebarBottom:get", t.sidebarBottomToggle = "studio:sidebarBottom:toggle", t.symbolAdd = "studio:symbolAdd", t.symbolDetach = "studio:symbolDetach", t.symbolOverride = "studio:symbolOverride", t.symbolPropagateStyles = "studio:propagateStyles", t.getPagesConfig = "studio:getPagesConfig", t.setPagesConfig = "studio:setPagesConfig", t.getPageSettings = "studio:getPageSettings", t.setPageSettings = "studio:setPageSettings", t.clearPage = "studio:clearPage", t.projectFiles = "studio:projectFiles", t.validateCode = "studio:validateCode", t.canvasReload = "studio:canvasReload", t.getBlocksPanel = "studio:getBlocksPanel", t.setBlocksPanel = "studio:setBlocksPanel", t.getStateContextMenu = "studio:getStateContextMenu", t.setStateContextMenu = "studio:setStateContextMenu", t.contextMenuComponent = "studio:contextMenuComponent", t.layoutAdd = "studio:layoutAdd", t.layoutRemove = "studio:layoutRemove", t.layoutToggle = "studio:layoutToggle", t.layoutUpdate = "studio:layoutUpdate", t.layoutGet = "studio:layoutGet", t.layoutConfigGet = "studio:layoutConfigGet", t.layoutConfigSet = "studio:layoutConfigSet", t.layoutComponentAdd = "studio:layoutComponentAdd", t.layoutComponentGet = "studio:layoutComponentGet", t.layoutComponentRemove = "studio:layoutComponentRemove", t.layoutComponentRender = "studio:layoutComponentRender", t.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", t.settings = "studio:settings", t.assetProviderGet = "studio:assetProviderGet", t.assetProviderAdd = "studio:assetProviderAdd", t.assetProviderRemove = "studio:assetProviderRemove", t.fontGet = "studio:fontGet", t.fontAdd = "studio:fontAdd", t.fontRemove = "studio:fontRemove", t.fontManagerOpen = "studio:fontManagerOpen", t.menuFontLoad = "studio:menuFontLoad", t.toggleStateDataSource = "studio:toggleStateDataSource", t.getStateDataSource = "studio:getStateDataSource", t.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", t.dataSourceSetImporter = "studio:dataSourceSetImporter", t.dataSourceSetExporter = "studio:dataSourceSetExporter", t.setDragAbsolute = "studio:setDragAbsolute", t))(P || {});
56
+ var b = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(b || {}), R = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", t.dialogExportCode = "studio:dialogExportCode", t.dialogImportCode = "studio:dialogImportCode", t.openEditCode = "studio:openEditCode", t.sidebarLeftSet = "studio:sidebarLeft:set", t.sidebarLeftGet = "studio:sidebarLeft:get", t.sidebarLeftToggle = "studio:sidebarLeft:toggle", t.sidebarRightSet = "studio:sidebarRight:set", t.sidebarRightGet = "studio:sidebarRight:get", t.sidebarRightToggle = "studio:sidebarRight:toggle", t.sidebarTopSet = "studio:sidebarTop:set", t.sidebarTopGet = "studio:sidebarTop:get", t.sidebarTopToggle = "studio:sidebarTop:toggle", t.sidebarBottomSet = "studio:sidebarBottom:set", t.sidebarBottomGet = "studio:sidebarBottom:get", t.sidebarBottomToggle = "studio:sidebarBottom:toggle", t.symbolAdd = "studio:symbolAdd", t.symbolDetach = "studio:symbolDetach", t.symbolOverride = "studio:symbolOverride", t.symbolPropagateStyles = "studio:propagateStyles", t.getPagesConfig = "studio:getPagesConfig", t.setPagesConfig = "studio:setPagesConfig", t.getPageSettings = "studio:getPageSettings", t.setPageSettings = "studio:setPageSettings", t.clearPage = "studio:clearPage", t.projectFiles = "studio:projectFiles", t.validateCode = "studio:validateCode", t.canvasReload = "studio:canvasReload", t.getBlocksPanel = "studio:getBlocksPanel", t.setBlocksPanel = "studio:setBlocksPanel", t.getStateContextMenu = "studio:getStateContextMenu", t.setStateContextMenu = "studio:setStateContextMenu", t.contextMenuComponent = "studio:contextMenuComponent", t.layoutAdd = "studio:layoutAdd", t.layoutRemove = "studio:layoutRemove", t.layoutToggle = "studio:layoutToggle", t.layoutUpdate = "studio:layoutUpdate", t.layoutGet = "studio:layoutGet", t.layoutConfigGet = "studio:layoutConfigGet", t.layoutConfigSet = "studio:layoutConfigSet", t.layoutComponentAdd = "studio:layoutComponentAdd", t.layoutComponentGet = "studio:layoutComponentGet", t.layoutComponentRemove = "studio:layoutComponentRemove", t.layoutComponentRender = "studio:layoutComponentRender", t.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", t.settings = "studio:settings", t.assetProviderGet = "studio:assetProviderGet", t.assetProviderAdd = "studio:assetProviderAdd", t.assetProviderRemove = "studio:assetProviderRemove", t.fontGet = "studio:fontGet", t.fontAdd = "studio:fontAdd", t.fontRemove = "studio:fontRemove", t.fontManagerOpen = "studio:fontManagerOpen", t.menuFontLoad = "studio:menuFontLoad", t.toggleStateDataSource = "studio:toggleStateDataSource", t.getStateDataSource = "studio:getStateDataSource", t.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", t.dataSourceSetImporter = "studio:dataSourceSetImporter", t.dataSourceSetExporter = "studio:dataSourceSetExporter", t.setDragAbsolute = "studio:setDragAbsolute", t))(R || {});
44
57
  const L = {
45
58
  [b.free]: 0,
46
59
  [b.startup]: 10,
47
60
  [b.business]: 20,
48
61
  [b.enterprise]: 30
49
62
  };
50
- function C(t) {
63
+ function H(t) {
51
64
  const e = t;
52
65
  return e.init = (a) => (r) => t(r, a), e;
53
66
  }
54
- const W = (t) => /* @__PURE__ */ C(t);
67
+ const W = (t) => /* @__PURE__ */ H(t);
55
68
  async function _({
56
69
  editor: t,
57
70
  plan: e,
@@ -64,8 +77,8 @@ async function _({
64
77
  const p = (n) => {
65
78
  console.warn("Cleanup plugin:", a, "Reason:", n), o();
66
79
  }, m = (n = {}) => {
67
- var R;
68
- const { error: c, sdkLicense: f } = n, h = (R = n.plan) == null ? void 0 : R.category;
80
+ var A;
81
+ const { error: c, sdkLicense: f } = n, h = (A = n.plan) == null ? void 0 : A.category;
69
82
  if (!(f || n.license) || c)
70
83
  p(c || "Invalid license");
71
84
  else if (h) {
@@ -73,15 +86,15 @@ async function _({
73
86
  E > M && p({ pluginRequiredPlan: e, licensePlan: h });
74
87
  }
75
88
  };
76
- t.Commands.has(P.settings) && (s = t.runCommand(P.settings), l = (s == null ? void 0 : s.baseUrl) || "");
89
+ t.Commands.has(R.settings) && (s = t.runCommand(R.settings), l = (s == null ? void 0 : s.baseUrl) || "");
77
90
  const d = (n) => {
78
91
  i == null || i(n), n && m(n);
79
92
  };
80
93
  if (!s) {
81
94
  t.onReady(async () => {
82
- if (!$())
95
+ if (!C())
83
96
  if (r) {
84
- const n = await K({ licenseKey: r, pluginName: a, baseApiUrl: l });
97
+ const n = await q({ licenseKey: r, pluginName: a, baseApiUrl: l });
85
98
  d(n);
86
99
  } else
87
100
  p("The `licenseKey` option not provided");
@@ -89,19 +102,19 @@ async function _({
89
102
  return;
90
103
  }
91
104
  if (s.licensePlan || s.licenseError) {
92
- const n = H(s);
105
+ const n = K(s);
93
106
  d(n);
94
107
  return;
95
108
  }
96
109
  t.on(V, (n) => d(n));
97
110
  }
98
- const H = (t) => ({
111
+ const K = (t) => ({
99
112
  sdkLicense: t.license,
100
113
  license: t.license,
101
114
  error: t.licenseError,
102
115
  plan: t.licensePlan
103
116
  });
104
- async function K(t) {
117
+ async function q(t) {
105
118
  const { licenseKey: e, pluginName: a, baseApiUrl: r } = t;
106
119
  try {
107
120
  return (await Y({
@@ -117,26 +130,26 @@ async function K(t) {
117
130
  return console.error("Error during SDK license check:", i), !1;
118
131
  }
119
132
  }
120
- const q = (...t) => (e) => t.some((a) => e.is(a));
133
+ const J = (...t) => (e) => t.some((a) => e.is(a));
121
134
  var u = /* @__PURE__ */ ((t) => (t.name = "animation-name", t.duration = "animation-duration", t.delay = "animation-delay", t.iterationCount = "animation-iteration-count", t.timingFunction = "animation-timing-function", t.fillMode = "animation-fill-mode", t))(u || {}), v = /* @__PURE__ */ ((t) => (t.onScroll = "--animation-on-scroll", t.threshold = "--animation-threshold", t.repeat = "--animation-repeat", t))(v || {});
122
- const y = "animation", I = "animation-group", T = "animation:update", w = "animation-group:update", B = {
135
+ const y = "animation", I = "animation-group", T = "animation:update", P = "animation-group:update", B = {
123
136
  category: { id: "animations", label: "Animations" },
124
137
  select: !0
125
- }, k = (t) => (t == null ? void 0 : t.getType()) === y, A = (t) => (t == null ? void 0 : t.getType()) === I, O = (t) => k(t) || A(t), x = {
138
+ }, k = (t) => (t == null ? void 0 : t.getType()) === y, w = (t) => (t == null ? void 0 : t.getType()) === I, O = (t) => k(t) || w(t), x = {
126
139
  isVisible: ({ component: t }) => k(t)
127
- }, J = {
128
- isVisible: ({ component: t }) => A(t)
129
140
  }, Q = {
130
- isVisible: ({ component: t }) => k(t) && A(t == null ? void 0 : t.parent()) ? !1 : O(t)
131
- }, S = {
141
+ isVisible: ({ component: t }) => w(t)
142
+ }, tt = {
143
+ isVisible: ({ component: t }) => k(t) && w(t == null ? void 0 : t.parent()) ? !1 : O(t)
144
+ }, U = {
132
145
  isVisible: ({ component: t, sector: e }) => {
133
146
  var a;
134
- return k(t) && A(t == null ? void 0 : t.parent()) ? !1 : O(t) && ((a = e.getProperty(v.onScroll)) == null ? void 0 : a.getValue()) === "true";
147
+ return k(t) && w(t == null ? void 0 : t.parent()) ? !1 : O(t) && ((a = e.getProperty(v.onScroll)) == null ? void 0 : a.getValue()) === "true";
135
148
  }
136
149
  }, Z = {
137
150
  animation: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',
138
151
  animationGroup: '<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'
139
- }, tt = function(t) {
152
+ }, et = function(t) {
140
153
  const e = this;
141
154
  let a = null;
142
155
  const r = () => {
@@ -167,7 +180,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
167
180
  });
168
181
  };
169
182
  e.addEventListener(t.animationUpdateEvent, i), i();
170
- }, et = (t, e) => {
183
+ }, nt = (t, e) => {
171
184
  const { Components: a, Blocks: r, Canvas: i } = t, { block: o = {}, animationList: l = [] } = e, s = t.Components.events, p = "Animation", m = Object.values(v), d = Object.values(u);
172
185
  return a.addType(y, {
173
186
  block: o ? {
@@ -182,7 +195,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
182
195
  emptyState: !0,
183
196
  name: p,
184
197
  traits: [],
185
- script: tt,
198
+ script: et,
186
199
  animationUpdateEvent: T,
187
200
  "script-props": ["animationUpdateEvent"],
188
201
  styles: l.map((n) => n.css).join(`
@@ -235,7 +248,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
235
248
  }), () => {
236
249
  r.remove(y), a.removeType(y);
237
250
  };
238
- }, nt = function(t) {
251
+ }, at = function(t) {
239
252
  const e = this, a = "--animation-on-scroll", r = "--animation-threshold", i = "--animation-repeat";
240
253
  let o = null;
241
254
  const l = () => {
@@ -244,7 +257,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
244
257
  l();
245
258
  const p = getComputedStyle(e), m = p.getPropertyValue(a).trim() !== "false", d = parseFloat(p.getPropertyValue(r).trim()) || 0.2, n = p.getPropertyValue(i).trim() === "true", c = () => {
246
259
  Array.from(e.children).forEach((f) => {
247
- f instanceof HTMLElement && typeof f.dispatchEvent == "function" && f.dispatchEvent(new CustomEvent(w, { bubbles: !1 }));
260
+ f instanceof HTMLElement && typeof f.dispatchEvent == "function" && f.dispatchEvent(new CustomEvent(P, { bubbles: !1 }));
248
261
  });
249
262
  };
250
263
  if (!m) {
@@ -263,7 +276,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
263
276
  ), o.observe(e);
264
277
  };
265
278
  e.addEventListener(t.animationGroupUpdateEvent, s), s();
266
- }, at = (t, e) => {
279
+ }, ot = (t, e) => {
267
280
  const { Components: a, Blocks: r } = t, { blockGroup: i = {} } = e, o = "Animation Group";
268
281
  return a.addType(I, {
269
282
  block: i ? {
@@ -285,10 +298,10 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
285
298
  name: o,
286
299
  emptyState: !0,
287
300
  traits: [],
288
- script: nt,
289
- animationGroupUpdateEvent: w,
301
+ script: at,
302
+ animationGroupUpdateEvent: P,
290
303
  "script-props": ["animationGroupUpdateEvent"],
291
- droppable: q(y)
304
+ droppable: J(y)
292
305
  },
293
306
  init() {
294
307
  this.addStyle({
@@ -316,7 +329,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
316
329
  this.listenTo(l, "component:styleUpdate", this.handleStyleChange);
317
330
  },
318
331
  triggerAnimation() {
319
- this.el.dispatchEvent(new CustomEvent(w));
332
+ this.el.dispatchEvent(new CustomEvent(P));
320
333
  },
321
334
  handleStyleChange() {
322
335
  this.triggerAnimation(), this.model.updateChildrenStaggerStyles();
@@ -328,7 +341,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
328
341
  }), () => {
329
342
  r.remove(I), a.removeType(I);
330
343
  };
331
- }, ot = "animationComponent", it = b.startup, U = [
344
+ }, it = "animationComponent", st = b.startup, S = [
332
345
  {
333
346
  id: "flash",
334
347
  name: "Flash",
@@ -1006,11 +1019,11 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1006
1019
  }
1007
1020
  }`
1008
1021
  }
1009
- ], st = function(t, e = {}) {
1022
+ ], rt = function(t, e = {}) {
1010
1023
  var i;
1011
- const a = ((i = e.animations) == null ? void 0 : i.call(e, { items: U })) || U, r = [
1012
- et(t, { ...e, animationList: a }),
1013
- at(t, e)
1024
+ const a = ((i = e.animations) == null ? void 0 : i.call(e, { items: S })) || S, r = [
1025
+ nt(t, { ...e, animationList: a }),
1026
+ ot(t, e)
1014
1027
  ];
1015
1028
  t.Styles.addSector("animation", {
1016
1029
  name: "Animation",
@@ -1072,7 +1085,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1072
1085
  ]
1073
1086
  },
1074
1087
  {
1075
- ...J,
1088
+ ...Q,
1076
1089
  name: "Stagger Delay",
1077
1090
  property: "--stagger-delay",
1078
1091
  type: "slider",
@@ -1083,7 +1096,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1083
1096
  default: "0.3s"
1084
1097
  },
1085
1098
  {
1086
- ...Q,
1099
+ ...tt,
1087
1100
  name: "Animate on Scroll",
1088
1101
  property: v.onScroll,
1089
1102
  type: "radio",
@@ -1100,7 +1113,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1100
1113
  ]
1101
1114
  },
1102
1115
  {
1103
- ...S,
1116
+ ...U,
1104
1117
  name: "Scroll Threshold",
1105
1118
  property: v.threshold,
1106
1119
  type: "number",
@@ -1111,7 +1124,7 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1111
1124
  default: "0.2"
1112
1125
  },
1113
1126
  {
1114
- ...S,
1127
+ ...U,
1115
1128
  name: "Repeat on Scroll",
1116
1129
  property: v.repeat,
1117
1130
  type: "radio",
@@ -1131,13 +1144,13 @@ const y = "animation", I = "animation-group", T = "animation:update", w = "anima
1131
1144
  }), _({
1132
1145
  editor: t,
1133
1146
  licenseKey: e.licenseKey,
1134
- plan: it,
1135
- pluginName: ot,
1147
+ plan: st,
1148
+ pluginName: it,
1136
1149
  cleanup: () => {
1137
1150
  r.forEach((o) => o());
1138
1151
  }
1139
1152
  });
1140
- }, rt = W(st);
1153
+ }, lt = W(rt);
1141
1154
  export {
1142
- rt as default
1155
+ lt as default
1143
1156
  };
@@ -1,5 +1,5 @@
1
- (function(b,I){typeof exports=="object"&&typeof module<"u"?module.exports=I():typeof define=="function"&&define.amd?define(I):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_animationComponent=I())})(this,function(){"use strict";const b="app.grapesjs.com",I="app-stage.grapesjs.com",T=[b,"app2.grapesjs.com",I,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],M="license:check:end",N=()=>typeof window<"u",F=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?I:b}`}/${a?"platform-api":"api"}`,V=()=>{const t=N()&&window.location.hostname;return!!t&&(T.includes(t)||T.some(e=>t.endsWith(e)))};async function X({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||F({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const d=i?new URLSearchParams(i).toString():"",f=d?`?${d}`:"",n=await fetch(`${s}${f}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var v=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(v||{}),w=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(w||{});const S={[v.free]:0,[v.startup]:10,[v.business]:20,[v.enterprise]:30};function j(t){const e=t;return e.init=a=>r=>t(r,a),e}const _=t=>j(t);async function $({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o()},d=(n={})=>{var E;const{error:c,sdkLicense:u}=n,h=(E=n.plan)==null?void 0:E.category;if(!(u||n.license)||c)p(c||"Invalid license");else if(h){const Z=S[e],at=S[h];Z>at&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(w.settings)&&(s=t.runCommand(w.settings),l=(s==null?void 0:s.baseUrl)||"");const f=n=>{i==null||i(n),n&&d(n)};if(!s){t.onReady(async()=>{if(!V())if(r){const n=await Y({licenseKey:r,pluginName:a,baseApiUrl:l});f(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=C(s);f(n);return}t.on(M,n=>f(n))}const C=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function Y(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await X({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const W=(...t)=>e=>t.some(a=>e.is(a));var m=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(m||{}),x=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(x||{});const g="animation",A="animation-group",L="animation:update",D="animation-group:update",U={category:{id:"animations",label:"Animations"},select:!0},P=t=>(t==null?void 0:t.getType())===g,R=t=>(t==null?void 0:t.getType())===A,G=t=>P(t)||R(t),k={isVisible:({component:t})=>P(t)},H={isVisible:({component:t})=>R(t)},K={isVisible:({component:t})=>P(t)&&R(t==null?void 0:t.parent())?!1:G(t)},O={isVisible:({component:t,sector:e})=>{var a;return P(t)&&R(t==null?void 0:t.parent())?!1:G(t)&&((a=e.getProperty(x.onScroll))==null?void 0:a.getValue())==="true"}},z={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},q=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{const l=getComputedStyle(e),s=l.getPropertyValue("animation-name").trim(),p=l.getPropertyValue("--animation-on-scroll").trim()!=="false",d=parseFloat(l.getPropertyValue("--animation-threshold").trim())||.2,f=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(u=>{u.isIntersecting&&(n(),!f&&r())})},{threshold:d}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},J=(t,e)=>{const{Components:a,Blocks:r,Canvas:i}=t,{block:o={},animationList:l=[]}=e,s=t.Components.events,p="Animation",d=Object.values(x),f=Object.values(m);return a.addType(g,{block:o?{label:p,media:z.animation,content:{type:g},...U,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:q,animationUpdateEvent:L,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
2
- `)},init(){const{em:n}=this;this.addStyle({[m.name]:"fadeIn",[m.duration]:"1s",[m.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==A||d.forEach(y=>this.removeStyle(y))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(L))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(y=>f.includes(y)||d.includes(y))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(g),a.removeType(g)}},Q=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),d=p.getPropertyValue(a).trim()!=="false",f=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(u=>{u instanceof HTMLElement&&typeof u.dispatchEvent=="function"&&u.dispatchEvent(new CustomEvent(D,{bubbles:!1}))})};if(!d){c();return}o=new IntersectionObserver(u=>{u.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(y=>{y instanceof HTMLElement&&getComputedStyle(y).getPropertyValue(a).trim()!=="false"&&(y.style.opacity="0",y.style.animationPlayState="paused")})})},{threshold:f}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},tt=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(A,{block:i?{label:o,media:z.animationGroup,content:{type:A,components:[{type:g},{type:g},{type:g}]},...U,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:Q,animationGroupUpdateEvent:D,"script-props":["animationGroupUpdateEvent"],droppable:W(g)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(g)&&l.addStyle({"--stagger-index":s.toString(),[m.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(D))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(A),a.removeType(A)}},et="animationComponent",nt=v.startup,B=[{id:"flash",name:"Flash",css:`@keyframes flash {
1
+ (function(b,I){typeof exports=="object"&&typeof module<"u"?module.exports=I():typeof define=="function"&&define.amd?define(I):(b=typeof globalThis<"u"?globalThis:b||self,b.StudioSdkPlugins_animationComponent=I())})(this,function(){"use strict";const b="app.grapesjs.com",I="app-stage.grapesjs.com",T=[b,"app2.grapesjs.com",I,"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"],M="license:check:end",N=()=>typeof window<"u",F=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?I:b}`}/${a?"platform-api":"api"}`,V=()=>{if(!N())return"";const{hostname:t}=window.location;if(t)return t;try{return window.parent.location.hostname||""}catch{return""}},X=()=>{const t=V();return!!t&&(T.includes(t)||T.some(e=>t.endsWith(e)))};async function j({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||F({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const d=i?new URLSearchParams(i).toString():"",f=d?`?${d}`:"",n=await fetch(`${s}${f}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var v=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(v||{}),w=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.openEditCode="studio:openEditCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.settings="studio:settings",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(w||{});const L={[v.free]:0,[v.startup]:10,[v.business]:20,[v.enterprise]:30};function _(t){const e=t;return e.init=a=>r=>t(r,a),e}const C=t=>_(t);async function $({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o()},d=(n={})=>{var D;const{error:c,sdkLicense:u}=n,h=(D=n.plan)==null?void 0:D.category;if(!(u||n.license)||c)p(c||"Invalid license");else if(h){const Z=L[e],ot=L[h];Z>ot&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(w.settings)&&(s=t.runCommand(w.settings),l=(s==null?void 0:s.baseUrl)||"");const f=n=>{i==null||i(n),n&&d(n)};if(!s){t.onReady(async()=>{if(!X())if(r){const n=await H({licenseKey:r,pluginName:a,baseApiUrl:l});f(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=Y(s);f(n);return}t.on(M,n=>f(n))}const Y=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function H(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await j({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const W=(...t)=>e=>t.some(a=>e.is(a));var m=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.iterationCount="animation-iteration-count",t.timingFunction="animation-timing-function",t.fillMode="animation-fill-mode",t))(m||{}),x=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(x||{});const g="animation",A="animation-group",S="animation:update",E="animation-group:update",U={category:{id:"animations",label:"Animations"},select:!0},P=t=>(t==null?void 0:t.getType())===g,R=t=>(t==null?void 0:t.getType())===A,G=t=>P(t)||R(t),k={isVisible:({component:t})=>P(t)},K={isVisible:({component:t})=>R(t)},q={isVisible:({component:t})=>P(t)&&R(t==null?void 0:t.parent())?!1:G(t)},O={isVisible:({component:t,sector:e})=>{var a;return P(t)&&R(t==null?void 0:t.parent())?!1:G(t)&&((a=e.getProperty(x.onScroll))==null?void 0:a.getValue())==="true"}},z={animation:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',animationGroup:'<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'},J=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{const l=getComputedStyle(e),s=l.getPropertyValue("animation-name").trim(),p=l.getPropertyValue("--animation-on-scroll").trim()!=="false",d=parseFloat(l.getPropertyValue("--animation-threshold").trim())||.2,f=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(u=>{u.isIntersecting&&(n(),!f&&r())})},{threshold:d}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},Q=(t,e)=>{const{Components:a,Blocks:r,Canvas:i}=t,{block:o={},animationList:l=[]}=e,s=t.Components.events,p="Animation",d=Object.values(x),f=Object.values(m);return a.addType(g,{block:o?{label:p,media:z.animation,content:{type:g},...U,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:J,animationUpdateEvent:S,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
2
+ `)},init(){const{em:n}=this;this.addStyle({[m.name]:"fadeIn",[m.duration]:"1s",[m.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==A||d.forEach(y=>this.removeStyle(y))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(S))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(y=>f.includes(y)||d.includes(y))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(g),a.removeType(g)}},tt=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),d=p.getPropertyValue(a).trim()!=="false",f=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(u=>{u instanceof HTMLElement&&typeof u.dispatchEvent=="function"&&u.dispatchEvent(new CustomEvent(E,{bubbles:!1}))})};if(!d){c();return}o=new IntersectionObserver(u=>{u.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(y=>{y instanceof HTMLElement&&getComputedStyle(y).getPropertyValue(a).trim()!=="false"&&(y.style.opacity="0",y.style.animationPlayState="paused")})})},{threshold:f}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},et=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(A,{block:i?{label:o,media:z.animationGroup,content:{type:A,components:[{type:g},{type:g},{type:g}]},...U,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:tt,animationGroupUpdateEvent:E,"script-props":["animationGroupUpdateEvent"],droppable:W(g)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(g)&&l.addStyle({"--stagger-index":s.toString(),[m.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(E))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(A),a.removeType(A)}},nt="animationComponent",at=v.startup,B=[{id:"flash",name:"Flash",css:`@keyframes flash {
3
3
  0%, 50%, to {
4
4
  opacity:1
5
5
  }
@@ -516,4 +516,4 @@
516
516
  transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0);
517
517
  animation-timing-function:cubic-bezier(.175, .885, .32, 1)
518
518
  }
519
- }`}];return _(function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:B}))||B,r=[J(t,{...e,animationList:a}),tt(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...k,name:"Type",property:m.name,type:"select",full:!0,default:"fadeIn",options:a},{...k,name:"Duration",property:m.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...k,name:"Delay",property:m.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...k,name:"Iteration Count",property:m.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...k,name:"Timing",property:m.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...H,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...K,name:"Animate on Scroll",property:x.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...O,name:"Scroll Threshold",property:x.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...O,name:"Repeat on Scroll",property:x.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),$({editor:t,licenseKey:e.licenseKey,plan:nt,pluginName:et,cleanup:()=>{r.forEach(o=>o())}})})});
519
+ }`}];return C(function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:B}))||B,r=[Q(t,{...e,animationList:a}),et(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...k,name:"Type",property:m.name,type:"select",full:!0,default:"fadeIn",options:a},{...k,name:"Duration",property:m.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...k,name:"Delay",property:m.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...k,name:"Iteration Count",property:m.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...k,name:"Timing",property:m.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...K,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...q,name:"Animate on Scroll",property:x.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...O,name:"Scroll Threshold",property:x.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...O,name:"Repeat on Scroll",property:x.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),$({editor:t,licenseKey:e.licenseKey,plan:at,pluginName:nt,cleanup:()=>{r.forEach(o=>o())}})})});