"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageConstructorProvider = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const blocksContext_1 = require("../../context/blocksContext/index.js");
const editorStoreContext_1 = require("../../context/editorStoreContext/index.js");
const PageConstructorProvider = (props) => {
    const { children, blocks = [] } = props;
    /* eslint-disable react/jsx-key */
    const context = [
        (0, jsx_runtime_1.jsx)(blocksContext_1.BlocksContext.Provider, { value: { blocks } }),
        (0, jsx_runtime_1.jsx)(editorStoreContext_1.PCEditorStoreProvider, {}),
    ].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
    /* eslint-enable react/jsx-key */
    return (0, jsx_runtime_1.jsx)(React.Fragment, { children: context });
};
exports.PageConstructorProvider = PageConstructorProvider;
//# sourceMappingURL=Provider.js.map
