function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _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) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Segmented } from 'antd';
// @ts-ignore
import { locales } from '@pisell/utils';
import useEngineContext from "../../hooks/useEngineContext";
import { request } from "../../utils";
import { withResponsive } from "../../responsive";
import RefreshableSaleDetail from "./components/RefreshableSaleDetail";
import GlobalSearchFind from "./components/GlobalSearchFind";
import { ALL_TAB_KEY } from "./types";
import { useProviderSearch, useResizablePane } from "./hooks";
import GroupedResults from "./components/GroupedResults";
import SingleProviderResults from "./components/SingleProviderResults";
import ScopeBar from "./components/ScopeBar";
import "./components/ScopeBar.less";
import { getLocaleLabel } from "./utils/getLocaleLabel";
import { getGlobalSearchText, normalizeGlobalSearchLocale } from "./utils/i18nText";
import localeTexts from "./locales";
import { allProviders } from "./providers";
import { buildOrderDetailRefreshFingerprints, bumpOrderDetailRefreshVersions, getDetailRefreshVersion } from "./utils/detailRefresh";
import "./PisellGlobalSearchFullPage.less";

/**
 * 当前选中、要在右侧（桌面）/抽屉（手机）内联展示详情的记录。
 * providerKey 决定用哪个详情组件渲染（目前仅 order → SaleDetail）。
 */

/**
 * PisellGlobalSearchFullPage 全局搜索 · 整页形态（目前唯一对外形态）
 *
 * - 占满 admin 路由的一个 page；
 * - 大搜索 Panel：Input + 独立"搜索"按钮 + Mode 切换（点按 / 回车提交）；
 * - 搜索 Panel 下面紧跟一个 Radio.Group 范围切换（All / Orders ...）；
 * - 双栏 body：左 = 结果区，右 = 管理模式下的订单详情侧栏（桌面）；
 * - **不走 PisellLookup 弹层**，直接在页面内组装 useProviderSearch + 结果组件，避免再套一层 modal。
 *
 * 与底层 PisellGlobalSearch 共享：providers 协议、useProviderSearch hook、结果组件、locales。
 */

/* ---------------------------------- 组件 ---------------------------------- */

