floor-editor-ts 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5977,6 +5977,16 @@ var DEFAULT_ZONE_FILL_OPACITY = .1;
5977
5977
  function nextZoneColor(existingCount) {
5978
5978
  return ZONE_COLOR_PALETTE[existingCount % ZONE_COLOR_PALETTE.length];
5979
5979
  }
5980
+ /** Resolve area label + color from host assigned camera fields. */
5981
+ function resolveCameraAreaStyle(source, fallbackIndex = 0) {
5982
+ var _source$props$area, _source$props, _source$props$areaCol, _source$props2;
5983
+ const areaRaw = (_source$props$area = source === null || source === void 0 || (_source$props = source.props) === null || _source$props === void 0 ? void 0 : _source$props.area) !== null && _source$props$area !== void 0 ? _source$props$area : source && "area" in source ? source.area : void 0;
5984
+ const colorRaw = (_source$props$areaCol = source === null || source === void 0 || (_source$props2 = source.props) === null || _source$props2 === void 0 ? void 0 : _source$props2.areaColor) !== null && _source$props$areaCol !== void 0 ? _source$props$areaCol : source && "areaColor" in source ? source.areaColor : void 0;
5985
+ return {
5986
+ name: String(areaRaw !== null && areaRaw !== void 0 ? areaRaw : "").trim() || "Area",
5987
+ color: String(colorRaw !== null && colorRaw !== void 0 ? colorRaw : "").trim() || nextZoneColor(fallbackIndex)
5988
+ };
5989
+ }
5980
5990
  function rectPoints(x1, y1, x2, y2) {
5981
5991
  const minX = Math.min(x1, x2);
5982
5992
  const maxX = Math.max(x1, x2);
@@ -7044,25 +7054,58 @@ function moveTextAnnotation(id, position) {
7044
7054
  p.updatedAt = /* @__PURE__ */ new Date();
7045
7055
  currentProject.set({ ...p });
7046
7056
  }
7047
- function addZone(shape, points, name, color) {
7057
+ function addZone(shape, points, nameOrOpts, colorArg) {
7058
+ const opts = typeof nameOrOpts === "object" && nameOrOpts ? nameOrOpts : {
7059
+ name: nameOrOpts,
7060
+ color: colorArg
7061
+ };
7048
7062
  const id = uid$1();
7049
7063
  mutate((f) => {
7064
+ var _opts$cameraSerial, _opts$name, _opts$fillOpacity;
7050
7065
  if (!f.zones) f.zones = [];
7051
7066
  const count = f.zones.length;
7067
+ const serial = ((_opts$cameraSerial = opts.cameraSerial) === null || _opts$cameraSerial === void 0 ? void 0 : _opts$cameraSerial.trim()) || void 0;
7052
7068
  f.zones.push({
7053
7069
  id,
7054
- name: (name === null || name === void 0 ? void 0 : name.trim()) || `Zone ${count + 1}`,
7070
+ name: ((_opts$name = opts.name) === null || _opts$name === void 0 ? void 0 : _opts$name.trim()) || `Area ${count + 1}`,
7055
7071
  shape,
7056
7072
  points: points.map((p) => ({
7057
7073
  x: p.x,
7058
7074
  y: p.y
7059
7075
  })),
7060
- color: color || nextZoneColor(count),
7061
- fillOpacity: .1
7076
+ color: opts.color || nextZoneColor(count),
7077
+ fillOpacity: (_opts$fillOpacity = opts.fillOpacity) !== null && _opts$fillOpacity !== void 0 ? _opts$fillOpacity : .1,
7078
+ ...serial ? { cameraSerial: serial } : {}
7062
7079
  });
7063
- }, "Added zone");
7080
+ }, "Added area");
7064
7081
  return id;
7065
7082
  }
7083
+ /**
7084
+ * Create area for a camera, or replace geometry if that camera already has an area.
7085
+ */
7086
+ function upsertCameraZone(shape, points, opts) {
7087
+ var _floor$zones;
7088
+ const serial = opts.cameraSerial.trim();
7089
+ const p = get$1(currentProject);
7090
+ const floor = p === null || p === void 0 ? void 0 : p.floors.find((f) => f.id === p.activeFloorId);
7091
+ const existing = floor === null || floor === void 0 || (_floor$zones = floor.zones) === null || _floor$zones === void 0 ? void 0 : _floor$zones.find((z) => z.cameraSerial === serial);
7092
+ if (existing) {
7093
+ var _opts$name2, _opts$fillOpacity2;
7094
+ updateZone(existing.id, {
7095
+ shape,
7096
+ points,
7097
+ name: ((_opts$name2 = opts.name) === null || _opts$name2 === void 0 ? void 0 : _opts$name2.trim()) || existing.name,
7098
+ color: opts.color || existing.color,
7099
+ cameraSerial: serial,
7100
+ fillOpacity: (_opts$fillOpacity2 = opts.fillOpacity) !== null && _opts$fillOpacity2 !== void 0 ? _opts$fillOpacity2 : existing.fillOpacity
7101
+ });
7102
+ return existing.id;
7103
+ }
7104
+ return addZone(shape, points, {
7105
+ ...opts,
7106
+ cameraSerial: serial
7107
+ });
7108
+ }
7066
7109
  function updateZone(id, updates) {
7067
7110
  mutate((f) => {
7068
7111
  if (!f.zones) return;
@@ -7072,11 +7115,16 @@ function updateZone(id, updates) {
7072
7115
  if (updates.color != null) z.color = updates.color;
7073
7116
  if (updates.fillOpacity != null) z.fillOpacity = updates.fillOpacity;
7074
7117
  if (updates.shape != null) z.shape = updates.shape;
7118
+ if (updates.cameraSerial != null) {
7119
+ const s = String(updates.cameraSerial).trim();
7120
+ if (s) z.cameraSerial = s;
7121
+ else delete z.cameraSerial;
7122
+ }
7075
7123
  if (updates.points) z.points = updates.points.map((p) => ({
7076
7124
  x: p.x,
7077
7125
  y: p.y
7078
7126
  }));
7079
- }, "Updated zone");
7127
+ }, "Updated area");
7080
7128
  }
7081
7129
  /** Live drag without undo snapshot (commit with updateZone / endUndoGroup). */
