'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Head=require("next/head"),useCSSCode=require("../hooks/useCSSCode.js"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js");const CSSCode=({setting:e,style:s,advanced:r,builderAttrs:t,builderProps:a,children:i})=>{let{editorData:l}=r,{handleDoubleClickCustomCode:d,htmlPlainText:m,mode:n}=useCSSCode.default(r,e),u=system.createStyle(styles.getCodeStyle(s,e,!1)),o=system.createClass(classes.getCodeClasses(a?.uid,"edit"!==n&&!l?.html,r?.cssClass));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Head,{children:!!e?.preloadBgImage&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!!e?.background?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.desktop.image.src,as:"image"}),!!e?.background?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.tablet.image.src,as:"image"}),!!e?.background?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:e.background.mobile.image.src,as:"image"})]})}),jsxRuntime.jsxs("div",{onClick:d,"aria-hidden":"true",style:u,...t,className:o,children:[jsxRuntime.jsx("div",{dangerouslySetInnerHTML:{__html:m||""}}),i]})]})};exports.default=CSSCode;
