("delivery_folder_pick").catch(() => null);
@@ -230,6 +237,13 @@ function CardJobRow({ job, onRemove, onStop }: { job: CardJob; onRemove: () => v
{job.status === "stopped" && {t.card.stopped}}
{scan && {scan}
}
+ {job.scan?.freeBytes != null && (
+
+ {t.card.free(human(job.scan.freeBytes))}
+ {job.scan.fits === true ? ` · ${t.card.fits}` : ""}
+ {job.scan.fits === false ? ` · ${t.card.notAll}` : ""}
+
+ )}
{job.status === "running" && job.progress && (
<>
diff --git a/apps/app/src/library/MergeButton.tsx b/apps/app/src/library/MergeButton.tsx
new file mode 100644
index 0000000..a555eb3
--- /dev/null
+++ b/apps/app/src/library/MergeButton.tsx
@@ -0,0 +1,74 @@
+import type { PhotoSummary } from "@photoreport/contracts";
+import type { ApiClient } from "@photoreport/sdk";
+import { useRef, useState } from "react";
+import { t } from "../i18n.js";
+import { MergeError, mergeIntoCollection } from "./mergeExposures.js";
+
+/**
+ * "Fundir exposições": the selection (or every detected bracket in the folder) becomes a linear DNG
+ * in this collection. The originals stay. The editor's own controls do the finish.
+ */
+export function MergeButton({
+ api,
+ orgId,
+ eventId,
+ photos,
+ selectedIds,
+}: {
+ api: ApiClient;
+ orgId: string;
+ /** Null is the inbox. */
+ eventId: string | null;
+ photos: readonly PhotoSummary[];
+ selectedIds: readonly string[];
+}) {
+ const [status, setStatus] = useState(null);
+ const [failed, setFailed] = useState(false);
+ const [busy, setBusy] = useState(false);
+ const pending = useRef(false);
+
+ const run = async () => {
+ if (pending.current) return;
+ pending.current = true;
+ setBusy(true);
+ setFailed(false);
+ setStatus(t.merge.reading);
+ try {
+ const made = await mergeIntoCollection({
+ api,
+ orgId,
+ eventId,
+ photos,
+ selectedIds,
+ onStatus: (stack, total) => setStatus(t.merge.working(stack, total)),
+ });
+ setStatus(t.merge.done(made));
+ } catch (err) {
+ const code = err instanceof MergeError ? err.code : "failed";
+ setStatus(t.merge.errors[code] ?? t.merge.errors.failed);
+ setFailed(true);
+ } finally {
+ pending.current = false;
+ setBusy(false);
+ }
+ };
+
+ return (
+
+
+ {status && (
+
+ {status}
+
+ )}
+
+ );
+}
diff --git a/apps/app/src/library/cardJobs.ts b/apps/app/src/library/cardJobs.ts
index 5903ac6..54a8353 100644
--- a/apps/app/src/library/cardJobs.ts
+++ b/apps/app/src/library/cardJobs.ts
@@ -16,6 +16,10 @@ export interface CardScan {
jpeg: number;
other: number;
bytes: number;
+ /** Free bytes on the destination. Absent on a shell that does not report it. */
+ freeBytes?: number;
+ /** False when the card would not fit, with a gigabyte left over. */
+ fits?: boolean;
}
export interface CardResult {
@@ -116,6 +120,22 @@ function ensureProgress() {
});
}
+/** Asks again, with the destination, so the dialog can show free space. An older shell keeps the first scan. */
+export async function rescanQueued(settings: CardSettings): Promise {
+ const waiting = jobs.filter((job) => job.status === "queued");
+ await Promise.all(
+ waiting.map(async (job) => {
+ try {
+ const scan = await desktopInvoke("card_scan", { source: job.source, settings });
+ const current = jobs.find((item) => item.id === job.id);
+ if (current?.status === "queued") patch(job.id, { scan });
+ } catch {
+ // The installed shell scans without a destination. The counts from enqueue stay.
+ }
+ }),
+ );
+}
+
export async function enqueueCard(source: string): Promise {
const id = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
jobs = [...jobs, { id, source, settings: null, scan: null, status: "queued", progress: null, startedAt: null, result: null, error: null }];
diff --git a/apps/app/src/library/mergeExposures.ts b/apps/app/src/library/mergeExposures.ts
new file mode 100644
index 0000000..119d40a
--- /dev/null
+++ b/apps/app/src/library/mergeExposures.ts
@@ -0,0 +1,113 @@
+import type { PhotoSummary } from "@photoreport/contracts";
+import type { ApiClient } from "@photoreport/sdk";
+import { loadEngine, type EngineModule } from "../develop/engine.js";
+import { localOriginal } from "../platform.js";
+import { MERGE_EDGE, stacksToMerge } from "./mergeStacks.js";
+
+export class MergeError extends Error {
+ constructor(readonly code: "none" | "missing" | "engine" | "failed") {
+ super(code);
+ }
+}
+
+async function loadFrame(photo: PhotoSummary, api: ApiClient): Promise {
+ const local = await localOriginal(photo.sha256);
+ if (local && local.byteLength > 0) return new Uint8Array(local);
+ if (!photo.originalStored) return null;
+ const bytes = await api.originalBytes(photo.id);
+ if (!bytes || bytes.byteLength === 0) return null;
+ return new Uint8Array(bytes);
+}
+
+function rgbaToJpeg(rgba: Uint8Array, width: number, height: number): Promise {
+ const canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ const context = canvas.getContext("2d");
+ if (!context || width <= 0 || height <= 0) return Promise.reject(new Error("canvas"));
+ const pixels = new Uint8ClampedArray(rgba.byteLength);
+ pixels.set(rgba);
+ context.putImageData(new ImageData(pixels, width, height), 0, 0);
+ return new Promise((resolve, reject) => {
+ canvas.toBlob((blob) => (blob ? resolve(blob) : reject(new Error("jpeg"))), "image/jpeg", 0.92);
+ });
+}
+
+/** A neutral JPEG of the linear file, so the grid has something to show before the editor opens the DNG. */
+async function previewOf(engine: EngineModule, dng: Uint8Array): Promise<{ blob: Blob; width: number; height: number }> {
+ const photo = new engine.Photo(dng, 2048);
+ try {
+ photo.render(engine.defaultSettings(), 2048, 2048, false, false);
+ const blob = await rgbaToJpeg(photo.pixels(), photo.width, photo.height);
+ return { blob, width: photo.sourceWidth, height: photo.sourceHeight };
+ } finally {
+ photo.free();
+ }
+}
+
+function stemOf(photo: PhotoSummary): string {
+ const name = photo.originalName || photo.name;
+ const dot = name.lastIndexOf(".");
+ return dot > 0 ? name.slice(0, dot) : name;
+}
+
+/**
+ * Merges the selection, or every detected bracket in the folder, into a linear DNG of the same collection.
+ * The originals stay. One stack at a time: several raws in memory at once is what made a property shoot stall.
+ */
+export async function mergeIntoCollection(opts: {
+ api: ApiClient;
+ orgId: string;
+ eventId: string | null;
+ photos: readonly PhotoSummary[];
+ selectedIds: readonly string[];
+ onStatus?: (stack: number, total: number) => void;
+}): Promise {
+ const stacks = stacksToMerge(opts.photos, opts.selectedIds);
+ if (stacks.length === 0) throw new MergeError("none");
+ const byId = new Map(opts.photos.map((photo) => [photo.id, photo]));
+ let engine: EngineModule;
+ try {
+ engine = await loadEngine();
+ } catch {
+ throw new MergeError("engine");
+ }
+ let made = 0;
+ for (let index = 0; index < stacks.length; index++) {
+ opts.onStatus?.(index + 1, stacks.length);
+ const frames = stacks[index]!.map((id) => byId.get(id)).filter((photo): photo is PhotoSummary => !!photo);
+ if (frames.length < 2) throw new MergeError("none");
+ const files: Uint8Array[] = [];
+ for (const frame of frames) {
+ const bytes = await loadFrame(frame, opts.api);
+ if (!bytes) throw new MergeError("missing");
+ files.push(bytes);
+ }
+ const job = new engine.BracketJob();
+ try {
+ for (const file of files) job.push(file);
+ if (!job.mergeDng) throw new MergeError("engine");
+ const dng = job.mergeDng(MERGE_EDGE);
+ const preview = await previewOf(engine, dng);
+ const mid = frames[Math.floor((frames.length - 1) / 2)]!;
+ const uploaded = await opts.api.uploadPhoto(opts.orgId, preview.blob, `${stemOf(mid)}-fundido.jpg`, {
+ ...(opts.eventId ? { eventId: opts.eventId } : { inbox: true }),
+ silent: true,
+ });
+ const copy = new Uint8Array(dng.byteLength);
+ copy.set(dng);
+ await opts.api.attachLinearDng(uploaded.photo.id, new Blob([copy]), {
+ width: preview.width,
+ height: preview.height,
+ capturedAt: mid.capturedAt,
+ });
+ made += 1;
+ } catch (err) {
+ if (err instanceof MergeError) throw err;
+ throw new MergeError("failed");
+ } finally {
+ job.free();
+ }
+ }
+ return made;
+}
diff --git a/apps/app/src/library/mergeStacks.test.ts b/apps/app/src/library/mergeStacks.test.ts
new file mode 100644
index 0000000..8502ed5
--- /dev/null
+++ b/apps/app/src/library/mergeStacks.test.ts
@@ -0,0 +1,63 @@
+import type { PhotoSummary } from "@photoreport/contracts";
+import { describe, expect, it } from "vitest";
+import { stacksToMerge } from "./mergeStacks.js";
+
+const at = (ms: number) => new Date(Date.parse("2026-10-21T10:00:00.000Z") + ms).toISOString();
+
+function photo(id: string, exposureTime: number, ms: number, name = `${id}.cr3`): PhotoSummary {
+ return {
+ id,
+ eventId: "e1",
+ originalName: name,
+ name,
+ sha256: id.padEnd(64, "a"),
+ originalStored: true,
+ status: "READY",
+ width: 4000,
+ height: 3000,
+ capturedAt: at(ms),
+ cameraModel: "EOS R5",
+ lens: null,
+ focalLength: 16,
+ aperture: 8,
+ exposureTime,
+ iso: 100,
+ rating: 0,
+ flag: "NONE",
+ colorLabel: "NONE",
+ players: [],
+ uploader: null,
+ developSeq: 0,
+ urls: { thumb: "", preview: "", source: "" },
+ };
+}
+
+describe("stacks to merge", () => {
+ const dark = photo("a", 1 / 500, 0);
+ const mid = photo("b", 1 / 125, 200);
+ const bright = photo("c", 1 / 30, 400);
+ const later = photo("d", 1 / 125, 30_000);
+
+ it("finds one angle in the folder when nothing is selected", () => {
+ expect(stacksToMerge([dark, mid, bright, later], [])).toEqual([["a", "b", "c"]]);
+ });
+
+ it("merges the selection even when it is not a detected bracket", () => {
+ expect(stacksToMerge([dark, later], ["a", "d"])).toEqual([["a", "d"]]);
+ });
+
+ it("detects the folder when only the open photo is selected", () => {
+ expect(stacksToMerge([dark, mid, bright], ["a"])).toEqual([["a", "b", "c"]]);
+ });
+
+ it("does nothing when there is no bracket and fewer than two are selected", () => {
+ expect(stacksToMerge([dark, later], ["a"])).toEqual([]);
+ });
+
+ it("does not treat a merged file as another exposure", () => {
+ const merged = photo("m", 1 / 125, 300, "b-fundido.dng");
+ const renamed = photo("n", 1 / 125, 500, "n.dng");
+ renamed.name = "n";
+ expect(stacksToMerge([dark, mid, bright, merged, renamed], [])).toEqual([["a", "b", "c"]]);
+ });
+});
diff --git a/apps/app/src/library/mergeStacks.ts b/apps/app/src/library/mergeStacks.ts
new file mode 100644
index 0000000..0d08298
--- /dev/null
+++ b/apps/app/src/library/mergeStacks.ts
@@ -0,0 +1,51 @@
+import type { PhotoSummary } from "@photoreport/contracts";
+import { groupBrackets, type BracketFrame } from "@photoreport/metadata";
+
+/** The engine's long-side cap for a merge. The DNG is this photo, not the full sensor. */
+export const MERGE_EDGE = 4096;
+
+function isMergedFile(photo: PhotoSummary): boolean {
+ const names = [photo.originalName, photo.name];
+ return names.some((name) => {
+ const lower = name.toLowerCase();
+ return lower.endsWith(".dng") || lower.includes("-fundido");
+ });
+}
+
+export function frameOf(photo: PhotoSummary): BracketFrame {
+ return {
+ id: photo.id,
+ fileName: photo.originalName || photo.name,
+ capturedAt: photo.capturedAt,
+ cameraModel: photo.cameraModel,
+ focalLength: photo.focalLength,
+ aperture: photo.aperture,
+ iso: photo.iso,
+ width: photo.width,
+ height: photo.height,
+ exposureTime: photo.exposureTime,
+ };
+}
+
+function byCapture(a: PhotoSummary, b: PhotoSummary): number {
+ const time = (a.capturedAt ?? "").localeCompare(b.capturedAt ?? "");
+ if (time !== 0) return time;
+ return (a.originalName || a.name).localeCompare(b.originalName || b.name, undefined, { numeric: true, sensitivity: "base" });
+}
+
+/**
+ * Stacks to merge. A selection of two or more is that set (detected into angles when they are brackets,
+ * otherwise one stack in capture order). With nothing selected, every bracket in the folder is a stack.
+ * A DNG already produced here is not an exposure.
+ */
+export function stacksToMerge(photos: readonly PhotoSummary[], selectedIds: readonly string[]): string[][] {
+ const ready = photos.filter((photo) => photo.status === "READY" && !isMergedFile(photo));
+ const selected = new Set(selectedIds);
+ const chosen = selected.size >= 2;
+ const pool = chosen ? ready.filter((photo) => selected.has(photo.id)) : ready;
+ if (pool.length < 2) return [];
+ const grouped = groupBrackets(pool.map(frameOf));
+ if (grouped.stacks.length > 0) return grouped.stacks.map((stack) => stack.frameIds);
+ if (!chosen) return [];
+ return [[...pool].sort(byCapture).map((photo) => photo.id)];
+}
diff --git a/apps/app/src/pages/DevelopPage.tsx b/apps/app/src/pages/DevelopPage.tsx
index c18815c..0395a65 100644
--- a/apps/app/src/pages/DevelopPage.tsx
+++ b/apps/app/src/pages/DevelopPage.tsx
@@ -15,6 +15,7 @@ import { IptcInfo } from "../library/IptcInfo.js";
import { activePhoto, savedFilter, saveFilter, setActivePhoto } from "../library/active.js";
import { FilterBar } from "../library/FilterBar.js";
import { cache } from "../offline/cache.js";
+import { MergeButton } from "../library/MergeButton.js";
import { localPhotos } from "../offline/local.js";
import { isNetworkError, offlineQueue } from "../offline/queue.js";
import { patchPhotos, useOfflineSync } from "../offline/sync.js";
@@ -219,9 +220,16 @@ export function DevelopPage() {
setPhotos((list) => list.map((p) => (ids.has(p.id) ? applyPatch(p, m.patch) : p)));
} else if (m.type === "photo.rendered") {
setPhotos((list) => list.map((p) => (p.id === m.photoId ? { ...p, urls: { ...p.urls, ...m.urls } } : p)));
+ } else if (m.type === "photo.added") {
+ const inThis = scope === "inbox" || scope === null ? m.photo.eventId === null : m.photo.eventId === scope;
+ if (!inThis) return;
+ setAll((list) => {
+ if (!list || list.some((p) => p.id === m.photo.id)) return list;
+ return [...list, m.photo].sort((a, b) => (a.capturedAt ?? "").localeCompare(b.capturedAt ?? ""));
+ });
}
},
- [session],
+ [session, scope],
);
const live = useLibraryLive(api, onMessage);
// Reconnected: anything sent meanwhile is fetched in order.
@@ -566,6 +574,9 @@ export function DevelopPage() {
)}
+ {canCull && orgId && scope && !scope.startsWith("search:") && !scope.startsWith("face:") && (
+
+ )}
@@ -602,7 +613,9 @@ export function DevelopPage() {
crop={crop}
onSourceSize={(w, h) => setSourceSize({ w, h })}
onError={(m) => setNote(m)}
- {...(oneToOne ? { localSource: fullSource } : isDesktop() && { localSource: () => localOriginalToView(current.sha256) })}
+ {...(oneToOne || current.originalName.toLowerCase().endsWith(".dng") || current.name.toLowerCase().endsWith(".dng")
+ ? { localSource: fullSource }
+ : isDesktop() && { localSource: () => localOriginalToView(current.sha256) })}
picking={picking && !cropping && !before}
onPick={(u, v) => {
setPicking(false);
diff --git a/apps/app/src/pages/LibraryPage.tsx b/apps/app/src/pages/LibraryPage.tsx
index ed11f2e..427b25a 100644
--- a/apps/app/src/pages/LibraryPage.tsx
+++ b/apps/app/src/pages/LibraryPage.tsx
@@ -19,6 +19,7 @@ import { useLibraryLive } from "../library/realtime.js";
import { useIngest } from "../library/ingest.js";
import { LocalFtpButton } from "../library/LocalFtp.js";
import { CardIngestButton, CardOverallStatus } from "../library/CardIngest.js";
+import { MergeButton } from "../library/MergeButton.js";
import { AutopilotButton } from "../library/Autopilot.js";
import { SquadsButton } from "../library/Squads.js";
import { type PlayerPick, photoIdsOf, samePicks } from "../library/squadFilter.js";
@@ -523,6 +524,9 @@ export function LibraryPage() {
))}
)}
+ {canCull && state.scope && !state.scope.startsWith("search:") && !state.scope.startsWith("face:") && (
+
+ )}
{canCull && (
m !== "advanced");
export function PreferencesPage() {
- const { api, me, reload, organization, role } = useAuth();
+ const { api, me, reload } = useAuth();
const [selected, setSelected] = useState(me?.preferences.editorModules ?? [...DEFAULT_MODULES]);
const [status, setStatus] = useState<"idle" | "saved" | "error">("idle");
- const [realEstateError, setRealEstateError] = useState(null);
- const [realEstateBusy, setRealEstateBusy] = useState(false);
- const realEstateOn = organization?.realEstateEnabled === true;
const toggle = async (module: Module) => {
const next = selected.includes(module) ? selected.filter((m) => m !== module) : [...selected, module];
@@ -54,37 +50,7 @@ export function PreferencesPage() {
))}
- {role === "OWNER" && organization && (
-
-
-
- )}
- {role === "OWNER" && organization && {t.realEstate.settingHelp}
}
- {realEstateError && {realEstateError}}
{isDesktop() && }
>
diff --git a/apps/app/src/pages/RealEstatePage.test.tsx b/apps/app/src/pages/RealEstatePage.test.tsx
deleted file mode 100644
index 1684e4d..0000000
--- a/apps/app/src/pages/RealEstatePage.test.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import type { BracketFrame } from "@photoreport/metadata";
-import { groupBrackets } from "@photoreport/metadata";
-import type { ApiClient, Me, Organization } from "@photoreport/sdk";
-import { render, screen, waitFor } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { App } from "../App.js";
-
-vi.mock("../library/realtime.js", () => ({
- useLibraryLive: () => "live",
- onSocketLive: () => () => undefined,
-}));
-vi.mock("../realestate/fuse.js", () => ({
- fuseBracket: () => Promise.resolve(new Blob([Uint8Array.from([0xff, 0xd8])], { type: "image/jpeg" })),
-}));
-
-const staged = vi.hoisted(() => ({ frames: new Map() }));
-
-vi.mock("../realestate/readFrame.js", async () => {
- const actual = await vi.importActual("../realestate/readFrame.js");
- return {
- ...actual,
- readBracketFile: (file: File) => Promise.resolve(staged.frames.get(file.name) ?? { id: file.name, fileName: file.name }),
- };
-});
-
-const org = (realEstateEnabled: boolean): Organization => ({ id: "o1", slug: "fpa", name: "FPA", mode: "AGENCY", realEstateEnabled });
-
-function me(role: Me["memberships"][number]["role"], realEstateEnabled: boolean): Me {
- return {
- user: { id: "u1", email: "ana@photoreport.pt", name: "Ana", locale: "pt-PT" },
- memberships: [{ role, organization: org(realEstateEnabled) }],
- preferences: { editorModules: ["crop", "basic"] },
- };
-}
-
-function fakeApi(who: Me, overrides: Partial> = {}): ApiClient {
- return {
- client: "web",
- resume: vi.fn().mockResolvedValue(true),
- me: vi.fn().mockResolvedValue(who),
- listEvents: vi.fn().mockResolvedValue({ events: [], inboxCount: 0 }),
- listPhotos: vi.fn().mockResolvedValue({ photos: [], total: 0 }),
- absolute: (path: string) => path,
- groupRealEstate: vi.fn(async (_orgId: string, frames: BracketFrame[]) => groupBrackets(frames)),
- setRealEstate: vi.fn().mockResolvedValue({ enabled: true }),
- ...overrides,
- } as unknown as ApiClient;
-}
-
-const at = (ms: number) => new Date(Date.parse("2026-10-21T10:00:00.000Z") + ms).toISOString();
-
-function shot(name: string, bias: number, ms: number): BracketFrame {
- return {
- id: name,
- fileName: name,
- capturedAt: at(ms),
- cameraSerial: "body",
- focalLength: 16,
- aperture: 8,
- iso: 100,
- exposureBias: bias,
- exposureTime: 0.01,
- };
-}
-
-describe("real estate area", () => {
- beforeEach(() => {
- URL.createObjectURL = () => "blob:fused";
- URL.revokeObjectURL = () => undefined;
- });
-
- afterEach(() => {
- staged.frames.clear();
- window.history.pushState({}, "", "/");
- });
-
- it("stays out of the menu until the organization turns it on", async () => {
- render();
- expect(await screen.findByText(/Ainda não chegaram fotografias/)).toBeTruthy();
- expect(screen.queryByRole("link", { name: "Imobiliário" })).toBeNull();
- });
-
- it("groups a dropped bracket and leaves the loose frame out", async () => {
- staged.frames.set("a.cr3", shot("a.cr3", -2, 0));
- staged.frames.set("b.cr3", shot("b.cr3", 0, 200));
- staged.frames.set("c.cr3", shot("c.cr3", 2, 400));
- staged.frames.set("solo.cr3", shot("solo.cr3", 0, 30_000));
- const api = fakeApi(me("PHOTOGRAPHER", true));
- render();
- await userEvent.click(await screen.findByRole("link", { name: "Imobiliário" }));
- const input = screen.getByLabelText("Escolher ficheiros");
- await userEvent.upload(input, [new File(["a"], "a.cr3"), new File(["b"], "b.cr3"), new File(["c"], "c.cr3"), new File(["s"], "solo.cr3")]);
- expect(await screen.findByText("1 ângulo")).toBeTruthy();
- expect(screen.getByText("Ângulo 1 · 3 exposições")).toBeTruthy();
- expect(await screen.findByRole("img", { name: "Ângulo 1 fundido" })).toBeTruthy();
- await waitFor(() => expect(screen.getByRole("button", { name: "Guardar todos" }).hasAttribute("disabled")).toBe(false));
- expect(screen.getByRole("button", { name: /^Guardar$/ })).toBeTruthy();
- expect(screen.getByRole("button", { name: "Interior claro" })).toBeTruthy();
- expect(screen.getByRole("button", { name: "Editar" })).toBeTruthy();
- expect(screen.getByText("1 fotografia fica de fora")).toBeTruthy();
- expect(screen.getByText("solo.cr3 · 0 EV")).toBeTruthy();
- expect(api.groupRealEstate).toHaveBeenCalledOnce();
- });
-
- it("lets the owner show the area from preferences", async () => {
- window.history.pushState({}, "", "/preferences");
- const api = fakeApi(me("OWNER", false));
- render();
- await userEvent.click(await screen.findByRole("checkbox", { name: "Imobiliário" }));
- expect(api.setRealEstate).toHaveBeenCalledWith("o1", true);
- });
-});
diff --git a/apps/app/src/pages/RealEstatePage.tsx b/apps/app/src/pages/RealEstatePage.tsx
deleted file mode 100644
index 3ac6680..0000000
--- a/apps/app/src/pages/RealEstatePage.tsx
+++ /dev/null
@@ -1,509 +0,0 @@
-import type { BracketFrame } from "@photoreport/metadata";
-import { ApiError, hasRole, type RealEstateGrouping } from "@photoreport/sdk";
-import { useEffect, useRef, useState } from "react";
-import { useAuth } from "../auth.js";
-import { t } from "../i18n.js";
-import { applyFinish } from "../realestate/finish.js";
-import { fuseBracket, type FusePhase } from "../realestate/fuse.js";
-import { LOOKS, finishValues, needsFinish, type LookId } from "../realestate/looks.js";
-import { fillFromSidecar, pairKey, partitionBracketFiles, readBracketFile } from "../realestate/readFrame.js";
-import { downloadBlob, jpegName, saveBlobs } from "../realestate/save.js";
-import { PageHeader } from "./Shell.js";
-
-const READ_AT_ONCE = 4;
-
-/**
- * Interior brackets, separate from the sports library. The files stay on this computer. The server
- * only receives exposure metadata and says which frames belong to the same angle; the develop
- * engine merges each angle in the browser.
- */
-export function RealEstatePage() {
- const { api, organization, role } = useAuth();
- const enabled = organization?.realEstateEnabled === true && role !== null && hasRole(role, "PHOTOGRAPHER");
- const [busy, setBusy] = useState(false);
- const busyRef = useRef(false);
- const [error, setError] = useState(null);
- const [frames, setFrames] = useState([]);
- const [files, setFiles] = useState