'use client';
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRenderMode as r}from"@gem-sdk/core";import{forwardRef as m}from"react";import{createAttr as o,createStyleReact as s,createClass as a,createContent as l}from"@gem-sdk/system";import{getAttr as i,getTextAttr as n}from"../common/attrs.js";import{getStyle as p,getContainerStyle as c,getTextStyle as d}from"../common/styles.js";import{getClasses as f,getContainerClasses as u,getTextClasses as g}from"../common/classes.js";import{getDisplayText as y}from"../common/helpers.js";let Text=m(({styles:m,builderAttrs:x,style:h,setting:j,advanced:v,builderProps:D,className:T,children:N,disableEdit:k,pageContext:C,...S},_)=>{let{isEditMode:E,isPreviewSharePageMode:H}=r(),{htmlTag:I="div",options:L}=j??{},M=o({...i({uid:D?.uid||""})}),R=o({...n(L)}),b=s({...p(m,h)}),q=s({...c(m,j)}),w=s({...d({styles:m,setting:j,builderProps:D,pageContext:C??{}})}),z=a({...f({setting:j,advanced:v,builderProps:D})}),A=a({...u({setting:j})}),B=a({...g({styles:m,setting:j,className:T,isEdit:E||H,disableEdit:k})}),F=y({type:"React",styles:m,setting:j,builderProps:D,pageContext:C??{}}),G=l(F);return e("div",{...M,...S,...x,style:b,className:z,children:[t("div",{className:A,style:{...q},children:t(I,{ref:_,...R,className:B,onDragStart:e=>e.preventDefault(),onDrop:e=>e.preventDefault(),style:{...w},dangerouslySetInnerHTML:{__html:G}})}),N]})});export{Text as default};
