/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Fragment, h } from "@stencil/core";
import { Euler, Quaternion, Vector3 } from "@vertexvis/geometry";
import classNames from "classnames";
const viewCubeSides = {
    front: {
        direction: Vector3.back(),
        quaternion: Quaternion.create(),
    },
    back: {
        direction: Vector3.forward(),
        quaternion: Quaternion.fromAxisAngle(Vector3.up(), Math.PI),
    },
    left: {
        direction: Vector3.left(),
        quaternion: Quaternion.fromAxisAngle(Vector3.down(), Math.PI / 2),
    },
    right: {
        direction: Vector3.right(),
        quaternion: Quaternion.fromAxisAngle(Vector3.up(), Math.PI / 2),
    },
    top: {
        direction: Vector3.up(),
        quaternion: Quaternion.fromAxisAngle(Vector3.right(), -Math.PI / 2),
    },
    bottom: {
        direction: Vector3.down(),
        quaternion: Quaternion.fromAxisAngle(Vector3.left(), -Math.PI / 2),
    },
};
export const TriadAxis = ({ label, length, rotationAxis, }) => {
    const axisStyles = { width: `${length + 5}px` };
    const quaternion = Quaternion.fromAxisAngle(rotationAxis, Math.PI / 2);
    const labelPos = Vector3.scale(length + 15, Vector3.right());
    return (h(Fragment, null, h("vertex-viewer-dom-group", { quaternion: quaternion }, h("vertex-viewer-dom-element", { style: axisStyles, billboardOff: true, interactionsOff: true }, h("div", { class: `triad-axis triad-axis-${label.toLowerCase()}` })), h("vertex-viewer-dom-element", { rotation: Euler.create({ x: Math.PI / 2, y: 0, z: 0 }), style: axisStyles, billboardOff: true, interactionsOff: true }, h("div", { class: `triad-axis triad-axis-${label.toLowerCase()}` })), h("vertex-viewer-dom-element", { position: labelPos, interactionsOff: true }, h("div", { class: `triad-label triad-label-${label.toLowerCase()}` }, label)))));
};
export const ViewCubeSide = ({ label, length, side, disabled, onPointerDown, }) => {
    const { direction, quaternion } = viewCubeSides[side];
    const position = Vector3.scale(length / 2 - 0.1, direction);
    return (h("vertex-viewer-dom-element", { class: classNames('cube-side', { disabled }), position: position, quaternion: quaternion, style: { width: `${length}px`, height: `${length}px` }, onPointerDown: onPointerDown, billboardOff: true }, h("div", { class: `cube-side-face cube-side-face-${label.toLowerCase()}` }, label)));
};
export const ViewCubeCorner = ({ length, face1Side, face1Corner, face2Side, face2Corner, face3Side, face3Corner, disabled, onPointerDown, }) => {
    const { direction: dir1, quaternion: rot1 } = viewCubeSides[face1Side];
    const { direction: dir2, quaternion: rot2 } = viewCubeSides[face2Side];
    const { direction: dir3, quaternion: rot3 } = viewCubeSides[face3Side];
    const position1 = Vector3.scale(length / 2, dir1);
    const position2 = Vector3.scale(length / 2, dir2);
    const position3 = Vector3.scale(length / 2, dir3);
    const styles = { width: `${length}px`, height: `${length}px` };
    return (h("vertex-viewer-dom-group", { class: classNames('cube-corner', { disabled }), onPointerDown: onPointerDown }, h("vertex-viewer-dom-element", { position: position1, quaternion: rot1, style: styles, billboardOff: true }, h("div", { class: `cube-corner-face ${face1Corner}` })), h("vertex-viewer-dom-element", { position: position2, quaternion: rot2, style: styles, billboardOff: true }, h("div", { class: `cube-corner-face ${face2Corner}` })), h("vertex-viewer-dom-element", { position: position3, quaternion: rot3, style: styles, billboardOff: true }, h("div", { class: `cube-corner-face ${face3Corner}` }))));
};
export const ViewCubeEdge = ({ length, face1Side, face2Side, face1Edge, face2Edge, disabled, onPointerDown, }) => {
    const { direction: dir1, quaternion: rot1 } = viewCubeSides[face1Side];
    const { direction: dir2, quaternion: rot2 } = viewCubeSides[face2Side];
    const position1 = Vector3.scale(length / 2, dir1);
    const position2 = Vector3.scale(length / 2, dir2);
    const styles = { width: `${length}px`, height: `${length}px` };
    return (h("vertex-viewer-dom-group", { class: classNames('cube-edge', { disabled }), onPointerDown: onPointerDown }, h("vertex-viewer-dom-element", { position: position1, quaternion: rot1, style: styles, billboardOff: true }, h("div", { class: `cube-edge-face ${face1Edge}` })), h("vertex-viewer-dom-element", { position: position2, quaternion: rot2, style: styles, billboardOff: true }, h("div", { class: `cube-edge-face ${face2Edge}` }))));
};
export const ViewCubeShadow = ({ length, }) => {
    const { direction, quaternion } = viewCubeSides.top;
    const position = Vector3.scale(-length / 2, direction);
    return (h("vertex-viewer-dom-element", { class: "cube-shadow", position: position, quaternion: quaternion, style: { width: `${length}px`, height: `${length}px` }, billboardOff: true, interactionsOff: true }, h("div", { class: "cube-shadow-face" })));
};
//# sourceMappingURL=viewer-view-cube-components.js.map
