'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers=require("../common/helpers.js");const Text=React.forwardRef(({styles:e,builderAttrs:s,style:t,setting:r,advanced:a,builderProps:l,className:c,children:y,disableEdit:m,pageContext:n,...i},o)=>{let{isEditMode:u,isPreviewSharePageMode:x}=core.useRenderMode(),{htmlTag:d="div",options:g}=r??{},j=system.createAttr({...attrs.getAttr({uid:l?.uid||""})}),p=system.createAttr({...attrs.getTextAttr(g)}),R=system.createStyleReact({...styles.getStyle(e,t)}),C=system.createStyleReact({...styles.getContainerStyle(e,r)}),q=system.createStyleReact({...styles.getTextStyle({styles:e,setting:r,builderProps:l,pageContext:n??{}})}),S=system.createClass({...classes.getClasses({setting:r,advanced:a,builderProps:l})}),T=system.createClass({...classes.getContainerClasses({setting:r})}),f=system.createClass({...classes.getTextClasses({styles:e,setting:r,className:c,isEdit:u||x,disableEdit:m})}),h=helpers.getDisplayText({type:"React",styles:e,setting:r,builderProps:l,pageContext:n??{}}),v=system.createContent(h);return jsxRuntime.jsxs("div",{...j,...i,...s,style:R,className:S,children:[jsxRuntime.jsx("div",{className:T,style:{...C},children:jsxRuntime.jsx(d,{ref:o,...p,className:f,onDragStart:e=>e.preventDefault(),onDrop:e=>e.preventDefault(),style:{...q},dangerouslySetInnerHTML:{__html:v}})}),y]})});exports.default=Text;