var PisellGlobalSearchFullPageInner = function PisellGlobalSearchFullPageInner(_ref) {
  var _locales$getLocale, _ctx$appHelper, _enabledProviders$0$k, _enabledProviders$, _enabledProviders$0$k2, _enabledProviders$2;
  var placeholder = _ref.placeholder,
    providers = _ref.providers,
    permissionContext = _ref.permissionContext,
    navigate = _ref.navigate,
    _ref$showModeSwitch = _ref.showModeSwitch,
    showModeSwitch = _ref$showModeSwitch === void 0 ? true : _ref$showModeSwitch,
    _ref$defaultMode = _ref.defaultMode,
    defaultMode = _ref$defaultMode === void 0 ? 'business' : _ref$defaultMode,
    modeProp = _ref.mode,
    onModeChange = _ref.onModeChange,
    modeOptions = _ref.modeOptions,
    _ref$allModePageSize = _ref.allModePageSize,
    allModePageSize = _ref$allModePageSize === void 0 ? 5 : _ref$allModePageSize,
    _ref$singleModePageSi = _ref.singleModePageSize,
    singleModePageSize = _ref$singleModePageSi === void 0 ? 20 : _ref$singleModePageSi,
    _ref$enableScanner = _ref.enableScanner,
    enableScanner = _ref$enableScanner === void 0 ? true : _ref$enableScanner,
    _ref$historyKey = _ref.historyKey,
    historyKey = _ref$historyKey === void 0 ? 'pisell_global_search_history' : _ref$historyKey,
    _ref$maxHistoryCount = _ref.maxHistoryCount,
    maxHistoryCount = _ref$maxHistoryCount === void 0 ? 10 : _ref$maxHistoryCount,
    variant = _ref.variant,
    className = _ref.className,
    style = _ref.style;
  // ---------- 多语言 ----------
  var ctx = useEngineContext();
  var locale = normalizeGlobalSearchLocale((_locales$getLocale = locales.getLocale) === null || _locales$getLocale === void 0 ? void 0 : _locales$getLocale.call(locales));
  locales.init(localeTexts, locale);

  // ---------- 请求客户端 ----------
  // 注入 engine 的 request，供真实 Provider（salesProvider → ES 接口）使用。
  // 与 PisellSalesManagement 一致：在渲染期同步 setRequest（幂等），保证 search() 触发前已就绪。
  if (ctx !== null && ctx !== void 0 && (_ctx$appHelper = ctx.appHelper) !== null && _ctx$appHelper !== void 0 && (_ctx$appHelper = _ctx$appHelper.utils) !== null && _ctx$appHelper !== void 0 && _ctx$appHelper.request) {
    request.setRequest(ctx.appHelper.utils.request);
  }

  // ---------- providers ----------
  var effectiveProviders = useMemo(function () {
    if (Array.isArray(providers) && providers.length > 0) return providers;
    // 未显式传 providers（典型为 lowcode 画布，providers 函数无法 JSON 序列化）：
    // 回退到内置真实业务 providers（走 ES `/shop/es/search/sales`）。
    return allProviders;
  }, [providers]);
  var enabledProviders = useMemo(function () {
    var list = effectiveProviders.filter(function (p) {
      return p && p.enabledWhen ? p.enabledWhen(permissionContext !== null && permissionContext !== void 0 ? permissionContext : {}) : Boolean(p);
    });
    return _toConsumableArray(list).sort(function (a, b) {
      var _a$order, _b$order;
      return ((_a$order = a.order) !== null && _a$order !== void 0 ? _a$order : Number.MAX_SAFE_INTEGER) - ((_b$order = b.order) !== null && _b$order !== void 0 ? _b$order : Number.MAX_SAFE_INTEGER);
    });
  }, [effectiveProviders, permissionContext]);

  // ---------- 输入 / keyword（提交式） ----------
  var _useState = useState(''),
    _useState2 = _slicedToArray(_useState, 2),
    inputValue = _useState2[0],
    setInputValue = _useState2[1];
  var _useState3 = useState(''),
    _useState4 = _slicedToArray(_useState3, 2),
    keyword = _useState4[0],
    setKeyword = _useState4[1];

  // ---------- 选中详情（仅桌面/大屏：行点击 → 右侧内联详情） ----------
  // 大屏（pos / desktop）：在右侧可拖拽栏内联展示订单详情；
  // 中小屏（手机 / iPad）：不接管行点击，交还给表格自身的订单详情抽屉
  //   （useOrderPerspective 未拿到 onOpenDetail 时会走引擎 action pisell1.handleOpenSaleDetail），
  //   不再自绘抽屉。
  var useDrawerDetail = variant === 'phone' || variant === 'smallTablet' || variant === 'tablet';
  var _useState5 = useState(null),
    _useState6 = _slicedToArray(_useState5, 2),
    selectedDetail = _useState6[0],
    setSelectedDetail = _useState6[1];
  var detailRefreshFingerprintsRef = useRef({});
  var _useState7 = useState({}),
    _useState8 = _slicedToArray(_useState7, 2),
    detailRefreshVersions = _useState8[0],
    setDetailRefreshVersions = _useState8[1];
  var handleOpenDetail = useCallback(function (_ref2) {
    var providerKey = _ref2.providerKey,
      id = _ref2.id;
    if (id === undefined || id === null || id === '') return;
    setSelectedDetail({
      providerKey: providerKey,
      id: id
    });
  }, []);
  // 仅大屏接管行点击做右侧内联详情；中小屏传 undefined，让表格走原生订单详情抽屉。
  var effectiveOpenDetail = useDrawerDetail ? undefined : handleOpenDetail;
  // 关键词变化（重新搜索）时清掉旧详情，避免展示与当前结果无关的订单
  useEffect(function () {
    setSelectedDetail(null);
    detailRefreshFingerprintsRef.current = {};
    setDetailRefreshVersions({});
  }, [keyword]);
  var handleRealtimePatchItems = useCallback(function (providerKey, items) {
    if (providerKey !== 'order') return;
    setDetailRefreshVersions(function (prev) {
      var fingerprints = buildOrderDetailRefreshFingerprints(items);
      var nextFingerprints = _objectSpread({}, detailRefreshFingerprintsRef.current);
      var changedFingerprintIds = Object.entries(fingerprints).filter(function (_ref3) {
        var _ref4 = _slicedToArray(_ref3, 2),
          id = _ref4[0],
          fingerprint = _ref4[1];
        return nextFingerprints[id] !== fingerprint;
      }).map(function (_ref5) {
        var _ref6 = _slicedToArray(_ref5, 2),
          id = _ref6[0],
          fingerprint = _ref6[1];
        nextFingerprints[id] = fingerprint;
        return id;
      });
      detailRefreshFingerprintsRef.current = nextFingerprints;
      var effectiveItems = Array.isArray(items) ? items.filter(function (item) {
        var _ref7, _item$order_id;
        return changedFingerprintIds.includes(String((_ref7 = (_item$order_id = item === null || item === void 0 ? void 0 : item.order_id) !== null && _item$order_id !== void 0 ? _item$order_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref7 !== void 0 ? _ref7 : item === null || item === void 0 ? void 0 : item.key));
      }) : [];
      var next = bumpOrderDetailRefreshVersions(prev, effectiveItems);
      return next;
    });
  }, []);

  // 左结果 / 右详情两栏可拖拽宽度
  var _useResizablePane = useResizablePane({
      initialRatio: 0.36
    }),
    rightWidth = _useResizablePane.rightWidth,
    bodyRef = _useResizablePane.containerRef,
    onResizerMouseDown = _useResizablePane.onResizerMouseDown,
    resizing = _useResizablePane.resizing;

  // ---------- mode（受控/非受控） ----------
  var _useState9 = useState(defaultMode),
    _useState10 = _slicedToArray(_useState9, 2),
    innerMode = _useState10[0],
    setInnerMode = _useState10[1];
  var mode = modeProp !== null && modeProp !== void 0 ? modeProp : innerMode;
  var handleModeChange = useCallback(function (next) {
    if (modeProp === undefined) setInnerMode(next);
    onModeChange === null || onModeChange === void 0 || onModeChange(next);
  }, [modeProp, onModeChange]);

  // ---------- activeTab ----------
  // 始终展示 All（只要有 provider）。`showAllTab` prop 已 deprecated 被忽略。
  var effectiveShowAllTab = enabledProviders.length >= 1;
  var _useState11 = useState(
    // 初始 Tab 固定为 All（只要展示 All）；不再受外部 defaultActiveTab 控制，
    // 避免 lowcode schema 里固化的旧值（如 order）覆盖默认。
    effectiveShowAllTab ? ALL_TAB_KEY : (_enabledProviders$0$k = (_enabledProviders$ = enabledProviders[0]) === null || _enabledProviders$ === void 0 ? void 0 : _enabledProviders$.key) !== null && _enabledProviders$0$k !== void 0 ? _enabledProviders$0$k : ALL_TAB_KEY),
    _useState12 = _slicedToArray(_useState11, 2),
    innerActiveTab = _useState12[0],
    setInnerActiveTab = _useState12[1];
  var resolvedInnerActiveTab = !effectiveShowAllTab && innerActiveTab === ALL_TAB_KEY ? (_enabledProviders$0$k2 = (_enabledProviders$2 = enabledProviders[0]) === null || _enabledProviders$2 === void 0 ? void 0 : _enabledProviders$2.key) !== null && _enabledProviders$0$k2 !== void 0 ? _enabledProviders$0$k2 : ALL_TAB_KEY : innerActiveTab;
  var activeTab = resolvedInnerActiveTab;

  // ---------- 搜索调度 ----------
  var _useProviderSearch = useProviderSearch({
      keyword: keyword,
      activeTab: activeTab,
      providers: enabledProviders,
      allModePageSize: allModePageSize,
      singleModePageSize: singleModePageSize,
      mode: mode,
      onRealtimePatchItems: handleRealtimePatchItems
    }),
    stateMap = _useProviderSearch.stateMap;

  // ---------- 提交搜索 ----------
  // 历史记录由搜索框（PisellFind / PisellLookup）内置管理（写入同一个 historyKey），
  // 这里只负责把提交的关键词喂给搜索调度。
  var handleSubmit = useCallback(function (raw) {
    setKeyword((raw !== null && raw !== void 0 ? raw : inputValue).trim());
  }, [inputValue]);

  // ---------- mode 控件 ----------
  var modeSegmentOptions = useMemo(function () {
    var adminLabel = modeOptions !== null && modeOptions !== void 0 && modeOptions.admin ? getLocaleLabel(modeOptions.admin, locale) : getGlobalSearchText('pisell-global-search.mode.admin');
    var businessLabel = modeOptions !== null && modeOptions !== void 0 && modeOptions.business ? getLocaleLabel(modeOptions.business, locale) : getGlobalSearchText('pisell-global-search.mode.business');
    return [{
      label: businessLabel,
      value: 'business'
    }, {
      label: adminLabel,
      value: 'admin'
    }];
  }, [modeOptions, locale]);

  // ---------- 搜索范围选项（ScopeBar 用） ----------
  var scopeOptions = useMemo(function () {
    var items = enabledProviders.map(function (p) {
      return {
        value: p.key,
        label: /*#__PURE__*/React.createElement("span", {
          className: "pisell-global-search-scope-bar__option"
        }, p.icon, getLocaleLabel(p.label, locale))
      };
    });
    if (effectiveShowAllTab) {
      items.unshift({
        value: ALL_TAB_KEY,
        label: /*#__PURE__*/React.createElement("span", {
          className: "pisell-global-search-scope-bar__option"
        }, getGlobalSearchText('pisell-global-search.tab.all'))
      });
    }
    return items;
  }, [enabledProviders, effectiveShowAllTab, locale]);

  // ---------- 结果区 ----------
  var isAll = activeTab === ALL_TAB_KEY;
  var close = useCallback(function () {
    /* 整页形态无弹层可关；保留空函数以满足 ctx 协议 */
  }, []);

  /**
   * 当前结果区是否走 provider.renderResults 完全自定义渲染（如订单表格）。
   * 此类内容（表格 / 自带 toolbar / 自带卡片）通常不需要外层再套一圈卡片样式，
   * 用 `__main--bare` 取消 main 容器的 border + padding，避免视觉双层框。
   */
  var isCustomSingleResults = useMemo(function () {
    if (!keyword || isAll) return false;
    var provider = enabledProviders.find(function (p) {
      return p.key === activeTab;
    });
    return !!(provider !== null && provider !== void 0 && provider.renderResults);
  }, [keyword, isAll, enabledProviders, activeTab]);
  var renderResultsBody = function renderResultsBody() {
    var _stateMap$provider$ke;
    // 空 keyword：主区显示 idle 提示（历史记录由搜索框内置承载，聚焦时弹出）
    if (!keyword) {
      return /*#__PURE__*/React.createElement("div", {
        className: "pisell-global-search-fp__empty"
      }, getGlobalSearchText('pisell-global-search.empty.idle'));
    }

    // 有 keyword 时走真正结果区
    if (isAll) {
      return /*#__PURE__*/React.createElement(GroupedResults, {
        providers: enabledProviders,
        stateMap: stateMap,
        keyword: keyword,
        mode: mode,
        locale: locale,
        onJumpTab: function onJumpTab(tab) {
          return setInnerActiveTab(tab);
        },
        onClose: close,
        navigate: navigate,
        onOpenDetail: effectiveOpenDetail,
        onRealtimePatchItems: handleRealtimePatchItems,
        detailRefreshVersions: detailRefreshVersions
      });
    }
    var provider = enabledProviders.find(function (p) {
      return p.key === activeTab;
    });
    if (!provider) return null;
    var state = (_stateMap$provider$ke = stateMap[provider.key]) !== null && _stateMap$provider$ke !== void 0 ? _stateMap$provider$ke : {
      loading: false,
      list: [],
      total: 0
    };
    return /*#__PURE__*/React.createElement(SingleProviderResults, {
      provider: provider,
      state: state,
      keyword: keyword,
      mode: mode,
      onClose: close,
      navigate: navigate,
      onOpenDetail: effectiveOpenDetail,
      onRealtimePatchItems: handleRealtimePatchItems,
      detailRefreshVersions: detailRefreshVersions
    });
  };

  /**
   * 详情内容（与设备无关）：目前仅 order 域 → SaleDetail 内联渲染。
   * 用独立 osKey 与宿主抽屉（sales-management-item-detail）隔离，互不干扰。
   */
  var renderDetailContent = function renderDetailContent() {
    if (!selectedDetail) {
      return /*#__PURE__*/React.createElement("div", {
        className: "pisell-global-search-fp__detail-idle"
      }, getGlobalSearchText('pisell-global-search.detail.idle'));
    }
    if (selectedDetail.providerKey === 'order') {
      var refreshVersion = getDetailRefreshVersion(detailRefreshVersions, 'order', selectedDetail.id);
      // key / osKey 仅按订单 id 稳定；实时刷新通过 ref 命令式就地刷新，避免版本变化导致整块 remount 闪烁。
      var osKey = "global-search-order-detail-".concat(selectedDetail.id);
      return /*#__PURE__*/React.createElement(RefreshableSaleDetail, {
        key: osKey,
        refreshVersion: refreshVersion,
        renderType: "current"
        // 显式对齐宿主表格抽屉内层：固定模板 A + 平板变体（覆盖 withResponsive 注入的 desktop），
        // 使右栏内联详情与点行弹出的抽屉里版式一致。
        ,
        tmpl: "B",
        variant: "tablet"
        // 右栏够宽时把金额明细 + 操作按钮抽到右侧第二列、按钮一行一个。
        ,
        summaryTwoColumn: true,
        osProps: {
          osKey: osKey,
          orderId: Number(selectedDetail.id),
          autoBootstrap: true
        }
      });
    }
    return null;
  };

  // 右侧内联详情仅在「桌面/大屏 + 管理模式（表格）」生效：
  // 管理模式才有表格 → 点行 → 右栏内联看详情；
  // 中小屏（手机 / iPad）不在此并排，点行走表格自身的订单详情抽屉；
  // 业务模式（精确搜索）整块内容区直接就是详情（由 order provider 渲染），不需要右栏。
  var showDetailAside = !useDrawerDetail && !!keyword && mode === 'admin';

  // ---------- 渲染 ----------
  return /*#__PURE__*/React.createElement("div", {
    className: "pisell-global-search-fp pisell-global-search-fp--".concat(variant || 'desktop', " ").concat(className !== null && className !== void 0 ? className : '').trim(),
    style: style
  }, /*#__PURE__*/React.createElement("section", {
    className: "pisell-global-search-fp__search-panel"
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-global-search-fp__search-row"
  }, /*#__PURE__*/React.createElement(GlobalSearchFind, {
    className: "pisell-global-search-fp__find",
    displayType: "inline"
    // 默认 true：监听宿主全局 `nativeScanResult`。注意宿主全局扫码桥
    // （createGlobalScanHostBridge）也订阅同一事件，二者同时生效会串扰；
    // 这是有意的默认入口，若需规避请把 enableScanner 显式置为 false。
    ,
    enableScanner: enableScanner
    // 手机端用小号输入框，节省竖向空间
    ,
    size: variant === 'phone' ? 'small' : undefined,
    showHistory: true,
    historyKey: historyKey,
    maxHistoryCount: maxHistoryCount,
    placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : getGlobalSearchText('pisell-global-search.placeholder'),
    confirmButtonText: getGlobalSearchText('pisell-global-search.search'),
    value: inputValue,
    onChange: setInputValue,
    onSearch: function onSearch(v) {
      return handleSubmit(v);
    }
  }), showModeSwitch && /*#__PURE__*/React.createElement("div", {
    className: "pisell-global-search-fp__mode-switch"
  }, /*#__PURE__*/React.createElement(Segmented, {
    options: modeSegmentOptions,
    value: mode,
    onChange: function onChange(v) {
      return handleModeChange(v);
    }
  }))), /*#__PURE__*/React.createElement(ScopeBar, {
    options: scopeOptions,
    value: activeTab,
    onChange: function onChange(v) {
      return setInnerActiveTab(v);
    }
  })), /*#__PURE__*/React.createElement("div", {
    className: "pisell-global-search-fp__body".concat(resizing ? ' pisell-global-search-fp__body--resizing' : ''),
    ref: bodyRef
  }, /*#__PURE__*/React.createElement("main", {
    className: "pisell-global-search-fp__main".concat(isCustomSingleResults ? ' pisell-global-search-fp__main--bare' : '')
  }, renderResultsBody()), showDetailAside && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-global-search-fp__resizer",
    onMouseDown: onResizerMouseDown,
    role: "separator",
    "aria-orientation": "vertical"
  }), /*#__PURE__*/React.createElement("aside", {
    className: "pisell-global-search-fp__detail",
    style: {
      flex: "0 0 ".concat(rightWidth),
      width: rightWidth
    }
  }, renderDetailContent()))));
};
PisellGlobalSearchFullPageInner.displayName = 'PisellGlobalSearchFullPage';

/**
 * 对外导出：用 withResponsive 包裹，注入 `variant`（phone/desktop/...），
 * 用于「桌面右栏详情 / 手机抽屉详情」的分支与根节点 variant class。
 */
export var PisellGlobalSearchFullPage = withResponsive(PisellGlobalSearchFullPageInner);
export default PisellGlobalSearchFullPage;