blue-chestnut-solar-expert 0.0.11 → 0.0.12

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.
Files changed (110) hide show
  1. package/dist/cjs/eraser-icon.house-icon.icon-selector.map-draw.move-icon.octagon-minus-icon.search-icon.solar-expert.solar-system-form.entry.cjs.js.map +1 -1
  2. package/dist/cjs/eraser-icon_9.cjs.entry.js +110 -48
  3. package/dist/cjs/eraser-icon_9.cjs.entry.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/loading-widget.cjs.entry.js +2 -2
  6. package/dist/cjs/loading-widget.cjs.entry.js.map +1 -1
  7. package/dist/cjs/loading-widget.entry.cjs.js.map +1 -1
  8. package/dist/cjs/solar-calculator.cjs.entry.js +1 -1
  9. package/dist/cjs/solar-calculator.cjs.entry.js.map +1 -1
  10. package/dist/cjs/solar-calculator.entry.cjs.js.map +1 -1
  11. package/dist/cjs/stencil-library.cjs.js +1 -1
  12. package/dist/collection/components/map-draw/map-draw.js +82 -22
  13. package/dist/collection/components/map-draw/map-draw.js.map +1 -1
  14. package/dist/collection/components/solar-expert/solar-expert.js +3 -3
  15. package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
  16. package/dist/collection/components/solar-system-form/solar-system-form.js +20 -14
  17. package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -1
  18. package/dist/collection/components/widgets/loading-widget.js +1 -1
  19. package/dist/collection/output.css +183 -0
  20. package/dist/collection/utils/geometry/gridMatch.js +0 -1
  21. package/dist/collection/utils/geometry/gridMatch.js.map +1 -1
  22. package/dist/components/eraser-icon.js +1 -1
  23. package/dist/components/house-icon.js +1 -1
  24. package/dist/components/icon-selector.js +1 -1
  25. package/dist/components/loading-widget.js +2 -2
  26. package/dist/components/loading-widget.js.map +1 -1
  27. package/dist/components/map-draw.js +1 -1
  28. package/dist/components/move-icon.js +1 -1
  29. package/dist/components/octagon-minus-icon.js +1 -1
  30. package/dist/components/p-BGspvo5S.js +36 -0
  31. package/dist/components/p-BGspvo5S.js.map +1 -0
  32. package/dist/components/p-C46bD4Bg.js +36 -0
  33. package/dist/components/p-C46bD4Bg.js.map +1 -0
  34. package/dist/components/p-CB8h41UZ.js +36 -0
  35. package/dist/components/p-CB8h41UZ.js.map +1 -0
  36. package/dist/components/p-CHsmfSJD.js +36 -0
  37. package/dist/components/p-CHsmfSJD.js.map +1 -0
  38. package/dist/components/p-Cg3h6HF4.js +83 -0
  39. package/dist/components/p-Cg3h6HF4.js.map +1 -0
  40. package/dist/components/p-D6cs3r7j.js +621 -0
  41. package/dist/components/p-D6cs3r7j.js.map +1 -0
  42. package/dist/components/{p-CwSYsL57.js → p-DEfwuR25.js} +92 -33
  43. package/dist/components/p-DEfwuR25.js.map +1 -0
  44. package/dist/components/p-DP1y5q1K.js +36 -0
  45. package/dist/components/p-DP1y5q1K.js.map +1 -0
  46. package/dist/components/search-icon.js +1 -1
  47. package/dist/components/solar-calculator.js +1 -1
  48. package/dist/components/solar-calculator.js.map +1 -1
  49. package/dist/components/solar-expert.js +12 -12
  50. package/dist/components/solar-expert.js.map +1 -1
  51. package/dist/components/solar-system-form.js +1 -1
  52. package/dist/esm/eraser-icon.house-icon.icon-selector.map-draw.move-icon.octagon-minus-icon.search-icon.solar-expert.solar-system-form.entry.js.map +1 -1
  53. package/dist/esm/eraser-icon_9.entry.js +110 -48
  54. package/dist/esm/eraser-icon_9.entry.js.map +1 -1
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/esm/loading-widget.entry.js +2 -2
  57. package/dist/esm/loading-widget.entry.js.map +1 -1
  58. package/dist/esm/solar-calculator.entry.js +1 -1
  59. package/dist/esm/solar-calculator.entry.js.map +1 -1
  60. package/dist/esm/stencil-library.js +1 -1
  61. package/dist/stencil-library/eraser-icon.house-icon.icon-selector.map-draw.move-icon.octagon-minus-icon.search-icon.solar-expert.solar-system-form.entry.esm.js.map +1 -1
  62. package/dist/stencil-library/index.esm.js.map +1 -1
  63. package/dist/stencil-library/loading-widget.entry.esm.js.map +1 -1
  64. package/dist/stencil-library/p-25e04c7a.entry.js +2 -0
  65. package/dist/stencil-library/p-25e04c7a.entry.js.map +1 -0
  66. package/dist/stencil-library/p-642b4ce9.entry.js +32 -0
  67. package/dist/stencil-library/{p-ab42a80c.entry.js.map → p-642b4ce9.entry.js.map} +1 -1
  68. package/dist/stencil-library/p-a8d15c85.entry.js +2 -0
  69. package/dist/stencil-library/p-a8d15c85.entry.js.map +1 -0
  70. package/dist/stencil-library/solar-calculator.entry.esm.js.map +1 -1
  71. package/dist/stencil-library/stencil-library.esm.js +1 -1
  72. package/dist/stencil-library/stencil-library.esm.js.map +1 -1
  73. package/dist/types/components/map-draw/map-draw.d.ts +1 -0
  74. package/dist/types/components/solar-system-form/solar-system-form.d.ts +3 -0
  75. package/package.json +1 -1
  76. package/dist/components/p-9ZUfi3zn.js +0 -36
  77. package/dist/components/p-9ZUfi3zn.js.map +0 -1
  78. package/dist/components/p-BfS46GQh.js +0 -36
  79. package/dist/components/p-BfS46GQh.js.map +0 -1
  80. package/dist/components/p-BwC0qfb_.js +0 -83
  81. package/dist/components/p-BwC0qfb_.js.map +0 -1
  82. package/dist/components/p-CX4Jw4PK.js +0 -36
  83. package/dist/components/p-CX4Jw4PK.js.map +0 -1
  84. package/dist/components/p-CllhWhkE.js +0 -615
  85. package/dist/components/p-CllhWhkE.js.map +0 -1
  86. package/dist/components/p-CwSYsL57.js.map +0 -1
  87. package/dist/components/p-OliNFLPu.js +0 -36
  88. package/dist/components/p-OliNFLPu.js.map +0 -1
  89. package/dist/components/p-uvNP9DQ_.js +0 -36
  90. package/dist/components/p-uvNP9DQ_.js.map +0 -1
  91. package/dist/stencil-library/api-By7kNIGr.js.map +0 -1
  92. package/dist/stencil-library/app-globals-DQuL1Twl.js.map +0 -1
  93. package/dist/stencil-library/config-Cx64GtC8.js.map +0 -1
  94. package/dist/stencil-library/decoder-DSavpK4g.js.map +0 -1
  95. package/dist/stencil-library/deflate-Cpl_7R0h.js.map +0 -1
  96. package/dist/stencil-library/general-3MvF5T9_.js.map +0 -1
  97. package/dist/stencil-library/index-Bkp4yicv.js.map +0 -1
  98. package/dist/stencil-library/index-DimvNaNS.js.map +0 -1
  99. package/dist/stencil-library/jpeg-3kYgfUiy.js.map +0 -1
  100. package/dist/stencil-library/lerc-D9ISp5i_.js.map +0 -1
  101. package/dist/stencil-library/lzw-15JscBc_.js.map +0 -1
  102. package/dist/stencil-library/p-ab42a80c.entry.js +0 -32
  103. package/dist/stencil-library/p-b3f0c6b6.entry.js +0 -2
  104. package/dist/stencil-library/p-b3f0c6b6.entry.js.map +0 -1
  105. package/dist/stencil-library/p-fec24b2b.entry.js +0 -2
  106. package/dist/stencil-library/p-fec24b2b.entry.js.map +0 -1
  107. package/dist/stencil-library/packbits-i_L--d7r.js.map +0 -1
  108. package/dist/stencil-library/pako.esm-BdkEMvj8.js.map +0 -1
  109. package/dist/stencil-library/raw-Cp-44rFp.js.map +0 -1
  110. package/dist/stencil-library/webimage-Cn4h3lmO.js.map +0 -1
