"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(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 = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(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__, {
    default: ()=>useContextVariable_rslib_entry_
});
const external_react_namespaceObject = require("react");
const index_js_namespaceObject = require("../../block-provider/index.js");
const useContextVariable = ()=>{
    var _field_data, _service_data;
    const { field, service, rowKey, collection: collectionName } = (0, index_js_namespaceObject.useTableBlockContext)();
    const contextData = (0, external_react_namespaceObject.useMemo)(()=>{
        var _service_data_data, _service_data;
        return null == service ? void 0 : null === (_service_data = service.data) || void 0 === _service_data ? void 0 : null === (_service_data_data = _service_data.data) || void 0 === _service_data_data ? void 0 : _service_data_data.filter((v)=>{
            var _this, _field_data;
            return null === (_this = (null == field ? void 0 : null === (_field_data = field.data) || void 0 === _field_data ? void 0 : _field_data.selectedRowKeys) || []) || void 0 === _this ? void 0 : _this.includes(v[rowKey]);
        });
    }, [
        null == field ? void 0 : null === (_field_data = field.data) || void 0 === _field_data ? void 0 : _field_data.selectedRowKeys,
        rowKey,
        null == service ? void 0 : null === (_service_data = service.data) || void 0 === _service_data ? void 0 : _service_data.data
    ]);
    return (0, external_react_namespaceObject.useMemo)(()=>({
            name: '$context',
            ctx: contextData,
            collectionName
        }), [
        collectionName,
        contextData
    ]);
};
const useContextVariable_rslib_entry_ = useContextVariable;
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
