"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunknocode_component"] = self["webpackChunknocode_component"] || []).push([[44],{

/***/ "./src/control/web/NocodeDesigner/KDNocodeDesigner.less":
/*!**************************************************************!*\
  !*** ./src/control/web/NocodeDesigner/KDNocodeDesigner.less ***!
  \**************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"loading-wrapper\":\"FQA8c9lK_loading-wrapper\",\"nocode-designer-wrapper\":\"Ohhxvt3A_nocode-designer-wrapper\"});\n\n//# sourceURL=webpack://nocode-component/./src/control/web/NocodeDesigner/KDNocodeDesigner.less?");

/***/ }),

/***/ "./src/base/index.ts":
/*!***************************!*\
  !*** ./src/base/index.ts ***!
  \***************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   hooks: function() { return /* binding */ hooks; },\n/* harmony export */   mobile: function() { return /* reexport module object */ _mobile__WEBPACK_IMPORTED_MODULE_1__; },\n/* harmony export */   web: function() { return /* reexport module object */ _web__WEBPACK_IMPORTED_MODULE_0__; }\n/* harmony export */ });\n/* harmony import */ var _web__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./web */ \"./src/base/web/index.ts\");\n/* harmony import */ var _mobile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mobile */ \"./src/base/mobile/index.ts\");\n/* harmony import */ var _hooks_useKDRefBill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hooks/useKDRefBill */ \"./src/base/hooks/useKDRefBill.tsx\");\n/* harmony import */ var _hooks_useOnDrop__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useOnDrop */ \"./src/base/hooks/useOnDrop.ts\");\n/* harmony import */ var _assets_icon_ncicon_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/icon/ncicon.css */ \"./assets/icon/ncicon.css\");\n/* harmony import */ var _assets_icon_ncicon_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_assets_icon_ncicon_css__WEBPACK_IMPORTED_MODULE_4__);\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2023-09-18 13:43:00\n * @LastEditTime: 2024-04-11 15:16:19\n * @Last Modified by: jianhang_he\n */\n\n\n\n\n\nvar hooks = {\n  useKDRefBill: _hooks_useKDRefBill__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n  useOnDrop: _hooks_useOnDrop__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n};\n\n\n//# sourceURL=webpack://nocode-component/./src/base/index.ts?");

/***/ }),

/***/ "./src/control/hooks/remote.config.js":
/*!********************************************!*\
  !*** ./src/control/hooks/remote.config.js ***!
  \********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/slice */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2023-02-08 18:56:37\n * @LastEditTime: 2023-03-02 10:13:56\n * @Last Modified by: jianhang_he\n */\nvar HOST = window.__kd_cdnPath__ || window.__domainurl__;\nvar config = {\n  nocode: {\n    url: \"\".concat(HOST + \"ncp\", \"/nocode-designer/nocodeRemoteEntry.js\"),\n    scope: 'nocode_designer'\n  },\n  components: {\n    url: \"\".concat(HOST + \"ncp\", \"/nocode-component/nocodeComponentEntry.js\"),\n    scope: 'nocode_component'\n  },\n  base: {\n    url: \"\".concat(HOST, \"public/designer-base/designerBaseRemoteEntry.js\"),\n    scope: 'designer_base'\n  },\n  nocodeflow: {\n    url: \"\".concat(HOST + \"ncp\", \"/nocode-flow/nocodeFlowRemoteEntry.js\"),\n    scope: 'nocode_flow'\n  }\n};\nif (true) {\n  _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(config).forEach(function (key) {\n    var _context, _context2;\n    var _config = config[key];\n    _config.url = _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_1___default()(_context = _config.url).call(_context, 0, -3) + '.dev' + _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_1___default()(_context2 = _config.url).call(_context2, -3) + \"?v=\".concat(1729258349369);\n  });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (config);\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/remote.config.js?");

/***/ }),

