import e from"../../../@babel/runtime/helpers/esm/extends.esm.js";import t from"../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.esm.js";import{forwardRef as i,useRef as o,useImperativeHandle as a,useCallback as r}from"react";import{useCodeMirror as n}from"./useCodeMirror.esm.js";export{ExternalChange}from"./useCodeMirror.esm.js";import{jsx as s}from"react/jsx-runtime";export{defaultLightThemeOption}from"./theme/light.esm.js";var m=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],h=i((i,h)=>{var{className:l,value:d="",selection:u,extensions:c=[],onChange:p,onStatistics:g,onCreateEditor:b,onUpdate:f,autoFocus:x,theme:C="light",height:v,minHeight:W,maxHeight:S,width:y,minWidth:j,maxWidth:w,basicSetup:H,placeholder:E,indentWithTab:N,editable:O,readOnly:T,root:F,initialState:M}=i,U=t(i,m),L=o(null),{state:P,view:k,container:q,setContainer:z}=n({root:F,value:d,autoFocus:x,theme:C,height:v,minHeight:W,maxHeight:S,width:y,minWidth:j,maxWidth:w,basicSetup:H,placeholder:E,indentWithTab:N,editable:O,readOnly:T,selection:u,onChange:p,onStatistics:g,onCreateEditor:b,onUpdate:f,extensions:c,initialState:M});a(h,()=>({editor:L.current,state:P,view:k}),[L,q,P,k]);var A=r(e=>{L.current=e,z(e)},[z]);if("string"!=typeof d)throw new Error("value must be typeof string but got "+typeof d);return s("div",e({ref:A,className:("string"==typeof C?"cm-theme-"+C:"cm-theme")+(l?" "+l:"")},U))});h.displayName="CodeMirror";export{h as default,n as useCodeMirror};
//# sourceMappingURL=index.esm.js.map
