"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Widget
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TabOutline = void 0;
require("./TabOutline.scss");
const classnames_1 = require("classnames");
const React = require("react");
const DragManager_1 = require("../base/DragManager");
const Widget_1 = require("../widget/Widget");
const DropTargetState_1 = require("../state/DropTargetState");
const SendBack_1 = require("../widget/SendBack");
/** @internal */
function TabOutline() {
    const hidden = useHidden();
    const className = (0, classnames_1.default)("nz-outline-tabOutline", hidden && "nz-hidden");
    return React.createElement("div", { className: className });
}
exports.TabOutline = TabOutline;
function useHidden() {
    const widgetId = React.useContext(Widget_1.WidgetIdContext);
    const targeted = (0, DragManager_1.useTargeted)();
    const activeHomeState = (0, SendBack_1.useSendBackHomeState)();
    return React.useMemo(() => {
        if (activeHomeState?.widgetId === widgetId)
            return false;
        if (!targeted)
            return true;
        if (!(0, DropTargetState_1.isWidgetDropTargetState)(targeted))
            return true;
        if (targeted.widgetId !== widgetId)
            return true;
        return false;
    }, [targeted, widgetId, activeHomeState]);
}
//# sourceMappingURL=TabOutline.js.map