'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),dynamic=require("next/dynamic"),Script=require("next/script"),helpers=require("../common/helpers.js");const KlaviyoSampleContent=dynamic(()=>Promise.resolve().then(function(){return require("./Klaviyo/KlaviyoSampleContent.js")})),InstantKlaviyo=({setting:e,styles:r,builderAttrs:t,style:i})=>{let{klaviyoCodes:o,background:s}=e??{},l=core.useEditorMode(),n=()=>{let e=helpers.getKlaviyoFormCode(o?.formCode||"");return o?.isEmbed&&o?.formCode&&"edit"!==l&&e};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["edit"!==l&&helpers.getKlaviyoCode(o?.klaviyoCode||"")&&jsxRuntime.jsx(Script,{strategy:"lazyOnload",src:helpers.getKlaviyoScriptUri(helpers.getKlaviyoCode(o?.klaviyoCode||"")),defer:!0}),jsxRuntime.jsxs("div",{...t,style:{...i,...core.makeStyleResponsive("ta",r?.align),...core.getStyleBackgroundByDevice(s)},className:"gp-h-full gp-w-full",children:[n()&&jsxRuntime.jsx("div",{className:helpers.getKlaviyoFormCode(o?.formCode||"")}),"edit"===l&&jsxRuntime.jsx(KlaviyoSampleContent,{style:r})]})]})};exports.default=InstantKlaviyo;
