import { jsx } from "react/jsx-runtime";
import { createContext, useContext } from "react";
import { connect, mapReadPretty } from "@tachybase/schema";
import { CodeMirror } from "./CodeMirror.mjs";
import { Input } from "./Input.mjs";
import { JSONInput } from "./JSONInput.mjs";
import { RawTextArea } from "./RawTextArea.mjs";
import { TextArea } from "./TextArea.mjs";
const VariableScopeContext = /*#__PURE__*/ createContext([]);
VariableScopeContext.displayName = 'VariableScopeContext';
function VariableScopeProvider(param) {
    let { scope = [], children } = param;
    return /*#__PURE__*/ jsx(VariableScopeContext.Provider, {
        value: scope,
        children: children
    });
}
function useVariableScope() {
    return useContext(VariableScopeContext);
}
function Variable() {
    return null;
}
Variable.Input = connect(Input);
Variable.TextArea = connect(TextArea, mapReadPretty(TextArea.ReadPretty));
Variable.RawTextArea = connect(RawTextArea);
Variable.JSON = connect(JSONInput);
Variable.CodeMirror = connect(CodeMirror);
const variable_Variable = Variable;
export { Variable, VariableScopeProvider, variable_Variable as default, useVariableScope };
