"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    DynamicPage: ()=>DynamicPage
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_antd_namespaceObject = require("antd");
const external_react_router_dom_namespaceObject = require("react-router-dom");
const external_index_js_namespaceObject = require("../index.js");
const index_js_namespaceObject = require("../../data-source/index.js");
const external_record_provider_index_js_namespaceObject = require("../../record-provider/index.js");
const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
const external_DynamicPage_style_js_namespaceObject = require("./DynamicPage.style.js");
const external_PageNavBar_js_namespaceObject = require("./PageNavBar.js");
const external_utils_js_namespaceObject = require("./utils.js");
const DynamicPage = ()=>{
    const { styles } = (0, external_DynamicPage_style_js_namespaceObject.useStyles)();
    const params = (0, external_react_router_dom_namespaceObject.useParams)();
    const pathParams = external_utils_js_namespaceObject.PathHandler.getInstance().parse(params['*'], params.name);
    if (!pathParams) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.RemoteSchemaComponent, {
        uid: params.name,
        onlyRenderProperties: true
    });
    if (!pathParams.sub || !pathParams.collection || !pathParams.filterByTk || !pathParams.schemaId) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.AppNotFound, {});
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        className: styles['dynamic-page'],
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.DataBlockProvider, {
            params: {
                filterByTk: pathParams.filterByTk
            },
            action: "get",
            collection: pathParams.collection,
            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_record_provider_index_js_namespaceObject.RecordContext_deprecated.Provider, {
                value: {
                    id: pathParams.filterByTk
                },
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_record_provider_index_js_namespaceObject.RecordProvider, {
                    record: {
                        id: pathParams.filterByTk
                    },
                    children: [
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PageNavBar_js_namespaceObject.PageNavBar, {
                            uid: pathParams.sub
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Card, {
                            className: "page-content",
                            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.RemoteSchemaComponent, {
                                uid: pathParams.sub,
                                onlyRenderProperties: true
                            })
                        })
                    ]
                })
            })
        })
    });
};
exports.DynamicPage = __webpack_exports__.DynamicPage;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
    "DynamicPage"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
    value: true
});
