"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__, {
    SearchAndJumpProvider: ()=>SearchAndJumpProvider,
    SearchAndJumpContext: ()=>SearchAndJumpContext,
    useSearchAndJump: ()=>useSearchAndJump,
    SearchAndJump: ()=>SearchAndJump
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_react_namespaceObject = require("react");
const external_antd_namespaceObject = require("antd");
const SearchAndJumpContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({
    open: false,
    setOpen: (open)=>{}
});
const SearchAndJumpProvider = (param)=>{
    let { children } = param;
    const [open, setOpen] = (0, external_react_namespaceObject.useState)(false);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(SearchAndJumpContext.Provider, {
        value: {
            open,
            setOpen
        },
        children: [
            children,
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SearchAndJump, {
                open: open,
                setOpen: setOpen
            })
        ]
    });
};
const useSearchAndJump = ()=>(0, external_react_namespaceObject.useContext)(SearchAndJumpContext);
const SearchAndJump = (param)=>{
    let { open, setOpen } = param;
    const inputRef = (0, external_react_namespaceObject.useRef)();
    (0, external_react_namespaceObject.useEffect)(()=>{
        if (open && inputRef.current) setTimeout(()=>{
            inputRef.current.focus();
        }, 0);
    }, [
        open,
        inputRef
    ]);
    const handleOk = ()=>{
        setOpen(false);
    };
    const handleCancel = ()=>{
        setOpen(false);
    };
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Modal, {
        title: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
            style: {
                width: '100%'
            },
            autoFocus: true,
            ref: inputRef
        }),
        closable: false,
        open: open,
        onOk: handleOk,
        onCancel: handleCancel,
        footer: null,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {})
    });
};
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
});
