var b=Object.defineProperty,x=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var d=(t,r,o)=>r in t?b(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,p=(t,r)=>{for(var o in r||(r={}))y.call(r,o)&&d(t,o,r[o]);if(c)for(var o of c(r))h.call(r,o)&&d(t,o,r[o]);return t},s=(t,r)=>x(t,T(r));import{jsx as v}from"react/jsx-runtime";import{c as w}from"./ui-components-B24mpb8o.js";import{useEditor as A}from"./use-editor-D8T8wKX0.js";import{f as C}from"./format-text-Bn-rZ97T.js";import f from"react";import{E as D}from"./element-wrapper-Dx7uKeuw.js";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./editor-provider-CwMLJaUa.js";import"uuid";import"./index-B_TQB0Un.js";import"./ActionsWrapper-B0x6l4Ay.js";import"@dnd-kit/sortable";import"@dnd-kit/utilities";const Et=({element:t})=>{const{editor:r,dispatch:o}=A(),{editor:a}=r,{content:e,styles:u}=t,n=f.useRef(null),i=!Array.isArray(e)&&typeof e=="object"&&"innerText"in e?e.innerText:"Label";f.useEffect(()=>{n.current&&n.current.innerText!==i&&(n.current.innerText=i)},[i]);const E=m=>{C(m,a,o)};return v(D,{element:t,tag:"div",wrapperClassName:"relative",htmlAttributes:p({ref:n,style:u,className:w("block w-full outline-none",t.className)},t.htmlAttributes),contentEditable:!a.liveMode,onKeyDown:E,suppressContentEditableWarning:!0,onBlur:m=>{const l=m.target.innerText;l!==i&&o({type:"UPDATE_ELEMENT",payload:{elementDetails:s(p({},t),{content:s(p({},typeof e=="object"?e:{}),{innerText:l})})}})},children:i})};export{Et as default};