@@ -99,6 +99,9 @@ export class SolarSystemForm {
99
99
  email = "";
100
100
  nameError = "";
101
101
  emailError = "";
102
+ electricCar = false;
103
+ heatPump = 0;
104
+ battery = 0;
102
105
  // private chart: Chart | null = null;
103
106
  // private chartRef: HTMLCanvasElement | null = null;
104
107
  updateSystemConfigs() {
@@ -247,50 +250,50 @@ export class SolarSystemForm {
247
250
  }
248
251
  render() {
249
252
  const t = getLanguageStrings(this.language);
250
- return (h("div", { key: 'b0a406a3e61afaf5e96e01cee612160b145bc902', class: "flex flex-col justify-center items-center w-full h-full pt-4" // style={{
251
- }, h("h1", { key: '10e24c4114cb8c99b66c63085dbaff4c26a2d784', class: "text-2xl font-bold text-[#271200] mb-4 w-full" }, t.solarSystemForm.title), h("div", { key: '1badca294e702c5ee9c927bbd20c41f02ecee6a6', class: "w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6" }, h("div", { key: '060730279fcb034fcfd2a1ddfd11ac0633b2fc73', class: "space-y-4" }, h("h2", { key: '71f499be9a0391ced80efd4cb316c1855a500d43', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.systemInformation), h("div", { key: '6f1d1903cc2d1b6663a1b06782bb18be00df81ed', class: "grid grid-rows-2 gap-0" }, h("div", { key: '0734194e402ebacaa7b689a2c53fe68ba6779d1c', class: "grid grid-cols-2 gap-4" }, h("label", { key: '9924155ff21e4b88d839bd7556008bda4385cee3', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.numberOfPanels), h("label", { key: 'f6ab52855564e323ade4c9d7daf29e4466ca13d1', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.panelPeakPower)), h("div", { key: '1d7b1bbc040ed2b96beaf1089f4071af37841c13', class: "grid grid-cols-2 gap-4" }, h("input", { key: '2cb11400c02982bf3e8d518b48c18cbd4cb52343', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.numberOfPanels, readOnly: true }), h("input", { key: '6a418ae815ea99b4b6316037144398aa500de9f6', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.panelPeakPower, readonly: true }))), h("div", { key: '95352d83e08f8dd84020179643315a3a8eb2f964', class: "bg-white rounded-4xl p-4" }, h("div", { key: 'f82afd12c95cd5b9d3f3b2f2e2acc9ab13b0c892', class: "flex items-center justify-between" }, h("span", { key: '9f1f9d2182583f37bff597551dc5d3cb0963dfa3', class: "text-gray-600" }, t.solarSystemForm.totalSystemPeakPower), h("span", { key: 'fffe7b7a6fbdb7342858d9c74496f5e33f68b885', class: "text-xl font-bold text-[#271200]" }, (DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *
252
- this.numberOfPanels).toFixed(1), " kW")))), h("div", { key: '36a7f2c39c880b8f77a56e7a7b92ebb17e398449', class: "space-y-4" }, h("h2", { key: 'da22448bb0dc2b06a81fbcaebf3a6d21c2bc2aba', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.householdConsumptionTitle), h("div", { key: 'f95398e218dc62bcb8abb8af96f68b1ee73d48e8', class: "grid grid-rows-2 gap-0" }, h("div", { key: 'e5b652aa182e87508550ee19e97abc310b2c0e84', class: "grid grid-cols-2 gap-4" }, h("label", { key: '454931f266a394d3bc787eb5bc7b9e041941d51e', class: "block text-sm font-medium text-gray-600" }, t.solarSystemForm.annualConsumption), h("label", { key: 'f2fa110b2a728baa5d159d72d1fb537e304e4fda', class: "block text-sm font-medium text-gray-600" }, t.solarSystemForm.consumptionProfileTitle)), h("div", { key: '0ae90d2f7ed03b9dcefc577bf2d77e33530214c9', class: "grid grid-cols-2 gap-4" }, h("input", { key: '22161b32ef443506315dfd52bc63d31f3b973539', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.householdConsumption, onInput: (e) => {
253
+ return (h("div", { key: '8d6f829e542b2c5c181e09341b308c57cf600b9c', class: "flex flex-col justify-center items-center w-full h-full pt-4" // style={{
254
+ }, h("h1", { key: 'ab4006f6fbaf7ec27d97866750c1379b61eda6af', class: "text-2xl font-bold text-[#271200] mb-4 w-full" }, t.solarSystemForm.title), h("div", { key: '146e4c669d1df07359804ed38ed848ad3352837a', class: "w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6" }, h("div", { key: '057ed2bbd8aeae409547a7bc6b1511ac4d1d8ed7', class: "space-y-4" }, h("h2", { key: 'f305926a4e3a15edc39a11085d6de49a4f1f5219', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.systemInformation), h("div", { key: 'ca356100529b595f5e09659af63a954402358049', class: "grid grid-rows-2 gap-0" }, h("div", { key: '82928f8746710de68a488e0354868e0535fbe233', class: "grid grid-cols-2 gap-4" }, h("label", { key: '27d40999038574b81663e718496997d7d47ced14', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.numberOfPanels), h("label", { key: 'c61daf5bbc25b15e42cc6238fbc43c68fa0aea32', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.panelPeakPower)), h("div", { key: '7ba4968d89ec6c9bde572faeb19838b2d301e29c', class: "grid grid-cols-2 gap-4" }, h("input", { key: 'c7e1e79c1151ad393b547edbef3f11e7f157f83a', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.numberOfPanels, readOnly: true }), h("input", { key: 'dfa15518c359c0efc12aa72043b465ad10a88412', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.panelPeakPower, readonly: true }))), h("div", { key: 'fe237482225d4007359614a196dc9c33a9859ef4', class: "bg-white rounded-4xl p-4" }, h("div", { key: '91f8b46c8feb1d4ed1eb5b1fcb02388bd1ba9687', class: "flex items-center justify-between" }, h("span", { key: 'f340e45aecae6bb63784389cac444cb54a18e684', class: "text-gray-600" }, t.solarSystemForm.totalSystemPeakPower), h("span", { key: '475c3c7508474fe3612d28fac781a51361135aba', class: "text-xl font-bold text-[#271200]" }, (DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *
255
+ this.numberOfPanels).toFixed(1), " kW")))), h("div", { key: '4c0245a98b3166da5cdc50c2c975489146456b80', class: "space-y-4" }, h("h2", { key: 'b950d4ccf23e48c72a085cc875ac9a96a7a87816', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.householdConsumptionTitle), h("div", { key: 'c805531e81121d87c33b5191ae8f9494c9fa89e6', class: "grid grid-rows-2 gap-0" }, h("div", { key: '54ba5238e1663018f2e82f991e58288816c8dfeb', class: "grid grid-cols-2 gap-4" }, h("label", { key: '20afa3d0bdfdf57c4e21cb3939fca79d904935d1', class: "block text-sm font-medium text-gray-600" }, t.solarSystemForm.annualConsumption), h("label", { key: '37c9f06e2f32ec8d9d42483da0f0a3292c1d1616', class: "block text-sm font-medium text-gray-600" }, t.solarSystemForm.consumptionProfileTitle)), h("div", { key: '6b5ce305001442946aac00b51b3afb20625cda25', class: "grid grid-cols-2 gap-4" }, h("input", { key: 'a3677da2c99e917b832c3ec9b7627e23fd080064', type: "number", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.householdConsumption, onInput: (e) => {
253
256
  this.householdConsumption = parseInt(e.target
254
257
  .value);
255
258
  this.recalculate();
256
259
  this.updateChart();
257
- } }), h("select", { key: '6bae7b07af670401f2a7f039973696b64bf18511', class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", onChange: (e) => {
260
+ } }), h("select", { key: '776ab2c001ea82845136a8d5f72e75edc69817dc', class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", onChange: (e) => {
258
261
  this.consumptionProfile =
259
262
  e.target
260
263
  .value;
261
264
  this.recalculate();
262
265
  this.updateChart();
263
- } }, h("option", { key: '7c53f3339245af79bff307f81dd6dce55cdd77ad', value: "mostly_at_home", selected: this.consumptionProfile ===
266
+ } }, h("option", { key: 'b3165b60537890a35e5686ee1920fb2f95c51ac4', value: "mostly_at_home", selected: this.consumptionProfile ===
264
267
  "mostly_at_home" }, t.solarSystemForm.consumptionProfiles
265
- .mostlyAtHome), h("option", { key: '5b3cf395b83cedba0da9ec573d75bfdd7ece1e80', value: "mostly_away", selected: this.consumptionProfile ===
268
+ .mostlyAtHome), h("option", { key: 'eb39ea402951c308dce688da043a630818e88219', value: "mostly_away", selected: this.consumptionProfile ===
266
269
  "mostly_away" }, t.solarSystemForm.consumptionProfiles
267
- .mostlyAway))))), h("div", { key: '71a0e1a8cbacbce6b9c836c68526882e2f99d638', class: "space-y-4" }, h("h2", { key: 'd7387553332fe44c62a4556dd592df7d80e38816', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.electricityCostsTitle), h("div", { key: 'b60b41db2d7d803b20d7c8c2f1520133027ac0c2', class: "grid grid-rows-2 gap-0" }, h("div", { key: '6208460d9b1176bda2ce82232283446b98b3fd20', class: "grid grid-cols-2 gap-4" }, h("label", { key: '1d7de8e25c6d464cde30bcfdf47258f8fbe5103a', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.electricityPrice), h("label", { key: 'd83a03641de312f31f63073a874cd6a8ffd16919', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.compensationRate)), h("div", { key: '231b2756d5fbbc9756a4d2b284468260249f0357', class: "grid grid-cols-2 gap-4" }, h("input", { key: 'a1f31bbeefcbf5d8d8786b75bacdadbf4603890a', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.electricityPrice.toFixed(2), onInput: (e) => {
270
+ .mostlyAway))))), h("div", { key: '6d9b59896053431448ef4773526d55b248b94cf2', class: "space-y-4" }, h("h2", { key: 'e8408f003e0de554be8ad3eabbca0050e4f75155', class: "text-lg font-semibold text-[#271200]" }, "Additional Components"), h("div", { key: '5505fba56da71bae25767d053170dfabf8a610fe', class: "grid grid-rows-2 gap-4" })), h("div", { key: '3f727f45fea480257c41d779eb980839200209dd', class: "space-y-4" }, h("h2", { key: '9565045eb4262ad5708f0802ac9161ddb50405c9', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.electricityCostsTitle), h("div", { key: '422102ce3fbe1aca445d10c26506a50e3e5b5dcb', class: "grid grid-rows-2 gap-0" }, h("div", { key: 'e72dce6ec3f8abcc7ffc12114c669ef16ae2d1e4', class: "grid grid-cols-2 gap-4" }, h("label", { key: '1dae32e95c18b673a0dd876c4c645c0232d3bf3c', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.electricityPrice), h("label", { key: 'c6167205fc4bbf3b81e12d5e7a4b812d3cb7d7e4', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.compensationRate)), h("div", { key: '97f5a91c39a59e51e27f69227178dc7615e323da', class: "grid grid-cols-2 gap-4" }, h("input", { key: '9a6c81ab930a1db918a8b978d5a26318ad359979', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.electricityPrice.toFixed(2), onInput: (e) => {
268
271
  this.electricityPrice = parseFloat(e.target
269
272
  .value);
270
273
  this.recalculate();
271
274
  this.updateChart();
272
- } }), h("input", { key: '2c55aa2a5efc9e8241b974b7b6bdc12effbedb10', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.compensationRate.toFixed(2), onInput: (e) => {
275
+ } }), h("input", { key: '5052bb2f4a1cae0c1a3eae47a358be65150b07f3', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white", value: this.compensationRate.toFixed(2), onInput: (e) => {
273
276
  this.compensationRate = parseFloat(e.target
274
277
  .value);
275
278
  this.recalculate();
276
279
  this.updateChart();
277
- } })))), h("div", { key: '4d6fe45c443a7ce484b02b79a2a1b835b0abbeee', class: "space-y-4 pt-4 border-t border-gray-200" }, h("h2", { key: '282e51617d2c1dd29b4631b9def26dbe98e912b5', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.resultsTitle), h("div", { key: '25dc9573694a07cf589f6dcb50896c4f28d47b57', class: "bg-white rounded-4xl p-4" }, h("div", { key: '45ac3469c96d1d4d96f4dc63abfab4401ec74cf5', class: "flex items-center justify-between" }, h("span", { key: '7729a9f5b142d8c1b981bf0734583522275e2ab4', class: "text-gray-600" }, t.solarSystemForm.autonomy), h("span", { key: 'abb4c0e3bb2a67f027ce57b6397fa539194fde3c', class: "text-xl font-bold text-[#271200]" }, this.autonomy.toFixed(1), "%")), h("div", { key: '1ef64dfc7679e8f407b2e17b4ecd61f03275959d', class: "flex items-center justify-between mt-4" }, h("div", { key: '2f1bdd7b9454b4e4b74f29727d193cad13c4ee97', class: "flex items-center gap-2" }, h("span", { key: 'a4a5eb9678ec19fb4f58efe08b729bdab58e2b0e', class: "text-gray-600" }, t.solarSystemForm.costSavings), h("div", { key: '6bfb54832f94188569bc84ca143bf7970c47790d', class: "relative group" }, h("svg", { key: '14c0290b399e2d26b5fd3145b80be1100f717882', xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5 text-gray-400 cursor-help", viewBox: "0 0 20 20", fill: "currentColor" }, h("path", { key: '965be62ab9e9fb1da83b7b248d0987ff6554a7ac', "fill-rule": "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z", "clip-rule": "evenodd" })), h("div", { key: '2e3df31e5272614139a7a064830f246099edbb4c', class: "absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, t.solarSystemForm
278
- .savingsDisclaimer))), h("span", { key: '5d3a4271b1dff765c38b5ce4b7eb855a14ec0f53', class: "text-xl font-bold text-green-600" }, this.costSavings.toFixed(2), "\u20AC/", t
279
- .solarSystemForm.year)))), h("div", { key: '1e75a090d4345d76dd7fad35882583924ae75a51', class: "space-y-4 pt-4 border-t border-gray-200" }, h("h2", { key: 'f631ba8d0709d8b8741fd0c78347ab7de1583dba', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.requestOffer), h("div", { key: '2ffc05cf09c6c328c0b98bda7800f28887c85594', class: "grid grid-rows-2 gap-0" }, h("div", { key: '914b967681d0b3a227388ba0a58c587923c01d83', class: "grid grid-cols-2 gap-4" }, h("label", { key: '2ed3105498642f20eda9f9a34dfec20c1da2b1ae', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.name), h("label", { key: 'de6e9290db4ea49b9d869b96d492900c08256cb3', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.email)), h("div", { key: '7d2d03798fe396c961922a2262a99227fbbdd577', class: "grid grid-cols-2 gap-4" }, h("input", { key: '621e7b599ed1559ad8fbc1be7c6a240004950474', type: "text", class: `w-full px-4 py-2 rounded-4xl border ${this.nameError
280
+ } })))), h("div", { key: '963fc95e0bad78a83683c4f67fc650a109ab2690', class: "space-y-4 pt-4 border-t border-gray-200" }, h("h2", { key: '95aa13e5cacdb63899460cf7dedb76c4461ee791', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.resultsTitle), h("div", { key: '4430f65734b775429b20f6ff0416b9786b0930c7', class: "bg-white rounded-4xl p-4" }, h("div", { key: 'ad1a2599bac396857ed68f896f43de0b44de5a48', class: "flex items-center justify-between" }, h("span", { key: '978c49b1770bb649c26d7b9d23d28a7a174afc96', class: "text-gray-600" }, t.solarSystemForm.autonomy), h("span", { key: 'cc7b0dae2d4db46ca284446988767207762c2bbe', class: "text-xl font-bold text-[#271200]" }, this.autonomy.toFixed(1), "%")), h("div", { key: '8bc803b6f2fb01e5a7c5a44d0054ff0096bb1f51', class: "flex items-center justify-between mt-4" }, h("div", { key: 'bf8cec65c5d32dbb32a1fd00d8b2897789d2dc37', class: "flex items-center gap-2" }, h("span", { key: 'fe123d39da7f209d13f441082f21de2474a27364', class: "text-gray-600" }, t.solarSystemForm.costSavings), h("div", { key: '00a33ff21329f0aa105696a4ab214188e25773d6', class: "relative group" }, h("svg", { key: '6f8e03c873fc28343bd515fdf8b0f47761c7ea3d', xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5 text-gray-400 cursor-help", viewBox: "0 0 20 20", fill: "currentColor" }, h("path", { key: '358ba8282f5e12629d5cbb0809ddd20c0a894fbc', "fill-rule": "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z", "clip-rule": "evenodd" })), h("div", { key: '7c10aeaf6d2e58523f747cf4b1ce0d9d21aaaa49', class: "absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, t.solarSystemForm
281
+ .savingsDisclaimer))), h("span", { key: 'e4faed1b8f1d57d0ebbb36084f9e4f0eed602014', class: "text-xl font-bold text-green-600" }, this.costSavings.toFixed(2), "\u20AC/", t
282
+ .solarSystemForm.year)))), h("div", { key: '57859b85dbf1bcee0cedb6c81e8ab9beffd51738', class: "space-y-4 pt-4 border-t border-gray-200" }, h("h2", { key: 'c8bda51815a9977304a3bca1a28a63d563375177', class: "text-lg font-semibold text-[#271200]" }, t.solarSystemForm.requestOffer), h("div", { key: 'a58139ae6c1714267b61b98f8bcbaa78f80c5e3e', class: "grid grid-rows-2 gap-0" }, h("div", { key: '30e18db38d9f2a2bd37d34d0e364b2477ec7e30e', class: "grid grid-cols-2 gap-4" }, h("label", { key: '15dd0d8714cc9a9548a0d478dc5825a55c9a249c', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.name), h("label", { key: 'e300aa1d93c95220e8cacc2903d5198a864d177f', class: "block text-sm font-medium text-gray-600 mb-1" }, t.solarSystemForm.email)), h("div", { key: 'ce9010d081c9c962c09ef8094899a3ea539b8fa8', class: "grid grid-cols-2 gap-4" }, h("input", { key: 'dd6317ee394798ec4ae897e0fc1aabc4a1fda935', type: "text", class: `w-full px-4 py-2 rounded-4xl border ${this.nameError
280
283
  ? "border-red-500"
281
284
  : "border-gray-300"} focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`, value: this.name, onInput: (e) => {
282
285
  this.name =
283
286
  e.target
284
287
  .value;
285
288
  this.validateForm();
286
- }, placeholder: "Your name" }), this.nameError && (h("p", { key: '4de3d0060b02d653af0f8b170b074395ba9e3ae4', class: "text-red-500 text-sm mt-1" }, this.nameError)), h("input", { key: 'a8902fa1f58a6b0c24b1d03f7798944fb5b78773', type: "email", class: `w-full px-4 py-2 rounded-4xl border ${this.emailError
289
+ }, placeholder: "Your name" }), this.nameError && (h("p", { key: 'b101b6a18db1fd0c528393ae19beec13099fdd80', class: "text-red-500 text-sm mt-1" }, this.nameError)), h("input", { key: '361b641612c986ed2859da069488007601d66594', type: "email", class: `w-full px-4 py-2 rounded-4xl border ${this.emailError
287
290
  ? "border-red-500"
288
291
  : "border-gray-300"} focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`, value: this.email, onInput: (e) => {
289
292
  this.email =
290
293
  e.target
291
294
  .value;
292
295
  this.validateForm();
293
- }, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: '5d9a926a67725d53ed5ad5823bcac02f5b5a7be5', class: "text-red-500 text-sm mt-1" }, this.emailError)))), h("div", { key: '8ab538d452498379706b7cf84fe1b591b6d44eae', class: "flex justify-center" }, h("button", { key: 'c07d408aa160ecb113e9dd35b550e7a88d219dce', onClick: () => this.handleRequestOffer(), disabled: !this.name.trim() ||
296
+ }, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: '504d32bba31775ba3e0ce650ee8840ea904e1877', class: "text-red-500 text-sm mt-1" }, this.emailError)))), h("div", { key: 'ade7fa72c0be4974ad6dc6d82f98cb2d11994c6f', class: "flex justify-center" }, h("button", { key: 'b2a2fdbbf4cffadc0c3d7b40027533cbfaa7943c', onClick: () => this.handleRequestOffer(), disabled: !this.name.trim() ||
294
297
  !this.email.trim() || !!this.nameError ||
295
298
  !!this.emailError, class: "px-4 py-2 bg-[#271200] rounded-4xl hover:bg-[#964500] transition-colors duration-200", style: { color: "white" } }, t.solarSystemForm.requestOfferButton))))));
296
299
  }
@@ -423,7 +426,10 @@ export class SolarSystemForm {
423
426
  "name": {},
424
427
  "email": {},
425
428
  "nameError": {},
426
- "emailError": {}
429
+ "emailError": {},
430
+ "electricCar": {},
431
+ "heatPump": {},
432
+ "battery": {}
427
433
  };
428
434
  }
429
435
  static get watchers() {
@@ -1 +1 @@
1
- {"version":3,"file":"solar-system-form.js","sourceRoot":"","sources":["../../../src/components/solar-system-form/solar-system-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,qCAAqC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D,MAAM,eAAe,GAAG;IACpB,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC,EAAE,oBAAoB;IACvB,CAAC;IACD,GAAG;IACH,GAAG,EAAE,IAAI;IACT,GAAG;IACH,GAAG;IACH,CAAC,EAAE,qBAAqB;IACxB,CAAC;IACD,CAAC;IACD,CAAC;IACD,GAAG;IACH,GAAG;IACH,GAAG,EAAE,qBAAqB;IAC1B,IAAI;IACJ,IAAI;IACJ,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC,EAAE,qBAAqB;CAC3B,CAAC;AACF,MAAM,oBAAoB,GAAG;IACzB,cAAc,EAAE;QACZ,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,IAAI,EAAE,oBAAoB;QAC1B,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI,EAAE,qBAAqB;QAC3B,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,GAAG,EAAE,qBAAqB;Q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ACX,CAAC,CAAC,gBAAgB;oCAClB,CAAC,CAAC,iBACV,sEAAsE,EACtE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oCACX,IAAI,CAAC,KAAK;wCACL,CAAC,CAAC,MAA2B;6CACzB,KAAK,CAAC;oCACf,IAAI,CAAC,YAAY,EAAE,CAAC;gCACxB,CAAC,EACD,WAAW,EAAC,wBAAwB,GACtC;4BACD,IAAI,CAAC,UAAU,IAAI,CAChB,0DAAG,KAAK,EAAC,2BAA2B,IAC/B,IAAI,CAAC,UAAU,CAChB,CACP,CACC,CACJ;oBACN,4DAAK,KAAK,EAAC,qBAAqB;wBAC5B,+DACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,EACxC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gCACvB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS;gCACtC,CAAC,CAAC,IAAI,CAAC,UAAU,EACrB,KAAK,EAAC,sFAAsF,EAC5F,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAExB,CAAC,CAAC,eAAe,CAAC,kBAAkB,CAChC,CACP,CACJ,CACJ,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State, Watch } from \"@stencil/core\";\r\n// import Chart from \"chart.js/auto\";\r\nimport { DEFAULT_SOLAR_PANEL_TYPE } from \"../../config\";\r\nimport { SolarPanelSystemPart } from \"../../utils/geometry/fitting\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { Polygon } from \"../../types/shapes\";\r\n\r\nconst SOLAR_RADIATION = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 0, // 00:00 - 05:00 - 6\r\n 0,\r\n 0.1,\r\n 0.2, // 8\r\n 0.4,\r\n 0.8,\r\n 1, // 06:00 - 11:00 - 12\r\n 1,\r\n 1,\r\n 1,\r\n 0.7,\r\n 0.5,\r\n 0.3, // 12:00 - 17:00 - 18\r\n 0.16,\r\n 0.02,\r\n 0,\r\n 0,\r\n 0,\r\n 0, // 18:00 - 23:00 - 24\r\n];\r\nconst CONSUMPTION_PROFILES = {\r\n mostly_at_home: [\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.15, // 00:00 - 05:00 - 6\r\n 0.23,\r\n 0.26,\r\n 0.16,\r\n 0.16,\r\n 0.15,\r\n 0.19, // 06:00 - 11:00 - 12\r\n 0.23,\r\n 0.24,\r\n 0.35,\r\n 0.28,\r\n 0.275,\r\n 0.8, // 12:00 - 17:00 - 18\r\n 0.78,\r\n 0.74,\r\n 0.75,\r\n 0.73,\r\n 0.26,\r\n 0.1, // 18:00 - 23:00 - 24\r\n ],\r\n mostly_away: [\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.15, // 00:00 - 05:00 - 6\r\n 0.29,\r\n 0.32,\r\n 0.25,\r\n 0.15,\r\n 0.12,\r\n 0.14, // 06:00 - 11:00 - 12\r\n 0.15,\r\n 0.12,\r\n 0.16,\r\n 0.21,\r\n 0.285,\r\n 1, // 12:00 - 17:00 - 18\r\n 0.81,\r\n 0.77,\r\n 0.79,\r\n 0.73,\r\n 0.26,\r\n 0.1, // 18:00 - 23:00 - 24\r\n ],\r\n};\r\n\r\n@Component({\r\n tag: \"solar-system-form\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarSystemForm {\r\n @Prop()\r\n systemConfigs: { [id: string]: SolarPanelSystemPart } = {};\r\n @Prop()\r\n language: Language = \"en\";\r\n @Prop()\r\n roofPolygons: { [id: string]: Polygon } = {};\r\n @Prop()\r\n obstructionPolygons: { [id: string]: Polygon } = {};\r\n\r\n @State()\r\n householdConsumption: number = 3500;\r\n @State()\r\n consumptionProfile: \"mostly_at_home\" | \"mostly_away\" = \"mostly_at_home\";\r\n @State()\r\n electricityPrice: number = 0.3;\r\n @State()\r\n compensationRate: number = 0.07;\r\n @State()\r\n autonomy: number = 0;\r\n @State()\r\n costSavings: number = 0;\r\n @State()\r\n numberOfPanels: number = 5;\r\n @State()\r\n panelPeakPower: number = 0.4; // kW per panel\r\n @State()\r\n name: string = \"\";\r\n @State()\r\n email: string = \"\";\r\n @State()\r\n nameError: string = \"\";\r\n @State()\r\n emailError: string = \"\";\r\n\r\n // private chart: Chart | null = null;\r\n // private chartRef: HTMLCanvasElement | null = null;\r\n\r\n @Watch(\"systemConfigs\")\r\n updateSystemConfigs() {\r\n if (Object.keys(this.systemConfigs).length === 0) {\r\n this.numberOfPanels = 0;\r\n return;\r\n }\r\n this.numberOfPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n\r\n this.panelPeakPower =\r\n Object.entries(this.systemConfigs)[0][1].positionedPanels[0].panel\r\n .kWattPeak;\r\n\r\n this.recalculate();\r\n this.updateChart();\r\n }\r\n\r\n private recalculate() {\r\n const data = CONSUMPTION_PROFILES[this.consumptionProfile];\r\n const norm = data.reduce((acc, curr) => acc + curr, 0);\r\n\r\n const peakKwh = this.numberOfPanels * this.panelPeakPower;\r\n const production = SOLAR_RADIATION.map((radiation) =>\r\n radiation * peakKwh\r\n );\r\n let energyUsageOfProduction = 0;\r\n\r\n for (let i = 0; i < data.length; i++) {\r\n data[i] = data[i] * this.householdConsumption / norm / 365;\r\n if (data[i] <= production[i]) {\r\n energyUsageOfProduction += data[i];\r\n } else if (data[i] > production[i]) {\r\n energyUsageOfProduction += production[i];\r\n }\r\n }\r\n const energyDifference = production.map((p, i) => data[i] - p);\r\n const soldEnergy = -energyDifference.filter((e) => e < 0).reduce(\r\n (acc, curr) => acc + curr,\r\n 0,\r\n );\r\n // Calculate the cost savings\r\n this.costSavings = soldEnergy * this.compensationRate * 365 +\r\n energyUsageOfProduction * 365 * this.electricityPrice;\r\n\r\n this.autonomy =\r\n (energyUsageOfProduction / (this.householdConsumption / 365)) *\r\n 100;\r\n }\r\n\r\n private updateChart() {\r\n // if (!this.chartRef) return;\r\n\r\n // const ctx = this.chartRef.getContext(\"2d\");\r\n // if (!ctx) return;\r\n\r\n // if (this.chart) {\r\n // this.chart.destroy();\r\n // }\r\n\r\n // const hours = Array.from({ length: 24 }, (_, i) => `${i}:00`);\r\n // const data = CONSUMPTION_PROFILES[this.consumptionProfile];\r\n // const norm = data.reduce((acc, curr) => acc + curr, 0);\r\n\r\n // const peakKwh = this.numberOfPanels * this.panelPeakPower;\r\n // const production = SOLAR_RADIATION.map((radiation) =>\r\n // radiation * peakKwh\r\n // );\r\n\r\n // for (let i = 0; i < data.length; i++) {\r\n // data[i] = data[i] * this.householdConsumption / norm / 365;\r\n // }\r\n\r\n // let datasets = [{\r\n // label: \"Energy Consumption\",\r\n // data: data,\r\n // borderColor: \"#964500\",\r\n // backgroundColor: \"rgba(150, 69, 0, 0.1)\",\r\n // fill: true,\r\n // tension: 0.4,\r\n // }, {\r\n // label: \"Energy Production\",\r\n // data: production,\r\n // borderColor: \"#000000\",\r\n // backgroundColor: \"rgba(0, 0, 0, 0.1)\",\r\n // fill: true,\r\n // }];\r\n\r\n // this.chart = new Chart(ctx, {\r\n // type: \"line\",\r\n // data: {\r\n // labels: hours,\r\n // datasets: datasets,\r\n // },\r\n // options: {\r\n // responsive: true,\r\n // plugins: {\r\n // title: {\r\n // display: true,\r\n // text: \"Daily Consumption Profile\",\r\n // },\r\n // },\r\n // scales: {\r\n // y: {\r\n // beginAtZero: true,\r\n // title: {\r\n // display: true,\r\n // text: \"Relative Consumption\",\r\n // },\r\n // },\r\n // x: {\r\n // title: {\r\n // display: true,\r\n // text: \"Hour of Day\",\r\n // },\r\n // },\r\n // },\r\n // },\r\n // });\r\n }\r\n\r\n componentWillLoad() {\r\n this.updateSystemConfigs();\r\n }\r\n\r\n private validateForm(): boolean {\r\n let isValid = true;\r\n const t = getLanguageStrings(this.language);\r\n\r\n // Validate name\r\n if (!this.name.trim()) {\r\n this.nameError = t.solarSystemForm.nameError;\r\n isValid = false;\r\n } else {\r\n this.nameError = \"\";\r\n }\r\n\r\n // Validate email\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n if (!this.email.trim()) {\r\n this.emailError = t.solarSystemForm.emailError;\r\n isValid = false;\r\n } else if (!emailRegex.test(this.email)) {\r\n this.emailError = t.solarSystemForm.validEmailError;\r\n isValid = false;\r\n } else {\r\n this.emailError = \"\";\r\n }\r\n\r\n return isValid;\r\n }\r\n\r\n private handleRequestOffer() {\r\n if (!this.validateForm()) {\r\n return;\r\n }\r\n // Here you can implement the logic to handle the offer request\r\n console.log(\"Requesting offer for: \", {\r\n name: this.name,\r\n email: this.email,\r\n systemConfig: this.systemConfigs,\r\n consumption: this.householdConsumption,\r\n autonomy: this.autonomy,\r\n costSavings: this.costSavings,\r\n roofPolygons: this.roofPolygons,\r\n obstructionPolygons: this.obstructionPolygons,\r\n });\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div class=\"flex flex-col justify-center items-center w-full h-full pt-4\" // style={{\r\n // display: (Object.keys(this.systemConfigs).length === 0)\r\n // ? \"none\"\r\n // : \"flex\",\r\n // }}\r\n >\r\n <h1 class=\"text-2xl font-bold text-[#271200] mb-4 w-full\">\r\n {t.solarSystemForm.title}\r\n </h1>\r\n\r\n <div class=\"w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6\">\r\n {/* System Info Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.systemInformation}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.numberOfPanels}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.panelPeakPower}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.numberOfPanels}\r\n readOnly\r\n />\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.panelPeakPower}\r\n readonly\r\n />\r\n </div>\r\n </div>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.totalSystemPeakPower}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {(DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *\r\n this.numberOfPanels).toFixed(1)} kW\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n {/* Household Consumption Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.householdConsumptionTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.annualConsumption}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.consumptionProfileTitle}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.householdConsumption}\r\n onInput={(e) => {\r\n this.householdConsumption = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.consumptionProfile =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"mostly_at_home\"\r\n | \"mostly_away\";\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n >\r\n <option\r\n value=\"mostly_at_home\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_at_home\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAtHome}\r\n </option>\r\n <option\r\n value=\"mostly_away\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_away\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAway}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n {\r\n /* <div class=\"mt-4 h-48\">\r\n <canvas ref={(el) => this.chartRef = el}></canvas>\r\n </div> */\r\n }\r\n </div>\r\n\r\n {/* Heat Pump Section */}\r\n\r\n {/* Battery Section */}\r\n\r\n {/* Electric Car Section */}\r\n\r\n {/* Electricity Price and Compensation Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.electricityCostsTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.electricityPrice}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.compensationRate}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.electricityPrice.toFixed(2)}\r\n onInput={(e) => {\r\n this.electricityPrice = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.compensationRate.toFixed(2)}\r\n onInput={(e) => {\r\n this.compensationRate = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Results Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.resultsTitle}\r\n </h2>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.autonomy}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {this.autonomy.toFixed(1)}%\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.costSavings}\r\n </span>\r\n <div class=\"relative group\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n class=\"h-5 w-5 text-gray-400 cursor-help\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <div class=\"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none\">\r\n {t.solarSystemForm\r\n .savingsDisclaimer}\r\n </div>\r\n </div>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.costSavings.toFixed(2)}€/{t\r\n .solarSystemForm.year}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Information Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.requestOffer}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.name}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.email}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"text\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.nameError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.name}\r\n onInput={(e) => {\r\n this.name =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"Your name\"\r\n />\r\n {this.nameError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.nameError}\r\n </p>\r\n )}\r\n <input\r\n type=\"email\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.emailError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.email}\r\n onInput={(e) => {\r\n this.email =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"your.email@example.com\"\r\n />\r\n {this.emailError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.emailError}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n <div class=\"flex justify-center\">\r\n <button\r\n onClick={() => this.handleRequestOffer()}\r\n disabled={!this.name.trim() ||\r\n !this.email.trim() || !!this.nameError ||\r\n !!this.emailError}\r\n class=\"px-4 py-2 bg-[#271200] rounded-4xl hover:bg-[#964500] transition-colors duration-200\"\r\n style={{ color: \"white\" }}\r\n >\r\n {t.solarSystemForm.requestOfferButton}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"solar-system-form.js","sourceRoot":"","sources":["../../../src/components/solar-system-form/solar-system-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,qCAAqC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D,MAAM,eAAe,GAAG;IACpB,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC;IACD,CAAC,EAAE,oBAAoB;IACvB,CAAC;IACD,GAAG;IACH,GAAG,EAAE,IAAI;IACT,GAAG;IACH,GAAG;IACH,CAAC,EAAE,qBAAqB;IACxB,CAAC;IACD,CAAC;IACD,CAAC;IACD,GAAG;IACH,GAAG;IACH,GAAG,EAAE,qBAAqB;IAC1B,IAAI;IACJ,IAAI;IACJ,CAAC;IACD,CAAC;IACD,CAAC;IACD,CA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ACrB,KAAK,EAAC,sFAAsF,EAC5F,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAExB,CAAC,CAAC,eAAe,CAAC,kBAAkB,CAChC,CACP,CACJ,CACJ,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State, Watch } from \"@stencil/core\";\r\n// import Chart from \"chart.js/auto\";\r\nimport { DEFAULT_SOLAR_PANEL_TYPE } from \"../../config\";\r\nimport { SolarPanelSystemPart } from \"../../utils/geometry/fitting\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { Polygon } from \"../../types/shapes\";\r\n\r\nconst SOLAR_RADIATION = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 0, // 00:00 - 05:00 - 6\r\n 0,\r\n 0.1,\r\n 0.2, // 8\r\n 0.4,\r\n 0.8,\r\n 1, // 06:00 - 11:00 - 12\r\n 1,\r\n 1,\r\n 1,\r\n 0.7,\r\n 0.5,\r\n 0.3, // 12:00 - 17:00 - 18\r\n 0.16,\r\n 0.02,\r\n 0,\r\n 0,\r\n 0,\r\n 0, // 18:00 - 23:00 - 24\r\n];\r\nconst CONSUMPTION_PROFILES = {\r\n mostly_at_home: [\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.15, // 00:00 - 05:00 - 6\r\n 0.23,\r\n 0.26,\r\n 0.16,\r\n 0.16,\r\n 0.15,\r\n 0.19, // 06:00 - 11:00 - 12\r\n 0.23,\r\n 0.24,\r\n 0.35,\r\n 0.28,\r\n 0.275,\r\n 0.8, // 12:00 - 17:00 - 18\r\n 0.78,\r\n 0.74,\r\n 0.75,\r\n 0.73,\r\n 0.26,\r\n 0.1, // 18:00 - 23:00 - 24\r\n ],\r\n mostly_away: [\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.1,\r\n 0.15, // 00:00 - 05:00 - 6\r\n 0.29,\r\n 0.32,\r\n 0.25,\r\n 0.15,\r\n 0.12,\r\n 0.14, // 06:00 - 11:00 - 12\r\n 0.15,\r\n 0.12,\r\n 0.16,\r\n 0.21,\r\n 0.285,\r\n 1, // 12:00 - 17:00 - 18\r\n 0.81,\r\n 0.77,\r\n 0.79,\r\n 0.73,\r\n 0.26,\r\n 0.1, // 18:00 - 23:00 - 24\r\n ],\r\n};\r\n\r\n@Component({\r\n tag: \"solar-system-form\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarSystemForm {\r\n @Prop()\r\n systemConfigs: { [id: string]: SolarPanelSystemPart } = {};\r\n @Prop()\r\n language: Language = \"en\";\r\n @Prop()\r\n roofPolygons: { [id: string]: Polygon } = {};\r\n @Prop()\r\n obstructionPolygons: { [id: string]: Polygon } = {};\r\n\r\n @State()\r\n householdConsumption: number = 3500;\r\n @State()\r\n consumptionProfile: \"mostly_at_home\" | \"mostly_away\" = \"mostly_at_home\";\r\n @State()\r\n electricityPrice: number = 0.3;\r\n @State()\r\n compensationRate: number = 0.07;\r\n @State()\r\n autonomy: number = 0;\r\n @State()\r\n costSavings: number = 0;\r\n @State()\r\n numberOfPanels: number = 5;\r\n @State()\r\n panelPeakPower: number = 0.4; // kW per panel\r\n @State()\r\n name: string = \"\";\r\n @State()\r\n email: string = \"\";\r\n @State()\r\n nameError: string = \"\";\r\n @State()\r\n emailError: string = \"\";\r\n @State()\r\n electricCar: boolean = false;\r\n @State()\r\n heatPump: number = 0;\r\n @State()\r\n battery: number = 0;\r\n\r\n // private chart: Chart | null = null;\r\n // private chartRef: HTMLCanvasElement | null = null;\r\n\r\n @Watch(\"systemConfigs\")\r\n updateSystemConfigs() {\r\n if (Object.keys(this.systemConfigs).length === 0) {\r\n this.numberOfPanels = 0;\r\n return;\r\n }\r\n this.numberOfPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n\r\n this.panelPeakPower =\r\n Object.entries(this.systemConfigs)[0][1].positionedPanels[0].panel\r\n .kWattPeak;\r\n\r\n this.recalculate();\r\n this.updateChart();\r\n }\r\n\r\n private recalculate() {\r\n const data = CONSUMPTION_PROFILES[this.consumptionProfile];\r\n const norm = data.reduce((acc, curr) => acc + curr, 0);\r\n\r\n const peakKwh = this.numberOfPanels * this.panelPeakPower;\r\n const production = SOLAR_RADIATION.map((radiation) =>\r\n radiation * peakKwh\r\n );\r\n let energyUsageOfProduction = 0;\r\n\r\n for (let i = 0; i < data.length; i++) {\r\n data[i] = data[i] * this.householdConsumption / norm / 365;\r\n if (data[i] <= production[i]) {\r\n energyUsageOfProduction += data[i];\r\n } else if (data[i] > production[i]) {\r\n energyUsageOfProduction += production[i];\r\n }\r\n }\r\n const energyDifference = production.map((p, i) => data[i] - p);\r\n const soldEnergy = -energyDifference.filter((e) => e < 0).reduce(\r\n (acc, curr) => acc + curr,\r\n 0,\r\n );\r\n // Calculate the cost savings\r\n this.costSavings = soldEnergy * this.compensationRate * 365 +\r\n energyUsageOfProduction * 365 * this.electricityPrice;\r\n\r\n this.autonomy =\r\n (energyUsageOfProduction / (this.householdConsumption / 365)) *\r\n 100;\r\n }\r\n\r\n private updateChart() {\r\n // if (!this.chartRef) return;\r\n\r\n // const ctx = this.chartRef.getContext(\"2d\");\r\n // if (!ctx) return;\r\n\r\n // if (this.chart) {\r\n // this.chart.destroy();\r\n // }\r\n\r\n // const hours = Array.from({ length: 24 }, (_, i) => `${i}:00`);\r\n // const data = CONSUMPTION_PROFILES[this.consumptionProfile];\r\n // const norm = data.reduce((acc, curr) => acc + curr, 0);\r\n\r\n // const peakKwh = this.numberOfPanels * this.panelPeakPower;\r\n // const production = SOLAR_RADIATION.map((radiation) =>\r\n // radiation * peakKwh\r\n // );\r\n\r\n // for (let i = 0; i < data.length; i++) {\r\n // data[i] = data[i] * this.householdConsumption / norm / 365;\r\n // }\r\n\r\n // let datasets = [{\r\n // label: \"Energy Consumption\",\r\n // data: data,\r\n // borderColor: \"#964500\",\r\n // backgroundColor: \"rgba(150, 69, 0, 0.1)\",\r\n // fill: true,\r\n // tension: 0.4,\r\n // }, {\r\n // label: \"Energy Production\",\r\n // data: production,\r\n // borderColor: \"#000000\",\r\n // backgroundColor: \"rgba(0, 0, 0, 0.1)\",\r\n // fill: true,\r\n // }];\r\n\r\n // this.chart = new Chart(ctx, {\r\n // type: \"line\",\r\n // data: {\r\n // labels: hours,\r\n // datasets: datasets,\r\n // },\r\n // options: {\r\n // responsive: true,\r\n // plugins: {\r\n // title: {\r\n // display: true,\r\n // text: \"Daily Consumption Profile\",\r\n // },\r\n // },\r\n // scales: {\r\n // y: {\r\n // beginAtZero: true,\r\n // title: {\r\n // display: true,\r\n // text: \"Relative Consumption\",\r\n // },\r\n // },\r\n // x: {\r\n // title: {\r\n // display: true,\r\n // text: \"Hour of Day\",\r\n // },\r\n // },\r\n // },\r\n // },\r\n // });\r\n }\r\n\r\n componentWillLoad() {\r\n this.updateSystemConfigs();\r\n }\r\n\r\n private validateForm(): boolean {\r\n let isValid = true;\r\n const t = getLanguageStrings(this.language);\r\n\r\n // Validate name\r\n if (!this.name.trim()) {\r\n this.nameError = t.solarSystemForm.nameError;\r\n isValid = false;\r\n } else {\r\n this.nameError = \"\";\r\n }\r\n\r\n // Validate email\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n if (!this.email.trim()) {\r\n this.emailError = t.solarSystemForm.emailError;\r\n isValid = false;\r\n } else if (!emailRegex.test(this.email)) {\r\n this.emailError = t.solarSystemForm.validEmailError;\r\n isValid = false;\r\n } else {\r\n this.emailError = \"\";\r\n }\r\n\r\n return isValid;\r\n }\r\n\r\n private handleRequestOffer() {\r\n if (!this.validateForm()) {\r\n return;\r\n }\r\n // Here you can implement the logic to handle the offer request\r\n console.log(\"Requesting offer for: \", {\r\n name: this.name,\r\n email: this.email,\r\n systemConfig: this.systemConfigs,\r\n consumption: this.householdConsumption,\r\n autonomy: this.autonomy,\r\n costSavings: this.costSavings,\r\n roofPolygons: this.roofPolygons,\r\n obstructionPolygons: this.obstructionPolygons,\r\n });\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div class=\"flex flex-col justify-center items-center w-full h-full pt-4\" // style={{\r\n // display: (Object.keys(this.systemConfigs).length === 0)\r\n // ? \"none\"\r\n // : \"flex\",\r\n // }}\r\n >\r\n <h1 class=\"text-2xl font-bold text-[#271200] mb-4 w-full\">\r\n {t.solarSystemForm.title}\r\n </h1>\r\n\r\n <div class=\"w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6\">\r\n {/* System Info Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.systemInformation}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.numberOfPanels}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.panelPeakPower}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.numberOfPanels}\r\n readOnly\r\n />\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.panelPeakPower}\r\n readonly\r\n />\r\n </div>\r\n </div>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.totalSystemPeakPower}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {(DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *\r\n this.numberOfPanels).toFixed(1)} kW\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n {/* Household Consumption Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.householdConsumptionTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.annualConsumption}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.consumptionProfileTitle}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.householdConsumption}\r\n onInput={(e) => {\r\n this.householdConsumption = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.consumptionProfile =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"mostly_at_home\"\r\n | \"mostly_away\";\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n >\r\n <option\r\n value=\"mostly_at_home\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_at_home\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAtHome}\r\n </option>\r\n <option\r\n value=\"mostly_away\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_away\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAway}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n {\r\n /* <div class=\"mt-4 h-48\">\r\n <canvas ref={(el) => this.chartRef = el}></canvas>\r\n </div> */\r\n }\r\n </div>\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n Additional Components\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-4\">\r\n </div>\r\n </div>\r\n\r\n {/* Heat Pump Section */}\r\n\r\n {/* Battery Section */}\r\n\r\n {/* Electric Car Section */}\r\n\r\n {/* Electricity Price and Compensation Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.electricityCostsTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.electricityPrice}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.compensationRate}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.electricityPrice.toFixed(2)}\r\n onInput={(e) => {\r\n this.electricityPrice = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.compensationRate.toFixed(2)}\r\n onInput={(e) => {\r\n this.compensationRate = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n this.updateChart();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Results Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.resultsTitle}\r\n </h2>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.autonomy}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {this.autonomy.toFixed(1)}%\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.costSavings}\r\n </span>\r\n <div class=\"relative group\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n class=\"h-5 w-5 text-gray-400 cursor-help\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <div class=\"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none\">\r\n {t.solarSystemForm\r\n .savingsDisclaimer}\r\n </div>\r\n </div>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.costSavings.toFixed(2)}€/{t\r\n .solarSystemForm.year}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Information Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.requestOffer}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.name}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.email}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"text\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.nameError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.name}\r\n onInput={(e) => {\r\n this.name =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"Your name\"\r\n />\r\n {this.nameError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.nameError}\r\n </p>\r\n )}\r\n <input\r\n type=\"email\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.emailError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.email}\r\n onInput={(e) => {\r\n this.email =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"your.email@example.com\"\r\n />\r\n {this.emailError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.emailError}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n <div class=\"flex justify-center\">\r\n <button\r\n onClick={() => this.handleRequestOffer()}\r\n disabled={!this.name.trim() ||\r\n !this.email.trim() || !!this.nameError ||\r\n !!this.emailError}\r\n class=\"px-4 py-2 bg-[#271200] rounded-4xl hover:bg-[#964500] transition-colors duration-200\"\r\n style={{ color: \"white\" }}\r\n >\r\n {t.solarSystemForm.requestOfferButton}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  export class LoadingWidget {
3
3
  render() {
4
- return (h("div", { key: 'bae5c13e0ea557582e70570c08af16eb02eb9810', class: "absolute flex items-center justify-center bg-white bg-opacity-75 z-20 pt-7 rounded-4xl" }, h("div", { key: '376d4d3b02d83751fdf7467de211ef3d6a624fa3', class: "animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-[#271200]" })));
4
+ return (h("div", { key: '0217d42753a42b9f04cc18b5f9aa1ff19ba4c32b', class: "absolute flex items-center justify-center bg-white bg-opacity-75 z-20 pt-7 rounded-4xl" }, h("div", { key: '42ae347ebfa33faa78bf6b2b628aa0828a08207e', class: "animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-[#271200]" })));
5
5
  }
6
6
  static get is() { return "loading-widget"; }
7
7
  static get originalStyleUrls() {
@@ -10,6 +10,7 @@
10
10
  --color-red-500: oklch(63.7% 0.237 25.331);
11
11
  --color-green-600: oklch(62.7% 0.194 149.214);
12
12
  --color-blue-500: oklch(62.3% 0.214 259.815);
13
+ --color-purple-500: oklch(62.7% 0.265 303.9);
13
14
  --color-gray-50: oklch(98.5% 0.002 247.839);
14
15
  --color-gray-200: oklch(92.8% 0.006 264.531);
15
16
  --color-gray-300: oklch(87.2% 0.01 258.338);
@@ -204,6 +205,9 @@
204
205
  .relative {
205
206
  position: relative;
206
207
  }
208
+ .inset-0 {
209
+ inset: calc(var(--spacing) * 0);
210
+ }
207
211
  .top-0 {
208
212
  top: calc(var(--spacing) * 0);
209
213
  }
@@ -237,6 +241,24 @@
237
241
  .z-20 {
238
242
  z-index: 20;
239
243
  }
244
+ .container {
245
+ width: 100%;
246
+ @media (width >= 40rem) {
247
+ max-width: 40rem;
248
+ }
249
+ @media (width >= 48rem) {
250
+ max-width: 48rem;
251
+ }
252
+ @media (width >= 64rem) {
253
+ max-width: 64rem;
254
+ }
255
+ @media (width >= 80rem) {
256
+ max-width: 80rem;
257
+ }
258
+ @media (width >= 96rem) {
259
+ max-width: 96rem;
260
+ }
261
+ }
240
262
  .m-auto {
241
263
  margin: auto;
242
264
  }
@@ -264,6 +286,9 @@
264
286
  .grid {
265
287
  display: grid;
266
288
  }
289
+ .hidden {
290
+ display: none;
291
+ }
267
292
  .inline {
268
293
  display: inline;
269
294
  }
@@ -297,6 +322,9 @@
297
322
  .w-16 {
298
323
  width: calc(var(--spacing) * 16);
299
324
  }
325
+ .w-20 {
326
+ width: calc(var(--spacing) * 20);
327
+ }
300
328
  .w-52 {
301
329
  width: calc(var(--spacing) * 52);
302
330
  }
@@ -349,6 +377,9 @@
349
377
  .resize {
350
378
  resize: both;
351
379
  }
380
+ .appearance-none {
381
+ appearance: none;
382
+ }
352
383
  .auto-cols-max {
353
384
  grid-auto-columns: max-content;
354
385
  }
@@ -417,6 +448,9 @@
417
448
  margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
418
449
  }
419
450
  }
451
+ .overflow-hidden {
452
+ overflow: hidden;
453
+ }
420
454
  .rounded-4xl {
421
455
  border-radius: var(--radius-4xl);
422
456
  }
@@ -472,6 +506,9 @@
472
506
  .bg-gray-800 {
473
507
  background-color: var(--color-gray-800);
474
508
  }
509
+ .bg-transparent {
510
+ background-color: transparent;
511
+ }
475
512
  .bg-white {
476
513
  background-color: var(--color-white);
477
514
  }
@@ -572,6 +609,9 @@
572
609
  .underline {
573
610
  text-decoration-line: underline;
574
611
  }
612
+ .accent-\[\#271200\] {
613
+ accent-color: #271200;
614
+ }
575
615
  .opacity-0 {
576
616
  opacity: 0%;
577
617
  }
@@ -685,6 +725,149 @@
685
725
  gap: calc(var(--spacing) * 4);
686
726
  }
687
727
  }
728
+ .\[\&\:\:-moz-range-thumb\]\:h-4 {
729
+ &::-moz-range-thumb {
730
+ height: calc(var(--spacing) * 4);
731
+ }
732
+ }
733
+ .\[\&\:\:-moz-range-thumb\]\:w-4 {
734
+ &::-moz-range-thumb {
735
+ width: calc(var(--spacing) * 4);
736
+ }
737
+ }
738
+ .\[\&\:\:-moz-range-thumb\]\:cursor-pointer {
739
+ &::-moz-range-thumb {
740
+ cursor: pointer;
741
+ }
742
+ }
743
+ .\[\&\:\:-moz-range-thumb\]\:appearance-none {
744
+ &::-moz-range-thumb {
745
+ appearance: none;
746
+ }
747
+ }
748
+ .\[\&\:\:-moz-range-thumb\]\:rounded-full {
749
+ &::-moz-range-thumb {
750
+ border-radius: calc(infinity * 1px);
751
+ }
752
+ }
753
+ .\[\&\:\:-moz-range-thumb\]\:bg-\[\#271200\] {
754
+ &::-moz-range-thumb {
755
+ background-color: #271200;
756
+ }
757
+ }
758
+ .\[\&\:\:-moz-range-track\]\:h-2 {
759
+ &::-moz-range-track {
760
+ height: calc(var(--spacing) * 2);
761
+ }
762
+ }
763
+ .\[\&\:\:-moz-range-track\]\:rounded-full {
764
+ &::-moz-range-track {
765
+ border-radius: calc(infinity * 1px);
766
+ }
767
+ }
768
+ .\[\&\:\:-moz-range-track\]\:bg-gray-200 {
769
+ &::-moz-range-track {
770
+ background-color: var(--color-gray-200);
771
+ }
772
+ }
773
+ .\[\&\:\:-webkit-slider-runnable-track\]\:h-2 {
774
+ &::-webkit-slider-runnable-track {
775
+ height: calc(var(--spacing) * 2);
776
+ }
777
+ }
778
+ .\[\&\:\:-webkit-slider-runnable-track\]\:rounded-full {
779
+ &::-webkit-slider-runnable-track {
780
+ border-radius: calc(infinity * 1px);
781
+ }
782
+ }
783
+ .\[\&\:\:-webkit-slider-runnable-track\]\:bg-black\/25 {
784
+ &::-webkit-slider-runnable-track {
785
+ background-color: color-mix(in srgb, #000 25%, transparent);
786
+ @supports (color: color-mix(in lab, red, red)) {
787
+ background-color: color-mix(in oklab, var(--color-black) 25%, transparent);
788
+ }
789
+ }
790
+ }
791
+ .\[\&\:\:-webkit-slider-runnable-track\]\:bg-gray-200 {
792
+ &::-webkit-slider-runnable-track {
793
+ background-color: var(--color-gray-200);
794
+ }
795
+ }
796
+ .\[\&\:\:-webkit-slider-runnable-track\]\:bg-white {
797
+ &::-webkit-slider-runnable-track {
798
+ background-color: var(--color-white);
799
+ }
800
+ }
801
+ .\[\&\:\:-webkit-slider-thumb\]\:h-4 {
802
+ &::-webkit-slider-thumb {
803
+ height: calc(var(--spacing) * 4);
804
+ }
805
+ }
806
+ .\[\&\:\:-webkit-slider-thumb\]\:h-\[5px\] {
807
+ &::-webkit-slider-thumb {
808
+ height: 5px;
809
+ }
810
+ }
811
+ .\[\&\:\:-webkit-slider-thumb\]\:h-\[10px\] {
812
+ &::-webkit-slider-thumb {
813
+ height: 10px;
814
+ }
815
+ }
816
+ .\[\&\:\:-webkit-slider-thumb\]\:h-\[50px\] {
817
+ &::-webkit-slider-thumb {
818
+ height: 50px;
819
+ }
820
+ }
821
+ .\[\&\:\:-webkit-slider-thumb\]\:w-4 {
822
+ &::-webkit-slider-thumb {
823
+ width: calc(var(--spacing) * 4);
824
+ }
825
+ }
826
+ .\[\&\:\:-webkit-slider-thumb\]\:w-\[5px\] {
827
+ &::-webkit-slider-thumb {
828
+ width: 5px;
829
+ }
830
+ }
831
+ .\[\&\:\:-webkit-slider-thumb\]\:w-\[10px\] {
832
+ &::-webkit-slider-thumb {
833
+ width: 10px;
834
+ }
835
+ }
836
+ .\[\&\:\:-webkit-slider-thumb\]\:w-\[50px\] {
837
+ &::-webkit-slider-thumb {
838
+ width: 50px;
839
+ }
840
+ }
841
+ .\[\&\:\:-webkit-slider-thumb\]\:cursor-pointer {
842
+ &::-webkit-slider-thumb {
843
+ cursor: pointer;
844
+ }
845
+ }
846
+ .\[\&\:\:-webkit-slider-thumb\]\:appearance-none {
847
+ &::-webkit-slider-thumb {
848
+ appearance: none;
849
+ }
850
+ }
851
+ .\[\&\:\:-webkit-slider-thumb\]\:rounded-full {
852
+ &::-webkit-slider-thumb {
853
+ border-radius: calc(infinity * 1px);
854
+ }
855
+ }
856
+ .\[\&\:\:-webkit-slider-thumb\]\:bg-\[\#271200\] {
857
+ &::-webkit-slider-thumb {
858
+ background-color: #271200;
859
+ }
860
+ }
861
+ .\[\&\:\:-webkit-slider-thumb\]\:bg-purple-500 {
862
+ &::-webkit-slider-thumb {
863
+ background-color: var(--color-purple-500);
864
+ }
865
+ }
866
+ .\[\&\:\:-webkit-slider-thumb\]\:bg-white {
867
+ &::-webkit-slider-thumb {
868
+ background-color: var(--color-white);
869
+ }
870
+ }
688
871
  }
689
872
  @property --tw-translate-x {
690
873
  syntax: "*";
@@ -140,7 +140,6 @@ export function getOptimalSolarPosition(roof, obstacles, solarPanel, angle) {
140
140
  minY: minY,
141
141
  maxY: maxY
142
142
  };
143
- console.log("solar", solarPanel);
144
143
  const horizontalSolarPanel = {
145
144
  ...solarPanel,
146
145
  widthMeters: solarPanel.widthMeters * Math.cos(angle * Math.PI / 180),