/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
export const DEFAULT_SCENE_TREE_OP_ANIMATION_MS = 500;
export async function showItem(viewer, id, { suppliedCorrelationId } = {}) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => op.items.where((q) => q.withItemId(id)).show())
        .execute({ suppliedCorrelationId });
}
export async function hideItem(viewer, id, { suppliedCorrelationId } = {}) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => op.items.where((q) => q.withItemId(id)).hide())
        .execute({
        suppliedCorrelationId,
    });
}
export async function selectItem(viewer, id, { append = false, suppliedCorrelationId }) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => [
        ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),
        op.items.where((q) => q.withItemId(id)).select(),
    ])
        .execute({ suppliedCorrelationId });
}
export async function selectRangeInSceneTree(viewer, start, end, { append = true, suppliedCorrelationId }) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => [
        ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),
        op.items.where((q) => q.withSceneTreeRange({ start, end })).select(),
    ])
        .execute({
        suppliedCorrelationId,
    });
}
export async function selectFilterResults(viewer, filter, keys, exactMatch, removeHiddenResults, { append = false, suppliedCorrelationId }) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => [
        ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),
        op.items
            .where((q) => q.withMetadata(filter, keys, exactMatch, removeHiddenResults))
            .select(),
    ])
        .execute({
        suppliedCorrelationId,
    });
}
export async function deselectItem(viewer, id, { suppliedCorrelationId } = {}) {
    const scene = await viewer.scene();
    return scene
        .elements((op) => op.items.where((q) => q.withItemId(id)).deselect())
        .execute({
        suppliedCorrelationId,
    });
}
export async function isolateItem(viewer, id, { suppliedCorrelationId, animationDurationMs } = {}) {
    const scene = await viewer.scene();
    await scene
        .elements((op) => [
        op.items.where((q) => q.all()).hide(),
        op.items.where((q) => q.withItemId(id)).show(),
    ])
        .execute({
        suppliedCorrelationId,
    });
    const renderResult = await scene
        .camera()
        .flyTo((q) => q.withItemId(id))
        .render({
        animation: {
            milliseconds: animationDurationMs !== null && animationDurationMs !== void 0 ? animationDurationMs : DEFAULT_SCENE_TREE_OP_ANIMATION_MS,
        },
    });
    await renderResult.onAnimationCompleted.once();
}
//# sourceMappingURL=viewer-ops.js.map
