floor-editor-ts 1.3.8 → 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.
- package/dist/floor-editor.es.js +1403 -729
- package/dist/floor-editor.es.js.map +1 -1
- package/dist/src/lib/models/types.d.ts +17 -0
- package/dist/src/lib/stores/project.d.ts +22 -2
- package/dist/src/lib/utils/canvasRenderer.d.ts +5 -1
- package/dist/src/lib/utils/hitTesting.d.ts +5 -1
- package/dist/src/lib/utils/zoneGeometry.d.ts +31 -0
- package/package.json +1 -1
package/dist/floor-editor.es.js
CHANGED
|
@@ -5963,6 +5963,108 @@ if (typeof window !== "undefined") {
|
|
|
5963
5963
|
var _window$__svelte, _window$__svelte$v, _window, _window$__svelte2;
|
|
5964
5964
|
((_window$__svelte$v = (_window$__svelte = (_window$__svelte2 = (_window = window).__svelte) !== null && _window$__svelte2 !== void 0 ? _window$__svelte2 : _window.__svelte = {}).v) !== null && _window$__svelte$v !== void 0 ? _window$__svelte$v : _window$__svelte.v = /* @__PURE__ */ new Set()).add("5");
|
|
5965
5965
|
}
|
|
5966
|
+
//#endregion
|
|
5967
|
+
//#region src/lib/utils/zoneGeometry.ts
|
|
5968
|
+
var ZONE_COLOR_PALETTE = [
|
|
5969
|
+
"#F97316",
|
|
5970
|
+
"#22C55E",
|
|
5971
|
+
"#3B82F6",
|
|
5972
|
+
"#EF4444",
|
|
5973
|
+
"#A855F7",
|
|
5974
|
+
"#EAB308"
|
|
5975
|
+
];
|
|
5976
|
+
var DEFAULT_ZONE_FILL_OPACITY = .1;
|
|
5977
|
+
function nextZoneColor(existingCount) {
|
|
5978
|
+
return ZONE_COLOR_PALETTE[existingCount % ZONE_COLOR_PALETTE.length];
|
|
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
|
+
}
|
|
5990
|
+
function rectPoints(x1, y1, x2, y2) {
|
|
5991
|
+
const minX = Math.min(x1, x2);
|
|
5992
|
+
const maxX = Math.max(x1, x2);
|
|
5993
|
+
const minY = Math.min(y1, y2);
|
|
5994
|
+
const maxY = Math.max(y1, y2);
|
|
5995
|
+
return [
|
|
5996
|
+
{
|
|
5997
|
+
x: minX,
|
|
5998
|
+
y: minY
|
|
5999
|
+
},
|
|
6000
|
+
{
|
|
6001
|
+
x: maxX,
|
|
6002
|
+
y: minY
|
|
6003
|
+
},
|
|
6004
|
+
{
|
|
6005
|
+
x: maxX,
|
|
6006
|
+
y: maxY
|
|
6007
|
+
},
|
|
6008
|
+
{
|
|
6009
|
+
x: minX,
|
|
6010
|
+
y: maxY
|
|
6011
|
+
}
|
|
6012
|
+
];
|
|
6013
|
+
}
|
|
6014
|
+
/** Isosceles triangle pointing up, centered at `c`. */
|
|
6015
|
+
function trianglePoints(c, size = 200) {
|
|
6016
|
+
const h = size * .866;
|
|
6017
|
+
return [
|
|
6018
|
+
{
|
|
6019
|
+
x: c.x,
|
|
6020
|
+
y: c.y - h / 2
|
|
6021
|
+
},
|
|
6022
|
+
{
|
|
6023
|
+
x: c.x + size / 2,
|
|
6024
|
+
y: c.y + h / 2
|
|
6025
|
+
},
|
|
6026
|
+
{
|
|
6027
|
+
x: c.x - size / 2,
|
|
6028
|
+
y: c.y + h / 2
|
|
6029
|
+
}
|
|
6030
|
+
];
|
|
6031
|
+
}
|
|
6032
|
+
function zoneBounds(points) {
|
|
6033
|
+
if (!points.length) return null;
|
|
6034
|
+
let minX = points[0].x, minY = points[0].y, maxX = points[0].x, maxY = points[0].y;
|
|
6035
|
+
for (let i = 1; i < points.length; i++) {
|
|
6036
|
+
const p = points[i];
|
|
6037
|
+
if (p.x < minX) minX = p.x;
|
|
6038
|
+
if (p.y < minY) minY = p.y;
|
|
6039
|
+
if (p.x > maxX) maxX = p.x;
|
|
6040
|
+
if (p.y > maxY) maxY = p.y;
|
|
6041
|
+
}
|
|
6042
|
+
return {
|
|
6043
|
+
minX,
|
|
6044
|
+
minY,
|
|
6045
|
+
maxX,
|
|
6046
|
+
maxY
|
|
6047
|
+
};
|
|
6048
|
+
}
|
|
6049
|
+
function translatePoints(points, dx, dy) {
|
|
6050
|
+
return points.map((p) => ({
|
|
6051
|
+
x: p.x + dx,
|
|
6052
|
+
y: p.y + dy
|
|
6053
|
+
}));
|
|
6054
|
+
}
|
|
6055
|
+
/** Axis-aligned resize: keep opposite corner fixed when dragging corner index. */
|
|
6056
|
+
function resizeRectCorner(points, cornerIndex, to) {
|
|
6057
|
+
if (points.length !== 4) {
|
|
6058
|
+
const next = points.map((p) => ({ ...p }));
|
|
6059
|
+
if (next[cornerIndex]) next[cornerIndex] = { ...to };
|
|
6060
|
+
return next;
|
|
6061
|
+
}
|
|
6062
|
+
const fixed = points[(cornerIndex + 2) % 4];
|
|
6063
|
+
return rectPoints(fixed.x, fixed.y, to.x, to.y);
|
|
6064
|
+
}
|
|
6065
|
+
function isNearPoint(a, b, threshold) {
|
|
6066
|
+
return Math.hypot(a.x - b.x, a.y - b.y) <= threshold;
|
|
6067
|
+
}
|
|
5966
6068
|
/** True while host → package assignedCameras sync is mutating furniture. */
|
|
5967
6069
|
var assignedCamerasSyncing = false;
|
|
5968
6070
|
function setAssignedCamerasSyncing(value) {
|
|
@@ -6076,6 +6178,7 @@ function createDefaultFloor(level = 0) {
|
|
|
6076
6178
|
measurements: [],
|
|
6077
6179
|
annotations: [],
|
|
6078
6180
|
textAnnotations: [],
|
|
6181
|
+
zones: [],
|
|
6079
6182
|
groups: []
|
|
6080
6183
|
};
|
|
6081
6184
|
}
|
|
@@ -6097,6 +6200,8 @@ var activeFloor = derived$1(currentProject, ($p) => {
|
|
|
6097
6200
|
return (_ref = (_$p$floors$find = $p.floors.find((f) => f.id === $p.activeFloorId)) !== null && _$p$floors$find !== void 0 ? _$p$floors$find : $p.floors[0]) !== null && _ref !== void 0 ? _ref : null;
|
|
6098
6201
|
});
|
|
6099
6202
|
var selectedTool = writable("select");
|
|
6203
|
+
/** Subtype when selectedTool === 'zone' */
|
|
6204
|
+
var placingZoneShape = writable("rectangle");
|
|
6100
6205
|
var snapEnabled = writable(true);
|
|
6101
6206
|
/** When true, left-click drag pans the canvas instead of selecting */
|
|
6102
6207
|
var panMode = writable(false);
|
|
@@ -6537,6 +6642,7 @@ function removeElement(id) {
|
|
|
6537
6642
|
if (f.stairs) f.stairs = f.stairs.filter((s) => s.id !== id);
|
|
6538
6643
|
if (f.columns) f.columns = f.columns.filter((c) => c.id !== id);
|
|
6539
6644
|
if (f.textAnnotations) f.textAnnotations = f.textAnnotations.filter((t) => t.id !== id);
|
|
6645
|
+
if (f.zones) f.zones = f.zones.filter((z) => z.id !== id);
|
|
6540
6646
|
}, "Deleted element");
|
|
6541
6647
|
if ((removedCamera === null || removedCamera === void 0 ? void 0 : removedCamera.serial) && !isAssignedCamerasSyncing()) {
|
|
6542
6648
|
const props = cameraItemToCallbackProps(removedCamera);
|
|
@@ -6639,6 +6745,7 @@ function addFloor(name, copyCurrentLayout = false) {
|
|
|
6639
6745
|
measurements: [],
|
|
6640
6746
|
annotations: [],
|
|
6641
6747
|
textAnnotations: [],
|
|
6748
|
+
zones: [],
|
|
6642
6749
|
groups: []
|
|
6643
6750
|
};
|
|
6644
6751
|
if (copyCurrentLayout) {
|
|
@@ -6947,6 +7054,99 @@ function moveTextAnnotation(id, position) {
|
|
|
6947
7054
|
p.updatedAt = /* @__PURE__ */ new Date();
|
|
6948
7055
|
currentProject.set({ ...p });
|
|
6949
7056
|
}
|
|
7057
|
+
function addZone(shape, points, nameOrOpts, colorArg) {
|
|
7058
|
+
const opts = typeof nameOrOpts === "object" && nameOrOpts ? nameOrOpts : {
|
|
7059
|
+
name: nameOrOpts,
|
|
7060
|
+
color: colorArg
|
|
7061
|
+
};
|
|
7062
|
+
const id = uid$1();
|
|
7063
|
+
mutate((f) => {
|
|
7064
|
+
var _opts$cameraSerial, _opts$name, _opts$fillOpacity;
|
|
7065
|
+
if (!f.zones) f.zones = [];
|
|
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;
|
|
7068
|
+
f.zones.push({
|
|
7069
|
+
id,
|
|
7070
|
+
name: ((_opts$name = opts.name) === null || _opts$name === void 0 ? void 0 : _opts$name.trim()) || `Area ${count + 1}`,
|
|
7071
|
+
shape,
|
|
7072
|
+
points: points.map((p) => ({
|
|
7073
|
+
x: p.x,
|
|
7074
|
+
y: p.y
|
|
7075
|
+
})),
|
|
7076
|
+
color: opts.color || nextZoneColor(count),
|
|
7077
|
+
fillOpacity: (_opts$fillOpacity = opts.fillOpacity) !== null && _opts$fillOpacity !== void 0 ? _opts$fillOpacity : .1,
|
|
7078
|
+
...serial ? { cameraSerial: serial } : {}
|
|
7079
|
+
});
|
|
7080
|
+
}, "Added area");
|
|
7081
|
+
return id;
|
|
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
|
+
}
|
|
7109
|
+
function updateZone(id, updates) {
|
|
7110
|
+
mutate((f) => {
|
|
7111
|
+
if (!f.zones) return;
|
|
7112
|
+
const z = f.zones.find((z) => z.id === id);
|
|
7113
|
+
if (!z) return;
|
|
7114
|
+
if (updates.name != null) z.name = updates.name;
|
|
7115
|
+
if (updates.color != null) z.color = updates.color;
|
|
7116
|
+
if (updates.fillOpacity != null) z.fillOpacity = updates.fillOpacity;
|
|
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
|
+
}
|
|
7123
|
+
if (updates.points) z.points = updates.points.map((p) => ({
|
|
7124
|
+
x: p.x,
|
|
7125
|
+
y: p.y
|
|
7126
|
+
}));
|
|
7127
|
+
}, "Updated area");
|
|
7128
|
+
}
|
|
7129
|
+
/** Live drag without undo snapshot (commit with updateZone / endUndoGroup). */
|
|
7130
|
+
function moveZonePoints(id, points) {
|
|
7131
|
+
const p = get$1(currentProject);
|
|
7132
|
+
if (!p) return;
|
|
7133
|
+
const floor = p.floors.find((f) => f.id === p.activeFloorId);
|
|
7134
|
+
if (!(floor === null || floor === void 0 ? void 0 : floor.zones)) return;
|
|
7135
|
+
const z = floor.zones.find((z) => z.id === id);
|
|
7136
|
+
if (!z) return;
|
|
7137
|
+
z.points = points.map((pt) => ({
|
|
7138
|
+
x: pt.x,
|
|
7139
|
+
y: pt.y
|
|
7140
|
+
}));
|
|
7141
|
+
p.updatedAt = /* @__PURE__ */ new Date();
|
|
7142
|
+
currentProject.set({ ...p });
|
|
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
|
+
}
|
|
6950
7150
|
var layerVisibility = writable({
|
|
6951
7151
|
walls: true,
|
|
6952
7152
|
doors: true,
|
|
@@ -6956,7 +7156,8 @@ var layerVisibility = writable({
|
|
|
6956
7156
|
columns: true,
|
|
6957
7157
|
guides: true,
|
|
6958
7158
|
measurements: true,
|
|
6959
|
-
annotations: true
|
|
7159
|
+
annotations: true,
|
|
7160
|
+
zones: true
|
|
6960
7161
|
});
|
|
6961
7162
|
function toggleFurnitureLock(id) {
|
|
6962
7163
|
mutate((f) => {
|
|
@@ -7204,6 +7405,8 @@ function assignedCameraToProps(cam) {
|
|
|
7204
7405
|
return props;
|
|
7205
7406
|
}
|
|
7206
7407
|
function formatCameraPropLabel(key) {
|
|
7408
|
+
if (key === "area") return "Area";
|
|
7409
|
+
if (key === "areaColor") return "Area Color";
|
|
7207
7410
|
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
7208
7411
|
}
|
|
7209
7412
|
var DEFAULT_CONFIG = {
|
|
@@ -56376,10 +56579,10 @@ var themePreference = createThemeStore();
|
|
|
56376
56579
|
//#endregion
|
|
56377
56580
|
//#region src/lib/components/toolbar/SettingsDialog.svelte
|
|
56378
56581
|
init_client();
|
|
56379
|
-
var root_2$
|
|
56380
|
-
var root_3$
|
|
56381
|
-
var root_4$
|
|
56382
|
-
var root_5$
|
|
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>`);
|
|
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>`);
|
|
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>`);
|
|
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>`);
|
|
56383
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>`);
|
|
56384
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
|
|
56385
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
|
|
@@ -56387,11 +56590,11 @@ var root_7$6 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-
|
|
|
56387
56590
|
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">Extension Lines</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
|
|
56388
56591
|
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">Object Distance</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
|
|
56389
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);
|
|
56390
|
-
var root_9$
|
|
56391
|
-
var root_8$
|
|
56392
|
-
var root_11$
|
|
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>`);
|
|
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>`);
|
|
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>`);
|
|
56393
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>`);
|
|
56394
|
-
var root_10$
|
|
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>`);
|
|
56395
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>`);
|
|
56396
56599
|
function SettingsDialog($$anchor, $$props) {
|
|
56397
56600
|
push($$props, true);
|
|
@@ -56504,7 +56707,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56504
56707
|
var button_1 = child(div_3);
|
|
56505
56708
|
var node_1 = sibling(child(button_1));
|
|
56506
56709
|
var consequent = ($$anchor) => {
|
|
56507
|
-
append($$anchor, root_2$
|
|
56710
|
+
append($$anchor, root_2$12());
|
|
56508
56711
|
};
|
|
56509
56712
|
if_block(node_1, ($$render) => {
|
|
56510
56713
|
if (get(activeTab) === "project") $$render(consequent);
|
|
@@ -56513,7 +56716,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56513
56716
|
var button_2 = sibling(button_1, 2);
|
|
56514
56717
|
var node_2 = sibling(child(button_2));
|
|
56515
56718
|
var consequent_1 = ($$anchor) => {
|
|
56516
|
-
append($$anchor, root_3$
|
|
56719
|
+
append($$anchor, root_3$11());
|
|
56517
56720
|
};
|
|
56518
56721
|
if_block(node_2, ($$render) => {
|
|
56519
56722
|
if (get(activeTab) === "dimensions") $$render(consequent_1);
|
|
@@ -56522,7 +56725,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56522
56725
|
var button_3 = sibling(button_2, 2);
|
|
56523
56726
|
var node_3 = sibling(child(button_3));
|
|
56524
56727
|
var consequent_2 = ($$anchor) => {
|
|
56525
|
-
append($$anchor, root_4$
|
|
56728
|
+
append($$anchor, root_4$10());
|
|
56526
56729
|
};
|
|
56527
56730
|
if_block(node_3, ($$render) => {
|
|
56528
56731
|
if (get(activeTab) === "appearance") $$render(consequent_2);
|
|
@@ -56531,7 +56734,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56531
56734
|
var button_4 = sibling(button_3, 2);
|
|
56532
56735
|
var node_4 = sibling(child(button_4));
|
|
56533
56736
|
var consequent_3 = ($$anchor) => {
|
|
56534
|
-
append($$anchor, root_5$
|
|
56737
|
+
append($$anchor, root_5$7());
|
|
56535
56738
|
};
|
|
56536
56739
|
if_block(node_4, ($$render) => {
|
|
56537
56740
|
if (get(activeTab) === "ai") $$render(consequent_3);
|
|
@@ -56618,7 +56821,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56618
56821
|
append($$anchor, fragment_1);
|
|
56619
56822
|
};
|
|
56620
56823
|
var consequent_6 = ($$anchor) => {
|
|
56621
|
-
var div_15 = root_8$
|
|
56824
|
+
var div_15 = root_8$4();
|
|
56622
56825
|
var div_16 = child(div_15);
|
|
56623
56826
|
var div_17 = sibling(child(div_16), 2);
|
|
56624
56827
|
each(div_17, 20, () => [
|
|
@@ -56642,7 +56845,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56642
56845
|
let value = () => get($$array)[0];
|
|
56643
56846
|
let icon = () => get($$array)[1];
|
|
56644
56847
|
let label = () => get($$array)[2];
|
|
56645
|
-
var button_9 = root_9$
|
|
56848
|
+
var button_9 = root_9$4();
|
|
56646
56849
|
var span = child(button_9);
|
|
56647
56850
|
var text = child(span, true);
|
|
56648
56851
|
reset(span);
|
|
@@ -56664,7 +56867,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56664
56867
|
append($$anchor, div_15);
|
|
56665
56868
|
};
|
|
56666
56869
|
var consequent_9 = ($$anchor) => {
|
|
56667
|
-
var div_18 = root_10$
|
|
56870
|
+
var div_18 = root_10$4();
|
|
56668
56871
|
var div_19 = child(div_18);
|
|
56669
56872
|
var div_20 = sibling(child(div_19), 4);
|
|
56670
56873
|
var div_21 = child(div_20);
|
|
@@ -56681,7 +56884,7 @@ function SettingsDialog($$anchor, $$props) {
|
|
|
56681
56884
|
reset(button_11);
|
|
56682
56885
|
var node_6 = sibling(button_11, 2);
|
|
56683
56886
|
var consequent_7 = ($$anchor) => {
|
|
56684
|
-
var button_12 = root_11$
|
|
56887
|
+
var button_12 = root_11$4();
|
|
56685
56888
|
delegated("click", button_12, clearGeminiKey);
|
|
56686
56889
|
append($$anchor, button_12);
|
|
56687
56890
|
};
|
|
@@ -56784,11 +56987,11 @@ delegate([
|
|
|
56784
56987
|
//#endregion
|
|
56785
56988
|
//#region src/lib/components/sidebar/AreaSummaryPanel.svelte
|
|
56786
56989
|
init_client();
|
|
56787
|
-
var root_2$
|
|
56990
|
+
var root_2$11 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-between text-xs bg-gray-50 rounded px-2 py-1.5"><span class="text-gray-700"> <span class="text-gray-400"> </span></span> <span class="font-medium text-gray-800"> </span></div>`);
|
|
56788
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>`);
|
|
56789
|
-
var root_4$
|
|
56790
|
-
var root_3$
|
|
56791
|
-
var root_5$
|
|
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>`);
|
|
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>`);
|
|
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>`);
|
|
56792
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>`);
|
|
56793
56996
|
function AreaSummaryPanel($$anchor, $$props) {
|
|
56794
56997
|
push($$props, true);
|
|
@@ -56905,7 +57108,7 @@ function AreaSummaryPanel($$anchor, $$props) {
|
|
|
56905
57108
|
var div_10 = root_1$12();
|
|
56906
57109
|
var div_11 = sibling(child(div_10), 2);
|
|
56907
57110
|
each(div_11, 21, () => get(categoryTotals), index$1, ($$anchor, cat) => {
|
|
56908
|
-
var div_12 = root_2$
|
|
57111
|
+
var div_12 = root_2$11();
|
|
56909
57112
|
var span = child(div_12);
|
|
56910
57113
|
var text_4 = child(span);
|
|
56911
57114
|
var span_1 = sibling(text_4);
|
|
@@ -56933,11 +57136,11 @@ function AreaSummaryPanel($$anchor, $$props) {
|
|
|
56933
57136
|
});
|
|
56934
57137
|
var node_1 = sibling(node, 2);
|
|
56935
57138
|
var consequent_1 = ($$anchor) => {
|
|
56936
|
-
var div_13 = root_3$
|
|
57139
|
+
var div_13 = root_3$10();
|
|
56937
57140
|
var div_14 = sibling(child(div_13), 2);
|
|
56938
57141
|
each(div_14, 21, () => get(allRooms), index$1, ($$anchor, room) => {
|
|
56939
57142
|
const pct = /* @__PURE__ */ user_derived(() => get(totalArea) > 0 ? get(room).area / get(totalArea) * 100 : 0);
|
|
56940
|
-
var div_15 = root_4$
|
|
57143
|
+
var div_15 = root_4$9();
|
|
56941
57144
|
var div_16 = child(div_15);
|
|
56942
57145
|
var div_17 = child(div_16);
|
|
56943
57146
|
var span_3 = child(div_17);
|
|
@@ -56972,7 +57175,7 @@ function AreaSummaryPanel($$anchor, $$props) {
|
|
|
56972
57175
|
append($$anchor, div_13);
|
|
56973
57176
|
};
|
|
56974
57177
|
var alternate = ($$anchor) => {
|
|
56975
|
-
append($$anchor, root_5$
|
|
57178
|
+
append($$anchor, root_5$6());
|
|
56976
57179
|
};
|
|
56977
57180
|
if_block(node_1, ($$render) => {
|
|
56978
57181
|
if (get(allRooms).length > 0) $$render(consequent_1);
|
|
@@ -57133,10 +57336,10 @@ async function autoSave(onDispatch) {
|
|
|
57133
57336
|
//#endregion
|
|
57134
57337
|
//#region src/lib/components/toolbar/VersionHistoryPanel.svelte
|
|
57135
57338
|
init_client();
|
|
57136
|
-
var root_2$
|
|
57137
|
-
var root_4$
|
|
57138
|
-
var root_3$
|
|
57139
|
-
var root_5$
|
|
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>`);
|
|
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>`);
|
|
57341
|
+
var root_3$9 = /* @__PURE__ */ from_html(`<div class="space-y-1"></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>`);
|
|
57140
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>`);
|
|
57141
57344
|
function VersionHistoryPanel($$anchor, $$props) {
|
|
57142
57345
|
push($$props, true);
|
|
@@ -57183,13 +57386,13 @@ function VersionHistoryPanel($$anchor, $$props) {
|
|
|
57183
57386
|
var div_3 = sibling(div_2, 2);
|
|
57184
57387
|
var node_1 = child(div_3);
|
|
57185
57388
|
var consequent = ($$anchor) => {
|
|
57186
|
-
append($$anchor, root_2$
|
|
57389
|
+
append($$anchor, root_2$10());
|
|
57187
57390
|
};
|
|
57188
57391
|
var alternate = ($$anchor) => {
|
|
57189
|
-
var div_4 = root_3$
|
|
57392
|
+
var div_4 = root_3$9();
|
|
57190
57393
|
each(div_4, 21, () => [...get(snapshots)].reverse(), index$1, ($$anchor, snap, i) => {
|
|
57191
57394
|
const realIndex = /* @__PURE__ */ user_derived(() => get(snapshots).length - 1 - i);
|
|
57192
|
-
var div_5 = root_4$
|
|
57395
|
+
var div_5 = root_4$8();
|
|
57193
57396
|
var div_6 = child(div_5);
|
|
57194
57397
|
var div_7 = child(div_6);
|
|
57195
57398
|
var text = child(div_7, true);
|
|
@@ -57217,7 +57420,7 @@ function VersionHistoryPanel($$anchor, $$props) {
|
|
|
57217
57420
|
reset(div_3);
|
|
57218
57421
|
var node_2 = sibling(div_3, 2);
|
|
57219
57422
|
var consequent_1 = ($$anchor) => {
|
|
57220
|
-
var div_9 = root_5$
|
|
57423
|
+
var div_9 = root_5$5();
|
|
57221
57424
|
var button_2 = child(div_9);
|
|
57222
57425
|
reset(div_9);
|
|
57223
57426
|
delegated("click", button_2, onClearAll);
|
|
@@ -57249,21 +57452,21 @@ delegate(["click", "keydown"]);
|
|
|
57249
57452
|
init_client();
|
|
57250
57453
|
init_index_client();
|
|
57251
57454
|
init_onboarding_svelte();
|
|
57252
|
-
var root_2$
|
|
57253
|
-
var root_3$
|
|
57254
|
-
var root_4$
|
|
57255
|
-
var root_5$
|
|
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"/>`);
|
|
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>`);
|
|
57457
|
+
var root_4$7 = /* @__PURE__ */ from_html(`<button> </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>`);
|
|
57256
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>`);
|
|
57257
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>`);
|
|
57258
|
-
var root_8$
|
|
57259
|
-
var root_10$
|
|
57260
|
-
var root_9$
|
|
57261
|
-
var root_11$
|
|
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>`);
|
|
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>`);
|
|
57463
|
+
var root_9$3 = /* @__PURE__ */ from_html(`<div class="relative shrink-0"><button title="Settings & tools" aria-label="Settings & 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>`);
|
|
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);
|
|
57262
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>`);
|
|
57263
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>`);
|
|
57264
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>`);
|
|
57265
|
-
var root_18$
|
|
57266
|
-
var root_17$
|
|
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>`);
|
|
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>`);
|
|
57267
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">×</button></div> <div class="overflow-y-auto max-h-[calc(80vh-52px)] p-1"><!></div></div></div>`);
|
|
57268
57471
|
var root$5 = /* @__PURE__ */ from_html(`<!> <!> <!> <!>`, 1);
|
|
57269
57472
|
function TopBar($$anchor, $$props) {
|
|
@@ -57318,6 +57521,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57318
57521
|
}
|
|
57319
57522
|
async function save() {
|
|
57320
57523
|
const p = get$1(currentProject);
|
|
57524
|
+
console.log("🚀 ~ save ~ p:", p);
|
|
57321
57525
|
if (!p) return;
|
|
57322
57526
|
const thumbnail = captureThumbnail(p.id);
|
|
57323
57527
|
$$props.onDispatch("floor:callbackEvent", {
|
|
@@ -57500,7 +57704,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57500
57704
|
var button = child(div);
|
|
57501
57705
|
var node_1 = sibling(button, 2);
|
|
57502
57706
|
var consequent = ($$anchor) => {
|
|
57503
|
-
var input_1 = root_2$
|
|
57707
|
+
var input_1 = root_2$9();
|
|
57504
57708
|
remove_input_defaults(input_1);
|
|
57505
57709
|
event("blur", input_1, onNameBlur);
|
|
57506
57710
|
delegated("keydown", input_1, onNameKeydown);
|
|
@@ -57508,7 +57712,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57508
57712
|
append($$anchor, input_1);
|
|
57509
57713
|
};
|
|
57510
57714
|
var alternate = ($$anchor) => {
|
|
57511
|
-
var button_1 = root_3$
|
|
57715
|
+
var button_1 = root_3$8();
|
|
57512
57716
|
var text_1 = child(button_1, true);
|
|
57513
57717
|
reset(button_1);
|
|
57514
57718
|
template_effect(() => set_text(text_1, get(projectName)));
|
|
@@ -57522,7 +57726,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57522
57726
|
var div_1 = sibling(node_1, 4);
|
|
57523
57727
|
var node_2 = child(div_1);
|
|
57524
57728
|
each(node_2, 17, () => get(floors), index$1, ($$anchor, fl) => {
|
|
57525
|
-
var button_2 = root_4$
|
|
57729
|
+
var button_2 = root_4$7();
|
|
57526
57730
|
var text_2 = child(button_2, true);
|
|
57527
57731
|
reset(button_2);
|
|
57528
57732
|
template_effect(() => {
|
|
@@ -57543,7 +57747,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57543
57747
|
var button_5 = sibling(button_4, 2);
|
|
57544
57748
|
var node_3 = sibling(button_5, 4);
|
|
57545
57749
|
var consequent_1 = ($$anchor) => {
|
|
57546
|
-
var button_6 = root_5$
|
|
57750
|
+
var button_6 = root_5$4();
|
|
57547
57751
|
template_effect(() => {
|
|
57548
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"}`);
|
|
57549
57753
|
set_attribute(button_6, "title", `Snap to Grid (${get(snapOn) ? "On" : "Off"})`);
|
|
@@ -57586,7 +57790,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57586
57790
|
});
|
|
57587
57791
|
var node_6 = sibling(node_5, 4);
|
|
57588
57792
|
var consequent_4 = ($$anchor) => {
|
|
57589
|
-
var div_3 = root_8$
|
|
57793
|
+
var div_3 = root_8$3();
|
|
57590
57794
|
var button_10 = child(div_3);
|
|
57591
57795
|
var button_11 = sibling(button_10, 2);
|
|
57592
57796
|
var text_4 = child(button_11);
|
|
@@ -57604,11 +57808,11 @@ function TopBar($$anchor, $$props) {
|
|
|
57604
57808
|
});
|
|
57605
57809
|
var node_7 = sibling(node_6, 2);
|
|
57606
57810
|
var consequent_6 = ($$anchor) => {
|
|
57607
|
-
var div_4 = root_9$
|
|
57811
|
+
var div_4 = root_9$3();
|
|
57608
57812
|
var button_13 = child(div_4);
|
|
57609
57813
|
var node_8 = sibling(button_13, 2);
|
|
57610
57814
|
var consequent_5 = ($$anchor) => {
|
|
57611
|
-
var div_5 = root_10$
|
|
57815
|
+
var div_5 = root_10$3();
|
|
57612
57816
|
var button_14 = child(div_5);
|
|
57613
57817
|
var span_1 = sibling(child(button_14), 2);
|
|
57614
57818
|
var text_5 = child(span_1, true);
|
|
@@ -57660,7 +57864,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57660
57864
|
append($$anchor, div_4);
|
|
57661
57865
|
};
|
|
57662
57866
|
var alternate_1 = ($$anchor) => {
|
|
57663
|
-
var fragment_1 = root_11$
|
|
57867
|
+
var fragment_1 = root_11$3();
|
|
57664
57868
|
var button_19 = first_child(fragment_1);
|
|
57665
57869
|
var button_20 = sibling(button_19, 2);
|
|
57666
57870
|
var button_21 = sibling(button_20, 2);
|
|
@@ -57765,7 +57969,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57765
57969
|
append($$anchor, div);
|
|
57766
57970
|
};
|
|
57767
57971
|
var alternate_3 = ($$anchor) => {
|
|
57768
|
-
var div_8 = root_17$
|
|
57972
|
+
var div_8 = root_17$2();
|
|
57769
57973
|
var span_4 = child(div_8);
|
|
57770
57974
|
var text_10 = child(span_4, true);
|
|
57771
57975
|
reset(span_4);
|
|
@@ -57773,7 +57977,7 @@ function TopBar($$anchor, $$props) {
|
|
|
57773
57977
|
var button_34 = child(div_9);
|
|
57774
57978
|
var node_12 = sibling(button_34, 2);
|
|
57775
57979
|
var consequent_12 = ($$anchor) => {
|
|
57776
|
-
var div_10 = root_18$
|
|
57980
|
+
var div_10 = root_18$2();
|
|
57777
57981
|
var button_35 = child(div_10);
|
|
57778
57982
|
var button_36 = sibling(button_35, 4);
|
|
57779
57983
|
var button_37 = sibling(button_36, 2);
|
|
@@ -58399,9 +58603,9 @@ function placeRoomTemplate(preset, origin, template, w = 400, h = 300) {
|
|
|
58399
58603
|
//#endregion
|
|
58400
58604
|
//#region src/lib/components/editor/UndoHistoryPanel.svelte
|
|
58401
58605
|
init_client();
|
|
58402
|
-
var root_2$
|
|
58403
|
-
var root_4$
|
|
58404
|
-
var root_3$
|
|
58606
|
+
var root_2$8 = /* @__PURE__ */ from_html(`<div class="px-3 py-6 text-center text-xs text-gray-400">No history yet</div>`);
|
|
58607
|
+
var root_4$6 = /* @__PURE__ */ from_html(`<button><span class="w-5 text-[10px] text-gray-400 text-right shrink-0"></span> <span class="truncate flex-1"> </span> <span class="text-[10px] text-gray-300 shrink-0"> </span></button>`);
|
|
58608
|
+
var root_3$7 = /* @__PURE__ */ from_html(`<div class="py-1"><!> <div><span class="w-5 text-[10px] text-gray-400 text-right shrink-0">●</span> <span class="truncate flex-1 font-medium">Current state</span></div></div>`);
|
|
58405
58609
|
var root_1$9 = /* @__PURE__ */ from_html(`<div class="fixed bottom-12 left-4 w-64 max-h-80 bg-white rounded-xl shadow-2xl border border-gray-200 z-50 flex flex-col overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-gray-100 bg-gray-50"><div class="flex items-center gap-1.5"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-slate-500"><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> <span class="text-xs font-semibold text-slate-700">Undo History</span></div> <div class="flex items-center gap-2"><span class="text-[10px] text-slate-400"> </span> <button class="text-gray-400 hover:text-gray-600 text-sm leading-none" aria-label="Close history">✕</button></div></div> <div class="flex-1 overflow-y-auto"><!></div></div>`);
|
|
58406
58610
|
function UndoHistoryPanel($$anchor, $$props) {
|
|
58407
58611
|
push($$props, true);
|
|
@@ -58438,13 +58642,13 @@ function UndoHistoryPanel($$anchor, $$props) {
|
|
|
58438
58642
|
var div_3 = sibling(div_1, 2);
|
|
58439
58643
|
var node_1 = child(div_3);
|
|
58440
58644
|
var consequent = ($$anchor) => {
|
|
58441
|
-
append($$anchor, root_2$
|
|
58645
|
+
append($$anchor, root_2$8());
|
|
58442
58646
|
};
|
|
58443
58647
|
var alternate = ($$anchor) => {
|
|
58444
|
-
var div_5 = root_3$
|
|
58648
|
+
var div_5 = root_3$7();
|
|
58445
58649
|
var node_2 = child(div_5);
|
|
58446
58650
|
each(node_2, 17, () => get(history).entries, index$1, ($$anchor, entry, i) => {
|
|
58447
|
-
var button_1 = root_4$
|
|
58651
|
+
var button_1 = root_4$6();
|
|
58448
58652
|
let classes;
|
|
58449
58653
|
var span_1 = child(button_1);
|
|
58450
58654
|
span_1.textContent = i + 1;
|
|
@@ -58502,24 +58706,24 @@ delegate(["click"]);
|
|
|
58502
58706
|
//#region src/lib/components/sidebar/BuildPanel.svelte
|
|
58503
58707
|
init_client();
|
|
58504
58708
|
init_index_client();
|
|
58505
|
-
var
|
|
58506
|
-
var
|
|
58507
|
-
var
|
|
58508
|
-
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">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>`);
|
|
58509
|
-
var
|
|
58510
|
-
var
|
|
58511
|
-
var
|
|
58512
|
-
var
|
|
58513
|
-
var
|
|
58514
|
-
var
|
|
58515
|
-
var
|
|
58516
|
-
var
|
|
58517
|
-
var
|
|
58518
|
-
var
|
|
58519
|
-
var
|
|
58520
|
-
var
|
|
58521
|
-
var
|
|
58522
|
-
var
|
|
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>`);
|
|
58523
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);
|
|
58524
58728
|
function BuildPanel($$anchor, $$props) {
|
|
58525
58729
|
push($$props, true);
|
|
@@ -58538,10 +58742,21 @@ function BuildPanel($$anchor, $$props) {
|
|
|
58538
58742
|
selectedTool.set(tool);
|
|
58539
58743
|
placingFurnitureId.set(null);
|
|
58540
58744
|
}
|
|
58745
|
+
function setZoneTool(shape) {
|
|
58746
|
+
placingZoneShape.set(shape);
|
|
58747
|
+
placingFurnitureId.set(null);
|
|
58748
|
+
placingStair.set(false);
|
|
58749
|
+
placingColumn.set(false);
|
|
58750
|
+
selectedTool.set("zone");
|
|
58751
|
+
}
|
|
58541
58752
|
let currentTool = /* @__PURE__ */ state("select");
|
|
58542
58753
|
selectedTool.subscribe((t) => {
|
|
58543
58754
|
set(currentTool, t, true);
|
|
58544
58755
|
});
|
|
58756
|
+
let currentZoneShape = /* @__PURE__ */ state("rectangle");
|
|
58757
|
+
placingZoneShape.subscribe((s) => {
|
|
58758
|
+
set(currentZoneShape, s, true);
|
|
58759
|
+
});
|
|
58545
58760
|
let currentPlacing = /* @__PURE__ */ state(null);
|
|
58546
58761
|
placingFurnitureId.subscribe((id) => {
|
|
58547
58762
|
set(currentPlacing, id, true);
|
|
@@ -58839,7 +59054,7 @@ function BuildPanel($$anchor, $$props) {
|
|
|
58839
59054
|
reset(div_1);
|
|
58840
59055
|
var div_2 = sibling(div_1, 2);
|
|
58841
59056
|
var node = child(div_2);
|
|
58842
|
-
var
|
|
59057
|
+
var consequent_4 = ($$anchor) => {
|
|
58843
59058
|
var div_3 = root_1$8();
|
|
58844
59059
|
var button_3 = sibling(child(div_3), 2);
|
|
58845
59060
|
var div_4 = child(button_3);
|
|
@@ -58849,100 +59064,126 @@ function BuildPanel($$anchor, $$props) {
|
|
|
58849
59064
|
var div_5 = child(button_4);
|
|
58850
59065
|
next(2);
|
|
58851
59066
|
reset(button_4);
|
|
58852
|
-
var
|
|
58853
|
-
var
|
|
58854
|
-
|
|
58855
|
-
reset(button_5);
|
|
58856
|
-
var div_7 = sibling(button_5, 2);
|
|
58857
|
-
var button_6 = child(div_7);
|
|
58858
|
-
var div_8 = child(button_6);
|
|
58859
|
-
next(2);
|
|
58860
|
-
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);
|
|
58861
59070
|
var button_7 = sibling(button_6, 2);
|
|
58862
|
-
|
|
58863
|
-
|
|
58864
|
-
|
|
58865
|
-
|
|
58866
|
-
|
|
58867
|
-
|
|
59071
|
+
reset(div_6);
|
|
59072
|
+
var p_1 = sibling(div_6, 2);
|
|
59073
|
+
var node_1 = child(p_1);
|
|
59074
|
+
var consequent = ($$anchor) => {
|
|
59075
|
+
append($$anchor, text$1("Drag to draw · name/color from camera Area / Area Color"));
|
|
59076
|
+
};
|
|
59077
|
+
var consequent_1 = ($$anchor) => {
|
|
59078
|
+
append($$anchor, text$1("Click to place · then drag vertices"));
|
|
59079
|
+
};
|
|
59080
|
+
var consequent_2 = ($$anchor) => {
|
|
59081
|
+
append($$anchor, text$1("Click vertices · Enter / click first point to close"));
|
|
59082
|
+
};
|
|
59083
|
+
var alternate = ($$anchor) => {
|
|
59084
|
+
append($$anchor, text$1("Select a camera first, then draw its Area"));
|
|
59085
|
+
};
|
|
59086
|
+
if_block(node_1, ($$render) => {
|
|
59087
|
+
if (get(currentTool) === "zone" && get(currentZoneShape) === "rectangle") $$render(consequent);
|
|
59088
|
+
else if (get(currentTool) === "zone" && get(currentZoneShape) === "triangle") $$render(consequent_1, 1);
|
|
59089
|
+
else if (get(currentTool) === "zone" && get(currentZoneShape) === "polygon") $$render(consequent_2, 2);
|
|
59090
|
+
else $$render(alternate, -1);
|
|
59091
|
+
});
|
|
59092
|
+
reset(p_1);
|
|
59093
|
+
var button_8 = sibling(p_1, 4);
|
|
59094
|
+
var div_7 = child(button_8);
|
|
58868
59095
|
next(2);
|
|
58869
59096
|
reset(button_8);
|
|
58870
|
-
var
|
|
58871
|
-
var
|
|
59097
|
+
var div_8 = sibling(button_8, 2);
|
|
59098
|
+
var button_9 = child(div_8);
|
|
59099
|
+
var div_9 = child(button_9);
|
|
58872
59100
|
next(2);
|
|
58873
59101
|
reset(button_9);
|
|
58874
59102
|
var button_10 = sibling(button_9, 2);
|
|
58875
|
-
var
|
|
59103
|
+
var div_10 = child(button_10);
|
|
58876
59104
|
next(2);
|
|
58877
59105
|
reset(button_10);
|
|
58878
|
-
|
|
59106
|
+
reset(div_8);
|
|
59107
|
+
var button_11 = sibling(div_8, 4);
|
|
59108
|
+
var div_11 = child(button_11);
|
|
59109
|
+
next(2);
|
|
59110
|
+
reset(button_11);
|
|
58879
59111
|
var button_12 = sibling(button_11, 2);
|
|
59112
|
+
var div_12 = child(button_12);
|
|
59113
|
+
next(2);
|
|
59114
|
+
reset(button_12);
|
|
58880
59115
|
var button_13 = sibling(button_12, 2);
|
|
58881
|
-
var
|
|
58882
|
-
|
|
58883
|
-
reset(span);
|
|
59116
|
+
var div_13 = child(button_13);
|
|
59117
|
+
next(2);
|
|
58884
59118
|
reset(button_13);
|
|
58885
|
-
var
|
|
58886
|
-
var
|
|
58887
|
-
|
|
58888
|
-
|
|
58889
|
-
|
|
58890
|
-
|
|
58891
|
-
|
|
58892
|
-
|
|
59119
|
+
var button_14 = sibling(button_13, 4);
|
|
59120
|
+
var button_15 = sibling(button_14, 2);
|
|
59121
|
+
var button_16 = sibling(button_15, 2);
|
|
59122
|
+
var span = sibling(child(button_16), 2);
|
|
59123
|
+
var text_5 = child(span, true);
|
|
59124
|
+
reset(span);
|
|
59125
|
+
reset(button_16);
|
|
59126
|
+
var node_2 = sibling(button_16, 2);
|
|
59127
|
+
var consequent_3 = ($$anchor) => {
|
|
59128
|
+
var fragment_1 = root_6$3();
|
|
59129
|
+
var div_14 = first_child(fragment_1);
|
|
59130
|
+
each(div_14, 21, () => doorCatalog, index$1, ($$anchor, dc) => {
|
|
59131
|
+
var button_17 = root_7$4();
|
|
59132
|
+
var div_15 = child(button_17);
|
|
59133
|
+
var svg = child(div_15);
|
|
58893
59134
|
var path = child(svg);
|
|
58894
59135
|
reset(svg);
|
|
58895
|
-
reset(
|
|
58896
|
-
var span_1 = sibling(
|
|
58897
|
-
var
|
|
59136
|
+
reset(div_15);
|
|
59137
|
+
var span_1 = sibling(div_15, 2);
|
|
59138
|
+
var text_6 = child(span_1, true);
|
|
58898
59139
|
reset(span_1);
|
|
58899
59140
|
var span_2 = sibling(span_1, 2);
|
|
58900
|
-
var
|
|
59141
|
+
var text_7 = child(span_2, true);
|
|
58901
59142
|
reset(span_2);
|
|
58902
|
-
reset(
|
|
59143
|
+
reset(button_17);
|
|
58903
59144
|
template_effect(() => {
|
|
58904
|
-
set_class(
|
|
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"}`);
|
|
58905
59146
|
set_attribute(path, "d", get(dc).icon);
|
|
58906
|
-
set_text(
|
|
58907
|
-
set_text(
|
|
59147
|
+
set_text(text_6, get(dc).name);
|
|
59148
|
+
set_text(text_7, get(dc).desc);
|
|
58908
59149
|
});
|
|
58909
|
-
delegated("click",
|
|
58910
|
-
event("dragstart",
|
|
59150
|
+
delegated("click", button_17, () => setDoorType(get(dc).type));
|
|
59151
|
+
event("dragstart", button_17, (e) => {
|
|
58911
59152
|
var _e$dataTransfer, _e$dataTransfer2;
|
|
58912
59153
|
(_e$dataTransfer = e.dataTransfer) === null || _e$dataTransfer === void 0 || _e$dataTransfer.setData("application/o3d-type", "door");
|
|
58913
59154
|
(_e$dataTransfer2 = e.dataTransfer) === null || _e$dataTransfer2 === void 0 || _e$dataTransfer2.setData("application/o3d-id", get(dc).type);
|
|
58914
59155
|
});
|
|
58915
|
-
append($$anchor,
|
|
59156
|
+
append($$anchor, button_17);
|
|
58916
59157
|
});
|
|
58917
|
-
reset(
|
|
58918
|
-
var
|
|
58919
|
-
each(
|
|
58920
|
-
var
|
|
58921
|
-
var span_3 = sibling(child(
|
|
58922
|
-
var
|
|
59158
|
+
reset(div_14);
|
|
59159
|
+
var div_16 = sibling(div_14, 4);
|
|
59160
|
+
each(div_16, 21, () => windowCatalog, index$1, ($$anchor, wc) => {
|
|
59161
|
+
var button_18 = root_8$2();
|
|
59162
|
+
var span_3 = sibling(child(button_18), 2);
|
|
59163
|
+
var text_8 = child(span_3, true);
|
|
58923
59164
|
reset(span_3);
|
|
58924
59165
|
var span_4 = sibling(span_3, 2);
|
|
58925
|
-
var
|
|
59166
|
+
var text_9 = child(span_4, true);
|
|
58926
59167
|
reset(span_4);
|
|
58927
|
-
reset(
|
|
59168
|
+
reset(button_18);
|
|
58928
59169
|
template_effect(() => {
|
|
58929
|
-
set_class(
|
|
58930
|
-
set_text(
|
|
58931
|
-
set_text(
|
|
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"}`);
|
|
59171
|
+
set_text(text_8, get(wc).name);
|
|
59172
|
+
set_text(text_9, get(wc).desc);
|
|
58932
59173
|
});
|
|
58933
|
-
delegated("click",
|
|
58934
|
-
event("dragstart",
|
|
59174
|
+
delegated("click", button_18, () => setWindowType(get(wc).type));
|
|
59175
|
+
event("dragstart", button_18, (e) => {
|
|
58935
59176
|
var _e$dataTransfer3, _e$dataTransfer4;
|
|
58936
59177
|
(_e$dataTransfer3 = e.dataTransfer) === null || _e$dataTransfer3 === void 0 || _e$dataTransfer3.setData("application/o3d-type", "window");
|
|
58937
59178
|
(_e$dataTransfer4 = e.dataTransfer) === null || _e$dataTransfer4 === void 0 || _e$dataTransfer4.setData("application/o3d-id", get(wc).type);
|
|
58938
59179
|
});
|
|
58939
|
-
append($$anchor,
|
|
59180
|
+
append($$anchor, button_18);
|
|
58940
59181
|
});
|
|
58941
|
-
reset(
|
|
59182
|
+
reset(div_16);
|
|
58942
59183
|
append($$anchor, fragment_1);
|
|
58943
59184
|
};
|
|
58944
|
-
if_block(
|
|
58945
|
-
if (get(constructionOpen)) $$render(
|
|
59185
|
+
if_block(node_2, ($$render) => {
|
|
59186
|
+
if (get(constructionOpen)) $$render(consequent_3);
|
|
58946
59187
|
});
|
|
58947
59188
|
reset(div_3);
|
|
58948
59189
|
template_effect(() => {
|
|
@@ -58950,206 +59191,212 @@ function BuildPanel($$anchor, $$props) {
|
|
|
58950
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" : ""}`);
|
|
58951
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"}`);
|
|
58952
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" : ""}`);
|
|
58953
|
-
set_class(button_5, 1, `
|
|
58954
|
-
set_class(
|
|
58955
|
-
set_class(
|
|
58956
|
-
set_class(
|
|
58957
|
-
set_class(
|
|
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"}`);
|
|
58958
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" : ""}`);
|
|
58959
|
-
set_class(
|
|
58960
|
-
set_class(div_10, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(
|
|
58961
|
-
set_class(
|
|
58962
|
-
set_class(div_11, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "
|
|
58963
|
-
set_class(
|
|
58964
|
-
set_class(div_12, 1, `w-9 h-9 rounded-lg bg-gray-100 flex items-center justify-center ${get(currentTool) === "
|
|
58965
|
-
|
|
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" : ""}`);
|
|
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"}`);
|
|
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" : ""}`);
|
|
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"}`);
|
|
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" : ""}`);
|
|
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"}`);
|
|
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" : ""}`);
|
|
59209
|
+
set_text(text_5, get(constructionOpen) ? "▼" : "▶");
|
|
58966
59210
|
});
|
|
58967
59211
|
delegated("click", button_3, () => setTool("select"));
|
|
58968
59212
|
delegated("click", button_4, () => setTool("wall"));
|
|
58969
|
-
delegated("click", button_5,
|
|
58970
|
-
delegated("click", button_6, () =>
|
|
58971
|
-
delegated("click", button_7, () =>
|
|
58972
|
-
delegated("click", button_8,
|
|
58973
|
-
delegated("click", button_9, () =>
|
|
58974
|
-
delegated("click", button_10, () =>
|
|
58975
|
-
delegated("click", button_11,
|
|
58976
|
-
delegated("click", button_12,
|
|
58977
|
-
delegated("click", button_13, () =>
|
|
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"));
|
|
59219
|
+
delegated("click", button_11, () => setTool("text"));
|
|
59220
|
+
delegated("click", button_12, () => setTool("annotate"));
|
|
59221
|
+
delegated("click", button_13, () => setTool("measure"));
|
|
59222
|
+
delegated("click", button_14, onImportImage);
|
|
59223
|
+
delegated("click", button_15, onImportRoomPlan);
|
|
59224
|
+
delegated("click", button_16, () => set(constructionOpen, !get(constructionOpen)));
|
|
58978
59225
|
append($$anchor, div_3);
|
|
58979
59226
|
};
|
|
58980
|
-
var
|
|
58981
|
-
var
|
|
58982
|
-
var
|
|
58983
|
-
each(
|
|
58984
|
-
var
|
|
58985
|
-
var
|
|
58986
|
-
var
|
|
58987
|
-
reset(
|
|
58988
|
-
var span_5 = sibling(
|
|
58989
|
-
var
|
|
59227
|
+
var consequent_11 = ($$anchor) => {
|
|
59228
|
+
var div_17 = root_9$2();
|
|
59229
|
+
var div_18 = sibling(child(div_17), 4);
|
|
59230
|
+
each(div_18, 21, () => roomPresets, index$1, ($$anchor, preset) => {
|
|
59231
|
+
var button_19 = root_10$2();
|
|
59232
|
+
var div_19 = child(button_19);
|
|
59233
|
+
var text_10 = child(div_19, true);
|
|
59234
|
+
reset(div_19);
|
|
59235
|
+
var span_5 = sibling(div_19, 2);
|
|
59236
|
+
var text_11 = child(span_5, true);
|
|
58990
59237
|
reset(span_5);
|
|
58991
|
-
reset(
|
|
59238
|
+
reset(button_19);
|
|
58992
59239
|
template_effect(() => {
|
|
58993
|
-
set_text(
|
|
58994
|
-
set_text(
|
|
59240
|
+
set_text(text_10, get(preset).icon);
|
|
59241
|
+
set_text(text_11, get(preset).name);
|
|
58995
59242
|
});
|
|
58996
|
-
delegated("click",
|
|
58997
|
-
event("dragstart",
|
|
59243
|
+
delegated("click", button_19, () => onPresetClick(get(preset).id));
|
|
59244
|
+
event("dragstart", button_19, (e) => {
|
|
58998
59245
|
var _e$dataTransfer5, _e$dataTransfer6;
|
|
58999
59246
|
(_e$dataTransfer5 = e.dataTransfer) === null || _e$dataTransfer5 === void 0 || _e$dataTransfer5.setData("application/o3d-type", "room");
|
|
59000
59247
|
(_e$dataTransfer6 = e.dataTransfer) === null || _e$dataTransfer6 === void 0 || _e$dataTransfer6.setData("application/o3d-id", get(preset).id);
|
|
59001
59248
|
});
|
|
59002
|
-
append($$anchor,
|
|
59249
|
+
append($$anchor, button_19);
|
|
59003
59250
|
});
|
|
59004
|
-
reset(
|
|
59005
|
-
var
|
|
59006
|
-
each(
|
|
59007
|
-
var
|
|
59008
|
-
var
|
|
59009
|
-
var
|
|
59010
|
-
var
|
|
59251
|
+
reset(div_18);
|
|
59252
|
+
var div_20 = sibling(div_18, 8);
|
|
59253
|
+
each(div_20, 21, () => roomTemplates, index$1, ($$anchor, tmpl) => {
|
|
59254
|
+
var button_20 = root_11$2();
|
|
59255
|
+
var div_21 = child(button_20);
|
|
59256
|
+
var node_3 = child(div_21);
|
|
59257
|
+
var consequent_5 = ($$anchor) => {
|
|
59011
59258
|
append($$anchor, text$1("🛋️"));
|
|
59012
59259
|
};
|
|
59013
|
-
var
|
|
59260
|
+
var consequent_6 = ($$anchor) => {
|
|
59014
59261
|
append($$anchor, text$1("🛏️"));
|
|
59015
59262
|
};
|
|
59016
|
-
var
|
|
59263
|
+
var consequent_7 = ($$anchor) => {
|
|
59017
59264
|
append($$anchor, text$1("🍳"));
|
|
59018
59265
|
};
|
|
59019
|
-
var
|
|
59266
|
+
var consequent_8 = ($$anchor) => {
|
|
59020
59267
|
append($$anchor, text$1("🛁"));
|
|
59021
59268
|
};
|
|
59022
|
-
var
|
|
59269
|
+
var consequent_9 = ($$anchor) => {
|
|
59023
59270
|
append($$anchor, text$1("🖥️"));
|
|
59024
59271
|
};
|
|
59025
|
-
var
|
|
59272
|
+
var consequent_10 = ($$anchor) => {
|
|
59026
59273
|
append($$anchor, text$1("🍽️"));
|
|
59027
59274
|
};
|
|
59028
|
-
var
|
|
59275
|
+
var alternate_1 = ($$anchor) => {
|
|
59029
59276
|
append($$anchor, text$1("🏠"));
|
|
59030
59277
|
};
|
|
59031
|
-
if_block(
|
|
59032
|
-
if (get(tmpl).name === "Living Room") $$render(
|
|
59033
|
-
else if (get(tmpl).name === "Bedroom") $$render(
|
|
59034
|
-
else if (get(tmpl).name === "Kitchen") $$render(
|
|
59035
|
-
else if (get(tmpl).name === "Bathroom") $$render(
|
|
59036
|
-
else if (get(tmpl).name === "Office") $$render(
|
|
59037
|
-
else if (get(tmpl).name === "Dining Room") $$render(
|
|
59038
|
-
else $$render(
|
|
59278
|
+
if_block(node_3, ($$render) => {
|
|
59279
|
+
if (get(tmpl).name === "Living Room") $$render(consequent_5);
|
|
59280
|
+
else if (get(tmpl).name === "Bedroom") $$render(consequent_6, 1);
|
|
59281
|
+
else if (get(tmpl).name === "Kitchen") $$render(consequent_7, 2);
|
|
59282
|
+
else if (get(tmpl).name === "Bathroom") $$render(consequent_8, 3);
|
|
59283
|
+
else if (get(tmpl).name === "Office") $$render(consequent_9, 4);
|
|
59284
|
+
else if (get(tmpl).name === "Dining Room") $$render(consequent_10, 5);
|
|
59285
|
+
else $$render(alternate_1, -1);
|
|
59039
59286
|
});
|
|
59040
|
-
reset(
|
|
59041
|
-
var span_6 = sibling(
|
|
59042
|
-
var
|
|
59287
|
+
reset(div_21);
|
|
59288
|
+
var span_6 = sibling(div_21, 2);
|
|
59289
|
+
var text_19 = child(span_6, true);
|
|
59043
59290
|
reset(span_6);
|
|
59044
59291
|
var span_7 = sibling(span_6, 2);
|
|
59045
|
-
var
|
|
59292
|
+
var text_20 = child(span_7);
|
|
59046
59293
|
reset(span_7);
|
|
59047
|
-
reset(
|
|
59294
|
+
reset(button_20);
|
|
59048
59295
|
template_effect(() => {
|
|
59049
59296
|
var _$$get$furniture$leng;
|
|
59050
|
-
set_text(
|
|
59051
|
-
set_text(
|
|
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`);
|
|
59052
59299
|
});
|
|
59053
|
-
delegated("click",
|
|
59054
|
-
event("dragstart",
|
|
59300
|
+
delegated("click", button_20, () => onPresetClick(get(tmpl).presetId, get(tmpl).name));
|
|
59301
|
+
event("dragstart", button_20, (e) => {
|
|
59055
59302
|
var _e$dataTransfer7, _e$dataTransfer8;
|
|
59056
59303
|
(_e$dataTransfer7 = e.dataTransfer) === null || _e$dataTransfer7 === void 0 || _e$dataTransfer7.setData("application/o3d-type", "room-template");
|
|
59057
59304
|
(_e$dataTransfer8 = e.dataTransfer) === null || _e$dataTransfer8 === void 0 || _e$dataTransfer8.setData("application/o3d-id", get(tmpl).name);
|
|
59058
59305
|
});
|
|
59059
|
-
append($$anchor,
|
|
59306
|
+
append($$anchor, button_20);
|
|
59060
59307
|
});
|
|
59061
|
-
reset(
|
|
59062
|
-
reset(
|
|
59063
|
-
append($$anchor,
|
|
59308
|
+
reset(div_20);
|
|
59309
|
+
reset(div_17);
|
|
59310
|
+
append($$anchor, div_17);
|
|
59064
59311
|
};
|
|
59065
|
-
var
|
|
59066
|
-
var
|
|
59067
|
-
var
|
|
59068
|
-
var input_1 = child(
|
|
59312
|
+
var consequent_16 = ($$anchor) => {
|
|
59313
|
+
var div_22 = root_19$2();
|
|
59314
|
+
var div_23 = child(div_22);
|
|
59315
|
+
var input_1 = child(div_23);
|
|
59069
59316
|
remove_input_defaults(input_1);
|
|
59070
|
-
var
|
|
59071
|
-
var
|
|
59072
|
-
var
|
|
59073
|
-
delegated("click",
|
|
59074
|
-
append($$anchor,
|
|
59317
|
+
var node_4 = sibling(input_1, 2);
|
|
59318
|
+
var consequent_12 = ($$anchor) => {
|
|
59319
|
+
var button_21 = root_20$2();
|
|
59320
|
+
delegated("click", button_21, () => set(search, ""));
|
|
59321
|
+
append($$anchor, button_21);
|
|
59075
59322
|
};
|
|
59076
|
-
if_block(
|
|
59077
|
-
if (get(search)) $$render(
|
|
59323
|
+
if_block(node_4, ($$render) => {
|
|
59324
|
+
if (get(search)) $$render(consequent_12);
|
|
59078
59325
|
});
|
|
59079
|
-
reset(
|
|
59080
|
-
var
|
|
59081
|
-
var
|
|
59082
|
-
var
|
|
59083
|
-
var
|
|
59084
|
-
reset(
|
|
59326
|
+
reset(div_23);
|
|
59327
|
+
var node_5 = sibling(div_23, 2);
|
|
59328
|
+
var consequent_13 = ($$anchor) => {
|
|
59329
|
+
var div_24 = root_21$1();
|
|
59330
|
+
var text_21 = child(div_24);
|
|
59331
|
+
reset(div_24);
|
|
59085
59332
|
template_effect(() => {
|
|
59086
59333
|
var _$$get$length, _$$get;
|
|
59087
|
-
return set_text(
|
|
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 : ""}"`);
|
|
59088
59335
|
});
|
|
59089
|
-
append($$anchor,
|
|
59336
|
+
append($$anchor, div_24);
|
|
59090
59337
|
};
|
|
59091
|
-
if_block(
|
|
59092
|
-
if (get(search)) $$render(
|
|
59338
|
+
if_block(node_5, ($$render) => {
|
|
59339
|
+
if (get(search)) $$render(consequent_13);
|
|
59093
59340
|
});
|
|
59094
|
-
var
|
|
59095
|
-
var
|
|
59096
|
-
var
|
|
59097
|
-
var
|
|
59098
|
-
reset(
|
|
59099
|
-
each(sibling(
|
|
59100
|
-
var
|
|
59101
|
-
var
|
|
59102
|
-
reset(
|
|
59341
|
+
var div_25 = sibling(node_5, 2);
|
|
59342
|
+
var button_22 = child(div_25);
|
|
59343
|
+
var button_23 = sibling(button_22, 2);
|
|
59344
|
+
var text_22 = child(button_23);
|
|
59345
|
+
reset(button_23);
|
|
59346
|
+
each(sibling(button_23, 2), 17, () => furnitureCategories, index$1, ($$anchor, cat) => {
|
|
59347
|
+
var button_24 = root_22$2();
|
|
59348
|
+
var text_23 = child(button_24, true);
|
|
59349
|
+
reset(button_24);
|
|
59103
59350
|
template_effect(() => {
|
|
59104
59351
|
var _categoryColors$$$get;
|
|
59105
|
-
set_class(
|
|
59106
|
-
set_style(
|
|
59107
|
-
set_text(
|
|
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"}`);
|
|
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");
|
|
59354
|
+
set_text(text_23, get(cat));
|
|
59108
59355
|
});
|
|
59109
|
-
delegated("click",
|
|
59110
|
-
append($$anchor,
|
|
59356
|
+
delegated("click", button_24, () => set(selectedCategory, get(cat), true));
|
|
59357
|
+
append($$anchor, button_24);
|
|
59111
59358
|
});
|
|
59112
|
-
reset(
|
|
59113
|
-
var
|
|
59114
|
-
var
|
|
59115
|
-
var fragment_2 =
|
|
59116
|
-
var
|
|
59117
|
-
var
|
|
59118
|
-
each(
|
|
59119
|
-
var
|
|
59120
|
-
var span_8 = child(
|
|
59121
|
-
var
|
|
59359
|
+
reset(div_25);
|
|
59360
|
+
var node_7 = sibling(div_25, 2);
|
|
59361
|
+
var consequent_14 = ($$anchor) => {
|
|
59362
|
+
var fragment_2 = root_23$2();
|
|
59363
|
+
var div_26 = first_child(fragment_2);
|
|
59364
|
+
var div_27 = sibling(child(div_26), 2);
|
|
59365
|
+
each(div_27, 21, () => get(recentItems), index$1, ($$anchor, item) => {
|
|
59366
|
+
var button_25 = root_24$1();
|
|
59367
|
+
var span_8 = child(button_25);
|
|
59368
|
+
var text_24 = child(span_8, true);
|
|
59122
59369
|
reset(span_8);
|
|
59123
|
-
var
|
|
59124
|
-
var
|
|
59125
|
-
reset(
|
|
59126
|
-
var span_9 = sibling(
|
|
59127
|
-
var
|
|
59370
|
+
var div_28 = sibling(span_8, 2);
|
|
59371
|
+
var div_29 = child(div_28);
|
|
59372
|
+
reset(div_28);
|
|
59373
|
+
var span_9 = sibling(div_28, 2);
|
|
59374
|
+
var text_25 = child(span_9, true);
|
|
59128
59375
|
reset(span_9);
|
|
59129
|
-
reset(
|
|
59376
|
+
reset(button_25);
|
|
59130
59377
|
template_effect(($0, $1, $2) => {
|
|
59131
59378
|
var _$$get$color, _$$get$color2;
|
|
59132
|
-
set_class(
|
|
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"}`);
|
|
59133
59380
|
set_class(span_8, 1, `absolute top-1 right-1 text-[12px] leading-none cursor-pointer ${$0 !== null && $0 !== void 0 ? $0 : ""}`);
|
|
59134
59381
|
set_attribute(span_8, "title", $1);
|
|
59135
|
-
set_text(
|
|
59136
|
-
set_style(
|
|
59137
|
-
set_style(
|
|
59138
|
-
set_text(
|
|
59382
|
+
set_text(text_24, $2);
|
|
59383
|
+
set_style(div_28, `background-color: ${(_$$get$color = get(item).color) !== null && _$$get$color !== void 0 ? _$$get$color : ""}20`);
|
|
59384
|
+
set_style(div_29, `background-color: ${(_$$get$color2 = get(item).color) !== null && _$$get$color2 !== void 0 ? _$$get$color2 : ""}; opacity: 0.7`);
|
|
59385
|
+
set_text(text_25, get(item).name);
|
|
59139
59386
|
}, [
|
|
59140
59387
|
() => get(favoriteIds).includes(get(item).id) ? "text-pink-500" : "text-gray-300 hover:text-pink-400",
|
|
59141
59388
|
() => get(favoriteIds).includes(get(item).id) ? "Remove from favorites" : "Add to favorites",
|
|
59142
59389
|
() => get(favoriteIds).includes(get(item).id) ? "♥" : "♡"
|
|
59143
59390
|
]);
|
|
59144
|
-
delegated("click",
|
|
59145
|
-
event("dragstart",
|
|
59391
|
+
delegated("click", button_25, () => onFurnitureClick(get(item)));
|
|
59392
|
+
event("dragstart", button_25, (e) => {
|
|
59146
59393
|
var _e$dataTransfer9, _e$dataTransfer10;
|
|
59147
59394
|
(_e$dataTransfer9 = e.dataTransfer) === null || _e$dataTransfer9 === void 0 || _e$dataTransfer9.setData("application/o3d-type", "furniture");
|
|
59148
59395
|
(_e$dataTransfer10 = e.dataTransfer) === null || _e$dataTransfer10 === void 0 || _e$dataTransfer10.setData("application/o3d-id", get(item).id);
|
|
59149
59396
|
});
|
|
59150
|
-
event("mouseenter",
|
|
59151
|
-
delegated("mousemove",
|
|
59152
|
-
event("mouseleave",
|
|
59397
|
+
event("mouseenter", button_25, (e) => onItemMouseEnter(e, get(item)));
|
|
59398
|
+
delegated("mousemove", button_25, onItemMouseMove);
|
|
59399
|
+
event("mouseleave", button_25, onItemMouseLeave);
|
|
59153
59400
|
delegated("click", span_8, (e) => {
|
|
59154
59401
|
e.stopPropagation();
|
|
59155
59402
|
e.preventDefault();
|
|
@@ -59161,40 +59408,40 @@ function BuildPanel($$anchor, $$props) {
|
|
|
59161
59408
|
toggleFavorite(get(item).id);
|
|
59162
59409
|
}
|
|
59163
59410
|
});
|
|
59164
|
-
append($$anchor,
|
|
59411
|
+
append($$anchor, button_25);
|
|
59165
59412
|
});
|
|
59413
|
+
reset(div_27);
|
|
59166
59414
|
reset(div_26);
|
|
59167
|
-
reset(div_25);
|
|
59168
59415
|
next(2);
|
|
59169
59416
|
append($$anchor, fragment_2);
|
|
59170
59417
|
};
|
|
59171
|
-
if_block(
|
|
59172
|
-
if (!get(search) && get(selectedCategory) === "All" && get(recentItems).length > 0) $$render(
|
|
59418
|
+
if_block(node_7, ($$render) => {
|
|
59419
|
+
if (!get(search) && get(selectedCategory) === "All" && get(recentItems).length > 0) $$render(consequent_14);
|
|
59173
59420
|
});
|
|
59174
|
-
var
|
|
59175
|
-
each(
|
|
59421
|
+
var div_30 = sibling(node_7, 2);
|
|
59422
|
+
each(div_30, 21, () => get(filtered), index$1, ($$anchor, item) => {
|
|
59176
59423
|
const s = /* @__PURE__ */ user_derived(() => get(search).toLowerCase());
|
|
59177
|
-
var
|
|
59178
|
-
var span_10 = child(
|
|
59179
|
-
var
|
|
59424
|
+
var button_26 = root_25$1();
|
|
59425
|
+
var span_10 = child(button_26);
|
|
59426
|
+
var text_26 = child(span_10, true);
|
|
59180
59427
|
reset(span_10);
|
|
59181
|
-
var
|
|
59182
|
-
var
|
|
59183
|
-
reset(
|
|
59184
|
-
var
|
|
59185
|
-
var
|
|
59428
|
+
var div_31 = sibling(span_10, 2);
|
|
59429
|
+
var div_32 = child(div_31);
|
|
59430
|
+
reset(div_31);
|
|
59431
|
+
var node_8 = sibling(div_31, 2);
|
|
59432
|
+
var consequent_15 = ($$anchor) => {
|
|
59186
59433
|
const idx = /* @__PURE__ */ user_derived(() => get(item).name.toLowerCase().indexOf(get(s)));
|
|
59187
|
-
var span_11 =
|
|
59188
|
-
var
|
|
59189
|
-
var mark = sibling(
|
|
59190
|
-
var
|
|
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);
|
|
59191
59438
|
reset(mark);
|
|
59192
|
-
var
|
|
59439
|
+
var text_29 = sibling(mark, 1, true);
|
|
59193
59440
|
reset(span_11);
|
|
59194
59441
|
template_effect(($0, $1, $2) => {
|
|
59195
|
-
set_text(
|
|
59196
|
-
set_text(
|
|
59197
|
-
set_text(
|
|
59442
|
+
set_text(text_27, $0);
|
|
59443
|
+
set_text(text_28, $1);
|
|
59444
|
+
set_text(text_29, $2);
|
|
59198
59445
|
}, [
|
|
59199
59446
|
() => get(item).name.slice(0, get(idx)),
|
|
59200
59447
|
() => get(item).name.slice(get(idx), get(idx) + get(s).length),
|
|
@@ -59203,44 +59450,44 @@ function BuildPanel($$anchor, $$props) {
|
|
|
59203
59450
|
append($$anchor, span_11);
|
|
59204
59451
|
};
|
|
59205
59452
|
var d = /* @__PURE__ */ user_derived(() => get(s) && get(item).name.toLowerCase().includes(get(s)));
|
|
59206
|
-
var
|
|
59207
|
-
var span_12 =
|
|
59208
|
-
var
|
|
59453
|
+
var alternate_2 = ($$anchor) => {
|
|
59454
|
+
var span_12 = root_27$1();
|
|
59455
|
+
var text_30 = child(span_12, true);
|
|
59209
59456
|
reset(span_12);
|
|
59210
|
-
template_effect(() => set_text(
|
|
59457
|
+
template_effect(() => set_text(text_30, get(item).name));
|
|
59211
59458
|
append($$anchor, span_12);
|
|
59212
59459
|
};
|
|
59213
|
-
if_block(
|
|
59214
|
-
if (get(d)) $$render(
|
|
59215
|
-
else $$render(
|
|
59460
|
+
if_block(node_8, ($$render) => {
|
|
59461
|
+
if (get(d)) $$render(consequent_15);
|
|
59462
|
+
else $$render(alternate_2, -1);
|
|
59216
59463
|
});
|
|
59217
|
-
var span_13 = sibling(
|
|
59218
|
-
var
|
|
59464
|
+
var span_13 = sibling(node_8, 2);
|
|
59465
|
+
var text_31 = child(span_13);
|
|
59219
59466
|
reset(span_13);
|
|
59220
|
-
reset(
|
|
59467
|
+
reset(button_26);
|
|
59221
59468
|
template_effect(($0, $1, $2) => {
|
|
59222
59469
|
var _$$get$color3, _$$get$color4, _$$get$width, _$$get$depth;
|
|
59223
|
-
set_class(
|
|
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"}`);
|
|
59224
59471
|
set_class(span_10, 1, `absolute top-1 right-1 text-[12px] leading-none cursor-pointer ${$0 !== null && $0 !== void 0 ? $0 : ""}`);
|
|
59225
59472
|
set_attribute(span_10, "title", $1);
|
|
59226
|
-
set_text(
|
|
59227
|
-
set_style(
|
|
59228
|
-
set_style(
|
|
59229
|
-
set_text(
|
|
59473
|
+
set_text(text_26, $2);
|
|
59474
|
+
set_style(div_31, `background-color: ${(_$$get$color3 = get(item).color) !== null && _$$get$color3 !== void 0 ? _$$get$color3 : ""}20`);
|
|
59475
|
+
set_style(div_32, `background-color: ${(_$$get$color4 = get(item).color) !== null && _$$get$color4 !== void 0 ? _$$get$color4 : ""}; opacity: 0.7`);
|
|
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`);
|
|
59230
59477
|
}, [
|
|
59231
59478
|
() => get(favoriteIds).includes(get(item).id) ? "text-pink-500" : "text-gray-300 hover:text-pink-400",
|
|
59232
59479
|
() => get(favoriteIds).includes(get(item).id) ? "Remove from favorites" : "Add to favorites",
|
|
59233
59480
|
() => get(favoriteIds).includes(get(item).id) ? "♥" : "♡"
|
|
59234
59481
|
]);
|
|
59235
|
-
delegated("click",
|
|
59236
|
-
event("dragstart",
|
|
59482
|
+
delegated("click", button_26, () => onFurnitureClick(get(item)));
|
|
59483
|
+
event("dragstart", button_26, (e) => {
|
|
59237
59484
|
var _e$dataTransfer11, _e$dataTransfer12;
|
|
59238
59485
|
(_e$dataTransfer11 = e.dataTransfer) === null || _e$dataTransfer11 === void 0 || _e$dataTransfer11.setData("application/o3d-type", "furniture");
|
|
59239
59486
|
(_e$dataTransfer12 = e.dataTransfer) === null || _e$dataTransfer12 === void 0 || _e$dataTransfer12.setData("application/o3d-id", get(item).id);
|
|
59240
59487
|
});
|
|
59241
|
-
event("mouseenter",
|
|
59242
|
-
delegated("mousemove",
|
|
59243
|
-
event("mouseleave",
|
|
59488
|
+
event("mouseenter", button_26, (e) => onItemMouseEnter(e, get(item)));
|
|
59489
|
+
delegated("mousemove", button_26, onItemMouseMove);
|
|
59490
|
+
event("mouseleave", button_26, onItemMouseLeave);
|
|
59244
59491
|
delegated("click", span_10, (e) => {
|
|
59245
59492
|
e.stopPropagation();
|
|
59246
59493
|
e.preventDefault();
|
|
@@ -59252,81 +59499,81 @@ function BuildPanel($$anchor, $$props) {
|
|
|
59252
59499
|
toggleFavorite(get(item).id);
|
|
59253
59500
|
}
|
|
59254
59501
|
});
|
|
59255
|
-
append($$anchor,
|
|
59502
|
+
append($$anchor, button_26);
|
|
59256
59503
|
});
|
|
59257
|
-
reset(
|
|
59258
|
-
reset(
|
|
59504
|
+
reset(div_30);
|
|
59505
|
+
reset(div_22);
|
|
59259
59506
|
template_effect(() => {
|
|
59260
|
-
set_class(
|
|
59261
|
-
set_class(
|
|
59262
|
-
set_text(
|
|
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"}`);
|
|
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"}`);
|
|
59509
|
+
set_text(text_22, `♥ Favorites${get(favoriteIds).length ? ` (${get(favoriteIds).length})` : ""}`);
|
|
59263
59510
|
});
|
|
59264
59511
|
bind_value(input_1, () => get(search), ($$value) => set(search, $$value));
|
|
59265
|
-
delegated("click",
|
|
59266
|
-
delegated("click",
|
|
59267
|
-
append($$anchor,
|
|
59512
|
+
delegated("click", button_22, () => set(selectedCategory, "All"));
|
|
59513
|
+
delegated("click", button_23, () => set(selectedCategory, "Favorites"));
|
|
59514
|
+
append($$anchor, div_22);
|
|
59268
59515
|
};
|
|
59269
59516
|
if_block(node, ($$render) => {
|
|
59270
|
-
if (get(activeTab) === "draw") $$render(
|
|
59271
|
-
else if (get(activeTab) === "rooms") $$render(
|
|
59272
|
-
else if (get(activeTab) === "objects") $$render(
|
|
59517
|
+
if (get(activeTab) === "draw") $$render(consequent_4);
|
|
59518
|
+
else if (get(activeTab) === "rooms") $$render(consequent_11, 1);
|
|
59519
|
+
else if (get(activeTab) === "objects") $$render(consequent_16, 2);
|
|
59273
59520
|
});
|
|
59274
59521
|
reset(div_2);
|
|
59275
|
-
var
|
|
59522
|
+
var button_27 = sibling(div_2, 2);
|
|
59276
59523
|
let classes;
|
|
59277
|
-
var
|
|
59524
|
+
var button_28 = sibling(button_27, 2);
|
|
59278
59525
|
let classes_1;
|
|
59279
|
-
var
|
|
59526
|
+
var button_29 = sibling(button_28, 2);
|
|
59280
59527
|
reset(div);
|
|
59281
|
-
var
|
|
59282
|
-
var
|
|
59528
|
+
var node_9 = sibling(div, 2);
|
|
59529
|
+
var consequent_17 = ($$anchor) => {
|
|
59283
59530
|
const item = /* @__PURE__ */ user_derived(() => get(hoveredItem));
|
|
59284
|
-
var
|
|
59285
|
-
var div_33 = child(div_32);
|
|
59531
|
+
var div_33 = root_28$1();
|
|
59286
59532
|
var div_34 = child(div_33);
|
|
59287
59533
|
var div_35 = child(div_34);
|
|
59288
59534
|
var div_36 = child(div_35);
|
|
59535
|
+
var div_37 = child(div_36);
|
|
59536
|
+
reset(div_36);
|
|
59289
59537
|
reset(div_35);
|
|
59290
|
-
|
|
59291
|
-
var
|
|
59292
|
-
var
|
|
59293
|
-
var
|
|
59294
|
-
var text_28 = child(span_14, true);
|
|
59538
|
+
var div_38 = sibling(div_35, 2);
|
|
59539
|
+
var div_39 = child(div_38);
|
|
59540
|
+
var span_14 = child(div_39);
|
|
59541
|
+
var text_32 = child(span_14, true);
|
|
59295
59542
|
reset(span_14);
|
|
59296
59543
|
var span_15 = sibling(span_14, 2);
|
|
59297
|
-
var
|
|
59544
|
+
var text_33 = child(span_15, true);
|
|
59298
59545
|
reset(span_15);
|
|
59299
|
-
reset(div_38);
|
|
59300
|
-
var div_39 = sibling(div_38, 2);
|
|
59301
|
-
var text_30 = child(div_39);
|
|
59302
59546
|
reset(div_39);
|
|
59303
|
-
|
|
59547
|
+
var div_40 = sibling(div_39, 2);
|
|
59548
|
+
var text_34 = child(div_40);
|
|
59549
|
+
reset(div_40);
|
|
59550
|
+
reset(div_38);
|
|
59551
|
+
reset(div_34);
|
|
59304
59552
|
reset(div_33);
|
|
59305
|
-
reset(div_32);
|
|
59306
59553
|
template_effect(() => {
|
|
59307
59554
|
var _$$get$x, _$$get$y, _$$get$color5, _$$get$color6, _ref, _categoryColors$$$get2, _$$get$width2, _$$get$depth2, _$$get$height;
|
|
59308
|
-
set_style(
|
|
59309
|
-
set_style(
|
|
59310
|
-
set_style(
|
|
59311
|
-
set_text(
|
|
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;`);
|
|
59556
|
+
set_style(div_36, `background-color: ${(_$$get$color5 = get(item).color) !== null && _$$get$color5 !== void 0 ? _$$get$color5 : ""}20`);
|
|
59557
|
+
set_style(div_37, `background-color: ${(_$$get$color6 = get(item).color) !== null && _$$get$color6 !== void 0 ? _$$get$color6 : ""}; opacity: 0.7`);
|
|
59558
|
+
set_text(text_32, get(item).name);
|
|
59312
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 : ""}`);
|
|
59313
|
-
set_text(
|
|
59314
|
-
set_text(
|
|
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`);
|
|
59315
59562
|
});
|
|
59316
|
-
append($$anchor,
|
|
59563
|
+
append($$anchor, div_33);
|
|
59317
59564
|
};
|
|
59318
|
-
if_block(
|
|
59319
|
-
if (get(showPreview) && get(hoveredItem)) $$render(
|
|
59565
|
+
if_block(node_9, ($$render) => {
|
|
59566
|
+
if (get(showPreview) && get(hoveredItem)) $$render(consequent_17);
|
|
59320
59567
|
});
|
|
59321
|
-
var
|
|
59322
|
-
var
|
|
59323
|
-
var
|
|
59324
|
-
var
|
|
59325
|
-
var
|
|
59326
|
-
var
|
|
59327
|
-
reset(
|
|
59328
|
-
var
|
|
59329
|
-
var label = child(
|
|
59568
|
+
var node_10 = sibling(node_9, 2);
|
|
59569
|
+
var consequent_18 = ($$anchor) => {
|
|
59570
|
+
var div_41 = root_29$1();
|
|
59571
|
+
var div_42 = child(div_41);
|
|
59572
|
+
var p_2 = sibling(child(div_42), 2);
|
|
59573
|
+
var text_35 = child(p_2, true);
|
|
59574
|
+
reset(p_2);
|
|
59575
|
+
var div_43 = sibling(p_2, 2);
|
|
59576
|
+
var label = child(div_43);
|
|
59330
59577
|
var input_2 = child(label);
|
|
59331
59578
|
remove_input_defaults(input_2);
|
|
59332
59579
|
next(2);
|
|
@@ -59334,53 +59581,53 @@ function BuildPanel($$anchor, $$props) {
|
|
|
59334
59581
|
var label_1 = sibling(label, 2);
|
|
59335
59582
|
var input_3 = child(label_1);
|
|
59336
59583
|
remove_input_defaults(input_3);
|
|
59337
|
-
var
|
|
59338
|
-
var
|
|
59339
|
-
var span_16 = sibling(child(
|
|
59340
|
-
var
|
|
59584
|
+
var div_44 = sibling(input_3, 2);
|
|
59585
|
+
var div_45 = child(div_44);
|
|
59586
|
+
var span_16 = sibling(child(div_45));
|
|
59587
|
+
var text_36 = child(span_16, true);
|
|
59341
59588
|
reset(span_16);
|
|
59342
|
-
reset(
|
|
59589
|
+
reset(div_45);
|
|
59343
59590
|
next(2);
|
|
59344
|
-
reset(
|
|
59591
|
+
reset(div_44);
|
|
59345
59592
|
reset(label_1);
|
|
59346
59593
|
var label_2 = sibling(label_1, 2);
|
|
59347
59594
|
var input_4 = sibling(child(label_2), 2);
|
|
59348
59595
|
remove_input_defaults(input_4);
|
|
59349
59596
|
reset(label_2);
|
|
59597
|
+
reset(div_43);
|
|
59598
|
+
var div_46 = sibling(div_43, 2);
|
|
59599
|
+
var button_30 = child(div_46);
|
|
59600
|
+
var button_31 = sibling(button_30, 2);
|
|
59601
|
+
reset(div_46);
|
|
59350
59602
|
reset(div_42);
|
|
59351
|
-
var div_45 = sibling(div_42, 2);
|
|
59352
|
-
var button_27 = child(div_45);
|
|
59353
|
-
var button_28 = sibling(button_27, 2);
|
|
59354
|
-
reset(div_45);
|
|
59355
59603
|
reset(div_41);
|
|
59356
|
-
reset(div_40);
|
|
59357
59604
|
template_effect(() => {
|
|
59358
|
-
set_text(
|
|
59359
|
-
set_text(
|
|
59605
|
+
set_text(text_35, get(importFileName));
|
|
59606
|
+
set_text(text_36, "v5");
|
|
59360
59607
|
});
|
|
59361
|
-
delegated("click",
|
|
59362
|
-
delegated("click",
|
|
59608
|
+
delegated("click", div_41, cancelImport);
|
|
59609
|
+
delegated("click", div_42, (e) => e.stopPropagation());
|
|
59363
59610
|
bind_checked(input_2, () => get(optStraighten), ($$value) => set(optStraighten, $$value));
|
|
59364
59611
|
bind_checked(input_3, () => get(optOrthogonal), ($$value) => set(optOrthogonal, $$value));
|
|
59365
59612
|
bind_value(input_4, () => get(optMergeDistance), ($$value) => set(optMergeDistance, $$value));
|
|
59366
|
-
delegated("click",
|
|
59367
|
-
delegated("click",
|
|
59368
|
-
append($$anchor,
|
|
59613
|
+
delegated("click", button_30, cancelImport);
|
|
59614
|
+
delegated("click", button_31, confirmImport);
|
|
59615
|
+
append($$anchor, div_41);
|
|
59369
59616
|
};
|
|
59370
|
-
if_block(
|
|
59371
|
-
if (get(showImportDialog)) $$render(
|
|
59617
|
+
if_block(node_10, ($$render) => {
|
|
59618
|
+
if (get(showImportDialog)) $$render(consequent_18);
|
|
59372
59619
|
});
|
|
59373
59620
|
template_effect(() => {
|
|
59374
59621
|
set_class(button, 1, `flex-1 py-2.5 text-xs font-semibold uppercase tracking-wide ${get(activeTab) === "draw" ? "text-slate-800 border-b-2 border-blue-500 bg-blue-50" : "text-gray-500 hover:text-gray-700"}`);
|
|
59375
59622
|
set_class(button_1, 1, `flex-1 py-2.5 text-xs font-semibold uppercase tracking-wide ${get(activeTab) === "rooms" ? "text-slate-800 border-b-2 border-blue-500 bg-blue-50" : "text-gray-500 hover:text-gray-700"}`);
|
|
59376
59623
|
set_class(button_2, 1, `flex-1 py-2.5 text-xs font-semibold uppercase tracking-wide ${get(activeTab) === "objects" ? "text-slate-800 border-b-2 border-blue-500 bg-blue-50" : "text-gray-500 hover:text-gray-700"}`);
|
|
59377
|
-
classes = set_class(
|
|
59624
|
+
classes = set_class(button_27, 1, "absolute bottom-4 left-14 w-8 h-8 rounded-full shadow-lg hover:bg-slate-600 transition-colors z-50 text-sm", null, classes, {
|
|
59378
59625
|
"bg-blue-600": showLayers(),
|
|
59379
59626
|
"text-white": showLayers(),
|
|
59380
59627
|
"bg-slate-700": !showLayers(),
|
|
59381
59628
|
"text-gray-300": !showLayers()
|
|
59382
59629
|
});
|
|
59383
|
-
classes_1 = set_class(
|
|
59630
|
+
classes_1 = set_class(button_28, 1, "absolute bottom-4 left-24 w-8 h-8 rounded-full shadow-lg hover:bg-slate-600 transition-colors z-50 text-sm", null, classes_1, {
|
|
59384
59631
|
"bg-blue-600": showUndoHistory(),
|
|
59385
59632
|
"text-white": showUndoHistory(),
|
|
59386
59633
|
"bg-slate-700": !showUndoHistory(),
|
|
@@ -59390,9 +59637,9 @@ function BuildPanel($$anchor, $$props) {
|
|
|
59390
59637
|
delegated("click", button, () => set(activeTab, "draw"));
|
|
59391
59638
|
delegated("click", button_1, () => set(activeTab, "rooms"));
|
|
59392
59639
|
delegated("click", button_2, () => set(activeTab, "objects"));
|
|
59393
|
-
delegated("click",
|
|
59394
|
-
delegated("click",
|
|
59395
|
-
delegated("click",
|
|
59640
|
+
delegated("click", button_27, () => showLayers(!showLayers()));
|
|
59641
|
+
delegated("click", button_28, () => showUndoHistory(!showUndoHistory()));
|
|
59642
|
+
delegated("click", button_29, () => showHelp(!showHelp()));
|
|
59396
59643
|
append($$anchor, fragment);
|
|
59397
59644
|
pop();
|
|
59398
59645
|
}
|
|
@@ -59765,20 +60012,23 @@ var root_13$1 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
|
59765
60012
|
var root_12$1 = /* @__PURE__ */ from_html(`<label class="block"><span class="text-xs text-gray-500">Camera</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm bg-white"><option>Select camera...</option><!></select></label>`);
|
|
59766
60013
|
var root_14$1 = /* @__PURE__ */ from_html(`<label class="block"><span class="text-xs text-gray-500"> </span> <input type="text"/></label>`);
|
|
59767
60014
|
var root_11$1 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
59768
|
-
var root_15
|
|
60015
|
+
var root_15 = /* @__PURE__ */ from_html(`<button></button>`);
|
|
59769
60016
|
var root_10$1 = /* @__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-purple-100 rounded flex items-center justify-center text-xs"> </span> <button> </button></h3> <div class="space-y-3"><!> <div><div class="flex items-center gap-1 mb-2"><span class="text-xs text-gray-500">Color</span> <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-gray-400"><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="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> <label class="block"><span class="text-xs text-gray-500"> </span> <input type="number" min="1" 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="1" 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="1" 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">Material</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"><option>Wood</option><option>Metal</option><option>Fabric</option><option>Leather</option><option>Glass</option><option>Plastic</option><option>Stone</option><option>Ceramic</option></select></label> <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> <div class="flex gap-1"><button class="flex-1 px-2 py-1.5 border border-gray-200 rounded text-sm hover:bg-gray-50 transition-colors" title="Rotate 90° left">↺ 90°</button> <button class="flex-1 px-2 py-1.5 border border-gray-200 rounded text-sm hover:bg-gray-50 transition-colors" title="Rotate 90° right">↻ 90°</button></div> <div class="flex gap-1"><button class="flex-1 px-2 py-1.5 border border-gray-200 rounded text-sm hover:bg-gray-50 transition-colors" title="Flip horizontally">↔ Flip H</button> <button class="flex-1 px-2 py-1.5 border border-gray-200 rounded text-sm hover:bg-gray-50 transition-colors" title="Flip vertically">↕ Flip V</button></div> <button class="w-full px-2 py-1.5 border border-gray-300 rounded text-sm text-gray-600 hover:bg-gray-50 transition-colors">Reset to defaults</button></div>`, 1);
|
|
59770
60017
|
var root_17$1 = /* @__PURE__ */ from_html(`<label class="block pb-3 border-b border-gray-200"><span class="text-xs text-gray-500"> </span> <input type="range" min="0.05" max="1" step="0.05" class="w-full"/></label>`);
|
|
59771
60018
|
var root_18$1 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
59772
60019
|
var root_19$1 = /* @__PURE__ */ from_html(`<button></button>`);
|
|
59773
60020
|
var root_22$1 = /* @__PURE__ */ from_html(`<button><div class="w-full h-12 rounded-md mb-1 overflow-hidden"></div> <div class="text-center leading-3 text-[10px] text-gray-600 truncate"> </div></button>`);
|
|
59774
60021
|
var root_20$1 = /* @__PURE__ */ from_html(`<div><span class="text-xs font-medium text-gray-600 mb-1.5 block"> </span> <div class="grid grid-cols-3 gap-1.5"></div></div>`);
|
|
59775
|
-
var root_16 = /* @__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-green-100 rounded flex items-center justify-center text-xs">⬜</span> Room Properties</h3> <div class="space-y-3"><!> <label class="block"><span class="text-xs text-gray-500">Room Type</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"></select></label> <label class="block"><span class="text-xs text-gray-500">Room Name</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">Category</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"><option>🏠 Indoor</option><option>🌳 Outdoor</option><option>🚗 Garage</option><option>🔧 Utility</option></select></label> <div><span class="text-xs text-gray-500">Area</span> <p class="text-sm text-gray-700"> </p></div> <div><span class="text-xs text-gray-500 mb-1.5 block">Room 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><div class="flex items-center gap-1 mb-2"><span class="text-xs text-gray-500">Floor Material</span> <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-gray-400"><path d="M3 3h18v18H3z"></path><path d="M8 8h8v8H8z"></path></svg></div> <div class="space-y-3"></div></div></div>`, 1);
|
|
60022
|
+
var root_16$1 = /* @__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-green-100 rounded flex items-center justify-center text-xs">⬜</span> Room Properties</h3> <div class="space-y-3"><!> <label class="block"><span class="text-xs text-gray-500">Room Type</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"></select></label> <label class="block"><span class="text-xs text-gray-500">Room Name</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">Category</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"><option>🏠 Indoor</option><option>🌳 Outdoor</option><option>🚗 Garage</option><option>🔧 Utility</option></select></label> <div><span class="text-xs text-gray-500">Area</span> <p class="text-sm text-gray-700"> </p></div> <div><span class="text-xs text-gray-500 mb-1.5 block">Room 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><div class="flex items-center gap-1 mb-2"><span class="text-xs text-gray-500">Floor Material</span> <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="text-gray-400"><path d="M3 3h18v18H3z"></path><path d="M8 8h8v8H8z"></path></svg></div> <div class="space-y-3"></div></div></div>`, 1);
|
|
59776
60023
|
var root_23$1 = /* @__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> Stair Properties</h3> <div class="space-y-3"><label class="block"><span class="text-xs text-gray-500">Type</span> <select class="w-full px-2 py-1 border border-gray-200 rounded text-sm"><option>Straight</option><option>L-Shaped</option><option>U-Shaped</option><option>Spiral</option></select></label> <label class="block"><span class="text-xs text-gray-500"> </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"> </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">Risers</span> <input type="number" min="3" max="30" 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">Direction</span> <div class="flex gap-2"><button>Up ↑</button> <button>Down ↓</button></div></label> <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></div>`, 1);
|
|
59777
60024
|
var root_25 = /* @__PURE__ */ from_html(`<button></button>`);
|
|
59778
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>`);
|
|
59779
|
-
var root_24
|
|
59780
|
-
var
|
|
59781
|
-
var
|
|
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);
|
|
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>`);
|
|
59782
60032
|
var root$3 = /* @__PURE__ */ from_html(`<div data-properties-panel="" style="top: 0; bottom: 0;"><!> <!></div>`);
|
|
59783
60033
|
function PropertiesPanel($$anchor, $$props) {
|
|
59784
60034
|
push($$props, true);
|
|
@@ -59846,29 +60096,33 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
59846
60096
|
var _$$get$textAnnotation, _$$get7;
|
|
59847
60097
|
return (_$$get$textAnnotation = (_$$get7 = get(floor)) === null || _$$get7 === void 0 || (_$$get7 = _$$get7.textAnnotations) === null || _$$get7 === void 0 ? void 0 : _$$get7.find((t) => t.id === get(selId))) !== null && _$$get$textAnnotation !== void 0 ? _$$get$textAnnotation : null;
|
|
59848
60098
|
});
|
|
60099
|
+
let selectedZone = /* @__PURE__ */ user_derived(() => {
|
|
60100
|
+
var _$$get$zones$find, _$$get8;
|
|
60101
|
+
return (_$$get$zones$find = (_$$get8 = get(floor)) === null || _$$get8 === void 0 || (_$$get8 = _$$get8.zones) === null || _$$get8 === void 0 ? void 0 : _$$get8.find((z) => z.id === get(selId))) !== null && _$$get$zones$find !== void 0 ? _$$get$zones$find : null;
|
|
60102
|
+
});
|
|
59849
60103
|
let hasBgImage = /* @__PURE__ */ user_derived(() => {
|
|
59850
|
-
var _$$
|
|
59851
|
-
return !!((_$$
|
|
60104
|
+
var _$$get9;
|
|
60105
|
+
return !!((_$$get9 = get(floor)) === null || _$$get9 === void 0 ? void 0 : _$$get9.backgroundImage);
|
|
59852
60106
|
});
|
|
59853
60107
|
let hasCameraThumbnailOverlay = /* @__PURE__ */ user_derived(() => {
|
|
59854
|
-
var _cameraThumbnail, _$$
|
|
59855
|
-
return !!((_cameraThumbnail = cameraThumbnail()) === null || _cameraThumbnail === void 0 ? void 0 : _cameraThumbnail.trim()) && !((_$$
|
|
60108
|
+
var _cameraThumbnail, _$$get10;
|
|
60109
|
+
return !!((_cameraThumbnail = cameraThumbnail()) === null || _cameraThumbnail === void 0 ? void 0 : _cameraThumbnail.trim()) && !((_$$get10 = get(floor)) === null || _$$get10 === void 0 ? void 0 : _$$get10.backgroundImage);
|
|
59856
60110
|
});
|
|
59857
60111
|
let thumbOpacity = /* @__PURE__ */ state(.65);
|
|
59858
60112
|
cameraThumbnailOpacity.subscribe((v) => {
|
|
59859
60113
|
set(thumbOpacity, v, true);
|
|
59860
60114
|
});
|
|
59861
60115
|
let selectedRoom = /* @__PURE__ */ user_derived(() => {
|
|
59862
|
-
var _ref, _$$get$rooms$find, _$$
|
|
59863
|
-
return (_ref = (_$$get$rooms$find = (_$$
|
|
60116
|
+
var _ref, _$$get$rooms$find, _$$get11;
|
|
60117
|
+
return (_ref = (_$$get$rooms$find = (_$$get11 = get(floor)) === null || _$$get11 === void 0 || (_$$get11 = _$$get11.rooms) === null || _$$get11 === void 0 ? void 0 : _$$get11.find((r) => r.id === get(selRoomId))) !== null && _$$get$rooms$find !== void 0 ? _$$get$rooms$find : get(detectedRooms).find((r) => r.id === get(selRoomId))) !== null && _ref !== void 0 ? _ref : null;
|
|
59864
60118
|
});
|
|
59865
60119
|
let selectedDoorWall = /* @__PURE__ */ user_derived(() => {
|
|
59866
|
-
var _ref2, _$$
|
|
59867
|
-
return (_ref2 = get(selectedDoor) && ((_$$
|
|
60120
|
+
var _ref2, _$$get12;
|
|
60121
|
+
return (_ref2 = get(selectedDoor) && ((_$$get12 = get(floor)) === null || _$$get12 === void 0 || (_$$get12 = _$$get12.walls) === null || _$$get12 === void 0 ? void 0 : _$$get12.find((w) => w.id === get(selectedDoor).wallId))) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
59868
60122
|
});
|
|
59869
60123
|
let selectedWindowWall = /* @__PURE__ */ user_derived(() => {
|
|
59870
|
-
var _ref3, _$$
|
|
59871
|
-
return (_ref3 = get(selectedWindow) && ((_$$
|
|
60124
|
+
var _ref3, _$$get13;
|
|
60125
|
+
return (_ref3 = get(selectedWindow) && ((_$$get13 = get(floor)) === null || _$$get13 === void 0 || (_$$get13 = _$$get13.walls) === null || _$$get13 === void 0 ? void 0 : _$$get13.find((w) => w.id === get(selectedWindow).wallId))) !== null && _ref3 !== void 0 ? _ref3 : null;
|
|
59872
60126
|
});
|
|
59873
60127
|
function calcWallLength(wall) {
|
|
59874
60128
|
if (wall.curvePoint) {
|
|
@@ -59961,12 +60215,10 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
59961
60215
|
const props = get(selectedFurniture).props;
|
|
59962
60216
|
if (props && Object.keys(props).length > 0) {
|
|
59963
60217
|
const keys = Object.keys(props);
|
|
60218
|
+
const rank = (k) => k === "serial" ? 0 : k === "name" ? 1 : k === "area" ? 2 : k === "areaColor" ? 3 : 10;
|
|
59964
60219
|
keys.sort((a, b) => {
|
|
59965
|
-
|
|
59966
|
-
|
|
59967
|
-
if (a === "name") return -1;
|
|
59968
|
-
if (b === "name") return 1;
|
|
59969
|
-
return a.localeCompare(b);
|
|
60220
|
+
const d = rank(a) - rank(b);
|
|
60221
|
+
return d !== 0 ? d : a.localeCompare(b);
|
|
59970
60222
|
});
|
|
59971
60223
|
return keys.map((key) => {
|
|
59972
60224
|
var _props$key;
|
|
@@ -59986,14 +60238,14 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
59986
60238
|
});
|
|
59987
60239
|
/** Host-assigned camera fields are read-only; package fields (color/size/…) stay editable. */
|
|
59988
60240
|
const cameraPropsLocked = /* @__PURE__ */ user_derived(() => {
|
|
59989
|
-
var _$$
|
|
59990
|
-
return !!(((_$$
|
|
60241
|
+
var _$$get14;
|
|
60242
|
+
return !!(((_$$get14 = get(selectedFurniture)) === null || _$$get14 === void 0 ? void 0 : _$$get14.catalogId) === "camera" && get(selectedFurniture).props && Object.keys(get(selectedFurniture).props).length > 0);
|
|
59991
60243
|
});
|
|
59992
60244
|
const useSiteCameraSelect = /* @__PURE__ */ user_derived(() => siteCameras().length > 0);
|
|
59993
60245
|
const usedCameraSerials = /* @__PURE__ */ user_derived(() => {
|
|
59994
|
-
var _$$
|
|
60246
|
+
var _$$get15;
|
|
59995
60247
|
const used = /* @__PURE__ */ new Set();
|
|
59996
|
-
if (!((_$$
|
|
60248
|
+
if (!((_$$get15 = get(floor)) === null || _$$get15 === void 0 ? void 0 : _$$get15.furniture) || !get(selectedFurniture)) return used;
|
|
59997
60249
|
for (const item of get(floor).furniture) {
|
|
59998
60250
|
if (item.catalogId !== "camera" || item.id === get(selectedFurniture).id) continue;
|
|
59999
60251
|
if (item.serial) used.add(item.serial);
|
|
@@ -60301,7 +60553,7 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
60301
60553
|
ids: ["carpet-beige", "carpet-gray"]
|
|
60302
60554
|
}
|
|
60303
60555
|
];
|
|
60304
|
-
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));
|
|
60305
60557
|
var div = root$3();
|
|
60306
60558
|
let classes;
|
|
60307
60559
|
var node = child(div);
|
|
@@ -60586,7 +60838,7 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
60586
60838
|
reset(label_11);
|
|
60587
60839
|
reset(div_11);
|
|
60588
60840
|
template_effect(($0, $1, $2, $3, $4, $5, $6, $7) => {
|
|
60589
|
-
var _$$
|
|
60841
|
+
var _$$get16, _$$get17, _$$get18, _$$get19;
|
|
60590
60842
|
set_text(text_6, `Width (${$0 !== null && $0 !== void 0 ? $0 : ""})`);
|
|
60591
60843
|
set_value(input_5, $1);
|
|
60592
60844
|
set_text(text_7, `Distance from A (${$2 !== null && $2 !== void 0 ? $2 : ""})`);
|
|
@@ -60599,10 +60851,10 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
60599
60851
|
var _select$__value;
|
|
60600
60852
|
select.value = (_select$__value = select.__value = get(selectedDoor).type) !== null && _select$__value !== void 0 ? _select$__value : "", select_option(select, get(selectedDoor).type);
|
|
60601
60853
|
}
|
|
60602
|
-
set_class(button_9, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$
|
|
60603
|
-
set_class(button_10, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$
|
|
60604
|
-
set_class(button_11, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${!((_$$
|
|
60605
|
-
set_class(button_12, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$
|
|
60854
|
+
set_class(button_9, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$get16 = get(selectedDoor)) === null || _$$get16 === void 0 ? void 0 : _$$get16.swingDirection) === "left" ? "bg-blue-100 border-blue-400 text-blue-700" : "border-gray-200 hover:bg-gray-50"}`);
|
|
60855
|
+
set_class(button_10, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$get17 = get(selectedDoor)) === null || _$$get17 === void 0 ? void 0 : _$$get17.swingDirection) === "right" ? "bg-blue-100 border-blue-400 text-blue-700" : "border-gray-200 hover:bg-gray-50"}`);
|
|
60856
|
+
set_class(button_11, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${!((_$$get18 = get(selectedDoor)) === null || _$$get18 === void 0 ? void 0 : _$$get18.flipSide) ? "bg-blue-100 border-blue-400 text-blue-700" : "border-gray-200 hover:bg-gray-50"}`);
|
|
60857
|
+
set_class(button_12, 1, `flex-1 px-2 py-1.5 border rounded text-sm transition-colors ${((_$$get19 = get(selectedDoor)) === null || _$$get19 === void 0 ? void 0 : _$$get19.flipSide) ? "bg-blue-100 border-blue-400 text-blue-700" : "border-gray-200 hover:bg-gray-50"}`);
|
|
60606
60858
|
}, [
|
|
60607
60859
|
() => unitLabel(),
|
|
60608
60860
|
() => displayValue(get(selectedDoor).width),
|
|
@@ -60807,7 +61059,7 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
60807
61059
|
"#dc143c",
|
|
60808
61060
|
"#228b22"
|
|
60809
61061
|
], index$1, ($$anchor, color) => {
|
|
60810
|
-
var button_14 = root_15
|
|
61062
|
+
var button_14 = root_15();
|
|
60811
61063
|
template_effect(($0) => {
|
|
60812
61064
|
set_class(button_14, 1, `w-6 h-6 rounded border-2 hover:border-gray-300 transition-colors ${$0 !== null && $0 !== void 0 ? $0 : ""}`);
|
|
60813
61065
|
set_style(button_14, `background-color: ${color !== null && color !== void 0 ? color : ""}`);
|
|
@@ -60970,7 +61222,7 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
60970
61222
|
append($$anchor, fragment_3);
|
|
60971
61223
|
};
|
|
60972
61224
|
var consequent_9 = ($$anchor) => {
|
|
60973
|
-
var fragment_5 = root_16();
|
|
61225
|
+
var fragment_5 = root_16$1();
|
|
60974
61226
|
var div_21 = sibling(first_child(fragment_5), 2);
|
|
60975
61227
|
var node_8 = child(div_21);
|
|
60976
61228
|
var consequent_7 = ($$anchor) => {
|
|
@@ -61200,7 +61452,7 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
61200
61452
|
append($$anchor, fragment_7);
|
|
61201
61453
|
};
|
|
61202
61454
|
var consequent_12 = ($$anchor) => {
|
|
61203
|
-
var fragment_8 = root_24
|
|
61455
|
+
var fragment_8 = root_24();
|
|
61204
61456
|
var div_34 = sibling(first_child(fragment_8), 2);
|
|
61205
61457
|
var label_35 = child(div_34);
|
|
61206
61458
|
var div_35 = sibling(child(label_35), 2);
|
|
@@ -61276,26 +61528,72 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
61276
61528
|
delegated("input", input_29, (e) => updateColumn(get(selectedColumn).id, { color: e.target.value }));
|
|
61277
61529
|
append($$anchor, fragment_8);
|
|
61278
61530
|
};
|
|
61279
|
-
var
|
|
61531
|
+
var consequent_14 = ($$anchor) => {
|
|
61280
61532
|
var div_39 = root_27();
|
|
61281
|
-
var
|
|
61533
|
+
var h3_1 = child(div_39);
|
|
61534
|
+
var span_25 = child(h3_1);
|
|
61535
|
+
next();
|
|
61536
|
+
reset(h3_1);
|
|
61537
|
+
var label_39 = sibling(h3_1, 2);
|
|
61282
61538
|
var input_31 = sibling(child(label_39), 2);
|
|
61283
61539
|
remove_input_defaults(input_31);
|
|
61284
61540
|
reset(label_39);
|
|
61285
|
-
var
|
|
61286
|
-
var
|
|
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();
|
|
61564
|
+
template_effect(() => {
|
|
61565
|
+
var _$$get20;
|
|
61566
|
+
set_class(button_27, 1, `w-6 h-6 rounded border-2 ${get(selectedZone).color === get(c) ? "border-slate-800" : "border-transparent"}`);
|
|
61567
|
+
set_style(button_27, `background:${(_$$get20 = get(c)) !== null && _$$get20 !== void 0 ? _$$get20 : ""}`);
|
|
61568
|
+
});
|
|
61569
|
+
delegated("click", button_27, () => updateZone(get(selectedZone).id, { color: get(c) }));
|
|
61570
|
+
append($$anchor, button_27);
|
|
61571
|
+
});
|
|
61572
|
+
var input_32 = sibling(node_12, 2);
|
|
61287
61573
|
remove_input_defaults(input_32);
|
|
61574
|
+
reset(div_42);
|
|
61288
61575
|
reset(label_40);
|
|
61289
61576
|
var label_41 = sibling(label_40, 2);
|
|
61290
|
-
var
|
|
61291
|
-
var input_33 = child(div_40);
|
|
61577
|
+
var input_33 = sibling(child(label_41), 2);
|
|
61292
61578
|
remove_input_defaults(input_33);
|
|
61293
|
-
var span_25 = sibling(input_33, 2);
|
|
61294
|
-
var text_32 = child(span_25, true);
|
|
61295
|
-
reset(span_25);
|
|
61296
|
-
reset(div_40);
|
|
61297
61579
|
reset(label_41);
|
|
61298
|
-
|
|
61580
|
+
reset(div_39);
|
|
61581
|
+
template_effect(() => {
|
|
61582
|
+
var _$$get$color8, _$$get$color9, _$$get$fillOpacity;
|
|
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 : ""}`);
|
|
61584
|
+
set_value(input_31, get(selectedZone).name);
|
|
61585
|
+
set_text(text_33, get(selectedZone).shape);
|
|
61586
|
+
set_value(input_32, get(selectedZone).color);
|
|
61587
|
+
set_value(input_33, (_$$get$fillOpacity = get(selectedZone).fillOpacity) !== null && _$$get$fillOpacity !== void 0 ? _$$get$fillOpacity : .1);
|
|
61588
|
+
});
|
|
61589
|
+
delegated("input", input_31, (e) => updateZone(get(selectedZone).id, { name: e.target.value }));
|
|
61590
|
+
delegated("input", input_32, (e) => updateZone(get(selectedZone).id, { color: e.target.value }));
|
|
61591
|
+
delegated("input", input_33, (e) => updateZone(get(selectedZone).id, { fillOpacity: Number(e.target.value) }));
|
|
61592
|
+
append($$anchor, div_39);
|
|
61593
|
+
};
|
|
61594
|
+
var consequent_15 = ($$anchor) => {
|
|
61595
|
+
var div_43 = root_30();
|
|
61596
|
+
var label_42 = sibling(child(div_43), 2);
|
|
61299
61597
|
var input_34 = sibling(child(label_42), 2);
|
|
61300
61598
|
remove_input_defaults(input_34);
|
|
61301
61599
|
reset(label_42);
|
|
@@ -61304,42 +61602,15 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
61304
61602
|
remove_input_defaults(input_35);
|
|
61305
61603
|
reset(label_43);
|
|
61306
61604
|
var label_44 = sibling(label_43, 2);
|
|
61307
|
-
var
|
|
61605
|
+
var div_44 = sibling(child(label_44), 2);
|
|
61606
|
+
var input_36 = child(div_44);
|
|
61308
61607
|
remove_input_defaults(input_36);
|
|
61608
|
+
var span_28 = sibling(input_36, 2);
|
|
61609
|
+
var text_34 = child(span_28, true);
|
|
61610
|
+
reset(span_28);
|
|
61611
|
+
reset(div_44);
|
|
61309
61612
|
reset(label_44);
|
|
61310
|
-
|
|
61311
|
-
template_effect(($0, $1) => {
|
|
61312
|
-
set_value(input_31, get(selectedTextAnnotation).text);
|
|
61313
|
-
set_value(input_32, get(selectedTextAnnotation).fontSize);
|
|
61314
|
-
set_value(input_33, get(selectedTextAnnotation).color);
|
|
61315
|
-
set_text(text_32, get(selectedTextAnnotation).color);
|
|
61316
|
-
set_value(input_34, get(selectedTextAnnotation).rotation);
|
|
61317
|
-
set_value(input_35, $0);
|
|
61318
|
-
set_value(input_36, $1);
|
|
61319
|
-
}, [() => Math.round(get(selectedTextAnnotation).x), () => Math.round(get(selectedTextAnnotation).y)]);
|
|
61320
|
-
delegated("input", input_31, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { text: e.target.value }));
|
|
61321
|
-
delegated("input", input_32, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { fontSize: Number(e.target.value) }));
|
|
61322
|
-
delegated("input", input_33, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { color: e.target.value }));
|
|
61323
|
-
delegated("input", input_34, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { rotation: Number(e.target.value) }));
|
|
61324
|
-
delegated("input", input_35, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { x: Number(e.target.value) }));
|
|
61325
|
-
delegated("input", input_36, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { y: Number(e.target.value) }));
|
|
61326
|
-
append($$anchor, div_39);
|
|
61327
|
-
};
|
|
61328
|
-
if_block(node, ($$render) => {
|
|
61329
|
-
if (get(selectedWall)) $$render(consequent_1);
|
|
61330
|
-
else if (get(selectedDoor)) $$render(consequent_2, 1);
|
|
61331
|
-
else if (get(selectedWindow)) $$render(consequent_3, 2);
|
|
61332
|
-
else if (get(selectedFurniture)) $$render(consequent_6, 3);
|
|
61333
|
-
else if (get(selectedRoom)) $$render(consequent_9, 4);
|
|
61334
|
-
else if (get(selectedStair)) $$render(consequent_10, 5);
|
|
61335
|
-
else if (get(selectedColumn)) $$render(consequent_12, 6);
|
|
61336
|
-
else if (get(selectedTextAnnotation)) $$render(consequent_13, 7);
|
|
61337
|
-
});
|
|
61338
|
-
var node_11 = sibling(node, 2);
|
|
61339
|
-
var consequent_14 = ($$anchor) => {
|
|
61340
|
-
var div_41 = root_28();
|
|
61341
|
-
var div_42 = sibling(child(div_41), 2);
|
|
61342
|
-
var label_45 = child(div_42);
|
|
61613
|
+
var label_45 = sibling(label_44, 2);
|
|
61343
61614
|
var input_37 = sibling(child(label_45), 2);
|
|
61344
61615
|
remove_input_defaults(input_37);
|
|
61345
61616
|
reset(label_45);
|
|
@@ -61351,36 +61622,81 @@ function PropertiesPanel($$anchor, $$props) {
|
|
|
61351
61622
|
var input_39 = sibling(child(label_47), 2);
|
|
61352
61623
|
remove_input_defaults(input_39);
|
|
61353
61624
|
reset(label_47);
|
|
61354
|
-
var div_43 = sibling(label_47, 2);
|
|
61355
|
-
var button_27 = child(div_43);
|
|
61356
|
-
var text_33 = child(button_27, true);
|
|
61357
|
-
reset(button_27);
|
|
61358
|
-
var button_28 = sibling(button_27, 2);
|
|
61359
61625
|
reset(div_43);
|
|
61360
|
-
|
|
61361
|
-
|
|
61362
|
-
|
|
61626
|
+
template_effect(($0, $1) => {
|
|
61627
|
+
set_value(input_34, get(selectedTextAnnotation).text);
|
|
61628
|
+
set_value(input_35, get(selectedTextAnnotation).fontSize);
|
|
61629
|
+
set_value(input_36, get(selectedTextAnnotation).color);
|
|
61630
|
+
set_text(text_34, get(selectedTextAnnotation).color);
|
|
61631
|
+
set_value(input_37, get(selectedTextAnnotation).rotation);
|
|
61632
|
+
set_value(input_38, $0);
|
|
61633
|
+
set_value(input_39, $1);
|
|
61634
|
+
}, [() => Math.round(get(selectedTextAnnotation).x), () => Math.round(get(selectedTextAnnotation).y)]);
|
|
61635
|
+
delegated("input", input_34, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { text: e.target.value }));
|
|
61636
|
+
delegated("input", input_35, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { fontSize: Number(e.target.value) }));
|
|
61637
|
+
delegated("input", input_36, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { color: e.target.value }));
|
|
61638
|
+
delegated("input", input_37, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { rotation: Number(e.target.value) }));
|
|
61639
|
+
delegated("input", input_38, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { x: Number(e.target.value) }));
|
|
61640
|
+
delegated("input", input_39, (e) => updateTextAnnotation(get(selectedTextAnnotation).id, { y: Number(e.target.value) }));
|
|
61641
|
+
append($$anchor, div_43);
|
|
61642
|
+
};
|
|
61643
|
+
if_block(node, ($$render) => {
|
|
61644
|
+
if (get(selectedWall)) $$render(consequent_1);
|
|
61645
|
+
else if (get(selectedDoor)) $$render(consequent_2, 1);
|
|
61646
|
+
else if (get(selectedWindow)) $$render(consequent_3, 2);
|
|
61647
|
+
else if (get(selectedFurniture)) $$render(consequent_6, 3);
|
|
61648
|
+
else if (get(selectedRoom)) $$render(consequent_9, 4);
|
|
61649
|
+
else if (get(selectedStair)) $$render(consequent_10, 5);
|
|
61650
|
+
else if (get(selectedColumn)) $$render(consequent_12, 6);
|
|
61651
|
+
else if (get(selectedZone)) $$render(consequent_14, 7);
|
|
61652
|
+
else if (get(selectedTextAnnotation)) $$render(consequent_15, 8);
|
|
61653
|
+
});
|
|
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);
|
|
61659
|
+
var input_40 = sibling(child(label_48), 2);
|
|
61660
|
+
remove_input_defaults(input_40);
|
|
61661
|
+
reset(label_48);
|
|
61662
|
+
var label_49 = sibling(label_48, 2);
|
|
61663
|
+
var input_41 = sibling(child(label_49), 2);
|
|
61664
|
+
remove_input_defaults(input_41);
|
|
61665
|
+
reset(label_49);
|
|
61666
|
+
var label_50 = sibling(label_49, 2);
|
|
61667
|
+
var input_42 = sibling(child(label_50), 2);
|
|
61668
|
+
remove_input_defaults(input_42);
|
|
61669
|
+
reset(label_50);
|
|
61670
|
+
var div_47 = sibling(label_50, 2);
|
|
61671
|
+
var button_28 = child(div_47);
|
|
61672
|
+
var text_35 = child(button_28, true);
|
|
61673
|
+
reset(button_28);
|
|
61674
|
+
var button_29 = sibling(button_28, 2);
|
|
61675
|
+
reset(div_47);
|
|
61676
|
+
var button_30 = sibling(div_47, 2);
|
|
61677
|
+
reset(div_46);
|
|
61678
|
+
reset(div_45);
|
|
61363
61679
|
template_effect(() => {
|
|
61364
|
-
set_value(
|
|
61365
|
-
set_value(
|
|
61366
|
-
set_value(
|
|
61367
|
-
set_class(
|
|
61368
|
-
set_text(
|
|
61680
|
+
set_value(input_40, get(floor).backgroundImage.opacity);
|
|
61681
|
+
set_value(input_41, get(floor).backgroundImage.scale);
|
|
61682
|
+
set_value(input_42, get(floor).backgroundImage.rotation);
|
|
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"}`);
|
|
61684
|
+
set_text(text_35, get(floor).backgroundImage.locked ? "🔒 Locked" : "🔓 Unlocked");
|
|
61369
61685
|
});
|
|
61370
|
-
delegated("input",
|
|
61371
|
-
delegated("input",
|
|
61372
|
-
delegated("input",
|
|
61373
|
-
delegated("click",
|
|
61374
|
-
delegated("click",
|
|
61686
|
+
delegated("input", input_40, (e) => updateBackgroundImage({ opacity: Number(e.target.value) }));
|
|
61687
|
+
delegated("input", input_41, (e) => updateBackgroundImage({ scale: Number(e.target.value) }));
|
|
61688
|
+
delegated("input", input_42, (e) => updateBackgroundImage({ rotation: Number(e.target.value) }));
|
|
61689
|
+
delegated("click", button_28, () => updateBackgroundImage({ locked: !get(floor).backgroundImage.locked }));
|
|
61690
|
+
delegated("click", button_29, () => {
|
|
61375
61691
|
calibrationPoints.set([]);
|
|
61376
61692
|
calibrationMode.set(true);
|
|
61377
61693
|
});
|
|
61378
|
-
delegated("click",
|
|
61379
|
-
append($$anchor,
|
|
61694
|
+
delegated("click", button_30, () => setBackgroundImage(void 0));
|
|
61695
|
+
append($$anchor, div_45);
|
|
61380
61696
|
};
|
|
61381
|
-
if_block(
|
|
61382
|
-
var _$$
|
|
61383
|
-
if (get(hasBgImage) && ((_$$
|
|
61697
|
+
if_block(node_13, ($$render) => {
|
|
61698
|
+
var _$$get21;
|
|
61699
|
+
if (get(hasBgImage) && ((_$$get21 = get(floor)) === null || _$$get21 === void 0 ? void 0 : _$$get21.backgroundImage)) $$render(consequent_16);
|
|
61384
61700
|
});
|
|
61385
61701
|
reset(div);
|
|
61386
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) }));
|
|
@@ -61424,10 +61740,14 @@ function LayersPanel($$anchor, $$props) {
|
|
|
61424
61740
|
columns: true,
|
|
61425
61741
|
guides: true,
|
|
61426
61742
|
measurements: true,
|
|
61427
|
-
annotations: true
|
|
61743
|
+
annotations: true,
|
|
61744
|
+
zones: true
|
|
61428
61745
|
}));
|
|
61429
61746
|
layerVisibility.subscribe((v) => {
|
|
61430
|
-
set(vis,
|
|
61747
|
+
set(vis, {
|
|
61748
|
+
zones: true,
|
|
61749
|
+
...v
|
|
61750
|
+
}, true);
|
|
61431
61751
|
});
|
|
61432
61752
|
let collapsed = proxy({});
|
|
61433
61753
|
function toggle(cat) {
|
|
@@ -61443,7 +61763,7 @@ function LayersPanel($$anchor, $$props) {
|
|
|
61443
61763
|
selectedElementId.set(id);
|
|
61444
61764
|
}
|
|
61445
61765
|
let categories = /* @__PURE__ */ user_derived(() => {
|
|
61446
|
-
var _$$get$stairs, _$$get$columns, _$$get$guides, _$$get$measurements, _$$get$annotations;
|
|
61766
|
+
var _$$get$stairs, _$$get$columns, _$$get$zones, _$$get$guides, _$$get$measurements, _$$get$annotations;
|
|
61447
61767
|
if (!get(floor)) return [];
|
|
61448
61768
|
const cats = [];
|
|
61449
61769
|
cats.push({
|
|
@@ -61510,6 +61830,16 @@ function LayersPanel($$anchor, $$props) {
|
|
|
61510
61830
|
icon: "🏛️"
|
|
61511
61831
|
}))
|
|
61512
61832
|
});
|
|
61833
|
+
if ((_$$get$zones = get(floor).zones) === null || _$$get$zones === void 0 ? void 0 : _$$get$zones.length) cats.push({
|
|
61834
|
+
key: "zones",
|
|
61835
|
+
label: "Areas",
|
|
61836
|
+
icon: "⬡",
|
|
61837
|
+
items: get(floor).zones.map((z) => ({
|
|
61838
|
+
id: z.id,
|
|
61839
|
+
label: z.name || z.shape,
|
|
61840
|
+
icon: "⬡"
|
|
61841
|
+
}))
|
|
61842
|
+
});
|
|
61513
61843
|
if ((_$$get$guides = get(floor).guides) === null || _$$get$guides === void 0 ? void 0 : _$$get$guides.length) cats.push({
|
|
61514
61844
|
key: "guides",
|
|
61515
61845
|
label: "Guides",
|
|
@@ -64456,6 +64786,120 @@ function drawTextAnnotations(cs, floor, selectedTextAnnotationId, currentSelecte
|
|
|
64456
64786
|
ctx.restore();
|
|
64457
64787
|
}
|
|
64458
64788
|
}
|
|
64789
|
+
function hexToRgba(hex, alpha) {
|
|
64790
|
+
const c = hex.trim();
|
|
64791
|
+
const short = c.match(/^#([0-9a-f]{3})$/i);
|
|
64792
|
+
let h = c;
|
|
64793
|
+
if (short) {
|
|
64794
|
+
const s = short[1];
|
|
64795
|
+
h = `#${s[0]}${s[0]}${s[1]}${s[1]}${s[2]}${s[2]}`;
|
|
64796
|
+
}
|
|
64797
|
+
const m = h.match(/^#([0-9a-f]{6})$/i);
|
|
64798
|
+
if (!m) return `rgba(249, 115, 22, ${alpha})`;
|
|
64799
|
+
const n = parseInt(m[1], 16);
|
|
64800
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alpha})`;
|
|
64801
|
+
}
|
|
64802
|
+
function pathZonePolygon(ctx, cs, points) {
|
|
64803
|
+
if (points.length < 2) return;
|
|
64804
|
+
const first = wts(cs, points[0].x, points[0].y);
|
|
64805
|
+
ctx.moveTo(first.x, first.y);
|
|
64806
|
+
for (let i = 1; i < points.length; i++) {
|
|
64807
|
+
const s = wts(cs, points[i].x, points[i].y);
|
|
64808
|
+
ctx.lineTo(s.x, s.y);
|
|
64809
|
+
}
|
|
64810
|
+
ctx.closePath();
|
|
64811
|
+
}
|
|
64812
|
+
function drawZoneShape(cs, zone, selected) {
|
|
64813
|
+
const pts = zone.points;
|
|
64814
|
+
if (!pts || pts.length < 2) return;
|
|
64815
|
+
const { ctx, zoom } = cs;
|
|
64816
|
+
const color = zone.color || "#F97316";
|
|
64817
|
+
const fillA = typeof zone.fillOpacity === "number" ? zone.fillOpacity : DEFAULT_ZONE_FILL_OPACITY;
|
|
64818
|
+
ctx.save();
|
|
64819
|
+
ctx.beginPath();
|
|
64820
|
+
pathZonePolygon(ctx, cs, pts);
|
|
64821
|
+
ctx.fillStyle = hexToRgba(color, fillA);
|
|
64822
|
+
ctx.fill();
|
|
64823
|
+
ctx.setLineDash([8 * Math.max(.6, zoom), 6 * Math.max(.6, zoom)]);
|
|
64824
|
+
ctx.strokeStyle = color;
|
|
64825
|
+
ctx.lineWidth = selected ? 2.5 : 1.75;
|
|
64826
|
+
ctx.lineJoin = "round";
|
|
64827
|
+
ctx.stroke();
|
|
64828
|
+
ctx.setLineDash([]);
|
|
64829
|
+
const b = zoneBounds(pts);
|
|
64830
|
+
if (b && zone.name) {
|
|
64831
|
+
const pad = 6;
|
|
64832
|
+
const labelPos = wts(cs, b.minX, b.minY);
|
|
64833
|
+
const fontSize = Math.max(11, 12 * Math.min(1.2, Math.max(.75, zoom)));
|
|
64834
|
+
ctx.font = `600 ${fontSize}px system-ui, sans-serif`;
|
|
64835
|
+
ctx.textAlign = "left";
|
|
64836
|
+
ctx.textBaseline = "top";
|
|
64837
|
+
const tw = ctx.measureText(zone.name).width;
|
|
64838
|
+
const bx = labelPos.x + pad;
|
|
64839
|
+
const by = labelPos.y + pad;
|
|
64840
|
+
const bw = tw + 12;
|
|
64841
|
+
const bh = fontSize + 8;
|
|
64842
|
+
ctx.fillStyle = hexToRgba(color, .22);
|
|
64843
|
+
ctx.beginPath();
|
|
64844
|
+
ctx.roundRect(bx, by, bw, bh, 4);
|
|
64845
|
+
ctx.fill();
|
|
64846
|
+
ctx.fillStyle = color;
|
|
64847
|
+
ctx.fillText(zone.name, bx + 6, by + 4);
|
|
64848
|
+
}
|
|
64849
|
+
if (selected) for (const p of pts) {
|
|
64850
|
+
const s = wts(cs, p.x, p.y);
|
|
64851
|
+
ctx.fillStyle = "#ffffff";
|
|
64852
|
+
ctx.strokeStyle = color;
|
|
64853
|
+
ctx.lineWidth = 1.5;
|
|
64854
|
+
ctx.beginPath();
|
|
64855
|
+
ctx.arc(s.x, s.y, 5, 0, Math.PI * 2);
|
|
64856
|
+
ctx.fill();
|
|
64857
|
+
ctx.stroke();
|
|
64858
|
+
}
|
|
64859
|
+
ctx.restore();
|
|
64860
|
+
}
|
|
64861
|
+
function drawZones(cs, floor, selectedZoneId) {
|
|
64862
|
+
var _floor$zones;
|
|
64863
|
+
if (!((_floor$zones = floor.zones) === null || _floor$zones === void 0 ? void 0 : _floor$zones.length)) return;
|
|
64864
|
+
for (const z of floor.zones) drawZoneShape(cs, z, z.id === selectedZoneId);
|
|
64865
|
+
}
|
|
64866
|
+
/** Preview while drawing polygon / dragging rect. */
|
|
64867
|
+
function drawZoneDraft(cs, points, color, closed, cursor) {
|
|
64868
|
+
if (!points.length && !cursor) return;
|
|
64869
|
+
const { ctx, zoom } = cs;
|
|
64870
|
+
const pts = [...points];
|
|
64871
|
+
if (cursor) pts.push(cursor);
|
|
64872
|
+
ctx.save();
|
|
64873
|
+
ctx.strokeStyle = color;
|
|
64874
|
+
ctx.fillStyle = hexToRgba(color, .08);
|
|
64875
|
+
ctx.lineWidth = 1.5;
|
|
64876
|
+
ctx.setLineDash([6 * Math.max(.6, zoom), 4 * Math.max(.6, zoom)]);
|
|
64877
|
+
if (pts.length >= 2) {
|
|
64878
|
+
ctx.beginPath();
|
|
64879
|
+
const first = wts(cs, pts[0].x, pts[0].y);
|
|
64880
|
+
ctx.moveTo(first.x, first.y);
|
|
64881
|
+
for (let i = 1; i < pts.length; i++) {
|
|
64882
|
+
const s = wts(cs, pts[i].x, pts[i].y);
|
|
64883
|
+
ctx.lineTo(s.x, s.y);
|
|
64884
|
+
}
|
|
64885
|
+
if (closed && pts.length >= 3) {
|
|
64886
|
+
ctx.closePath();
|
|
64887
|
+
ctx.fill();
|
|
64888
|
+
}
|
|
64889
|
+
ctx.stroke();
|
|
64890
|
+
}
|
|
64891
|
+
for (const p of points) {
|
|
64892
|
+
const s = wts(cs, p.x, p.y);
|
|
64893
|
+
ctx.setLineDash([]);
|
|
64894
|
+
ctx.fillStyle = "#fff";
|
|
64895
|
+
ctx.strokeStyle = color;
|
|
64896
|
+
ctx.beginPath();
|
|
64897
|
+
ctx.arc(s.x, s.y, 4, 0, Math.PI * 2);
|
|
64898
|
+
ctx.fill();
|
|
64899
|
+
ctx.stroke();
|
|
64900
|
+
}
|
|
64901
|
+
ctx.restore();
|
|
64902
|
+
}
|
|
64459
64903
|
function drawAnnotation(cs, a, selected, dimSettings) {
|
|
64460
64904
|
const { ctx, zoom } = cs;
|
|
64461
64905
|
const offset = a.offset || 40;
|
|
@@ -65215,35 +65659,59 @@ function hitTestTextAnnotation(wp, floor, ctx, zoom) {
|
|
|
65215
65659
|
}
|
|
65216
65660
|
return null;
|
|
65217
65661
|
}
|
|
65662
|
+
/** Hit zone vertex; returns index or -1. */
|
|
65663
|
+
function findZoneVertexAt(wp, zone, zoom) {
|
|
65664
|
+
const threshold = 10 / zoom;
|
|
65665
|
+
for (let i = 0; i < zone.points.length; i++) {
|
|
65666
|
+
const p = zone.points[i];
|
|
65667
|
+
if (Math.hypot(wp.x - p.x, wp.y - p.y) <= threshold) return i;
|
|
65668
|
+
}
|
|
65669
|
+
return -1;
|
|
65670
|
+
}
|
|
65671
|
+
/** Top-most zone under point (fill or near edge). */
|
|
65672
|
+
function findZoneAt(wp, zones, zoom) {
|
|
65673
|
+
if (!(zones === null || zones === void 0 ? void 0 : zones.length)) return null;
|
|
65674
|
+
const edgeTol = 8 / zoom;
|
|
65675
|
+
for (let i = zones.length - 1; i >= 0; i--) {
|
|
65676
|
+
const z = zones[i];
|
|
65677
|
+
if (!z.points || z.points.length < 2) continue;
|
|
65678
|
+
if (pointInPolygon(wp, z.points)) return z;
|
|
65679
|
+
for (let j = 0; j < z.points.length; j++) {
|
|
65680
|
+
const a = z.points[j];
|
|
65681
|
+
const b = z.points[(j + 1) % z.points.length];
|
|
65682
|
+
if (pointToSegmentDist(wp, a, b) <= edgeTol) return z;
|
|
65683
|
+
}
|
|
65684
|
+
}
|
|
65685
|
+
return null;
|
|
65686
|
+
}
|
|
65218
65687
|
//#endregion
|
|
65219
65688
|
//#region src/lib/components/editor/FloorPlanCanvas.svelte
|
|
65220
65689
|
init_client();
|
|
65221
65690
|
init_index_client();
|
|
65222
|
-
var
|
|
65691
|
+
var root_2$4 = /* @__PURE__ */ from_html(`<input type="text" class="absolute bg-white border-2 border-blue-500 rounded px-2 py-1 text-sm text-center shadow-lg outline-none"/>`);
|
|
65223
65692
|
var root_3$3 = /* @__PURE__ */ from_html(`<input type="text" class="absolute bg-white border-2 border-blue-500 rounded px-2 py-1 text-sm text-center shadow-lg outline-none"/>`);
|
|
65224
|
-
var root_4$2 = /* @__PURE__ */ from_html(`<
|
|
65225
|
-
var root_5 = /* @__PURE__ */ from_html(`<
|
|
65226
|
-
var
|
|
65227
|
-
var
|
|
65693
|
+
var root_4$2 = /* @__PURE__ */ from_html(`<div class="absolute inset-0 flex items-center justify-center pointer-events-none"><div class="text-center opacity-60"><div class="text-5xl mb-3">🏠</div> <div class="text-sm font-medium text-gray-500">Start building your floor plan</div> <div class="text-xs text-gray-400 mt-1">Draw walls with <span class="font-mono bg-gray-100 px-1 rounded">W</span> or drag items from the sidebar</div></div></div>`);
|
|
65694
|
+
var root_5 = /* @__PURE__ */ from_html(`<canvas width="180" height="120" class="absolute bottom-10 right-2 rounded-lg shadow-lg border border-gray-300 cursor-crosshair bg-white" style="z-index: 15;"></canvas>`);
|
|
65695
|
+
var root_7$1 = /* @__PURE__ */ from_html(`<span> </span> <span> </span> <span class="text-gray-300">|</span>`, 1);
|
|
65696
|
+
var root_9 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
65228
65697
|
var root_10 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
65229
65698
|
var root_11 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
65230
|
-
var
|
|
65231
|
-
var
|
|
65232
|
-
var
|
|
65233
|
-
var
|
|
65234
|
-
var
|
|
65235
|
-
var
|
|
65236
|
-
var root_18 = /* @__PURE__ */ from_html(`<button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500 hover:text-gray-700" title="
|
|
65237
|
-
var
|
|
65238
|
-
var
|
|
65239
|
-
var root_20 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-blue-600 text-white px-3 py-1 rounded-full text-xs shadow">Click to add wall segment · Double-click to finish · C to close loop ·
|
|
65699
|
+
var root_8 = /* @__PURE__ */ from_html(`<span> </span> <!> <!> <!> <span class="text-gray-300">|</span>`, 1);
|
|
65700
|
+
var root_12 = /* @__PURE__ */ from_html(`<span class="text-blue-600 font-medium"> </span> <span class="text-gray-300">|</span>`, 1);
|
|
65701
|
+
var root_6 = /* @__PURE__ */ from_html(`<div class="absolute bottom-2 right-2 bg-white/80 rounded px-2 py-1 text-xs text-gray-500 flex gap-3"><!> <!> <!> <span> </span> <button class="hover:text-gray-700" title="Zoom to Fit (F)">⊞ Fit</button> <button class="hover:text-gray-700" title="Toggle Grid (G)"> </button> <button class="hover:text-gray-700" title="Toggle Snap to Grid (S)"> </button> <button class="hover:text-gray-700" title="Toggle Furniture"> </button> <button class="hover:text-gray-700" title="Layer Visibility">🗂 Layers</button> <button class="hover:text-gray-700" title="Toggle Rulers"> </button> <button class="hover:text-gray-700" title="Toggle Mini-map"> </button></div>`);
|
|
65702
|
+
var root_14 = /* @__PURE__ */ from_html(`<label class="flex items-center gap-2 py-0.5 cursor-pointer hover:bg-gray-50 rounded px-1"><input type="checkbox" class="accent-blue-500"/> <span> </span></label>`);
|
|
65703
|
+
var root_13 = /* @__PURE__ */ from_html(`<div class="absolute bottom-12 right-2 z-20 bg-white rounded-lg shadow-lg border border-gray-200 p-3 text-xs min-w-[160px]"><div class="font-semibold text-gray-700 mb-2">Layers</div> <!> <hr class="my-1 border-gray-100"/> <label class="flex items-center gap-2 py-0.5 cursor-pointer hover:bg-gray-50 rounded px-1"><input type="checkbox" class="accent-blue-500"/> <span>Room Labels</span></label> <label class="flex items-center gap-2 py-0.5 cursor-pointer hover:bg-gray-50 rounded px-1"><input type="checkbox" class="accent-blue-500"/> <span>Dimensions</span></label></div>`);
|
|
65704
|
+
var root_17 = /* @__PURE__ */ from_html(`<button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500 hover:text-gray-700" title="Flip swing" aria-label="Flip swing"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M7 16V4m0 0L3 8m4-4l4 4M17 8v12m0 0l4-4m-4 4l-4-4"></path></svg></button>`);
|
|
65705
|
+
var root_18 = /* @__PURE__ */ from_html(`<button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500 hover:text-gray-700" title="Split wall at midpoint" aria-label="Split wall at midpoint"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20M4 12h4M16 12h4"></path></svg></button>`);
|
|
65706
|
+
var root_16 = /* @__PURE__ */ from_html(`<div class="absolute z-40 flex items-center gap-0.5 bg-white rounded-lg shadow-lg border border-gray-200 px-1 py-0.5"><button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500 hover:text-gray-700" title="Duplicate" aria-label="Duplicate"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"></rect><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path></svg></button> <!> <!> <div class="w-px h-5 bg-gray-200 mx-0.5"></div> <button class="w-7 h-7 flex items-center justify-center rounded hover:bg-red-50 text-gray-400 hover:text-red-600" title="Delete" aria-label="Delete"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14"></path></svg></button></div>`);
|
|
65707
|
+
var root_19 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-blue-600 text-white px-3 py-1 rounded-full text-xs shadow">Click to add wall segment · Double-click to finish · C to close loop ·
|
|
65240
65708
|
Esc to cancel</div>`);
|
|
65241
|
-
var
|
|
65242
|
-
var
|
|
65243
|
-
var
|
|
65244
|
-
var
|
|
65245
|
-
var
|
|
65246
|
-
var root$1 = /* @__PURE__ */ from_html(`<div class="w-full h-full relative overflow-hidden" role="application"><div class="w-full h-full"><canvas aria-label="Floor plan editor canvas"></canvas></div>
|
|
65709
|
+
var root_20 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-purple-600 text-white px-3 py-1 rounded-full text-xs shadow"> </div>`);
|
|
65710
|
+
var root_21 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-red-600 text-white px-3 py-1 rounded-full text-xs shadow">Right-click two points to measure · M to exit · Esc to cancel</div>`);
|
|
65711
|
+
var root_22 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-emerald-600 text-white px-3 py-1 rounded-full text-xs shadow">Click to place text label · Esc to cancel</div>`);
|
|
65712
|
+
var root_23 = /* @__PURE__ */ from_html(`<div class="absolute top-2 left-1/2 -translate-x-1/2 bg-indigo-600 text-white px-3 py-1 rounded-full text-xs shadow"> </div>`);
|
|
65713
|
+
var root_1$4 = /* @__PURE__ */ from_html(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <div class="absolute bottom-3 left-3 z-20 flex items-center gap-1 bg-white rounded-lg shadow-lg border border-gray-200 px-1 py-0.5"><button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-600 hover:text-gray-800 font-bold text-lg" title="Zoom Out (−)" aria-label="Zoom out">−</button> <button class="min-w-[3.5rem] h-7 flex items-center justify-center rounded hover:bg-gray-100 text-xs font-medium text-gray-600 hover:text-gray-800 tabular-nums" title="Reset to 100%" aria-label="Zoom to 100%"> </button> <button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-600 hover:text-gray-800 font-bold text-lg" title="Zoom In (+)" aria-label="Zoom in">+</button> <div class="w-px h-5 bg-gray-200"></div> <button class="w-7 h-7 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500 hover:text-gray-700 text-sm" title="Zoom to Fit (F)" aria-label="Zoom to fit">⊞</button></div> <!>`, 1);
|
|
65714
|
+
var root$1 = /* @__PURE__ */ from_html(`<div class="w-full h-full relative overflow-hidden" role="application"><div class="w-full h-full"><canvas aria-label="Floor plan editor canvas"></canvas></div> <!></div>`);
|
|
65247
65715
|
function FloorPlanCanvas($$anchor, $$props) {
|
|
65248
65716
|
push($$props, true);
|
|
65249
65717
|
const $panMode = () => store_get(panMode, "$panMode", $$stores);
|
|
@@ -65320,6 +65788,15 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
65320
65788
|
let annotationStart = /* @__PURE__ */ state(null);
|
|
65321
65789
|
let selectedAnnotationId = /* @__PURE__ */ state(null);
|
|
65322
65790
|
let textAnnotationMode = /* @__PURE__ */ state(false);
|
|
65791
|
+
let currentZoneShape = /* @__PURE__ */ state("rectangle");
|
|
65792
|
+
let selectedZoneId = /* @__PURE__ */ state(null);
|
|
65793
|
+
let zonePolyDraft = /* @__PURE__ */ state(proxy([]));
|
|
65794
|
+
let zoneRectDragStart = /* @__PURE__ */ state(null);
|
|
65795
|
+
let zoneRectDragCurrent = /* @__PURE__ */ state(null);
|
|
65796
|
+
let draggingZoneId = /* @__PURE__ */ state(null);
|
|
65797
|
+
let draggingZoneVertex = /* @__PURE__ */ state(null);
|
|
65798
|
+
let zoneDragLast = /* @__PURE__ */ state(null);
|
|
65799
|
+
let zoneCursor = /* @__PURE__ */ state(null);
|
|
65323
65800
|
let editingTextAnnotationId = /* @__PURE__ */ state(null);
|
|
65324
65801
|
let editingTextAnnotationPos = /* @__PURE__ */ state(proxy({
|
|
65325
65802
|
x: 0,
|
|
@@ -65351,7 +65828,6 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
65351
65828
|
cameraThumbnail();
|
|
65352
65829
|
canvasBackground();
|
|
65353
65830
|
floorPlateBackground();
|
|
65354
|
-
$$props.projectName;
|
|
65355
65831
|
$$props.heatmapEnabled;
|
|
65356
65832
|
$$props.heatmapMatrix;
|
|
65357
65833
|
heatmapColorScale();
|
|
@@ -65366,7 +65842,8 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
65366
65842
|
columns: true,
|
|
65367
65843
|
guides: true,
|
|
65368
65844
|
measurements: true,
|
|
65369
|
-
annotations: true
|
|
65845
|
+
annotations: true,
|
|
65846
|
+
zones: true
|
|
65370
65847
|
}));
|
|
65371
65848
|
let showFurniture = /* @__PURE__ */ user_derived(() => get(layerVis).furniture);
|
|
65372
65849
|
user_effect(() => {
|
|
@@ -65612,6 +66089,35 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
65612
66089
|
const step = get(currentSnapToGrid) ? get(currentGridSize) : SNAP;
|
|
65613
66090
|
return Math.round(v / step) * step;
|
|
65614
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
|
+
}
|
|
65615
66121
|
function screenToWorld(sx, sy) {
|
|
65616
66122
|
return {
|
|
65617
66123
|
x: (sx - get(width) / 2) / get(zoom) + get(camX),
|
|
@@ -66025,9 +66531,9 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66025
66531
|
}
|
|
66026
66532
|
}
|
|
66027
66533
|
function drawMeasurement() {
|
|
66028
|
-
var _$$
|
|
66534
|
+
var _$$get3;
|
|
66029
66535
|
if (!get(measureStart)) return;
|
|
66030
|
-
const end = (_$$
|
|
66536
|
+
const end = (_$$get3 = get(measureEnd)) !== null && _$$get3 !== void 0 ? _$$get3 : get(mousePos);
|
|
66031
66537
|
const s = worldToScreen(get(measureStart).x, get(measureStart).y);
|
|
66032
66538
|
const e = worldToScreen(end.x, end.y);
|
|
66033
66539
|
ctx.strokeStyle = "#ef4444";
|
|
@@ -66199,8 +66705,8 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66199
66705
|
return getFloorBounds(floor, { includeWallThickness: true });
|
|
66200
66706
|
}
|
|
66201
66707
|
function drawFloorPlateBackground() {
|
|
66202
|
-
var _$$
|
|
66203
|
-
if (!((_$$
|
|
66708
|
+
var _$$get4;
|
|
66709
|
+
if (!((_$$get4 = get(currentFloor)) === null || _$$get4 === void 0 || (_$$get4 = _$$get4.walls) === null || _$$get4 === void 0 ? void 0 : _$$get4.length)) return;
|
|
66204
66710
|
const bounds = getCameraThumbnailBounds(get(currentFloor));
|
|
66205
66711
|
if (!bounds) return;
|
|
66206
66712
|
const topLeft = worldToScreen(bounds.minX, bounds.minY);
|
|
@@ -66209,12 +66715,12 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66209
66715
|
ctx.fillRect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
|
|
66210
66716
|
}
|
|
66211
66717
|
function isCameraThumbnailOverlayActive() {
|
|
66212
|
-
var _cameraThumbnail2, _$$
|
|
66213
|
-
return !!(((_cameraThumbnail2 = cameraThumbnail()) === null || _cameraThumbnail2 === void 0 ? void 0 : _cameraThumbnail2.trim()) && get(bgImage) && !((_$$
|
|
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));
|
|
66214
66720
|
}
|
|
66215
66721
|
function drawBackgroundImage() {
|
|
66216
|
-
var _$$
|
|
66217
|
-
if (!get(bgImage) || !((_$$
|
|
66722
|
+
var _$$get6;
|
|
66723
|
+
if (!get(bgImage) || !((_$$get6 = get(currentFloor)) === null || _$$get6 === void 0 ? void 0 : _$$get6.backgroundImage)) return;
|
|
66218
66724
|
const bg = get(currentFloor).backgroundImage;
|
|
66219
66725
|
ctx.save();
|
|
66220
66726
|
ctx.globalAlpha = bg.opacity;
|
|
@@ -66283,6 +66789,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66283
66789
|
return "width: 100%; height: 100%";
|
|
66284
66790
|
}
|
|
66285
66791
|
function draw() {
|
|
66792
|
+
var _floor$zones;
|
|
66286
66793
|
if (!ctx) return;
|
|
66287
66794
|
if (!canvasDirty) {
|
|
66288
66795
|
requestAnimationFrame(draw);
|
|
@@ -66305,7 +66812,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66305
66812
|
else zoomToFit();
|
|
66306
66813
|
needsFitToCanvas = false;
|
|
66307
66814
|
}
|
|
66308
|
-
if (get(wallStart) || get(draggingFurnitureId) || get(draggingDoorId) || get(draggingWindowId) || get(draggingStairId) || get(draggingColumnId) || get(draggingWallEndpoint) || get(draggingWallParallel) || get(draggingCurveHandle) || get(draggingHandle) || get(draggingMultiSelect) || get(draggingRoomId) || get(draggingRoomLabelId) || get(draggingTextAnnotationId) || get(draggingGuideId) || get(measuring) || get(annotating) || get(currentPlacingId) || get(isPlacingStair) || get(isPlacingColumn) || get(marqueeStart) || get(isPanning)) canvasDirty = true;
|
|
66815
|
+
if (get(wallStart) || get(draggingFurnitureId) || get(draggingDoorId) || get(draggingWindowId) || get(draggingStairId) || get(draggingColumnId) || get(draggingWallEndpoint) || get(draggingWallParallel) || get(draggingCurveHandle) || get(draggingHandle) || get(draggingMultiSelect) || get(draggingRoomId) || get(draggingRoomLabelId) || get(draggingTextAnnotationId) || get(draggingGuideId) || get(draggingZoneId) || get(zoneRectDragStart) || get(zonePolyDraft).length > 0 || get(measuring) || get(annotating) || get(currentPlacingId) || get(isPlacingStair) || get(isPlacingColumn) || get(marqueeStart) || get(isPanning)) canvasDirty = true;
|
|
66309
66816
|
updateDetectedRooms();
|
|
66310
66817
|
const selId = get(currentSelectedId);
|
|
66311
66818
|
const multiIds = get(currentSelectedIds);
|
|
@@ -66938,6 +67445,18 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66938
67445
|
ctx.restore();
|
|
66939
67446
|
}
|
|
66940
67447
|
drawFloorHeatmapLayer();
|
|
67448
|
+
if (get(layerVis).zones && (floor === null || floor === void 0 || (_floor$zones = floor.zones) === null || _floor$zones === void 0 ? void 0 : _floor$zones.length)) {
|
|
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;
|
|
67451
|
+
drawZones(getCS(), floor, zoneSel);
|
|
67452
|
+
}
|
|
67453
|
+
if (get(currentTool) === "zone") {
|
|
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);
|
|
67457
|
+
if (get(zoneRectDragStart) && get(zoneRectDragCurrent)) drawZoneDraft(getCS(), rectPoints(get(zoneRectDragStart).x, get(zoneRectDragStart).y, get(zoneRectDragCurrent).x, get(zoneRectDragCurrent).y), draftColor, true);
|
|
67458
|
+
else if (get(zonePolyDraft).length || get(zoneCursor)) drawZoneDraft(getCS(), get(zonePolyDraft), draftColor, false, get(zoneCursor));
|
|
67459
|
+
}
|
|
66941
67460
|
drawMinimap$1();
|
|
66942
67461
|
requestAnimationFrame(draw);
|
|
66943
67462
|
}
|
|
@@ -66978,6 +67497,18 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
66978
67497
|
set(currentTool, t, true);
|
|
66979
67498
|
set(textAnnotationMode, t === "text");
|
|
66980
67499
|
if (t !== "text") set(editingTextAnnotationId, null);
|
|
67500
|
+
if (t !== "zone") {
|
|
67501
|
+
set(zonePolyDraft, [], true);
|
|
67502
|
+
set(zoneRectDragStart, null);
|
|
67503
|
+
set(zoneRectDragCurrent, null);
|
|
67504
|
+
}
|
|
67505
|
+
markDirty();
|
|
67506
|
+
});
|
|
67507
|
+
const unsubZoneShape = placingZoneShape.subscribe((s) => {
|
|
67508
|
+
set(currentZoneShape, s, true);
|
|
67509
|
+
set(zonePolyDraft, [], true);
|
|
67510
|
+
set(zoneRectDragStart, null);
|
|
67511
|
+
set(zoneRectDragCurrent, null);
|
|
66981
67512
|
markDirty();
|
|
66982
67513
|
});
|
|
66983
67514
|
const unsub7 = detectedRoomsStore.subscribe((rooms) => {
|
|
@@ -67081,6 +67612,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67081
67612
|
unsub4();
|
|
67082
67613
|
unsub5();
|
|
67083
67614
|
unsub6();
|
|
67615
|
+
unsubZoneShape();
|
|
67084
67616
|
unsub7();
|
|
67085
67617
|
unsub8();
|
|
67086
67618
|
unsub9();
|
|
@@ -67263,7 +67795,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67263
67795
|
return findRoomAt(p, get(detectedRooms), get(currentFloor).walls);
|
|
67264
67796
|
}
|
|
67265
67797
|
function onMouseDown(e) {
|
|
67266
|
-
var _$$
|
|
67798
|
+
var _$$get8, _$$get9;
|
|
67267
67799
|
if ($$props.viewOnly) return;
|
|
67268
67800
|
markDirty();
|
|
67269
67801
|
if (e.button === 1 || e.button === 0 && (get(spaceDown) || $panMode() || e.shiftKey && get(currentTool) === "select")) {
|
|
@@ -67344,7 +67876,61 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67344
67876
|
placingStair.set(false);
|
|
67345
67877
|
return;
|
|
67346
67878
|
}
|
|
67347
|
-
if (tool === "
|
|
67879
|
+
if (tool === "zone") {
|
|
67880
|
+
const snapped = {
|
|
67881
|
+
x: snap(wp.x),
|
|
67882
|
+
y: snap(wp.y)
|
|
67883
|
+
};
|
|
67884
|
+
if (get(currentZoneShape) === "rectangle") {
|
|
67885
|
+
set(zoneRectDragStart, snapped, true);
|
|
67886
|
+
set(zoneRectDragCurrent, snapped, true);
|
|
67887
|
+
return;
|
|
67888
|
+
}
|
|
67889
|
+
if (get(currentZoneShape) === "triangle") {
|
|
67890
|
+
const id = commitAreaShape("triangle", trianglePoints(snapped));
|
|
67891
|
+
set(selectedZoneId, id, true);
|
|
67892
|
+
selectedElementId.set(id);
|
|
67893
|
+
selectedTool.set("select");
|
|
67894
|
+
return;
|
|
67895
|
+
}
|
|
67896
|
+
if (get(zonePolyDraft).length >= 3 && isNearPoint(snapped, get(zonePolyDraft)[0], 15 / get(zoom))) {
|
|
67897
|
+
const id = commitAreaShape("polygon", get(zonePolyDraft));
|
|
67898
|
+
set(zonePolyDraft, [], true);
|
|
67899
|
+
set(zoneCursor, null);
|
|
67900
|
+
set(selectedZoneId, id, true);
|
|
67901
|
+
selectedElementId.set(id);
|
|
67902
|
+
selectedTool.set("select");
|
|
67903
|
+
return;
|
|
67904
|
+
}
|
|
67905
|
+
set(zonePolyDraft, [...get(zonePolyDraft), snapped], true);
|
|
67906
|
+
return;
|
|
67907
|
+
}
|
|
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) {
|
|
67909
|
+
const zHit = findZoneAt(wp, get(currentFloor).zones, get(zoom));
|
|
67910
|
+
if (zHit) {
|
|
67911
|
+
set(selectedZoneId, zHit.id, true);
|
|
67912
|
+
selectedElementId.set(zHit.id);
|
|
67913
|
+
set(selectedTextAnnotationId, null);
|
|
67914
|
+
set(selectedAnnotationId, null);
|
|
67915
|
+
set(selectedMeasurementId, null);
|
|
67916
|
+
const vIdx = findZoneVertexAt(wp, zHit, get(zoom));
|
|
67917
|
+
beginUndoGroup();
|
|
67918
|
+
if (vIdx >= 0) {
|
|
67919
|
+
set(draggingZoneId, zHit.id, true);
|
|
67920
|
+
set(draggingZoneVertex, vIdx, true);
|
|
67921
|
+
} else {
|
|
67922
|
+
set(draggingZoneId, zHit.id, true);
|
|
67923
|
+
set(draggingZoneVertex, null);
|
|
67924
|
+
set(zoneDragLast, {
|
|
67925
|
+
x: wp.x,
|
|
67926
|
+
y: wp.y
|
|
67927
|
+
}, true);
|
|
67928
|
+
}
|
|
67929
|
+
return;
|
|
67930
|
+
}
|
|
67931
|
+
set(selectedZoneId, null);
|
|
67932
|
+
}
|
|
67933
|
+
if (tool === "select" && ((_$$get9 = get(currentFloor)) === null || _$$get9 === void 0 ? void 0 : _$$get9.guides)) {
|
|
67348
67934
|
const GUIDE_HIT = 6 / get(zoom);
|
|
67349
67935
|
for (const g of get(currentFloor).guides) {
|
|
67350
67936
|
if (g.orientation === "horizontal" && Math.abs(wp.y - g.position) < GUIDE_HIT) {
|
|
@@ -67413,9 +67999,9 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67413
67999
|
const dist = Math.hypot(newPts[1].x - newPts[0].x, newPts[1].y - newPts[0].y);
|
|
67414
68000
|
const realDist = prompt("Enter the real-world distance between these two points (in cm):");
|
|
67415
68001
|
if (realDist && Number(realDist) > 0) {
|
|
67416
|
-
var _$$
|
|
68002
|
+
var _$$get10;
|
|
67417
68003
|
const pixelsPerCm = dist / Number(realDist);
|
|
67418
|
-
if ((_$$
|
|
68004
|
+
if ((_$$get10 = get(currentFloor)) === null || _$$get10 === void 0 ? void 0 : _$$get10.backgroundImage) updateBackgroundImage({ scale: get(currentFloor).backgroundImage.scale * (1 / pixelsPerCm) });
|
|
67419
68005
|
}
|
|
67420
68006
|
calibrationMode.set(false);
|
|
67421
68007
|
return [];
|
|
@@ -67765,6 +68351,15 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67765
68351
|
return;
|
|
67766
68352
|
}
|
|
67767
68353
|
}
|
|
68354
|
+
if (get(currentTool) === "zone" && get(currentZoneShape) === "polygon" && get(zonePolyDraft).length >= 3) {
|
|
68355
|
+
const id = commitAreaShape("polygon", get(zonePolyDraft));
|
|
68356
|
+
set(zonePolyDraft, [], true);
|
|
68357
|
+
set(zoneCursor, null);
|
|
68358
|
+
set(selectedZoneId, id, true);
|
|
68359
|
+
selectedElementId.set(id);
|
|
68360
|
+
selectedTool.set("select");
|
|
68361
|
+
return;
|
|
68362
|
+
}
|
|
67768
68363
|
if (get(currentTool) === "select") {
|
|
67769
68364
|
const wp = screenToWorld(sx, sy);
|
|
67770
68365
|
const wall = findWallAt$1(wp);
|
|
@@ -67785,11 +68380,47 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67785
68380
|
}
|
|
67786
68381
|
}
|
|
67787
68382
|
function onMouseMove(e) {
|
|
67788
|
-
var _$$
|
|
68383
|
+
var _$$get11, _$$get12, _$$get13, _$$get14, _$$get15;
|
|
67789
68384
|
if ($$props.viewOnly) return;
|
|
67790
68385
|
markDirty();
|
|
67791
68386
|
const rect = canvas.getBoundingClientRect();
|
|
67792
68387
|
set(mousePos, screenToWorld(e.clientX - rect.left, e.clientY - rect.top), true);
|
|
68388
|
+
if (get(zoneRectDragStart) && get(currentTool) === "zone") {
|
|
68389
|
+
set(zoneRectDragCurrent, {
|
|
68390
|
+
x: snap(get(mousePos).x),
|
|
68391
|
+
y: snap(get(mousePos).y)
|
|
68392
|
+
}, true);
|
|
68393
|
+
return;
|
|
68394
|
+
}
|
|
68395
|
+
if (get(currentTool) === "zone" && get(currentZoneShape) === "polygon") set(zoneCursor, {
|
|
68396
|
+
x: snap(get(mousePos).x),
|
|
68397
|
+
y: snap(get(mousePos).y)
|
|
68398
|
+
}, true);
|
|
68399
|
+
if (get(draggingZoneId) && ((_$$get11 = get(currentFloor)) === null || _$$get11 === void 0 ? void 0 : _$$get11.zones)) {
|
|
68400
|
+
const z = get(currentFloor).zones.find((z) => z.id === get(draggingZoneId));
|
|
68401
|
+
if (z) {
|
|
68402
|
+
const snapped = {
|
|
68403
|
+
x: snap(get(mousePos).x),
|
|
68404
|
+
y: snap(get(mousePos).y)
|
|
68405
|
+
};
|
|
68406
|
+
if (get(draggingZoneVertex) != null) if (z.shape === "rectangle" && z.points.length === 4) moveZonePoints(z.id, resizeRectCorner(z.points, get(draggingZoneVertex), snapped));
|
|
68407
|
+
else {
|
|
68408
|
+
const next = z.points.map((p) => ({ ...p }));
|
|
68409
|
+
next[get(draggingZoneVertex)] = snapped;
|
|
68410
|
+
moveZonePoints(z.id, next);
|
|
68411
|
+
}
|
|
68412
|
+
else if (get(zoneDragLast)) {
|
|
68413
|
+
const dx = get(mousePos).x - get(zoneDragLast).x;
|
|
68414
|
+
const dy = get(mousePos).y - get(zoneDragLast).y;
|
|
68415
|
+
set(zoneDragLast, {
|
|
68416
|
+
x: get(mousePos).x,
|
|
68417
|
+
y: get(mousePos).y
|
|
68418
|
+
}, true);
|
|
68419
|
+
moveZonePoints(z.id, translatePoints(z.points, dx, dy));
|
|
68420
|
+
}
|
|
68421
|
+
}
|
|
68422
|
+
return;
|
|
68423
|
+
}
|
|
67793
68424
|
if (get(draggingRoomLabelId)) {
|
|
67794
68425
|
const dx = get(mousePos).x - roomLabelDragStart.x;
|
|
67795
68426
|
const dy = get(mousePos).y - roomLabelDragStart.y;
|
|
@@ -67803,7 +68434,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67803
68434
|
} : r));
|
|
67804
68435
|
return;
|
|
67805
68436
|
}
|
|
67806
|
-
if (get(draggingGuideId) && ((_$$
|
|
68437
|
+
if (get(draggingGuideId) && ((_$$get12 = get(currentFloor)) === null || _$$get12 === void 0 ? void 0 : _$$get12.guides)) {
|
|
67807
68438
|
const g = get(currentFloor).guides.find((g) => g.id === get(draggingGuideId));
|
|
67808
68439
|
if (g) {
|
|
67809
68440
|
const newPos = g.orientation === "horizontal" ? get(mousePos).y : get(mousePos).x;
|
|
@@ -67959,7 +68590,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67959
68590
|
}
|
|
67960
68591
|
}
|
|
67961
68592
|
}
|
|
67962
|
-
if (get(draggingTextAnnotationId) && ((_$$
|
|
68593
|
+
if (get(draggingTextAnnotationId) && ((_$$get13 = get(currentFloor)) === null || _$$get13 === void 0 ? void 0 : _$$get13.textAnnotations)) {
|
|
67963
68594
|
const basePos = {
|
|
67964
68595
|
x: get(mousePos).x - textAnnotationDragOffset.x,
|
|
67965
68596
|
y: get(mousePos).y - textAnnotationDragOffset.y
|
|
@@ -67976,7 +68607,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67976
68607
|
}, true);
|
|
67977
68608
|
}
|
|
67978
68609
|
}
|
|
67979
|
-
if (get(draggingColumnId) && ((_$$
|
|
68610
|
+
if (get(draggingColumnId) && ((_$$get14 = get(currentFloor)) === null || _$$get14 === void 0 ? void 0 : _$$get14.columns)) {
|
|
67980
68611
|
const basePos = {
|
|
67981
68612
|
x: get(mousePos).x - columnDragOffset.x,
|
|
67982
68613
|
y: get(mousePos).y - columnDragOffset.y
|
|
@@ -67986,7 +68617,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67986
68617
|
y: snap(basePos.y)
|
|
67987
68618
|
});
|
|
67988
68619
|
}
|
|
67989
|
-
if (get(draggingStairId) && ((_$$
|
|
68620
|
+
if (get(draggingStairId) && ((_$$get15 = get(currentFloor)) === null || _$$get15 === void 0 ? void 0 : _$$get15.stairs)) {
|
|
67990
68621
|
const basePos = {
|
|
67991
68622
|
x: get(mousePos).x - stairDragOffset.x,
|
|
67992
68623
|
y: get(mousePos).y - stairDragOffset.y
|
|
@@ -67997,12 +68628,12 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
67997
68628
|
});
|
|
67998
68629
|
}
|
|
67999
68630
|
if (get(draggingFurnitureId)) {
|
|
68000
|
-
var _$$
|
|
68631
|
+
var _$$get16;
|
|
68001
68632
|
const basePos = {
|
|
68002
68633
|
x: get(mousePos).x - dragOffset.x,
|
|
68003
68634
|
y: get(mousePos).y - dragOffset.y
|
|
68004
68635
|
};
|
|
68005
|
-
const fi = (_$$
|
|
68636
|
+
const fi = (_$$get16 = get(currentFloor)) === null || _$$get16 === void 0 ? void 0 : _$$get16.furniture.find((f) => f.id === get(draggingFurnitureId));
|
|
68006
68637
|
if (fi) {
|
|
68007
68638
|
const wallSnap = snapFurnitureToWall(basePos, fi.catalogId, fi.rotation);
|
|
68008
68639
|
if (wallSnap) {
|
|
@@ -68015,13 +68646,13 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68015
68646
|
wallAngle: wallSnap.wallAngle
|
|
68016
68647
|
}, true);
|
|
68017
68648
|
} else {
|
|
68018
|
-
var _$$
|
|
68649
|
+
var _$$get17;
|
|
68019
68650
|
const snapped = {
|
|
68020
68651
|
x: snap(basePos.x),
|
|
68021
68652
|
y: snap(basePos.y)
|
|
68022
68653
|
};
|
|
68023
68654
|
const GUIDE_SNAP = 10;
|
|
68024
|
-
if ((_$$
|
|
68655
|
+
if ((_$$get17 = get(currentFloor)) === null || _$$get17 === void 0 ? void 0 : _$$get17.guides) for (const g of get(currentFloor).guides) {
|
|
68025
68656
|
if (g.orientation === "horizontal" && Math.abs(snapped.y - g.position) < GUIDE_SNAP) snapped.y = g.position;
|
|
68026
68657
|
if (g.orientation === "vertical" && Math.abs(snapped.x - g.position) < GUIDE_SNAP) snapped.x = g.position;
|
|
68027
68658
|
}
|
|
@@ -68071,6 +68702,26 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68071
68702
|
markDirty();
|
|
68072
68703
|
set(isPanning, false);
|
|
68073
68704
|
set(draggingGuideId, null);
|
|
68705
|
+
if (get(zoneRectDragStart) && get(zoneRectDragCurrent) && get(currentTool) === "zone") {
|
|
68706
|
+
const pts = rectPoints(get(zoneRectDragStart).x, get(zoneRectDragStart).y, get(zoneRectDragCurrent).x, get(zoneRectDragCurrent).y);
|
|
68707
|
+
const w = Math.abs(get(zoneRectDragCurrent).x - get(zoneRectDragStart).x);
|
|
68708
|
+
const h = Math.abs(get(zoneRectDragCurrent).y - get(zoneRectDragStart).y);
|
|
68709
|
+
set(zoneRectDragStart, null);
|
|
68710
|
+
set(zoneRectDragCurrent, null);
|
|
68711
|
+
if (w > 5 && h > 5) {
|
|
68712
|
+
const id = commitAreaShape("rectangle", pts);
|
|
68713
|
+
set(selectedZoneId, id, true);
|
|
68714
|
+
selectedElementId.set(id);
|
|
68715
|
+
selectedTool.set("select");
|
|
68716
|
+
}
|
|
68717
|
+
return;
|
|
68718
|
+
}
|
|
68719
|
+
if (get(draggingZoneId)) {
|
|
68720
|
+
endUndoGroup();
|
|
68721
|
+
set(draggingZoneId, null);
|
|
68722
|
+
set(draggingZoneVertex, null);
|
|
68723
|
+
set(zoneDragLast, null);
|
|
68724
|
+
}
|
|
68074
68725
|
if (get(draggingRoomLabelId)) {
|
|
68075
68726
|
const dx = get(mousePos).x - roomLabelDragStart.x;
|
|
68076
68727
|
const dy = get(mousePos).y - roomLabelDragStart.y;
|
|
@@ -68239,6 +68890,20 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68239
68890
|
set(annotationStart, null);
|
|
68240
68891
|
set(marqueeStart, null);
|
|
68241
68892
|
set(marqueeEnd, null);
|
|
68893
|
+
set(zonePolyDraft, [], true);
|
|
68894
|
+
set(zoneCursor, null);
|
|
68895
|
+
set(zoneRectDragStart, null);
|
|
68896
|
+
set(zoneRectDragCurrent, null);
|
|
68897
|
+
}
|
|
68898
|
+
if (e.key === "Enter" && get(currentTool) === "zone" && get(currentZoneShape) === "polygon" && get(zonePolyDraft).length >= 3) {
|
|
68899
|
+
const id = commitAreaShape("polygon", get(zonePolyDraft));
|
|
68900
|
+
set(zonePolyDraft, [], true);
|
|
68901
|
+
set(zoneCursor, null);
|
|
68902
|
+
set(selectedZoneId, id, true);
|
|
68903
|
+
selectedElementId.set(id);
|
|
68904
|
+
selectedTool.set("select");
|
|
68905
|
+
e.preventDefault();
|
|
68906
|
+
return;
|
|
68242
68907
|
}
|
|
68243
68908
|
if ((e.ctrlKey || e.metaKey) && e.key === "a" && !e.shiftKey) {
|
|
68244
68909
|
e.preventDefault();
|
|
@@ -68717,8 +69382,8 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68717
69382
|
}
|
|
68718
69383
|
}
|
|
68719
69384
|
let cursorStyle = /* @__PURE__ */ user_derived(() => {
|
|
68720
|
-
var _$$
|
|
68721
|
-
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(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" : ((_$$
|
|
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";
|
|
68722
69387
|
});
|
|
68723
69388
|
var div = root$1();
|
|
68724
69389
|
event("keydown", $window, onKeyDown);
|
|
@@ -68730,22 +69395,11 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68730
69395
|
reset(div_1);
|
|
68731
69396
|
bind_this(div_1, ($$value) => canvasFrame = $$value, () => canvasFrame);
|
|
68732
69397
|
var node = sibling(div_1, 2);
|
|
68733
|
-
var
|
|
68734
|
-
var
|
|
68735
|
-
var
|
|
68736
|
-
|
|
68737
|
-
|
|
68738
|
-
append($$anchor, div_2);
|
|
68739
|
-
};
|
|
68740
|
-
if_block(node, ($$render) => {
|
|
68741
|
-
if ($$props.viewOnly && $$props.projectName) $$render(consequent);
|
|
68742
|
-
});
|
|
68743
|
-
var node_1 = sibling(node, 2);
|
|
68744
|
-
var consequent_22 = ($$anchor) => {
|
|
68745
|
-
var fragment = root_2$4();
|
|
68746
|
-
var node_2 = first_child(fragment);
|
|
68747
|
-
var consequent_1 = ($$anchor) => {
|
|
68748
|
-
var input = root_3$3();
|
|
69398
|
+
var consequent_21 = ($$anchor) => {
|
|
69399
|
+
var fragment = root_1$4();
|
|
69400
|
+
var node_1 = first_child(fragment);
|
|
69401
|
+
var consequent = ($$anchor) => {
|
|
69402
|
+
var input = root_2$4();
|
|
68749
69403
|
remove_input_defaults(input);
|
|
68750
69404
|
autofocus(input, true);
|
|
68751
69405
|
template_effect(() => {
|
|
@@ -68778,12 +69432,12 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68778
69432
|
});
|
|
68779
69433
|
append($$anchor, input);
|
|
68780
69434
|
};
|
|
68781
|
-
if_block(
|
|
68782
|
-
if (get(editingRoomId)) $$render(
|
|
69435
|
+
if_block(node_1, ($$render) => {
|
|
69436
|
+
if (get(editingRoomId)) $$render(consequent);
|
|
68783
69437
|
});
|
|
68784
|
-
var
|
|
68785
|
-
var
|
|
68786
|
-
var input_1 =
|
|
69438
|
+
var node_2 = sibling(node_1, 2);
|
|
69439
|
+
var consequent_1 = ($$anchor) => {
|
|
69440
|
+
var input_1 = root_3$3();
|
|
68787
69441
|
remove_input_defaults(input_1);
|
|
68788
69442
|
autofocus(input_1, true);
|
|
68789
69443
|
template_effect(() => {
|
|
@@ -68805,8 +69459,8 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68805
69459
|
}
|
|
68806
69460
|
set(editingTextAnnotationId, null);
|
|
68807
69461
|
} else if (e.key === "Escape") {
|
|
68808
|
-
var _$$
|
|
68809
|
-
if ((_$$
|
|
69462
|
+
var _$$get19;
|
|
69463
|
+
if ((_$$get19 = get(currentFloor)) === null || _$$get19 === void 0 ? void 0 : _$$get19.textAnnotations) {
|
|
68810
69464
|
const ta = get(currentFloor).textAnnotations.find((t) => t.id === get(editingTextAnnotationId));
|
|
68811
69465
|
if (ta && ta.text === "Text" && !get(editingTextAnnotationValue).trim()) {
|
|
68812
69466
|
removeTextAnnotation(get(editingTextAnnotationId));
|
|
@@ -68830,151 +69484,151 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68830
69484
|
});
|
|
68831
69485
|
append($$anchor, input_1);
|
|
68832
69486
|
};
|
|
69487
|
+
if_block(node_2, ($$render) => {
|
|
69488
|
+
if (get(editingTextAnnotationId)) $$render(consequent_1);
|
|
69489
|
+
});
|
|
69490
|
+
var node_3 = sibling(node_2, 2);
|
|
69491
|
+
var consequent_2 = ($$anchor) => {
|
|
69492
|
+
append($$anchor, root_4$2());
|
|
69493
|
+
};
|
|
68833
69494
|
if_block(node_3, ($$render) => {
|
|
68834
|
-
if (get(
|
|
69495
|
+
if (get(currentFloor) && get(currentFloor).walls.length === 0 && get(currentFloor).furniture.length === 0 && get(currentFloor).doors.length === 0 && !$$props.viewOnly) $$render(consequent_2);
|
|
68835
69496
|
});
|
|
68836
69497
|
var node_4 = sibling(node_3, 2);
|
|
68837
69498
|
var consequent_3 = ($$anchor) => {
|
|
68838
|
-
|
|
68839
|
-
};
|
|
68840
|
-
if_block(node_4, ($$render) => {
|
|
68841
|
-
if (get(currentFloor) && get(currentFloor).walls.length === 0 && get(currentFloor).furniture.length === 0 && get(currentFloor).doors.length === 0 && !$$props.viewOnly) $$render(consequent_3);
|
|
68842
|
-
});
|
|
68843
|
-
var node_5 = sibling(node_4, 2);
|
|
68844
|
-
var consequent_4 = ($$anchor) => {
|
|
68845
|
-
var canvas_2 = root_6();
|
|
69499
|
+
var canvas_2 = root_5();
|
|
68846
69500
|
bind_this(canvas_2, ($$value) => minimapCanvas = $$value, () => minimapCanvas);
|
|
68847
69501
|
delegated("click", canvas_2, onMinimapClick);
|
|
68848
69502
|
append($$anchor, canvas_2);
|
|
68849
69503
|
};
|
|
68850
|
-
if_block(
|
|
68851
|
-
if (!$$props.viewOnly && get(showMinimap) && get(currentFloor) && get(currentFloor).walls.length > 0) $$render(
|
|
69504
|
+
if_block(node_4, ($$render) => {
|
|
69505
|
+
if (!$$props.viewOnly && get(showMinimap) && get(currentFloor) && get(currentFloor).walls.length > 0) $$render(consequent_3);
|
|
68852
69506
|
});
|
|
68853
|
-
var
|
|
68854
|
-
var
|
|
68855
|
-
var
|
|
68856
|
-
var
|
|
68857
|
-
var
|
|
68858
|
-
var fragment_1 =
|
|
69507
|
+
var node_5 = sibling(node_4, 2);
|
|
69508
|
+
var consequent_10 = ($$anchor) => {
|
|
69509
|
+
var div_3 = root_6();
|
|
69510
|
+
var node_6 = child(div_3);
|
|
69511
|
+
var consequent_4 = ($$anchor) => {
|
|
69512
|
+
var fragment_1 = root_7$1();
|
|
68859
69513
|
var span = first_child(fragment_1);
|
|
68860
|
-
var
|
|
69514
|
+
var text_1 = child(span);
|
|
68861
69515
|
reset(span);
|
|
68862
69516
|
var span_1 = sibling(span, 2);
|
|
68863
|
-
var
|
|
69517
|
+
var text_2 = child(span_1, true);
|
|
68864
69518
|
reset(span_1);
|
|
68865
69519
|
next(2);
|
|
68866
69520
|
template_effect(($0) => {
|
|
68867
69521
|
var _$$get$length;
|
|
68868
|
-
set_text(
|
|
68869
|
-
set_text(
|
|
69522
|
+
set_text(text_1, `${(_$$get$length = get(detectedRooms).length) !== null && _$$get$length !== void 0 ? _$$get$length : ""} room${get(detectedRooms).length !== 1 ? "s" : ""}`);
|
|
69523
|
+
set_text(text_2, $0);
|
|
68870
69524
|
}, [() => formatArea(get(detectedRooms).reduce((s, r) => s + r.area, 0), $projectSettings().units)]);
|
|
68871
69525
|
append($$anchor, fragment_1);
|
|
68872
69526
|
};
|
|
68873
|
-
if_block(
|
|
68874
|
-
if (get(detectedRooms).length > 0) $$render(
|
|
69527
|
+
if_block(node_6, ($$render) => {
|
|
69528
|
+
if (get(detectedRooms).length > 0) $$render(consequent_4);
|
|
68875
69529
|
});
|
|
68876
|
-
var
|
|
68877
|
-
var
|
|
68878
|
-
var fragment_2 =
|
|
69530
|
+
var node_7 = sibling(node_6, 2);
|
|
69531
|
+
var consequent_8 = ($$anchor) => {
|
|
69532
|
+
var fragment_2 = root_8();
|
|
68879
69533
|
var span_2 = first_child(fragment_2);
|
|
68880
|
-
var
|
|
69534
|
+
var text_3 = child(span_2);
|
|
68881
69535
|
reset(span_2);
|
|
68882
|
-
var
|
|
68883
|
-
var
|
|
68884
|
-
var span_3 =
|
|
68885
|
-
var
|
|
69536
|
+
var node_8 = sibling(span_2, 2);
|
|
69537
|
+
var consequent_5 = ($$anchor) => {
|
|
69538
|
+
var span_3 = root_9();
|
|
69539
|
+
var text_4 = child(span_3);
|
|
68886
69540
|
reset(span_3);
|
|
68887
69541
|
template_effect(() => {
|
|
68888
69542
|
var _$$get$doors$length;
|
|
68889
|
-
return set_text(
|
|
69543
|
+
return set_text(text_4, `${(_$$get$doors$length = get(currentFloor).doors.length) !== null && _$$get$doors$length !== void 0 ? _$$get$doors$length : ""} door${get(currentFloor).doors.length !== 1 ? "s" : ""}`);
|
|
68890
69544
|
});
|
|
68891
69545
|
append($$anchor, span_3);
|
|
68892
69546
|
};
|
|
68893
|
-
if_block(
|
|
68894
|
-
if (get(currentFloor).doors.length > 0) $$render(
|
|
69547
|
+
if_block(node_8, ($$render) => {
|
|
69548
|
+
if (get(currentFloor).doors.length > 0) $$render(consequent_5);
|
|
68895
69549
|
});
|
|
68896
|
-
var
|
|
68897
|
-
var
|
|
68898
|
-
var span_4 =
|
|
68899
|
-
var
|
|
69550
|
+
var node_9 = sibling(node_8, 2);
|
|
69551
|
+
var consequent_6 = ($$anchor) => {
|
|
69552
|
+
var span_4 = root_10();
|
|
69553
|
+
var text_5 = child(span_4);
|
|
68900
69554
|
reset(span_4);
|
|
68901
69555
|
template_effect(() => {
|
|
68902
69556
|
var _$$get$windows$length;
|
|
68903
|
-
return set_text(
|
|
69557
|
+
return set_text(text_5, `${(_$$get$windows$length = get(currentFloor).windows.length) !== null && _$$get$windows$length !== void 0 ? _$$get$windows$length : ""} window${get(currentFloor).windows.length !== 1 ? "s" : ""}`);
|
|
68904
69558
|
});
|
|
68905
69559
|
append($$anchor, span_4);
|
|
68906
69560
|
};
|
|
68907
|
-
if_block(
|
|
68908
|
-
if (get(currentFloor).windows.length > 0) $$render(
|
|
69561
|
+
if_block(node_9, ($$render) => {
|
|
69562
|
+
if (get(currentFloor).windows.length > 0) $$render(consequent_6);
|
|
68909
69563
|
});
|
|
68910
|
-
var
|
|
68911
|
-
var
|
|
68912
|
-
var span_5 =
|
|
68913
|
-
var
|
|
69564
|
+
var node_10 = sibling(node_9, 2);
|
|
69565
|
+
var consequent_7 = ($$anchor) => {
|
|
69566
|
+
var span_5 = root_11();
|
|
69567
|
+
var text_6 = child(span_5);
|
|
68914
69568
|
reset(span_5);
|
|
68915
69569
|
template_effect(() => {
|
|
68916
69570
|
var _$$get$furniture$leng;
|
|
68917
|
-
return set_text(
|
|
69571
|
+
return set_text(text_6, `${(_$$get$furniture$leng = get(currentFloor).furniture.length) !== null && _$$get$furniture$leng !== void 0 ? _$$get$furniture$leng : ""} object${get(currentFloor).furniture.length !== 1 ? "s" : ""}`);
|
|
68918
69572
|
});
|
|
68919
69573
|
append($$anchor, span_5);
|
|
68920
69574
|
};
|
|
68921
|
-
if_block(
|
|
68922
|
-
if (get(currentFloor).furniture.length > 0) $$render(
|
|
69575
|
+
if_block(node_10, ($$render) => {
|
|
69576
|
+
if (get(currentFloor).furniture.length > 0) $$render(consequent_7);
|
|
68923
69577
|
});
|
|
68924
69578
|
next(2);
|
|
68925
69579
|
template_effect(() => {
|
|
68926
69580
|
var _$$get$walls$length;
|
|
68927
|
-
return set_text(
|
|
69581
|
+
return set_text(text_3, `${(_$$get$walls$length = get(currentFloor).walls.length) !== null && _$$get$walls$length !== void 0 ? _$$get$walls$length : ""} wall${get(currentFloor).walls.length !== 1 ? "s" : ""}`);
|
|
68928
69582
|
});
|
|
68929
69583
|
append($$anchor, fragment_2);
|
|
68930
69584
|
};
|
|
68931
|
-
if_block(
|
|
68932
|
-
if (get(currentFloor)) $$render(
|
|
69585
|
+
if_block(node_7, ($$render) => {
|
|
69586
|
+
if (get(currentFloor)) $$render(consequent_8);
|
|
68933
69587
|
});
|
|
68934
|
-
var
|
|
68935
|
-
var
|
|
68936
|
-
var fragment_3 =
|
|
69588
|
+
var node_11 = sibling(node_7, 2);
|
|
69589
|
+
var consequent_9 = ($$anchor) => {
|
|
69590
|
+
var fragment_3 = root_12();
|
|
68937
69591
|
var span_6 = first_child(fragment_3);
|
|
68938
|
-
var
|
|
69592
|
+
var text_7 = child(span_6);
|
|
68939
69593
|
reset(span_6);
|
|
68940
69594
|
next(2);
|
|
68941
69595
|
template_effect(() => {
|
|
68942
69596
|
var _$$get$size;
|
|
68943
|
-
return set_text(
|
|
69597
|
+
return set_text(text_7, `${(_$$get$size = get(currentSelectedIds).size) !== null && _$$get$size !== void 0 ? _$$get$size : ""} selected`);
|
|
68944
69598
|
});
|
|
68945
69599
|
append($$anchor, fragment_3);
|
|
68946
69600
|
};
|
|
68947
|
-
if_block(
|
|
68948
|
-
if (get(currentSelectedIds).size > 1) $$render(
|
|
69601
|
+
if_block(node_11, ($$render) => {
|
|
69602
|
+
if (get(currentSelectedIds).size > 1) $$render(consequent_9);
|
|
68949
69603
|
});
|
|
68950
|
-
var span_7 = sibling(
|
|
68951
|
-
var
|
|
69604
|
+
var span_7 = sibling(node_11, 2);
|
|
69605
|
+
var text_8 = child(span_7);
|
|
68952
69606
|
reset(span_7);
|
|
68953
69607
|
var button = sibling(span_7, 2);
|
|
68954
69608
|
var button_1 = sibling(button, 2);
|
|
68955
|
-
var
|
|
69609
|
+
var text_9 = child(button_1);
|
|
68956
69610
|
reset(button_1);
|
|
68957
69611
|
var button_2 = sibling(button_1, 2);
|
|
68958
|
-
var
|
|
69612
|
+
var text_10 = child(button_2);
|
|
68959
69613
|
reset(button_2);
|
|
68960
69614
|
var button_3 = sibling(button_2, 2);
|
|
68961
|
-
var
|
|
69615
|
+
var text_11 = child(button_3);
|
|
68962
69616
|
reset(button_3);
|
|
68963
69617
|
var button_4 = sibling(button_3, 2);
|
|
68964
69618
|
var button_5 = sibling(button_4, 2);
|
|
68965
|
-
var
|
|
69619
|
+
var text_12 = child(button_5);
|
|
68966
69620
|
reset(button_5);
|
|
68967
69621
|
var button_6 = sibling(button_5, 2);
|
|
68968
|
-
var
|
|
68969
|
-
|
|
69622
|
+
var text_13 = child(button_6);
|
|
69623
|
+
text_13.nodeValue = "🗺 Map";
|
|
68970
69624
|
reset(button_6);
|
|
68971
|
-
reset(
|
|
69625
|
+
reset(div_3);
|
|
68972
69626
|
template_effect(($0) => {
|
|
68973
|
-
set_text(
|
|
68974
|
-
set_text(
|
|
68975
|
-
set_text(
|
|
68976
|
-
set_text(
|
|
68977
|
-
set_text(
|
|
69627
|
+
set_text(text_8, `Zoom: ${$0 !== null && $0 !== void 0 ? $0 : ""}%`);
|
|
69628
|
+
set_text(text_9, `${get(showGrid) ? "▦" : "▢"} Grid`);
|
|
69629
|
+
set_text(text_10, `${get(currentSnapToGrid) ? "🧲" : "↔"} Snap`);
|
|
69630
|
+
set_text(text_11, `${get(showFurniture) ? "🪑" : "👻"} Furniture`);
|
|
69631
|
+
set_text(text_12, `${get(showRulers) ? "📏" : "📐"} Rulers`);
|
|
68978
69632
|
}, [() => Math.round(get(zoom) * 100)]);
|
|
68979
69633
|
delegated("click", button, () => zoomToFit());
|
|
68980
69634
|
delegated("click", button_1, () => set(showGrid, !get(showGrid)));
|
|
@@ -68989,38 +69643,39 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
68989
69643
|
delegated("click", button_4, () => set(showLayerPanel, !get(showLayerPanel)));
|
|
68990
69644
|
delegated("click", button_5, () => set(showRulers, !get(showRulers)));
|
|
68991
69645
|
delegated("click", button_6, () => set(showMinimap, !get(showMinimap)));
|
|
68992
|
-
append($$anchor,
|
|
69646
|
+
append($$anchor, div_3);
|
|
68993
69647
|
};
|
|
68994
|
-
if_block(
|
|
68995
|
-
if (!$$props.viewOnly) $$render(
|
|
69648
|
+
if_block(node_5, ($$render) => {
|
|
69649
|
+
if (!$$props.viewOnly) $$render(consequent_10);
|
|
68996
69650
|
});
|
|
68997
|
-
var
|
|
68998
|
-
var
|
|
68999
|
-
var
|
|
69000
|
-
var
|
|
69001
|
-
each(
|
|
69651
|
+
var node_12 = sibling(node_5, 2);
|
|
69652
|
+
var consequent_11 = ($$anchor) => {
|
|
69653
|
+
var div_4 = root_13();
|
|
69654
|
+
var node_13 = sibling(child(div_4), 2);
|
|
69655
|
+
each(node_13, 16, () => [
|
|
69002
69656
|
["walls", "Walls"],
|
|
69003
69657
|
["doors", "Doors"],
|
|
69004
69658
|
["windows", "Windows"],
|
|
69005
69659
|
["furniture", "Furniture"],
|
|
69006
69660
|
["stairs", "Stairs"],
|
|
69007
69661
|
["columns", "Columns"],
|
|
69662
|
+
["zones", "Areas"],
|
|
69008
69663
|
["guides", "Guides"],
|
|
69009
69664
|
["measurements", "Measurements"]
|
|
69010
69665
|
], index$1, ($$anchor, $$item) => {
|
|
69011
69666
|
var $$array = /* @__PURE__ */ user_derived(() => to_array($$item, 2));
|
|
69012
69667
|
let key = () => get($$array)[0];
|
|
69013
69668
|
let label = () => get($$array)[1];
|
|
69014
|
-
var label_1 =
|
|
69669
|
+
var label_1 = root_14();
|
|
69015
69670
|
var input_2 = child(label_1);
|
|
69016
69671
|
remove_input_defaults(input_2);
|
|
69017
69672
|
var span_8 = sibling(input_2, 2);
|
|
69018
|
-
var
|
|
69673
|
+
var text_14 = child(span_8, true);
|
|
69019
69674
|
reset(span_8);
|
|
69020
69675
|
reset(label_1);
|
|
69021
69676
|
template_effect(() => {
|
|
69022
69677
|
set_checked(input_2, get(layerVis)[key()]);
|
|
69023
|
-
set_text(
|
|
69678
|
+
set_text(text_14, label());
|
|
69024
69679
|
});
|
|
69025
69680
|
delegated("change", input_2, () => layerVisibility.update((v) => ({
|
|
69026
69681
|
...v,
|
|
@@ -69028,7 +69683,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69028
69683
|
})));
|
|
69029
69684
|
append($$anchor, label_1);
|
|
69030
69685
|
});
|
|
69031
|
-
var label_2 = sibling(
|
|
69686
|
+
var label_2 = sibling(node_13, 4);
|
|
69032
69687
|
var input_3 = child(label_2);
|
|
69033
69688
|
remove_input_defaults(input_3);
|
|
69034
69689
|
next(2);
|
|
@@ -69038,16 +69693,16 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69038
69693
|
remove_input_defaults(input_4);
|
|
69039
69694
|
next(2);
|
|
69040
69695
|
reset(label_3);
|
|
69041
|
-
reset(
|
|
69696
|
+
reset(div_4);
|
|
69042
69697
|
bind_checked(input_3, () => get(showRoomLabels), ($$value) => set(showRoomLabels, $$value));
|
|
69043
69698
|
bind_checked(input_4, () => get(showDimensions), ($$value) => set(showDimensions, $$value));
|
|
69044
|
-
append($$anchor,
|
|
69699
|
+
append($$anchor, div_4);
|
|
69045
69700
|
};
|
|
69046
|
-
if_block(
|
|
69047
|
-
if (get(showLayerPanel)) $$render(
|
|
69701
|
+
if_block(node_12, ($$render) => {
|
|
69702
|
+
if (get(showLayerPanel)) $$render(consequent_11);
|
|
69048
69703
|
});
|
|
69049
|
-
var
|
|
69050
|
-
var
|
|
69704
|
+
var node_14 = sibling(node_12, 2);
|
|
69705
|
+
var consequent_15 = ($$anchor) => {
|
|
69051
69706
|
const el = /* @__PURE__ */ user_derived(() => (() => {
|
|
69052
69707
|
const f = get(currentFloor);
|
|
69053
69708
|
const wall = f.walls.find((w) => w.id === get(currentSelectedId));
|
|
@@ -69080,24 +69735,24 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69080
69735
|
return null;
|
|
69081
69736
|
})());
|
|
69082
69737
|
var fragment_4 = comment();
|
|
69083
|
-
var
|
|
69084
|
-
var
|
|
69085
|
-
var
|
|
69086
|
-
var button_7 = child(
|
|
69087
|
-
var
|
|
69088
|
-
var
|
|
69089
|
-
var button_8 =
|
|
69738
|
+
var node_15 = first_child(fragment_4);
|
|
69739
|
+
var consequent_14 = ($$anchor) => {
|
|
69740
|
+
var div_5 = root_16();
|
|
69741
|
+
var button_7 = child(div_5);
|
|
69742
|
+
var node_16 = sibling(button_7, 2);
|
|
69743
|
+
var consequent_12 = ($$anchor) => {
|
|
69744
|
+
var button_8 = root_17();
|
|
69090
69745
|
delegated("click", button_8, () => {
|
|
69091
69746
|
if (get(el).door) updateDoor(get(el).door.id, { swingDirection: get(el).door.swingDirection === "left" ? "right" : "left" });
|
|
69092
69747
|
});
|
|
69093
69748
|
append($$anchor, button_8);
|
|
69094
69749
|
};
|
|
69095
|
-
if_block(
|
|
69096
|
-
if (get(el).type === "door" && get(el).door) $$render(
|
|
69750
|
+
if_block(node_16, ($$render) => {
|
|
69751
|
+
if (get(el).type === "door" && get(el).door) $$render(consequent_12);
|
|
69097
69752
|
});
|
|
69098
|
-
var
|
|
69099
|
-
var
|
|
69100
|
-
var button_9 =
|
|
69753
|
+
var node_17 = sibling(node_16, 2);
|
|
69754
|
+
var consequent_13 = ($$anchor) => {
|
|
69755
|
+
var button_9 = root_18();
|
|
69101
69756
|
delegated("click", button_9, () => {
|
|
69102
69757
|
if (get(currentSelectedId)) {
|
|
69103
69758
|
if (splitWall(get(currentSelectedId), .5)) selectedElementId.set(null);
|
|
@@ -69105,14 +69760,14 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69105
69760
|
});
|
|
69106
69761
|
append($$anchor, button_9);
|
|
69107
69762
|
};
|
|
69108
|
-
if_block(
|
|
69109
|
-
if (get(el).type === "wall" && get(currentSelectedId) && get(currentSelectedIds).size === 0) $$render(
|
|
69763
|
+
if_block(node_17, ($$render) => {
|
|
69764
|
+
if (get(el).type === "wall" && get(currentSelectedId) && get(currentSelectedIds).size === 0) $$render(consequent_13);
|
|
69110
69765
|
});
|
|
69111
|
-
var button_10 = sibling(
|
|
69112
|
-
reset(
|
|
69766
|
+
var button_10 = sibling(node_17, 4);
|
|
69767
|
+
reset(div_5);
|
|
69113
69768
|
template_effect(() => {
|
|
69114
69769
|
var _$$get$pos$x;
|
|
69115
|
-
return set_style(
|
|
69770
|
+
return set_style(div_5, `left: ${(_$$get$pos$x = get(el).pos.x) !== null && _$$get$pos$x !== void 0 ? _$$get$pos$x : ""}px; top: ${get(el).pos.y - 44}px; transform: translateX(-50%);`);
|
|
69116
69771
|
});
|
|
69117
69772
|
delegated("click", button_7, () => {
|
|
69118
69773
|
if (!get(currentSelectedId) || !get(currentFloor)) return;
|
|
@@ -69135,72 +69790,72 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69135
69790
|
selectedElementId.set(null);
|
|
69136
69791
|
}
|
|
69137
69792
|
});
|
|
69138
|
-
append($$anchor,
|
|
69793
|
+
append($$anchor, div_5);
|
|
69139
69794
|
};
|
|
69140
|
-
if_block(
|
|
69141
|
-
if (get(el)) $$render(
|
|
69795
|
+
if_block(node_15, ($$render) => {
|
|
69796
|
+
if (get(el)) $$render(consequent_14);
|
|
69142
69797
|
});
|
|
69143
69798
|
append($$anchor, fragment_4);
|
|
69144
69799
|
};
|
|
69145
|
-
if_block(
|
|
69146
|
-
if ((get(currentSelectedId) || get(currentSelectedIds).size > 0) && get(currentFloor) && get(currentTool) === "select") $$render(
|
|
69800
|
+
if_block(node_14, ($$render) => {
|
|
69801
|
+
if ((get(currentSelectedId) || get(currentSelectedIds).size > 0) && get(currentFloor) && get(currentTool) === "select") $$render(consequent_15);
|
|
69147
69802
|
});
|
|
69148
|
-
var
|
|
69803
|
+
var node_18 = sibling(node_14, 2);
|
|
69804
|
+
var consequent_16 = ($$anchor) => {
|
|
69805
|
+
append($$anchor, root_19());
|
|
69806
|
+
};
|
|
69807
|
+
if_block(node_18, ($$render) => {
|
|
69808
|
+
if (get(currentTool) === "wall" && get(wallStart)) $$render(consequent_16);
|
|
69809
|
+
});
|
|
69810
|
+
var node_19 = sibling(node_18, 2);
|
|
69149
69811
|
var consequent_17 = ($$anchor) => {
|
|
69150
|
-
|
|
69812
|
+
var div_7 = root_20();
|
|
69813
|
+
var text_15 = child(div_7);
|
|
69814
|
+
reset(div_7);
|
|
69815
|
+
template_effect(() => {
|
|
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
|
|
69818
|
+
to cancel`);
|
|
69819
|
+
});
|
|
69820
|
+
append($$anchor, div_7);
|
|
69151
69821
|
};
|
|
69152
69822
|
if_block(node_19, ($$render) => {
|
|
69153
|
-
if (get(currentTool) === "
|
|
69823
|
+
if (get(currentPlacingId) && get(currentTool) === "furniture") $$render(consequent_17);
|
|
69154
69824
|
});
|
|
69155
69825
|
var node_20 = sibling(node_19, 2);
|
|
69156
69826
|
var consequent_18 = ($$anchor) => {
|
|
69157
|
-
|
|
69158
|
-
var text_16 = child(div_8);
|
|
69159
|
-
reset(div_8);
|
|
69160
|
-
template_effect(() => {
|
|
69161
|
-
var _$$get16;
|
|
69162
|
-
return set_text(text_16, `Click to place · Scroll or R to rotate (${(_$$get16 = get(currentPlacingRotation)) !== null && _$$get16 !== void 0 ? _$$get16 : ""}°) · Esc
|
|
69163
|
-
to cancel`);
|
|
69164
|
-
});
|
|
69165
|
-
append($$anchor, div_8);
|
|
69827
|
+
append($$anchor, root_21());
|
|
69166
69828
|
};
|
|
69167
69829
|
if_block(node_20, ($$render) => {
|
|
69168
|
-
if (get(
|
|
69830
|
+
if (get(measuring)) $$render(consequent_18);
|
|
69169
69831
|
});
|
|
69170
69832
|
var node_21 = sibling(node_20, 2);
|
|
69171
69833
|
var consequent_19 = ($$anchor) => {
|
|
69172
69834
|
append($$anchor, root_22());
|
|
69173
69835
|
};
|
|
69174
69836
|
if_block(node_21, ($$render) => {
|
|
69175
|
-
if (get(
|
|
69837
|
+
if (get(textAnnotationMode)) $$render(consequent_19);
|
|
69176
69838
|
});
|
|
69177
69839
|
var node_22 = sibling(node_21, 2);
|
|
69178
69840
|
var consequent_20 = ($$anchor) => {
|
|
69179
|
-
|
|
69841
|
+
var div_10 = root_23();
|
|
69842
|
+
var text_16 = child(div_10);
|
|
69843
|
+
reset(div_10);
|
|
69844
|
+
template_effect(() => set_text(text_16, `${get(annotationStart) ? "Click second point to create annotation" : "Click first point"} · N to exit · Esc to cancel`));
|
|
69845
|
+
append($$anchor, div_10);
|
|
69180
69846
|
};
|
|
69181
69847
|
if_block(node_22, ($$render) => {
|
|
69182
|
-
if (get(
|
|
69848
|
+
if (get(annotating)) $$render(consequent_20);
|
|
69183
69849
|
});
|
|
69184
|
-
var
|
|
69185
|
-
var
|
|
69186
|
-
var div_11 = root_24();
|
|
69187
|
-
var text_17 = child(div_11);
|
|
69188
|
-
reset(div_11);
|
|
69189
|
-
template_effect(() => set_text(text_17, `${get(annotationStart) ? "Click second point to create annotation" : "Click first point"} · N to exit · Esc to cancel`));
|
|
69190
|
-
append($$anchor, div_11);
|
|
69191
|
-
};
|
|
69192
|
-
if_block(node_23, ($$render) => {
|
|
69193
|
-
if (get(annotating)) $$render(consequent_21);
|
|
69194
|
-
});
|
|
69195
|
-
var div_12 = sibling(node_23, 2);
|
|
69196
|
-
var button_11 = child(div_12);
|
|
69850
|
+
var div_11 = sibling(node_22, 2);
|
|
69851
|
+
var button_11 = child(div_11);
|
|
69197
69852
|
var button_12 = sibling(button_11, 2);
|
|
69198
|
-
var
|
|
69853
|
+
var text_17 = child(button_12);
|
|
69199
69854
|
reset(button_12);
|
|
69200
69855
|
var button_13 = sibling(button_12, 2);
|
|
69201
69856
|
var button_14 = sibling(button_13, 4);
|
|
69202
|
-
reset(
|
|
69203
|
-
ContextMenu(sibling(
|
|
69857
|
+
reset(div_11);
|
|
69858
|
+
ContextMenu(sibling(div_11, 2), {
|
|
69204
69859
|
get x() {
|
|
69205
69860
|
return get(ctxMenuX);
|
|
69206
69861
|
},
|
|
@@ -69233,7 +69888,7 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69233
69888
|
},
|
|
69234
69889
|
onaction: handleContextMenuAction
|
|
69235
69890
|
});
|
|
69236
|
-
template_effect(($0) => set_text(
|
|
69891
|
+
template_effect(($0) => set_text(text_17, `${$0 !== null && $0 !== void 0 ? $0 : ""}%`), [() => Math.round(get(zoom) * 100)]);
|
|
69237
69892
|
delegated("click", button_11, () => {
|
|
69238
69893
|
const newZoom = Math.max(.1, get(zoom) * .8);
|
|
69239
69894
|
const worldCX = (get(width) / 2 - get(width) / 2) / get(zoom) + get(camX);
|
|
@@ -69254,8 +69909,8 @@ function FloorPlanCanvas($$anchor, $$props) {
|
|
|
69254
69909
|
delegated("click", button_14, () => zoomToFit());
|
|
69255
69910
|
append($$anchor, fragment);
|
|
69256
69911
|
};
|
|
69257
|
-
if_block(
|
|
69258
|
-
if (!$$props.viewOnly) $$render(
|
|
69912
|
+
if_block(node, ($$render) => {
|
|
69913
|
+
if (!$$props.viewOnly) $$render(consequent_21);
|
|
69259
69914
|
});
|
|
69260
69915
|
reset(div);
|
|
69261
69916
|
template_effect(($0) => {
|
|
@@ -70366,12 +71021,14 @@ function syncAssignedCameras(assigned) {
|
|
|
70366
71021
|
if (!propsEqual(item.props, nextProps) || item.name !== nextProps.name) applyCameraProps(item.id, assignedCam);
|
|
70367
71022
|
}
|
|
70368
71023
|
if (!hasFloorLayout) {
|
|
71024
|
+
syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
|
|
70369
71025
|
if (hostDrivesAssignment || newSerials.size > 0) lastSyncedSerials = newSerials;
|
|
70370
71026
|
return;
|
|
70371
71027
|
}
|
|
70372
71028
|
const center = getFloorCenter(floorAfterRemove);
|
|
70373
71029
|
if (!center) {
|
|
70374
71030
|
rejectNoFloor(toAdd);
|
|
71031
|
+
syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
|
|
70375
71032
|
if (hostDrivesAssignment || newSerials.size > 0) lastSyncedSerials = newSerials;
|
|
70376
71033
|
return;
|
|
70377
71034
|
}
|
|
@@ -70383,11 +71040,35 @@ function syncAssignedCameras(assigned) {
|
|
|
70383
71040
|
applyCameraProps(addFurniture("camera", findOpenCameraPosition(workingFloor, center)), cam);
|
|
70384
71041
|
workingFloor = get$1(activeFloor);
|
|
70385
71042
|
}
|
|
71043
|
+
syncZonesFromAssigned(assignedBySerial, hostDrivesAssignment);
|
|
70386
71044
|
lastSyncedSerials = newSerials;
|
|
70387
71045
|
} finally {
|
|
70388
71046
|
setAssignedCamerasSyncing(false);
|
|
70389
71047
|
}
|
|
70390
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
|
+
}
|
|
70391
71072
|
//#endregion
|
|
70392
71073
|
//#region src/App.svelte
|
|
70393
71074
|
init_client();
|
|
@@ -70575,35 +71256,31 @@ function App($$anchor, $$props) {
|
|
|
70575
71256
|
});
|
|
70576
71257
|
let $6 = /* @__PURE__ */ user_derived(() => {
|
|
70577
71258
|
var _$$get8;
|
|
70578
|
-
return (_$$get8 = get(config)) === null || _$$get8 === void 0 ? void 0 : _$$get8.
|
|
71259
|
+
return (_$$get8 = get(config)) === null || _$$get8 === void 0 ? void 0 : _$$get8.selectedCameraSerial;
|
|
70579
71260
|
});
|
|
70580
71261
|
let $7 = /* @__PURE__ */ user_derived(() => {
|
|
70581
71262
|
var _$$get9;
|
|
70582
|
-
return (_$$get9 = get(config)) === null || _$$get9 === void 0 ? void 0 : _$$get9.
|
|
71263
|
+
return (_$$get9 = get(config)) === null || _$$get9 === void 0 ? void 0 : _$$get9.showCameraCones;
|
|
70583
71264
|
});
|
|
70584
71265
|
let $8 = /* @__PURE__ */ user_derived(() => {
|
|
70585
71266
|
var _$$get10;
|
|
70586
|
-
return (_$$get10 = get(config)) === null || _$$get10 === void 0 ? void 0 : _$$get10.
|
|
71267
|
+
return (_$$get10 = get(config)) === null || _$$get10 === void 0 ? void 0 : _$$get10.showCameraLabels;
|
|
70587
71268
|
});
|
|
70588
71269
|
let $9 = /* @__PURE__ */ user_derived(() => {
|
|
70589
71270
|
var _$$get11;
|
|
70590
|
-
return (_$$get11 = get(config)) === null || _$$get11 === void 0 ? void 0 : _$$get11.
|
|
71271
|
+
return (_$$get11 = get(config)) === null || _$$get11 === void 0 ? void 0 : _$$get11.cameraHeatmapMatrix;
|
|
70591
71272
|
});
|
|
70592
71273
|
let $10 = /* @__PURE__ */ user_derived(() => {
|
|
70593
71274
|
var _$$get12;
|
|
70594
|
-
return (_$$get12 = get(config)) === null || _$$get12 === void 0 ? void 0 : _$$get12.
|
|
71275
|
+
return ((_$$get12 = get(config)) === null || _$$get12 === void 0 ? void 0 : _$$get12.cameraThumbnail) || "";
|
|
70595
71276
|
});
|
|
70596
71277
|
let $11 = /* @__PURE__ */ user_derived(() => {
|
|
70597
71278
|
var _$$get13;
|
|
70598
|
-
return (
|
|
71279
|
+
return (_$$get13 = get(config)) === null || _$$get13 === void 0 ? void 0 : _$$get13.canvasBackground;
|
|
70599
71280
|
});
|
|
70600
71281
|
let $12 = /* @__PURE__ */ user_derived(() => {
|
|
70601
71282
|
var _$$get14;
|
|
70602
|
-
return (_$$get14 = get(config)) === null || _$$get14 === void 0 ? void 0 : _$$get14.
|
|
70603
|
-
});
|
|
70604
|
-
let $13 = /* @__PURE__ */ user_derived(() => {
|
|
70605
|
-
var _$$get15;
|
|
70606
|
-
return (_$$get15 = get(config)) === null || _$$get15 === void 0 ? void 0 : _$$get15.floorPlateBackground;
|
|
71283
|
+
return (_$$get14 = get(config)) === null || _$$get14 === void 0 ? void 0 : _$$get14.floorPlateBackground;
|
|
70607
71284
|
});
|
|
70608
71285
|
FloorPlanCanvas(node_4, {
|
|
70609
71286
|
get viewOnly() {
|
|
@@ -70624,29 +71301,26 @@ function App($$anchor, $$props) {
|
|
|
70624
71301
|
get heatmapColorScale() {
|
|
70625
71302
|
return get($5);
|
|
70626
71303
|
},
|
|
70627
|
-
get projectName() {
|
|
70628
|
-
return get($6);
|
|
70629
|
-
},
|
|
70630
71304
|
get selectedCameraSerial() {
|
|
70631
|
-
return get($
|
|
71305
|
+
return get($6);
|
|
70632
71306
|
},
|
|
70633
71307
|
get showCameraCones() {
|
|
70634
|
-
return get($
|
|
71308
|
+
return get($7);
|
|
70635
71309
|
},
|
|
70636
71310
|
get showCameraLabels() {
|
|
70637
|
-
return get($
|
|
71311
|
+
return get($8);
|
|
70638
71312
|
},
|
|
70639
71313
|
get cameraHeatmapMatrix() {
|
|
70640
|
-
return get($
|
|
71314
|
+
return get($9);
|
|
70641
71315
|
},
|
|
70642
71316
|
get cameraThumbnail() {
|
|
70643
|
-
return get($
|
|
71317
|
+
return get($10);
|
|
70644
71318
|
},
|
|
70645
71319
|
get canvasBackground() {
|
|
70646
|
-
return get($
|
|
71320
|
+
return get($11);
|
|
70647
71321
|
},
|
|
70648
71322
|
get floorPlateBackground() {
|
|
70649
|
-
return get($
|
|
71323
|
+
return get($12);
|
|
70650
71324
|
}
|
|
70651
71325
|
});
|
|
70652
71326
|
}
|
|
@@ -70675,12 +71349,12 @@ function App($$anchor, $$props) {
|
|
|
70675
71349
|
{
|
|
70676
71350
|
let $0 = /* @__PURE__ */ user_derived(() => get(mode) === "3d");
|
|
70677
71351
|
let $1 = /* @__PURE__ */ user_derived(() => {
|
|
70678
|
-
var _$$get$siteCameras, _$$
|
|
70679
|
-
return (_$$get$siteCameras = (_$$
|
|
71352
|
+
var _$$get$siteCameras, _$$get15;
|
|
71353
|
+
return (_$$get$siteCameras = (_$$get15 = get(config)) === null || _$$get15 === void 0 ? void 0 : _$$get15.siteCameras) !== null && _$$get$siteCameras !== void 0 ? _$$get$siteCameras : [];
|
|
70680
71354
|
});
|
|
70681
71355
|
let $2 = /* @__PURE__ */ user_derived(() => {
|
|
70682
|
-
var _$$get$cameraThumbnai, _$$
|
|
70683
|
-
return (_$$get$cameraThumbnai = (_$$
|
|
71356
|
+
var _$$get$cameraThumbnai, _$$get16;
|
|
71357
|
+
return (_$$get$cameraThumbnai = (_$$get16 = get(config)) === null || _$$get16 === void 0 ? void 0 : _$$get16.cameraThumbnail) !== null && _$$get$cameraThumbnai !== void 0 ? _$$get$cameraThumbnai : "";
|
|
70684
71358
|
});
|
|
70685
71359
|
PropertiesPanel($$anchor, {
|
|
70686
71360
|
get is3D() {
|