/***/ "./src/control/hooks/useDynamicScript.js":
/*!***********************************************!*\
  !*** ./src/control/hooks/useDynamicScript.js ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/slicedToArray.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/set.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/map.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n/*\n * @Author: cxf\n * @Email: jinrui_fang@kingdee.com\n * @Date: 2022-02-18 09:37:31\n * @Last Modified by: fjr\n * @LastEditTime: 2022-02-18 14:19:40\n * @Description: ...\n */\n\n\n// 将远程入口文件注入到html头部\nvar urlCache = new (_babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_3___default())(); // url地址缓存\nvar resolveUrlCache = new (_babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_3___default())(); // url地址缓存\nvar resolveUrlCallbacksMap = new (_babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_4___default())();\nvar useDynamicScript = function useDynamicScript(url, scope) {\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n    ready = _useState2[0],\n    setReady = _useState2[1];\n  var _useState3 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),\n    _useState4 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState3, 2),\n    errorLoading = _useState4[0],\n    setErrorLoading = _useState4[1];\n  // console.log(url,scope)\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n    if (!url) return;\n    if (resolveUrlCache.has(url) || window[scope]) {\n      // 如果已缓存，直接返回\n      setReady(true);\n      setErrorLoading(false);\n      return;\n    }\n    if (urlCache.has(url)) {\n      if (!resolveUrlCallbacksMap.has(url)) {\n        resolveUrlCallbacksMap.set(url, []);\n      }\n      var callbacks = resolveUrlCallbacksMap.get(url);\n      callbacks.push([function () {\n        setReady(true);\n      }, function () {\n        setReady(false);\n        setErrorLoading(true);\n      }]);\n      return;\n    }\n    // 在这个位置存地址，异步同时引入多个组件的时候，可能还未ready\n    urlCache.add(url);\n    setReady(false);\n    setErrorLoading(false);\n    var element = document.createElement('script');\n    element.src = url;\n    element.type = 'text/javascript';\n    element.async = true;\n    element.onload = function () {\n      // urlCache.add(url); // 在这个位置存地址，会引发多次插入脚本问题\n      resolveUrlCache.add(url); // 在这个位置存地址，异步同时引入多个组件的时候，可能还未ready\n      setReady(true);\n      if (resolveUrlCallbacksMap.has(url)) {\n        var _callbacks = resolveUrlCallbacksMap.get(url);\n        _callbacks.forEach(function (_ref) {\n          var _ref2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_ref, 1),\n            resolveCallback = _ref2[0];\n          return resolveCallback();\n        });\n        resolveUrlCallbacksMap.delete(url);\n      }\n    };\n    document.head.appendChild(element);\n    element.onerror = function () {\n      setReady(false);\n      setErrorLoading(true);\n      if (resolveUrlCallbacksMap.has(url)) {\n        var _callbacks2 = resolveUrlCallbacksMap.get(url);\n        _callbacks2.forEach(function (_ref3) {\n          var _ref4 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_ref3, 2),\n            _c = _ref4[0],\n            rejectCallback = _ref4[1];\n          return rejectCallback();\n        });\n        resolveUrlCallbacksMap.delete(url);\n      }\n    };\n    return function () {\n      urlCache.delete(url);\n      resolveUrlCallbacksMap.delete(url);\n      document.head.removeChild(element);\n    };\n  }, [url]);\n  return {\n    errorLoading: errorLoading,\n    ready: ready\n  };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (useDynamicScript);\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useDynamicScript.js?");

/***/ }),

