@polycyphers/bim 0.1.1 → 0.1.2

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/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { createContext as e, useCallback as t, useContext as n, useEffect as r, useRef as i, useState as a } from "react";
2
2
  import o from "dompurify";
3
- import { disableTelemetry as s, disableTelemetry as c, enableTelemetry as l, setBrand as u, verifySystemMessage as ee } from "@polycyphers/license";
4
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
3
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { disableTelemetry as u, disableTelemetry as d, enableTelemetry as f, setBrand as p, verifySystemMessage as m } from "@polycyphers/license";
5
5
  // src/i18n.ts
6
- var m = {
6
+ var h = {
7
7
  studio: "Open studio",
8
8
  pricing: "Pricing",
9
9
  start: "Start with your sketch",
@@ -67,10 +67,10 @@ var m = {
67
67
  account: "Account",
68
68
  cancel: "Cancel",
69
69
  close: "Close"
70
- }, h = {
71
- en: m,
70
+ }, g = {
71
+ en: h,
72
72
  de: {
73
- ...m,
73
+ ...h,
74
74
  studio: "Studio öffnen",
75
75
  pricing: "Preise",
76
76
  start: "Mit Ihrer Skizze starten",
@@ -111,7 +111,7 @@ var m = {
111
111
  close: "Schließen"
112
112
  },
113
113
  fr: {
114
- ...m,
114
+ ...h,
115
115
  studio: "Ouvrir le studio",
116
116
  pricing: "Tarifs",
117
117
  start: "Commencez par votre croquis",
@@ -152,7 +152,7 @@ var m = {
152
152
  close: "Fermer"
153
153
  },
154
154
  ar: {
155
- ...m,
155
+ ...h,
156
156
  studio: "فتح الاستوديو",
157
157
  pricing: "الأسعار",
158
158
  start: "ابدأ برسمك",
@@ -193,7 +193,7 @@ var m = {
193
193
  close: "إغلاق"
194
194
  }
195
195
  };
196
- Object.assign(h.de, {
196
+ Object.assign(g.de, {
197
197
  workspace: "Wohnungskonzept",
198
198
  example: "Referenzprojekt · vor Ort bestätigte Geometrie",
199
199
  back: "Alle Projekte",
@@ -219,7 +219,7 @@ Object.assign(h.de, {
219
219
  width: "Breite",
220
220
  depth: "Tiefe",
221
221
  account: "Konto"
222
- }), Object.assign(h.fr, {
222
+ }), Object.assign(g.fr, {
223
223
  workspace: "Concept d’appartement",
224
224
  example: "Projet de référence · géométrie confirmée sur site",
225
225
  back: "Tous les projets",
@@ -245,7 +245,7 @@ Object.assign(h.de, {
245
245
  width: "Largeur",
246
246
  depth: "Profondeur",
247
247
  account: "Compte"
248
- }), Object.assign(h.ar, {
248
+ }), Object.assign(g.ar, {
249
249
  workspace: "تصوّر شقة",
250
250
  example: "مشروع مرجعي · هندسة مؤكدة ميدانياً",
251
251
  back: "كل المشاريع",
@@ -273,7 +273,7 @@ Object.assign(h.de, {
273
273
  account: "الحساب"
274
274
  });
275
275
  // src/workflowText.ts
276
- var g = {
276
+ var _ = {
277
277
  de: {
278
278
  "New project": "Neues Projekt",
279
279
  "Enter measurements": "Maße eingeben",
@@ -410,7 +410,7 @@ var g = {
410
410
  "Discrepancy report": "تقرير الفروقات"
411
411
  }
412
412
  };
413
- Object.assign(g.de, {
413
+ Object.assign(_.de, {
414
414
  "Plan your next space": "Ihren nächsten Raum planen",
415
415
  "Apartment layout": "Wohnungsgrundriss",
416
416
  "House extension": "Hausanbau",
@@ -473,7 +473,7 @@ Object.assign(g.de, {
473
473
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "Der Dienst prüft und normalisiert das Bild vor der Speicherung. Die Dateiauswahl allein sendet es nicht an einen KI-Anbieter. Erst die angeforderte Skizzenanalyse übermittelt das bereinigte Bild an Anthropic Claude. EU-Speicherung bestimmt nicht den Ort der KI-Verarbeitung; Anbieterregion und Datenschutzbedingungen müssen konfiguriert werden.",
474
474
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "Die Analyse sendet dieses bereinigte Bild an Anthropic Claude. EU-Speicherung und KI-Verarbeitungsort sind getrennt; der Dienst muss die Datenschutzbedingungen konfigurieren.",
475
475
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "Damit wird die Löschung Ihrer Projekte, Skizzen und erzeugten Dateien in diesem Dienst angefordert. Kontoidentität, Abrechnungsdaten und notwendige Missbrauchsschutzdaten bleiben erhalten. Offene Abrechnung kann den Abschluss verzögern; das Ergebnis des Dienstes wird angezeigt."
476
- }), Object.assign(g.fr, {
476
+ }), Object.assign(_.fr, {
477
477
  "Plan your next space": "Préparez votre prochain espace",
478
478
  "Apartment layout": "Plan d’appartement",
479
479
  "House extension": "Extension de maison",
@@ -536,7 +536,7 @@ Object.assign(g.de, {
536
536
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "Le service contrôle et normalise l’image avant stockage. La sélection d’un fichier ne l’envoie pas à un fournisseur d’IA. Seule la lecture explicitement demandée transmet l’image assainie à Anthropic Claude. Le stockage dans l’UE ne détermine pas le lieu d’inférence ; la région du fournisseur et les conditions de traitement doivent être configurées.",
537
537
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "La lecture transmet cette image assainie à Anthropic Claude. Le stockage dans l’UE et le lieu d’inférence sont distincts ; le service doit configurer les conditions de traitement.",
538
538
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "Cette demande concerne les projets, croquis et fichiers générés dans ce service. L’identité du compte, la facturation et les données anti-abus nécessaires sont conservées. Une comptabilisation en attente peut retarder la suppression ; le résultat du service sera affiché."
539
- }), Object.assign(g.ar, {
539
+ }), Object.assign(_.ar, {
540
540
  "Plan your next space": "خطّط لمساحتك القادمة",
541
541
  "Apartment layout": "تخطيط شقة",
542
542
  "House extension": "توسعة منزل",
@@ -599,99 +599,261 @@ Object.assign(g.de, {
599
599
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "يفحص النظام الصورة ويوحّد تنسيقها قبل التخزين. اختيار الملف وحده لا يرسله إلى مزوّد ذكاء اصطناعي. تُرسل الصورة المنقّحة إلى Anthropic Claude فقط عند طلب قراءة الرسم المحفوظ. التخزين الأوروبي مستقل عن موقع المعالجة؛ يجب ضبط منطقة المزوّد وشروط معالجة البيانات.",
600
600
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "ترسل القراءة هذه الصورة المنقّحة إلى Anthropic Claude. التخزين الأوروبي وموقع المعالجة مستقلان؛ يجب أن يضبط النظام شروط معالجة البيانات.",
601
601
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "يطلب هذا حذف المشاريع والرسوم والملفات الناتجة في هذه الخدمة. تبقى هوية الحساب والفواتير وسجلات مكافحة الإساءة الضرورية محفوظة. قد تؤخر المحاسبة المعلّقة الإتمام؛ نعرض نتيجة الخدمة."
602
- }), Object.assign(g.de, {
602
+ }), Object.assign(_.de, {
603
603
  "Verifying component license…": "Komponentenlizenz wird geprüft…",
604
604
  "A valid component license is required": "Eine gültige Komponentenlizenz ist erforderlich",
605
605
  "The studio stays closed until its installation license and signed revocation status are verified.": "Das Studio bleibt geschlossen, bis Installationslizenz und signierter Sperrstatus geprüft sind.",
606
606
  "Check license again": "Lizenz erneut prüfen",
607
607
  "License management": "Lizenzverwaltung"
608
- }), Object.assign(g.fr, {
608
+ }), Object.assign(_.fr, {
609
609
  "Verifying component license…": "Vérification de la licence du composant…",
610
610
  "A valid component license is required": "Une licence valide du composant est requise",
611
611
  "The studio stays closed until its installation license and signed revocation status are verified.": "Le studio reste fermé tant que la licence d’installation et son état de révocation signé ne sont pas vérifiés.",
612
612
  "Check license again": "Vérifier à nouveau la licence",
613
613
  "License management": "Gestion des licences"
614
- }), Object.assign(g.ar, {
614
+ }), Object.assign(_.ar, {
615
615
  "Verifying component license…": "جارٍ التحقق من ترخيص المكوّن…",
616
616
  "A valid component license is required": "يلزم ترخيص صالح للمكوّن",
617
617
  "The studio stays closed until its installation license and signed revocation status are verified.": "يبقى الاستوديو مغلقاً حتى التحقق من ترخيص التثبيت وحالة الإلغاء الموقّعة.",
618
618
  "Check license again": "إعادة فحص الترخيص",
619
619
  "License management": "إدارة التراخيص"
620
+ }), Object.assign(_.de, {
621
+ "No layout proposal is available": "Kein Grundrissvorschlag verfügbar",
622
+ "Your measurements are retained. Review the engine findings and measurements before trying again.": "Ihre Maße bleiben erhalten. Prüfen Sie die Hinweise der Engine und die Maße vor einem neuen Versuch.",
623
+ "Review measurements": "Maße überprüfen"
624
+ }), Object.assign(_.fr, {
625
+ "No layout proposal is available": "Aucune proposition de plan disponible",
626
+ "Your measurements are retained. Review the engine findings and measurements before trying again.": "Vos mesures sont conservées. Vérifiez les observations du moteur et les mesures avant de réessayer.",
627
+ "Review measurements": "Vérifier les mesures"
628
+ }), Object.assign(_.ar, {
629
+ "No layout proposal is available": "لا يتوفر مقترح مخطط",
630
+ "Your measurements are retained. Review the engine findings and measurements before trying again.": "تبقى أبعادك محفوظة. راجع ملاحظات المحرك والأبعاد قبل المحاولة مجدداً.",
631
+ "Review measurements": "مراجعة الأبعاد"
632
+ }), Object.assign(_.de, {
633
+ "Saved as a new version. Earlier versions are unchanged.": "Als neue Version gespeichert. Frühere Versionen bleiben unverändert.",
634
+ "Hide version history": "Versionsverlauf ausblenden",
635
+ "Version history & compare": "Versionsverlauf und Vergleich",
636
+ "Saved versions": "Gespeicherte Versionen",
637
+ "History and comparison are read-only. Restoring creates a new version after the service checks the current version.": "Verlauf und Vergleich sind schreibgeschützt. Eine Wiederherstellung erstellt nach Prüfung der aktuellen Version eine neue Version.",
638
+ "Earlier version": "Frühere Version",
639
+ "Later version": "Spätere Version",
640
+ "Compare saved versions": "Gespeicherte Versionen vergleichen",
641
+ "Restore earlier version": "Frühere Version wiederherstellen",
642
+ "Footprint area change": "Änderung der Grundfläche",
643
+ "Engine comparison of saved inputs. Source measurements retain their uncertainty.": "Engine-Vergleich gespeicherter Eingaben. Die Ausgangsmaße behalten ihre Unsicherheit.",
644
+ "Selected layout": "Gewählter Grundriss",
645
+ "Changed inputs": "Geänderte Eingaben",
646
+ "No input changes reported.": "Keine geänderten Eingaben gemeldet."
647
+ }), Object.assign(_.fr, {
648
+ "Saved as a new version. Earlier versions are unchanged.": "Enregistré comme nouvelle version. Les versions précédentes restent inchangées.",
649
+ "Hide version history": "Masquer l’historique",
650
+ "Version history & compare": "Historique et comparaison",
651
+ "Saved versions": "Versions enregistrées",
652
+ "History and comparison are read-only. Restoring creates a new version after the service checks the current version.": "L’historique et la comparaison sont en lecture seule. La restauration crée une nouvelle version après contrôle de la version actuelle.",
653
+ "Earlier version": "Version précédente",
654
+ "Later version": "Version suivante",
655
+ "Compare saved versions": "Comparer les versions enregistrées",
656
+ "Restore earlier version": "Restaurer la version précédente",
657
+ "Footprint area change": "Variation de surface du contour",
658
+ "Engine comparison of saved inputs. Source measurements retain their uncertainty.": "Comparaison des entrées enregistrées par le moteur. Les mesures sources conservent leur incertitude.",
659
+ "Selected layout": "Plan sélectionné",
660
+ "Changed inputs": "Entrées modifiées",
661
+ "No input changes reported.": "Aucune modification des entrées signalée."
662
+ }), Object.assign(_.ar, {
663
+ "Saved as a new version. Earlier versions are unchanged.": "حُفظ كنسخة جديدة. تبقى النسخ السابقة دون تغيير.",
664
+ "Hide version history": "إخفاء سجل النسخ",
665
+ "Version history & compare": "سجل النسخ والمقارنة",
666
+ "Saved versions": "النسخ المحفوظة",
667
+ "History and comparison are read-only. Restoring creates a new version after the service checks the current version.": "السجل والمقارنة للقراءة فقط. تنشئ الاستعادة نسخة جديدة بعد تحقق النظام من النسخة الحالية.",
668
+ "Earlier version": "النسخة السابقة",
669
+ "Later version": "النسخة اللاحقة",
670
+ "Compare saved versions": "مقارنة النسخ المحفوظة",
671
+ "Restore earlier version": "استعادة النسخة السابقة",
672
+ "Footprint area change": "تغيّر مساحة المحيط",
673
+ "Engine comparison of saved inputs. Source measurements retain their uncertainty.": "مقارنة المحرك للمدخلات المحفوظة. تبقى أبعاد المصدر غير مؤكدة.",
674
+ "Selected layout": "المخطط المختار",
675
+ "Changed inputs": "المدخلات المتغيّرة",
676
+ "No input changes reported.": "لم تُسجّل تغييرات في المدخلات."
620
677
  });
621
- function _(e, t) {
622
- return e === "en" ? t : g[e][t] ?? t;
678
+ function v(e, t) {
679
+ return e === "en" ? t : _[e][t] ?? t;
680
+ }
681
+ // src/VersionHistory.tsx
682
+ function ee({ language: e, version: t, busy: n, preview: r, open: i, versions: a, comparison: o, left: s, right: u, onToggle: d, onLeftChange: f, onRightChange: p, onCompare: m, onRestore: h }) {
683
+ let g = a?.some((e) => e.version === s), _ = a?.some((e) => e.version === u);
684
+ return /* @__PURE__ */ l("section", {
685
+ className: "paper version-history",
686
+ children: [/* @__PURE__ */ c("button", {
687
+ className: "outline",
688
+ disabled: n,
689
+ "aria-expanded": i,
690
+ "aria-controls": "bim-version-history",
691
+ onClick: d,
692
+ children: v(e, i ? "Hide version history" : "Version history & compare")
693
+ }), i && a && /* @__PURE__ */ l("div", {
694
+ id: "bim-version-history",
695
+ children: [
696
+ /* @__PURE__ */ c("h3", { children: v(e, "Saved versions") }),
697
+ /* @__PURE__ */ c("p", { children: v(e, "History and comparison are read-only. Restoring creates a new version after the service checks the current version.") }),
698
+ /* @__PURE__ */ c("ul", { children: a.map((t) => /* @__PURE__ */ l("li", { children: [
699
+ /* @__PURE__ */ l("strong", { children: ["v", t.version] }),
700
+ " · ",
701
+ new Date(t.createdAtUtc).toLocaleString(e),
702
+ t.selectedProposalId ? " · " + t.selectedProposalId : "",
703
+ t.note ? " · " + t.note : ""
704
+ ] }, t.version)) }),
705
+ /* @__PURE__ */ l("div", {
706
+ className: "actions",
707
+ children: [
708
+ /* @__PURE__ */ l("label", {
709
+ className: "field",
710
+ children: [v(e, "Earlier version"), /* @__PURE__ */ c("select", {
711
+ disabled: n,
712
+ value: s,
713
+ onChange: (e) => f(Number(e.target.value)),
714
+ children: a.map((e) => /* @__PURE__ */ l("option", {
715
+ value: e.version,
716
+ children: ["v", e.version]
717
+ }, e.version))
718
+ })]
719
+ }),
720
+ /* @__PURE__ */ l("label", {
721
+ className: "field",
722
+ children: [v(e, "Later version"), /* @__PURE__ */ c("select", {
723
+ disabled: n,
724
+ value: u,
725
+ onChange: (e) => p(Number(e.target.value)),
726
+ children: a.map((e) => /* @__PURE__ */ l("option", {
727
+ value: e.version,
728
+ children: ["v", e.version]
729
+ }, e.version))
730
+ })]
731
+ }),
732
+ /* @__PURE__ */ c("button", {
733
+ className: "outline",
734
+ disabled: n || s === u || !g || !_,
735
+ onClick: m,
736
+ children: v(e, "Compare saved versions")
737
+ }),
738
+ /* @__PURE__ */ c("button", {
739
+ className: "outline",
740
+ disabled: n || r || s === t || !g,
741
+ onClick: h,
742
+ children: v(e, "Restore earlier version")
743
+ })
744
+ ]
745
+ }),
746
+ o && /* @__PURE__ */ l("article", {
747
+ className: "comparison-summary",
748
+ role: "status",
749
+ children: [
750
+ /* @__PURE__ */ l("h4", { children: [
751
+ "v",
752
+ o.leftVersion,
753
+ " → v",
754
+ o.rightVersion
755
+ ] }),
756
+ o.areaDeltaM2 != null && /* @__PURE__ */ l("p", { children: [
757
+ v(e, "Footprint area change"),
758
+ ": ",
759
+ o.areaDeltaM2.toLocaleString(e, { maximumFractionDigits: 4 }),
760
+ " m² ",
761
+ /* @__PURE__ */ l("small", {
762
+ className: "value-tag",
763
+ children: [
764
+ v(e, "calculated"),
765
+ " · ",
766
+ v(e, "unconfirmed")
767
+ ]
768
+ })
769
+ ] }),
770
+ /* @__PURE__ */ c("p", { children: v(e, "Engine comparison of saved inputs. Source measurements retain their uncertainty.") }),
771
+ /* @__PURE__ */ l("p", { children: [
772
+ v(e, "Selected layout"),
773
+ ": ",
774
+ o.leftProposalId ?? "—",
775
+ " → ",
776
+ o.rightProposalId ?? "—"
777
+ ] }),
778
+ /* @__PURE__ */ c("h4", { children: v(e, "Changed inputs") }),
779
+ o.changedInputs.length ? /* @__PURE__ */ c("ul", { children: o.changedInputs.map((e, t) => /* @__PURE__ */ c("li", { children: e }, t)) }) : /* @__PURE__ */ c("p", { children: v(e, "No input changes reported.") })
780
+ ]
781
+ })
782
+ ]
783
+ })]
784
+ });
623
785
  }
624
786
  // src/packageVersion.ts
625
- var v = "0.1.1";
787
+ var te = "0.1.2";
626
788
  // src/licensing.ts
627
- c();
628
- var y = "bim", te = v, b = "https://licenseapi.polycyphers.com/api/license/revoked.json", x = "polycyphers-revocation-list", ne = 1048576, re = 86400, S = 6e4, ie = "", C = 0, w = "not_set", T = null, E = null, ae = /* @__PURE__ */ new Set();
629
- function D(e) {
630
- u(e === "karamentreprises" ? "karament" : null);
789
+ d();
790
+ var ne = "bim", y = te, b = "https://licenseapi.polycyphers.com/api/license/revoked.json", re = "polycyphers-revocation-list", x = 1048576, S = 86400, ie = 6e4, ae = "", C = 0, oe = "not_set", w = null, T = null, E = /* @__PURE__ */ new Set();
791
+ function se(e) {
792
+ p(e === "karamentreprises" ? "karament" : null);
631
793
  }
632
- function O(e) {
794
+ function ce(e) {
633
795
  let t = typeof e == "string" ? e.trim() : "";
634
- if (t !== ie) {
635
- ie = t, C++, T = null, w = t ? "checking" : "not_set";
636
- for (let e of ae) try {
796
+ if (t !== ae) {
797
+ ae = t, C++, w = null, oe = t ? "checking" : "not_set";
798
+ for (let e of E) try {
637
799
  e();
638
800
  } catch {}
639
801
  }
640
802
  }
641
- function oe() {
642
- O("");
803
+ function D() {
804
+ ce("");
643
805
  }
644
- function se(e) {
645
- return ae.add(e), () => {
646
- ae.delete(e);
806
+ function O(e) {
807
+ return E.add(e), () => {
808
+ E.delete(e);
647
809
  };
648
810
  }
649
- function ce() {
650
- return T ? Date.now() >= T.expires ? "expired" : Date.now() < T.until ? T.status : "checking" : w;
811
+ function le() {
812
+ return w ? Date.now() >= w.expires ? "expired" : Date.now() < w.until ? w.status : "checking" : oe;
651
813
  }
652
- function k(e) {
814
+ function ue(e) {
653
815
  return !!e && typeof e == "object" && !Array.isArray(e);
654
816
  }
655
- function A(e, t = 256) {
817
+ function k(e, t = 256) {
656
818
  return typeof e == "string" && e.length > 0 && e.length <= t && !/[\u0000-\u001f\u007f]/.test(e);
657
819
  }
658
- function j(e) {
820
+ function A(e) {
659
821
  return typeof e == "number" && Number.isSafeInteger(e) && e > 0;
660
822
  }
661
- function M(e) {
823
+ function de(e) {
662
824
  if (e.length > 32768 || !/^[-_A-Za-z0-9]+\.[-_A-Za-z0-9]+$/.test(e)) return null;
663
825
  try {
664
826
  let t = Uint8Array.from(atob(e.split(".")[0].replace(/-/g, "+").replace(/_/g, "/")), (e) => e.charCodeAt(0)), n = JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(t));
665
- return k(n) ? n : null;
827
+ return ue(n) ? n : null;
666
828
  } catch {
667
829
  return null;
668
830
  }
669
831
  }
670
- function le(e) {
832
+ function fe(e) {
671
833
  if (e === "*") return !0;
672
- let t = e.split("."), n = te.split(".");
834
+ let t = e.split("."), n = y.split(".");
673
835
  return t.length <= 3 && t.every((e, t) => e === "x" || e === "*" || /^\d+$/.test(e) && e === n[t]);
674
836
  }
675
- function ue(e) {
676
- if (!A(e, 253)) return !1;
837
+ function j(e) {
838
+ if (!k(e, 253)) return !1;
677
839
  let t = e.toLowerCase().replace(/^\*\./, "").replace(/^\./, "");
678
840
  return /^\[[0-9a-f:]+\]$/.test(t) || t.split(".").every((e) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(e));
679
841
  }
680
- function de(e, t) {
842
+ function pe(e, t) {
681
843
  let n = e.toLowerCase();
682
844
  return n === t ? !0 : n.startsWith("*.") ? t.endsWith(n.slice(1)) && t.length > n.length - 1 : n.startsWith(".") ? t === n.slice(1) || t.endsWith(n) : !1;
683
845
  }
684
- async function fe(e) {
846
+ async function me(e) {
685
847
  if (!e.ok) throw Error("License service unavailable");
686
848
  let t = e.headers.get("content-length");
687
- if (t && (!/^\d+$/.test(t) || Number(t) > ne)) throw Error("License response too large");
849
+ if (t && (!/^\d+$/.test(t) || Number(t) > x)) throw Error("License response too large");
688
850
  if (!e.body) throw Error("License response missing");
689
851
  let n = e.body.getReader(), r = 0, i = [];
690
852
  try {
691
853
  for (;;) {
692
854
  let e = await n.read();
693
855
  if (e.done) break;
694
- if (r += e.value.byteLength, r > ne) throw Error("License response too large");
856
+ if (r += e.value.byteLength, r > x) throw Error("License response too large");
695
857
  i.push(e.value);
696
858
  }
697
859
  } finally {
@@ -701,42 +863,42 @@ async function fe(e) {
701
863
  for (let e of i) a.set(e, o), o += e.byteLength;
702
864
  return JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(a));
703
865
  }
704
- async function pe(e, t) {
866
+ async function he(e, t) {
705
867
  let n = new AbortController(), r = setTimeout(() => n.abort(), 8e3);
706
868
  try {
707
- let r = await fe(await fetch(b, {
869
+ let r = await me(await fetch(b, {
708
870
  credentials: "omit",
709
871
  cache: "no-store",
710
872
  redirect: "error",
711
873
  signal: n.signal
712
874
  }));
713
- if (!k(r) || typeof r.token != "string" || r.token.length > ne || !j(r.iat) || !Array.isArray(r.revoked) || r.revoked.length > 1e5 || !r.revoked.every((e) => A(e, 128))) throw Error("Invalid revocation envelope");
714
- let i = r.revoked, a = await ee(r.token, x, t);
875
+ if (!ue(r) || typeof r.token != "string" || r.token.length > x || !A(r.iat) || !Array.isArray(r.revoked) || r.revoked.length > 1e5 || !r.revoked.every((e) => k(e, 128))) throw Error("Invalid revocation envelope");
876
+ let i = r.revoked, a = await m(r.token, re, t);
715
877
  if (!a.ok) throw Error("Invalid signed revocation list");
716
878
  let o = a.payload;
717
- if (!j(o.iat) || !j(o.exp) || o.exp <= t || o.exp <= o.iat || o.exp - o.iat > re || o.iat > t + 60 || t - o.iat > re || o.iat !== r.iat || !Array.isArray(o.revoked) || o.revoked.length !== r.revoked.length || !o.revoked.every((e, t) => A(e, 128) && e === i[t])) throw Error("Stale or inconsistent revocation list");
879
+ if (!A(o.iat) || !A(o.exp) || o.exp <= t || o.exp <= o.iat || o.exp - o.iat > S || o.iat > t + 60 || t - o.iat > S || o.iat !== r.iat || !Array.isArray(o.revoked) || o.revoked.length !== r.revoked.length || !o.revoked.every((e, t) => k(e, 128) && e === i[t])) throw Error("Stale or inconsistent revocation list");
718
880
  return {
719
881
  revoked: r.revoked.includes(e),
720
- expires: Math.min(o.exp, o.iat + re) * 1e3
882
+ expires: Math.min(o.exp, o.iat + S) * 1e3
721
883
  };
722
884
  } finally {
723
885
  clearTimeout(r);
724
886
  }
725
887
  }
726
- async function me(e = !1) {
727
- let t = ce();
888
+ async function ge(e = !1) {
889
+ let t = le();
728
890
  if (!e && t === "licensed") return t;
729
- if (!ie) return "not_set";
730
- if (E?.epoch === C) return E.promise;
731
- let n = C, r = ie, i = (async () => {
891
+ if (!ae) return "not_set";
892
+ if (T?.epoch === C) return T.promise;
893
+ let n = C, r = ae, i = (async () => {
732
894
  let e = "invalid_signature", t = null;
733
895
  try {
734
- let n = M(r);
735
- if (!n || !A(n.sub)) return "invalid_signature";
736
- let i = Math.floor(Date.now() / 1e3), a = await ee(r, n.sub, i);
896
+ let n = de(r);
897
+ if (!n || !k(n.sub)) return "invalid_signature";
898
+ let i = Math.floor(Date.now() / 1e3), a = await m(r, n.sub, i);
737
899
  if (!a.ok) return a.status;
738
900
  let o = a.payload;
739
- if (!A(o.sub) || !A(o.jti, 128) || !j(o.iat) || !j(o.exp) || o.iat > i + 60 || o.exp <= o.iat) return "invalid_signature";
901
+ if (!k(o.sub) || !k(o.jti, 128) || !A(o.iat) || !A(o.exp) || o.iat > i + 60 || o.exp <= o.iat) return "invalid_signature";
740
902
  if (![
741
903
  "pro",
742
904
  "team",
@@ -744,37 +906,37 @@ async function me(e = !1) {
744
906
  "internal"
745
907
  ].includes(String(o.tier))) return "wrong_tier";
746
908
  if (o.exp <= i) return "expired";
747
- if (!Array.isArray(o.pkg) || !o.pkg.length || o.pkg.length > 32 || !o.pkg.every((e) => A(e, 128)) || !o.pkg.includes("bim") || o.pkg.includes("Polycyphers.Bim")) return "wrong_package";
748
- if (typeof o.ver != "string" || o.ver.length > 64 || !le(o.ver)) return "wrong_version";
909
+ if (!Array.isArray(o.pkg) || !o.pkg.length || o.pkg.length > 32 || !o.pkg.every((e) => k(e, 128)) || !o.pkg.includes("bim") || o.pkg.includes("Polycyphers.Bim")) return "wrong_package";
910
+ if (typeof o.ver != "string" || o.ver.length > 64 || !fe(o.ver)) return "wrong_version";
749
911
  let s = typeof location > "u" ? "" : location.hostname.toLowerCase();
750
- if (!s || !Array.isArray(o.dom) || !o.dom.length || o.dom.length > 64 || !o.dom.every(ue) || !o.dom.some((e) => de(e, s))) return "wrong_domain";
751
- let c = await pe(o.jti, i);
912
+ if (!s || !Array.isArray(o.dom) || !o.dom.length || o.dom.length > 64 || !o.dom.every(j) || !o.dom.some((e) => pe(e, s))) return "wrong_domain";
913
+ let c = await he(o.jti, i);
752
914
  if (c.revoked) return "revoked";
753
915
  let l = Math.min(o.exp * 1e3, c.expires);
754
916
  return o.exp * 1e3 <= Date.now() ? "expired" : l <= Date.now() ? "unavailable" : (e = "licensed", t = {
755
- until: Math.min(l, Date.now() + S),
917
+ until: Math.min(l, Date.now() + ie),
756
918
  expires: l,
757
919
  status: e
758
920
  }, e);
759
921
  } catch {
760
922
  return "unavailable";
761
923
  } finally {
762
- n === C && (T = t, w = t?.status ?? "unavailable");
924
+ n === C && (w = t, oe = t?.status ?? "unavailable");
763
925
  }
764
926
  })();
765
- E = {
927
+ T = {
766
928
  epoch: n,
767
929
  promise: i
768
930
  };
769
931
  try {
770
932
  let e = await i;
771
- return n === C ? (w = e, e) : ce();
933
+ return n === C ? (oe = e, e) : le();
772
934
  } finally {
773
- E?.promise === i && (E = null);
935
+ T?.promise === i && (T = null);
774
936
  }
775
937
  }
776
938
  // src/studioState.ts
777
- function he(e, t) {
939
+ function _e(e, t) {
778
940
  if (typeof e.priceMinorUnits != "number" || !Number.isFinite(e.priceMinorUnits) || typeof e.currency != "string") return null;
779
941
  try {
780
942
  let n = new Intl.NumberFormat(t, {
@@ -786,29 +948,29 @@ function he(e, t) {
786
948
  return null;
787
949
  }
788
950
  }
789
- function ge(e) {
951
+ function ve(e) {
790
952
  return typeof e.freeProposalGenerations == "number" && typeof e.freeBimExports == "number" ? {
791
953
  proposals: e.freeProposalGenerations,
792
954
  exports: e.freeBimExports
793
955
  } : null;
794
956
  }
795
- function N(e) {
957
+ function ye(e) {
796
958
  return "polycyphers.bim.project.v1:" + encodeURIComponent(e);
797
959
  }
798
- function _e(e, t) {
960
+ function be(e, t) {
799
961
  try {
800
- let n = e.getItem(N(t));
962
+ let n = e.getItem(ye(t));
801
963
  return n && /^[a-f0-9]{32}$/i.test(n) ? n : null;
802
964
  } catch {
803
965
  return null;
804
966
  }
805
967
  }
806
- function ve(e, t, n) {
968
+ function xe(e, t, n) {
807
969
  try {
808
- n && /^[a-f0-9]{32}$/i.test(n) ? e.setItem(N(t), n) : e.removeItem(N(t));
970
+ n && /^[a-f0-9]{32}$/i.test(n) ? e.setItem(ye(t), n) : e.removeItem(ye(t));
809
971
  } catch {}
810
972
  }
811
- function ye(e) {
973
+ function Se(e) {
812
974
  return {
813
975
  footprint: { edges: Array.from({ length: 4 }, (e, t) => ({
814
976
  id: "W" + (t + 1),
@@ -838,7 +1000,7 @@ function ye(e) {
838
1000
  language: e
839
1001
  };
840
1002
  }
841
- function be(e) {
1003
+ function Ce(e) {
842
1004
  if (e.footprint.edges.length < 3 || e.footprint.edges.some((e) => !Number.isFinite(e.lengthM) || e.lengthM <= 0 || e.bearingDegrees !== null && !Number.isFinite(e.bearingDegrees))) return "Enter every measured wall length. Leave an unknown bearing blank.";
843
1005
  if (e.programme) {
844
1006
  let t = e.programme;
@@ -854,124 +1016,138 @@ function be(e) {
854
1016
  }
855
1017
  return null;
856
1018
  }
857
- function xe(e, t) {
1019
+ function we(e, t) {
858
1020
  return !!e && !!t && e.isChanged && e.expectedVersion === t.version && e.snapshot.projectId === t.projectId;
859
1021
  }
1022
+ function Te(e) {
1023
+ let t = e?.toLowerCase().split(/[-_]/)[0];
1024
+ return t === "de" || t === "fr" || t === "ar" ? t : "en";
1025
+ }
1026
+ function M(e, t, n) {
1027
+ return n.some((e) => e.toLowerCase() === t.toLowerCase()) ? "estimated" : e.valueOrigins ? e.valueOrigins.userGivenPaths.some((e) => e.toLowerCase() === t.toLowerCase()) ? "user-given" : "estimated" : t.startsWith("programme.") ? e.programme?.source.startsWith("User-entered") ? "user-given" : "estimated" : t.startsWith("buildUps.") ? "estimated" : "user-given";
1028
+ }
1029
+ function Ee(e, t, n) {
1030
+ let r = e.valueOrigins?.userGivenPaths ?? [...e.footprint.edges.flatMap((e, t) => [...Number.isFinite(e.lengthM) ? [`footprint.edges[${t}].lengthM`] : [], ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]]), ...Object.entries(e.programme ?? {}).filter(([, e]) => typeof e == "number" && Number.isFinite(e)).map(([e]) => "programme." + e)].filter((t) => M(e, t, n) === "user-given");
1031
+ return {
1032
+ ...e,
1033
+ valueOrigins: { userGivenPaths: [...r.filter((e) => e.toLowerCase() !== t.toLowerCase()), t] }
1034
+ };
1035
+ }
860
1036
  // src/BimStudio.tsx
861
- var P = e("baulynq"), Se = () => location.pathname === "/verify-email" || location.pathname === "/verify", F = () => crypto.randomUUID().replaceAll("-", "");
862
- function Ce() {
863
- let e = n(P);
864
- return /* @__PURE__ */ p("span", {
1037
+ var N = e("baulynq"), De = () => location.pathname === "/verify-email" || location.pathname === "/verify", P = () => crypto.randomUUID().replaceAll("-", "");
1038
+ function Oe() {
1039
+ let e = n(N);
1040
+ return /* @__PURE__ */ l("span", {
865
1041
  className: "brand",
866
- children: [/* @__PURE__ */ f("svg", {
1042
+ children: [/* @__PURE__ */ c("svg", {
867
1043
  viewBox: "0 0 28 28",
868
1044
  "aria-hidden": "true",
869
- children: /* @__PURE__ */ f("path", { d: "M4 23V5h13v7h7v11H4m7 0V12h6m0 0V5" })
870
- }), /* @__PURE__ */ p("strong", { children: [e === "karamentreprises" ? "Karamentreprises" : "BauLynq", /* @__PURE__ */ f("span", { children: e === "karamentreprises" ? "BIM" : "Vision" })] })]
1045
+ children: /* @__PURE__ */ c("path", { d: "M4 23V5h13v7h7v11H4m7 0V12h6m0 0V5" })
1046
+ }), /* @__PURE__ */ l("strong", { children: [e === "karamentreprises" ? "Karamentreprises" : "BauLynq", /* @__PURE__ */ c("span", { children: e === "karamentreprises" ? "BIM" : "Vision" })] })]
871
1047
  });
872
1048
  }
873
- function we() {
874
- return /* @__PURE__ */ f("span", {
1049
+ function ke() {
1050
+ return /* @__PURE__ */ c("span", {
875
1051
  "aria-hidden": "true",
876
1052
  children: "↗"
877
1053
  });
878
1054
  }
879
- function Te() {
880
- return /* @__PURE__ */ p("svg", {
1055
+ function Ae() {
1056
+ return /* @__PURE__ */ l("svg", {
881
1057
  viewBox: "0 0 450 340",
882
1058
  role: "img",
883
1059
  "aria-label": "Illustrative hand sketch of the reference footprint",
884
1060
  children: [
885
- /* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("pattern", {
1061
+ /* @__PURE__ */ c("defs", { children: /* @__PURE__ */ c("pattern", {
886
1062
  id: "sketchgrid",
887
1063
  width: "16",
888
1064
  height: "16",
889
1065
  patternUnits: "userSpaceOnUse",
890
- children: /* @__PURE__ */ f("path", {
1066
+ children: /* @__PURE__ */ c("path", {
891
1067
  d: "M16 0H0V16",
892
1068
  fill: "none",
893
1069
  stroke: "#e9e4d8",
894
1070
  strokeWidth: ".5"
895
1071
  })
896
1072
  }) }),
897
- /* @__PURE__ */ f("rect", {
1073
+ /* @__PURE__ */ c("rect", {
898
1074
  width: "450",
899
1075
  height: "340",
900
1076
  fill: "url(#sketchgrid)"
901
1077
  }),
902
- /* @__PURE__ */ p("g", {
1078
+ /* @__PURE__ */ l("g", {
903
1079
  transform: "translate(66 53) rotate(-4 140 110)",
904
1080
  fill: "none",
905
1081
  stroke: "#77776e",
906
1082
  strokeWidth: "2.2",
907
1083
  strokeLinecap: "round",
908
1084
  children: [
909
- /* @__PURE__ */ f("path", { d: "M12 233L255 235l-1-37 56 1-2-159-19-17L18 22Z" }),
910
- /* @__PURE__ */ f("path", {
1085
+ /* @__PURE__ */ c("path", { d: "M12 233L255 235l-1-37 56 1-2-159-19-17L18 22Z" }),
1086
+ /* @__PURE__ */ c("path", {
911
1087
  d: "M13 232L17 21l272 4 19 14 2 160-55-2v36Z",
912
1088
  opacity: ".4"
913
1089
  }),
914
- /* @__PURE__ */ f("path", {
1090
+ /* @__PURE__ */ c("path", {
915
1091
  d: "M129 232V115h178M130 154h74v77",
916
1092
  strokeDasharray: "5 7"
917
1093
  }),
918
- /* @__PURE__ */ f("path", {
1094
+ /* @__PURE__ */ c("path", {
919
1095
  d: "M324 70v72m-5-7 5 8 5-8",
920
1096
  stroke: "#328577"
921
1097
  })
922
1098
  ]
923
1099
  }),
924
- /* @__PURE__ */ p("g", {
1100
+ /* @__PURE__ */ l("g", {
925
1101
  fontFamily: "monospace",
926
1102
  fontSize: "15",
927
1103
  fill: "#72756e",
928
1104
  transform: "rotate(-4 200 170)",
929
1105
  children: [
930
- /* @__PURE__ */ p("text", {
1106
+ /* @__PURE__ */ l("text", {
931
1107
  x: "145",
932
1108
  y: "62",
933
- children: ["8.34", /* @__PURE__ */ f("tspan", {
1109
+ children: ["8.34", /* @__PURE__ */ c("tspan", {
934
1110
  fontSize: "7",
935
1111
  children: " [user-given]"
936
1112
  })]
937
1113
  }),
938
- /* @__PURE__ */ p("text", {
1114
+ /* @__PURE__ */ l("text", {
939
1115
  x: "165",
940
1116
  y: "318",
941
- children: ["7.40", /* @__PURE__ */ f("tspan", {
1117
+ children: ["7.40", /* @__PURE__ */ c("tspan", {
942
1118
  fontSize: "7",
943
1119
  children: " [user-given]"
944
1120
  })]
945
1121
  }),
946
- /* @__PURE__ */ p("text", {
1122
+ /* @__PURE__ */ l("text", {
947
1123
  x: "21",
948
1124
  y: "172",
949
1125
  transform: "rotate(-90 21 172)",
950
- children: ["6.40", /* @__PURE__ */ f("tspan", {
1126
+ children: ["6.40", /* @__PURE__ */ c("tspan", {
951
1127
  fontSize: "7",
952
1128
  children: " [user-given]"
953
1129
  })]
954
1130
  }),
955
- /* @__PURE__ */ p("text", {
1131
+ /* @__PURE__ */ l("text", {
956
1132
  x: "387",
957
1133
  y: "153",
958
1134
  transform: "rotate(90 387 153)",
959
- children: ["4.81", /* @__PURE__ */ f("tspan", {
1135
+ children: ["4.81", /* @__PURE__ */ c("tspan", {
960
1136
  fontSize: "7",
961
1137
  children: " [user-given]"
962
1138
  })]
963
1139
  }),
964
- /* @__PURE__ */ p("text", {
1140
+ /* @__PURE__ */ l("text", {
965
1141
  x: "307",
966
1142
  y: "282",
967
- children: ["1.70", /* @__PURE__ */ f("tspan", {
1143
+ children: ["1.70", /* @__PURE__ */ c("tspan", {
968
1144
  fontSize: "7",
969
1145
  children: " [user-given]"
970
1146
  })]
971
1147
  })
972
1148
  ]
973
1149
  }),
974
- /* @__PURE__ */ f("text", {
1150
+ /* @__PURE__ */ c("text", {
975
1151
  x: "29",
976
1152
  y: "32",
977
1153
  fontFamily: "monospace",
@@ -982,117 +1158,128 @@ function Te() {
982
1158
  ]
983
1159
  });
984
1160
  }
985
- function Ee(e = {}) {
986
- let n = e.brand ?? "baulynq", i = e.initialInput?.language ?? (typeof navigator > "u" ? "en" : navigator.language.split("-")[0]), o = [
987
- "en",
988
- "de",
989
- "fr",
990
- "ar"
991
- ].includes(i) ? i : "en", [s, c] = a("checking"), [l, u] = a(0);
1161
+ function je(e = {}) {
1162
+ let n = e.brand ?? "baulynq", i = Te(e.language ?? e.initialInput?.language ?? (typeof navigator > "u" ? "en" : navigator.language)), [o, s] = a("checking"), [u, d] = a(0);
992
1163
  r(() => {
993
1164
  let e = !0, t = !1, r = !1;
994
- D(n);
1165
+ se(n);
995
1166
  let i = async () => {
996
1167
  if (t) r = !0;
997
1168
  else {
998
1169
  t = !0;
999
1170
  try {
1000
- let t = await me(!0);
1001
- e && c(t);
1171
+ let t = await ge(!0);
1172
+ e && s(t);
1002
1173
  } catch {
1003
- e && c("unavailable");
1174
+ e && s("unavailable");
1004
1175
  } finally {
1005
1176
  t = !1, r && e && (r = !1, i());
1006
1177
  }
1007
1178
  }
1008
1179
  };
1009
1180
  i();
1010
- let a = se(() => {
1011
- e && c("checking"), i();
1181
+ let a = O(() => {
1182
+ e && s("checking"), i();
1012
1183
  }), o = setInterval(() => {
1013
1184
  i();
1014
- }, 3e4), s = setInterval(() => {
1015
- let t = ce();
1016
- e && t !== "licensed" && c(t);
1185
+ }, 3e4), c = setInterval(() => {
1186
+ let t = le();
1187
+ e && t !== "licensed" && s(t);
1017
1188
  }, 1e3);
1018
1189
  return () => {
1019
- e = !1, clearInterval(o), clearInterval(s), a();
1190
+ e = !1, clearInterval(o), clearInterval(c), a();
1020
1191
  };
1021
- }, [n, l]);
1022
- let ee = t(async (t, n) => {
1023
- let r = await me(), i = ce();
1024
- if (r !== "licensed" || i !== "licensed") throw c(i), new DOMException("A valid component license is required.", "AbortError");
1192
+ }, [n, u]);
1193
+ let f = t(async (t, n) => {
1194
+ let r = await ge(), i = le();
1195
+ if (r !== "licensed" || i !== "licensed") throw s(i), new DOMException("A valid component license is required.", "AbortError");
1025
1196
  return e.transport ? e.transport(t, n) : fetch("/v1" + t, n);
1026
- }, [e.transport]), d = s === "licensed";
1027
- return /* @__PURE__ */ f(P.Provider, {
1197
+ }, [e.transport]), p = o === "licensed";
1198
+ return /* @__PURE__ */ c(N.Provider, {
1028
1199
  value: n,
1029
- children: d ? /* @__PURE__ */ f(De, {
1200
+ children: p ? /* @__PURE__ */ c(Me, {
1030
1201
  ...e,
1031
- transport: ee
1032
- }) : /* @__PURE__ */ p("section", {
1202
+ transport: f
1203
+ }, e.embedded ? e.workspaceKey ?? "unscoped" : "public") : /* @__PURE__ */ l("section", {
1033
1204
  className: "bim-studio bim-license-gate",
1034
- dir: o === "ar" ? "rtl" : "ltr",
1205
+ dir: i === "ar" ? "rtl" : "ltr",
1035
1206
  "aria-label": "Component licensing",
1036
1207
  children: [
1037
- /* @__PURE__ */ f(Ce, {}),
1038
- /* @__PURE__ */ f("h1", { children: _(o, s === "checking" ? "Verifying component license…" : "A valid component license is required") }),
1039
- /* @__PURE__ */ p("p", { children: [
1208
+ /* @__PURE__ */ c(Oe, {}),
1209
+ /* @__PURE__ */ c("h1", { children: v(i, o === "checking" ? "Verifying component license…" : "A valid component license is required") }),
1210
+ /* @__PURE__ */ l("p", { children: [
1040
1211
  n === "karamentreprises" ? "Karamentreprises BIM" : "BauLynq Vision",
1041
1212
  " · ",
1042
- s
1213
+ o
1043
1214
  ] }),
1044
- /* @__PURE__ */ f("p", { children: _(o, "The studio stays closed until its installation license and signed revocation status are verified.") }),
1045
- s !== "checking" && /* @__PURE__ */ f("button", {
1215
+ /* @__PURE__ */ c("p", { children: v(i, "The studio stays closed until its installation license and signed revocation status are verified.") }),
1216
+ o !== "checking" && /* @__PURE__ */ c("button", {
1046
1217
  className: "outline",
1047
- onClick: () => u((e) => e + 1),
1048
- children: _(o, "Check license again")
1218
+ onClick: () => d((e) => e + 1),
1219
+ children: v(i, "Check license again")
1049
1220
  }),
1050
- /* @__PURE__ */ p("a", {
1221
+ /* @__PURE__ */ l("a", {
1051
1222
  href: n === "karamentreprises" ? "https://packages.karamentreprises.com/bim" : "https://packages.polycyphers.com/bim",
1052
- children: [_(o, "License management"), " ↗"]
1223
+ children: [v(i, "License management"), " ↗"]
1053
1224
  })
1054
1225
  ]
1055
1226
  })
1056
1227
  });
1057
1228
  }
1058
- function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s, brand: c = "baulynq" } = {}) {
1059
- let [l, u] = a(n?.language ?? "en"), [ee, m] = a(e || location.pathname === "/studio" ? "studio" : "home"), [g, v] = a("measure"), [y, te] = a(null), [b, x] = a(n ?? null), [ne, re] = a("A"), [S, ie] = a(!1), [C, w] = a(""), [T, E] = a(""), [ae, D] = a(""), [O, oe] = a(null), [se, k] = a(null), [A, j] = a(null), [M, le] = a(""), [ue, de] = a(!e && Se()), [fe, pe] = a(""), [me, N] = a(""), [P, Ee] = a({}), [De, je] = a(!1), [L, Me] = a(Se() ? "verify" : "login"), [Ne, Pe] = a(() => Se() ? new URLSearchParams(location.search).get("token") ?? "" : ""), [Fe, Ie] = a(), [Le, Re] = a(null), [R, z] = a(null), [B, ze] = a(null), [Be, Ve] = a(""), [He, Ue] = a(null), [We, Ge] = a([]), [Ke, qe] = a(!1), [Je, Ye] = a(!1), [Xe, Ze] = a(!1), [Qe, $e] = a(null), [et, tt] = a(!1), [nt, rt] = a(!1), [V, it] = a(null), [at, ot] = a(!1), [st, ct] = a([]), [lt, ut] = a([]), [dt, ft] = a(!1), [pt, mt] = a([]), [ht, gt] = a(), _t = i(null), vt = i(!1), yt = i(!0), H = i(0), bt = i(""), xt = i(void 0), St = i(s), U = h[l], W = s ?? Fe, G = R?.snapshot ?? y, K = G?.proposals.find((e) => e.id === ne) ?? G?.proposals[0], Ct = he(P, l), wt = ge(P), Tt = typeof P.checkoutAvailable == "boolean" ? P.checkoutAvailable : P.checkoutEnabled === !0, q = [
1229
+ function Me({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: u, language: d, onStateChange: f, brand: p = "baulynq" } = {}) {
1230
+ let [m, h] = a(() => Te(d ?? n?.language ?? (typeof navigator > "u" ? "en" : navigator.language))), [_, te] = a(e || location.pathname === "/studio" ? "studio" : "home"), [ne, y] = a("measure"), [b, re] = a(null), [x, S] = a(n ?? null), [ie, ae] = a("A"), [C, oe] = a(!1), [w, T] = a(""), [E, se] = a(""), [ce, D] = a(""), [O, ue] = a(null), [k, A] = a(null), [de, fe] = a(null), [j, pe] = a(""), [me, he] = a(!e && De()), [ge, ye] = a(""), [M, Ee] = a(""), [N, je] = a({}), [Me, Ie] = a(!1), [I, Le] = a(De() ? "verify" : "login"), [Re, ze] = a(() => De() ? new URLSearchParams(location.search).get("token") ?? "" : ""), [Be, Ve] = a(), [He, Ue] = a(null), [L, R] = a(null), [z, We] = a(null), [Ge, Ke] = a(""), [B, qe] = a(null), [Je, Ye] = a([]), [Xe, Ze] = a(!1), [Qe, $e] = a(!1), [et, tt] = a(!1), [nt, rt] = a(null), [it, at] = a(null), [ot, st] = a(null), [ct, lt] = a(!1), [ut, dt] = a(1), [ft, pt] = a(1), [mt, ht] = a(!1), [gt, _t] = a(!1), [vt, yt] = a(!1), [V, bt] = a(null), [xt, St] = a(!1), [Ct, wt] = a([]), [Tt, Et] = a([]), [Dt, Ot] = a(!1), [kt, At] = a([]), [jt, Mt] = a(), Nt = i(null), Pt = i(!1), Ft = i(!0), H = i(0), It = i(""), Lt = i(void 0), Rt = i(u), U = g[m], W = u ?? Be, zt = i(f), Bt = mt || !!E.trim() || !!L || !!z && !B || xt;
1231
+ r(() => {
1232
+ zt.current = f;
1233
+ }, [f]), r(() => {
1234
+ zt.current?.({
1235
+ busy: C,
1236
+ hasUnsavedChanges: Bt
1237
+ });
1238
+ }, [C, Bt]), r(() => () => {
1239
+ zt.current?.({
1240
+ busy: !1,
1241
+ hasUnsavedChanges: !1
1242
+ });
1243
+ }, []), r(() => {
1244
+ at(null), st(null), dt(Math.max(1, (b?.version ?? 1) - 1)), pt(b?.version ?? 1), b || lt(!1);
1245
+ }, [b?.projectId, b?.version]);
1246
+ let G = L?.snapshot ?? b, K = G?.proposals.find((e) => e.id === ie) ?? G?.proposals[0], Vt = _e(N, m), Ht = ve(N), Ut = typeof N.checkoutAvailable == "boolean" ? N.checkoutAvailable : N.checkoutEnabled === !0, q = [
1060
1247
  "paidRegenerations",
1061
1248
  "chatRefinementsPerProject",
1062
1249
  "exportsPerPaidProject"
1063
- ].every((e) => typeof P[e] == "number" && Number.isInteger(P[e]) && Number(P[e]) >= 0) ? {
1064
- regenerations: Number(P.paidRegenerations),
1065
- chat: Number(P.chatRefinementsPerProject),
1066
- exports: Number(P.exportsPerPaidProject)
1250
+ ].every((e) => typeof N[e] == "number" && Number.isInteger(N[e]) && Number(N[e]) >= 0) ? {
1251
+ regenerations: Number(N.paidRegenerations),
1252
+ chat: Number(N.chatRefinementsPerProject),
1253
+ exports: Number(N.exportsPerPaidProject)
1067
1254
  } : null;
1068
- r(() => (yt.current = !0, () => {
1069
- yt.current = !1, H.current++;
1255
+ r(() => (Ft.current = !0, () => {
1256
+ Ft.current = !1, H.current++;
1070
1257
  }), []);
1071
1258
  function J(e) {
1072
- let t = ce();
1073
- if (!yt.current || e !== H.current || t !== "licensed") throw new DOMException("The verified session changed.", "AbortError");
1259
+ let t = le();
1260
+ if (!Ft.current || e !== H.current || t !== "licensed") throw new DOMException("The verified session changed.", "AbortError");
1074
1261
  }
1075
- async function Y(n, r) {
1262
+ async function Wt(n, r) {
1076
1263
  let i = H.current;
1077
1264
  J(i);
1078
1265
  let a = new Headers(r?.headers).get("Authorization");
1079
- if (!e && n !== "/session" && a && a !== "Bearer " + bt.current) throw new DOMException("The verified session changed.", "AbortError");
1266
+ if (!e && n !== "/session" && a && a !== "Bearer " + It.current) throw new DOMException("The verified session changed.", "AbortError");
1080
1267
  let o = await (t ? t(n, r) : fetch("/v1" + n, r));
1081
- if (n !== "/config" && J(i), !e && o.status === 401 && !n.startsWith("/account/")) throw Dt(), Me("login"), de(!0), w("Sign in with a verified account to continue."), new DOMException("The verified session expired.", "AbortError");
1268
+ if (n !== "/config" && J(i), !e && o.status === 401 && !n.startsWith("/account/")) throw Kt(), Le("login"), he(!0), T("Sign in with a verified account to continue."), new DOMException("The verified session expired.", "AbortError");
1082
1269
  return o;
1083
1270
  }
1084
- function Et() {
1085
- rt(!1), w(""), D(""), tt(!1), $e(null), Ge([]), mt([]), gt(void 0), it(null), ot(!1), ct([]), qe(!1), Ye(!1), E(""), te(null), ut([]), x(null), z(null), ze(null), j(null), k(null), oe(null), Ue(null), Re(null), Ze(!1);
1271
+ function Gt() {
1272
+ ht(!1), yt(!1), T(""), D(""), _t(!1), rt(null), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), Ze(!1), $e(!1), se(""), re(null), Et([]), S(null), R(null), We(null), fe(null), A(null), ue(null), qe(null), Ue(null), tt(!1);
1086
1273
  }
1087
- function Dt() {
1088
- (y || xt.current) && Et(), H.current++, bt.current = "", xt.current = void 0, le(""), Ie(void 0);
1274
+ function Kt() {
1275
+ (b || Lt.current) && Gt(), H.current++, It.current = "", Lt.current = void 0, pe(""), Ve(void 0);
1089
1276
  }
1090
- async function X(t, n, r) {
1091
- let i = H.current, a = await Y(t, {
1277
+ async function Y(t, n, r) {
1278
+ let i = H.current, a = await Wt(t, {
1092
1279
  method: r ?? (n ? "POST" : "GET"),
1093
1280
  headers: {
1094
1281
  ...n ? { "Content-Type": "application/json" } : {},
1095
- ...!e && M ? { Authorization: "Bearer " + M } : {}
1282
+ ...!e && j ? { Authorization: "Bearer " + j } : {}
1096
1283
  },
1097
1284
  body: n ? JSON.stringify(n) : void 0
1098
1285
  });
@@ -1102,98 +1289,100 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1102
1289
  let e = await a.json();
1103
1290
  n = e.detail ?? e.title ?? e.error ?? n;
1104
1291
  } catch {}
1105
- throw J(i), a.status === 401 && (e || (Dt(), t.startsWith("/account/") || Me("login"), de(!0)), n = e ? "Your app session needs attention. Sign in again through your app." : "Sign in with a verified account to continue."), a.status === 402 && Ot("paywall"), Error(n);
1292
+ throw J(i), a.status === 401 && (e || (Kt(), t.startsWith("/account/") || Le("login"), he(!0)), n = e ? "Your app session needs attention. Sign in again through your app." : "Sign in with a verified account to continue."), a.status === 402 && qt("paywall"), Error(n);
1106
1293
  }
1107
1294
  let o = a.status === 204 ? null : await a.json();
1108
1295
  return J(i), o;
1109
1296
  }
1110
- async function Ot(t, n = dt) {
1111
- if (!(e || P.analyticsEnabled !== !0)) try {
1112
- await Y("/analytics/events", {
1297
+ async function qt(t, n = Dt) {
1298
+ if (!(e || N.analyticsEnabled !== !0)) try {
1299
+ await Wt("/analytics/events", {
1113
1300
  method: "POST",
1114
1301
  headers: {
1115
1302
  "Content-Type": "application/json",
1116
- ...M ? { Authorization: "Bearer " + M } : {}
1303
+ ...j ? { Authorization: "Bearer " + j } : {}
1117
1304
  },
1118
1305
  body: JSON.stringify({
1119
- eventId: F(),
1306
+ eventId: P(),
1120
1307
  kind: t,
1121
1308
  consentGranted: n
1122
1309
  })
1123
1310
  });
1124
1311
  } catch {}
1125
1312
  }
1126
- function kt(e) {
1127
- ft(e), Ot("visit", e);
1313
+ function Jt(e) {
1314
+ Ot(e), qt("visit", e);
1128
1315
  }
1129
1316
  r(() => {
1130
- e || (document.documentElement.lang = l, document.documentElement.dir = l === "ar" ? "rtl" : "ltr");
1131
- }, [l, e]), r(() => {
1317
+ d !== void 0 && h(Te(d));
1318
+ }, [d]), r(() => {
1319
+ e || (document.documentElement.lang = m, document.documentElement.dir = m === "ar" ? "rtl" : "ltr");
1320
+ }, [m, e]), r(() => {
1132
1321
  let e = !0;
1133
- return Y("/config").then((e) => e.ok ? e.json() : Promise.reject()).then((t) => {
1134
- e && Ee(t);
1322
+ return Wt("/config").then((e) => e.ok ? e.json() : Promise.reject()).then((t) => {
1323
+ e && je(t);
1135
1324
  }).catch(() => {}), () => {
1136
1325
  e = !1;
1137
1326
  };
1138
1327
  }, [t]), r(() => {
1139
- !e && Se() && history.replaceState({}, "", location.pathname);
1328
+ !e && De() && history.replaceState({}, "", location.pathname);
1140
1329
  }, [e]), r(() => {
1141
- if (!B) {
1142
- Ve("");
1330
+ if (!z) {
1331
+ Ke("");
1143
1332
  return;
1144
1333
  }
1145
- let e = URL.createObjectURL(B);
1146
- return Ve(e), () => URL.revokeObjectURL(e);
1147
- }, [B]), r(() => {
1148
- e && St.current !== s && (H.current++, Et(), St.current = s);
1149
- }, [s, e]), r(() => {
1334
+ let e = URL.createObjectURL(z);
1335
+ return Ke(e), () => URL.revokeObjectURL(e);
1336
+ }, [z]), r(() => {
1337
+ e && Rt.current !== u && (H.current++, Gt(), Rt.current = u);
1338
+ }, [u, e]), r(() => {
1150
1339
  if (!W) return;
1151
- let e = _e(localStorage, W);
1152
- if (Re(e), !e || b || y) return;
1340
+ let e = be(localStorage, W);
1341
+ if (Ue(e), !e || x || b) return;
1153
1342
  let t = !0;
1154
- return X("/projects/" + e).then((e) => {
1155
- t && (At(e), v(e.input.isDraft ? "measure" : "proposals"));
1343
+ return Y("/projects/" + e).then((e) => {
1344
+ t && (X(e), y(e.input.isDraft ? "measure" : "proposals"));
1156
1345
  }).catch((e) => {
1157
- t && w(e instanceof Error ? e.message : "Could not resume the project.");
1346
+ t && T(e instanceof Error ? e.message : "Could not resume the project.");
1158
1347
  }), () => {
1159
1348
  t = !1;
1160
1349
  };
1161
1350
  }, [W]);
1162
- function At(e) {
1163
- J(H.current), e.input.isDraft || ct([]), te(e), x(e.input.isDraft ? b ?? ye(l) : e.input), re(e.selectedProposalId ?? e.proposals.find((e) => e.recommended)?.id ?? "A"), j(null), k(null), oe(null), z(null), W && (ve(localStorage, W, e.projectId), Re(e.projectId));
1351
+ function X(e) {
1352
+ J(H.current), rt(e.reconciliation), tt(!1), e.input.isDraft || (ht(!1), St(!1)), e.input.isDraft || wt([]), re(e), S(e.input.isDraft ? x ?? Se(m) : e.input), ae(e.selectedProposalId ?? e.proposals.find((e) => e.recommended)?.id ?? "A"), fe(null), A(null), ue(null), R(null), W && (xe(localStorage, W, e.projectId), Ue(e.projectId));
1164
1353
  }
1165
1354
  async function Z(e) {
1166
- if (!vt.current) {
1167
- vt.current = !0, ie(!0), w("");
1355
+ if (!Pt.current) {
1356
+ Pt.current = !0, oe(!0), T("");
1168
1357
  try {
1169
1358
  await e();
1170
1359
  } catch (e) {
1171
- e instanceof DOMException && e.name === "AbortError" || w(e instanceof Error ? e.message : "Please try again.");
1360
+ e instanceof DOMException && e.name === "AbortError" || T(e instanceof Error ? e.message : "Please try again.");
1172
1361
  } finally {
1173
- vt.current = !1, ie(!1);
1362
+ Pt.current = !1, oe(!1);
1174
1363
  }
1175
1364
  }
1176
1365
  }
1177
1366
  function Q(t) {
1178
- rt(!1), m(t), e || history.pushState({}, "", t === "home" ? "/" : "/studio"), window.scrollTo(0, 0);
1367
+ yt(!1), te(t), e || history.pushState({}, "", t === "home" ? "/" : "/studio"), window.scrollTo(0, 0);
1179
1368
  }
1180
- function jt(e = !1) {
1181
- e || ze(null), qe(!1), Ye(!1), Ge([]), mt([]), gt(void 0), it(null), ot(!1), ct([]), E(""), te(null), ut([]), x(ye(l)), z(null), j(null), k(null), oe(null), Ze(!1), $e(null), Ue(null), v("measure"), Q("studio");
1369
+ function Yt(e = !1) {
1370
+ ht(!1), e || We(null), Ze(!1), $e(!1), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), se(""), re(null), Et([]), S(Se(m)), R(null), fe(null), A(null), ue(null), tt(!1), rt(null), qe(null), y("measure"), Q("studio");
1182
1371
  }
1183
- async function Mt() {
1184
- P.mode === "local-demo" ? (Q("studio"), await Z(async () => {
1185
- let e = await X("/reference?language=" + l);
1186
- x(e), Ze(!1), v("measure"), D("Reference example loaded. Review its site-confirmed dimensions before generating.");
1187
- })) : jt();
1372
+ async function Xt() {
1373
+ N.mode === "local-demo" ? (Q("studio"), await Z(async () => {
1374
+ let e = await Y("/reference?language=" + m);
1375
+ S(e), ht(!1), tt(!1), y("measure"), D("Reference example loaded. Review its site-confirmed dimensions before generating.");
1376
+ })) : Yt();
1188
1377
  }
1189
- async function Nt(t, n) {
1378
+ async function Zt(t, n) {
1190
1379
  let r = H.current;
1191
- if (!Ke || !Je) throw Error("Review the image permissions and AI disclosure before upload.");
1380
+ if (!Xe || !Qe) throw Error("Review the image permissions and AI disclosure before upload.");
1192
1381
  let i = new FormData();
1193
1382
  i.append("file", n), i.append("rightsAcknowledged", "true"), i.append("aiProcessingAcknowledged", "true");
1194
- let a = await Y(`/projects/${t.projectId}/uploads`, {
1383
+ let a = await Wt(`/projects/${t.projectId}/uploads`, {
1195
1384
  method: "POST",
1196
- headers: !e && M ? { Authorization: "Bearer " + M } : {},
1385
+ headers: !e && j ? { Authorization: "Bearer " + j } : {},
1197
1386
  body: i
1198
1387
  });
1199
1388
  if (!a.ok) {
@@ -1205,60 +1394,60 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1205
1394
  throw J(r), Error(e);
1206
1395
  }
1207
1396
  let o = await a.json();
1208
- J(r), Ue(o.upload.id), D("Sketch stored privately. Reading produces observations to confirm, never unchecked dimensions.");
1397
+ J(r), qe(o.upload.id), D("Sketch stored privately. Reading produces observations to confirm, never unchecked dimensions.");
1209
1398
  }
1210
- async function Pt() {
1211
- b && await Z(async () => {
1212
- let e = be(b);
1399
+ async function Qt() {
1400
+ x && await Z(async () => {
1401
+ let e = Ce(x);
1213
1402
  if (e) throw Error(e);
1214
- if (B && !He && (!Ke || !Je)) throw Error("Review the image permissions and AI disclosure, or remove the local image.");
1215
- if (!Xe) throw Error("Confirm the measured dimensions and bearings before generating.");
1403
+ if (z && !B && (!Xe || !Qe)) throw Error("Review the image permissions and AI disclosure, or remove the local image.");
1404
+ if (!et) throw Error("Confirm the measured dimensions and bearings before generating.");
1216
1405
  let t = {
1217
- ...b,
1218
- language: l
1219
- }, n = await X("/footprints/reconcile", t.footprint);
1220
- if ($e(n), n.status !== "Unique") throw Error(n.findings.map((e) => e.message).join(" ") || "The footprint needs another confirmed measurement.");
1221
- let r = y ? await X(`/projects/${y.projectId}/edits`, {
1222
- expectedVersion: y.version,
1223
- operationId: F(),
1406
+ ...x,
1407
+ language: m
1408
+ }, n = await Y("/footprints/reconcile", t.footprint);
1409
+ if (rt(n), n.status !== "Unique") throw Error(n.findings.map((e) => e.message).join(" ") || "The footprint needs another confirmed measurement.");
1410
+ let r = b ? await Y(`/projects/${b.projectId}/edits`, {
1411
+ expectedVersion: b.version,
1412
+ operationId: P(),
1224
1413
  edit: {
1225
1414
  replaceInput: t,
1226
1415
  note: "Confirmed measurements"
1227
1416
  }
1228
- }) : await X("/projects", {
1229
- projectId: F(),
1230
- operationId: F(),
1417
+ }) : await Y("/projects", {
1418
+ projectId: P(),
1419
+ operationId: P(),
1231
1420
  input: t
1232
1421
  });
1233
- At(r), v(r.input.isDraft ? "measure" : "proposals"), B && !He && await Nt(r, B);
1422
+ X(r), y(r.input.isDraft ? "measure" : "proposals"), z && !B && await Zt(r, z);
1234
1423
  });
1235
1424
  }
1236
- async function Ft() {
1237
- T.trim() && y && await Z(async () => {
1238
- let e = await X(`/projects/${y.projectId}/chat`, {
1239
- expectedVersion: y.version,
1240
- operationId: F(),
1241
- message: T
1425
+ async function $t() {
1426
+ E.trim() && b && await Z(async () => {
1427
+ let e = await Y(`/projects/${b.projectId}/chat`, {
1428
+ expectedVersion: b.version,
1429
+ operationId: P(),
1430
+ message: E
1242
1431
  });
1243
- z(e.preview), D(e.reply), E(""), v("refine");
1432
+ R(e.preview), D(e.reply), se(""), y("refine");
1244
1433
  });
1245
1434
  }
1246
- async function It() {
1247
- if (!xe(R, y) || !R || !y) return;
1248
- let e = R;
1435
+ async function en() {
1436
+ if (!we(L, b) || !L || !b) return;
1437
+ let e = L;
1249
1438
  await Z(async () => {
1250
- At(await X(`/projects/${y.projectId}/edits`, {
1439
+ X(await Y(`/projects/${b.projectId}/edits`, {
1251
1440
  expectedVersion: e.expectedVersion,
1252
- operationId: F(),
1441
+ operationId: P(),
1253
1442
  edit: e.edit
1254
1443
  })), D("Preview applied as a new saved version.");
1255
1444
  });
1256
1445
  }
1257
- async function Lt(e) {
1258
- y && !R && await Z(async () => {
1259
- At(await X(`/projects/${y.projectId}/edits`, {
1260
- expectedVersion: y.version,
1261
- operationId: F(),
1446
+ async function tn(e) {
1447
+ b && !L && await Z(async () => {
1448
+ X(await Y(`/projects/${b.projectId}/edits`, {
1449
+ expectedVersion: b.version,
1450
+ operationId: P(),
1262
1451
  edit: {
1263
1452
  selectProposalId: e.id,
1264
1453
  note: "Selected layout " + e.id
@@ -1266,328 +1455,348 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1266
1455
  }));
1267
1456
  });
1268
1457
  }
1269
- async function Rt() {
1270
- y && !e && await Z(async () => {
1271
- let e = await X("/account/quote", { projectId: y.projectId });
1272
- if (e.projectId !== y.projectId || !e.quoteId || he({
1458
+ async function nn() {
1459
+ b && (ct ? lt(!1) : await Z(async () => {
1460
+ let e = await Y(`/projects/${b.projectId}/history`);
1461
+ at(e), lt(!0);
1462
+ }));
1463
+ }
1464
+ async function rn() {
1465
+ b && it?.some((e) => e.version === ut) && it.some((e) => e.version === ft) && await Z(async () => {
1466
+ st(await Y(`/projects/${b.projectId}/compare?left=${ut}&right=${ft}`));
1467
+ });
1468
+ }
1469
+ async function an() {
1470
+ b && ut !== b.version && !L && it?.some((e) => e.version === ut) && await Z(async () => {
1471
+ X(await Y(`/projects/${b.projectId}/undo`, {
1472
+ expectedVersion: b.version,
1473
+ targetVersion: ut,
1474
+ operationId: P()
1475
+ })), D(v(m, "Saved as a new version. Earlier versions are unchanged."));
1476
+ });
1477
+ }
1478
+ async function on() {
1479
+ b && !e && await Z(async () => {
1480
+ let e = await Y("/account/quote", { projectId: b.projectId });
1481
+ if (e.projectId !== b.projectId || !e.quoteId || _e({
1273
1482
  priceMinorUnits: e.priceMinorUnits,
1274
1483
  currency: e.currency
1275
- }, l) === null || !Number.isFinite(Date.parse(e.expiresAtUtc))) throw Error("A valid project quote was not supplied.");
1276
- oe(e);
1484
+ }, m) === null || !Number.isFinite(Date.parse(e.expiresAtUtc))) throw Error("A valid project quote was not supplied.");
1485
+ ue(e);
1277
1486
  });
1278
1487
  }
1279
- async function zt() {
1280
- y && O && !e && Tt && q && await Z(async () => {
1281
- if (O.projectId !== y.projectId || Date.parse(O.expiresAtUtc) <= Date.now()) throw Error("This quote expired. Refresh the project quote before purchase.");
1282
- let e = await X("/account/checkout", {
1283
- projectId: y.projectId,
1284
- requestId: F(),
1488
+ async function sn() {
1489
+ b && O && !e && Ut && q && await Z(async () => {
1490
+ if (O.projectId !== b.projectId || Date.parse(O.expiresAtUtc) <= Date.now()) throw Error("This quote expired. Refresh the project quote before purchase.");
1491
+ let e = await Y("/account/checkout", {
1492
+ projectId: b.projectId,
1493
+ requestId: P(),
1285
1494
  quoteId: O.quoteId
1286
1495
  }), t = new URL(e.url);
1287
1496
  if (t.protocol !== "https:" || t.hostname !== "checkout.stripe.com" || t.username || t.password) throw Error("The checkout address was not accepted.");
1288
1497
  window.location.assign(t.href);
1289
1498
  });
1290
1499
  }
1291
- function Bt() {
1292
- Et(), H.current++, bt.current = "", xt.current = void 0, w(""), le(""), Ie(void 0), N(""), pe(""), Pe(""), D("Signed out. Your saved project stays private and can resume after sign-in.");
1500
+ function cn() {
1501
+ Gt(), H.current++, It.current = "", Lt.current = void 0, T(""), pe(""), Ve(void 0), Ee(""), ye(""), ze(""), D("Signed out. Your saved project stays private and can resume after sign-in.");
1293
1502
  }
1294
- async function Vt() {
1295
- y && K && !R && await Z(async () => {
1296
- k(await X(`/projects/${y.projectId}/drawings`, {
1297
- expectedVersion: y.version,
1298
- operationId: F(),
1503
+ async function ln() {
1504
+ b && K && !L && await Z(async () => {
1505
+ A(await Y(`/projects/${b.projectId}/drawings`, {
1506
+ expectedVersion: b.version,
1507
+ operationId: P(),
1299
1508
  proposalId: K.id
1300
1509
  })), D("2D concept drawings prepared. This does not spend the BIM model export.");
1301
1510
  });
1302
1511
  }
1303
- async function Ht() {
1304
- y && K && !R && await Z(async () => {
1305
- let e = await X(`/projects/${y.projectId}/exports`, {
1306
- expectedVersion: y.version,
1307
- operationId: F(),
1512
+ async function un() {
1513
+ b && K && !L && await Z(async () => {
1514
+ let e = await Y(`/projects/${b.projectId}/exports`, {
1515
+ expectedVersion: b.version,
1516
+ operationId: P(),
1308
1517
  proposalId: K.id
1309
1518
  });
1310
- j(e), v("download");
1519
+ fe(e), y("download");
1311
1520
  });
1312
1521
  }
1313
- async function Ut(t, n = A) {
1314
- n && y && await Z(async () => {
1315
- let r = H.current, i = await Y(`/projects/${y.projectId}/objects/${n.files[t].id}`, { headers: !e && M ? { Authorization: "Bearer " + M } : {} });
1522
+ async function dn(t, n = de) {
1523
+ n && b && await Z(async () => {
1524
+ let r = H.current, i = await Wt(`/projects/${b.projectId}/objects/${n.files[t].id}`, { headers: !e && j ? { Authorization: "Bearer " + j } : {} });
1316
1525
  if (!i.ok) throw Error("Download unavailable.");
1317
1526
  let a = await i.blob();
1318
1527
  J(r);
1319
1528
  let o = URL.createObjectURL(a), s = document.createElement("a");
1320
- s.href = o, s.download = `baulynq-${n.proposalId}-v${n.version}.${t}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1529
+ s.href = o, s.download = `${p === "karamentreprises" ? "karamentreprises" : "baulynq"}-${n.proposalId}-v${n.version}.${t}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1321
1530
  });
1322
1531
  }
1323
- async function Wt(e) {
1532
+ async function fn(e) {
1324
1533
  ![
1325
1534
  "image/png",
1326
1535
  "image/jpeg",
1327
1536
  "image/webp"
1328
- ].includes(e.type) || e.size > 8388608 ? w("Choose a PNG, JPEG or WebP up to 8 MB.") : (ze(e), Ue(null), qe(!1), Ye(!1), y ? (v("measure"), D("Local preview only. Review permissions and AI disclosure before uploading the image.")) : (b || jt(!0), v("measure"), D("Local sketch preview only. Review permissions, then scan and store it privately before asking AI to read observations. No measured footprint is required for that step.")));
1537
+ ].includes(e.type) || e.size > 8388608 ? T("Choose a PNG, JPEG or WebP up to 8 MB.") : (We(e), qe(null), Ze(!1), $e(!1), b ? (y("measure"), D("Local preview only. Review permissions and AI disclosure before uploading the image.")) : (x || Yt(!0), y("measure"), D("Local sketch preview only. Review permissions, then scan and store it privately before asking AI to read observations. No measured footprint is required for that step.")));
1329
1538
  }
1330
- async function Gt() {
1331
- B && await Z(async () => {
1332
- let e = y;
1333
- e || (e = await X("/drafts", {
1334
- projectId: F(),
1335
- operationId: F()
1336
- }), At(e), v("measure")), await Nt(e, B);
1539
+ async function pn() {
1540
+ z && await Z(async () => {
1541
+ let e = b;
1542
+ e || (e = await Y("/drafts", {
1543
+ projectId: P(),
1544
+ operationId: P()
1545
+ }), X(e), y("measure")), await Zt(e, z);
1337
1546
  });
1338
1547
  }
1339
- async function Kt() {
1340
- y && He && await Z(async () => {
1341
- let e = await X(`/projects/${y.projectId}/read-sketch`, {
1342
- expectedVersion: y.version,
1343
- operationId: F(),
1344
- objectId: He,
1345
- intent: T || "Read the sketch measurements and identify uncertainties."
1548
+ async function mn() {
1549
+ b && B && await Z(async () => {
1550
+ let e = await Y(`/projects/${b.projectId}/read-sketch`, {
1551
+ expectedVersion: b.version,
1552
+ operationId: P(),
1553
+ objectId: B,
1554
+ intent: E || "Read the sketch measurements and identify uncertainties."
1346
1555
  });
1347
- mt(e.observations), gt(e.values), it(e.candidate ?? null), ot(!1), Ge(e.questions), D("Recognized values remain estimated. Preview the outline, check labels and assumptions, then explicitly adopt reviewed measurements."), v("measure");
1556
+ At(e.observations), Mt(e.values), bt(e.candidate ?? null), St(!1), Ye(e.questions), D("Recognized values remain estimated. Preview the outline, check labels and assumptions, then explicitly adopt reviewed measurements."), y("measure");
1348
1557
  });
1349
1558
  }
1350
- async function qt() {
1351
- y && await Z(async () => {
1352
- let e = await X(`/projects/${y.projectId}`, void 0, "DELETE");
1353
- te(null), ut([]), x(null), j(null), k(null), oe(null), z(null), ze(null), Ue(null), Ge([]), mt([]), gt(void 0), it(null), ot(!1), ct([]), $e(null), W && ve(localStorage, W, null), Re(null), D(e.dataErased === !0 ? `Service reports project data erased. ${e.accountingPending ? "Accounting cleanup is still pending." : "Accounting cleanup completed."}` : "Deletion accepted; data erasure is still pending. The service will continue cleanup.");
1559
+ async function hn() {
1560
+ b && await Z(async () => {
1561
+ let e = await Y(`/projects/${b.projectId}`, void 0, "DELETE");
1562
+ re(null), Et([]), S(null), fe(null), A(null), ue(null), R(null), ht(!1), We(null), qe(null), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), rt(null), W && xe(localStorage, W, null), Ue(null), D(e.dataErased === !0 ? `Service reports project data erased. ${e.accountingPending ? "Accounting cleanup is still pending." : "Accounting cleanup completed."}` : "Deletion accepted; data erasure is still pending. The service will continue cleanup.");
1354
1563
  });
1355
1564
  }
1356
- async function Jt() {
1357
- !e && M && await Z(async () => {
1358
- let e = await X("/account/data", void 0, "DELETE");
1359
- dt && (await Ot("visit", !1), ft(!1)), Et(), H.current++, W && ve(localStorage, W, null), v("measure"), D((e.dataErased ? "Service reports project content erased." : "Content deletion accepted; erasure is still pending.") + " " + (e.accountingPending ? "Accounting cleanup is still pending. " : "") + "Account identity, billing and required anti-abuse metadata are retained.");
1565
+ async function gn() {
1566
+ !e && j && await Z(async () => {
1567
+ let e = await Y("/account/data", void 0, "DELETE");
1568
+ Dt && (await qt("visit", !1), Ot(!1)), Gt(), H.current++, W && xe(localStorage, W, null), y("measure"), D((e.dataErased ? "Service reports project content erased." : "Content deletion accepted; erasure is still pending.") + " " + (e.accountingPending ? "Accounting cleanup is still pending. " : "") + "Account identity, billing and required anti-abuse metadata are retained.");
1360
1569
  });
1361
1570
  }
1362
- async function Yt() {
1571
+ async function _n() {
1363
1572
  await Z(async () => {
1364
1573
  let e = H.current;
1365
- if (L === "signup") {
1366
- await X("/account/signup", { email: fe }), D("Check your email for the verification link. No session is created until ownership is verified."), Me("verify"), N("");
1574
+ if (I === "signup") {
1575
+ await Y("/account/signup", { email: ge }), D("Check your email for the verification link. No session is created until ownership is verified."), Le("verify"), Ee("");
1367
1576
  return;
1368
1577
  }
1369
- let t = await X(L === "verify" ? "/account/verification/complete" : "/account/login", L === "verify" ? {
1370
- token: Ne,
1371
- password: me
1578
+ let t = await Y(I === "verify" ? "/account/verification/complete" : "/account/login", I === "verify" ? {
1579
+ token: Re,
1580
+ password: M
1372
1581
  } : {
1373
- email: fe,
1374
- password: me
1582
+ email: ge,
1583
+ password: M
1375
1584
  });
1376
- if (N(""), Pe(""), !t.token) {
1377
- Me("login"), D("Email verified. Sign in to continue.");
1585
+ if (Ee(""), ze(""), !t.token) {
1586
+ Le("login"), D("Email verified. Sign in to continue.");
1378
1587
  return;
1379
1588
  }
1380
- let n = await Y("/session", { headers: { Authorization: "Bearer " + t.token } });
1589
+ let n = await Wt("/session", { headers: { Authorization: "Bearer " + t.token } });
1381
1590
  if (!n.ok) throw Error("The verified workspace could not be loaded.");
1382
1591
  let r = await n.json();
1383
1592
  if (J(e), typeof r.workspaceKey != "string" || !r.workspaceKey || r.workspaceKey.length > 512) throw Error("The verified workspace could not be loaded.");
1384
- xt.current && xt.current !== r.workspaceKey && Et(), H.current++, bt.current = t.token, xt.current = r.workspaceKey, le(t.token), Ie(r.workspaceKey), de(!1), D("Signed in. This session stays in memory only.");
1593
+ Lt.current && Lt.current !== r.workspaceKey && Gt(), H.current++, It.current = t.token, Lt.current = r.workspaceKey, pe(t.token), Ve(r.workspaceKey), he(!1), D("Signed in. This session stays in memory only.");
1385
1594
  });
1386
1595
  }
1387
- function Xt() {
1388
- V?.input && (x({
1389
- ...b ?? ye(l),
1596
+ function vn() {
1597
+ V?.input && (ht(!0), S({
1598
+ ...x ?? Se(m),
1390
1599
  footprint: V.input
1391
- }), $e(V.reconciliation), ct(V.input.edges.flatMap((e, t) => [`footprint.edges[${t}].lengthM`, ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]])), ot(!0), Ze(!1), z(null), v("measure"), D("Recognized outline is a local estimated preview. No project version or proposal was changed. Review every length, bearing and wall type before adoption."));
1600
+ }), rt(V.reconciliation), wt(V.input.edges.flatMap((e, t) => [`footprint.edges[${t}].lengthM`, ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]])), St(!0), tt(!1), R(null), y("measure"), D("Recognized outline is a local estimated preview. No project version or proposal was changed. Review every length, bearing and wall type before adoption."));
1392
1601
  }
1393
- function Zt(e) {
1394
- Ue(e), v("measure"), D("Saved sanitized sketch selected. Reading it with AI is a separate explicit action.");
1602
+ function yn(e) {
1603
+ qe(e), y("measure"), D("Saved sanitized sketch selected. Reading it with AI is a separate explicit action.");
1395
1604
  }
1396
- async function Qt(t, n) {
1397
- y && await Z(async () => {
1398
- let r = H.current, i = await Y(`/projects/${y.projectId}/objects/${n.objectId}`, { headers: !e && M ? { Authorization: "Bearer " + M } : {} });
1605
+ async function bn(t, n) {
1606
+ b && await Z(async () => {
1607
+ let r = H.current, i = await Wt(`/projects/${b.projectId}/objects/${n.objectId}`, { headers: !e && j ? { Authorization: "Bearer " + j } : {} });
1399
1608
  if (!i.ok) throw Error("Saved file is unavailable or expired.");
1400
1609
  let a = await i.blob();
1401
1610
  J(r);
1402
1611
  let o = URL.createObjectURL(a), s = document.createElement("a");
1403
- s.href = o, s.download = `baulynq-${t.kind}${t.version ? "-v" + t.version : ""}.${n.format}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1612
+ s.href = o, s.download = `${p === "karamentreprises" ? "karamentreprises" : "baulynq"}-${t.kind}${t.version ? "-v" + t.version : ""}.${n.format}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1404
1613
  });
1405
1614
  }
1406
1615
  r(() => {
1407
- if (!y) return;
1616
+ if (!b) return;
1408
1617
  let e = !0;
1409
- return X(`/projects/${y.projectId}/artifacts`).then((t) => {
1410
- e && ut(Array.isArray(t) ? t : []);
1618
+ return Y(`/projects/${b.projectId}/artifacts`).then((t) => {
1619
+ e && Et(Array.isArray(t) ? t : []);
1411
1620
  }).catch(() => {
1412
- e && ut([]);
1621
+ e && Et([]);
1413
1622
  }), () => {
1414
1623
  e = !1;
1415
1624
  };
1416
1625
  }, [
1417
- y?.projectId,
1418
- y?.version,
1419
- He
1626
+ b?.projectId,
1627
+ b?.version,
1628
+ B
1420
1629
  ]);
1421
- let $ = K?.values ?? G?.reconciliation.values ?? Qe?.values, $t = K?.findings.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {}) ?? {};
1422
- return /* @__PURE__ */ p("div", {
1630
+ let $ = ne === "measure" ? nt?.values : K?.values ?? G?.reconciliation.values ?? nt?.values, xn = K?.findings.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {}) ?? {};
1631
+ return /* @__PURE__ */ l("div", {
1423
1632
  className: "bim-studio",
1424
- dir: l === "ar" ? "rtl" : "ltr",
1633
+ dir: m === "ar" ? "rtl" : "ltr",
1425
1634
  children: [
1426
- !e && /* @__PURE__ */ p("header", { children: [/* @__PURE__ */ f("a", {
1635
+ !e && /* @__PURE__ */ l("header", { children: [/* @__PURE__ */ c("a", {
1427
1636
  className: "logo",
1428
1637
  href: "/",
1429
1638
  onClick: (e) => {
1430
1639
  e.preventDefault(), Q("home");
1431
1640
  },
1432
- children: /* @__PURE__ */ f(Ce, {})
1433
- }), /* @__PURE__ */ p("nav", { children: [
1434
- /* @__PURE__ */ f("a", {
1641
+ children: /* @__PURE__ */ c(Oe, {})
1642
+ }), /* @__PURE__ */ l("nav", { children: [
1643
+ /* @__PURE__ */ c("a", {
1435
1644
  href: "/#pricing",
1436
- onClick: () => ee !== "home" && Q("home"),
1645
+ onClick: () => _ !== "home" && Q("home"),
1437
1646
  children: U.pricing
1438
1647
  }),
1439
- /* @__PURE__ */ f("select", {
1648
+ /* @__PURE__ */ c("select", {
1440
1649
  "aria-label": U.language,
1441
- value: l,
1442
- onChange: (e) => u(e.target.value),
1650
+ value: m,
1651
+ onChange: (e) => h(e.target.value),
1443
1652
  children: [
1444
1653
  "en",
1445
1654
  "de",
1446
1655
  "fr",
1447
1656
  "ar"
1448
- ].map((e) => /* @__PURE__ */ f("option", {
1657
+ ].map((e) => /* @__PURE__ */ c("option", {
1449
1658
  value: e,
1450
1659
  children: e.toUpperCase()
1451
1660
  }, e))
1452
1661
  }),
1453
- /* @__PURE__ */ f("button", {
1662
+ /* @__PURE__ */ c("button", {
1454
1663
  className: "quiet account-action",
1455
- disabled: S,
1456
- onClick: () => M ? Q("studio") : de(!0),
1457
- children: M ? U.account : U.signin
1664
+ disabled: C,
1665
+ onClick: () => j ? Q("studio") : he(!0),
1666
+ children: j ? U.account : U.signin
1458
1667
  }),
1459
- M && /* @__PURE__ */ p("div", {
1668
+ j && /* @__PURE__ */ l("div", {
1460
1669
  className: "account-options",
1461
- children: [/* @__PURE__ */ f("button", {
1670
+ children: [/* @__PURE__ */ c("button", {
1462
1671
  className: "quiet",
1463
- "aria-label": _(l, "Account options"),
1464
- "aria-expanded": nt,
1672
+ "aria-label": v(m, "Account options"),
1673
+ "aria-expanded": vt,
1465
1674
  "aria-controls": "bim-account-actions",
1466
- disabled: S,
1467
- onClick: () => rt(!nt),
1675
+ disabled: C,
1676
+ onClick: () => yt(!vt),
1468
1677
  children: "⋯"
1469
- }), nt && /* @__PURE__ */ p("div", {
1678
+ }), vt && /* @__PURE__ */ l("div", {
1470
1679
  id: "bim-account-actions",
1471
1680
  role: "group",
1472
- "aria-label": _(l, "Account actions"),
1681
+ "aria-label": v(m, "Account actions"),
1473
1682
  className: "account-actions",
1474
1683
  onKeyDown: (e) => {
1475
- e.key === "Escape" && (rt(!1), e.currentTarget.parentElement?.querySelector("button")?.focus());
1684
+ e.key === "Escape" && (yt(!1), e.currentTarget.parentElement?.querySelector("button")?.focus());
1476
1685
  },
1477
- children: [/* @__PURE__ */ f("button", {
1686
+ children: [/* @__PURE__ */ c("button", {
1478
1687
  className: "quiet full",
1479
- disabled: S,
1688
+ disabled: C,
1480
1689
  onClick: () => {
1481
- rt(!1), tt(!0);
1690
+ yt(!1), _t(!0);
1482
1691
  },
1483
- children: _(l, "Delete project content")
1484
- }), /* @__PURE__ */ f("button", {
1692
+ children: v(m, "Delete project content")
1693
+ }), /* @__PURE__ */ c("button", {
1485
1694
  className: "quiet full",
1486
- disabled: S,
1487
- onClick: Bt,
1488
- children: _(l, "Sign out")
1695
+ disabled: C,
1696
+ onClick: cn,
1697
+ children: v(m, "Sign out")
1489
1698
  })]
1490
1699
  })]
1491
1700
  }),
1492
- /* @__PURE__ */ p("button", {
1701
+ /* @__PURE__ */ l("button", {
1493
1702
  className: "ink",
1494
1703
  onClick: () => Q("studio"),
1495
- children: [U.studio, /* @__PURE__ */ f(we, {})]
1704
+ children: [U.studio, /* @__PURE__ */ c(ke, {})]
1496
1705
  })
1497
1706
  ] })] }),
1498
- ee === "home" ? /* @__PURE__ */ p("main", {
1707
+ _ === "home" ? /* @__PURE__ */ l("main", {
1499
1708
  className: "landing",
1500
1709
  children: [
1501
- /* @__PURE__ */ p("section", {
1710
+ /* @__PURE__ */ l("section", {
1502
1711
  className: "hero",
1503
1712
  children: [
1504
- /* @__PURE__ */ p("span", {
1713
+ /* @__PURE__ */ l("span", {
1505
1714
  className: "eyebrow",
1506
1715
  children: [
1507
1716
  U.eyebrow,
1508
1717
  " ",
1509
- /* @__PURE__ */ f("span", { children: "01 — VISION" })
1718
+ /* @__PURE__ */ c("span", { children: "01 — VISION" })
1510
1719
  ]
1511
1720
  }),
1512
- /* @__PURE__ */ f("h1", { children: U.hero }),
1513
- /* @__PURE__ */ f("p", { children: U.intro }),
1514
- /* @__PURE__ */ p("div", {
1721
+ /* @__PURE__ */ c("h1", { children: U.hero }),
1722
+ /* @__PURE__ */ c("p", { children: U.intro }),
1723
+ /* @__PURE__ */ l("div", {
1515
1724
  className: "actions",
1516
- children: [/* @__PURE__ */ p("button", {
1725
+ children: [/* @__PURE__ */ l("button", {
1517
1726
  className: "ink large",
1518
1727
  onClick: () => Q("studio"),
1519
- children: [U.start, /* @__PURE__ */ f(we, {})]
1520
- }), P.mode === "local-demo" ? /* @__PURE__ */ p("button", {
1728
+ children: [U.start, /* @__PURE__ */ c(ke, {})]
1729
+ }), N.mode === "local-demo" ? /* @__PURE__ */ l("button", {
1521
1730
  className: "textbtn",
1522
- onClick: Mt,
1731
+ onClick: Xt,
1523
1732
  children: [U.try, " →"]
1524
- }) : /* @__PURE__ */ p("button", {
1733
+ }) : /* @__PURE__ */ l("button", {
1525
1734
  className: "textbtn",
1526
- onClick: () => jt(),
1527
- children: [_(l, "Enter measurements"), " →"]
1735
+ onClick: () => Yt(),
1736
+ children: [v(m, "Enter measurements"), " →"]
1528
1737
  })]
1529
1738
  }),
1530
- /* @__PURE__ */ p("div", {
1739
+ /* @__PURE__ */ l("div", {
1531
1740
  className: "proof",
1532
- children: [/* @__PURE__ */ f("span", { className: "dot" }), "Your measurements. Checked geometry. One shared engine."]
1741
+ children: [/* @__PURE__ */ c("span", { className: "dot" }), "Your measurements. Checked geometry. One shared engine."]
1533
1742
  })
1534
1743
  ]
1535
1744
  }),
1536
- /* @__PURE__ */ p("section", {
1745
+ /* @__PURE__ */ l("section", {
1537
1746
  className: "transformation",
1538
1747
  children: [
1539
- /* @__PURE__ */ p("article", {
1748
+ /* @__PURE__ */ l("article", {
1540
1749
  className: "sketch-card",
1541
1750
  children: [
1542
- /* @__PURE__ */ p("div", {
1751
+ /* @__PURE__ */ l("div", {
1543
1752
  className: "card-title",
1544
- children: [/* @__PURE__ */ f("span", { children: "01 / SKETCH" }), /* @__PURE__ */ f("span", { children: "THE STARTING POINT" })]
1753
+ children: [/* @__PURE__ */ c("span", { children: "01 / SKETCH" }), /* @__PURE__ */ c("span", { children: "THE STARTING POINT" })]
1545
1754
  }),
1546
- /* @__PURE__ */ f(Te, {}),
1547
- /* @__PURE__ */ f("h3", { children: U.before })
1755
+ /* @__PURE__ */ c(Ae, {}),
1756
+ /* @__PURE__ */ c("h3", { children: U.before })
1548
1757
  ]
1549
1758
  }),
1550
- /* @__PURE__ */ f("div", {
1759
+ /* @__PURE__ */ c("div", {
1551
1760
  className: "flow-arrow",
1552
1761
  children: "→"
1553
1762
  }),
1554
- /* @__PURE__ */ p("article", {
1763
+ /* @__PURE__ */ l("article", {
1555
1764
  className: "plan-card",
1556
1765
  children: [
1557
- /* @__PURE__ */ p("div", {
1766
+ /* @__PURE__ */ l("div", {
1558
1767
  className: "card-title",
1559
- children: [/* @__PURE__ */ f("span", { children: "02 / POSSIBILITIES" }), /* @__PURE__ */ f("span", {
1768
+ children: [/* @__PURE__ */ c("span", { children: "02 / POSSIBILITIES" }), /* @__PURE__ */ c("span", {
1560
1769
  className: "teal",
1561
1770
  children: "CHECKED BY THE ENGINE"
1562
1771
  })]
1563
1772
  }),
1564
- /* @__PURE__ */ f("div", {
1773
+ /* @__PURE__ */ c("div", {
1565
1774
  className: "mini-plan",
1566
- children: /* @__PURE__ */ f("img", {
1775
+ children: /* @__PURE__ */ c("img", {
1567
1776
  src: "/reference-plan.svg",
1568
1777
  alt: "Engine-generated reference layout A with checked dimensions"
1569
1778
  })
1570
1779
  }),
1571
- /* @__PURE__ */ f("h3", { children: U.after }),
1572
- P.mode === "local-demo" ? /* @__PURE__ */ p("button", {
1780
+ /* @__PURE__ */ c("h3", { children: U.after }),
1781
+ N.mode === "local-demo" ? /* @__PURE__ */ l("button", {
1573
1782
  className: "textbtn",
1574
- onClick: Mt,
1783
+ onClick: Xt,
1575
1784
  children: [U.try, " ↗"]
1576
- }) : /* @__PURE__ */ p("button", {
1785
+ }) : /* @__PURE__ */ l("button", {
1577
1786
  className: "textbtn",
1578
- onClick: () => jt(),
1579
- children: [_(l, "Enter measurements"), " ↗"]
1787
+ onClick: () => Yt(),
1788
+ children: [v(m, "Enter measurements"), " ↗"]
1580
1789
  })
1581
1790
  ]
1582
1791
  })
1583
1792
  ]
1584
1793
  }),
1585
- /* @__PURE__ */ f("section", {
1794
+ /* @__PURE__ */ c("section", {
1586
1795
  className: "process",
1587
- children: U.steps.map((e, t) => /* @__PURE__ */ p("div", { children: [
1588
- /* @__PURE__ */ p("span", { children: ["0", t + 1] }),
1589
- /* @__PURE__ */ f("h3", { children: e }),
1590
- /* @__PURE__ */ f("p", { children: [
1796
+ children: U.steps.map((e, t) => /* @__PURE__ */ l("div", { children: [
1797
+ /* @__PURE__ */ l("span", { children: ["0", t + 1] }),
1798
+ /* @__PURE__ */ c("h3", { children: e }),
1799
+ /* @__PURE__ */ c("p", { children: [
1591
1800
  "A drawing or photo, with dimensions.",
1592
1801
  "Confirm dimensions and fixed constraints.",
1593
1802
  "Compare different ways to use your space.",
@@ -1595,50 +1804,50 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1595
1804
  ][t] })
1596
1805
  ] }, e))
1597
1806
  }),
1598
- /* @__PURE__ */ p("section", {
1807
+ /* @__PURE__ */ l("section", {
1599
1808
  className: "use-case-links",
1600
1809
  children: [
1601
- /* @__PURE__ */ f("h2", { children: _(l, "Plan your next space") }),
1602
- /* @__PURE__ */ p("a", {
1810
+ /* @__PURE__ */ c("h2", { children: v(m, "Plan your next space") }),
1811
+ /* @__PURE__ */ l("a", {
1603
1812
  href: "/apartment-layout/",
1604
- children: [_(l, "Apartment layout"), " ↗"]
1813
+ children: [v(m, "Apartment layout"), " ↗"]
1605
1814
  }),
1606
- /* @__PURE__ */ p("a", {
1815
+ /* @__PURE__ */ l("a", {
1607
1816
  href: "/house-extension/",
1608
- children: [_(l, "House extension"), " ↗"]
1817
+ children: [v(m, "House extension"), " ↗"]
1609
1818
  }),
1610
- /* @__PURE__ */ p("a", {
1819
+ /* @__PURE__ */ l("a", {
1611
1820
  href: "/renovation/",
1612
- children: [_(l, "Renovation"), " ↗"]
1821
+ children: [v(m, "Renovation"), " ↗"]
1613
1822
  })
1614
1823
  ]
1615
1824
  }),
1616
- /* @__PURE__ */ p("section", {
1825
+ /* @__PURE__ */ l("section", {
1617
1826
  className: "price-section",
1618
1827
  id: "pricing",
1619
- children: [/* @__PURE__ */ p("div", { children: [
1620
- /* @__PURE__ */ f("span", {
1828
+ children: [/* @__PURE__ */ l("div", { children: [
1829
+ /* @__PURE__ */ c("span", {
1621
1830
  className: "eyebrow",
1622
1831
  children: "A CLEAR START"
1623
1832
  }),
1624
- /* @__PURE__ */ p("h2", { children: [
1833
+ /* @__PURE__ */ l("h2", { children: [
1625
1834
  "A small project.",
1626
- /* @__PURE__ */ f("br", {}),
1835
+ /* @__PURE__ */ c("br", {}),
1627
1836
  "A useful next step."
1628
1837
  ] }),
1629
- /* @__PURE__ */ f("p", { children: "Free access is included in KEHBIMVISION and BauLynq BIM, within each app’s AI usage limits." })
1630
- ] }), /* @__PURE__ */ p("article", {
1838
+ /* @__PURE__ */ c("p", { children: "Free access is included in KEHBIMVISION and BauLynq BIM, within each app’s AI usage limits." })
1839
+ ] }), /* @__PURE__ */ l("article", {
1631
1840
  className: "price-card",
1632
1841
  children: [
1633
- /* @__PURE__ */ f("span", {
1842
+ /* @__PURE__ */ c("span", {
1634
1843
  className: "eyebrow",
1635
- children: c === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION"
1844
+ children: p === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION"
1636
1845
  }),
1637
- /* @__PURE__ */ f("h2", { children: Ct ?? "Pricing opens with the service" }),
1638
- /* @__PURE__ */ f("small", { children: "Base pricing. Your project quote is shown before purchase." }),
1639
- /* @__PURE__ */ f("p", { children: wt ? `${wt.proposals} free proposal generations · ${wt.exports} BIM exports` : "The local preview does not accept payments." }),
1640
- /* @__PURE__ */ f("p", { children: "One project includes proposals, refinements and its model export." }),
1641
- q && /* @__PURE__ */ p("p", { children: [
1846
+ /* @__PURE__ */ c("h2", { children: Vt ?? "Pricing opens with the service" }),
1847
+ /* @__PURE__ */ c("small", { children: "Base pricing. Your project quote is shown before purchase." }),
1848
+ /* @__PURE__ */ c("p", { children: Ht ? `${Ht.proposals} free proposal generations · ${Ht.exports} BIM exports` : "The local preview does not accept payments." }),
1849
+ /* @__PURE__ */ c("p", { children: "One project includes proposals, refinements and its model export." }),
1850
+ q && /* @__PURE__ */ l("p", { children: [
1642
1851
  "After the initial proposal request: ",
1643
1852
  q.regenerations,
1644
1853
  " regenerations · ",
@@ -1649,108 +1858,109 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1649
1858
  q.exports === 1 ? "BIM export" : "BIM exports",
1650
1859
  " per paid project."
1651
1860
  ] }),
1652
- /* @__PURE__ */ p("button", {
1861
+ /* @__PURE__ */ l("button", {
1653
1862
  className: "ink",
1654
1863
  onClick: () => Q("studio"),
1655
- children: [U.start, /* @__PURE__ */ f(we, {})]
1864
+ children: [U.start, /* @__PURE__ */ c(ke, {})]
1656
1865
  })
1657
1866
  ]
1658
1867
  })]
1659
1868
  }),
1660
- /* @__PURE__ */ p("footer", { children: [/* @__PURE__ */ f(Ce, {}), /* @__PURE__ */ f("span", { children: U.disclaimer })] })
1869
+ /* @__PURE__ */ l("footer", { children: [/* @__PURE__ */ c(Oe, {}), /* @__PURE__ */ c("span", { children: U.disclaimer })] })
1661
1870
  ]
1662
- }) : /* @__PURE__ */ p("main", {
1871
+ }) : /* @__PURE__ */ l("main", {
1663
1872
  className: "studio",
1664
1873
  children: [
1665
- /* @__PURE__ */ p("aside", {
1874
+ /* @__PURE__ */ l("aside", {
1666
1875
  className: "rail",
1667
1876
  children: [
1668
- /* @__PURE__ */ f("span", {
1877
+ /* @__PURE__ */ c("span", {
1669
1878
  className: "eyebrow",
1670
1879
  children: "WORKSPACE"
1671
1880
  }),
1672
- /* @__PURE__ */ f("h2", { children: U.workspace }),
1673
- /* @__PURE__ */ p("span", {
1881
+ /* @__PURE__ */ c("h2", { children: U.workspace }),
1882
+ /* @__PURE__ */ l("span", {
1674
1883
  className: "project-status",
1675
- children: [/* @__PURE__ */ f("span", { className: "dot" }), P.mode === "local-demo" ? "Local reference preview" : "Private project"]
1884
+ children: [/* @__PURE__ */ c("span", { className: "dot" }), N.mode === "local-demo" ? "Local reference preview" : "Private project"]
1676
1885
  }),
1677
- /* @__PURE__ */ f("div", {
1886
+ /* @__PURE__ */ c("div", {
1678
1887
  className: "stage-nav",
1679
1888
  children: [
1680
1889
  "measure",
1681
1890
  "proposals",
1682
1891
  "refine",
1683
1892
  "download"
1684
- ].map((e, t) => /* @__PURE__ */ p("button", {
1685
- className: g === e ? "active" : "",
1686
- onClick: () => v(e),
1687
- children: [/* @__PURE__ */ p("span", { children: ["0", t + 1] }), U[e]]
1893
+ ].map((e, t) => /* @__PURE__ */ l("button", {
1894
+ className: ne === e ? "active" : "",
1895
+ disabled: C,
1896
+ onClick: () => y(e),
1897
+ children: [/* @__PURE__ */ l("span", { children: ["0", t + 1] }), U[e]]
1688
1898
  }, e))
1689
1899
  }),
1690
- /* @__PURE__ */ p("div", {
1900
+ /* @__PURE__ */ l("div", {
1691
1901
  className: "rail-bottom",
1692
1902
  children: [
1693
- /* @__PURE__ */ f("p", { children: U.privacy }),
1694
- typeof P.retentionDays == "number" && /* @__PURE__ */ p("p", { children: [
1903
+ /* @__PURE__ */ c("p", { children: U.privacy }),
1904
+ typeof N.retentionDays == "number" && /* @__PURE__ */ l("p", { children: [
1695
1905
  "Retention: ",
1696
- P.retentionDays,
1906
+ N.retentionDays,
1697
1907
  " days, as configured by the service."
1698
1908
  ] }),
1699
- y && /* @__PURE__ */ f("button", {
1909
+ b && /* @__PURE__ */ c("button", {
1700
1910
  className: "quiet danger",
1701
- onClick: qt,
1911
+ onClick: hn,
1702
1912
  children: U.delete
1703
1913
  })
1704
1914
  ]
1705
1915
  })
1706
1916
  ]
1707
1917
  }),
1708
- /* @__PURE__ */ p("section", {
1918
+ /* @__PURE__ */ l("section", {
1709
1919
  className: "workspace",
1710
1920
  children: [
1711
- /* @__PURE__ */ p("div", {
1921
+ /* @__PURE__ */ l("div", {
1712
1922
  className: "workspace-heading",
1713
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("span", {
1923
+ children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("span", {
1714
1924
  className: "eyebrow",
1715
- children: y ? `VERSION ${y.version} / ${y.projectId.slice(0, 8)}` : "YOUR NEXT SPACE"
1716
- }), /* @__PURE__ */ f("h1", { children: U[g] })] }), /* @__PURE__ */ p("div", {
1925
+ children: b ? `VERSION ${b.version} / ${b.projectId.slice(0, 8)}` : "YOUR NEXT SPACE"
1926
+ }), /* @__PURE__ */ c("h1", { children: U[ne] })] }), /* @__PURE__ */ l("div", {
1717
1927
  className: "workspace-controls",
1718
1928
  children: [
1719
- e && /* @__PURE__ */ f("select", {
1929
+ e && /* @__PURE__ */ c("select", {
1720
1930
  "aria-label": U.language,
1721
- value: l,
1722
- onChange: (e) => u(e.target.value),
1931
+ value: m,
1932
+ onChange: (e) => h(e.target.value),
1723
1933
  children: [
1724
1934
  "en",
1725
1935
  "de",
1726
1936
  "fr",
1727
1937
  "ar"
1728
- ].map((e) => /* @__PURE__ */ f("option", {
1938
+ ].map((e) => /* @__PURE__ */ c("option", {
1729
1939
  value: e,
1730
1940
  children: e.toUpperCase()
1731
1941
  }, e))
1732
1942
  }),
1733
- /* @__PURE__ */ f("button", {
1943
+ /* @__PURE__ */ c("button", {
1734
1944
  className: "quiet",
1735
- disabled: S,
1736
- onClick: () => jt(),
1737
- children: _(l, "New project")
1945
+ disabled: C,
1946
+ onClick: () => Yt(),
1947
+ children: v(m, "New project")
1738
1948
  }),
1739
- y && /* @__PURE__ */ f("button", {
1949
+ b && /* @__PURE__ */ c("button", {
1740
1950
  className: "quiet compact-delete",
1741
1951
  "aria-label": "Delete current project",
1742
- disabled: S,
1743
- onClick: qt,
1952
+ disabled: C,
1953
+ onClick: hn,
1744
1954
  children: U.delete
1745
1955
  }),
1746
- y && /* @__PURE__ */ p("button", {
1956
+ b && /* @__PURE__ */ l("button", {
1747
1957
  className: "outline",
1748
- disabled: S || !!R || y.version < 2,
1958
+ disabled: C || !!L || b.version < 2,
1749
1959
  onClick: () => Z(async () => {
1750
- At(await X(`/projects/${y.projectId}/undo`, {
1751
- expectedVersion: y.version,
1752
- targetVersion: y.version - 1,
1753
- operationId: F()
1960
+ X(await Y(`/projects/${b.projectId}/undo`, {
1961
+ expectedVersion: b.version,
1962
+ targetVersion: b.version - 1,
1963
+ operationId: P()
1754
1964
  }));
1755
1965
  }),
1756
1966
  children: ["↶ ", U.undo]
@@ -1758,318 +1968,325 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
1758
1968
  ]
1759
1969
  })]
1760
1970
  }),
1761
- C && /* @__PURE__ */ p("div", {
1971
+ w && /* @__PURE__ */ l("div", {
1762
1972
  role: "alert",
1763
1973
  className: "alert",
1764
- children: [c === "karamentreprises" ? C.replace(/Polycyphers/gi, "Karamentreprises") : C, /* @__PURE__ */ f("button", {
1974
+ children: [p === "karamentreprises" ? w.replace(/Polycyphers/gi, "Karamentreprises") : w, /* @__PURE__ */ c("button", {
1765
1975
  "aria-label": U.close,
1766
- onClick: () => w(""),
1976
+ onClick: () => T(""),
1767
1977
  children: "×"
1768
1978
  })]
1769
1979
  }),
1770
- ae && /* @__PURE__ */ p("div", {
1980
+ ce && /* @__PURE__ */ l("div", {
1771
1981
  role: "status",
1772
1982
  className: "notice",
1773
- children: [ae, /* @__PURE__ */ f("button", {
1983
+ children: [ce, /* @__PURE__ */ c("button", {
1774
1984
  "aria-label": U.close,
1775
1985
  onClick: () => D(""),
1776
1986
  children: "×"
1777
1987
  })]
1778
1988
  }),
1779
- R && /* @__PURE__ */ f("section", {
1989
+ L && /* @__PURE__ */ c("section", {
1780
1990
  className: "notice preview-banner",
1781
1991
  role: "status",
1782
- children: /* @__PURE__ */ p("div", { children: [
1783
- /* @__PURE__ */ f("strong", { children: _(l, "Unsaved edit preview") }),
1784
- /* @__PURE__ */ p("p", { children: [
1992
+ children: /* @__PURE__ */ l("div", { children: [
1993
+ /* @__PURE__ */ c("strong", { children: v(m, "Unsaved edit preview") }),
1994
+ /* @__PURE__ */ l("p", { children: [
1785
1995
  "Review the recomputed plan, schedule and rule findings below. Your saved version ",
1786
- y?.version,
1996
+ b?.version,
1787
1997
  " is unchanged."
1788
1998
  ] }),
1789
- /* @__PURE__ */ f("button", {
1999
+ /* @__PURE__ */ c("button", {
1790
2000
  className: "ink",
1791
- disabled: S || !xe(R, y),
1792
- onClick: It,
1793
- children: _(l, "Apply as new version")
2001
+ disabled: C || !we(L, b),
2002
+ onClick: en,
2003
+ children: v(m, "Apply as new version")
1794
2004
  }),
1795
- /* @__PURE__ */ f("button", {
2005
+ /* @__PURE__ */ c("button", {
1796
2006
  className: "outline",
1797
- disabled: S,
1798
- onClick: () => z(null),
1799
- children: _(l, "Discard preview")
2007
+ disabled: C,
2008
+ onClick: () => R(null),
2009
+ children: v(m, "Discard preview")
1800
2010
  })
1801
2011
  ] })
1802
2012
  }),
1803
- !y && !b ? /* @__PURE__ */ p("div", {
2013
+ !b && !x ? /* @__PURE__ */ l("div", {
1804
2014
  className: "empty",
1805
2015
  children: [
1806
- /* @__PURE__ */ f("span", {
2016
+ /* @__PURE__ */ c("span", {
1807
2017
  className: "empty-icon",
1808
2018
  children: "⌑"
1809
2019
  }),
1810
- /* @__PURE__ */ f("h2", { children: U.empty }),
1811
- /* @__PURE__ */ f("p", { children: U.emptyBody }),
1812
- /* @__PURE__ */ p("div", {
2020
+ /* @__PURE__ */ c("h2", { children: U.empty }),
2021
+ /* @__PURE__ */ c("p", { children: U.emptyBody }),
2022
+ /* @__PURE__ */ l("div", {
1813
2023
  className: "actions",
1814
- children: [/* @__PURE__ */ p("button", {
2024
+ children: [/* @__PURE__ */ l("button", {
1815
2025
  className: "ink large",
1816
- disabled: S,
1817
- onClick: () => _t.current?.click(),
1818
- children: [U.upload, /* @__PURE__ */ f(we, {})]
1819
- }), /* @__PURE__ */ f("button", {
2026
+ disabled: C,
2027
+ onClick: () => Nt.current?.click(),
2028
+ children: [U.upload, /* @__PURE__ */ c(ke, {})]
2029
+ }), /* @__PURE__ */ c("button", {
1820
2030
  className: "outline",
1821
- disabled: S,
1822
- onClick: () => jt(),
1823
- children: _(l, "Enter measurements")
2031
+ disabled: C,
2032
+ onClick: () => Yt(),
2033
+ children: v(m, "Enter measurements")
1824
2034
  })]
1825
2035
  }),
1826
- Le && /* @__PURE__ */ f("button", {
2036
+ He && /* @__PURE__ */ c("button", {
1827
2037
  className: "outline",
1828
- disabled: S,
2038
+ disabled: C,
1829
2039
  onClick: () => Z(async () => {
1830
- let e = await X("/projects/" + Le);
1831
- At(e), v(e.input.isDraft ? "measure" : "proposals");
2040
+ let e = await Y("/projects/" + He);
2041
+ X(e), y(e.input.isDraft ? "measure" : "proposals");
1832
2042
  }),
1833
- children: _(l, "Resume saved project")
2043
+ children: v(m, "Resume saved project")
1834
2044
  }),
1835
- P.mode === "local-demo" && /* @__PURE__ */ f("button", {
2045
+ N.mode === "local-demo" && /* @__PURE__ */ c("button", {
1836
2046
  className: "textbtn",
1837
- disabled: S,
1838
- onClick: Mt,
2047
+ disabled: C,
2048
+ onClick: Xt,
1839
2049
  children: U.try
1840
2050
  })
1841
2051
  ]
1842
- }) : g === "measure" && b ? /* @__PURE__ */ p(d, { children: [
1843
- /* @__PURE__ */ f(ke, {
1844
- language: l,
1845
- input: b,
1846
- setInput: x,
2052
+ }) : ne === "measure" && x ? /* @__PURE__ */ l(s, { children: [
2053
+ /* @__PURE__ */ c(Pe, {
2054
+ language: m,
2055
+ input: x,
2056
+ setInput: S,
1847
2057
  onChange: (e) => {
1848
- Ze(!1), z(null), e && ct((t) => t.filter((t) => t !== e));
2058
+ ht(!0), tt(!1), R(null), rt((t) => e === "footprint.diagonals" && t ? {
2059
+ status: "Unvalidated",
2060
+ findings: [],
2061
+ suggestedDiagonal: t.suggestedDiagonal
2062
+ } : null), e && wt((t) => t.filter((t) => t !== e));
1849
2063
  },
1850
- estimatedFields: st,
1851
- confirmed: Xe,
1852
- setConfirmed: Ze,
1853
- onGenerate: Pt,
1854
- busy: S,
1855
- onUpload: () => _t.current?.click(),
1856
- imageUrl: Be,
1857
- geometry: Qe
2064
+ estimatedFields: Ct,
2065
+ confirmed: et,
2066
+ setConfirmed: tt,
2067
+ onGenerate: Qt,
2068
+ busy: C,
2069
+ onUpload: () => Nt.current?.click(),
2070
+ imageUrl: Ge,
2071
+ geometry: nt
1858
2072
  }),
1859
- B && !He && /* @__PURE__ */ p("section", {
2073
+ z && !B && /* @__PURE__ */ l("section", {
1860
2074
  className: "paper consent-panel",
1861
2075
  children: [
1862
- /* @__PURE__ */ f("h3", { children: _(l, "Before image upload") }),
1863
- /* @__PURE__ */ f("p", { children: _(l, "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.") }),
1864
- /* @__PURE__ */ p("label", {
2076
+ /* @__PURE__ */ c("h3", { children: v(m, "Before image upload") }),
2077
+ /* @__PURE__ */ c("p", { children: v(m, "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.") }),
2078
+ /* @__PURE__ */ l("label", {
1865
2079
  className: "confirmation",
1866
- children: [/* @__PURE__ */ f("input", {
2080
+ children: [/* @__PURE__ */ c("input", {
1867
2081
  type: "checkbox",
1868
- checked: Ke,
1869
- onChange: (e) => qe(e.target.checked)
1870
- }), _(l, "I have permission to use this image for this project.")]
2082
+ checked: Xe,
2083
+ onChange: (e) => Ze(e.target.checked)
2084
+ }), v(m, "I have permission to use this image for this project.")]
1871
2085
  }),
1872
- /* @__PURE__ */ p("label", {
2086
+ /* @__PURE__ */ l("label", {
1873
2087
  className: "confirmation",
1874
- children: [/* @__PURE__ */ f("input", {
2088
+ children: [/* @__PURE__ */ c("input", {
1875
2089
  type: "checkbox",
1876
- checked: Je,
1877
- onChange: (e) => Ye(e.target.checked)
1878
- }), _(l, "I understand the AI image-processing disclosure above.")]
2090
+ checked: Qe,
2091
+ onChange: (e) => $e(e.target.checked)
2092
+ }), v(m, "I understand the AI image-processing disclosure above.")]
1879
2093
  }),
1880
- /* @__PURE__ */ p("label", {
2094
+ /* @__PURE__ */ l("label", {
1881
2095
  className: "field",
1882
- children: [_(l, "What would you like to create?"), /* @__PURE__ */ f("textarea", {
2096
+ children: [v(m, "What would you like to create?"), /* @__PURE__ */ c("textarea", {
1883
2097
  "aria-label": "Sketch brief",
1884
- value: T,
2098
+ value: E,
1885
2099
  maxLength: 8e3,
1886
2100
  placeholder: "Room wishes, entrance and view, fixed walls, country…",
1887
- onChange: (e) => E(e.target.value)
2101
+ onChange: (e) => se(e.target.value)
1888
2102
  })]
1889
2103
  }),
1890
- /* @__PURE__ */ f("button", {
2104
+ /* @__PURE__ */ c("button", {
1891
2105
  className: "ink",
1892
- disabled: S || !Ke || !Je,
1893
- onClick: Gt,
1894
- children: _(l, "Upload for scanning")
2106
+ disabled: C || !Xe || !Qe,
2107
+ onClick: pn,
2108
+ children: v(m, "Upload for scanning")
1895
2109
  }),
1896
- /* @__PURE__ */ f("button", {
2110
+ /* @__PURE__ */ c("button", {
1897
2111
  className: "quiet",
1898
2112
  onClick: () => {
1899
- ze(null), qe(!1), Ye(!1);
2113
+ We(null), Ze(!1), $e(!1);
1900
2114
  },
1901
- children: _(l, "Remove local image")
2115
+ children: v(m, "Remove local image")
1902
2116
  })
1903
2117
  ]
1904
2118
  }),
1905
- He && /* @__PURE__ */ p("section", {
2119
+ B && /* @__PURE__ */ l("section", {
1906
2120
  className: "paper consent-panel",
1907
2121
  children: [
1908
- /* @__PURE__ */ f("p", { children: _(l, "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.") }),
1909
- /* @__PURE__ */ p("label", {
2122
+ /* @__PURE__ */ c("p", { children: v(m, "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.") }),
2123
+ /* @__PURE__ */ l("label", {
1910
2124
  className: "field",
1911
- children: [_(l, "What should the sketch reader focus on?"), /* @__PURE__ */ f("textarea", {
2125
+ children: [v(m, "What should the sketch reader focus on?"), /* @__PURE__ */ c("textarea", {
1912
2126
  "aria-label": "Saved sketch brief",
1913
- value: T,
2127
+ value: E,
1914
2128
  maxLength: 8e3,
1915
- onChange: (e) => E(e.target.value)
2129
+ onChange: (e) => se(e.target.value)
1916
2130
  })]
1917
2131
  }),
1918
- /* @__PURE__ */ f("button", {
2132
+ /* @__PURE__ */ c("button", {
1919
2133
  className: "outline",
1920
- disabled: S,
1921
- onClick: Kt,
1922
- children: _(l, "Read saved sketch with AI · observations only")
2134
+ disabled: C,
2135
+ onClick: mn,
2136
+ children: v(m, "Read saved sketch with AI · observations only")
1923
2137
  })
1924
2138
  ]
1925
2139
  }),
1926
- V && /* @__PURE__ */ p("section", {
2140
+ V && /* @__PURE__ */ l("section", {
1927
2141
  className: "paper candidate-panel",
1928
2142
  children: [
1929
- /* @__PURE__ */ f("h3", { children: _(l, "Recognized outline · estimated") }),
1930
- /* @__PURE__ */ f("p", { children: V.input ? `${V.input.edges.length} linked boundary edges · geometry ${V.status}` : "The reader did not return a complete, valid outline. Enter or correct measurements manually." }),
1931
- /* @__PURE__ */ f("p", { children: "Lengths use explicit labels only. Image coordinates do not establish physical scale. Bearings and wall types remain assumptions to review." }),
1932
- /* @__PURE__ */ f("button", {
2143
+ /* @__PURE__ */ c("h3", { children: v(m, "Recognized outline · estimated") }),
2144
+ /* @__PURE__ */ c("p", { children: V.input ? `${V.input.edges.length} linked boundary edges · geometry ${V.status}` : "The reader did not return a complete, valid outline. Enter or correct measurements manually." }),
2145
+ /* @__PURE__ */ c("p", { children: "Lengths use explicit labels only. Image coordinates do not establish physical scale. Bearings and wall types remain assumptions to review." }),
2146
+ /* @__PURE__ */ c("button", {
1933
2147
  className: "outline",
1934
- disabled: S || !V.input || at,
1935
- onClick: Xt,
1936
- children: _(l, "Preview recognized outline")
2148
+ disabled: C || !V.input || xt,
2149
+ onClick: vn,
2150
+ children: v(m, "Preview recognized outline")
1937
2151
  }),
1938
- at && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("p", { children: _(l, "Local estimated preview only. The saved project is unchanged.") }), /* @__PURE__ */ f(Ae, { candidate: V })] }),
1939
- /* @__PURE__ */ f(Oe, {
2152
+ xt && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("p", { children: v(m, "Local estimated preview only. The saved project is unchanged.") }), /* @__PURE__ */ c(Fe, { candidate: V })] }),
2153
+ /* @__PURE__ */ c(Ne, {
1940
2154
  report: V.values,
1941
- language: l
2155
+ language: m
1942
2156
  })
1943
2157
  ]
1944
2158
  }),
1945
- (pt.length > 0 || We.length > 0) && /* @__PURE__ */ p("article", {
2159
+ (kt.length > 0 || Je.length > 0) && /* @__PURE__ */ l("article", {
1946
2160
  className: "paper findings",
1947
2161
  children: [
1948
- /* @__PURE__ */ f("h3", { children: _(l, "Sketch observations to confirm") }),
1949
- /* @__PURE__ */ f("p", { children: "AI readings are estimated and unconfirmed. Compare them with your image and site measurements; enter the reviewed values in the footprint form. No value is applied automatically." }),
1950
- pt.map((e, t) => /* @__PURE__ */ p("section", { children: [
1951
- /* @__PURE__ */ p("strong", { children: [e.kind, e.edgeId ? " · " + e.edgeId : ""] }),
1952
- e.value != null && /* @__PURE__ */ p("p", { children: [
2162
+ /* @__PURE__ */ c("h3", { children: v(m, "Sketch observations to confirm") }),
2163
+ /* @__PURE__ */ c("p", { children: "AI readings are estimated and unconfirmed. Compare them with your image and site measurements; enter the reviewed values in the footprint form. No value is applied automatically." }),
2164
+ kt.map((e, t) => /* @__PURE__ */ l("section", { children: [
2165
+ /* @__PURE__ */ l("strong", { children: [e.kind, e.edgeId ? " · " + e.edgeId : ""] }),
2166
+ e.value != null && /* @__PURE__ */ l("p", { children: [
1953
2167
  e.value,
1954
2168
  " ",
1955
2169
  e.unit ?? "unit unknown",
1956
2170
  " ",
1957
- /* @__PURE__ */ f("span", {
2171
+ /* @__PURE__ */ c("span", {
1958
2172
  className: "value-tag origin-estimated",
1959
2173
  children: "estimated · unconfirmed"
1960
2174
  })
1961
2175
  ] }),
1962
- /* @__PURE__ */ f("p", { children: e.evidence })
2176
+ /* @__PURE__ */ c("p", { children: e.evidence })
1963
2177
  ] }, t)),
1964
- We.map((e, t) => /* @__PURE__ */ f("p", { children: e }, t)),
1965
- ht && /* @__PURE__ */ f(Oe, {
1966
- report: ht,
1967
- language: l
2178
+ Je.map((e, t) => /* @__PURE__ */ c("p", { children: e }, t)),
2179
+ jt && /* @__PURE__ */ c(Ne, {
2180
+ report: jt,
2181
+ language: m
1968
2182
  })
1969
2183
  ]
1970
2184
  })
1971
- ] }) : K ? /* @__PURE__ */ p(d, { children: [
1972
- /* @__PURE__ */ p("div", {
2185
+ ] }) : K ? /* @__PURE__ */ l(s, { children: [
2186
+ /* @__PURE__ */ l("div", {
1973
2187
  className: "metrics",
1974
2188
  children: [
1975
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("span", { children: [
2189
+ /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
1976
2190
  U.area,
1977
2191
  " ",
1978
- /* @__PURE__ */ f(I, {
1979
- language: l,
2192
+ /* @__PURE__ */ c(F, {
2193
+ language: m,
1980
2194
  report: $,
1981
2195
  path: "centerlineAreaM2"
1982
2196
  })
1983
- ] }), /* @__PURE__ */ p("strong", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ f("small", { children: "m²" })] })] }),
1984
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("span", { children: [
2197
+ ] }), /* @__PURE__ */ l("strong", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c("small", { children: "m²" })] })] }),
2198
+ /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
1985
2199
  U.net,
1986
2200
  " ",
1987
- /* @__PURE__ */ f(I, {
1988
- language: l,
2201
+ /* @__PURE__ */ c(F, {
2202
+ language: m,
1989
2203
  report: $,
1990
2204
  path: "netAreaM2"
1991
2205
  })
1992
- ] }), /* @__PURE__ */ p("strong", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ f("small", { children: "m²" })] })] }),
1993
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("span", { children: [
2206
+ ] }), /* @__PURE__ */ l("strong", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ c("small", { children: "m²" })] })] }),
2207
+ /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
1994
2208
  U.perimeter,
1995
2209
  " ",
1996
- /* @__PURE__ */ f(I, {
1997
- language: l,
2210
+ /* @__PURE__ */ c(F, {
2211
+ language: m,
1998
2212
  report: $,
1999
2213
  path: "perimeterM"
2000
2214
  })
2001
- ] }), /* @__PURE__ */ p("strong", { children: [G?.reconciliation.solutions[0]?.perimeterM.toFixed(2), /* @__PURE__ */ f("small", { children: "m" })] })] }),
2002
- /* @__PURE__ */ p("div", {
2215
+ ] }), /* @__PURE__ */ l("strong", { children: [G?.reconciliation.solutions[0]?.perimeterM.toFixed(2), /* @__PURE__ */ c("small", { children: "m" })] })] }),
2216
+ /* @__PURE__ */ l("div", {
2003
2217
  className: "metric-note",
2004
- children: [K.hasRequiredConflicts ? U.warning : _(l, "Required layout checks passed"), /* @__PURE__ */ f("span", { children: _(l, "Reference sources remain visible below.") })]
2218
+ children: [K.hasRequiredConflicts ? U.warning : v(m, "Required layout checks passed"), /* @__PURE__ */ c("span", { children: v(m, "Reference sources remain visible below.") })]
2005
2219
  })
2006
2220
  ]
2007
2221
  }),
2008
- /* @__PURE__ */ p("div", {
2222
+ /* @__PURE__ */ l("div", {
2009
2223
  className: "drawing-layout",
2010
- children: [/* @__PURE__ */ p("article", {
2224
+ children: [/* @__PURE__ */ l("article", {
2011
2225
  className: "drawing paper",
2012
2226
  children: [
2013
- /* @__PURE__ */ p("div", {
2227
+ /* @__PURE__ */ l("div", {
2014
2228
  className: "drawing-top",
2015
2229
  children: [
2016
- /* @__PURE__ */ p("span", { children: ["LAYOUT ", K.id] }),
2017
- /* @__PURE__ */ f("span", { children: R ? "UNSAVED EDIT PREVIEW" : "ENGINE-CHECKED CONCEPT" }),
2018
- /* @__PURE__ */ f("span", { children: "METRES / CONCEPT" })
2230
+ /* @__PURE__ */ l("span", { children: ["LAYOUT ", K.id] }),
2231
+ /* @__PURE__ */ c("span", { children: L ? "UNSAVED EDIT PREVIEW" : "ENGINE-CHECKED CONCEPT" }),
2232
+ /* @__PURE__ */ c("span", { children: "METRES / CONCEPT" })
2019
2233
  ]
2020
2234
  }),
2021
- /* @__PURE__ */ f("div", {
2235
+ /* @__PURE__ */ c("div", {
2022
2236
  className: "engine-svg",
2023
2237
  dangerouslySetInnerHTML: { __html: o.sanitize(K.svg, { USE_PROFILES: {
2024
2238
  svg: !0,
2025
2239
  svgFilters: !0
2026
2240
  } }) }
2027
2241
  }),
2028
- /* @__PURE__ */ p("div", {
2242
+ /* @__PURE__ */ l("div", {
2029
2243
  className: "drawing-bottom",
2030
- children: [/* @__PURE__ */ f("span", { children: c === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION" }), /* @__PURE__ */ p("span", { children: [
2031
- R ? "PREVIEW / " : "",
2244
+ children: [/* @__PURE__ */ c("span", { children: p === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION" }), /* @__PURE__ */ l("span", { children: [
2245
+ L ? "PREVIEW / " : "",
2032
2246
  "v",
2033
2247
  G?.version,
2034
2248
  " · ",
2035
- l.toUpperCase()
2249
+ m.toUpperCase()
2036
2250
  ] })]
2037
2251
  })
2038
2252
  ]
2039
- }), /* @__PURE__ */ p("aside", {
2253
+ }), /* @__PURE__ */ l("aside", {
2040
2254
  className: "proposal-panel",
2041
2255
  children: [
2042
- /* @__PURE__ */ f("span", {
2256
+ /* @__PURE__ */ c("span", {
2043
2257
  className: "eyebrow",
2044
2258
  children: "FIND YOUR FIT"
2045
2259
  }),
2046
- G?.proposals.map((e) => /* @__PURE__ */ p("button", {
2047
- className: "proposal-card " + (ne === e.id ? "selected" : ""),
2048
- onClick: () => re(e.id),
2049
- children: [/* @__PURE__ */ f("span", {
2260
+ G?.proposals.map((e) => /* @__PURE__ */ l("button", {
2261
+ className: "proposal-card " + (ie === e.id ? "selected" : ""),
2262
+ disabled: C,
2263
+ onClick: () => {
2264
+ ie !== e.id && (ae(e.id), fe(null), A(null));
2265
+ },
2266
+ children: [/* @__PURE__ */ c("span", {
2050
2267
  className: "proposal-letter",
2051
2268
  children: e.id
2052
- }), /* @__PURE__ */ p("div", { children: [
2053
- e.recommended && /* @__PURE__ */ f("small", {
2269
+ }), /* @__PURE__ */ l("div", { children: [
2270
+ e.recommended && /* @__PURE__ */ c("small", {
2054
2271
  className: "badge",
2055
2272
  children: U.recommended
2056
2273
  }),
2057
- /* @__PURE__ */ f("h3", { children: e.title }),
2058
- /* @__PURE__ */ f("p", { children: e.tradeOffs[0] })
2274
+ /* @__PURE__ */ c("h3", { children: e.title }),
2275
+ /* @__PURE__ */ c("p", { children: e.tradeOffs[0] })
2059
2276
  ] })]
2060
2277
  }, e.id)),
2061
- /* @__PURE__ */ p("button", {
2278
+ /* @__PURE__ */ l("button", {
2062
2279
  className: "ink full",
2063
- disabled: S || !!R,
2064
- onClick: () => Lt(K),
2065
- children: [U.select, /* @__PURE__ */ f(we, {})]
2280
+ disabled: C || !!L,
2281
+ onClick: () => tn(K),
2282
+ children: [U.select, /* @__PURE__ */ c(ke, {})]
2066
2283
  }),
2067
- !e && y && /* @__PURE__ */ p("section", {
2284
+ !e && b && /* @__PURE__ */ l("section", {
2068
2285
  className: "project-price",
2069
2286
  children: [
2070
- /* @__PURE__ */ f("h3", { children: _(l, "Project billing") }),
2071
- /* @__PURE__ */ f("p", { children: "One project includes proposals, refinements and its BIM model within the configured caps. Free allowances are checked by the service." }),
2072
- q ? /* @__PURE__ */ p("p", {
2287
+ /* @__PURE__ */ c("h3", { children: v(m, "Project billing") }),
2288
+ /* @__PURE__ */ c("p", { children: "One project includes proposals, refinements and its BIM model within the configured caps. Free allowances are checked by the service." }),
2289
+ q ? /* @__PURE__ */ l("p", {
2073
2290
  className: "quota-disclosure",
2074
2291
  children: [
2075
2292
  "After the initial proposal request: ",
@@ -2082,89 +2299,89 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
2082
2299
  q.exports === 1 ? "BIM export" : "BIM exports",
2083
2300
  " per paid project."
2084
2301
  ]
2085
- }) : /* @__PURE__ */ f("p", { children: "Project usage limits are unavailable. Checkout stays disabled until they can be shown." }),
2086
- O ? /* @__PURE__ */ p(d, { children: [
2087
- /* @__PURE__ */ f("strong", { children: he({
2302
+ }) : /* @__PURE__ */ c("p", { children: "Project usage limits are unavailable. Checkout stays disabled until they can be shown." }),
2303
+ O ? /* @__PURE__ */ l(s, { children: [
2304
+ /* @__PURE__ */ c("strong", { children: _e({
2088
2305
  priceMinorUnits: O.priceMinorUnits,
2089
2306
  currency: O.currency
2090
- }, l) }),
2091
- /* @__PURE__ */ p("p", { children: [
2307
+ }, m) }),
2308
+ /* @__PURE__ */ l("p", { children: [
2092
2309
  "Quote valid until ",
2093
- new Date(O.expiresAtUtc).toLocaleString(l),
2310
+ new Date(O.expiresAtUtc).toLocaleString(m),
2094
2311
  "."
2095
2312
  ] }),
2096
- /* @__PURE__ */ f("button", {
2313
+ /* @__PURE__ */ c("button", {
2097
2314
  className: "ink full",
2098
- disabled: S || !Tt || !q,
2099
- onClick: zt,
2100
- children: _(l, "Continue to Stripe")
2315
+ disabled: C || !Ut || !q,
2316
+ onClick: sn,
2317
+ children: v(m, "Continue to Stripe")
2101
2318
  }),
2102
- /* @__PURE__ */ f("button", {
2319
+ /* @__PURE__ */ c("button", {
2103
2320
  className: "textbtn",
2104
- disabled: S,
2105
- onClick: Rt,
2106
- children: _(l, "Refresh project quote")
2321
+ disabled: C,
2322
+ onClick: on,
2323
+ children: v(m, "Refresh project quote")
2107
2324
  })
2108
- ] }) : /* @__PURE__ */ f("button", {
2325
+ ] }) : /* @__PURE__ */ c("button", {
2109
2326
  className: "outline full",
2110
- disabled: S || !Tt,
2111
- onClick: Rt,
2112
- children: _(l, "View project price")
2327
+ disabled: C || !Ut,
2328
+ onClick: on,
2329
+ children: v(m, "View project price")
2113
2330
  }),
2114
- !Tt && /* @__PURE__ */ f("small", { children: _(l, "Purchases are not enabled in this environment.") }),
2115
- /* @__PURE__ */ f("small", { children: "A checkout return is not proof of payment; downloads use the service's verified entitlement." })
2331
+ !Ut && /* @__PURE__ */ c("small", { children: v(m, "Purchases are not enabled in this environment.") }),
2332
+ /* @__PURE__ */ c("small", { children: "A checkout return is not proof of payment; downloads use the service's verified entitlement." })
2116
2333
  ]
2117
2334
  }),
2118
- /* @__PURE__ */ p("section", {
2335
+ /* @__PURE__ */ l("section", {
2119
2336
  className: "drawing-downloads",
2120
2337
  children: [
2121
- /* @__PURE__ */ f("h3", { children: _(l, "2D concept drawings") }),
2122
- /* @__PURE__ */ f("button", {
2338
+ /* @__PURE__ */ c("h3", { children: v(m, "2D concept drawings") }),
2339
+ /* @__PURE__ */ c("button", {
2123
2340
  className: "outline full",
2124
- disabled: S || !!R,
2125
- onClick: Vt,
2126
- children: _(l, "Prepare PDF / editable DXF / SVG")
2341
+ disabled: C || !!L,
2342
+ onClick: ln,
2343
+ children: v(m, "Prepare PDF / editable DXF / SVG")
2127
2344
  }),
2128
- se && Object.keys(se.files).map((e) => /* @__PURE__ */ p("button", {
2345
+ k && Object.keys(k.files).map((e) => /* @__PURE__ */ l("button", {
2129
2346
  className: "quiet",
2130
- onClick: () => Ut(e, se),
2347
+ onClick: () => dn(e, k),
2131
2348
  children: [e.toUpperCase(), " ↓"]
2132
2349
  }, e)),
2133
- /* @__PURE__ */ f("small", { children: "Separate from the BIM model export. PDF is included when the service has PDF rendering configured." })
2350
+ /* @__PURE__ */ c("small", { children: "Separate from the BIM model export. PDF is included when the service has PDF rendering configured." })
2134
2351
  ]
2135
2352
  }),
2136
- /* @__PURE__ */ p("div", {
2353
+ /* @__PURE__ */ l("div", {
2137
2354
  className: "tradeoffs",
2138
- children: [/* @__PURE__ */ f("h3", { children: U.tradeoffs }), K.tradeOffs.map((e, t) => /* @__PURE__ */ f("p", { children: e }, t))]
2355
+ children: [/* @__PURE__ */ c("h3", { children: U.tradeoffs }), K.tradeOffs.map((e, t) => /* @__PURE__ */ c("p", { children: e }, t))]
2139
2356
  }),
2140
- g === "download" ? /* @__PURE__ */ p(d, { children: [
2141
- /* @__PURE__ */ f("h3", { children: U.download }),
2142
- A ? Object.keys(A.files).map((e) => /* @__PURE__ */ p("button", {
2357
+ ne === "download" ? /* @__PURE__ */ l(s, { children: [
2358
+ /* @__PURE__ */ c("h3", { children: U.download }),
2359
+ de ? Object.keys(de.files).map((e) => /* @__PURE__ */ l("button", {
2143
2360
  className: "outline full",
2144
- onClick: () => Ut(e),
2361
+ onClick: () => dn(e),
2145
2362
  children: [e.toUpperCase(), " ↓"]
2146
- }, e)) : /* @__PURE__ */ p("button", {
2363
+ }, e)) : /* @__PURE__ */ l("button", {
2147
2364
  className: "ink full",
2148
- disabled: S || !!R || K.hasRequiredConflicts,
2149
- onClick: Ht,
2150
- children: [U.export, /* @__PURE__ */ f(we, {})]
2365
+ disabled: C || !!L || K.hasRequiredConflicts,
2366
+ onClick: un,
2367
+ children: [U.export, /* @__PURE__ */ c(ke, {})]
2151
2368
  }),
2152
- /* @__PURE__ */ f("small", { children: A?.viewerVerification ?? U.downloadNote })
2153
- ] }) : /* @__PURE__ */ p("div", {
2369
+ /* @__PURE__ */ c("small", { children: de?.viewerVerification ?? U.downloadNote })
2370
+ ] }) : /* @__PURE__ */ l("div", {
2154
2371
  className: "chat",
2155
2372
  children: [
2156
- /* @__PURE__ */ f("h3", { children: U.chat }),
2157
- /* @__PURE__ */ f("textarea", {
2373
+ /* @__PURE__ */ c("h3", { children: U.chat }),
2374
+ /* @__PURE__ */ c("textarea", {
2158
2375
  "aria-label": U.chat,
2159
2376
  placeholder: U.hint,
2160
- value: T,
2377
+ value: E,
2161
2378
  maxLength: 8e3,
2162
- onChange: (e) => E(e.target.value)
2379
+ onChange: (e) => se(e.target.value)
2163
2380
  }),
2164
- /* @__PURE__ */ p("button", {
2381
+ /* @__PURE__ */ l("button", {
2165
2382
  className: "outline full",
2166
- disabled: S || !T.trim(),
2167
- onClick: Ft,
2383
+ disabled: C || !E.trim(),
2384
+ onClick: $t,
2168
2385
  children: [U.send, " →"]
2169
2386
  })
2170
2387
  ]
@@ -2172,338 +2389,381 @@ function De({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: s,
2172
2389
  ]
2173
2390
  })]
2174
2391
  }),
2175
- /* @__PURE__ */ p("div", {
2392
+ /* @__PURE__ */ l("div", {
2176
2393
  className: "detail-grid",
2177
- children: [/* @__PURE__ */ p("article", {
2394
+ children: [/* @__PURE__ */ l("article", {
2178
2395
  className: "paper schedule",
2179
- children: [/* @__PURE__ */ f("h3", { children: U.schedule }), /* @__PURE__ */ p("table", { children: [
2180
- /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
2181
- /* @__PURE__ */ f("th", { children: _(l, "Room") }),
2182
- /* @__PURE__ */ f("th", { children: "W × D" }),
2183
- /* @__PURE__ */ f("th", { children: _(l, "Axis m²") }),
2184
- /* @__PURE__ */ f("th", { children: _(l, "Net m²") })
2396
+ children: [/* @__PURE__ */ c("h3", { children: U.schedule }), /* @__PURE__ */ l("table", { children: [
2397
+ /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [
2398
+ /* @__PURE__ */ c("th", { children: v(m, "Room") }),
2399
+ /* @__PURE__ */ c("th", { children: "W × D" }),
2400
+ /* @__PURE__ */ c("th", { children: v(m, "Axis m²") }),
2401
+ /* @__PURE__ */ c("th", { children: v(m, "Net m²") })
2185
2402
  ] }) }),
2186
- /* @__PURE__ */ f("tbody", { children: K.schedule.map((e) => /* @__PURE__ */ p("tr", { children: [
2187
- /* @__PURE__ */ f("td", { children: e.name }),
2188
- /* @__PURE__ */ p("td", { children: [
2403
+ /* @__PURE__ */ c("tbody", { children: K.schedule.map((e) => /* @__PURE__ */ l("tr", { children: [
2404
+ /* @__PURE__ */ c("td", { children: e.name }),
2405
+ /* @__PURE__ */ l("td", { children: [
2189
2406
  e.widthM.toFixed(2),
2190
2407
  " × ",
2191
2408
  e.depthM.toFixed(2),
2192
- /* @__PURE__ */ f(I, {
2193
- language: l,
2409
+ /* @__PURE__ */ c(F, {
2410
+ language: m,
2194
2411
  report: $,
2195
2412
  path: `${e.roomId}.widthM`
2196
2413
  }),
2197
- /* @__PURE__ */ f(I, {
2198
- language: l,
2414
+ /* @__PURE__ */ c(F, {
2415
+ language: m,
2199
2416
  report: $,
2200
2417
  path: `${e.roomId}.depthM`
2201
2418
  })
2202
2419
  ] }),
2203
- /* @__PURE__ */ p("td", { children: [e.centerlineAreaM2.toFixed(2), /* @__PURE__ */ f(I, {
2204
- language: l,
2420
+ /* @__PURE__ */ l("td", { children: [e.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2421
+ language: m,
2205
2422
  report: $,
2206
2423
  path: `${e.roomId}.centerlineAreaM2`
2207
2424
  })] }),
2208
- /* @__PURE__ */ p("td", { children: [e.netAreaM2.toFixed(2), /* @__PURE__ */ f(I, {
2209
- language: l,
2425
+ /* @__PURE__ */ l("td", { children: [e.netAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2426
+ language: m,
2210
2427
  report: $,
2211
2428
  path: `${e.roomId}.netAreaM2`
2212
2429
  })] })
2213
2430
  ] }, e.roomId)) }),
2214
- /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ p("tr", { children: [
2215
- /* @__PURE__ */ f("th", { children: _(l, "Total") }),
2216
- /* @__PURE__ */ f("td", {}),
2217
- /* @__PURE__ */ p("th", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ f(I, {
2218
- language: l,
2431
+ /* @__PURE__ */ c("tfoot", { children: /* @__PURE__ */ l("tr", { children: [
2432
+ /* @__PURE__ */ c("th", { children: v(m, "Total") }),
2433
+ /* @__PURE__ */ c("td", {}),
2434
+ /* @__PURE__ */ l("th", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2435
+ language: m,
2219
2436
  report: $,
2220
2437
  path: "centerlineAreaM2"
2221
2438
  })] }),
2222
- /* @__PURE__ */ p("th", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ f(I, {
2223
- language: l,
2439
+ /* @__PURE__ */ l("th", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2440
+ language: m,
2224
2441
  report: $,
2225
2442
  path: "netAreaM2"
2226
2443
  })] })
2227
2444
  ] }) })
2228
2445
  ] })]
2229
- }), /* @__PURE__ */ p("article", {
2446
+ }), /* @__PURE__ */ l("article", {
2230
2447
  className: "paper check-summary",
2231
2448
  children: [
2232
- /* @__PURE__ */ f("h3", { children: U.checks }),
2233
- /* @__PURE__ */ f("div", {
2449
+ /* @__PURE__ */ c("h3", { children: U.checks }),
2450
+ /* @__PURE__ */ c("div", {
2234
2451
  className: "check-counts",
2235
- children: Object.entries($t).map(([e, t]) => /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ f("strong", { children: t }), e] }, e))
2452
+ children: Object.entries(xn).map(([e, t]) => /* @__PURE__ */ l("span", { children: [/* @__PURE__ */ c("strong", { children: t }), e] }, e))
2236
2453
  }),
2237
- /* @__PURE__ */ p("button", {
2454
+ /* @__PURE__ */ l("button", {
2238
2455
  className: "textbtn",
2239
- onClick: () => je(!De),
2456
+ onClick: () => Ie(!Me),
2240
2457
  children: [
2241
- De ? _(l, "Hide") : U.notes,
2458
+ Me ? v(m, "Hide") : U.notes,
2242
2459
  " ",
2243
- De ? "−" : "+"
2460
+ Me ? "−" : "+"
2244
2461
  ]
2245
2462
  }),
2246
- /* @__PURE__ */ f("p", { children: "Reference-only entries are disclosed, never presented as passed checks. Country statutory certification is not inferred." })
2463
+ /* @__PURE__ */ c("p", { children: "Reference-only entries are disclosed, never presented as passed checks. Country statutory certification is not inferred." })
2247
2464
  ]
2248
2465
  })]
2249
2466
  }),
2250
- De && /* @__PURE__ */ f("article", {
2467
+ Me && /* @__PURE__ */ c("article", {
2251
2468
  className: "paper findings",
2252
- children: K.findings.map((e, t) => /* @__PURE__ */ p("details", { children: [
2253
- /* @__PURE__ */ p("summary", { children: [
2254
- /* @__PURE__ */ f("span", {
2469
+ children: K.findings.map((e, t) => /* @__PURE__ */ l("details", { children: [
2470
+ /* @__PURE__ */ l("summary", { children: [
2471
+ /* @__PURE__ */ c("span", {
2255
2472
  className: "status " + e.status,
2256
2473
  children: e.status
2257
2474
  }),
2258
- /* @__PURE__ */ f("code", { children: e.ruleId }),
2259
- /* @__PURE__ */ f("span", { children: e.subjectId })
2475
+ /* @__PURE__ */ c("code", { children: e.ruleId }),
2476
+ /* @__PURE__ */ c("span", { children: e.subjectId })
2260
2477
  ] }),
2261
- /* @__PURE__ */ f("p", { children: e.measurement }),
2262
- e.fix && /* @__PURE__ */ f("p", { children: e.fix }),
2263
- /* @__PURE__ */ f("small", { children: e.source })
2478
+ /* @__PURE__ */ c("p", { children: e.measurement }),
2479
+ e.fix && /* @__PURE__ */ c("p", { children: e.fix }),
2480
+ /* @__PURE__ */ c("small", { children: e.source })
2264
2481
  ] }, t))
2265
2482
  }),
2266
- /* @__PURE__ */ f("p", {
2483
+ /* @__PURE__ */ c("p", {
2267
2484
  className: "disclaimer",
2268
2485
  children: U.disclaimer
2269
2486
  })
2270
- ] }) : null,
2271
- (G || Qe) && /* @__PURE__ */ f(Oe, {
2487
+ ] }) : G ? /* @__PURE__ */ l("section", {
2488
+ className: "paper findings",
2489
+ role: "status",
2490
+ children: [
2491
+ /* @__PURE__ */ c("h2", { children: v(m, "No layout proposal is available") }),
2492
+ /* @__PURE__ */ c("p", { children: v(m, "Your measurements are retained. Review the engine findings and measurements before trying again.") }),
2493
+ /* @__PURE__ */ l("p", { children: [
2494
+ v(m, "Status"),
2495
+ ": ",
2496
+ G.reconciliation.status
2497
+ ] }),
2498
+ G.reconciliation.findings.map((e, t) => /* @__PURE__ */ c("p", { children: e.message }, t)),
2499
+ /* @__PURE__ */ c("button", {
2500
+ className: "outline",
2501
+ disabled: C,
2502
+ onClick: () => y("measure"),
2503
+ children: v(m, "Review measurements")
2504
+ }),
2505
+ /* @__PURE__ */ c("p", {
2506
+ className: "disclaimer",
2507
+ children: U.disclaimer
2508
+ })
2509
+ ]
2510
+ }) : null,
2511
+ b && /* @__PURE__ */ c(ee, {
2512
+ language: m,
2513
+ version: b.version,
2514
+ busy: C,
2515
+ preview: !!L,
2516
+ open: ct,
2517
+ versions: it,
2518
+ comparison: ot,
2519
+ left: ut,
2520
+ right: ft,
2521
+ onToggle: nn,
2522
+ onLeftChange: (e) => {
2523
+ dt(e), st(null);
2524
+ },
2525
+ onRightChange: (e) => {
2526
+ pt(e), st(null);
2527
+ },
2528
+ onCompare: rn,
2529
+ onRestore: an
2530
+ }),
2531
+ (G || nt) && /* @__PURE__ */ c(Ne, {
2272
2532
  report: $,
2273
- language: l
2533
+ language: m
2274
2534
  })
2275
2535
  ]
2276
2536
  }),
2277
- /* @__PURE__ */ f("input", {
2537
+ /* @__PURE__ */ c("input", {
2278
2538
  hidden: !0,
2279
2539
  type: "file",
2280
- ref: _t,
2540
+ ref: Nt,
2281
2541
  accept: "image/png,image/jpeg,image/webp",
2282
2542
  onChange: (e) => {
2283
2543
  let t = e.target.files?.[0];
2284
- t && Wt(t), e.target.value = "";
2544
+ t && fn(t), e.target.value = "";
2285
2545
  }
2286
2546
  })
2287
2547
  ]
2288
2548
  }),
2289
- S && /* @__PURE__ */ p("div", {
2549
+ C && /* @__PURE__ */ l("div", {
2290
2550
  className: "working",
2291
2551
  role: "status",
2292
- children: [/* @__PURE__ */ f("span", { className: "spinner" }), U.generating]
2552
+ children: [/* @__PURE__ */ c("span", { className: "spinner" }), U.generating]
2293
2553
  }),
2294
- ee === "studio" && y && lt.length > 0 && /* @__PURE__ */ f("section", {
2554
+ _ === "studio" && b && Tt.length > 0 && /* @__PURE__ */ c("section", {
2295
2555
  className: "paper saved-files",
2296
- children: /* @__PURE__ */ p("details", { children: [/* @__PURE__ */ f("summary", { children: _(l, "Saved project files · download without a new export") }), lt.map((e) => /* @__PURE__ */ p("article", { children: [
2297
- /* @__PURE__ */ p("strong", { children: [
2556
+ children: /* @__PURE__ */ l("details", { children: [/* @__PURE__ */ c("summary", { children: v(m, "Saved project files · download without a new export") }), Tt.map((e) => /* @__PURE__ */ l("article", { children: [
2557
+ /* @__PURE__ */ l("strong", { children: [
2298
2558
  e.kind,
2299
2559
  e.version ? " · v" + e.version : "",
2300
2560
  e.proposalId ? " · " + e.proposalId : ""
2301
2561
  ] }),
2302
- e.files.map((t) => /* @__PURE__ */ p("button", {
2562
+ e.files.map((t) => /* @__PURE__ */ l("button", {
2303
2563
  className: "quiet",
2304
- disabled: S,
2305
- onClick: () => Qt(e, t),
2564
+ disabled: C,
2565
+ onClick: () => bn(e, t),
2306
2566
  children: [t.format.toUpperCase(), " ↓"]
2307
2567
  }, t.objectId)),
2308
2568
  e.kind === "upload" && e.files.find((e) => [
2309
2569
  "png",
2310
2570
  "jpeg",
2311
2571
  "webp"
2312
- ].includes(e.format)) && /* @__PURE__ */ f("button", {
2572
+ ].includes(e.format)) && /* @__PURE__ */ c("button", {
2313
2573
  className: "outline",
2314
- disabled: S,
2315
- onClick: () => Zt(e.files.find((e) => [
2574
+ disabled: C,
2575
+ onClick: () => yn(e.files.find((e) => [
2316
2576
  "png",
2317
2577
  "jpeg",
2318
2578
  "webp"
2319
2579
  ].includes(e.format)).objectId),
2320
- children: _(l, "Use saved sketch")
2580
+ children: v(m, "Use saved sketch")
2321
2581
  })
2322
2582
  ] }, e.artifactId))] })
2323
2583
  }),
2324
- !e && P.analyticsEnabled === !0 && /* @__PURE__ */ p("aside", {
2584
+ !e && N.analyticsEnabled === !0 && /* @__PURE__ */ l("aside", {
2325
2585
  className: "analytics-choice",
2326
- children: [/* @__PURE__ */ p("label", { children: [/* @__PURE__ */ f("input", {
2586
+ children: [/* @__PURE__ */ l("label", { children: [/* @__PURE__ */ c("input", {
2327
2587
  type: "checkbox",
2328
- checked: dt,
2329
- onChange: (e) => kt(e.target.checked)
2330
- }), " Allow optional visit and paywall analytics"] }), /* @__PURE__ */ f("small", { children: "We send event type only, without drawings, dimensions, prompts, URLs or account IDs. Uncheck to withdraw consent and request deletion of this browser's client observations." })]
2588
+ checked: Dt,
2589
+ onChange: (e) => Jt(e.target.checked)
2590
+ }), " Allow optional visit and paywall analytics"] }), /* @__PURE__ */ c("small", { children: "We send event type only, without drawings, dimensions, prompts, URLs or account IDs. Uncheck to withdraw consent and request deletion of this browser's client observations." })]
2331
2591
  }),
2332
- !e && M && et && /* @__PURE__ */ f("div", {
2592
+ !e && j && gt && /* @__PURE__ */ c("div", {
2333
2593
  className: "modal-backdrop",
2334
- children: /* @__PURE__ */ p("section", {
2594
+ children: /* @__PURE__ */ l("section", {
2335
2595
  className: "modal paper",
2336
2596
  role: "alertdialog",
2337
2597
  "aria-modal": "true",
2338
2598
  "aria-labelledby": "content-deletion-title",
2339
2599
  children: [
2340
- /* @__PURE__ */ f("h2", {
2600
+ /* @__PURE__ */ c("h2", {
2341
2601
  id: "content-deletion-title",
2342
- children: _(l, "Delete all project content?")
2602
+ children: v(m, "Delete all project content?")
2343
2603
  }),
2344
- /* @__PURE__ */ f("p", { children: _(l, "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.") }),
2345
- /* @__PURE__ */ f("button", {
2604
+ /* @__PURE__ */ c("p", { children: v(m, "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.") }),
2605
+ /* @__PURE__ */ c("button", {
2346
2606
  className: "outline full danger",
2347
- disabled: S,
2348
- onClick: Jt,
2349
- children: _(l, "Delete my project content")
2607
+ disabled: C,
2608
+ onClick: gn,
2609
+ children: v(m, "Delete my project content")
2350
2610
  }),
2351
- /* @__PURE__ */ f("button", {
2611
+ /* @__PURE__ */ c("button", {
2352
2612
  className: "quiet full",
2353
- disabled: S,
2354
- onClick: () => tt(!1),
2355
- children: _(l, "Cancel")
2613
+ disabled: C,
2614
+ onClick: () => _t(!1),
2615
+ children: v(m, "Cancel")
2356
2616
  })
2357
2617
  ]
2358
2618
  })
2359
2619
  }),
2360
- !e && ue && /* @__PURE__ */ f("div", {
2620
+ !e && me && /* @__PURE__ */ c("div", {
2361
2621
  className: "modal-backdrop",
2362
- children: /* @__PURE__ */ p("form", {
2622
+ children: /* @__PURE__ */ l("form", {
2363
2623
  className: "modal paper",
2364
2624
  onSubmit: (e) => {
2365
- e.preventDefault(), Yt();
2625
+ e.preventDefault(), _n();
2366
2626
  },
2367
2627
  children: [
2368
- /* @__PURE__ */ f("button", {
2628
+ /* @__PURE__ */ c("button", {
2369
2629
  type: "button",
2370
2630
  className: "close",
2371
2631
  "aria-label": U.close,
2372
- onClick: () => de(!1),
2632
+ onClick: () => he(!1),
2373
2633
  children: "×"
2374
2634
  }),
2375
- /* @__PURE__ */ f(Ce, {}),
2376
- /* @__PURE__ */ f("h2", { children: L === "signup" ? _(l, "Create a verified account") : L === "verify" ? _(l, "Verify your email") : U.signin }),
2377
- C && /* @__PURE__ */ f("p", {
2635
+ /* @__PURE__ */ c(Oe, {}),
2636
+ /* @__PURE__ */ c("h2", { children: I === "signup" ? v(m, "Create a verified account") : I === "verify" ? v(m, "Verify your email") : U.signin }),
2637
+ w && /* @__PURE__ */ c("p", {
2378
2638
  role: "alert",
2379
- children: c === "karamentreprises" ? C.replace(/Polycyphers/gi, "Karamentreprises") : C
2639
+ children: p === "karamentreprises" ? w.replace(/Polycyphers/gi, "Karamentreprises") : w
2380
2640
  }),
2381
- ae && /* @__PURE__ */ f("p", {
2641
+ ce && /* @__PURE__ */ c("p", {
2382
2642
  role: "status",
2383
- children: ae
2643
+ children: ce
2384
2644
  }),
2385
- L !== "verify" && /* @__PURE__ */ p("label", {
2645
+ I !== "verify" && /* @__PURE__ */ l("label", {
2386
2646
  className: "field",
2387
- children: [U.email, /* @__PURE__ */ f("input", {
2647
+ children: [U.email, /* @__PURE__ */ c("input", {
2388
2648
  type: "email",
2389
2649
  autoComplete: "email",
2390
2650
  required: !0,
2391
- value: fe,
2392
- onChange: (e) => pe(e.target.value)
2651
+ value: ge,
2652
+ onChange: (e) => ye(e.target.value)
2393
2653
  })]
2394
2654
  }),
2395
- L === "verify" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("p", { children: "Open the verification link sent to your email, or paste its token below. Verification happens only when you submit this form." }), /* @__PURE__ */ p("label", {
2655
+ I === "verify" && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("p", { children: "Open the verification link sent to your email, or paste its token below. Verification happens only when you submit this form." }), /* @__PURE__ */ l("label", {
2396
2656
  className: "field",
2397
- children: [_(l, "Verification token"), /* @__PURE__ */ f("input", {
2657
+ children: [v(m, "Verification token"), /* @__PURE__ */ c("input", {
2398
2658
  autoComplete: "off",
2399
2659
  required: !0,
2400
- value: Ne,
2401
- onChange: (e) => Pe(e.target.value)
2660
+ value: Re,
2661
+ onChange: (e) => ze(e.target.value)
2402
2662
  })]
2403
2663
  })] }),
2404
- L !== "signup" && /* @__PURE__ */ p("label", {
2664
+ I !== "signup" && /* @__PURE__ */ l("label", {
2405
2665
  className: "field",
2406
- children: [U.password, /* @__PURE__ */ f("input", {
2666
+ children: [U.password, /* @__PURE__ */ c("input", {
2407
2667
  type: "password",
2408
- autoComplete: L === "verify" ? "new-password" : "current-password",
2409
- minLength: L === "verify" ? 10 : void 0,
2668
+ autoComplete: I === "verify" ? "new-password" : "current-password",
2669
+ minLength: I === "verify" ? 10 : void 0,
2410
2670
  required: !0,
2411
- value: me,
2412
- onChange: (e) => N(e.target.value)
2671
+ value: M,
2672
+ onChange: (e) => Ee(e.target.value)
2413
2673
  })]
2414
2674
  }),
2415
- /* @__PURE__ */ f("button", {
2675
+ /* @__PURE__ */ c("button", {
2416
2676
  className: "ink full",
2417
- disabled: S,
2418
- children: L === "signup" ? _(l, "Send verification email") : L === "verify" ? _(l, "Verify & set password") : U.signin
2677
+ disabled: C,
2678
+ children: I === "signup" ? v(m, "Send verification email") : I === "verify" ? v(m, "Verify & set password") : U.signin
2419
2679
  }),
2420
- /* @__PURE__ */ p("div", {
2680
+ /* @__PURE__ */ l("div", {
2421
2681
  className: "account-modes",
2422
2682
  children: [
2423
- /* @__PURE__ */ f("button", {
2683
+ /* @__PURE__ */ c("button", {
2424
2684
  type: "button",
2425
2685
  className: "textbtn",
2426
- onClick: () => Me("login"),
2427
- children: _(l, "Sign in")
2686
+ onClick: () => Le("login"),
2687
+ children: v(m, "Sign in")
2428
2688
  }),
2429
- /* @__PURE__ */ f("button", {
2689
+ /* @__PURE__ */ c("button", {
2430
2690
  type: "button",
2431
2691
  className: "textbtn",
2432
- onClick: () => Me("signup"),
2433
- children: _(l, "Create account")
2692
+ onClick: () => Le("signup"),
2693
+ children: v(m, "Create account")
2434
2694
  }),
2435
- /* @__PURE__ */ f("button", {
2695
+ /* @__PURE__ */ c("button", {
2436
2696
  type: "button",
2437
2697
  className: "textbtn",
2438
- onClick: () => Me("verify"),
2439
- children: _(l, "Verify email")
2698
+ onClick: () => Le("verify"),
2699
+ children: v(m, "Verify email")
2440
2700
  })
2441
2701
  ]
2442
2702
  }),
2443
- typeof P.verificationCompletionUrl == "string" && /* @__PURE__ */ p("p", { children: ["Verification destination: ", P.verificationCompletionUrl] })
2703
+ typeof N.verificationCompletionUrl == "string" && /* @__PURE__ */ l("p", { children: ["Verification destination: ", N.verificationCompletionUrl] })
2444
2704
  ]
2445
2705
  })
2446
2706
  })
2447
2707
  ]
2448
2708
  });
2449
2709
  }
2450
- function I({ report: e, path: t, language: n = "en" }) {
2451
- let r = e?.values.find((e) => e.path === t || e.path.endsWith("." + t));
2452
- return /* @__PURE__ */ p("small", {
2710
+ function F({ report: e, path: t, language: n = "en" }) {
2711
+ let r = e?.values.find((e) => e.path === t) ?? e?.values.find((e) => e.path.endsWith("." + t));
2712
+ return /* @__PURE__ */ l("small", {
2453
2713
  className: "value-tag " + (r?.origin ?? "missing"),
2454
2714
  title: r?.source ?? "No provenance supplied for this displayed value.",
2455
2715
  children: [
2456
- _(n, r?.origin ?? "unlabelled"),
2716
+ v(n, r?.origin ?? "unlabelled"),
2457
2717
  " · ",
2458
- _(n, r?.origin !== "estimated" && r?.confirmed === !0 ? "reviewed evidence" : "unconfirmed")
2718
+ v(n, r?.origin !== "estimated" && r?.confirmed === !0 ? "reviewed evidence" : "unconfirmed")
2459
2719
  ]
2460
2720
  });
2461
2721
  }
2462
- function Oe({ report: e, language: t }) {
2722
+ function Ne({ report: e, language: t }) {
2463
2723
  let n = t;
2464
- return /* @__PURE__ */ p("section", {
2724
+ return /* @__PURE__ */ l("section", {
2465
2725
  className: "paper provenance",
2466
2726
  children: [
2467
- /* @__PURE__ */ f("h3", { children: _(t, "Value provenance & discrepancies") }),
2468
- /* @__PURE__ */ f("p", { children: e?.notice ?? "No provenance report was supplied. Values are unconfirmed; do not treat them as measured or verified." }),
2469
- /* @__PURE__ */ f("h4", { children: _(t, "Discrepancy report") }),
2470
- e ? e.discrepancies.length ? e.discrepancies.map((e) => /* @__PURE__ */ p("article", { children: [
2471
- /* @__PURE__ */ p("strong", { children: [
2727
+ /* @__PURE__ */ c("h3", { children: v(t, "Value provenance & discrepancies") }),
2728
+ /* @__PURE__ */ c("p", { children: e?.notice ?? "No provenance report was supplied. Values are unconfirmed; do not treat them as measured or verified." }),
2729
+ /* @__PURE__ */ c("h4", { children: v(t, "Discrepancy report") }),
2730
+ e ? e.discrepancies.length ? e.discrepancies.map((e) => /* @__PURE__ */ l("article", { children: [
2731
+ /* @__PURE__ */ l("strong", { children: [
2472
2732
  e.kind,
2473
2733
  " · ",
2474
2734
  e.subject
2475
2735
  ] }),
2476
- /* @__PURE__ */ f("p", { children: e.message }),
2477
- e.appliedFix && /* @__PURE__ */ p("p", { children: ["Applied fix: ", e.appliedFix] }),
2478
- e.question && /* @__PURE__ */ p("p", { children: ["Measurement needed: ", e.question] }),
2479
- e.ruleId && /* @__PURE__ */ f("code", { children: e.ruleId })
2480
- ] }, e.id)) : /* @__PURE__ */ f("p", { children: _(n, "No discrepancies reported by the engine.") }) : /* @__PURE__ */ f("p", { children: _(n, "Discrepancy report unavailable.") }),
2481
- /* @__PURE__ */ p("details", { children: [/* @__PURE__ */ f("summary", { children: _(n, "Every supplied value and its source") }), /* @__PURE__ */ p("table", { children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
2482
- /* @__PURE__ */ f("th", { children: _(n, "Value") }),
2483
- /* @__PURE__ */ f("th", { children: _(n, "Origin / evidence") }),
2484
- /* @__PURE__ */ f("th", { children: _(n, "Source") })
2485
- ] }) }), /* @__PURE__ */ f("tbody", { children: e?.values.map((t) => /* @__PURE__ */ p("tr", { children: [
2486
- /* @__PURE__ */ p("td", { children: [
2487
- /* @__PURE__ */ f("code", { children: t.path }),
2488
- /* @__PURE__ */ f("br", {}),
2736
+ /* @__PURE__ */ c("p", { children: e.message }),
2737
+ e.appliedFix && /* @__PURE__ */ l("p", { children: ["Applied fix: ", e.appliedFix] }),
2738
+ e.question && /* @__PURE__ */ l("p", { children: ["Measurement needed: ", e.question] }),
2739
+ e.ruleId && /* @__PURE__ */ c("code", { children: e.ruleId })
2740
+ ] }, e.id)) : /* @__PURE__ */ c("p", { children: v(n, "No discrepancies reported by the engine.") }) : /* @__PURE__ */ c("p", { children: v(n, "Discrepancy report unavailable.") }),
2741
+ /* @__PURE__ */ l("details", { children: [/* @__PURE__ */ c("summary", { children: v(n, "Every supplied value and its source") }), /* @__PURE__ */ l("table", { children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [
2742
+ /* @__PURE__ */ c("th", { children: v(n, "Value") }),
2743
+ /* @__PURE__ */ c("th", { children: v(n, "Origin / evidence") }),
2744
+ /* @__PURE__ */ c("th", { children: v(n, "Source") })
2745
+ ] }) }), /* @__PURE__ */ c("tbody", { children: e?.values.map((t) => /* @__PURE__ */ l("tr", { children: [
2746
+ /* @__PURE__ */ l("td", { children: [
2747
+ /* @__PURE__ */ c("code", { children: t.path }),
2748
+ /* @__PURE__ */ c("br", {}),
2489
2749
  t.value,
2490
2750
  " ",
2491
2751
  t.unit
2492
2752
  ] }),
2493
- /* @__PURE__ */ f("td", { children: /* @__PURE__ */ f(I, {
2753
+ /* @__PURE__ */ c("td", { children: /* @__PURE__ */ c(F, {
2494
2754
  language: n,
2495
2755
  report: e,
2496
2756
  path: t.path
2497
2757
  }) }),
2498
- /* @__PURE__ */ p("td", { children: [t.source, t.inputPaths.length > 0 && /* @__PURE__ */ p("small", { children: ["Inputs: ", t.inputPaths.join(", ")] })] })
2758
+ /* @__PURE__ */ l("td", { children: [t.source, t.inputPaths.length > 0 && /* @__PURE__ */ l("small", { children: ["Inputs: ", t.inputPaths.join(", ")] })] })
2499
2759
  ] }, t.path)) })] })] })
2500
2760
  ]
2501
2761
  });
2502
2762
  }
2503
- function ke({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed: i, setConfirmed: a, onGenerate: o, busy: s, onUpload: c, imageUrl: l, geometry: u, language: ee }) {
2504
- let m = ee, h = (e, r) => {
2505
- t(e), n(r);
2506
- }, g = e.programme, v = [
2763
+ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed: i, setConfirmed: a, onGenerate: o, busy: u, onUpload: d, imageUrl: f, geometry: p, language: m }) {
2764
+ let h = m, g = (e, i) => {
2765
+ i && (e = Ee(e, i, r)), t(e), n(i);
2766
+ }, _ = e.programme, ee = [
2507
2767
  ["bedroomWidthM", "Bedroom width"],
2508
2768
  ["bedroomDepthM", "Bedroom depth"],
2509
2769
  ["bathroomWidthM", "Bathroom width"],
@@ -2513,7 +2773,7 @@ function ke({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2513
2773
  ["balconyDepthM", "Balcony depth (0 for none)"],
2514
2774
  ["slidingDoorWidthM", "Balcony sliding door width"]
2515
2775
  ];
2516
- function y(t) {
2776
+ function te(t) {
2517
2777
  let n = e.footprint.edges, r = (t ? [...n, {
2518
2778
  id: "",
2519
2779
  startVertexId: "",
@@ -2528,300 +2788,313 @@ function ke({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2528
2788
  startVertexId: "V" + (t + 1),
2529
2789
  endVertexId: "V" + ((t + 1) % n.length + 1)
2530
2790
  }));
2531
- h({
2791
+ g({
2532
2792
  ...e,
2533
2793
  footprint: { edges: r }
2534
2794
  });
2535
2795
  }
2536
- return /* @__PURE__ */ p("section", {
2796
+ return /* @__PURE__ */ l("section", {
2537
2797
  className: "measure-layout",
2538
- children: [/* @__PURE__ */ p("article", {
2798
+ children: [/* @__PURE__ */ c("article", {
2539
2799
  className: "paper form-card",
2540
- children: [
2541
- /* @__PURE__ */ f("h2", { children: _(m, "Measured footprint") }),
2542
- /* @__PURE__ */ f("p", { children: "Enter walls in boundary order, counterclockwise. Bearings: 0° east, 90° north. Leave unknown angles blank; the solver may request one diagonal. These are your measurements, not generated dimensions." }),
2543
- /* @__PURE__ */ f("div", {
2544
- className: "edge-table",
2545
- children: e.footprint.edges.map((t, n) => /* @__PURE__ */ p("div", {
2546
- className: "edge-row",
2547
- children: [
2548
- /* @__PURE__ */ p("strong", { children: [
2549
- t.id,
2550
- " ",
2551
- /* @__PURE__ */ p("small", { children: [
2552
- t.startVertexId,
2553
- " → ",
2554
- t.endVertexId
2555
- ] })
2556
- ] }),
2557
- /* @__PURE__ */ p("label", { children: [
2558
- _(m, "Length (m)"),
2559
- " ",
2560
- /* @__PURE__ */ p("small", { children: [
2561
- _(m, r.includes(`footprint.edges[${n}].lengthM`) ? "estimated" : "user-given"),
2562
- " · ",
2563
- _(m, "unconfirmed")
2800
+ children: /* @__PURE__ */ l("fieldset", {
2801
+ disabled: u,
2802
+ style: {
2803
+ border: 0,
2804
+ padding: 0,
2805
+ minWidth: 0
2806
+ },
2807
+ children: [
2808
+ /* @__PURE__ */ c("h2", { children: v(h, "Measured footprint") }),
2809
+ /* @__PURE__ */ c("p", { children: "Enter walls in boundary order, counterclockwise. Bearings: 0° east, 90° north. Leave unknown angles blank; the solver may request one diagonal. These are your measurements, not generated dimensions." }),
2810
+ /* @__PURE__ */ c("div", {
2811
+ className: "edge-table",
2812
+ children: e.footprint.edges.map((t, n) => /* @__PURE__ */ l("div", {
2813
+ className: "edge-row",
2814
+ children: [
2815
+ /* @__PURE__ */ l("strong", { children: [
2816
+ t.id,
2817
+ " ",
2818
+ /* @__PURE__ */ l("small", { children: [
2819
+ t.startVertexId,
2820
+ " → ",
2821
+ t.endVertexId
2822
+ ] })
2564
2823
  ] }),
2565
- /* @__PURE__ */ f("input", {
2566
- "aria-label": `${t.id} length`,
2567
- type: "number",
2568
- min: "0",
2569
- step: "any",
2570
- value: Number.isFinite(t.lengthM) ? t.lengthM : "",
2571
- onChange: (t) => h({
2572
- ...e,
2573
- footprint: {
2574
- ...e.footprint,
2575
- edges: e.footprint.edges.map((e, r) => r === n ? {
2576
- ...e,
2577
- lengthM: t.target.value === "" ? NaN : Number(t.target.value)
2578
- } : e)
2579
- }
2580
- }, `footprint.edges[${n}].lengthM`)
2581
- })
2582
- ] }),
2583
- /* @__PURE__ */ p("label", { children: [
2584
- _(m, "Bearing (°)"),
2585
- " ",
2586
- /* @__PURE__ */ p("small", { children: [
2587
- _(m, r.includes(`footprint.edges[${n}].bearingDegrees`) ? "estimated" : "user-given"),
2588
- " · ",
2589
- _(m, "unconfirmed")
2824
+ /* @__PURE__ */ l("label", { children: [
2825
+ v(h, "Length (m)"),
2826
+ " ",
2827
+ /* @__PURE__ */ l("small", { children: [
2828
+ v(h, M(e, `footprint.edges[${n}].lengthM`, r)),
2829
+ " · ",
2830
+ v(h, "unconfirmed")
2831
+ ] }),
2832
+ /* @__PURE__ */ c("input", {
2833
+ "aria-label": `${t.id} length`,
2834
+ type: "number",
2835
+ min: "0",
2836
+ step: "any",
2837
+ value: Number.isFinite(t.lengthM) ? t.lengthM : "",
2838
+ onChange: (t) => g({
2839
+ ...e,
2840
+ footprint: {
2841
+ ...e.footprint,
2842
+ edges: e.footprint.edges.map((e, r) => r === n ? {
2843
+ ...e,
2844
+ lengthM: t.target.value === "" ? NaN : Number(t.target.value)
2845
+ } : e)
2846
+ }
2847
+ }, `footprint.edges[${n}].lengthM`)
2848
+ })
2849
+ ] }),
2850
+ /* @__PURE__ */ l("label", { children: [
2851
+ v(h, "Bearing (°)"),
2852
+ " ",
2853
+ /* @__PURE__ */ l("small", { children: [
2854
+ v(h, M(e, `footprint.edges[${n}].bearingDegrees`, r)),
2855
+ " · ",
2856
+ v(h, "unconfirmed")
2857
+ ] }),
2858
+ /* @__PURE__ */ c("input", {
2859
+ "aria-label": `${t.id} bearing`,
2860
+ type: "number",
2861
+ step: "0.01",
2862
+ placeholder: v(h, "Unknown"),
2863
+ value: t.bearingDegrees ?? "",
2864
+ onChange: (t) => g({
2865
+ ...e,
2866
+ footprint: {
2867
+ ...e.footprint,
2868
+ edges: e.footprint.edges.map((e, r) => r === n ? {
2869
+ ...e,
2870
+ bearingDegrees: t.target.value === "" ? null : Number(t.target.value)
2871
+ } : e)
2872
+ }
2873
+ }, `footprint.edges[${n}].bearingDegrees`)
2874
+ })
2590
2875
  ] }),
2591
- /* @__PURE__ */ f("input", {
2592
- "aria-label": `${t.id} bearing`,
2593
- type: "number",
2594
- step: "0.01",
2595
- placeholder: _(m, "Unknown"),
2596
- value: t.bearingDegrees ?? "",
2597
- onChange: (t) => h({
2876
+ /* @__PURE__ */ l("label", { children: [v(h, "Wall"), /* @__PURE__ */ l("select", {
2877
+ "aria-label": `${t.id} wall type`,
2878
+ value: t.wallType,
2879
+ onChange: (t) => g({
2598
2880
  ...e,
2599
2881
  footprint: {
2600
2882
  ...e.footprint,
2601
2883
  edges: e.footprint.edges.map((e, r) => r === n ? {
2602
2884
  ...e,
2603
- bearingDegrees: t.target.value === "" ? null : Number(t.target.value)
2885
+ wallType: t.target.value
2604
2886
  } : e)
2605
2887
  }
2606
- }, `footprint.edges[${n}].bearingDegrees`)
2607
- })
2608
- ] }),
2609
- /* @__PURE__ */ p("label", { children: [_(m, "Wall"), /* @__PURE__ */ p("select", {
2610
- "aria-label": `${t.id} wall type`,
2611
- value: t.wallType,
2612
- onChange: (t) => h({
2888
+ }),
2889
+ children: [/* @__PURE__ */ c("option", {
2890
+ value: "exterior",
2891
+ children: v(h, "Exterior")
2892
+ }), /* @__PURE__ */ c("option", {
2893
+ value: "party",
2894
+ children: v(h, "Party · no openings")
2895
+ })]
2896
+ })] })
2897
+ ]
2898
+ }, t.id))
2899
+ }),
2900
+ _?.source.startsWith("User-entered") && /* @__PURE__ */ l("div", {
2901
+ className: "actions",
2902
+ children: [/* @__PURE__ */ c("button", {
2903
+ className: "outline",
2904
+ disabled: e.footprint.edges.length >= 64,
2905
+ onClick: () => te(!0),
2906
+ children: v(h, "Add wall")
2907
+ }), /* @__PURE__ */ c("button", {
2908
+ className: "quiet",
2909
+ disabled: e.footprint.edges.length <= 3,
2910
+ onClick: () => te(!1),
2911
+ children: v(h, "Remove last wall")
2912
+ })]
2913
+ }),
2914
+ p?.suggestedDiagonal && /* @__PURE__ */ l("label", {
2915
+ className: "field",
2916
+ children: [
2917
+ "Diagonal ",
2918
+ p.suggestedDiagonal.startVertexId,
2919
+ " → ",
2920
+ p.suggestedDiagonal.endVertexId,
2921
+ " (m)",
2922
+ /* @__PURE__ */ c("small", { children: p.suggestedDiagonal.reason }),
2923
+ /* @__PURE__ */ c("input", {
2924
+ type: "number",
2925
+ min: "0",
2926
+ step: "any",
2927
+ value: e.footprint.diagonals?.[0]?.lengthM ?? "",
2928
+ onChange: (t) => g({
2613
2929
  ...e,
2614
2930
  footprint: {
2615
2931
  ...e.footprint,
2616
- edges: e.footprint.edges.map((e, r) => r === n ? {
2617
- ...e,
2618
- wallType: t.target.value
2619
- } : e)
2932
+ diagonals: t.target.value ? [{
2933
+ startVertexId: p.suggestedDiagonal.startVertexId,
2934
+ endVertexId: p.suggestedDiagonal.endVertexId,
2935
+ lengthM: Number(t.target.value)
2936
+ }] : []
2620
2937
  }
2621
- }),
2622
- children: [/* @__PURE__ */ f("option", {
2623
- value: "exterior",
2624
- children: _(m, "Exterior")
2625
- }), /* @__PURE__ */ f("option", {
2626
- value: "party",
2627
- children: _(m, "Party · no openings")
2628
- })]
2629
- })] })
2630
- ]
2631
- }, t.id))
2632
- }),
2633
- g?.source.startsWith("User-entered") && /* @__PURE__ */ p("div", {
2634
- className: "actions",
2635
- children: [/* @__PURE__ */ f("button", {
2636
- className: "outline",
2637
- disabled: e.footprint.edges.length >= 64,
2638
- onClick: () => y(!0),
2639
- children: _(m, "Add wall")
2640
- }), /* @__PURE__ */ f("button", {
2641
- className: "quiet",
2642
- disabled: e.footprint.edges.length <= 3,
2643
- onClick: () => y(!1),
2644
- children: _(m, "Remove last wall")
2645
- })]
2646
- }),
2647
- u?.suggestedDiagonal && /* @__PURE__ */ p("label", {
2648
- className: "field",
2649
- children: [
2650
- "Diagonal ",
2651
- u.suggestedDiagonal.startVertexId,
2652
- " → ",
2653
- u.suggestedDiagonal.endVertexId,
2654
- " (m)",
2655
- /* @__PURE__ */ f("small", { children: u.suggestedDiagonal.reason }),
2656
- /* @__PURE__ */ f("input", {
2657
- type: "number",
2658
- min: "0",
2659
- step: "any",
2660
- value: e.footprint.diagonals?.[0]?.lengthM ?? "",
2661
- onChange: (t) => h({
2662
- ...e,
2663
- footprint: {
2664
- ...e.footprint,
2665
- diagonals: t.target.value ? [{
2666
- startVertexId: u.suggestedDiagonal.startVertexId,
2667
- endVertexId: u.suggestedDiagonal.endVertexId,
2668
- lengthM: Number(t.target.value)
2669
- }] : []
2670
- }
2938
+ }, "footprint.diagonals")
2671
2939
  })
2672
- })
2673
- ]
2674
- }),
2675
- /* @__PURE__ */ p("details", {
2676
- open: !!g,
2677
- children: [/* @__PURE__ */ f("summary", { children: _(m, "Room programme") }), g ? /* @__PURE__ */ p(d, { children: [
2678
- /* @__PURE__ */ f("p", { children: _(m, "Requested dimensions. Every value is checked by the shared engine.") }),
2679
- /* @__PURE__ */ f("div", {
2680
- className: "programme-grid",
2681
- children: v.map(([t, n]) => /* @__PURE__ */ p("label", {
2682
- className: "field",
2683
- children: [
2684
- _(m, n),
2685
- " (m)",
2686
- /* @__PURE__ */ p("small", { children: [
2687
- _(m, "user-given"),
2688
- " · ",
2689
- _(m, "unconfirmed")
2690
- ] }),
2691
- /* @__PURE__ */ f("input", {
2692
- type: "number",
2693
- min: "0",
2694
- step: "0.01",
2695
- value: Number.isFinite(g[t]) ? g[t] : "",
2696
- onChange: (n) => h({
2697
- ...e,
2698
- programme: {
2699
- ...g,
2700
- [t]: n.target.value === "" ? NaN : Number(n.target.value)
2701
- }
2940
+ ]
2941
+ }),
2942
+ /* @__PURE__ */ l("details", {
2943
+ open: !!_,
2944
+ children: [/* @__PURE__ */ c("summary", { children: v(h, "Room programme") }), _ ? /* @__PURE__ */ l(s, { children: [
2945
+ /* @__PURE__ */ c("p", { children: v(h, "Requested dimensions. Every value is checked by the shared engine.") }),
2946
+ /* @__PURE__ */ c("div", {
2947
+ className: "programme-grid",
2948
+ children: ee.map(([t, n]) => /* @__PURE__ */ l("label", {
2949
+ className: "field",
2950
+ children: [
2951
+ v(h, n),
2952
+ " (m)",
2953
+ /* @__PURE__ */ l("small", { children: [
2954
+ v(h, M(e, `programme.${t}`, r)),
2955
+ " · ",
2956
+ v(h, "unconfirmed")
2957
+ ] }),
2958
+ /* @__PURE__ */ c("input", {
2959
+ type: "number",
2960
+ min: "0",
2961
+ step: "0.01",
2962
+ value: Number.isFinite(_[t]) ? _[t] : "",
2963
+ onChange: (n) => g({
2964
+ ...e,
2965
+ programme: {
2966
+ ..._,
2967
+ [t]: n.target.value === "" ? NaN : Number(n.target.value)
2968
+ }
2969
+ }, `programme.${t}`)
2702
2970
  })
2703
- })
2704
- ]
2971
+ ]
2972
+ }, t))
2973
+ }),
2974
+ ["entranceEdgeId", "balconyEdgeId"].map((t) => /* @__PURE__ */ l("label", {
2975
+ className: "field",
2976
+ children: [v(h, t === "entranceEdgeId" ? "Entrance wall" : "Balcony wall"), /* @__PURE__ */ l("select", {
2977
+ value: _[t],
2978
+ onChange: (n) => g({
2979
+ ...e,
2980
+ programme: {
2981
+ ..._,
2982
+ [t]: n.target.value
2983
+ }
2984
+ }),
2985
+ children: [/* @__PURE__ */ c("option", {
2986
+ value: "",
2987
+ children: v(h, "Choose a wall")
2988
+ }), e.footprint.edges.map((e) => /* @__PURE__ */ c("option", { children: e.id }, e.id))]
2989
+ })]
2705
2990
  }, t))
2706
- }),
2707
- ["entranceEdgeId", "balconyEdgeId"].map((t) => /* @__PURE__ */ p("label", {
2708
- className: "field",
2709
- children: [_(m, t === "entranceEdgeId" ? "Entrance wall" : "Balcony wall"), /* @__PURE__ */ p("select", {
2710
- value: g[t],
2711
- onChange: (n) => h({
2991
+ ] }) : /* @__PURE__ */ l("p", { children: ["This example uses engine concept programme assumptions. They remain estimated until replaced with your own dimensions. ", /* @__PURE__ */ c("button", {
2992
+ className: "textbtn",
2993
+ onClick: () => g({
2994
+ ...e,
2995
+ programme: Se(e.language).programme
2996
+ }),
2997
+ children: "Enter my own room dimensions"
2998
+ })] })]
2999
+ }),
3000
+ /* @__PURE__ */ l("label", {
3001
+ className: "field",
3002
+ children: [v(h, "Main view wall"), /* @__PURE__ */ l("select", {
3003
+ value: e.viewEdgeId,
3004
+ onChange: (t) => g({
3005
+ ...e,
3006
+ viewEdgeId: t.target.value
3007
+ }),
3008
+ children: [/* @__PURE__ */ c("option", {
3009
+ value: "",
3010
+ children: v(h, "No preference")
3011
+ }), e.footprint.edges.map((e) => /* @__PURE__ */ c("option", { children: e.id }, e.id))]
3012
+ })]
3013
+ }),
3014
+ /* @__PURE__ */ l("label", {
3015
+ className: "field",
3016
+ children: [
3017
+ v(h, "Clear ceiling height (m)"),
3018
+ /* @__PURE__ */ l("small", { children: [
3019
+ v(h, M(e, "buildUps.clearCeilingHeightM", r)),
3020
+ " · ",
3021
+ v(h, "unconfirmed")
3022
+ ] }),
3023
+ /* @__PURE__ */ c("input", {
3024
+ type: "number",
3025
+ step: "0.01",
3026
+ min: "0",
3027
+ value: Number(e.buildUps?.clearCeilingHeightM ?? 2.8),
3028
+ onChange: (t) => g({
2712
3029
  ...e,
2713
- programme: {
2714
- ...g,
2715
- [t]: n.target.value
3030
+ buildUps: {
3031
+ ...e.buildUps,
3032
+ clearCeilingHeightM: Number(t.target.value)
2716
3033
  }
2717
- }),
2718
- children: [/* @__PURE__ */ f("option", {
2719
- value: "",
2720
- children: _(m, "Choose a wall")
2721
- }), e.footprint.edges.map((e) => /* @__PURE__ */ f("option", { children: e.id }, e.id))]
2722
- })]
2723
- }, t))
2724
- ] }) : /* @__PURE__ */ p("p", { children: ["This example uses engine concept programme assumptions. They remain estimated until replaced with your own dimensions. ", /* @__PURE__ */ f("button", {
2725
- className: "textbtn",
2726
- onClick: () => h({
2727
- ...e,
2728
- programme: ye(e.language).programme
2729
- }),
2730
- children: "Enter my own room dimensions"
2731
- })] })]
2732
- }),
2733
- /* @__PURE__ */ p("label", {
2734
- className: "field",
2735
- children: [_(m, "Main view wall"), /* @__PURE__ */ p("select", {
2736
- value: e.viewEdgeId,
2737
- onChange: (t) => h({
2738
- ...e,
2739
- viewEdgeId: t.target.value
2740
- }),
2741
- children: [/* @__PURE__ */ f("option", {
2742
- value: "",
2743
- children: _(m, "No preference")
2744
- }), e.footprint.edges.map((e) => /* @__PURE__ */ f("option", { children: e.id }, e.id))]
2745
- })]
2746
- }),
2747
- /* @__PURE__ */ p("label", {
2748
- className: "field",
2749
- children: [
2750
- _(m, "Clear ceiling height (m)"),
2751
- /* @__PURE__ */ f("small", { children: e.buildUps?.clearCeilingHeightM == null ? "estimated default · unconfirmed" : "user-given · unconfirmed" }),
2752
- /* @__PURE__ */ f("input", {
2753
- type: "number",
2754
- step: "0.01",
2755
- min: "0",
2756
- value: Number(e.buildUps?.clearCeilingHeightM ?? 2.8),
2757
- onChange: (t) => h({
2758
- ...e,
2759
- buildUps: {
2760
- ...e.buildUps,
2761
- clearCeilingHeightM: Number(t.target.value)
2762
- }
3034
+ }, "buildUps.clearCeilingHeightM")
2763
3035
  })
2764
- })
2765
- ]
2766
- }),
2767
- /* @__PURE__ */ f("p", { children: "Other wall/slab build-ups remain labelled concept placeholders from the shared engine." }),
2768
- /* @__PURE__ */ p("label", {
2769
- className: "field",
2770
- children: [_(m, "Country"), /* @__PURE__ */ p("select", {
2771
- value: e.country,
2772
- onChange: (t) => h({
2773
- ...e,
2774
- country: t.target.value
2775
- }),
2776
- children: [
2777
- /* @__PURE__ */ f("option", { children: "unspecified" }),
2778
- /* @__PURE__ */ f("option", { children: "Lebanon" }),
2779
- /* @__PURE__ */ f("option", { children: "Germany" })
2780
3036
  ]
2781
- })]
2782
- }),
2783
- /* @__PURE__ */ p("label", {
2784
- className: "confirmation",
2785
- children: [/* @__PURE__ */ f("input", {
2786
- type: "checkbox",
2787
- checked: i,
2788
- onChange: (e) => a(e.target.checked)
2789
- }), _(m, "I confirm these measured dimensions and angle assumptions.")]
2790
- }),
2791
- /* @__PURE__ */ f("button", {
2792
- className: "ink full",
2793
- disabled: s || !i,
2794
- onClick: o,
2795
- children: _(m, "Check footprint & generate")
2796
- }),
2797
- /* @__PURE__ */ f("button", {
2798
- className: "outline full",
2799
- onClick: c,
2800
- children: _(m, "Attach sketch")
2801
- })
2802
- ]
2803
- }), /* @__PURE__ */ f("aside", {
3037
+ }),
3038
+ /* @__PURE__ */ c("p", { children: "Other wall/slab build-ups remain labelled concept placeholders from the shared engine." }),
3039
+ /* @__PURE__ */ l("label", {
3040
+ className: "field",
3041
+ children: [v(h, "Country"), /* @__PURE__ */ l("select", {
3042
+ value: e.country,
3043
+ onChange: (t) => g({
3044
+ ...e,
3045
+ country: t.target.value
3046
+ }),
3047
+ children: [
3048
+ /* @__PURE__ */ c("option", { children: "unspecified" }),
3049
+ /* @__PURE__ */ c("option", { children: "Lebanon" }),
3050
+ /* @__PURE__ */ c("option", { children: "Germany" })
3051
+ ]
3052
+ })]
3053
+ }),
3054
+ /* @__PURE__ */ l("label", {
3055
+ className: "confirmation",
3056
+ children: [/* @__PURE__ */ c("input", {
3057
+ type: "checkbox",
3058
+ checked: i,
3059
+ onChange: (e) => a(e.target.checked)
3060
+ }), v(h, "I confirm these measured dimensions and angle assumptions.")]
3061
+ }),
3062
+ /* @__PURE__ */ c("button", {
3063
+ className: "ink full",
3064
+ disabled: u || !i,
3065
+ onClick: o,
3066
+ children: v(h, "Check footprint & generate")
3067
+ }),
3068
+ /* @__PURE__ */ c("button", {
3069
+ className: "outline full",
3070
+ onClick: d,
3071
+ children: v(h, "Attach sketch")
3072
+ })
3073
+ ]
3074
+ })
3075
+ }), /* @__PURE__ */ c("aside", {
2804
3076
  className: "paper measure-sketch",
2805
- children: l ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("img", {
3077
+ children: f ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("img", {
2806
3078
  className: "uploaded-preview",
2807
- src: l,
3079
+ src: f,
2808
3080
  alt: "Your selected sketch, local preview"
2809
- }), /* @__PURE__ */ f("p", { children: _(m, "Local image preview. No dimensions are inferred from this display.") })] }) : /* @__PURE__ */ p("div", {
3081
+ }), /* @__PURE__ */ c("p", { children: v(h, "Local image preview. No dimensions are inferred from this display.") })] }) : /* @__PURE__ */ l("div", {
2810
3082
  className: "empty",
2811
3083
  children: [
2812
- /* @__PURE__ */ f("h3", { children: _(m, "Your measurements define the plan.") }),
2813
- /* @__PURE__ */ f("p", { children: _(m, "Attach your sketch for reference. There is no sample footprint hidden behind this form.") }),
2814
- /* @__PURE__ */ f("button", {
3084
+ /* @__PURE__ */ c("h3", { children: v(h, "Your measurements define the plan.") }),
3085
+ /* @__PURE__ */ c("p", { children: v(h, "Attach your sketch for reference. There is no sample footprint hidden behind this form.") }),
3086
+ /* @__PURE__ */ c("button", {
2815
3087
  className: "outline",
2816
- onClick: c,
2817
- children: _(m, "Choose sketch image")
3088
+ disabled: u,
3089
+ onClick: d,
3090
+ children: v(h, "Choose sketch image")
2818
3091
  })
2819
3092
  ]
2820
3093
  })
2821
3094
  })]
2822
3095
  });
2823
3096
  }
2824
- function Ae({ candidate: e }) {
3097
+ function Fe({ candidate: e }) {
2825
3098
  let t = e.reconciliation?.status === "Unique" ? e.reconciliation.solutions[0]?.vertices : null, n = /* @__PURE__ */ new Map();
2826
3099
  for (let t of e.values.values) {
2827
3100
  let e = /^sketch\.topology\.vertices\.([A-Za-z0-9_-]+)\.(x|y)$/.exec(t.path);
@@ -2842,38 +3115,38 @@ function Ae({ candidate: e }) {
2842
3115
  ...n.get(e.startVertexId)
2843
3116
  })).filter((e) => Number.isFinite(e.x) && Number.isFinite(e.y)) ?? [];
2844
3117
  if (r.length < 3 || r.length !== e.input?.edges.length) return null;
2845
- let i = Math.min(...r.map((e) => e.x)), a = Math.min(...r.map((e) => e.y)), o = Math.max(...r.map((e) => e.x)) - i, s = Math.max(...r.map((e) => e.y)) - a, c = Math.min(560 / Math.max(o, 1e-6), 300 / Math.max(s, 1e-6)), l = r.map((e) => ({
3118
+ let i = Math.min(...r.map((e) => e.x)), a = Math.min(...r.map((e) => e.y)), o = Math.max(...r.map((e) => e.x)) - i, s = Math.max(...r.map((e) => e.y)) - a, u = Math.min(560 / Math.max(o, 1e-6), 300 / Math.max(s, 1e-6)), d = r.map((e) => ({
2846
3119
  id: e.id,
2847
- x: 40 + (e.x - i) * c,
2848
- y: 40 + (e.y - a) * c
3120
+ x: 40 + (e.x - i) * u,
3121
+ y: 40 + (e.y - a) * u
2849
3122
  }));
2850
- return /* @__PURE__ */ p("figure", {
3123
+ return /* @__PURE__ */ l("figure", {
2851
3124
  className: "recognized-outline",
2852
- children: [/* @__PURE__ */ p("svg", {
3125
+ children: [/* @__PURE__ */ l("svg", {
2853
3126
  viewBox: "0 0 640 390",
2854
3127
  role: "img",
2855
3128
  "aria-label": "Unconfirmed recognized outline preview",
2856
- children: [/* @__PURE__ */ f("polygon", {
2857
- points: l.map((e) => `${e.x},${e.y}`).join(" "),
3129
+ children: [/* @__PURE__ */ c("polygon", {
3130
+ points: d.map((e) => `${e.x},${e.y}`).join(" "),
2858
3131
  fill: "rgba(41,124,112,.07)",
2859
3132
  stroke: "#286e62",
2860
3133
  strokeWidth: "2"
2861
- }), l.map((t, n) => {
2862
- let r = l[(n + 1) % l.length], i = e.input?.edges.find((e) => e.startVertexId === t.id);
2863
- return /* @__PURE__ */ p("g", { children: [
2864
- /* @__PURE__ */ f("circle", {
3134
+ }), d.map((t, n) => {
3135
+ let r = d[(n + 1) % d.length], i = e.input?.edges.find((e) => e.startVertexId === t.id);
3136
+ return /* @__PURE__ */ l("g", { children: [
3137
+ /* @__PURE__ */ c("circle", {
2865
3138
  cx: t.x,
2866
3139
  cy: t.y,
2867
3140
  r: "3",
2868
3141
  fill: "#286e62"
2869
3142
  }),
2870
- /* @__PURE__ */ f("text", {
3143
+ /* @__PURE__ */ c("text", {
2871
3144
  x: t.x + 5,
2872
3145
  y: t.y - 7,
2873
3146
  fontSize: "10",
2874
3147
  children: t.id
2875
3148
  }),
2876
- i && /* @__PURE__ */ p("text", {
3149
+ i && /* @__PURE__ */ l("text", {
2877
3150
  x: (t.x + r.x) / 2 + 5,
2878
3151
  y: (t.y + r.y) / 2 + 12,
2879
3152
  fontSize: "11",
@@ -2886,7 +3159,7 @@ function Ae({ candidate: e }) {
2886
3159
  })
2887
3160
  ] }, t.id);
2888
3161
  })]
2889
- }), /* @__PURE__ */ p("figcaption", { children: [t?.length ? "Deterministic closure preview from estimated inputs." : "Image-space outline estimate; no physical scale.", " Original recognized outline; form edits are checked when you request reconciliation."] })]
3162
+ }), /* @__PURE__ */ l("figcaption", { children: [t?.length ? "Deterministic closure preview from estimated inputs." : "Image-space outline estimate; no physical scale.", " Original recognized outline; form edits are checked when you request reconciliation."] })]
2890
3163
  });
2891
3164
  }
2892
- export { y as BIM_PACKAGE_ID, te as BIM_PACKAGE_VERSION, Ee as BimStudio, me as checkBimLicense, oe as clearLicense, s as disableTelemetry, l as enableTelemetry, O as setLicense };
3165
+ export { ne as BIM_PACKAGE_ID, y as BIM_PACKAGE_VERSION, je as BimStudio, ge as checkBimLicense, D as clearLicense, u as disableTelemetry, f as enableTelemetry, ce as setLicense };