"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = function(module) {
        var getter = module && module.__esModule ? function() {
            return module['default'];
        } : function() {
            return module;
        };
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __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__, {
    useCreateActionAndRefreshCM: ()=>useCreateActionAndRefreshCM,
    useDeleteButtonDisabled: ()=>useDeleteButtonDisabled,
    useFilterActionProps: ()=>useFilterActionProps,
    useFilterDataSource: ()=>useFilterDataSource,
    useValuesFromRA: ()=>useValuesFromRA,
    useCollectionFieldsOptions: ()=>useCollectionFieldsOptions,
    useKanbanEvents: ()=>useKanbanEvents,
    useBulkDestroyActionAndRefreshCM: ()=>useBulkDestroyActionAndRefreshCM,
    useBulkDestroyAction: ()=>useBulkDestroyAction,
    useDestroyAction: ()=>useDestroyAction,
    useDestroyActionAndRefreshCM: ()=>useDestroyActionAndRefreshCM,
    useCreateAction: ()=>useCreateAction,
    useResetFilterAction: ()=>useResetFilterAction,
    useSortFields: ()=>useSortFields,
    useValuesFromRecord: ()=>useValuesFromRecord,
    useChildrenCollections: ()=>useChildrenCollections,
    useCollectionFilterOptionsV2: ()=>useCollectionFilterOptionsV2,
    useMoveAction: ()=>useMoveAction,
    useCreateActionWithoutRefresh: ()=>useCreateActionWithoutRefresh,
    useSelfAndChildrenCollections: ()=>useSelfAndChildrenCollections,
    useLinkageCollectionFilterOptions: ()=>useLinkageCollectionFilterOptions,
    isDeleteButtonDisabled: ()=>isDeleteButtonDisabled,
    useCollectionFilterOptions: ()=>useCollectionFilterOptions,
    useFilterAction: ()=>useFilterAction,
    useCancelAction: ()=>useCancelAction,
    useUpdateAction: ()=>useUpdateAction,
    useUpdateViewAction: ()=>useUpdateViewAction,
    useUpdateActionAndRefreshCM: ()=>useUpdateActionAndRefreshCM
});
const external_react_namespaceObject = require("react");
const schema_namespaceObject = require("@tachybase/schema");
const external_antd_namespaceObject = require("antd");
const external_lodash_namespaceObject = require("lodash");
var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
const cloneDeep_namespaceObject = require("lodash/cloneDeep");
var cloneDeep_default = /*#__PURE__*/ __webpack_require__.n(cloneDeep_namespaceObject);
const omit_namespaceObject = require("lodash/omit");
var omit_default = /*#__PURE__*/ __webpack_require__.n(omit_namespaceObject);
const external_react_i18next_namespaceObject = require("react-i18next");
const external_index_js_namespaceObject = require("./index.js");
const index_js_namespaceObject = require("../api-client/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 useFilterActionProps_js_namespaceObject = require("../schema-component/antd/filter/useFilterActionProps.js");
const external_ResourceActionProvider_js_namespaceObject = require("./ResourceActionProvider.js");
const useCancelAction = ()=>{
    const form = (0, schema_namespaceObject.useForm)();
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    return {
        async run () {
            ctx.setVisible(false);
            form.reset();
        }
    };
};
const useValuesFromRecord = (options)=>{
    const record = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    const result = (0, index_js_namespaceObject.useRequest)(()=>Promise.resolve({
            data: omit_default()(cloneDeep_default()(record), [
                '__parent',
                '__collectionName'
            ])
        }), {
        ...options,
        manual: true
    });
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    (0, external_react_namespaceObject.useEffect)(()=>{
        if (ctx.visible) result.run();
    }, [
        ctx.visible
    ]);
    return result;
};
const useResetFilterAction = ()=>{
    const { run } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const form = (0, schema_namespaceObject.useForm)();
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    return {
        async run () {
            form.reset();
            run();
            ctx.setVisible(false);
        }
    };
};
const useKanbanEvents = ()=>{
    const { resource } = (0, external_index_js_namespaceObject.useCollection_deprecated)();
    return {
        async onCardDragEnd (param, param1, param2) {
            let { columns, groupField } = param, { fromColumnId, fromPosition } = param1, { toColumnId, toPosition } = param2;
            var _sourceColumn_cards, _destinationColumn_cards;
            const sourceColumn = columns.find((column)=>column.id === fromColumnId);
            const destinationColumn = columns.find((column)=>column.id === toColumnId);
            const sourceCard = null == sourceColumn ? void 0 : null === (_sourceColumn_cards = sourceColumn.cards) || void 0 === _sourceColumn_cards ? void 0 : _sourceColumn_cards[fromPosition];
            const targetCard = null == destinationColumn ? void 0 : null === (_destinationColumn_cards = destinationColumn.cards) || void 0 === _destinationColumn_cards ? void 0 : _destinationColumn_cards[toPosition];
            const values = {
                sourceId: sourceCard.id,
                sortField: "".concat(groupField.name, "_sort")
            };
            if (targetCard) values['targetId'] = targetCard.id;
            else values['targetScope'] = {
                [groupField.name]: toColumnId
            };
            await resource.move(values);
        }
    };
};
const useSortFields = (collectionName)=>{
    const { getCollectionFields, getInterface } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const fields = getCollectionFields(collectionName);
    return fields.filter((field)=>{
        if (!field.interface) return false;
        const fieldInterface = getInterface(field.interface);
        if (null == fieldInterface ? void 0 : fieldInterface.sortable) return true;
        return false;
    }).map((field)=>{
        var _field_uiSchema;
        return {
            value: field.name,
            label: (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name
        };
    });
};
const useChildrenCollections = (collectionName)=>{
    const { getChildrenCollections } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const childrenCollections = getChildrenCollections(collectionName);
    return childrenCollections.map((collection)=>({
            value: collection.name,
            label: (null == collection ? void 0 : collection.title) || collection.name
        }));
};
const useSelfAndChildrenCollections = (collectionName)=>{
    const { getChildrenCollections, getCollection } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const childrenCollections = getChildrenCollections(collectionName);
    const self = getCollection(collectionName);
    if (!collectionName) return null;
    const options = childrenCollections.map((collection)=>({
            value: collection.name,
            label: (null == collection ? void 0 : collection.title) || collection.name
        }));
    options.unshift({
        value: self.name,
        label: (null == self ? void 0 : self.title) || self.name
    });
    return options;
};
const useCollectionFilterOptions = (collection, dataSource)=>{
    const { getCollectionFields, getInterface } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    return (0, external_react_namespaceObject.useMemo)(()=>{
        const fields = getCollectionFields(collection, dataSource);
        const field2option = (field, depth)=>{
            var _field_uiSchema, _operators_filter;
            if (!field.interface) return;
            const fieldInterface = getInterface(field.interface);
            if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
            const { nested, children, operators } = fieldInterface.filterable;
            const option = {
                name: field.name,
                title: (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
                schema: null == field ? void 0 : field.uiSchema,
                operators: (null == operators ? void 0 : null === (_operators_filter = operators.filter) || void 0 === _operators_filter ? void 0 : _operators_filter.call(operators, (operator)=>!(null == operator ? void 0 : operator.visible) || operator.visible(field))) || [],
                interface: field.interface
            };
            if (field.target && depth > 2) return;
            if (depth > 2) return option;
            if (null == children ? void 0 : children.length) option['children'] = children;
            if (nested) {
                const targetFields = getCollectionFields(field.target, dataSource);
                const options = getOptions(targetFields, depth + 1).filter(Boolean);
                option['children'] = option['children'] || [];
                option['children'].push(...options);
            }
            return option;
        };
        const getOptions = (fields, depth)=>{
            const options = [];
            fields.forEach((field)=>{
                const option = field2option(field, depth);
                if (option) options.push(option);
            });
            return options;
        };
        const options = getOptions(fields, 1);
        return options;
    }, [
        external_lodash_default().isString(collection) ? collection : null == collection ? void 0 : collection.name,
        dataSource
    ]);
};
const useCollectionFilterOptionsV2 = (collection)=>{
    const { getCollectionFields, getInterface } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const getFields = (0, external_react_namespaceObject.useCallback)(()=>{
        const fields = getCollectionFields(collection);
        const field2option = (field, depth)=>{
            var _field_uiSchema, _operators_filter;
            if (!field.interface) return;
            const fieldInterface = getInterface(field.interface);
            if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
            const { nested, children, operators } = fieldInterface.filterable;
            const option = {
                name: field.name,
                title: (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
                schema: null == field ? void 0 : field.uiSchema,
                operators: (null == operators ? void 0 : null === (_operators_filter = operators.filter) || void 0 === _operators_filter ? void 0 : _operators_filter.call(operators, (operator)=>!(null == operator ? void 0 : operator.visible) || operator.visible(field))) || [],
                interface: field.interface
            };
            if (field.target && depth > 2) return;
            if (depth > 2) return option;
            if (null == children ? void 0 : children.length) option['children'] = children;
            if (nested) {
                const targetFields = getCollectionFields(field.target);
                const options = getOptions(targetFields, depth + 1).filter(Boolean);
                option['children'] = option['children'] || [];
                option['children'].push(...options);
            }
            return option;
        };
        const getOptions = (fields, depth)=>{
            const options = [];
            fields.forEach((field)=>{
                const option = field2option(field, depth);
                if (option) options.push(option);
            });
            return options;
        };
        const options = getOptions(fields, 1);
        return options;
    }, [
        external_lodash_default().isString(collection) ? collection : null == collection ? void 0 : collection.name
    ]);
    return {
        getFields
    };
};
const useLinkageCollectionFilterOptions = (collectionName)=>{
    const { getCollectionFields, getInterface } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const fields = getCollectionFields(collectionName);
    const field2option = (field, depth)=>{
        var _field_uiSchema, _operators_filter;
        if (!field.interface) return;
        const fieldInterface = getInterface(field.interface);
        if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
        const { nested, children, operators } = fieldInterface.filterable;
        const option = {
            name: field.name,
            title: (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
            schema: null == field ? void 0 : field.uiSchema,
            operators: (null == operators ? void 0 : null === (_operators_filter = operators.filter) || void 0 === _operators_filter ? void 0 : _operators_filter.call(operators, (operator)=>!(null == operator ? void 0 : operator.visible) || operator.visible(field))) || [],
            interface: field.interface
        };
        if (field.target && depth > 2) return;
        if (depth > 2) return option;
        if (null == children ? void 0 : children.length) option['children'] = children;
        if (nested) {
            const targetFields = getCollectionFields(field.target).filter((v)=>{
                if ([
                    'hasMany',
                    'belongsToMany'
                ].includes(field.type)) return ![
                    'hasOne',
                    'hasMany',
                    'belongsTo',
                    'belongsToMany'
                ].includes(v.type);
                return ![
                    'hasMany',
                    'belongsToMany'
                ].includes(v.type);
            });
            const options = getOptions(targetFields, depth + 1).filter(Boolean);
            option['children'] = option['children'] || [];
            option['children'].push(...options);
        }
        return option;
    };
    const getOptions = (fields, depth)=>{
        const options = [];
        fields.forEach((field)=>{
            const option = field2option(field, depth);
            if (option) options.push(option);
        });
        return options;
    };
    const options = getOptions(fields, 1);
    return options;
};
const useCollectionFieldsOptions = function(collectionName) {
    let maxDepth = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, excludes = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
    const { getCollectionFields, getInterface } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    const fields = getCollectionFields(collectionName).filter((v)=>!excludes.includes(v.interface));
    const field2option = (field, depth, prefix)=>{
        var _field_uiSchema;
        if (!field.interface) return;
        const fieldInterface = getInterface(field.interface);
        if (!(null == fieldInterface ? void 0 : fieldInterface.filterable)) return;
        const { nested, children } = fieldInterface.filterable;
        const value = prefix ? "".concat(prefix, ".").concat(field.name) : field.name;
        const option = {
            ...field,
            name: field.name,
            title: (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
            schema: null == field ? void 0 : field.uiSchema,
            key: value
        };
        if (field.target && depth > maxDepth) return;
        if (depth > maxDepth) return option;
        if (null == children ? void 0 : children.length) option['children'] = children.map((v)=>({
                ...v,
                key: "".concat(field.name, ".").concat(v.name)
            }));
        if (nested) {
            const targetFields = getCollectionFields(field.target).filter((v)=>!excludes.includes(v.interface));
            const options = getOptions(targetFields, depth + 1, field.name).filter(Boolean);
            option['children'] = option['children'] || [];
            option['children'].push(...options);
        }
        return option;
    };
    const getOptions = (fields, depth, prefix)=>{
        const options = [];
        fields.forEach((field)=>{
            const option = field2option(field, depth, prefix);
            if (option) options.push(option);
        });
        return options;
    };
    const options = getOptions(fields, 1);
    return options;
};
const useFilterDataSource = (options)=>{
    const { name } = (0, external_index_js_namespaceObject.useCollection_deprecated)();
    const data = useCollectionFilterOptions(name);
    return (0, index_js_namespaceObject.useRequest)(()=>Promise.resolve({
            data
        }), options);
};
const useFilterAction = ()=>{
    const { run, params, defaultRequest } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const form = (0, schema_namespaceObject.useForm)();
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    const [first, ...others] = params;
    return {
        async run () {
            var _defaultRequest_params;
            const prevFilter = null == defaultRequest ? void 0 : null === (_defaultRequest_params = defaultRequest.params) || void 0 === _defaultRequest_params ? void 0 : _defaultRequest_params.filter;
            const filter = prevFilter ? {
                $and: [
                    prevFilter,
                    form.values.filter
                ]
            } : form.values.filter;
            run({
                ...first,
                filter
            }, ...others);
            ctx.setVisible(false);
        }
    };
};
const useCreateAction = (actionCallback)=>{
    const form = (0, schema_namespaceObject.useForm)();
    const field = (0, schema_namespaceObject.useField)();
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    const { refresh } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const { resource } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    return {
        async run () {
            try {
                var _res_data;
                await form.submit();
                field.data = field.data || {};
                field.data.loading = true;
                const res = await resource.create({
                    values: form.values
                });
                ctx.setVisible(false);
                null == actionCallback || actionCallback(null == res ? void 0 : null === (_res_data = res.data) || void 0 === _res_data ? void 0 : _res_data.data);
                await form.reset();
                field.data.loading = false;
                refresh();
            } catch (error) {
                if (field.data) field.data.loading = false;
            }
        }
    };
};
const useCreateActionWithoutRefresh = (actionCallback)=>{
    const form = (0, schema_namespaceObject.useForm)();
    const { resource } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    return {
        async run () {
            var _res_data;
            await form.submit();
            const res = await resource.create({
                values: form.values
            });
            null == actionCallback || actionCallback(null == res ? void 0 : null === (_res_data = res.data) || void 0 === _res_data ? void 0 : _res_data.data);
            await form.reset();
        }
    };
};
const useUpdateViewAction = (actionCallback)=>{
    const form = (0, schema_namespaceObject.useForm)();
    const { message } = external_antd_namespaceObject.App.useApp();
    const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
    const { resource, targetKey } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const { [targetKey]: filterByTk } = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    return {
        async run () {
            var _res_data;
            await form.submit();
            const res = await resource.update({
                filterByTk,
                values: form.values
            });
            null == actionCallback || actionCallback(filterByTk, null == res ? void 0 : null === (_res_data = res.data) || void 0 === _res_data ? void 0 : _res_data.data);
            message.success(t('Save successfully.'));
        }
    };
};
const useMoveAction = ()=>{
    const { resource } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const { refresh } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    return {
        async move (from, to) {
            await resource.move({
                sourceId: from.id,
                targetId: to.id
            });
            refresh();
        }
    };
};
const useUpdateAction = (actionCallback)=>{
    const field = (0, schema_namespaceObject.useField)();
    const form = (0, schema_namespaceObject.useForm)();
    const ctx = (0, external_schema_component_index_js_namespaceObject.useActionContext)();
    const { refresh } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const { resource, targetKey } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const { [targetKey]: filterByTk } = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    return {
        async run () {
            await form.submit();
            field.data = field.data || {};
            field.data.loading = true;
            try {
                var _res_data;
                const res = await resource.update({
                    filterByTk,
                    values: form.values
                });
                ctx.setVisible(false);
                null == actionCallback || actionCallback(filterByTk, null == res ? void 0 : null === (_res_data = res.data) || void 0 === _res_data ? void 0 : _res_data.data);
                await form.reset();
                refresh();
            } catch (e) {
                console.error(e);
            } finally{
                field.data.loading = false;
            }
        }
    };
};
const useDestroyAction = (actionCallback)=>{
    const { refresh } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const { resource, targetKey } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const { [targetKey]: filterByTk } = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    return {
        async run () {
            await resource.destroy({
                filterByTk
            });
            null == actionCallback || actionCallback(filterByTk);
            refresh();
        }
    };
};
const useBulkDestroyAction = (actionCallback)=>{
    const { state, setState, refresh } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    const { resource } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const { message } = external_antd_namespaceObject.App.useApp();
    const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
    return {
        async run () {
            var _state_selectedRowKeys;
            if (!(null == state ? void 0 : null === (_state_selectedRowKeys = state.selectedRowKeys) || void 0 === _state_selectedRowKeys ? void 0 : _state_selectedRowKeys.length)) return message.error(t('Please select the records you want to delete'));
            await resource.destroy({
                filterByTk: (null == state ? void 0 : state.selectedRowKeys) || []
            });
            null == actionCallback || actionCallback(null == state ? void 0 : state.selectedRowKeys);
            null == setState || setState({
                selectedRowKeys: []
            });
            refresh();
        }
    };
};
const useValuesFromRA = (options)=>{
    const ctx = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    return (0, index_js_namespaceObject.useRequest)(()=>Promise.resolve(ctx.data), {
        ...options,
        refreshDeps: [
            ctx.data
        ]
    });
};
const useCreateActionAndRefreshCM = ()=>{
    const { run } = useCreateAction();
    const { refreshCM } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    return {
        async run () {
            await run();
            await refreshCM();
        }
    };
};
const useUpdateActionAndRefreshCM = ()=>{
    const { run } = useUpdateAction();
    const { refreshCM } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    return {
        async run () {
            await run();
            await refreshCM();
        }
    };
};
const useDestroyActionAndRefreshCM = ()=>{
    const { run } = useDestroyAction();
    const { refreshCM } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    return {
        async run () {
            await run();
            await refreshCM();
        }
    };
};
const useDeleteButtonDisabled = (record)=>{
    const recordFromProvider = (0, external_record_provider_index_js_namespaceObject.useRecord)();
    return isDeleteButtonDisabled(record || recordFromProvider);
};
const isDeleteButtonDisabled = (record)=>{
    const { interface: i, deletable = true } = record || {};
    return !deletable || 'id' === i;
};
const useBulkDestroyActionAndRefreshCM = ()=>{
    const { run } = useBulkDestroyAction();
    const { refreshCM } = (0, external_index_js_namespaceObject.useCollectionManager_deprecated)();
    return {
        async run () {
            await run();
            await refreshCM();
        }
    };
};
const useFilterActionProps = ()=>{
    var _service_state_params, _service_state;
    const { collection } = (0, external_ResourceActionProvider_js_namespaceObject.useResourceContext)();
    const options = (0, useFilterActionProps_js_namespaceObject.useFilterFieldOptions)(collection.fields);
    const service = (0, external_ResourceActionProvider_js_namespaceObject.useResourceActionContext)();
    return (0, useFilterActionProps_js_namespaceObject.useFilterFieldProps)({
        options: options.filter((option)=>[
                'title',
                'name'
            ].includes(option.name)),
        params: (null === (_service_state = service.state) || void 0 === _service_state ? void 0 : null === (_service_state_params = _service_state.params) || void 0 === _service_state_params ? void 0 : _service_state_params[0]) || service.params,
        service
    });
};
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
});