7082
7130
  function moveZonePoints(id, points) {
@@ -7093,6 +7141,12 @@ function moveZonePoints(id, points) {
7093
7141
  p.updatedAt = /* @__PURE__ */ new Date();
7094
7142
  currentProject.set({ ...p });
7095
7143
  }
7144
+ function removeZone(id) {
7145
+ mutate((f) => {
7146
+ if (!f.zones) return;
7147
+ f.zones = f.zones.filter((z) => z.id !== id);
7148
+ }, "Deleted area");
7149
+ }
7096
7150
  var layerVisibility = writable({
7097
7151
  walls: true,
7098
7152
  doors: true,
@@ -7351,6 +7405,8 @@ function assignedCameraToProps(cam) {
7351
7405
  return props;
7352
7406
  }
7353
7407
  function formatCameraPropLabel(key) {
7408
+ if (key === "area") return "Area";
7409
+ if (key === "areaColor") return "Area Color";
7354
7410
  return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
7355
7411
  }
7356
7412
  var DEFAULT_CONFIG = {
@@ -56526,7 +56582,7 @@ init_client();
56526
56582
  var root_2$12 = /* @__PURE__ */ from_html(`<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-slate-700 dark:bg-slate-300 rounded-t"></div>`);
56527
56583
  var root_3$11 = /* @__PURE__ */ from_html(`<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-slate-700 dark:bg-slate-300 rounded-t"></div>`);
56528
56584
  var root_4$10 = /* @__PURE__ */ from_html(`<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-slate-700 dark:bg-slate-300 rounded-t"></div>`);
56529
- var root_5$8 = /* @__PURE__ */ from_html(`<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-slate-700 dark:bg-slate-300 rounded-t"></div>`);
56585
+ var root_5$7 = /* @__PURE__ */ from_html(`<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-slate-700 dark:bg-slate-300 rounded-t"></div>`);
56530
56586
  var root_6$5 = /* @__PURE__ */ from_html(`<div class="space-y-4"><label class="block"><span class="text-sm font-medium text-gray-700 dark:text-gray-300">Project Name</span> <input type="text" class="mt-1 w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm focus:ring-2 focus:ring-slate-500 focus:border-slate-500 outline-none bg-white dark:bg-gray-700 dark:text-gray-100" placeholder="Untitled Project"/></label> <label class="block"><span class="text-sm font-medium text-gray-700 dark:text-gray-300">Description</span> <textarea rows="3" class="mt-1 w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm focus:ring-2 focus:ring-slate-500 focus:border-slate-500 outline-none resize-none bg-white dark:bg-gray-700 dark:text-gray-100" placeholder="Add a description for this project..."></textarea></label></div>`);
56531
56587
  var root_7$6 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-between mb-5"><span class="text-sm font-medium text-gray-700 dark:text-gray-300">Metrics unit</span> <div class="flex rounded-lg border border-gray-300 dark:border-gray-600 overflow-hidden"><button>m, cm</button> <button>ft, inch</button></div></div> <div class="bg-gray-50 dark:bg-gray-700/50 rounded-xl divide-y divide-gray-200 dark:divide-gray-600"><label class="flex items-center justify-between px-4 py-3.5 cursor-pointer"><span class="text-sm text-gray-700">Dimensions</span> <input type="checkbox" class="w-10 h-5 rounded-full appearance-none cursor-pointer bg-gray-300 checked:bg-slate-700 relative transition-colors
56532
56588
  before:content-[''] before:absolute before:w-4 before:h-4 before:rounded-full before:bg-white before:top-0.5 before:left-0.5 before:transition-transform checked:before:translate-x-5"/></label> <label class="flex items-center justify-between px-4 py-3.5 cursor-pointer"><span class="text-sm text-gray-700">External Dimensions</span> <input type="checkbox" class="w-10 h-5 rounded-full appearance-none cursor-pointer bg-gray-300 checked:bg-slate-700 relative transition-colors
@@ -56536,7 +56592,7 @@ var root_7$6 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-
56536
56592
  before:content-[''] before:absolute before:w-4 before:h-4 before:rounded-full before:bg-white before:top-0.5 before:left-0.5 before:transition-transform checked:before:translate-x-5"/></label> <div class="flex items-center justify-between px-4 py-3.5"><span class="text-sm text-gray-700">Line Color</span> <div class="flex items-center gap-2"><button style="background-color: #ffffff" aria-label="White line color"></button> <span class="text-gray-300">|</span> <button style="background-color: #1e293b" aria-label="Dark line color"></button></div></div></div>`, 1);
56537
56593
  var root_9$4 = /* @__PURE__ */ from_html(`<button><span class="text-2xl"> </span> <span class="text-xs font-medium text-gray-700 dark:text-gray-300"> </span></button>`);
56538
56594
  var root_8$4 = /* @__PURE__ */ from_html(`<div class="space-y-4"><div><span class="text-sm font-medium text-gray-700 dark:text-gray-300 block mb-3">Theme</span> <div class="flex gap-3"></div></div></div>`);
56539
- var root_11$3 = /* @__PURE__ */ from_html(`<button class="px-4 py-2 text-sm font-medium text-red-600 dark:text-red-400 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors">Remove</button>`);
56595
+ var root_11$4 = /* @__PURE__ */ from_html(`<button class="px-4 py-2 text-sm font-medium text-red-600 dark:text-red-400 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors">Remove</button>`);
56540
56596
  var root_12$3 = /* @__PURE__ */ from_html(`<button class="px-4 py-2 text-sm font-medium text-red-600 dark:text-red-400 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors">Remove</button>`);
56541
56597
  var root_10$4 = /* @__PURE__ */ from_html(`<div class="space-y-4"><div><span class="text-sm font-medium text-gray-700 dark:text-gray-300 block mb-1">Gemini API Key</span> <p class="text-xs text-gray-500 dark:text-gray-400 mb-3">Required for AI-powered photorealistic rendering. Your key is stored locally in your browser only - never sent to our servers.</p> <div class="flex gap-2"><div class="relative flex-1"><input class="w-full px-3 py-2 pr-10 border border-gray-300 dark:border-gray-600 rounded-lg text-sm font-mono focus:ring-2 focus:ring-slate-500 focus:border-slate-500 outline-none bg-white dark:bg-gray-700 dark:text-gray-100" placeholder="AIza..."/> <button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"> </button></div></div> <div class="flex gap-2 mt-3"><button class="px-4 py-2 text-sm font-medium bg-slate-700 text-white rounded-lg hover:bg-slate-600 transition-colors"> </button> <!></div></div> <div class="border-t border-gray-200 dark:border-gray-700 pt-4"><span class="text-sm font-medium text-gray-700 dark:text-gray-300 block mb-2">How to get a Gemini key</span> <ol class="text-xs text-gray-500 dark:text-gray-400 space-y-1 list-decimal list-inside"><li>Go to <a href="https://aistudio.google.com/apikey" target="_blank" rel="noopener" class="text-blue-500 hover:underline">Google AI Studio</a></li> <li>Click "Create API Key"</li> <li>Copy and paste it above</li></ol></div> <div class="border-t border-gray-200 dark:border-gray-700 pt-4"><span class="text-sm font-medium text-gray-700 dark:text-gray-300 block mb-1">OpenAI API Key</span> <p class="text-xs text-gray-500 dark:text-gray-400 mb-3">Optional — enables OpenAI image generation as an alternative to Gemini. Stored locally only.</p> <div class="flex gap-2"><div class="relative flex-1"><input class="w-full px-3 py-2 pr-10 border border-gray-300 dark:border-gray-600 rounded-lg text-sm font-mono focus:ring-2 focus:ring-slate-500 focus:border-slate-500 outline-none bg-white dark:bg-gray-700 dark:text-gray-100" placeholder="sk-..."/> <button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-sm"> </button></div></div> <div class="flex gap-2 mt-3"><button class="px-4 py-2 text-sm font-medium bg-slate-700 text-white rounded-lg hover:bg-slate-600 transition-colors"> </button> <!></div> <div class="mt-3"><span class="text-sm font-medium text-gray-700 dark:text-gray-300 block mb-2">How to get an OpenAI key</span> <ol class="text-xs text-gray-500 dark:text-gray-400 space-y-1 list-decimal list-inside"><li>Go to <a href="https://platform.openai.com/api-keys" target="_blank" rel="noopener" class="text-blue-500 hover:underline">OpenAI Platform</a></li> <li>Click "Create new secret key"</li> <li>Copy and paste it above</li></ol></div></div></div>`);
56542
56598
  var root_1$13 = /* @__PURE__ */ from_html(`<div class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center" role="dialog" tabindex="-1" aria-label="Settings"><div class="bg-white dark:bg-gray-800 rounded-xl shadow-2xl w-[420px] max-h-[80vh] flex flex-col" role="document"><div class="flex items-center justify-between px-5 pt-4 pb-2"><h2 class="text-lg font-bold text-gray-800 dark:text-gray-100">Settings</h2> <button class="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-xl leading-none" aria-label="Close settings">✕</button></div> <div class="flex border-b border-gray-200 dark:border-gray-700 px-5"><button>Project <!></button> <button>Dimensions <!></button> <button>Appearance <!></button> <button>AI <!></button></div> <div class="p-5 overflow-y-auto"><!></div></div></div>`);
@@ -56678,7 +56734,7 @@ function SettingsDialog($$anchor, $$props) {
56678
56734
  var button_4 = sibling(button_3, 2);
56679
56735
  var node_4 = sibling(child(button_4));
56680
56736
  var consequent_3 = ($$anchor) => {
56681
- append($$anchor, root_5$8());
56737
+ append($$anchor, root_5$7());
56682
56738
  };
56683
56739
  if_block(node_4, ($$render) => {
56684
56740
  if (get(activeTab) === "ai") $$render(consequent_3);
@@ -56828,7 +56884,7 @@ function SettingsDialog($$anchor, $$props) {
56828
56884
  reset(button_11);
56829
56885
  var node_6 = sibling(button_11, 2);
56830
56886
  var consequent_7 = ($$anchor) => {
56831
- var button_12 = root_11$3();
56887
+ var button_12 = root_11$4();
56832
56888
  delegated("click", button_12, clearGeminiKey);
56833
56889
  append($$anchor, button_12);
56834
56890
  };
@@ -56935,7 +56991,7 @@ var root_2$11 = /* @__PURE__ */ from_html(`<div class="flex items-center justify
56935
56991
  var root_1$12 = /* @__PURE__ */ from_html(`<div><h4 class="text-xs font-semibold text-gray-500 uppercase mb-1.5">By Category</h4> <div class="space-y-1"></div></div>`);
56936
56992
  var root_4$9 = /* @__PURE__ */ from_html(`<div class="flex items-center gap-1.5 text-xs px-1 py-1"><div class="flex-1 min-w-0"><div class="flex items-center justify-between"><span class="text-gray-700 truncate"> </span> <span class="text-gray-500 ml-1 shrink-0"> </span></div> <div class="w-full bg-gray-200 rounded-full h-1 mt-0.5"><div class="bg-blue-400 h-1 rounded-full"></div></div></div> <span class="text-[10px] text-gray-400 w-8 text-right shrink-0"> </span></div>`);
56937
56993
  var root_3$10 = /* @__PURE__ */ from_html(`<div><h4 class="text-xs font-semibold text-gray-500 uppercase mb-1.5">Room Breakdown</h4> <div class="space-y-0.5"></div></div>`);
56938
- var root_5$7 = /* @__PURE__ */ from_html(`<p class="text-xs text-gray-400 text-center py-4">No rooms detected yet.<br/>Draw walls to create rooms.</p>`);
56994
+ var root_5$6 = /* @__PURE__ */ from_html(`<p class="text-xs text-gray-400 text-center py-4">No rooms detected yet.<br/>Draw walls to create rooms.</p>`);
56939
56995
  var root$6 = /* @__PURE__ */ from_html(`<div class="space-y-3"><div class="grid grid-cols-2 gap-2"><div class="bg-blue-50 rounded-lg p-2 text-center"><div class="text-lg font-bold text-blue-700"> </div> <div class="text-[10px] text-blue-500">Rooms</div></div> <div class="bg-green-50 rounded-lg p-2 text-center"><div class="text-lg font-bold text-green-700"> </div> <div class="text-[10px] text-green-500">Total Area</div></div> <div class="bg-amber-50 rounded-lg p-2 text-center"><div class="text-sm font-bold text-amber-700"> </div> <div class="text-[10px] text-amber-500">Doors / Windows</div></div> <div class="bg-purple-50 rounded-lg p-2 text-center"><div class="text-sm font-bold text-purple-700"> </div> <div class="text-[10px] text-purple-500">Wall Length</div></div></div> <!> <!></div>`);
56940
56996
  function AreaSummaryPanel($$anchor, $$props) {
56941
56997
  push($$props, true);
@@ -57119,7 +57175,7 @@ function AreaSummaryPanel($$anchor, $$props) {
57119
57175
  append($$anchor, div_13);
57120
57176
  };
57121
57177
  var alternate = ($$anchor) => {
57122
- append($$anchor, root_5$7());
57178
+ append($$anchor, root_5$6());
57123
57179
  };
57124
57180
  if_block(node_1, ($$render) => {
57125
57181
  if (get(allRooms).length > 0) $$render(consequent_1);
@@ -57283,7 +57339,7 @@ init_client();
57283
57339
  var root_2$10 = /* @__PURE__ */ from_html(`<p class="text-sm text-gray-400 text-center py-8">No snapshots yet.<br/>Versions are saved automatically every 5 minutes.</p>`);
57284
57340
  var root_4$8 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-between py-2 px-2 rounded-lg hover:bg-gray-50 group transition-colors"><div class="flex-1 min-w-0"><div class="text-sm font-medium text-gray-700 truncate"> </div> <div class="text-xs text-gray-400"> </div></div> <button class="text-xs px-2.5 py-1 bg-blue-50 text-blue-600 rounded-md hover:bg-blue-100 transition-colors opacity-0 group-hover:opacity-100 font-medium shrink-0 ml-2">Restore</button></div>`);
57285
57341
  var root_3$9 = /* @__PURE__ */ from_html(`<div class="space-y-1"></div>`);
57286
- var root_5$6 = /* @__PURE__ */ from_html(`<div class="px-4 py-2 border-t border-gray-100"><button class="text-xs text-red-400 hover:text-red-600 transition-colors">Clear all versions</button></div>`);
57342
+ var root_5$5 = /* @__PURE__ */ from_html(`<div class="px-4 py-2 border-t border-gray-100"><button class="text-xs text-red-400 hover:text-red-600 transition-colors">Clear all versions</button></div>`);
57287
57343
  var root_1$11 = /* @__PURE__ */ from_html(`<div class="fixed inset-0 bg-black/40 z-50 flex items-center justify-center"><div class="bg-white rounded-xl shadow-2xl w-96 max-h-[70vh] flex flex-col"><div class="flex items-center justify-between px-4 py-3 border-b border-gray-100"><h2 class="text-sm font-semibold text-gray-800 flex items-center gap-2"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> Version History</h2> <button class="text-gray-400 hover:text-gray-600 transition-colors" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="flex-1 overflow-y-auto px-4 py-2"><!></div> <!></div></div>`);
57288
57344
  function VersionHistoryPanel($$anchor, $$props) {
57289
57345
  push($$props, true);
@@ -57364,7 +57420,7 @@ function VersionHistoryPanel($$anchor, $$props) {
57364
57420
  reset(div_3);
57365
57421
  var node_2 = sibling(div_3, 2);
57366
57422
  var consequent_1 = ($$anchor) => {
57367
- var div_9 = root_5$6();
57423
+ var div_9 = root_5$5();
57368
57424
  var button_2 = child(div_9);
57369
57425
  reset(div_9);
57370
57426
  delegated("click", button_2, onClearAll);
@@ -57399,17 +57455,17 @@ init_onboarding_svelte();
57399
57455
  var root_2$9 = /* @__PURE__ */ from_html(`<input type="text" class="bg-white/20 text-white font-semibold px-2 py-0.5 rounded border border-white/30 outline-none text-sm w-40"/>`);
57400
57456
  var root_3$8 = /* @__PURE__ */ from_html(`<button class="font-semibold text-white text-sm hover:bg-white/10 px-2 py-0.5 rounded transition-colors" title="Click to rename"> </button>`);
57401
57457
  var root_4$7 = /* @__PURE__ */ from_html(`<button> </button>`);
57402
- var root_5$5 = /* @__PURE__ */ from_html(`<button aria-label="Snap to Grid"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg></button>`);
57458
+ var root_5$4 = /* @__PURE__ */ from_html(`<button aria-label="Snap to Grid"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg></button>`);
57403
57459
  var root_6$4 = /* @__PURE__ */ from_html(`<div class="flex bg-white/15 rounded-full p-0.5 shrink-0"><button title="Select mode (V)" aria-label="Select mode"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg></button> <button title="Pan mode (H)" aria-label="Pan mode"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 11V6a2 2 0 0 0-4 0v1"></path><path d="M14 10V4a2 2 0 0 0-4 0v2"></path><path d="M10 10.5V6a2 2 0 0 0-4 0v8"></path><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"></path></svg></button></div>`);
57404
57460
  var root_7$5 = /* @__PURE__ */ from_html(`<button aria-label="Toggle Furniture"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="12" width="20" height="8" rx="1"></rect><path d="M4 12V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v5"></path><line x1="12" y1="12" x2="12" y2="20"></line></svg></button>`);
57405
57461
  var root_8$3 = /* @__PURE__ */ from_html(`<div class="flex items-center gap-1 bg-white/15 rounded-full p-0.5 shrink-0"><button class="w-7 h-7 flex items-center justify-center text-white/80 hover:text-white hover:bg-white/10 rounded-full transition-colors text-sm font-bold" title="Zoom Out (−)" aria-label="Zoom Out">−</button> <button class="px-2 py-1 text-xs font-medium text-white/80 hover:text-white hover:bg-white/10 rounded-full transition-colors min-w-[3rem] text-center" title="Reset Zoom (100%)"> </button> <button class="w-7 h-7 flex items-center justify-center text-white/80 hover:text-white hover:bg-white/10 rounded-full transition-colors text-sm font-bold" title="Zoom In (+)" aria-label="Zoom In">+</button></div>`);
57406
57462
  var root_10$3 = /* @__PURE__ */ from_html(`<div class="absolute right-0 top-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200 py-1 w-56 z-50" role="menu"><button type="button" role="menuitemcheckbox" class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center justify-between gap-2"><span>Snap to grid</span> <span> </span></button> <button type="button" role="menuitemcheckbox" class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center justify-between gap-2"><span>Show furniture</span> <span> </span></button> <div class="h-px bg-gray-100 my-1"></div> <button type="button" role="menuitem" class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left">Version history</button> <button type="button" role="menuitem" class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left">Area summary</button> <div class="h-px bg-gray-100 my-1"></div> <button type="button" role="menuitem" class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left">Settings…</button></div>`);
57407
57463
  var root_9$3 = /* @__PURE__ */ from_html(`<div class="relative shrink-0"><button title="Settings &amp; tools" aria-label="Settings &amp; tools"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button> <!></div>`);
57408
- var root_11$2 = /* @__PURE__ */ from_html(`<button class="p-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Version History" aria-label="Version History"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></button> <button class="px-2 py-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Area Summary" aria-label="Area Summary"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"></rect><path d="M3 9h18"></path><path d="M9 3v18"></path></svg></button> <button class="px-2 py-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Settings" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button>`, 1);
57464
+ var root_11$3 = /* @__PURE__ */ from_html(`<button class="p-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Version History" aria-label="Version History"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></button> <button class="px-2 py-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Area Summary" aria-label="Area Summary"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"></rect><path d="M3 9h18"></path><path d="M9 3v18"></path></svg></button> <button class="px-2 py-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Settings" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button>`, 1);
57409
57465
  var root_13$2 = /* @__PURE__ */ from_html(`<button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg> Import JSON</button>`);
57410
57466
  var root_12$2 = /* @__PURE__ */ from_html(`<div class="absolute right-0 top-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200 py-1 w-48 z-50"><button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg> Print Layout</button> <div class="h-px bg-gray-100 my-1"></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><path d="M21 15l-5-5L5 21"></path></svg> Export 2D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg> Export 3D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 19V5"></path><path d="M5 12l7-7 7 7"></path></svg> Export as SVG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M8 16h2"></path><path d="M14 16h2"></path></svg> Export as DXF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M9 16h6"></path></svg> Export as DWG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M16 11v6"></path><path d="M8 11v6"></path><path d="M12 11v6"></path></svg> Export as PDF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path></svg> Download JSON</button> <div class="h-px bg-gray-100 my-1"></div> <!> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> New Project</button></div>`);
57411
57467
  var root_1$10 = /* @__PURE__ */ from_html(`<div class="h-12 bg-gradient-to-r from-slate-800 to-slate-700 flex items-center px-4 gap-3 shrink-0 shadow-sm overflow-hidden"><button type="button"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2.5"></rect><path d="M9 3v18"></path></svg></button> <!> <div class="h-5 w-px bg-white/20"></div> <div class="flex items-center gap-1"><!> <button class="text-white/80 hover:text-white text-xs hover:bg-white/10 px-1.5 py-0.5 rounded transition-colors" title="Add Floor" aria-label="Add Floor">+</button> <span class="text-white/40 text-[10px] ml-1"> </span></div> <div class="flex-1"></div> <button class="p-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Undo (Ctrl+Z)" aria-label="Undo"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg></button> <button class="p-1.5 text-white/80 hover:text-white hover:bg-white/10 rounded transition-colors" title="Redo (Ctrl+Y)" aria-label="Redo"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.13-9.36L23 10"></path></svg></button> <div class="h-5 w-px bg-white/20"></div> <!> <!> <!> <div class="h-5 w-px bg-white/20"></div> <!> <!> <div class="h-5 w-px bg-white/20 shrink-0"></div> <div class="relative"><button class="px-3 py-1.5 text-sm text-white/90 hover:text-white hover:bg-white/10 rounded transition-colors flex items-center gap-1.5"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> Export</button> <!></div> <span><!></span> <button class="px-3 py-1.5 text-sm bg-white text-slate-800 font-semibold rounded-lg hover:bg-blue-50 transition-colors shadow-sm">Save</button></div>`);
57412
- var root_18$3 = /* @__PURE__ */ from_html(`<div class="absolute right-0 top-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200 py-1 w-48 z-50"><button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg> Print Layout</button> <div class="h-px bg-gray-100 my-1"></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><path d="M21 15l-5-5L5 21"></path></svg> Export 2D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg> Export 3D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 19V5"></path><path d="M5 12l7-7 7 7"></path></svg> Export as SVG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M8 16h2"></path><path d="M14 16h2"></path></svg> Export as DXF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M9 16h6"></path></svg> Export as DWG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M16 11v6"></path><path d="M8 11v6"></path><path d="M12 11v6"></path></svg> Export as PDF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path></svg> Download JSON</button> <div class="h-px bg-gray-100 my-1"></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg> Import JSON</button></div>`);
57468
+ var root_18$2 = /* @__PURE__ */ from_html(`<div class="absolute right-0 top-full mt-1 bg-white rounded-lg shadow-lg border border-gray-200 py-1 w-48 z-50"><button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg> Print Layout</button> <div class="h-px bg-gray-100 my-1"></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><path d="M21 15l-5-5L5 21"></path></svg> Export 2D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"></path><path d="M2 17l10 5 10-5"></path><path d="M2 12l10 5 10-5"></path></svg> Export 3D as PNG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 19V5"></path><path d="M5 12l7-7 7 7"></path></svg> Export as SVG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M8 16h2"></path><path d="M14 16h2"></path></svg> Export as DXF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M9 16h6"></path></svg> Export as DWG</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><path d="M16 11v6"></path><path d="M8 11v6"></path><path d="M12 11v6"></path></svg> Export as PDF</button> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path></svg> Download JSON</button> <div class="h-px bg-gray-100 my-1"></div> <button class="w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 text-left flex items-center gap-2"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg> Import JSON</button></div>`);
57413
57469
  var root_17$2 = /* @__PURE__ */ from_html(`<div class="h-12 bg-gradient-to-r from-slate-800 to-slate-700 flex items-center justify-between px-4 gap-3 shrink-0 shadow-sm"><span class="font-semibold text-white text-sm px-2 py-0.5 rounded transition-colors"> </span> <div class="relative"><button class="px-3 py-1.5 text-sm text-white/90 hover:text-white hover:bg-white/10 rounded transition-colors flex items-center gap-1.5"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> Import</button> <!></div></div>`);
57414
57470
  var root_19$3 = /* @__PURE__ */ from_html(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40"><div class="bg-white rounded-xl shadow-2xl w-[420px] max-h-[80vh] overflow-hidden"><div class="flex items-center justify-between px-5 py-3 border-b border-gray-200"><h2 class="text-base font-semibold text-gray-800">📐 Area Summary</h2> <button class="text-gray-400 hover:text-gray-600 text-xl leading-none">&times;</button></div> <div class="overflow-y-auto max-h-[calc(80vh-52px)] p-1"><!></div></div></div>`);
57415
57471
  var root$5 = /* @__PURE__ */ from_html(`<!> <!> <!> <!>`, 1);
@@ -57691,7 +57747,7 @@ function TopBar($$anchor, $$props) {
57691
57747
  var button_5 = sibling(button_4, 2);
57692
57748
  var node_3 = sibling(button_5, 4);
57693
57749
  var consequent_1 = ($$anchor) => {
57694
- var button_6 = root_5$5();
57750
+ var button_6 = root_5$4();
57695
57751
  template_effect(() => {
57696
57752
  set_class(button_6, 1, `p-1.5 rounded transition-colors ${get(snapOn) ? "text-white bg-white/20" : "text-white/40 hover:text-white/70 hover:bg-white/10"}`);
57697
57753
  set_attribute(button_6, "title", `Snap to Grid (${get(snapOn) ? "On" : "Off"})`);
@@ -57808,7 +57864,7 @@ function TopBar($$anchor, $$props) {
57808
57864
  append($$anchor, div_4);
57809
57865
  };
57810
57866
  var alternate_1 = ($$anchor) => {
57811
- var fragment_1 = root_11$2();
57867
+ var fragment_1 = root_11$3();
57812
57868
  var button_19 = first_child(fragment_1);
57813
57869
  var button_20 = sibling(button_19, 2);
57814
57870
  var button_21 = sibling(button_20, 2);
@@ -57921,7 +57977,7 @@ function TopBar($$anchor, $$props) {
57921
57977
  var button_34 = child(div_9);
57922
57978
  var node_12 = sibling(button_34, 2);
57923
57979
  var consequent_12 = ($$anchor) => {
57924
- var div_10 = root_18$3();
57980
+ var div_10 = root_18$2();
57925
57981
  var button_35 = child(div_10);
57926
57982
  var button_36 = sibling(button_35, 4);
57927
57983
  var button_37 = sibling(button_36, 2);
@@ -58650,24 +58706,24 @@ delegate(["click"]);
58650
58706
  //#region src/lib/components/sidebar/BuildPanel.svelte
58651
58707
  init_client();
58652
58708
  init_index_client();
58653
- var root_6$3 = /* @__PURE__ */ from_html(`<button draggable="true"><div class="w-9 h-9 rounded-lg bg-amber-50 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#92400e" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58654
- var root_7$4 = /* @__PURE__ */ from_html(`<button draggable="true"><div class="w-9 h-9 rounded-lg bg-cyan-50 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#0e7490" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="1"></rect><line x1="12" y1="4" x2="12" y2="20"></line><line x1="3" y1="12" x2="21" y2="12"></line></svg></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58655
- var root_5$4 = /* @__PURE__ */ from_html(`<div class="grid grid-cols-2 gap-2 mb-3"></div> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Windows</h3> <div class="grid grid-cols-2 gap-2"></div>`, 1);
58656
- var root_1$8 = /* @__PURE__ */ from_html(`<div class="space-y-1"><h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Tools</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg></div> <div class="text-left"><div class="font-medium">Select <span class="text-gray-400 text-xs ml-1">V</span></div> <div class="text-xs text-gray-400">Click to select elements</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="8" width="18" height="8" rx="1"></rect><line x1="7" y1="8" x2="7" y2="16"></line><line x1="12" y1="8" x2="12" y2="16"></line><line x1="17" y1="8" x2="17" y2="16"></line></svg></div> <div class="text-left"><div class="font-medium">Draw Wall <span class="text-gray-400 text-xs ml-1">W</span></div> <div class="text-xs text-gray-400">Click to draw, dbl-click to finish</div></div></button> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Structure</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 5h-5V2h-3v6h-4V5H7v6H2v3h5v3h3v-3h4v3h3v-6h5z"></path></svg></div> <div class="text-left"><div class="font-medium">Add Stairs</div> <div class="text-xs text-gray-400">Click to place stairs</div></div></button> <div class="flex gap-2"><button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="6"></circle><line x1="6" y1="6" x2="18" y2="18"></line><line x1="18" y1="6" x2="6" y2="18"></line></svg></div> <div class="text-left"><div class="font-medium text-xs">Round Column</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="6" y="6" width="12" height="12"></rect><line x1="6" y1="6" x2="18" y2="18"></line><line x1="18" y1="6" x2="6" y2="18"></line></svg></div> <div class="text-left"><div class="font-medium text-xs">Square Column</div></div></button></div> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Zones</h3> <div class="grid grid-cols-3 gap-1.5 mb-1"><button type="button" title="Drag to create rectangle zone"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><rect x="4" y="6" width="16" height="12" rx="1"></rect></svg> Rect</button> <button type="button" title="Click to place triangle zone"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><path d="M12 4 L20 19 L4 19 Z"></path></svg> Triangle</button> <button type="button" title="Click points; click first point or Enter to close"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><path d="M7 4 L17 6 L20 14 L12 20 L4 12 Z"></path></svg> Polygon</button></div> <p class="text-[10px] text-gray-400 mb-2 px-0.5"><!></p> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Annotate</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V4h16v3"></path><line x1="12" y1="4" x2="12" y2="20"></line><line x1="8" y1="20" x2="16" y2="20"></line></svg></div> <div class="text-left"><div class="font-medium">Text Label</div> <div class="text-xs text-gray-400">Add text annotations (T)</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><line x1="16" y1="5" x2="22" y2="5"></line><line x1="19" y1="2" x2="19" y2="8"></line><line x1="3" y1="12" x2="12" y2="12"></line></svg></div> <div class="text-left"><div class="font-medium">Dimension</div> <div class="text-xs text-gray-400">Add dimension annotations (N)</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12h5l2-7 4 14 2-7h7"></path></svg></div> <div class="text-left"><div class="font-medium">Measure</div> <div class="text-xs text-gray-400">Measure distances (M)</div></div></button> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Import</h3> <button class="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors hover:bg-gray-50 text-gray-700"><div class="w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg></div> <div class="text-left"><div class="font-medium">Import Image</div> <div class="text-xs text-gray-400">Floor plan background</div></div></button> <button class="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors hover:bg-gray-50 text-gray-700"><div class="w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg></div> <div class="text-left"><div class="font-medium">Import RoomPlan</div> <div class="text-xs text-gray-400">iOS LiDAR scan (.json/.zip)</div></div></button> <button class="w-full flex items-center justify-between px-1 py-2 mt-3"><h3 class="text-xs font-semibold text-gray-400 uppercase">Doors</h3> <span class="text-gray-400 text-xs"> </span></button> <!></div>`);
58657
- var root_9$2 = /* @__PURE__ */ from_html(`<button class="flex flex-col items-center gap-1.5 p-3 rounded-lg border-2 border-gray-100 hover:border-blue-300 hover:bg-blue-50 transition-colors cursor-grab active:cursor-grabbing" draggable="true"><div class="w-12 h-12 rounded-lg bg-gray-50 flex items-center justify-center text-2xl font-mono"> </div> <span class="text-xs font-medium text-gray-600"> </span></button>`);
58658
- var root_10$2 = /* @__PURE__ */ from_html(`<button class="flex flex-col items-center gap-1.5 p-3 rounded-lg border-2 border-gray-100 hover:border-green-300 hover:bg-green-50 transition-colors cursor-grab active:cursor-grabbing" draggable="true"><div class="w-12 h-12 rounded-lg bg-green-50 flex items-center justify-center text-lg"><!></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58659
- var root_8$2 = /* @__PURE__ */ from_html(`<div class="space-y-2"><h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Room Presets</h3> <p class="text-xs text-gray-400 mb-3">Click to add a room shape to the canvas</p> <div class="grid grid-cols-2 gap-2"></div> <hr class="my-3 border-gray-200"/> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Room Templates</h3> <p class="text-xs text-gray-400 mb-3">Pre-furnished rooms — walls + furniture in one click</p> <div class="grid grid-cols-2 gap-2"></div></div>`);
58660
- var root_19$2 = /* @__PURE__ */ from_html(`<button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 w-5 h-5 flex items-center justify-center rounded-full hover:bg-gray-100" title="Clear search"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>`);
58661
- var root_20$2 = /* @__PURE__ */ from_html(`<div class="text-[10px] text-gray-400 px-1"> </div>`);
58662
- var root_21$1 = /* @__PURE__ */ from_html(`<button> </button>`);
58663
- var root_23$2 = /* @__PURE__ */ from_html(`<button draggable="true"><span role="button" tabindex="0"> </span> <div class="w-8 h-8 rounded-lg flex items-center justify-center"><div class="w-4 h-4 rounded-sm"></div></div> <span class="text-[10px] font-medium text-gray-600 leading-tight text-center"> </span></button>`);
58664
- var root_22$2 = /* @__PURE__ */ from_html(`<div class="mt-1"><h4 class="text-[10px] font-semibold text-gray-400 uppercase mb-1.5">Recent</h4> <div class="grid grid-cols-2 gap-2"></div></div> <hr class="border-gray-100"/>`, 1);
58665
- var root_25$1 = /* @__PURE__ */ from_html(`<span class="text-xs font-medium text-gray-600"> <mark class="bg-yellow-200 text-gray-800 rounded-sm px-0.5"> </mark> </span>`);
58666
- var root_26$1 = /* @__PURE__ */ from_html(`<span class="text-xs font-medium text-gray-600"> </span>`);
58667
- var root_24$1 = /* @__PURE__ */ from_html(`<button draggable="true"><span role="button" tabindex="0"> </span> <div class="w-10 h-10 rounded-lg flex items-center justify-center"><div class="w-5 h-5 rounded-sm"></div></div> <!> <span class="text-[10px] text-gray-400"> </span></button>`);
58668
- var root_18$2 = /* @__PURE__ */ from_html(`<div class="space-y-2"><div class="relative"><input type="text" placeholder="Search furniture..." class="w-full px-3 py-2 pr-8 border border-gray-200 rounded-lg text-sm focus:ring-2 focus:ring-blue-200 focus:border-blue-400 outline-none"/> <!></div> <!> <div class="flex flex-wrap gap-1 max-h-24 overflow-y-auto"><button>All</button> <button> </button> <!></div> <!> <div class="grid grid-cols-2 gap-2 mt-2"></div></div>`);
58669
- var root_27$1 = /* @__PURE__ */ from_html(`<div class="fixed z-50 pointer-events-none"><div class="bg-white rounded-xl shadow-2xl border border-gray-200 overflow-hidden" style="width: 220px;"><div class="w-full h-[120px] bg-gray-50 flex items-center justify-center p-3"><div class="w-16 h-16 rounded-xl flex items-center justify-center"><div class="w-10 h-10 rounded-md"></div></div></div> <div class="p-3 space-y-1.5"><div class="flex items-center gap-2"><span class="text-sm font-semibold text-gray-800"> </span> <span class="px-1.5 py-0.5 rounded-full text-[9px] font-semibold text-white"> </span></div> <div class="text-xs text-gray-500"> </div></div></div></div>`);
58670
- var root_28$1 = /* @__PURE__ */ from_html(`<div class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center"><div class="bg-white rounded-xl shadow-2xl w-80 p-5"><h3 class="text-sm font-bold text-gray-800 mb-1">Import RoomPlan</h3> <p class="text-xs text-gray-400 mb-4"> </p> <div class="space-y-3"><label class="flex items-start gap-2.5 cursor-pointer"><input type="checkbox" class="accent-blue-500 mt-0.5"/> <div><div class="text-sm font-medium text-gray-700">Straighten walls</div> <div class="text-xs text-gray-400">Snap near-horizontal/vertical walls to axis</div></div></label> <label class="flex items-start gap-2.5 cursor-pointer"><input type="checkbox" class="accent-blue-500 mt-0.5"/> <div><div class="text-sm font-medium text-gray-700">Enforce orthogonal <span class="text-xs text-blue-400 font-mono"> </span></div> <div class="text-xs text-gray-400">Force all walls to 90°/180° angles</div></div></label> <label class="block"><div class="text-xs text-gray-500 mb-1">Corner merge distance (cm)</div> <input type="number" min="0" max="50" step="5" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label></div> <div class="flex gap-2 mt-5"><button class="flex-1 px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition-colors">Cancel</button> <button class="flex-1 px-3 py-2 bg-blue-500 text-white rounded-lg text-sm font-medium hover:bg-blue-600 transition-colors">Import</button></div></div></div>`);
58709
+ var root_7$4 = /* @__PURE__ */ from_html(`<button draggable="true"><div class="w-9 h-9 rounded-lg bg-amber-50 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#92400e" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58710
+ var root_8$2 = /* @__PURE__ */ from_html(`<button draggable="true"><div class="w-9 h-9 rounded-lg bg-cyan-50 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#0e7490" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="1"></rect><line x1="12" y1="4" x2="12" y2="20"></line><line x1="3" y1="12" x2="21" y2="12"></line></svg></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58711
+ var root_6$3 = /* @__PURE__ */ from_html(`<div class="grid grid-cols-2 gap-2 mb-3"></div> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Windows</h3> <div class="grid grid-cols-2 gap-2"></div>`, 1);
58712
+ var root_1$8 = /* @__PURE__ */ from_html(`<div class="space-y-1"><h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Tools</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg></div> <div class="text-left"><div class="font-medium">Select <span class="text-gray-400 text-xs ml-1">V</span></div> <div class="text-xs text-gray-400">Click to select elements</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="8" width="18" height="8" rx="1"></rect><line x1="7" y1="8" x2="7" y2="16"></line><line x1="12" y1="8" x2="12" y2="16"></line><line x1="17" y1="8" x2="17" y2="16"></line></svg></div> <div class="text-left"><div class="font-medium">Draw Wall <span class="text-gray-400 text-xs ml-1">W</span></div> <div class="text-xs text-gray-400">Click to draw, dbl-click to finish</div></div></button> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Area</h3> <div class="grid grid-cols-3 gap-1.5 mb-1"><button type="button" title="Drag to create rectangle area"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><rect x="4" y="6" width="16" height="12" rx="1"></rect></svg> Rect</button> <button type="button" title="Click to place triangle area"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><path d="M12 4 L20 19 L4 19 Z"></path></svg> Triangle</button> <button type="button" title="Click points; click first point or Enter to close"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="3 2"><path d="M7 4 L17 6 L20 14 L12 20 L4 12 Z"></path></svg> Polygon</button></div> <p class="text-[10px] text-gray-400 mb-2 px-0.5"><!></p> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Structure</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 5h-5V2h-3v6h-4V5H7v6H2v3h5v3h3v-3h4v3h3v-6h5z"></path></svg></div> <div class="text-left"><div class="font-medium">Add Stairs</div> <div class="text-xs text-gray-400">Click to place stairs</div></div></button> <div class="flex gap-2"><button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="6"></circle><line x1="6" y1="6" x2="18" y2="18"></line><line x1="18" y1="6" x2="6" y2="18"></line></svg></div> <div class="text-left"><div class="font-medium text-xs">Round Column</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="6" y="6" width="12" height="12"></rect><line x1="6" y1="6" x2="18" y2="18"></line><line x1="18" y1="6" x2="6" y2="18"></line></svg></div> <div class="text-left"><div class="font-medium text-xs">Square Column</div></div></button></div> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Annotate</h3> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V4h16v3"></path><line x1="12" y1="4" x2="12" y2="20"></line><line x1="8" y1="20" x2="16" y2="20"></line></svg></div> <div class="text-left"><div class="font-medium">Text Label</div> <div class="text-xs text-gray-400">Add text annotations (T)</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><line x1="16" y1="5" x2="22" y2="5"></line><line x1="19" y1="2" x2="19" y2="8"></line><line x1="3" y1="12" x2="12" y2="12"></line></svg></div> <div class="text-left"><div class="font-medium">Dimension</div> <div class="text-xs text-gray-400">Add dimension annotations (N)</div></div></button> <button><div><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12h5l2-7 4 14 2-7h7"></path></svg></div> <div class="text-left"><div class="font-medium">Measure</div> <div class="text-xs text-gray-400">Measure distances (M)</div></div></button> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2 mt-3">Import</h3> <button class="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors hover:bg-gray-50 text-gray-700"><div class="w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg></div> <div class="text-left"><div class="font-medium">Import Image</div> <div class="text-xs text-gray-400">Floor plan background</div></div></button> <button class="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors hover:bg-gray-50 text-gray-700"><div class="w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg></div> <div class="text-left"><div class="font-medium">Import RoomPlan</div> <div class="text-xs text-gray-400">iOS LiDAR scan (.json/.zip)</div></div></button> <button class="w-full flex items-center justify-between px-1 py-2 mt-3"><h3 class="text-xs font-semibold text-gray-400 uppercase">Doors</h3> <span class="text-gray-400 text-xs"> </span></button> <!></div>`);
58713
+ var root_10$2 = /* @__PURE__ */ from_html(`<button class="flex flex-col items-center gap-1.5 p-3 rounded-lg border-2 border-gray-100 hover:border-blue-300 hover:bg-blue-50 transition-colors cursor-grab active:cursor-grabbing" draggable="true"><div class="w-12 h-12 rounded-lg bg-gray-50 flex items-center justify-center text-2xl font-mono"> </div> <span class="text-xs font-medium text-gray-600"> </span></button>`);
58714
+ var root_11$2 = /* @__PURE__ */ from_html(`<button class="flex flex-col items-center gap-1.5 p-3 rounded-lg border-2 border-gray-100 hover:border-green-300 hover:bg-green-50 transition-colors cursor-grab active:cursor-grabbing" draggable="true"><div class="w-12 h-12 rounded-lg bg-green-50 flex items-center justify-center text-lg"><!></div> <span class="text-xs font-medium text-gray-600"> </span> <span class="text-[10px] text-gray-400"> </span></button>`);
58715
+ var root_9$2 = /* @__PURE__ */ from_html(`<div class="space-y-2"><h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Room Presets</h3> <p class="text-xs text-gray-400 mb-3">Click to add a room shape to the canvas</p> <div class="grid grid-cols-2 gap-2"></div> <hr class="my-3 border-gray-200"/> <h3 class="text-xs font-semibold text-gray-400 uppercase mb-2">Room Templates</h3> <p class="text-xs text-gray-400 mb-3">Pre-furnished rooms — walls + furniture in one click</p> <div class="grid grid-cols-2 gap-2"></div></div>`);
58716
+ var root_20$2 = /* @__PURE__ */ from_html(`<button class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 w-5 h-5 flex items-center justify-center rounded-full hover:bg-gray-100" title="Clear search"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>`);
58717
+ var root_21$1 = /* @__PURE__ */ from_html(`<div class="text-[10px] text-gray-400 px-1"> </div>`);
58718
+ var root_22$2 = /* @__PURE__ */ from_html(`<button> </button>`);
58719
+ var root_24$1 = /* @__PURE__ */ from_html(`<button draggable="true"><span role="button" tabindex="0"> </span> <div class="w-8 h-8 rounded-lg flex items-center justify-center"><div class="w-4 h-4 rounded-sm"></div></div> <span class="text-[10px] font-medium text-gray-600 leading-tight text-center"> </span></button>`);
58720
+ var root_23$2 = /* @__PURE__ */ from_html(`<div class="mt-1"><h4 class="text-[10px] font-semibold text-gray-400 uppercase mb-1.5">Recent</h4> <div class="grid grid-cols-2 gap-2"></div></div> <hr class="border-gray-100"/>`, 1);
58721
+ var root_26$1 = /* @__PURE__ */ from_html(`<span class="text-xs font-medium text-gray-600"> <mark class="bg-yellow-200 text-gray-800 rounded-sm px-0.5"> </mark> </span>`);
58722
+ var root_27$1 = /* @__PURE__ */ from_html(`<span class="text-xs font-medium text-gray-600"> </span>`);
58723
+ var root_25$1 = /* @__PURE__ */ from_html(`<button draggable="true"><span role="button" tabindex="0"> </span> <div class="w-10 h-10 rounded-lg flex items-center justify-center"><div class="w-5 h-5 rounded-sm"></div></div> <!> <span class="text-[10px] text-gray-400"> </span></button>`);
58724
+ var root_19$2 = /* @__PURE__ */ from_html(`<div class="space-y-2"><div class="relative"><input type="text" placeholder="Search furniture..." class="w-full px-3 py-2 pr-8 border border-gray-200 rounded-lg text-sm focus:ring-2 focus:ring-blue-200 focus:border-blue-400 outline-none"/> <!></div> <!> <div class="flex flex-wrap gap-1 max-h-24 overflow-y-auto"><button>All</button> <button> </button> <!></div> <!> <div class="grid grid-cols-2 gap-2 mt-2"></div></div>`);
58725
+ var root_28$1 = /* @__PURE__ */ from_html(`<div class="fixed z-50 pointer-events-none"><div class="bg-white rounded-xl shadow-2xl border border-gray-200 overflow-hidden" style="width: 220px;"><div class="w-full h-[120px] bg-gray-50 flex items-center justify-center p-3"><div class="w-16 h-16 rounded-xl flex items-center justify-center"><div class="w-10 h-10 rounded-md"></div></div></div> <div class="p-3 space-y-1.5"><div class="flex items-center gap-2"><span class="text-sm font-semibold text-gray-800"> </span> <span class="px-1.5 py-0.5 rounded-full text-[9px] font-semibold text-white"> </span></div> <div class="text-xs text-gray-500"> </div></div></div></div>`);
58726
+ var root_29$1 = /* @__PURE__ */ from_html(`<div class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center"><div class="bg-white rounded-xl shadow-2xl w-80 p-5"><h3 class="text-sm font-bold text-gray-800 mb-1">Import RoomPlan</h3> <p class="text-xs text-gray-400 mb-4"> </p> <div class="space-y-3"><label class="flex items-start gap-2.5 cursor-pointer"><input type="checkbox" class="accent-blue-500 mt-0.5"/> <div><div class="text-sm font-medium text-gray-700">Straighten walls</div> <div class="text-xs text-gray-400">Snap near-horizontal/vertical walls to axis</div></div></label> <label class="flex items-start gap-2.5 cursor-pointer"><input type="checkbox" class="accent-blue-500 mt-0.5"/> <div><div class="text-sm font-medium text-gray-700">Enforce orthogonal <span class="text-xs text-blue-400 font-mono"> </span></div> <div class="text-xs text-gray-400">Force all walls to 90°/180° angles</div></div></label> <label class="block"><div class="text-xs text-gray-500 mb-1">Corner merge distance (cm)</div> <input type="number" min="0" max="50" step="5" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label></div> <div class="flex gap-2 mt-5"><button class="flex-1 px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition-colors">Cancel</button> <button class="flex-1 px-3 py-2 bg-blue-500 text-white rounded-lg text-sm font-medium hover:bg-blue-600 transition-colors">Import</button></div></div></div>`);
58671
58727
  var root$4 = /* @__PURE__ */ from_html(`<div class="relative w-64 bg-white border-r border-gray-200 flex flex-col h-full overflow-hidden"><div class="flex border-b border-gray-200"><button>Build</button> <button>Rooms</button> <button>Objects</button></div> <div class="flex-1 overflow-y-auto p-3"><!></div> <button title="Layers Panel (L)" aria-label="Toggle Layers Panel">🗂</button> <button title="Undo History" aria-label="Toggle Undo History">⟲</button> <button class="absolute bottom-4 left-4 w-8 h-8 rounded-full bg-slate-700 text-white text-sm font-bold shadow-lg hover:bg-slate-600 transition-colors z-50" title="Keyboard Shortcuts (?)" aria-label="Keyboard Shortcuts">?</button></div> <!> <!>`, 1);
58672
58728
  function BuildPanel($$anchor, $$props) {
58673
58729
  push($$props, true);
@@ -59008,43 +59064,47 @@ function BuildPanel($$anchor, $$props) {
59008
59064
  var div_5 = child(button_4);
59009
59065
  next(2);
59010
59066
  reset(button_4);
59011
- var button_5 = sibling(button_4, 4);
59012
- var div_6 = child(button_5);
59013
- next(2);
59014
- reset(button_5);
59015
- var div_7 = sibling(button_5, 2);
59016
- var button_6 = child(div_7);
59017
- var div_8 = child(button_6);
59018
- next(2);
59019
- reset(button_6);
59067
+ var div_6 = sibling(button_4, 4);
59068
+ var button_5 = child(div_6);
59069
+ var button_6 = sibling(button_5, 2);
59020
59070
  var button_7 = sibling(button_6, 2);
59021
- var div_9 = child(button_7);
59022
- next(2);
59023
- reset(button_7);
59024
- reset(div_7);
59025
- var div_10 = sibling(div_7, 4);
59026
- var button_8 = child(div_10);
59027
- var button_9 = sibling(button_8, 2);
59028
- var button_10 = sibling(button_9, 2);
59029
- reset(div_10);
59030
- var p_1 = sibling(div_10, 2);
59071
+ reset(div_6);
59072
+ var p_1 = sibling(div_6, 2);
59031
59073
  var node_1 = child(p_1);
59032
59074
  var consequent = ($$anchor) => {
59033
- append($$anchor, text$1("Drag on canvas to draw a rectangle"));
59075
+ append($$anchor, text$1("Drag to draw · name/color from camera Area / Area Color"));
59034
59076
  };
59035
59077
  var consequent_1 = ($$anchor) => {
59036
- append($$anchor, text$1("Click to place a triangle, then drag vertices"));
59078
+ append($$anchor, text$1("Click to place · then drag vertices"));
59037
59079
  };
59038
59080
  var consequent_2 = ($$anchor) => {
59039
59081
  append($$anchor, text$1("Click vertices · Enter / click first point to close"));
59040
59082
  };
59083
+ var alternate = ($$anchor) => {
59084
+ append($$anchor, text$1("Select a camera first, then draw its Area"));
59085
+ };
59041
59086
  if_block(node_1, ($$render) => {
59042
59087
  if (get(currentTool) === "zone" && get(currentZoneShape) === "rectangle") $$render(consequent);
59043
59088
  else if (get(currentTool) === "zone" && get(currentZoneShape) === "triangle") $$render(consequent_1, 1);
59044
59089
  else if (get(currentTool) === "zone" && get(currentZoneShape) === "polygon") $$render(consequent_2, 2);
59090
+ else $$render(alternate, -1);
59045
59091
  });
59046
59092
  reset(p_1);
59047
- var button_11 = sibling(p_1, 4);
59093
+ var button_8 = sibling(p_1, 4);
59094
+ var div_7 = child(button_8);
59095
+ next(2);
59096
+ reset(button_8);
59097
+ var div_8 = sibling(button_8, 2);
59098
+ var button_9 = child(div_8);
59099
+ var div_9 = child(button_9);
59100
+ next(2);
59101
+ reset(button_9);
59102
+ var button_10 = sibling(button_9, 2);
59103
+ var div_10 = child(button_10);
59104
+ next(2);
59105
+ reset(button_10);
59106
+ reset(div_8);
59107
+ var button_11 = sibling(div_8, 4);
59048
59108
  var div_11 = child(button_11);
59049
59109
  next(2);
59050
59110
  reset(button_11);
@@ -59060,32 +59120,32 @@ function BuildPanel($$anchor, $$props) {
59060
59120
  var button_15 = sibling(button_14, 2);
59061
59121
  var button_16 = sibling(button_15, 2);
59062
59122
  var span = sibling(child(button_16), 2);
59063
- var text_4 = child(span, true);
59123
+ var text_5 = child(span, true);
59064
59124
  reset(span);
59065
59125
  reset(button_16);
59066
59126
  var node_2 = sibling(button_16, 2);
59067
59127
  var consequent_3 = ($$anchor) => {
59068
- var fragment_1 = root_5$4();
59128
+ var fragment_1 = root_6$3();
59069
59129
  var div_14 = first_child(fragment_1);
59070
59130
  each(div_14, 21, () => doorCatalog, index$1, ($$anchor, dc) => {
59071
- var button_17 = root_6$3();
59131
+ var button_17 = root_7$4();
59072
59132
  var div_15 = child(button_17);
59073
59133
  var svg = child(div_15);
59074
59134
  var path = child(svg);
59075
59135
  reset(svg);
59076
59136
  reset(div_15);
59077
59137
  var span_1 = sibling(div_15, 2);
59078
- var text_5 = child(span_1, true);
59138
+ var text_6 = child(span_1, true);
59079
59139
  reset(span_1);
59080
59140
  var span_2 = sibling(span_1, 2);
59081
- var text_6 = child(span_2, true);
59141
+ var text_7 = child(span_2, true);
59082
59142
  reset(span_2);
59083
59143
  reset(button_17);
59084
59144
  template_effect(() => {
59085
59145
  set_class(button_17, 1, `flex flex-col items-center gap-1 p-2.5 rounded-lg border-2 transition-colors cursor-grab active:cursor-grabbing ${get(currentTool) === "door" && get(selectedDoorType) === get(dc).type ? "border-blue-400 bg-blue-50" : "border-gray-100 hover:border-gray-200"}`);
59086
59146
  set_attribute(path, "d", get(dc).icon);
59087
- set_text(text_5, get(dc).name);
59088
- set_text(text_6, get(dc).desc);
59147
+ set_text(text_6, get(dc).name);
59148
+ set_text(text_7, get(dc).desc);
59089
59149
  });
59090
59150
  delegated("click", button_17, () => setDoorType(get(dc).type));
59091
59151
  event("dragstart", button_17, (e) => {
@@ -59098,18 +59158,18 @@ function BuildPanel($$anchor, $$props) {
59098
59158
  reset(div_14);
59099
59159
  var div_16 = sibling(div_14, 4);
59100
59160
  each(div_16, 21, () => windowCatalog, index$1, ($$anchor, wc) => {
59101
- var button_18 = root_7$4();
59161
+ var button_18 = root_8$2();
59102
59162
  var span_3 = sibling(child(button_18), 2);
59103
- var text_7 = child(span_3, true);
59163
+ var text_8 = child(span_3, true);
59104
59164
  reset(span_3);
59105
59165
  var span_4 = sibling(span_3, 2);
59106
- var text_8 = child(span_4, true);
59166
+ var text_9 = child(span_4, true);
59107
59167
  reset(span_4);
59108
59168
  reset(button_18);
59109
59169
  template_effect(() => {
59110
59170
  set_class(button_18, 1, `flex flex-col items-center gap-1 p-2.5 rounded-lg border-2 transition-colors cursor-grab active:cursor-grabbing ${get(currentTool) === "window" && get(selectedWindowType) === get(wc).type ? "border-blue-400 bg-blue-50" : "border-gray-100 hover:border-gray-200"}`);
59111
- set_text(text_7, get(wc).name);
59112
- set_text(text_8, get(wc).desc);
59171
+ set_text(text_8, get(wc).name);
59172
+ set_text(text_9, get(wc).desc);
59113
59173
  });
59114
59174
  delegated("click", button_18, () => setWindowType(get(wc).type));
59115
59175
  event("dragstart", button_18, (e) => {
@@ -59131,31 +59191,31 @@ function BuildPanel($$anchor, $$props) {
59131
59191
  set_class(div_4, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "select" ? "bg-blue-100" : ""}`);
59132
59192
  set_class(button_4, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(currentTool) === "wall" ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59133
59193
  set_class(div_5, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "wall" ? "bg-blue-100" : ""}`);
59134
- set_class(button_5, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingStair) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59135
- set_class(div_6, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(isPlacingStair) ? "bg-blue-100" : ""}`);
59136
- set_class(button_6, 1, `flex-1 flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingColumn) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59137
- set_class(div_8, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(isPlacingColumn) ? "bg-blue-100" : ""}`);
59138
- set_class(button_7, 1, `flex-1 flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingColumn) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59194
+ set_class(button_5, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "rectangle" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59195
+ set_class(button_6, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "triangle" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59196
+ set_class(button_7, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "polygon" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59197
+ set_class(button_8, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingStair) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59198
+ set_class(div_7, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(isPlacingStair) ? "bg-blue-100" : ""}`);
59199
+ set_class(button_9, 1, `flex-1 flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingColumn) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59139
59200
  set_class(div_9, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(isPlacingColumn) ? "bg-blue-100" : ""}`);
59140
- set_class(button_8, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "rectangle" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59141
- set_class(button_9, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "triangle" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59142
- set_class(button_10, 1, `flex flex-col items-center gap-1 p-2 rounded-lg border-2 text-xs transition-colors ${get(currentTool) === "zone" && get(currentZoneShape) === "polygon" ? "border-orange-400 bg-orange-50" : "border-gray-100 hover:border-gray-200"}`);
59201
+ set_class(button_10, 1, `flex-1 flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(isPlacingColumn) ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59202
+ set_class(div_10, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(isPlacingColumn) ? "bg-blue-100" : ""}`);
59143
59203
  set_class(button_11, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(currentTool) === "text" ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59144
59204
  set_class(div_11, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "text" ? "bg-blue-100" : ""}`);
59145
59205
  set_class(button_12, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(currentTool) === "annotate" ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59146
59206
  set_class(div_12, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "annotate" ? "bg-blue-100" : ""}`);
59147
59207
  set_class(button_13, 1, `w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ${get(currentTool) === "measure" ? "bg-blue-50 text-slate-800 ring-1 ring-blue-200" : "hover:bg-gray-50 text-gray-700"}`);
59148
59208
  set_class(div_13, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "measure" ? "bg-blue-100" : ""}`);
59149
- set_text(text_4, get(constructionOpen) ? "▼" : "▶");
59209
+ set_text(text_5, get(constructionOpen) ? "▼" : "▶");
59150
59210
  });
59151
59211
  delegated("click", button_3, () => setTool("select"));
59152
59212
  delegated("click", button_4, () => setTool("wall"));
59153
- delegated("click", button_5, onPlaceStair);
59154
- delegated("click", button_6, () => onPlaceColumn("round"));
59155
- delegated("click", button_7, () => onPlaceColumn("square"));
59156
- delegated("click", button_8, () => setZoneTool("rectangle"));
59157
- delegated("click", button_9, () => setZoneTool("triangle"));
59158
- delegated("click", button_10, () => setZoneTool("polygon"));
59213
+ delegated("click", button_5, () => setZoneTool("rectangle"));
59214
+ delegated("click", button_6, () => setZoneTool("triangle"));
59215
+ delegated("click", button_7, () => setZoneTool("polygon"));
59216
+ delegated("click", button_8, onPlaceStair);
59217
+ delegated("click", button_9, () => onPlaceColumn("round"));
59218
+ delegated("click", button_10, () => onPlaceColumn("square"));
59159
59219
  delegated("click", button_11, () => setTool("text"));
59160
59220
  delegated("click", button_12, () => setTool("annotate"));
59161
59221
  delegated("click", button_13, () => setTool("measure"));
@@ -59165,20 +59225,20 @@ function BuildPanel($$anchor, $$props) {
59165
59225
  append($$anchor, div_3);
59166
59226
  };
59167
59227
  var consequent_11 = ($$anchor) => {
59168
- var div_17 = root_8$2();
59228
+ var div_17 = root_9$2();
59169
59229
  var div_18 = sibling(child(div_17), 4);
59170
59230
  each(div_18, 21, () => roomPresets, index$1, ($$anchor, preset) => {
59171
- var button_19 = root_9$2();
59231
+ var button_19 = root_10$2();
59172
59232
  var div_19 = child(button_19);
59173
- var text_9 = child(div_19, true);
59233
+ var text_10 = child(div_19, true);
59174
59234
  reset(div_19);
59175
59235
  var span_5 = sibling(div_19, 2);
59176
- var text_10 = child(span_5, true);
59236
+ var text_11 = child(span_5, true);
59177
59237
  reset(span_5);
59178
59238
  reset(button_19);
59179
59239
  template_effect(() => {
59180
- set_text(text_9, get(preset).icon);
59181
- set_text(text_10, get(preset).name);
59240
+ set_text(text_10, get(preset).icon);
59241
+ set_text(text_11, get(preset).name);
59182
59242
  });
59183
59243
  delegated("click", button_19, () => onPresetClick(get(preset).id));
59184
59244
  event("dragstart", button_19, (e) => {
@@ -59191,7 +59251,7 @@ function BuildPanel($$anchor, $$props) {
59191
59251
  reset(div_18);
59192
59252
  var div_20 = sibling(div_18, 8);
59193
59253
  each(div_20, 21, () => roomTemplates, index$1, ($$anchor, tmpl) => {
59194
- var button_20 = root_10$2();
59254
+ var button_20 = root_11$2();
59195
59255
  var div_21 = child(button_20);
59196
59256
  var node_3 = child(div_21);
59197
59257
  var consequent_5 = ($$anchor) => {
@@ -59212,7 +59272,7 @@ function BuildPanel($$anchor, $$props) {
59212
59272
  var consequent_10 = ($$anchor) => {
59213
59273
  append($$anchor, text$1("🍽️"));
59214
59274
  };
59215
- var alternate = ($$anchor) => {
59275
+ var alternate_1 = ($$anchor) => {
59216
59276
  append($$anchor, text$1("🏠"));
59217
59277
  };
59218
59278
  if_block(node_3, ($$render) => {
@@ -59222,20 +59282,20 @@ function BuildPanel($$anchor, $$props) {
59222
59282
  else if (get(tmpl).name === "Bathroom") $$render(consequent_8, 3);
59223
59283
  else if (get(tmpl).name === "Office") $$render(consequent_9, 4);
59224
59284
  else if (get(tmpl).name === "Dining Room") $$render(consequent_10, 5);
59225
- else $$render(alternate, -1);
59285
+ else $$render(alternate_1, -1);
59226
59286
  });
59227
59287
  reset(div_21);
59228
59288
  var span_6 = sibling(div_21, 2);
59229
- var text_18 = child(span_6, true);
59289
+ var text_19 = child(span_6, true);
59230
59290
  reset(span_6);
59231
59291
  var span_7 = sibling(span_6, 2);
59232
- var text_19 = child(span_7);
59292
+ var text_20 = child(span_7);
59233
59293
  reset(span_7);
59234
59294
  reset(button_20);
59235
59295
  template_effect(() => {
59236
59296
  var _$$get$furniture$leng;
59237
- set_text(text_18, get(tmpl).name);
59238
- set_text(text_19, `${(_$$get$furniture$leng = get(tmpl).furniture.length) !== null && _$$get$furniture$leng !== void 0 ? _$$get$furniture$leng : ""} items`);
59297
+ set_text(text_19, get(tmpl).name);
59298
+ set_text(text_20, `${(_$$get$furniture$leng = get(tmpl).furniture.length) !== null && _$$get$furniture$leng !== void 0 ? _$$get$furniture$leng : ""} items`);
59239
59299
  });
59240
59300
  delegated("click", button_20, () => onPresetClick(get(tmpl).presetId, get(tmpl).name));
59241
59301
  event("dragstart", button_20, (e) => {
@@ -59250,13 +59310,13 @@ function BuildPanel($$anchor, $$props) {
59250
59310
  append($$anchor, div_17);
59251
59311
  };
59252
59312
  var consequent_16 = ($$anchor) => {
59253
- var div_22 = root_18$2();
59313
+ var div_22 = root_19$2();
59254
59314
  var div_23 = child(div_22);
59255
59315
  var input_1 = child(div_23);
59256
59316
  remove_input_defaults(input_1);
59257
59317
  var node_4 = sibling(input_1, 2);
59258
59318
  var consequent_12 = ($$anchor) => {
59259
- var button_21 = root_19$2();
59319
+ var button_21 = root_20$2();
59260
59320
  delegated("click", button_21, () => set(search, ""));
59261
59321
  append($$anchor, button_21);
59262
59322
  };
@@ -59266,12 +59326,12 @@ function BuildPanel($$anchor, $$props) {
59266
59326
  reset(div_23);
59267
59327
  var node_5 = sibling(div_23, 2);
59268
59328
  var consequent_13 = ($$anchor) => {
59269
- var div_24 = root_20$2();
59270
- var text_20 = child(div_24);
59329
+ var div_24 = root_21$1();
59330
+ var text_21 = child(div_24);
59271
59331
  reset(div_24);
59272
59332
  template_effect(() => {
59273
59333
  var _$$get$length, _$$get;
59274
- return set_text(text_20, `${(_$$get$length = get(filtered).length) !== null && _$$get$length !== void 0 ? _$$get$length : ""} result${get(filtered).length !== 1 ? "s" : ""} for "${(_$$get = get(search)) !== null && _$$get !== void 0 ? _$$get : ""}"`);
59334
+ return set_text(text_21, `${(_$$get$length = get(filtered).length) !== null && _$$get$length !== void 0 ? _$$get$length : ""} result${get(filtered).length !== 1 ? "s" : ""} for "${(_$$get = get(search)) !== null && _$$get !== void 0 ? _$$get : ""}"`);
59275
59335
  });
59276
59336
  append($$anchor, div_24);
59277
59337
  };
@@ -59281,17 +59341,17 @@ function BuildPanel($$anchor, $$props) {
59281
59341
  var div_25 = sibling(node_5, 2);
59282
59342
  var button_22 = child(div_25);
59283
59343
  var button_23 = sibling(button_22, 2);
59284
- var text_21 = child(button_23);
59344
+ var text_22 = child(button_23);
59285
59345
  reset(button_23);
59286
59346
  each(sibling(button_23, 2), 17, () => furnitureCategories, index$1, ($$anchor, cat) => {
59287
- var button_24 = root_21$1();
59288
- var text_22 = child(button_24, true);
59347
+ var button_24 = root_22$2();
59348
+ var text_23 = child(button_24, true);
59289
59349
  reset(button_24);
59290
59350
  template_effect(() => {
59291
59351
  var _categoryColors$$$get;
59292
59352
  set_class(button_24, 1, `px-2 py-0.5 rounded-full text-[10px] font-medium ${get(selectedCategory) === get(cat) ? "text-white" : "text-gray-600 hover:bg-gray-200"}`);
59293
59353
  set_style(button_24, get(selectedCategory) === get(cat) ? `background-color: ${(_categoryColors$$$get = categoryColors[get(cat)]) !== null && _categoryColors$$$get !== void 0 ? _categoryColors$$$get : "#6b7280"}` : "background-color: #f3f4f6");
59294
- set_text(text_22, get(cat));
59354
+ set_text(text_23, get(cat));
59295
59355
  });
59296
59356
  delegated("click", button_24, () => set(selectedCategory, get(cat), true));
59297
59357
  append($$anchor, button_24);
@@ -59299,19 +59359,19 @@ function BuildPanel($$anchor, $$props) {
59299
59359
  reset(div_25);
59300
59360
  var node_7 = sibling(div_25, 2);
59301
59361
  var consequent_14 = ($$anchor) => {
59302
- var fragment_2 = root_22$2();
59362
+ var fragment_2 = root_23$2();
59303
59363
  var div_26 = first_child(fragment_2);
59304
59364
  var div_27 = sibling(child(div_26), 2);
59305
59365
  each(div_27, 21, () => get(recentItems), index$1, ($$anchor, item) => {
59306
- var button_25 = root_23$2();
59366
+ var button_25 = root_24$1();
59307
59367
  var span_8 = child(button_25);
59308
- var text_23 = child(span_8, true);
59368
+ var text_24 = child(span_8, true);
59309
59369
  reset(span_8);
59310
59370
  var div_28 = sibling(span_8, 2);
59311
59371
  var div_29 = child(div_28);
59312
59372
  reset(div_28);
59313
59373
  var span_9 = sibling(div_28, 2);
59314
- var text_24 = child(span_9, true);
59374
+ var text_25 = child(span_9, true);
59315
59375
  reset(span_9);
59316
59376
  reset(button_25);
59317
59377
  template_effect(($0, $1, $2) => {
@@ -59319,10 +59379,10 @@ function BuildPanel($$anchor, $$props) {
59319
59379
  set_class(button_25, 1, `relative flex flex-col items-center gap-1 p-2.5 rounded-lg border-2 transition-colors cursor-grab active:cursor-grabbing ${get(currentPlacing) === get(item).id ? "border-blue-400 bg-blue-50 ring-1 ring-blue-300" : "border-gray-100 hover:border-blue-300 hover:bg-blue-50"}`);
59320
59380
  set_class(span_8, 1, `absolute top-1 right-1 text-[12px] leading-none cursor-pointer ${$0 !== null && $0 !== void 0 ? $0 : ""}`);
59321
59381
  set_attribute(span_8, "title", $1);
59322
- set_text(text_23, $2);
59382
+ set_text(text_24, $2);
59323
59383
  set_style(div_28, `background-color: ${(_$$get$color = get(item).color) !== null && _$$get$color !== void 0 ? _$$get$color : ""}20`);
59324
59384
  set_style(div_29, `background-color: ${(_$$get$color2 = get(item).color) !== null && _$$get$color2 !== void 0 ? _$$get$color2 : ""}; opacity: 0.7`);
59325
- set_text(text_24, get(item).name);
59385
+ set_text(text_25, get(item).name);
59326
59386
  }, [
59327
59387
  () => get(favoriteIds).includes(get(item).id) ? "text-pink-500" : "text-gray-300 hover:text-pink-400",
59328
59388
  () => get(favoriteIds).includes(get(item).id) ? "Remove from favorites" : "Add to favorites",
@@ -59361,9 +59421,9 @@ function BuildPanel($$anchor, $$props) {
59361
59421
  var div_30 = sibling(node_7, 2);
59362
59422
  each(div_30, 21, () => get(filtered), index$1, ($$anchor, item) => {
59363
59423
  const s = /* @__PURE__ */ user_derived(() => get(search).toLowerCase());
59364
- var button_26 = root_24$1();
59424
+ var button_26 = root_25$1();
59365
59425
  var span_10 = child(button_26);
59366
- var text_25 = child(span_10, true);
59426
+ var text_26 = child(span_10, true);
59367
59427
  reset(span_10);
59368
59428
  var div_31 = sibling(span_10, 2);
59369
59429
  var div_32 = child(div_31);
@@ -59371,17 +59431,17 @@ function BuildPanel($$anchor, $$props) {
59371
59431
  var node_8 = sibling(div_31, 2);
59372
59432
  var consequent_15 = ($$anchor) => {
59373
59433
  const idx = /* @__PURE__ */ user_derived(() => get(item).name.toLowerCase().indexOf(get(s)));
59374
- var span_11 = root_25$1();
59375
- var text_26 = child(span_11, true);
59376
- var mark = sibling(text_26);
59377
- var text_27 = child(mark, true);
59434
+ var span_11 = root_26$1();
59435
+ var text_27 = child(span_11, true);
59436
+ var mark = sibling(text_27);
59437
+ var text_28 = child(mark, true);
59378
59438
  reset(mark);
59379
- var text_28 = sibling(mark, 1, true);
59439
+ var text_29 = sibling(mark, 1, true);
59380
59440
  reset(span_11);
59381
59441
  template_effect(($0, $1, $2) => {
59382
- set_text(text_26, $0);
59383
- set_text(text_27, $1);
59384
- set_text(text_28, $2);
59442
+ set_text(text_27, $0);
59443
+ set_text(text_28, $1);
59444
+ set_text(text_29, $2);
59385
59445
  }, [
59386
59446
  () => get(item).name.slice(0, get(idx)),
59387
59447
  () => get(item).name.slice(get(idx), get(idx) + get(s).length),
@@ -59390,19 +59450,19 @@ function BuildPanel($$anchor, $$props) {
59390
59450
  append($$anchor, span_11);
59391
59451
  };
59392
59452
  var d = /* @__PURE__ */ user_derived(() => get(s) && get(item).name.toLowerCase().includes(get(s)));
59393
- var alternate_1 = ($$anchor) => {
59394
- var span_12 = root_26$1();
59395
- var text_29 = child(span_12, true);
59453
+ var alternate_2 = ($$anchor) => {
59454
+ var span_12 = root_27$1();
59455
+ var text_30 = child(span_12, true);
59396
59456
  reset(span_12);
59397
- template_effect(() => set_text(text_29, get(item).name));
59457
+ template_effect(() => set_text(text_30, get(item).name));
59398
59458
  append($$anchor, span_12);
59399
59459
  };
59400
59460
  if_block(node_8, ($$render) => {
59401
59461
  if (get(d)) $$render(consequent_15);
59402
- else $$render(alternate_1, -1);
59462
+ else $$render(alternate_2, -1);
59403
59463
  });
59404
59464
  var span_13 = sibling(node_8, 2);
59405
- var text_30 = child(span_13);
59465
+ var text_31 = child(span_13);
59406
59466
  reset(span_13);
59407
59467
  reset(button_26);
59408
59468
  template_effect(($0, $1, $2) => {
@@ -59410,10 +59470,10 @@ function BuildPanel($$anchor, $$props) {
59410
59470
  set_class(button_26, 1, `relative flex flex-col items-center gap-1 p-3 rounded-lg border-2 transition-colors cursor-grab active:cursor-grabbing ${get(currentPlacing) === get(item).id ? "border-blue-400 bg-blue-50 ring-1 ring-blue-300" : "border-gray-100 hover:border-blue-300 hover:bg-blue-50"}`);
59411
59471
  set_class(span_10, 1, `absolute top-1 right-1 text-[12px] leading-none cursor-pointer ${$0 !== null && $0 !== void 0 ? $0 : ""}`);
59412
59472
  set_attribute(span_10, "title", $1);
59413
- set_text(text_25, $2);
59473
+ set_text(text_26, $2);
59414
59474
  set_style(div_31, `background-color: ${(_$$get$color3 = get(item).color) !== null && _$$get$color3 !== void 0 ? _$$get$color3 : ""}20`);
59415
59475
  set_style(div_32, `background-color: ${(_$$get$color4 = get(item).color) !== null && _$$get$color4 !== void 0 ? _$$get$color4 : ""}; opacity: 0.7`);
59416
- set_text(text_30, `${(_$$get$width = get(item).width) !== null && _$$get$width !== void 0 ? _$$get$width : ""}×${(_$$get$depth = get(item).depth) !== null && _$$get$depth !== void 0 ? _$$get$depth : ""}cm`);
59476
+ set_text(text_31, `${(_$$get$width = get(item).width) !== null && _$$get$width !== void 0 ? _$$get$width : ""}×${(_$$get$depth = get(item).depth) !== null && _$$get$depth !== void 0 ? _$$get$depth : ""}cm`);
59417
59477
  }, [
59418
59478
  () => get(favoriteIds).includes(get(item).id) ? "text-pink-500" : "text-gray-300 hover:text-pink-400",
59419
59479
  () => get(favoriteIds).includes(get(item).id) ? "Remove from favorites" : "Add to favorites",
@@ -59446,7 +59506,7 @@ function BuildPanel($$anchor, $$props) {
59446
59506
  template_effect(() => {
59447
59507
  set_class(button_22, 1, `px-2 py-0.5 rounded-full text-[10px] font-medium ${get(selectedCategory) === "All" ? "bg-blue-600 text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`);
59448
59508
  set_class(button_23, 1, `px-2 py-0.5 rounded-full text-[10px] font-medium ${get(selectedCategory) === "Favorites" ? "bg-pink-500 text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`);
59449
- set_text(text_21, `♥ Favorites${get(favoriteIds).length ? ` (${get(favoriteIds).length})` : ""}`);
59509
+ set_text(text_22, `♥ Favorites${get(favoriteIds).length ? ` (${get(favoriteIds).length})` : ""}`);
59450
59510
  });
59451
59511
  bind_value(input_1, () => get(search), ($$value) => set(search, $$value));
59452
59512
  delegated("click", button_22, () => set(selectedCategory, "All"));
@@ -59468,7 +59528,7 @@ function BuildPanel($$anchor, $$props) {
59468
59528
  var node_9 = sibling(div, 2);
59469
59529
  var consequent_17 = ($$anchor) => {
59470
59530
  const item = /* @__PURE__ */ user_derived(() => get(hoveredItem));
59471
- var div_33 = root_27$1();
59531
+ var div_33 = root_28$1();
59472
59532
  var div_34 = child(div_33);
59473
59533
  var div_35 = child(div_34);
59474
59534
  var div_36 = child(div_35);
@@ -59478,14 +59538,14 @@ function BuildPanel($$anchor, $$props) {
59478
59538
  var div_38 = sibling(div_35, 2);
59479
59539
  var div_39 = child(div_38);
59480
59540
  var span_14 = child(div_39);
59481
- var text_31 = child(span_14, true);
59541
+ var text_32 = child(span_14, true);
59482
59542
  reset(span_14);
59483
59543
  var span_15 = sibling(span_14, 2);
59484
- var text_32 = child(span_15, true);
59544
+ var text_33 = child(span_15, true);
59485
59545
  reset(span_15);
59486
59546
  reset(div_39);
59487
59547
  var div_40 = sibling(div_39, 2);
59488
- var text_33 = child(div_40);
59548
+ var text_34 = child(div_40);
59489
59549
  reset(div_40);
59490
59550
  reset(div_38);
59491
59551
  reset(div_34);
@@ -59495,10 +59555,10 @@ function BuildPanel($$anchor, $$props) {
59495
59555
  set_style(div_33, `left: ${(_$$get$x = get(hoverPos).x) !== null && _$$get$x !== void 0 ? _$$get$x : ""}px; top: ${(_$$get$y = get(hoverPos).y) !== null && _$$get$y !== void 0 ? _$$get$y : ""}px;`);
59496
59556
  set_style(div_36, `background-color: ${(_$$get$color5 = get(item).color) !== null && _$$get$color5 !== void 0 ? _$$get$color5 : ""}20`);
59497
59557
  set_style(div_37, `background-color: ${(_$$get$color6 = get(item).color) !== null && _$$get$color6 !== void 0 ? _$$get$color6 : ""}; opacity: 0.7`);
59498
- set_text(text_31, get(item).name);
59558
+ set_text(text_32, get(item).name);
59499
59559
  set_style(span_15, `background-color: ${(_ref = (_categoryColors$$$get2 = categoryColors[get(item).category]) !== null && _categoryColors$$$get2 !== void 0 ? _categoryColors$$$get2 : "#6b7280") !== null && _ref !== void 0 ? _ref : ""}`);
59500
- set_text(text_32, get(item).category);
59501
- set_text(text_33, `${(_$$get$width2 = get(item).width) !== null && _$$get$width2 !== void 0 ? _$$get$width2 : ""} × ${(_$$get$depth2 = get(item).depth) !== null && _$$get$depth2 !== void 0 ? _$$get$depth2 : ""} × ${(_$$get$height = get(item).height) !== null && _$$get$height !== void 0 ? _$$get$height : ""} cm`);
59560
+ set_text(text_33, get(item).category);
59561
+ set_text(text_34, `${(_$$get$width2 = get(item).width) !== null && _$$get$width2 !== void 0 ? _$$get$width2 : ""} × ${(_$$get$depth2 = get(item).depth) !== null && _$$get$depth2 !== void 0 ? _$$get$depth2 : ""} × ${(_$$get$height = get(item).height) !== null && _$$get$height !== void 0 ? _$$get$height : ""} cm`);
59502
59562
  });
59503
59563
  append($$anchor, div_33);
59504
59564
  };
@@ -59507,10 +59567,10 @@ function BuildPanel($$anchor, $$props) {
59507
59567
  });
59508
59568
  var node_10 = sibling(node_9, 2);
59509
59569
  var consequent_18 = ($$anchor) => {
59510
- var div_41 = root_28$1();
59570
+ var div_41 = root_29$1();
59511
59571
  var div_42 = child(div_41);
59512
59572
  var p_2 = sibling(child(div_42), 2);
59513
- var text_34 = child(p_2, true);
59573
+ var text_35 = child(p_2, true);
59514
59574
  reset(p_2);
59515
59575
  var div_43 = sibling(p_2, 2);
59516
59576
  var label = child(div_43);
@@ -59524,7 +59584,7 @@ function BuildPanel($$anchor, $$props) {
59524
59584
  var div_44 = sibling(input_3, 2);
59525
59585
  var div_45 = child(div_44);
59526
59586
  var span_16 = sibling(child(div_45));
59527
- var text_35 = child(span_16, true);
59587
+ var text_36 = child(span_16, true);
59528
59588
  reset(span_16);
59529
59589
  reset(div_45);
59530
59590
  next(2);
@@ -59542,8 +59602,8 @@ function BuildPanel($$anchor, $$props) {
59542
59602
  reset(div_42);
59543
59603
  reset(div_41);
59544
59604
  template_effect(() => {
59545
- set_text(text_34, get(importFileName));
59546
- set_text(text_35, "v5");
59605
+ set_text(text_35, get(importFileName));
59606
+ set_text(text_36, "v5");
59547
59607
  });
59548
59608
  delegated("click", div_41, cancelImport);
59549
59609
  delegated("click", div_42, (e) => e.stopPropagation());
@@ -59964,10 +60024,11 @@ var root_23$1 = /* @__PURE__ */ from_html(`<h3 class="text-sm font-semibold text
59964
60024
  var root_25 = /* @__PURE__ */ from_html(`<button></button>`);
59965
60025
  var root_26 = /* @__PURE__ */ from_html(`<label class="block"><span class="text-xs text-gray-500">Rotation (degrees)</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label>`);
59966
60026
  var root_24 = /* @__PURE__ */ from_html(`<h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 bg-gray-200 rounded flex items-center justify-center text-xs">🏛️</span> Column Properties</h3> <div class="space-y-3"><label class="block"><span class="text-xs text-gray-500">Shape</span> <div class="flex gap-2"><button>⭕ Round</button> <button>⬜ Square</button></div></label> <label class="block"><span class="text-xs text-gray-500"> </span> <input type="number" min="10" max="200" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500"> </span> <input type="number" min="50" max="1000" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <div><span class="text-xs text-gray-500 mb-1.5 block">Color</span> <div class="grid grid-cols-5 gap-1.5 mb-2"></div> <div class="flex items-center gap-2"><span class="text-xs text-gray-500">Custom:</span> <input type="color" class="w-8 h-6 rounded border border-gray-200 cursor-pointer"/></div></div> <!></div>`, 1);
59967
- var root_28 = /* @__PURE__ */ from_html(`<button type="button"></button>`);
59968
- var root_27 = /* @__PURE__ */ from_html(`<div class="space-y-3"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 rounded flex items-center justify-center text-xs">⬡</span> Zone</h3> <label class="block"><span class="text-xs text-gray-500">Name</span> <input type="text" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <div class="text-xs text-gray-500">Shape: <span class="text-gray-700 capitalize"> </span></div> <label class="block"><span class="text-xs text-gray-500">Color</span> <div class="flex flex-wrap gap-1.5 mt-1"><!> <input type="color" class="w-8 h-6 rounded border border-gray-200 cursor-pointer"/></div></label> <label class="block"><span class="text-xs text-gray-500">Fill opacity</span> <input type="range" min="0" max="0.4" step="0.02" class="w-full"/></label></div>`);
59969
- var root_29 = /* @__PURE__ */ from_html(`<div class="space-y-3"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 bg-emerald-100 rounded flex items-center justify-center text-xs">🏷️</span> Text Annotation</h3> <label class="block"><span class="text-xs text-gray-500">Text</span> <input type="text" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Font Size</span> <input type="number" min="8" max="72" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Color</span> <div class="flex items-center gap-2"><input type="color" class="w-8 h-6 rounded border border-gray-200 cursor-pointer"/> <span class="text-xs text-gray-400"> </span></div></label> <label class="block"><span class="text-xs text-gray-500">Rotation (°)</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">X</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Y</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label></div>`);
59970
- var root_30 = /* @__PURE__ */ from_html(`<div class="mt-4 pt-3 border-t border-gray-200"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 bg-blue-100 rounded flex items-center justify-center text-xs">🖼️</span> Background Image</h3> <div class="space-y-3"><label class="block"><span class="text-xs text-gray-500">Opacity</span> <input type="range" min="0.05" max="1" step="0.05" class="w-full"/></label> <label class="block"><span class="text-xs text-gray-500">Scale</span> <input type="range" min="0.1" max="5" step="0.05" class="w-full"/></label> <label class="block"><span class="text-xs text-gray-500">Rotation</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <div class="flex gap-2"><button> </button> <button class="flex-1 px-2 py-1.5 border rounded text-sm border-gray-200 hover:bg-gray-50">📏 Set Scale</button></div> <button class="w-full px-2 py-1.5 border border-red-300 rounded text-sm text-red-600 hover:bg-red-50">Remove Image</button></div></div>`);
60027
+ var root_28 = /* @__PURE__ */ from_html(`<div class="text-xs text-gray-500">Camera: <span class="text-gray-700 font-mono"> </span></div>`);
60028
+ var root_29 = /* @__PURE__ */ from_html(`<button type="button"></button>`);
60029
+ var root_27 = /* @__PURE__ */ from_html(`<div class="space-y-3"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 rounded flex items-center justify-center text-xs">⬡</span> Area</h3> <label class="block"><span class="text-xs text-gray-500">Area</span> <input type="text" class="w-full px-2 py-1 border border-gray-200 rounded text-sm" title="From assignedCameras.area when linked"/></label> <!> <div class="text-xs text-gray-500">Shape: <span class="text-gray-700 capitalize"> </span></div> <label class="block"><span class="text-xs text-gray-500">Area Color</span> <div class="flex flex-wrap gap-1.5 mt-1"><!> <input type="color" class="w-8 h-6 rounded border border-gray-200 cursor-pointer"/></div></label> <label class="block"><span class="text-xs text-gray-500">Fill opacity</span> <input type="range" min="0" max="0.4" step="0.02" class="w-full"/></label></div>`);
60030
+ var root_30 = /* @__PURE__ */ from_html(`<div class="space-y-3"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 bg-emerald-100 rounded flex items-center justify-center text-xs">🏷️</span> Text Annotation</h3> <label class="block"><span class="text-xs text-gray-500">Text</span> <input type="text" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Font Size</span> <input type="number" min="8" max="72" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Color</span> <div class="flex items-center gap-2"><input type="color" class="w-8 h-6 rounded border border-gray-200 cursor-pointer"/> <span class="text-xs text-gray-400"> </span></div></label> <label class="block"><span class="text-xs text-gray-500">Rotation (°)</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">X</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <label class="block"><span class="text-xs text-gray-500">Y</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label></div>`);
60031
+ var root_31 = /* @__PURE__ */ from_html(`<div class="mt-4 pt-3 border-t border-gray-200"><h3 class="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2"><span class="w-6 h-6 bg-blue-100 rounded flex items-center justify-center text-xs">🖼️</span> Background Image</h3> <div class="space-y-3"><label class="block"><span class="text-xs text-gray-500">Opacity</span> <input type="range" min="0.05" max="1" step="0.05" class="w-full"/></label> <label class="block"><span class="text-xs text-gray-500">Scale</span> <input type="range" min="0.1" max="5" step="0.05" class="w-full"/></label> <label class="block"><span class="text-xs text-gray-500">Rotation</span> <input type="number" class="w-full px-2 py-1 border border-gray-200 rounded text-sm"/></label> <div class="flex gap-2"><button> </button> <button class="flex-1 px-2 py-1.5 border rounded text-sm border-gray-200 hover:bg-gray-50">📏 Set Scale</button></div> <button class="w-full px-2 py-1.5 border border-red-300 rounded text-sm text-red-600 hover:bg-red-50">Remove Image</button></div></div>`);
59971
60032
  var root$3 = /* @__PURE__ */ from_html(`<div data-properties-panel="" style="top: 0; bottom: 0;"><!> <!></div>`);
59972
60033
  function PropertiesPanel($$anchor, $$props) {
59973
60034
  push($$props, true);
@@ -60154,12 +60215,10 @@ function PropertiesPanel($$anchor, $$props) {
60154
60215
  const props = get(selectedFurniture).props;
60155
60216
  if (props && Object.keys(props).length > 0) {
60156
60217
  const keys = Object.keys(props);
60218
+ const rank = (k) => k === "serial" ? 0 : k === "name" ? 1 : k === "area" ? 2 : k === "areaColor" ? 3 : 10;
60157
60219
  keys.sort((a, b) => {
60158
- if (a === "serial") return -1;
60159
- if (b === "serial") return 1;
60160
- if (a === "name") return -1;
60161
- if (b === "name") return 1;
60162
- return a.localeCompare(b);
60220
+ const d = rank(a) - rank(b);
60221
+ return d !== 0 ? d : a.localeCompare(b);
60163
60222
  });
60164
60223
  return keys.map((key) => {
60165
60224
  var _props$key;
@@ -60494,7 +60553,7 @@ function PropertiesPanel($$anchor, $$props) {
60494
60553
  ids: ["carpet-beige", "carpet-gray"]
60495
60554
  }
60496
60555
  ];
60497
- let hasSelection = /* @__PURE__ */ user_derived(() => !!get(selectedWall) || !!get(selectedDoor) || !!get(selectedWindow) || !!get(selectedFurniture) || !!get(selectedRoom) || !!get(selectedStair) || !!get(selectedColumn) || !!get(selectedTextAnnotation) || !is3D() && get(hasBgImage));
60556
+ let hasSelection = /* @__PURE__ */ user_derived(() => !!get(selectedWall) || !!get(selectedDoor) || !!get(selectedWindow) || !!get(selectedFurniture) || !!get(selectedRoom) || !!get(selectedStair) || !!get(selectedColumn) || !!get(selectedTextAnnotation) || !!get(selectedZone) || !is3D() && get(hasBgImage));
60498
60557
  var div = root$3();
60499
60558
  let classes;
60500
60559
  var node = child(div);
@@ -61469,7 +61528,7 @@ function PropertiesPanel($$anchor, $$props) {
61469
61528
  delegated("input", input_29, (e) => updateColumn(get(selectedColumn).id, { color: e.target.value }));
61470
61529
  append($$anchor, fragment_8);
61471
61530
  };
61472
- var consequent_13 = ($$anchor) => {
61531
+ var consequent_14 = ($$anchor) => {
61473
61532
  var div_39 = root_27();
61474
61533
  var h3_1 = child(div_39);
61475
61534
  var span_25 = child(h3_1);
@@ -61479,16 +61538,29 @@ function PropertiesPanel($$anchor, $$props) {
61479
61538
  var input_31 = sibling(child(label_39), 2);
61480
61539
  remove_input_defaults(input_31);
61481
61540
  reset(label_39);
61482
- var div_40 = sibling(label_39, 2);
61483
- var span_26 = sibling(child(div_40));
61484
- var text_32 = child(span_26, true);
61485
- reset(span_26);
61486
- reset(div_40);
61487
- var label_40 = sibling(div_40, 2);
61488
- var div_41 = sibling(child(label_40), 2);
61489
- var node_11 = child(div_41);
61490
- each(node_11, 17, () => ZONE_COLOR_PALETTE, index$1, ($$anchor, c) => {
61491
- var button_27 = root_28();
61541
+ var node_11 = sibling(label_39, 2);
61542
+ var consequent_13 = ($$anchor) => {
61543
+ var div_40 = root_28();
61544
+ var span_26 = sibling(child(div_40));
61545
+ var text_32 = child(span_26, true);
61546
+ reset(span_26);
61547
+ reset(div_40);
61548
+ template_effect(() => set_text(text_32, get(selectedZone).cameraSerial));
61549
+ append($$anchor, div_40);
61550
+ };
61551
+ if_block(node_11, ($$render) => {
61552
+ if (get(selectedZone).cameraSerial) $$render(consequent_13);
61553
+ });
61554
+ var div_41 = sibling(node_11, 2);
61555
+ var span_27 = sibling(child(div_41));
61556
+ var text_33 = child(span_27, true);
61557
+ reset(span_27);
61558
+ reset(div_41);
61559
+ var label_40 = sibling(div_41, 2);
61560
+ var div_42 = sibling(child(label_40), 2);
61561
+ var node_12 = child(div_42);
61562
+ each(node_12, 17, () => ZONE_COLOR_PALETTE, index$1, ($$anchor, c) => {
61563
+ var button_27 = root_29();
61492
61564
  template_effect(() => {
61493
61565
  var _$$get20;
61494
61566
  set_class(button_27, 1, `w-6 h-6 rounded border-2 ${get(selectedZone).color === get(c) ? "border-slate-800" : "border-transparent"}`);
@@ -61497,9 +61569,9 @@ function PropertiesPanel($$anchor, $$props) {
61497
61569
  delegated("click", button_27, () => updateZone(get(selectedZone).id, { color: get(c) }));
61498
61570
  append($$anchor, button_27);
61499
61571
  });
61500
- var input_32 = sibling(node_11, 2);
61572
+ var input_32 = sibling(node_12, 2);
61501
61573
  remove_input_defaults(input_32);
61502
- reset(div_41);
61574
+ reset(div_42);
61503
61575
  reset(label_40);
61504
61576
  var label_41 = sibling(label_40, 2);
61505
61577
  var input_33 = sibling(child(label_41), 2);
@@ -61510,7 +61582,7 @@ function PropertiesPanel($$anchor, $$props) {
61510
61582
  var _$$get$color8, _$$get$color9, _$$get$fillOpacity;
61511
61583
  set_style(span_25, `background:${(_$$get$color8 = get(selectedZone).color) !== null && _$$get$color8 !== void 0 ? _$$get$color8 : ""}22;color:${(_$$get$color9 = get(selectedZone).color) !== null && _$$get$color9 !== void 0 ? _$$get$color9 : ""}`);
61512
61584
  set_value(input_31, get(selectedZone).name);
61513
- set_text(text_32, get(selectedZone).shape);
61585
+ set_text(text_33, get(selectedZone).shape);
61514
61586
  set_value(input_32, get(selectedZone).color);
61515
61587
  set_value(input_33, (_$$get$fillOpacity = get(selectedZone).fillOpacity) !== null && _$$get$fillOpacity !== void 0 ? _$$get$fillOpacity : .1);
61516
61588
  });
@@ -61519,9 +61591,9 @@ function PropertiesPanel($$anchor, $$props) {
61519
61591
  delegated("input", input_33, (e) => updateZone(get(selectedZone).id, { fillOpacity: Number(e.target.value) }));
61520
61592
  append($$anchor, div_39);
61521
61593
  };
61522
- var consequent_14 = ($$anchor) => {
61523
- var div_42 = root_29();
61524
- var label_42 = sibling(child(div_42), 2);
61594
+ var consequent_15 = ($$anchor) => {
61595
+ var div_43 = root_30();
61596
+ var label_42 = sibling(child(div_43), 2);
61525
61597
  var input_34 = sibling(child(label_42), 2);
61526
61598
  remove_input_defaults(input_34);
61527
61599
  reset(label_42);
@@ -61530,13 +61602,13 @@ function PropertiesPanel($$anchor, $$props) {
61530
61602
  remove_input_defaults(input_35);
61531
61603
  reset(label_43);
61532
61604
  var label_44 = sibling(label_43, 2);
61533
- var div_43 = sibling(child(label_44), 2);
61534
- var input_36 = child(div_43);
61605
+ var div_44 = sibling(child(label_44), 2);
61606
+ var input_36 = child(div_44);
61535
61607
  remove_input_defaults(input_36);
61536
- var span_27 = sibling(input_36, 2);
61537
- var text_33 = child(span_27, true);
61538
- reset(span_27);
61539
- reset(div_43);
61608
+ var span_28 = sibling(input_36, 2);
61609
+ var text_34 = child(span_28, true);
61610
+ reset(span_28);
61611
+ reset(div_44);
61540
61612
  reset(label_44);
61541
61613
  var label_45 = sibling(label_44, 2);
61542
61614
  var input_37 = sibling(child(label_45), 2);
@@ -61550,12 +61622,12 @@ function PropertiesPanel($$anchor, $$props) {
61550
61622
  var input_39 = sibling(child(label_47), 2);
61551
61623
  remove_input_defaults(input_39);
61552
61624
  reset(label_47);
61553
- reset(div_42);
61625
+ reset(div_43);
61554
61626
  template_effect(($0, $1) => {
61555
61627
  set_value(input_34, get(selectedTextAnnotation).text);
61556
61628
  set_value(input_35, get(selectedTextAnnotation).fontSize);
61557
61629
  set_value(input_36, get(selectedTextAnnotation).color);
61558
- set_text(text_33, get(selectedTextAnnotation).color);
61630
+ set_text(text_34, get(selectedTextAnnotation).color);
61559
61631
  set_value(input_37, get(selectedTextAnnotation).rotation);
61560
61632
  set_value(input_38, $0);
61561
61633
  set_value(input_39, $1);
@@ -61566,7 +61638,7 @@ function PropertiesPanel($$anchor, $$props) {
61566
61638
  delegated("input", input_37, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { rotation: Number(e.target.value) }));
61567
61639
  delegated("input", input_38, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { x: Number(e.target.value) }));
61568
61640
  delegated("input", input_39, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { y: Number(e.target.value) }));
61569
- append($$anchor, div_42);
61641
+ append($$anchor, div_43);
61570
61642
  };
61571
61643
  if_block(node, ($$render) => {
61572
61644
  if (get(selectedWall)) $$render(consequent_1);
@@ -61576,14 +61648,14 @@ function PropertiesPanel($$anchor, $$props) {
61576
61648
  else if (get(selectedRoom)) $$render(consequent_9, 4);
61577
61649
  else if (get(selectedStair)) $$render(consequent_10, 5);
61578
61650
  else if (get(selectedColumn)) $$render(consequent_12, 6);
61579
- else if (get(selectedZone)) $$render(consequent_13, 7);
61580
- else if (get(selectedTextAnnotation)) $$render(consequent_14, 8);
61651
+ else if (get(selectedZone)) $$render(consequent_14, 7);
61652
+ else if (get(selectedTextAnnotation)) $$render(consequent_15, 8);
61581
61653
  });
61582
- var node_12 = sibling(node, 2);
61583
- var consequent_15 = ($$anchor) => {
61584
- var div_44 = root_30();
61585
- var div_45 = sibling(child(div_44), 2);
61586
- var label_48 = child(div_45);
61654
+ var node_13 = sibling(node, 2);
61655
+ var consequent_16 = ($$anchor) => {
61656
+ var div_45 = root_31();
61657
+ var div_46 = sibling(child(div_45), 2);
61658
+ var label_48 = child(div_46);
61587
61659
  var input_40 = sibling(child(label_48), 2);
61588
61660
  remove_input_defaults(input_40);
61589
61661
  reset(label_48);
@@ -61595,21 +61667,21 @@ function PropertiesPanel($$anchor, $$props) {
61595
61667
  var input_42 = sibling(child(label_50), 2);
61596
61668
  remove_input_defaults(input_42);
61597
61669
  reset(label_50);
61598
- var div_46 = sibling(label_50, 2);
61599
- var button_28 = child(div_46);
61600
- var text_34 = child(button_28, true);
61670
+ var div_47 = sibling(label_50, 2);
61671
+ var button_28 = child(div_47);
61672
+ var text_35 = child(button_28, true);
61601
61673
  reset(button_28);
61602
61674
  var button_29 = sibling(button_28, 2);
61675
+ reset(div_47);
61676
+ var button_30 = sibling(div_47, 2);
61603
61677
  reset(div_46);
61604
- var button_30 = sibling(div_46, 2);
61605
61678
  reset(div_45);
61606
- reset(div_44);
61607
61679
  template_effect(() => {
61608
61680
  set_value(input_40, get(floor).backgroundImage.opacity);
61609
61681
  set_value(input_41, get(floor).backgroundImage.scale);
61610
61682
  set_value(input_42, get(floor).backgroundImage.rotation);
61611
61683
  set_class(button_28, 1, `flex-1 px-2 py-1.5 border rounded text-sm ${get(floor).backgroundImage.locked ? "bg-amber-100 border-amber-400 text-amber-700" : "border-gray-200 hover:bg-gray-50"}`);
61612
- set_text(text_34, get(floor).backgroundImage.locked ? "🔒 Locked" : "🔓 Unlocked");
61684
+ set_text(text_35, get(floor).backgroundImage.locked ? "🔒 Locked" : "🔓 Unlocked");
61613
61685
  });
61614
61686
  delegated("input", input_40, (e) => updateBackgroundImage({ opacity: Number(e.target.value) }));
61615
61687
  delegated("input", input_41, (e) => updateBackgroundImage({ scale: Number(e.target.value) }));
@@ -61620,11 +61692,11 @@ function PropertiesPanel($$anchor, $$props) {
61620
61692
  calibrationMode.set(true);
61621
61693
  });
61622
61694
  delegated("click", button_30, () => setBackgroundImage(void 0));
61623
- append($$anchor, div_44);
61695
+ append($$anchor, div_45);
61624
61696
  };
61625
- if_block(node_12, ($$render) => {
61697
+ if_block(node_13, ($$render) => {
61626
61698
  var _$$get21;
61627
- if (get(hasBgImage) && ((_$$get21 = get(floor)) === null || _$$get21 === void 0 ? void 0 : _$$get21.backgroundImage)) $$render(consequent_15);
61699
+ if (get(hasBgImage) && ((_$$get21 = get(floor)) === null || _$$get21 === void 0 ? void 0 : _$$get21.backgroundImage)) $$render(consequent_16);
61628
61700
  });
61629
61701
  reset(div);
61630
61702
  template_effect(() => classes = set_class(div, 1, `${is3D() ? "w-80" : "w-64"} shrink-0 bg-white border-l border-gray-200 flex flex-col overflow-y-auto p-3 absolute right-0 z-40 shadow-lg`, null, classes, { hidden: !get(hasSelection) }));
@@ -61760,7 +61832,7 @@ function LayersPanel($$anchor, $$props) {
61760
61832
  });
61761
61833
  if ((_$$get$zones = get(floor).zones) === null || _$$get$zones === void 0 ? void 0 : _$$get$zones.length) cats.push({
61762
61834
  key: "zones",
61763
- label: "Zones",
61835
+ label: "Areas",
61764
61836
  icon: "⬡",
61765
61837
  items: get(floor).zones.map((z) => ({
61766
61838
  id: z.id,
@@ -66017,6 +66089,35 @@ function FloorPlanCanvas($$anchor, $$props) {
66017
66089
  const step = get(currentSnapToGrid) ? get(currentGridSize) : SNAP;
66018
66090
  return Math.round(v / step) * step;
66019
66091
  }
66092
+ /** Pick camera for new Area: selected camera, else first camera without an area. */
66093
+ function resolveAreaCameraTarget() {
66094
+ var _$$get$zones, _ref, _$$get$furniture$find;
66095
+ if (!get(currentFloor)) return null;
66096
+ const zones = (_$$get$zones = get(currentFloor).zones) !== null && _$$get$zones !== void 0 ? _$$get$zones : [];
66097
+ const used = new Set(zones.map((z) => z.cameraSerial).filter((s) => !!s));
66098
+ if (get(currentSelectedId)) {
66099
+ const sel = get(currentFloor).furniture.find((f) => f.id === get(currentSelectedId) && f.catalogId === "camera");
66100
+ if (sel === null || sel === void 0 ? void 0 : sel.serial) return sel;
66101
+ }
66102
+ return (_ref = (_$$get$furniture$find = get(currentFloor).furniture.find((f) => f.catalogId === "camera" && !!f.serial && !used.has(f.serial))) !== null && _$$get$furniture$find !== void 0 ? _$$get$furniture$find : get(currentFloor).furniture.find((f) => f.catalogId === "camera" && !!f.serial)) !== null && _ref !== void 0 ? _ref : null;
66103
+ }
66104
+ function commitAreaShape(shape, points) {
66105
+ var _$$get$zones$length, _$$get2;
66106
+ const cam = resolveAreaCameraTarget();
66107
+ const idx = (_$$get$zones$length = (_$$get2 = get(currentFloor)) === null || _$$get2 === void 0 || (_$$get2 = _$$get2.zones) === null || _$$get2 === void 0 ? void 0 : _$$get2.length) !== null && _$$get$zones$length !== void 0 ? _$$get$zones$length : 0;
66108
+ if (cam === null || cam === void 0 ? void 0 : cam.serial) {
66109
+ const style = resolveCameraAreaStyle(cam, idx);
66110
+ return upsertCameraZone(shape, points, {
66111
+ cameraSerial: cam.serial,
66112
+ name: style.name,
66113
+ color: style.color
66114
+ });
66115
+ }
66116
+ return addZone(shape, points, {
66117
+ name: `Area ${idx + 1}`,
66118
+ color: nextZoneColor(idx)
66119
+ });
66120
+ }
66020
66121
  function screenToWorld(sx, sy) {
66021
66122
  return {
66022
66123
  x: (sx - get(width) / 2) / get(zoom) + get(camX),
@@ -66430,9 +66531,9 @@ function FloorPlanCanvas($$anchor, $$props) {
66430
66531
  }
66431
66532
  }
66432
66533
  function drawMeasurement() {
66433
- var _$$get2;
66534
+ var _$$get3;
66434
66535
  if (!get(measureStart)) return;
66435
- const end = (_$$get2 = get(measureEnd)) !== null && _$$get2 !== void 0 ? _$$get2 : get(mousePos);
66536
+ const end = (_$$get3 = get(measureEnd)) !== null && _$$get3 !== void 0 ? _$$get3 : get(mousePos);
66436
66537
  const s = worldToScreen(get(measureStart).x, get(measureStart).y);
66437
66538
  const e = worldToScreen(end.x, end.y);
66438
66539
  ctx.strokeStyle = "#ef4444";
@@ -66604,8 +66705,8 @@ function FloorPlanCanvas($$anchor, $$props) {
66604
66705
  return getFloorBounds(floor, { includeWallThickness: true });
66605
66706
  }
66606
66707
  function drawFloorPlateBackground() {
66607
- var _$$get3;
66608
- if (!((_$$get3 = get(currentFloor)) === null || _$$get3 === void 0 || (_$$get3 = _$$get3.walls) === null || _$$get3 === void 0 ? void 0 : _$$get3.length)) return;
66708
+ var _$$get4;
66709
+ if (!((_$$get4 = get(currentFloor)) === null || _$$get4 === void 0 || (_$$get4 = _$$get4.walls) === null || _$$get4 === void 0 ? void 0 : _$$get4.length)) return;
66609
66710
  const bounds = getCameraThumbnailBounds(get(currentFloor));
66610
66711
  if (!bounds) return;
66611
66712
  const topLeft = worldToScreen(bounds.minX, bounds.minY);
@@ -66614,12 +66715,12 @@ function FloorPlanCanvas($$anchor, $$props) {
66614
66715
  ctx.fillRect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
66615
66716
  }
66616
66717
  function isCameraThumbnailOverlayActive() {
66617
- var _cameraThumbnail2, _$$get4;
66618
- return !!(((_cameraThumbnail2 = cameraThumbnail()) === null || _cameraThumbnail2 === void 0 ? void 0 : _cameraThumbnail2.trim()) && get(bgImage) && !((_$$get4 = get(currentFloor)) === null || _$$get4 === void 0 ? void 0 : _$$get4.backgroundImage));
66718
+ var _cameraThumbnail2, _$$get5;
66719
+ return !!(((_cameraThumbnail2 = cameraThumbnail()) === null || _cameraThumbnail2 === void 0 ? void 0 : _cameraThumbnail2.trim()) && get(bgImage) && !((_$$get5 = get(currentFloor)) === null || _$$get5 === void 0 ? void 0 : _$$get5.backgroundImage));
66619
66720
  }
66620
66721
  function drawBackgroundImage() {
66621
- var _$$get5;
66622
- if (!get(bgImage) || !((_$$get5 = get(currentFloor)) === null || _$$get5 === void 0 ? void 0 : _$$get5.backgroundImage)) return;
66722
+ var _$$get6;
66723
+ if (!get(bgImage) || !((_$$get6 = get(currentFloor)) === null || _$$get6 === void 0 ? void 0 : _$$get6.backgroundImage)) return;
66623
66724
  const bg = get(currentFloor).backgroundImage;
66624
66725
  ctx.save();
66625
66726
  ctx.globalAlpha = bg.opacity;
@@ -67345,13 +67446,14 @@ function FloorPlanCanvas($$anchor, $$props) {
67345
67446
  }
67346
67447
  drawFloorHeatmapLayer();
67347
67448
  if (get(layerVis).zones && (floor === null || floor === void 0 || (_floor$zones = floor.zones) === null || _floor$zones === void 0 ? void 0 : _floor$zones.length)) {
67348
- var _$$get6;
67349
- const zoneSel = (_$$get6 = get(selectedZoneId)) !== null && _$$get6 !== void 0 ? _$$get6 : floor.zones.some((z) => z.id === get(currentSelectedId)) ? get(currentSelectedId) : null;
67449
+ var _$$get7;
67450
+ const zoneSel = (_$$get7 = get(selectedZoneId)) !== null && _$$get7 !== void 0 ? _$$get7 : floor.zones.some((z) => z.id === get(currentSelectedId)) ? get(currentSelectedId) : null;
67350
67451
  drawZones(getCS(), floor, zoneSel);
67351
67452
  }
67352
67453
  if (get(currentTool) === "zone") {
67353
- var _floor$zones$length, _floor$zones2;
67354
- const draftColor = nextZoneColor((_floor$zones$length = floor === null || floor === void 0 || (_floor$zones2 = floor.zones) === null || _floor$zones2 === void 0 ? void 0 : _floor$zones2.length) !== null && _floor$zones$length !== void 0 ? _floor$zones$length : 0);
67454
+ var _floor$zones$length, _floor$zones2, _floor$zones$length2, _floor$zones3;
67455
+ const draftCam = resolveAreaCameraTarget();
67456
+ const draftColor = draftCam ? resolveCameraAreaStyle(draftCam, (_floor$zones$length = floor === null || floor === void 0 || (_floor$zones2 = floor.zones) === null || _floor$zones2 === void 0 ? void 0 : _floor$zones2.length) !== null && _floor$zones$length !== void 0 ? _floor$zones$length : 0).color : nextZoneColor((_floor$zones$length2 = floor === null || floor === void 0 || (_floor$zones3 = floor.zones) === null || _floor$zones3 === void 0 ? void 0 : _floor$zones3.length) !== null && _floor$zones$length2 !== void 0 ? _floor$zones$length2 : 0);
67355
67457
  if (get(zoneRectDragStart) && get(zoneRectDragCurrent)) drawZoneDraft(getCS(), rectPoints(get(zoneRectDragStart).x, get(zoneRectDragStart).y, get(zoneRectDragCurrent).x, get(zoneRectDragCurrent).y), draftColor, true);
67356
67458
  else if (get(zonePolyDraft).length || get(zoneCursor)) drawZoneDraft(getCS(), get(zonePolyDraft), draftColor, false, get(zoneCursor));
67357
67459
  }
@@ -67693,7 +67795,7 @@ function FloorPlanCanvas($$anchor, $$props) {
67693
67795
  return findRoomAt(p, get(detectedRooms), get(currentFloor).walls);
67694
67796
  }
67695
67797
  function onMouseDown(e) {
67696
- var _$$get7, _$$get8;
67798
+ var _$$get8, _$$get9;
67697
67799
  if ($$props.viewOnly) return;
67698
67800
  markDirty();
67699
67801
  if (e.button === 1 || e.button === 0 && (get(spaceDown) || $panMode() || e.shiftKey && get(currentTool) === "select")) {
@@ -67785,14 +67887,14 @@ function FloorPlanCanvas($$anchor, $$props) {
67785
67887
  return;
67786
67888
  }
67787
67889
  if (get(currentZoneShape) === "triangle") {
67788
- const id = addZone("triangle", trianglePoints(snapped));
67890
+ const id = commitAreaShape("triangle", trianglePoints(snapped));
67789
67891
  set(selectedZoneId, id, true);
67790
67892
  selectedElementId.set(id);
67791
67893
  selectedTool.set("select");
67792
67894
  return;
67793
67895
  }
67794
67896
  if (get(zonePolyDraft).length >= 3 && isNearPoint(snapped, get(zonePolyDraft)[0], 15 / get(zoom))) {
67795
- const id = addZone("polygon", get(zonePolyDraft));
67897
+ const id = commitAreaShape("polygon", get(zonePolyDraft));
67796
67898
  set(zonePolyDraft, [], true);
67797
67899
  set(zoneCursor, null);
67798
67900
  set(selectedZoneId, id, true);
@@ -67803,7 +67905,7 @@ function FloorPlanCanvas($$anchor, $$props) {
67803
67905
  set(zonePolyDraft, [...get(zonePolyDraft), snapped], true);
67804
67906
  return;
67805
67907
  }
67806
- if (tool === "select" && ((_$$get7 = get(currentFloor)) === null || _$$get7 === void 0 || (_$$get7 = _$$get7.zones) === null || _$$get7 === void 0 ? void 0 : _$$get7.length) && get(layerVis).zones) {
67908
+ if (tool === "select" && ((_$$get8 = get(currentFloor)) === null || _$$get8 === void 0 || (_$$get8 = _$$get8.zones) === null || _$$get8 === void 0 ? void 0 : _$$get8.length) && get(layerVis).zones) {
67807
67909
  const zHit = findZoneAt(wp, get(currentFloor).zones, get(zoom));
67808
67910
  if (zHit) {
67809
67911
  set(selectedZoneId, zHit.id, true);
@@ -67828,7 +67930,7 @@ function FloorPlanCanvas($$anchor, $$props) {
67828
67930
  }
67829
67931
  set(selectedZoneId, null);
67830
67932
  }
67831
- if (tool === "select" && ((_$$get8 = get(currentFloor)) === null || _$$get8 === void 0 ? void 0 : _$$get8.guides)) {
67933
+ if (tool === "select" && ((_$$get9 = get(currentFloor)) === null || _$$get9 === void 0 ? void 0 : _$$get9.guides)) {
67832
67934
  const GUIDE_HIT = 6 / get(zoom);
67833
67935
  for (const g of get(currentFloor).guides) {
67834
67936
  if (g.orientation === "horizontal" && Math.abs(wp.y - g.position) < GUIDE_HIT) {
@@ -67897,9 +67999,9 @@ function FloorPlanCanvas($$anchor, $$props) {
67897
67999
  const dist = Math.hypot(newPts[1].x - newPts[0].x, newPts[1].y - newPts[0].y);
67898
68000
  const realDist = prompt("Enter the real-world distance between these two points (in cm):");
67899
68001
  if (realDist && Number(realDist) > 0) {
67900
- var _$$get9;
68002
+ var _$$get10;
67901
68003
  const pixelsPerCm = dist / Number(realDist);
67902
- if ((_$$get9 = get(currentFloor)) === null || _$$get9 === void 0 ? void 0 : _$$get9.backgroundImage) updateBackgroundImage({ scale: get(currentFloor).backgroundImage.scale * (1 / pixelsPerCm) });
68004
+ if ((_$$get10 = get(currentFloor)) === null || _$$get10 === void 0 ? void 0 : _$$get10.backgroundImage) updateBackgroundImage({ scale: get(currentFloor).backgroundImage.scale * (1 / pixelsPerCm) });
67903
68005
  }
67904
68006
  calibrationMode.set(false);
67905
68007
  return [];
@@ -68250,7 +68352,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68250
68352
  }
68251
68353
  }
68252
68354
  if (get(currentTool) === "zone" && get(currentZoneShape) === "polygon" && get(zonePolyDraft).length >= 3) {
68253
- const id = addZone("polygon", get(zonePolyDraft));
68355
+ const id = commitAreaShape("polygon", get(zonePolyDraft));
68254
68356
  set(zonePolyDraft, [], true);
68255
68357
  set(zoneCursor, null);
68256
68358
  set(selectedZoneId, id, true);
@@ -68278,7 +68380,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68278
68380
  }
68279
68381
  }
68280
68382
  function onMouseMove(e) {
68281
- var _$$get10, _$$get11, _$$get12, _$$get13, _$$get14;
68383
+ var _$$get11, _$$get12, _$$get13, _$$get14, _$$get15;
68282
68384
  if ($$props.viewOnly) return;
68283
68385
  markDirty();
68284
68386
  const rect = canvas.getBoundingClientRect();
@@ -68294,7 +68396,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68294
68396
  x: snap(get(mousePos).x),
68295
68397
  y: snap(get(mousePos).y)
68296
68398
  }, true);
68297
- if (get(draggingZoneId) && ((_$$get10 = get(currentFloor)) === null || _$$get10 === void 0 ? void 0 : _$$get10.zones)) {
68399
+ if (get(draggingZoneId) && ((_$$get11 = get(currentFloor)) === null || _$$get11 === void 0 ? void 0 : _$$get11.zones)) {
68298
68400
  const z = get(currentFloor).zones.find((z) => z.id === get(draggingZoneId));
68299
68401
  if (z) {
68300
68402
  const snapped = {
@@ -68332,7 +68434,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68332
68434
  } : r));
68333
68435
  return;
68334
68436
  }
68335
- if (get(draggingGuideId) && ((_$$get11 = get(currentFloor)) === null || _$$get11 === void 0 ? void 0 : _$$get11.guides)) {
68437
+ if (get(draggingGuideId) && ((_$$get12 = get(currentFloor)) === null || _$$get12 === void 0 ? void 0 : _$$get12.guides)) {
68336
68438
  const g = get(currentFloor).guides.find((g) => g.id === get(draggingGuideId));
68337
68439
  if (g) {
68338
68440
  const newPos = g.orientation === "horizontal" ? get(mousePos).y : get(mousePos).x;
@@ -68488,7 +68590,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68488
68590
  }
68489
68591
  }
68490
68592
  }
68491
- if (get(draggingTextAnnotationId) && ((_$$get12 = get(currentFloor)) === null || _$$get12 === void 0 ? void 0 : _$$get12.textAnnotations)) {
68593
+ if (get(draggingTextAnnotationId) && ((_$$get13 = get(currentFloor)) === null || _$$get13 === void 0 ? void 0 : _$$get13.textAnnotations)) {
68492
68594
  const basePos = {
68493
68595
  x: get(mousePos).x - textAnnotationDragOffset.x,
68494
68596
  y: get(mousePos).y - textAnnotationDragOffset.y
@@ -68505,7 +68607,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68505
68607
  }, true);
68506
68608
  }
68507
68609
  }
68508
- if (get(draggingColumnId) && ((_$$get13 = get(currentFloor)) === null || _$$get13 === void 0 ? void 0 : _$$get13.columns)) {
68610
+ if (get(draggingColumnId) && ((_$$get14 = get(currentFloor)) === null || _$$get14 === void 0 ? void 0 : _$$get14.columns)) {
68509
68611
  const basePos = {
68510
68612
  x: get(mousePos).x - columnDragOffset.x,
68511
68613
  y: get(mousePos).y - columnDragOffset.y
@@ -68515,7 +68617,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68515
68617
  y: snap(basePos.y)
68516
68618
  });
68517
68619
  }
68518
- if (get(draggingStairId) && ((_$$get14 = get(currentFloor)) === null || _$$get14 === void 0 ? void 0 : _$$get14.stairs)) {
68620
+ if (get(draggingStairId) && ((_$$get15 = get(currentFloor)) === null || _$$get15 === void 0 ? void 0 : _$$get15.stairs)) {
68519
68621
  const basePos = {
68520
68622
  x: get(mousePos).x - stairDragOffset.x,
68521
68623
  y: get(mousePos).y - stairDragOffset.y
@@ -68526,12 +68628,12 @@ function FloorPlanCanvas($$anchor, $$props) {
68526
68628
  });
68527
68629
  }
68528
68630
  if (get(draggingFurnitureId)) {
68529
- var _$$get15;
68631
+ var _$$get16;
68530
68632
  const basePos = {
68531
68633
  x: get(mousePos).x - dragOffset.x,
68532
68634
  y: get(mousePos).y - dragOffset.y
68533
68635
  };
68534
- const fi = (_$$get15 = get(currentFloor)) === null || _$$get15 === void 0 ? void 0 : _$$get15.furniture.find((f) => f.id === get(draggingFurnitureId));
68636
+ const fi = (_$$get16 = get(currentFloor)) === null || _$$get16 === void 0 ? void 0 : _$$get16.furniture.find((f) => f.id === get(draggingFurnitureId));
68535
68637
  if (fi) {
68536
68638
  const wallSnap = snapFurnitureToWall(basePos, fi.catalogId, fi.rotation);
68537
68639
  if (wallSnap) {
@@ -68544,13 +68646,13 @@ function FloorPlanCanvas($$anchor, $$props) {
68544
68646
  wallAngle: wallSnap.wallAngle
68545
68647
  }, true);
68546
68648
  } else {
68547
- var _$$get16;
68649
+ var _$$get17;
68548
68650
  const snapped = {
68549
68651
  x: snap(basePos.x),
68550
68652
  y: snap(basePos.y)
68551
68653
  };
68552
68654
  const GUIDE_SNAP = 10;
68553
- if ((_$$get16 = get(currentFloor)) === null || _$$get16 === void 0 ? void 0 : _$$get16.guides) for (const g of get(currentFloor).guides) {
68655
+ if ((_$$get17 = get(currentFloor)) === null || _$$get17 === void 0 ? void 0 : _$$get17.guides) for (const g of get(currentFloor).guides) {
68554
68656
  if (g.orientation === "horizontal" && Math.abs(snapped.y - g.position) < GUIDE_SNAP) snapped.y = g.position;
68555
68657
  if (g.orientation === "vertical" && Math.abs(snapped.x - g.position) < GUIDE_SNAP) snapped.x = g.position;
68556
68658
  }
@@ -68607,7 +68709,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68607
68709
  set(zoneRectDragStart, null);
68608
68710
  set(zoneRectDragCurrent, null);
68609
68711
  if (w > 5 && h > 5) {
68610
- const id = addZone("rectangle", pts);
68712
+ const id = commitAreaShape("rectangle", pts);
68611
68713
  set(selectedZoneId, id, true);
68612
68714
  selectedElementId.set(id);
68613
68715
  selectedTool.set("select");
@@ -68794,7 +68896,7 @@ function FloorPlanCanvas($$anchor, $$props) {
68794
68896
  set(zoneRectDragCurrent, null);
68795
68897
  }
68796
68898
  if (e.key === "Enter" && get(currentTool) === "zone" && get(currentZoneShape) === "polygon" && get(zonePolyDraft).length >= 3) {
68797
- const id = addZone("polygon", get(zonePolyDraft));
68899
+ const id = commitAreaShape("polygon", get(zonePolyDraft));
68798
68900
  set(zonePolyDraft, [], true);
68799
68901
  set(zoneCursor, null);
68800
68902
  set(selectedZoneId, id, true);
@@ -69280,8 +69382,8 @@ function FloorPlanCanvas($$anchor, $$props) {
69280
69382
  }
69281
69383
  }
69282
69384
  let cursorStyle = /* @__PURE__ */ user_derived(() => {
69283
- var _$$get17;
69284
- return get(spaceDown) || get(isPanning) || $panMode() || get(shiftDown) && get(currentTool) === "select" ? "grab" : get(draggingFurnitureId) ? "move" : get(draggingRoomId) ? "move" : get(draggingMultiSelect) ? "move" : get(draggingDoorId) ? "move" : get(draggingWindowId) ? "move" : get(draggingStairId) ? "move" : get(draggingColumnId) ? "move" : get(draggingTextAnnotationId) ? "move" : get(draggingZoneId) ? "move" : get(draggingWallParallel) ? "move" : get(draggingCurveHandle) ? "crosshair" : get(draggingWallEndpoint) ? "crosshair" : get(draggingHandle) === "rotate" ? "grabbing" : get(draggingHandle) === "resize-t" || get(draggingHandle) === "resize-b" ? "ns-resize" : get(draggingHandle) === "resize-l" || get(draggingHandle) === "resize-r" ? "ew-resize" : ((_$$get17 = get(draggingHandle)) === null || _$$get17 === void 0 ? void 0 : _$$get17.startsWith("resize")) ? "nwse-resize" : get(currentTool) === "text" ? "text" : get(currentTool) === "select" ? "default" : get(currentTool) === "furniture" ? "copy" : get(currentTool) === "door" || get(currentTool) === "window" ? get(placementPreview) ? "crosshair" : "not-allowed" : "crosshair";
69385
+ var _$$get18;
69386
+ return get(spaceDown) || get(isPanning) || $panMode() || get(shiftDown) && get(currentTool) === "select" ? "grab" : get(draggingFurnitureId) ? "move" : get(draggingRoomId) ? "move" : get(draggingMultiSelect) ? "move" : get(draggingDoorId) ? "move" : get(draggingWindowId) ? "move" : get(draggingStairId) ? "move" : get(draggingColumnId) ? "move" : get(draggingTextAnnotationId) ? "move" : get(draggingZoneId) ? "move" : get(draggingWallParallel) ? "move" : get(draggingCurveHandle) ? "crosshair" : get(draggingWallEndpoint) ? "crosshair" : get(draggingHandle) === "rotate" ? "grabbing" : get(draggingHandle) === "resize-t" || get(draggingHandle) === "resize-b" ? "ns-resize" : get(draggingHandle) === "resize-l" || get(draggingHandle) === "resize-r" ? "ew-resize" : ((_$$get18 = get(draggingHandle)) === null || _$$get18 === void 0 ? void 0 : _$$get18.startsWith("resize")) ? "nwse-resize" : get(currentTool) === "text" ? "text" : get(currentTool) === "select" ? "default" : get(currentTool) === "furniture" ? "copy" : get(currentTool) === "door" || get(currentTool) === "window" ? get(placementPreview) ? "crosshair" : "not-allowed" : "crosshair";
69285
69387
  });
69286
69388
  var div = root$1();
69287
69389
  event("keydown", $window, onKeyDown);
@@ -69357,8 +69459,8 @@ function FloorPlanCanvas($$anchor, $$props) {
69357
69459
  }
69358
69460
  set(editingTextAnnotationId, null);
69359
69461
  } else if (e.key === "Escape") {
69360
- var _$$get18;
69361
- if ((_$$get18 = get(currentFloor)) === null || _$$get18 === void 0 ? void 0 : _$$get18.textAnnotations) {
69462
+ var _$$get19;
69463
+ if ((_$$get19 = get(currentFloor)) === null || _$$get19 === void 0 ? void 0 : _$$get19.textAnnotations) {
69362
69464
  const ta = get(currentFloor).textAnnotations.find((t) => t.id === get(editingTextAnnotationId));
69363
69465
  if (ta && ta.text === "Text" && !get(editingTextAnnotationValue).trim()) {
69364
69466
  removeTextAnnotation(get(editingTextAnnotationId));
@@ -69557,7 +69659,7 @@ function FloorPlanCanvas($$anchor, $$props) {
69557
69659
  ["furniture", "Furniture"],
69558
69660
  ["stairs", "Stairs"],
69559
69661
  ["columns", "Columns"],
69560
- ["zones", "Zones"],
69662
+ ["zones", "Areas"],
69561
69663
  ["guides", "Guides"],
69562
69664
  ["measurements", "Measurements"]
69563
69665
  ], index$1, ($$anchor, $$item) => {
@@ -69711,8 +69813,8 @@ function FloorPlanCanvas($$anchor, $$props) {
69711
69813
  var text_15 = child(div_7);
69712
69814
  reset(div_7);
69713
69815
  template_effect(() => {
69714
- var _$$get19;
69715
- return set_text(text_15, `Click to place · Scroll or R to rotate (${(_$$get19 = get(currentPlacingRotation)) !== null && _$$get19 !== void 0 ? _$$get19 : ""}°) · Esc
69816
+ var _$$get20;
69817
+ return set_text(text_15, `Click to place · Scroll or R to rotate (${(_$$get20 = get(currentPlacingRotation)) !== null && _$$get20 !== void 0 ? _$$get20 : ""}°) · Esc
69716
69818
  to cancel`);
69717
69819
  });
69718
69820
  append($$anchor, div_7);
@@ -70919,12 +71021,14 @@ function syncAssignedCameras(assigned) {
70919
71021
  if (!propsEqual(item.props, nextProps) || item.name !== nextProps.name) applyCameraProps(item.id, assignedCam);
70920
71022
  }
70921
71023
  if (!hasFloorLayout) {
71024
+ syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
70922
71025
  if (hostDrivesAssignment || newSerials.size > 0) lastSyncedSerials = newSerials;
70923
71026
  return;
70924
71027
  }
70925
71028
  const center = getFloorCenter(floorAfterRemove);
70926
71029
  if (!center) {
70927
71030
  rejectNoFloor(toAdd);
71031
+ syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
70928
71032
  if (hostDrivesAssignment || newSerials.size > 0) lastSyncedSerials = newSerials;
70929
71033
  return;
70930
71034
  }
@@ -70936,11 +71040,35 @@ function syncAssignedCameras(assigned) {
70936
71040
  applyCameraProps(addFurniture("camera", findOpenCameraPosition(workingFloor, center)), cam);
70937
71041
  workingFloor = get$1(activeFloor);
70938
71042
  }
71043
+ syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
70939
71044
  lastSyncedSerials = newSerials;
70940
71045
  } finally {
70941
71046
  setAssignedCamerasSyncing(false);
70942
71047
  }
70943
71048
  }
71049
+ /** Push area / areaColor onto linked zones; remove areas whose camera was unassigned. */
71050
+ function syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment) {
71051
+ var _floor$zones, _floor2$zones;
71052
+ const floor = get$1(activeFloor);
71053
+ if (!floor) return;
71054
+ if (hostDrivesAssignment && ((_floor$zones = floor.zones) === null || _floor$zones === void 0 ? void 0 : _floor$zones.length)) for (const z of [...floor.zones]) {
71055
+ if (!z.cameraSerial) continue;
71056
+ if (!assignedBySerial.has(z.cameraSerial)) removeZone(z.id);
71057
+ }
71058
+ const floor2 = get$1(activeFloor);
71059
+ if (!(floor2 === null || floor2 === void 0 || (_floor2$zones = floor2.zones) === null || _floor2$zones === void 0 ? void 0 : _floor2$zones.length)) return;
71060
+ let i = 0;
71061
+ for (const z of floor2.zones) {
71062
+ if (!z.cameraSerial) continue;
71063
+ const cam = assignedBySerial.get(z.cameraSerial);
71064
+ if (!cam) continue;
71065
+ const style = resolveCameraAreaStyle(cam, i++);
71066
+ if (z.name !== style.name || z.color !== style.color) updateZone(z.id, {
71067
+ name: style.name,
71068
+ color: style.color
71069
+ });
71070
+ }
71071
+ }
70944
71072
  //#endregion
70945
71073
  //#region src/App.svelte
70946
71074
  init_client();