/***/ "./src/control/hooks/useFederationModule.js":
/*!**************************************************!*\
  !*** ./src/control/hooks/useFederationModule.js ***!
  \**************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   useFederatedModule: function() { return /* binding */ useFederatedModule; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_corejs3_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/asyncToGenerator */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/map.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/regenerator */ \"../../node_modules/@babel/runtime-corejs3/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _useDynamicScript_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./useDynamicScript.js */ \"./src/control/hooks/useDynamicScript.js\");\n/* harmony import */ var _remote_config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./remote.config.js */ \"./src/control/hooks/remote.config.js\");\n\n\n\n\n\n\n\n\n/**\n *\n * @param {*} scope\n * @param {*} module\n * @returns Module\n */\nfunction loadModule(configKey, module) {\n  var scope = _remote_config_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"][configKey].scope;\n  return /*#__PURE__*/(0,_babel_runtime_corejs3_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee() {\n    var container, factory, Module;\n    return _babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee$(_context) {\n      while (1) switch (_context.prev = _context.next) {\n        case 0:\n          _context.prev = 0;\n          _context.next = 3;\n          return __webpack_require__.I(\"default\");\n        case 3:\n          container = window[scope]; // or get the container somewhere else\n          // Initialize the container, it may provide shared modules\n          _context.next = 6;\n          return container.init(__webpack_require__.S.default);\n        case 6:\n          _context.next = 11;\n          break;\n        case 8:\n          _context.prev = 8;\n          _context.t0 = _context[\"catch\"](0);\n          console.log(_context.t0);\n        case 11:\n          _context.next = 13;\n          return window[scope].get(module);\n        case 13:\n          factory = _context.sent;\n          Module = factory();\n          return _context.abrupt(\"return\", Module);\n        case 16:\n        case \"end\":\n          return _context.stop();\n      }\n    }, _callee, null, [[0, 8]]);\n  }));\n}\nvar componentCache = new (_babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_2___default())();\nvar useFederatedModule = function useFederatedModule(configKey) {\n  var _context2, _context3;\n  var module = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"./Main\";\n  var _remoteConfig$configK = _remote_config_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"][configKey],\n    url = _remoteConfig$configK.url,\n    scope = _remoteConfig$configK.scope;\n  var key = _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_3___default()(_context2 = _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_3___default()(_context3 = \"\".concat(url, \"-\")).call(_context3, scope, \"-\")).call(_context2, module);\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useState)(function () {\n      return componentCache.get(key) || null;\n    }),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n    Component = _useState2[0],\n    setComponent = _useState2[1];\n  var _useDynamicScript = (0,_useDynamicScript_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(url, scope),\n    ready = _useDynamicScript.ready,\n    errorLoading = _useDynamicScript.errorLoading;\n  var isMountRef = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useRef)(false);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n    if (!isMountRef.current) {\n      isMountRef.current = true;\n      return;\n    }\n    if (Component) setComponent(null);\n    // Only recalculate when key changes\n  }, [key]);\n  // console.log('useFederatedModule',module,Component)\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {\n    if (ready && !Component) {\n      loadModule(configKey, module)().then(function (resolveModule) {\n        var Comp = resolveModule;\n        componentCache.set(key, Comp);\n        setComponent(Comp);\n      });\n    }\n    // key includes all dependencies (scope/module)\n  }, [Component, ready, key]);\n  return {\n    errorLoading: errorLoading,\n    Component: Component\n  };\n};\n\n//# sourceURL=webpack://nocode-component/./src/control/hooks/useFederationModule.js?");

/***/ }),

/***/ "./src/control/web/NocodeDesigner/KDNocodeDesigner.tsx":
/*!*************************************************************!*\
  !*** ./src/control/web/NocodeDesigner/KDNocodeDesigner.tsx ***!
  \*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-properties */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set-timeout */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ \"../../node_modules/core-js/modules/es.function.name.js\");\n/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _KDNocodeDesigner_less__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./KDNocodeDesigner.less */ \"./src/control/web/NocodeDesigner/KDNocodeDesigner.less\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var _control_hooks_useFederationModule_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/control/hooks/useFederationModule.js */ \"./src/control/hooks/useFederationModule.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/base */ \"./src/base/index.ts\");\n/* harmony import */ var _utils_context__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/utils/context */ \"./src/utils/context.ts\");\n/* harmony import */ var bos_core_Tools__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! bos_core/Tools */ \"webpack/container/remote/bos_core/Tools\");\n/* harmony import */ var bos_core_Tools__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(bos_core_Tools__WEBPACK_IMPORTED_MODULE_21__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/constants */ \"./src/constants/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/utils */ \"./src/utils/index.ts\");\n/* harmony import */ var kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! kd_libs/react-dom */ \"webpack/container/remote/kd_libs/react-dom\");\n/* harmony import */ var kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_24__);\n/* harmony import */ var kd_libs_lodash__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! kd_libs/lodash */ \"webpack/container/remote/kd_libs/lodash\");\n/* harmony import */ var kd_libs_lodash__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(kd_libs_lodash__WEBPACK_IMPORTED_MODULE_25__);\n\n\n\n\n\n\n\n\n\n\n\n\nfunction ownKeys(e, r) { var t = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_0___default()(e); if ((_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_1___default())) { var o = _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_1___default()(e); r && (o = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_2___default()(o).call(o, function (r) { return _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_3___default()(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(e, r, t[r]); }) : (_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_4___default()) ? _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_5___default()(e, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_4___default()(t)) : ownKeys(Object(t)).forEach(function (r) { _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_6___default()(e, r, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_3___default()(t, r)); }); } return e; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// 更新表单名称\nvar UPDATE_FORMNAME = 'updateFormName';\nvar SAVE_AS_TEMPLATE = 'saveAsTemplate';\n\n/**\n * 将指令转成对象\n * @param result 返回的结果\n * @param data 输入的指令内容\n * @returns {指令}\n */\nvar getBosActions = function getBosActions(data) {\n  var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  data.forEach(function (item) {\n    var _item$p;\n    if (item.a === 'sendDynamicFormAction' && ((_item$p = item.p) === null || _item$p === void 0 || (_item$p = _item$p[0]) === null || _item$p === void 0 ? void 0 : _item$p.actions.length) > 0) {\n      var _item$p2;\n      getBosActions((_item$p2 = item.p) === null || _item$p2 === void 0 || (_item$p2 = _item$p2[0]) === null || _item$p2 === void 0 ? void 0 : _item$p2.actions, result);\n    } else {\n      result[item.a] = item.p;\n    }\n  });\n  return result;\n};\nvar KDNocodeDesigner = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.memo)(function (_ref) {\n  var controlMeta = _ref.controlMeta;\n  var _useContext = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useContext)(_utils_context__WEBPACK_IMPORTED_MODULE_20__.KDContext),\n    model = _useContext.model;\n  var _useState = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(),\n    _useState2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState, 2),\n    meta = _useState2[0],\n    setMeta = _useState2[1];\n  var _useState3 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(),\n    _useState4 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState3, 2),\n    data = _useState4[0],\n    setData = _useState4[1];\n  var _useState5 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)({}),\n    _useState6 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState5, 2),\n    tableMetas = _useState6[0],\n    setTableMetas = _useState6[1];\n  var _useState7 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)([]),\n    _useState8 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState7, 2),\n    expression = _useState8[0],\n    setExpression = _useState8[1];\n  var _useState9 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)([]),\n    _useState10 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState9, 2),\n    refBillData = _useState10[0],\n    setRefBillData = _useState10[1];\n  var _useState11 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(model.getGlobal(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_SETTING) || null),\n    _useState12 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState11, 2),\n    setting = _useState12[0],\n    setSetting = _useState12[1];\n  var pageId = controlMeta.pageId,\n    id = controlMeta.id;\n  var isGetData = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useRef)(false);\n  var _useState13 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(model.getGlobal(_constants__WEBPACK_IMPORTED_MODULE_22__.SET_COMPARE_TYPES) || {}),\n    _useState14 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState13, 2),\n    compareTypes = _useState14[0],\n    setCompareTypes = _useState14[1];\n  var _useState15 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(model.getGlobal(_constants__WEBPACK_IMPORTED_MODULE_22__.SET_NOCODE_PLATFORM_API) || {}),\n    _useState16 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState15, 1),\n    ncpToolKits = _useState16[0];\n  var _useState17 = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useState)(model.getGlobal(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_SAVE_API) || {}),\n    _useState18 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_useState17, 1),\n    saveapi = _useState18[0];\n  var _useFederatedModule = (0,_control_hooks_useFederationModule_js__WEBPACK_IMPORTED_MODULE_18__.useFederatedModule)('nocode'),\n    module = _useFederatedModule.Component; // 请求组件\n  var _ref2 = module || {},\n    NoCodeDesigner = _ref2.NoCodeDesigner;\n  var designerRef = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useRef)();\n  var designerDataRef = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useRef)();\n\n  /**\n   * 指令执行\n   */\n  var doMethod = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (action) {\n    var _ref3 = designerRef.current || {},\n      pubEvent = _ref3.pubEvent;\n    switch (action.methodname) {\n      case 'open':\n        fetchDomainModel(action.args[0]);\n        designerDataRef.current = action.args[2].data;\n        (0,kd_libs_react_dom__WEBPACK_IMPORTED_MODULE_24__.unstable_batchedUpdates)(function () {\n          setData(action.args[2].data);\n          setExpression(action.args[3].expression);\n          setRefBillData(action.args[4].refBillData);\n          // 将值转成键值对保存\n          setTableMetas(action.args[5].tableMetas);\n        });\n        break;\n      case _constants__WEBPACK_IMPORTED_MODULE_22__.SHOW_PREVIEW:\n        {\n          var getDesignerClientType = designerRef.current.getDesignerClientType;\n          var clientType = getDesignerClientType();\n          model.emitEvent(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_PREVIEW_DEVICE, clientType);\n          break;\n        }\n      default:\n        // 默认走pubEvent\n        pubEvent === null || pubEvent === void 0 || pubEvent(action.methodname, action.args[0]);\n        break;\n    }\n  }, [designerRef.current]);\n\n  // 请求model数据\n  var fetchDomainModel = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (modelType) {\n    var _model$getPageConfig = model.getPageConfig(),\n      targetFormId = _model$getPageConfig.targetFormId;\n    (0,bos_core_Tools__WEBPACK_IMPORTED_MODULE_21__.fetchData)(pageId, 'nocode/getDomainModel.do', {\n      modelType: modelType,\n      targetFormId: targetFormId\n    }).then(function (res) {\n      return setMeta(res.data);\n    });\n  }, []);\n  // 遍历指令\n  var invokeMethod = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (res) {\n    res.forEach(function (item) {\n      return doMethod(item);\n    });\n  }, []);\n\n  // 请求model数据\n  var updateSetting = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (info) {\n    setSetting(info);\n  }, []);\n  var updateCompareTypes = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (newData) {\n    setCompareTypes(newData);\n  }, []);\n  var updateFormHandler = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (args) {\n    switch (args.type) {\n      case UPDATE_FORMNAME:\n        // 更新表单名称\n        updateFormName(args.payload);\n        break;\n      case SAVE_AS_TEMPLATE:\n        saveTemplate(args.payload);\n        break;\n      default:\n        break;\n    }\n  }, []);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useEffect)(function () {\n    var removeMethodListener = model.addControlAction('InvokeControlMethod', pageId, id, invokeMethod);\n    var removeSaveListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_SAVE, function () {\n      return save();\n    });\n    var removeSaveAndVisitListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_SAVE_AND_VISIT, function () {\n      return saveAndVisit();\n    });\n    var removePreviewListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_PREVIEW, function () {\n      return preview();\n    });\n    var removeUpdateListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_UPDATE, updateFormHandler);\n    var removeSettingListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.NOCODE_DESIGNER_SETTING, updateSetting);\n    var removeSetCompareTypesListener = model.addEventListener(_constants__WEBPACK_IMPORTED_MODULE_22__.SET_COMPARE_TYPES, updateCompareTypes);\n    return function () {\n      removeMethodListener();\n      removeSaveListener();\n      removeSaveAndVisitListener();\n      removePreviewListener();\n      removeUpdateListener();\n      removeSettingListener();\n      removeSetCompareTypesListener();\n    };\n  }, []);\n  var onData = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (data) {\n    designerDataRef.current = data;\n  }, []);\n  var onApi = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (designerApi) {\n    designerRef.current = _objectSpread({}, designerApi);\n  }, []);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useEffect)(function () {\n    window.noCodeDesignerRef = {\n      save: save,\n      getDesignerData: function getDesignerData() {\n        return designerDataRef.current;\n      }\n    };\n  }, []);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useEffect)(function () {\n    // 通知bos-platform（DesignerHomePage）那边，数据已经获取完毕\n    if (meta && data && NoCodeDesigner && !isGetData.current) {\n      isGetData.current = true;\n      model.emitEvent(_constants__WEBPACK_IMPORTED_MODULE_22__.DESIGNER_MOUNT, true);\n    }\n  }, [meta, data, NoCodeDesigner]);\n\n  // 保存成功后删除ROOT节点的refFieldProps属性\n  var removeRootRefFieldEditProps = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function () {\n    var _designerRef$current;\n    var _ref4 = ((_designerRef$current = designerRef.current) === null || _designerRef$current === void 0 ? void 0 : _designerRef$current.kdesignerApi) || {},\n      dataContext = _ref4.data,\n      selectionContext = _ref4.selection;\n    var _dataContext$getData = dataContext.getData(),\n      Items = _dataContext$getData.Items;\n    // 将焦点定位到根节点\n    selectionContext.setSelect([Items[0].Id]);\n    // 清空refFieldEdit属性\n    dataContext.batchUpdateControlPropertyValues({\n      type: 'UPDATE',\n      value: [[Items[0].Id, {\n        refFieldEdit: {}\n      }]]\n    });\n  }, []);\n  var save = function save() {\n    var _designerRef$current2;\n    var postKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'save';\n    // setTimeout为了防止属性修改后没有失焦，直接点击保存，发送数据不是最新的问题\n    // console.log('save', args)\n    var _ref5 = ((_designerRef$current2 = designerRef.current) === null || _designerRef$current2 === void 0 ? void 0 : _designerRef$current2.kdesignerApi) || {},\n      controlCacheApi = _ref5.controlCacheApi;\n    // controlCacheApi?.clearCache('controlId')\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default()(function () {\n      var post = formatePostData();\n      var batchInvokeForceProps = {\n        action: 'designerBarClick',\n        pageId: pageId,\n        controlId: id,\n        args: [postKey],\n        postData: [post],\n        callback: function callback(res) {\n          var _ShowNotificationMsg$;\n          saveapi === null || saveapi === void 0 || saveapi.saveStatus();\n          var _ref6 = getBosActions(res.data) || {},\n            ShowNotificationMsg = _ref6.ShowNotificationMsg;\n          if ((ShowNotificationMsg === null || ShowNotificationMsg === void 0 || (_ShowNotificationMsg$ = ShowNotificationMsg[0]) === null || _ShowNotificationMsg$ === void 0 ? void 0 : _ShowNotificationMsg$.type) === 0) removeRootRefFieldEditProps();\n        },\n        enforce: true\n      };\n      model.batchInvokeWithForce(batchInvokeForceProps);\n    }, 20);\n    // 防止超时加载关不掉\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default()(function () {\n      saveapi === null || saveapi === void 0 || saveapi.saveStatus();\n    }, 30000);\n  };\n  var saveAndVisit = function saveAndVisit() {\n    save('saveandvisit');\n  };\n  var preview = function preview() {\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default()(function () {\n      var post = formatePostData();\n      var getDesignerClientType = designerRef.current.getDesignerClientType;\n      var clientType = getDesignerClientType();\n      var batchInvokeForceProps = {\n        action: 'designerBarClick',\n        pageId: pageId,\n        controlId: id,\n        args: [\"\".concat(clientType, \"_preview\")],\n        postData: [post],\n        callback: function callback(res) {\n          var _ShowNotificationMsg$2;\n          saveapi === null || saveapi === void 0 || saveapi.saveStatus();\n          var _ref7 = getBosActions(res.data) || {},\n            ShowNotificationMsg = _ref7.ShowNotificationMsg;\n          if ((ShowNotificationMsg === null || ShowNotificationMsg === void 0 || (_ShowNotificationMsg$2 = ShowNotificationMsg[0]) === null || _ShowNotificationMsg$2 === void 0 ? void 0 : _ShowNotificationMsg$2.type) === 0) removeRootRefFieldEditProps();\n        },\n        enforce: true\n      };\n      model.batchInvokeWithForce(batchInvokeForceProps);\n    }, 20);\n    // 防止超时加载关不掉\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default()(function () {\n      saveapi === null || saveapi === void 0 || saveapi.saveStatus();\n    }, 30000);\n  };\n\n  /**\n   * 格式化设计器postData\n   * @param {*} args 参数,可为空\n   * @returns {}\n   */\n  var formatePostData = function formatePostData() {\n    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var _designerRef$current3 = designerRef.current,\n      getSystemSetting = _designerRef$current3.getSystemSetting,\n      getBillnoSetting = _designerRef$current3.getBillnoSetting;\n    var newData = _objectSpread(_objectSpread({}, designerDataRef.current), {}, {\n      setting: setting,\n      sysSetting: getSystemSetting(),\n      billNoSetting: getBillnoSetting()\n    }, args);\n    var post = {};\n    post[id] = newData;\n    return post;\n  };\n  var updateDataIndex = function updateDataIndex() {\n    var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var indexMap = {};\n    return _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_10___default()(data).call(data, function (item) {\n      var parentId = item.ParentId;\n      if (parentId) {\n        indexMap[parentId] = indexMap[parentId] === undefined ? 0 : indexMap[parentId] + 1;\n        return _objectSpread(_objectSpread({}, item), {}, {\n          Index: indexMap[parentId]\n        });\n      }\n      return item;\n    });\n  };\n\n  // 修改表单名称\n  var updateFormName = function updateFormName(formName) {\n    if (!formName || !designerRef.current) return;\n    var newData = (0,kd_libs_lodash__WEBPACK_IMPORTED_MODULE_25__.cloneDeep)(designerDataRef.current);\n\n    // 修改表单名称\n    if (newData.entitymeta) {\n      newData.entitymeta.Name = formName;\n      newData.entitymeta.Items[0].Name = formName;\n    }\n    if (newData.formmeta) {\n      newData.formmeta.Name = formName;\n      newData.formmeta.Items[0].Name = formName;\n    }\n    var _designerRef$current4 = designerRef.current,\n      resetDesignerData = _designerRef$current4.resetDesignerData,\n      kdesignerApi = _designerRef$current4.kdesignerApi;\n    resetDesignerData === null || resetDesignerData === void 0 || resetDesignerData(newData, kdesignerApi);\n  };\n  var saveTemplate = function saveTemplate(templateConfig) {\n    var post = formatePostData({\n      templateConfig: templateConfig,\n      saveAsTemplate: true\n    });\n    var batchInvokeForceProps = {\n      action: 'designerBarClick',\n      pageId: pageId,\n      controlId: id,\n      args: ['save'],\n      postData: [post],\n      callback: saveapi === null || saveapi === void 0 ? void 0 : saveapi.saveStatus,\n      enforce: true\n    };\n    _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_9___default()(function () {\n      model.batchInvokeWithForce(batchInvokeForceProps);\n    }, 200);\n  };\n  var invokeAction = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (actionName, args) {\n    var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n    // console.log(':::::::', actionName, pageId, id, args, params, enforce)\n    model.batchInvoke(actionName, pageId, id, args, params);\n    // dispatch(property_editor_click(model, actionName, params))\n  }, []);\n  var enforceInvokeAction = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (actionName, args) {\n    var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n    var batchInvokeForceProps = {\n      action: actionName,\n      pageId: pageId,\n      controlId: id,\n      args: args,\n      postData: params,\n      enforce: true\n    };\n    model.batchInvokeWithForce(batchInvokeForceProps);\n  }, []);\n  var onDownLoad = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_15__.useCallback)(function (info) {\n    var _context;\n    var config = model.getConfig(pageId);\n    // const file = uploadRef.current.get(info.uid)\n    var options = {\n      params: '1',\n      appId: config.appId,\n      fId: config.formId,\n      fileName: info.name\n    };\n    var url = _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_11___default()(_context = \"\".concat(info.url, \"&kd_cs_ticket=\")).call(_context, model.Global.token);\n    (0,_utils__WEBPACK_IMPORTED_MODULE_23__.downloadFile)(url, options);\n  }, []);\n  var designerWrapperClass = classnames__WEBPACK_IMPORTED_MODULE_17___default()((0,_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({}, _KDNocodeDesigner_less__WEBPACK_IMPORTED_MODULE_16__[\"default\"]['nocode-designer-wrapper'], true));\n  if (meta && data && NoCodeDesigner) {\n    return /*#__PURE__*/kd_libs_react__WEBPACK_IMPORTED_MODULE_15___default().createElement(\"div\", {\n      className: designerWrapperClass\n    }, /*#__PURE__*/kd_libs_react__WEBPACK_IMPORTED_MODULE_15___default().createElement(NoCodeDesigner, {\n      name: \"NoCodeDesigner\",\n      meta: meta,\n      data: data,\n      expression: expression,\n      refBillData: refBillData,\n      tableMetas: tableMetas,\n      compareTypes: compareTypes,\n      onData: onData,\n      invokeAction: invokeAction,\n      enforceInvokeAction: enforceInvokeAction,\n      onApi: onApi,\n      baseHooks: _base__WEBPACK_IMPORTED_MODULE_19__.hooks,\n      settingData: setting,\n      onDownLoad: onDownLoad,\n      getControlText: model.getControlText,\n      addControlAction: function addControlAction(methodName, id, listener) {\n        return model.addControlAction(methodName, pageId, id, listener);\n      },\n      fetchControlData: model.fetchControlData,\n      batchInvoke: function batchInvoke(actionName, id, args, params) {\n        return model.batchInvoke(actionName, pageId, id, args, params);\n      },\n      baseUrl: {\n        attachment: model.getFileServer('attachment'),\n        picture: model.getFileServer('picture')\n      },\n      ncpToolKits: ncpToolKits\n    }));\n  }\n  return null;\n});\nKDNocodeDesigner.displayName = 'KDNocodeDesigner';\n/* harmony default export */ __webpack_exports__[\"default\"] = (KDNocodeDesigner);\n\n//# sourceURL=webpack://nocode-component/./src/control/web/NocodeDesigner/KDNocodeDesigner.tsx?");

/***/ })

}]);