blue-chestnut-solar-expert 0.0.54 → 0.0.56
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/cjs/app-globals-I24yU8do.js +10 -0
- package/dist/cjs/app-globals-I24yU8do.js.map +1 -0
- package/dist/cjs/basedecoder-CQuzfSgz.js +116 -0
- package/dist/cjs/basedecoder-CQuzfSgz.js.map +1 -0
- package/dist/cjs/deflate-AzGzQSW2.js +17 -0
- package/dist/cjs/deflate-AzGzQSW2.js.map +1 -0
- package/dist/cjs/eraser-icon_18.cjs.entry.js +30 -0
- package/dist/cjs/eraser-icon_18.cjs.entry.js.map +1 -0
- package/dist/cjs/index-HgRXF6kp.js +1470 -0
- package/dist/cjs/index-HgRXF6kp.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/jpeg-Bx3bTm32.js +904 -0
- package/dist/cjs/jpeg-Bx3bTm32.js.map +1 -0
- package/dist/cjs/lerc-BC1SKbTC.js +4427 -0
- package/dist/cjs/lerc-BC1SKbTC.js.map +1 -0
- package/dist/cjs/loader.cjs.js +18 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-widget.cjs.entry.js +22 -0
- package/dist/cjs/loading-widget.cjs.entry.js.map +1 -0
- package/dist/cjs/loading-widget.entry.cjs.js.map +1 -0
- package/dist/cjs/lzw-BmFug486.js +140 -0
- package/dist/cjs/lzw-BmFug486.js.map +1 -0
- package/dist/cjs/packbits-CYx9fB0v.js +35 -0
- package/dist/cjs/packbits-CYx9fB0v.js.map +1 -0
- package/dist/cjs/pako.esm-0mKI6Jik.js +3243 -0
- package/dist/cjs/pako.esm-0mKI6Jik.js.map +1 -0
- package/dist/cjs/raw-DC82yoyr.js +16 -0
- package/dist/cjs/raw-DC82yoyr.js.map +1 -0
- package/dist/cjs/stencil-library.cjs.js +30 -0
- package/dist/cjs/stencil-library.cjs.js.map +1 -0
- package/dist/cjs/webimage-Dc0t2xAB.js +49 -0
- package/dist/cjs/webimage-Dc0t2xAB.js.map +1 -0
- package/dist/collection/build/assets/tutorial1.mp4 +0 -0
- package/dist/collection/build/assets/tutorial2.mp4 +0 -0
- package/dist/collection/build/assets/tutorial3.mp4 +0 -0
- package/dist/collection/collection-manifest.json +30 -0
- package/dist/collection/components/icons/eraser.js +64 -0
- package/dist/collection/components/icons/eraser.js.map +1 -0
- package/dist/collection/components/icons/house.js +64 -0
- package/dist/collection/components/icons/house.js.map +1 -0
- package/dist/collection/components/icons/icon.js +108 -0
- package/dist/collection/components/icons/icon.js.map +1 -0
- package/dist/collection/components/icons/marker.js +64 -0
- package/dist/collection/components/icons/marker.js.map +1 -0
- package/dist/collection/components/icons/move.js +64 -0
- package/dist/collection/components/icons/move.js.map +1 -0
- package/dist/collection/components/icons/octagonMinus.js +64 -0
- package/dist/collection/components/icons/octagonMinus.js.map +1 -0
- package/dist/collection/components/icons/search.js +64 -0
- package/dist/collection/components/icons/search.js.map +1 -0
- package/dist/collection/components/icons/settings.js +64 -0
- package/dist/collection/components/icons/settings.js.map +1 -0
- package/dist/collection/components/icons/undo.js +64 -0
- package/dist/collection/components/icons/undo.js.map +1 -0
- package/dist/collection/components/map-draw/map-draw.js +797 -0
- package/dist/collection/components/map-draw/map-draw.js.map +1 -0
- package/dist/collection/components/map-draw/map-selector.js +246 -0
- package/dist/collection/components/map-draw/map-selector.js.map +1 -0
- package/dist/collection/components/map-draw/polygon-buttons.js +86 -0
- package/dist/collection/components/map-draw/polygon-buttons.js.map +1 -0
- package/dist/collection/components/map-draw/polygon-information.js +204 -0
- package/dist/collection/components/map-draw/polygon-information.js.map +1 -0
- package/dist/collection/components/map-draw/tool-box.js +108 -0
- package/dist/collection/components/map-draw/tool-box.js.map +1 -0
- package/dist/collection/components/map-draw/tutorial-component.js +118 -0
- package/dist/collection/components/map-draw/tutorial-component.js.map +1 -0
- package/dist/collection/components/settings/settings.js +127 -0
- package/dist/collection/components/settings/settings.js.map +1 -0
- package/dist/collection/components/solar-expert/solar-expert.js +239 -0
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -0
- package/dist/collection/components/solar-system-form/solar-system-form.js +573 -0
- package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -0
- package/dist/collection/components/widgets/loading-widget.js +18 -0
- package/dist/collection/components/widgets/loading-widget.js.map +1 -0
- package/dist/{stencil-library/config-CWfV1nKn.js → collection/config.js} +4 -10
- package/dist/collection/config.js.map +1 -0
- package/dist/collection/constants.js +90 -0
- package/dist/collection/constants.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/output.css +1175 -0
- package/dist/collection/store.js +43 -0
- package/dist/collection/store.js.map +1 -0
- package/dist/collection/types/lang.js +2 -0
- package/dist/collection/types/lang.js.map +1 -0
- package/dist/collection/types/shapes.js +2 -0
- package/dist/collection/types/shapes.js.map +1 -0
- package/dist/{stencil-library/api-Did5lAE0.js → collection/utils/api.js} +27 -32
- package/dist/collection/utils/api.js.map +1 -0
- package/dist/collection/utils/images.js +2 -0
- package/dist/collection/utils/images.js.map +1 -0
- package/dist/collection/utils/lang/english.js +150 -0
- package/dist/collection/utils/lang/english.js.map +1 -0
- package/dist/collection/utils/lang/general.js +30 -0
- package/dist/collection/utils/lang/general.js.map +1 -0
- package/dist/collection/utils/lang/german.js +150 -0
- package/dist/collection/utils/lang/german.js.map +1 -0
- package/dist/collection/utils/lang/spanish.js +150 -0
- package/dist/collection/utils/lang/spanish.js.map +1 -0
- package/dist/{stencil-library/tools-BCET7NeO.js → collection/utils/render/tools.js} +10 -15
- package/dist/collection/utils/render/tools.js.map +1 -0
- package/dist/collection/utils/solar.js +135 -0
- package/dist/collection/utils/solar.js.map +1 -0
- package/dist/collection/utils/theme.js +97 -0
- package/dist/collection/utils/theme.js.map +1 -0
- package/dist/{stencil-library/utils-BCUZxI9u.js → collection/utils/utils.js} +3 -9
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/eraser-icon.js +11 -0
- package/dist/components/eraser-icon.js.map +1 -0
- package/dist/components/house-icon.js +11 -0
- package/dist/components/house-icon.js.map +1 -0
- package/dist/components/icon-selector.js +11 -0
- package/dist/components/icon-selector.js.map +1 -0
- package/dist/components/index.js +1269 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-widget.js +38 -0
- package/dist/components/loading-widget.js.map +1 -0
- package/dist/components/map-draw.js +11 -0
- package/dist/components/map-draw.js.map +1 -0
- package/dist/components/map-selector.js +11 -0
- package/dist/components/map-selector.js.map +1 -0
- package/dist/components/{solar-calculator.d.ts → marker-icon.d.ts} +4 -4
- package/dist/components/marker-icon.js +11 -0
- package/dist/components/marker-icon.js.map +1 -0
- package/dist/components/move-icon.js +11 -0
- package/dist/components/move-icon.js.map +1 -0
- package/dist/components/octagon-minus-icon.js +11 -0
- package/dist/components/octagon-minus-icon.js.map +1 -0
- package/dist/components/p-B54Ul0nf.js +15 -0
- package/dist/components/p-B54Ul0nf.js.map +1 -0
- package/dist/components/p-B5WTRCh8.js +3241 -0
- package/dist/components/p-B5WTRCh8.js.map +1 -0
- package/dist/components/p-B7UJpRdF.js +40 -0
- package/dist/components/p-B7UJpRdF.js.map +1 -0
- package/dist/components/p-BELtn8mh.js +40 -0
- package/dist/components/p-BELtn8mh.js.map +1 -0
- package/dist/components/p-BFxdD9Vs.js +40 -0
- package/dist/components/p-BFxdD9Vs.js.map +1 -0
- package/dist/{stencil-library/jpeg-CjOJHUd1.js → components/p-BGoSj_DR.js} +3 -11
- package/dist/components/p-BGoSj_DR.js.map +1 -0
- package/dist/components/p-BXbeMtbx.js +76 -0
- package/dist/components/p-BXbeMtbx.js.map +1 -0
- package/dist/components/p-BYE5N70N.js +163 -0
- package/dist/components/p-BYE5N70N.js.map +1 -0
- package/dist/components/p-BnTinS5t.js +40 -0
- package/dist/components/p-BnTinS5t.js.map +1 -0
- package/dist/components/p-BsLLB46f.js +114 -0
- package/dist/components/p-BsLLB46f.js.map +1 -0
- package/dist/{stencil-library/packbits-BMYGgS0z.js → components/p-ByX6QP-E.js} +3 -9
- package/dist/components/p-ByX6QP-E.js.map +1 -0
- package/dist/{stencil-library/lerc-BQF80JgE.js → components/p-CH_OwRlu.js} +1981 -27
- package/dist/components/p-CH_OwRlu.js.map +1 -0
- package/dist/components/p-CO7fYxHj.js +40 -0
- package/dist/components/p-CO7fYxHj.js.map +1 -0
- package/dist/{stencil-library/store-4trH9erz.js → components/p-CRQ8cKpY.js} +72 -9
- package/dist/components/p-CRQ8cKpY.js.map +1 -0
- package/dist/components/p-CZydnQHs.js +114 -0
- package/dist/components/p-CZydnQHs.js.map +1 -0
- package/dist/components/p-CcItlhA2.js +60 -0
- package/dist/components/p-CcItlhA2.js.map +1 -0
- package/dist/{stencil-library/webimage-V5ihYILu.js → components/p-Cgchl6bA.js} +3 -9
- package/dist/components/p-Cgchl6bA.js.map +1 -0
- package/dist/components/p-DJcc5dax.js +1959 -0
- package/dist/components/p-DJcc5dax.js.map +1 -0
- package/dist/components/p-Dcu7-bdb.js +623 -0
- package/dist/components/p-Dcu7-bdb.js.map +1 -0
- package/dist/components/p-DotCjbjt.js +40 -0
- package/dist/components/p-DotCjbjt.js.map +1 -0
- package/dist/components/p-Dqekrz_n.js +40 -0
- package/dist/components/p-Dqekrz_n.js.map +1 -0
- package/dist/components/p-DvYICeab.js +40 -0
- package/dist/components/p-DvYICeab.js.map +1 -0
- package/dist/components/p-Dvlk0vkV.js +47 -0
- package/dist/components/p-Dvlk0vkV.js.map +1 -0
- package/dist/components/p-N0461-xw.js +15944 -0
- package/dist/components/p-N0461-xw.js.map +1 -0
- package/dist/components/p-WmcSqXD8.js +14 -0
- package/dist/components/p-WmcSqXD8.js.map +1 -0
- package/dist/components/p-j-vOrhhh.js +114 -0
- package/dist/components/p-j-vOrhhh.js.map +1 -0
- package/dist/{stencil-library/lzw-PA2aOuVK.js → components/p-q8auDIJ2.js} +4 -10
- package/dist/components/p-q8auDIJ2.js.map +1 -0
- package/dist/components/polygon-buttons.js +11 -0
- package/dist/components/polygon-buttons.js.map +1 -0
- package/dist/components/polygon-information.js +11 -0
- package/dist/components/polygon-information.js.map +1 -0
- package/dist/components/search-icon.js +11 -0
- package/dist/components/search-icon.js.map +1 -0
- package/dist/components/settings-icon.js +11 -0
- package/dist/components/settings-icon.js.map +1 -0
- package/dist/components/settings-modal.js +11 -0
- package/dist/components/settings-modal.js.map +1 -0
- package/dist/components/solar-expert.js +373 -0
- package/dist/components/solar-expert.js.map +1 -0
- package/dist/components/solar-system-form.js +11 -0
- package/dist/components/solar-system-form.js.map +1 -0
- package/dist/components/tool-box.js +11 -0
- package/dist/components/tool-box.js.map +1 -0
- package/dist/components/tutorial-component.d.ts +11 -0
- package/dist/components/tutorial-component.js +11 -0
- package/dist/components/tutorial-component.js.map +1 -0
- package/dist/components/undo-icon.js +11 -0
- package/dist/components/undo-icon.js.map +1 -0
- package/dist/esm/basedecoder-j-vOrhhh.js +114 -0
- package/dist/esm/basedecoder-j-vOrhhh.js.map +1 -0
- package/dist/esm/deflate-DHgPf9CO.js +15 -0
- package/dist/{stencil-library/deflate-BrCNE9ec.js.map → esm/deflate-DHgPf9CO.js.map} +1 -1
- package/dist/esm/eraser-icon_18.entry.js +7 -0
- package/dist/esm/eraser-icon_18.entry.js.map +1 -0
- package/dist/esm/index-C2JRBB5c.js +1458 -0
- package/dist/esm/index-C2JRBB5c.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/jpeg-CJLm1GkA.js +902 -0
- package/dist/esm/jpeg-CJLm1GkA.js.map +1 -0
- package/dist/esm/lerc-C1dTV3Ec.js +4424 -0
- package/dist/esm/lerc-C1dTV3Ec.js.map +1 -0
- package/dist/esm/loader.js +16 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/loading-widget.entry.js +20 -0
- package/dist/esm/loading-widget.entry.js.map +1 -0
- package/dist/esm/lzw-DaOzWJUD.js +138 -0
- package/dist/esm/lzw-DaOzWJUD.js.map +1 -0
- package/dist/esm/packbits-CZPyx9kx.js +33 -0
- package/dist/esm/packbits-CZPyx9kx.js.map +1 -0
- package/dist/esm/pako.esm-B5WTRCh8.js +3241 -0
- package/dist/{stencil-library/pako.esm-CPorU236.js.map → esm/pako.esm-B5WTRCh8.js.map} +1 -1
- package/dist/esm/raw-pqeeWc2_.js +14 -0
- package/dist/esm/raw-pqeeWc2_.js.map +1 -0
- package/dist/esm/stencil-library.js +26 -0
- package/dist/esm/stencil-library.js.map +1 -0
- package/dist/esm/webimage-BiHardhv.js +47 -0
- package/dist/{stencil-library/webimage-V5ihYILu.js.map → esm/webimage-BiHardhv.js.map} +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil-library/build/assets/tutorial1.mp4 +0 -0
- package/dist/stencil-library/build/assets/tutorial2.mp4 +0 -0
- package/dist/stencil-library/build/assets/tutorial3.mp4 +0 -0
- package/dist/stencil-library/index.esm.js +1 -13
- package/dist/stencil-library/index.esm.js.map +1 -1
- package/dist/stencil-library/loading-widget.entry.esm.js.map +1 -1
- package/dist/stencil-library/p-0cc467c4.entry.js +2 -0
- package/dist/stencil-library/p-0cc467c4.entry.js.map +1 -0
- package/dist/stencil-library/p-B54Ul0nf.js +2 -0
- package/dist/stencil-library/p-B54Ul0nf.js.map +1 -0
- package/dist/stencil-library/p-B5WTRCh8.js +2 -0
- package/dist/stencil-library/p-B5WTRCh8.js.map +1 -0
- package/dist/stencil-library/p-BGoSj_DR.js +2 -0
- package/dist/stencil-library/p-BGoSj_DR.js.map +1 -0
- package/dist/stencil-library/p-ByX6QP-E.js +2 -0
- package/dist/stencil-library/p-ByX6QP-E.js.map +1 -0
- package/dist/stencil-library/p-C2JRBB5c.js +3 -0
- package/dist/stencil-library/p-C2JRBB5c.js.map +1 -0
- package/dist/stencil-library/p-CX8V3eiN.js +2 -0
- package/dist/stencil-library/p-CX8V3eiN.js.map +1 -0
- package/dist/stencil-library/p-Cgchl6bA.js +2 -0
- package/dist/stencil-library/p-Cgchl6bA.js.map +1 -0
- package/dist/stencil-library/p-DN5z5Lnk.js +2 -0
- package/dist/stencil-library/p-DN5z5Lnk.js.map +1 -0
- package/dist/stencil-library/p-DYtW7_ih.js +10 -0
- package/dist/stencil-library/p-DYtW7_ih.js.map +1 -0
- package/dist/stencil-library/p-WmcSqXD8.js +2 -0
- package/dist/stencil-library/p-WmcSqXD8.js.map +1 -0
- package/dist/stencil-library/p-d3e17162.entry.js +2 -0
- package/dist/stencil-library/p-d3e17162.entry.js.map +1 -0
- package/dist/stencil-library/p-j-vOrhhh.js +2 -0
- package/dist/stencil-library/p-j-vOrhhh.js.map +1 -0
- package/dist/stencil-library/p-q8auDIJ2.js +2 -0
- package/dist/stencil-library/p-q8auDIJ2.js.map +1 -0
- package/dist/stencil-library/stencil-library.esm.js +1 -52
- package/dist/stencil-library/stencil-library.esm.js.map +1 -1
- package/dist/types/components/icons/marker.d.ts +5 -0
- package/dist/types/components/map-draw/map-draw.d.ts +8 -1
- package/dist/types/components/map-draw/map-selector.d.ts +1 -0
- package/dist/types/components/map-draw/polygon-buttons.d.ts +0 -1
- package/dist/types/components/map-draw/polygon-information.d.ts +2 -0
- package/dist/types/components/map-draw/tutorial-component.d.ts +8 -0
- package/dist/types/components.d.ts +42 -17
- package/dist/types/types/lang.d.ts +21 -0
- package/dist/types/utils/api.d.ts +1 -1
- package/dist/types/utils/images.d.ts +1 -0
- package/package.json +2 -1
- package/dist/stencil-library/api-90JQS7b6.js +0 -104
- package/dist/stencil-library/api-90JQS7b6.js.map +0 -1
- package/dist/stencil-library/api-B5514wut.js +0 -102
- package/dist/stencil-library/api-B5514wut.js.map +0 -1
- package/dist/stencil-library/api-CLbMaqt3.js +0 -103
- package/dist/stencil-library/api-CLbMaqt3.js.map +0 -1
- package/dist/stencil-library/api-Cfi-C6kT.js +0 -104
- package/dist/stencil-library/api-Cfi-C6kT.js.map +0 -1
- package/dist/stencil-library/api-CiNFC5mG.js +0 -104
- package/dist/stencil-library/api-CiNFC5mG.js.map +0 -1
- package/dist/stencil-library/api-D_61gY2X.js +0 -102
- package/dist/stencil-library/api-D_61gY2X.js.map +0 -1
- package/dist/stencil-library/api-Did5lAE0.js.map +0 -1
- package/dist/stencil-library/api-S3oJcLL5.js +0 -103
- package/dist/stencil-library/api-S3oJcLL5.js.map +0 -1
- package/dist/stencil-library/api-iAs1ZQr1.js +0 -104
- package/dist/stencil-library/api-iAs1ZQr1.js.map +0 -1
- package/dist/stencil-library/api-vropRvpT.js +0 -102
- package/dist/stencil-library/api-vropRvpT.js.map +0 -1
- package/dist/stencil-library/config-CWfV1nKn.js.map +0 -1
- package/dist/stencil-library/constants-pXQQsEkH.js +0 -1519
- package/dist/stencil-library/constants-pXQQsEkH.js.map +0 -1
- package/dist/stencil-library/decoder-BDfrXE7e.js +0 -39
- package/dist/stencil-library/decoder-BDfrXE7e.js.map +0 -1
- package/dist/stencil-library/deflate-BrCNE9ec.js +0 -21
- package/dist/stencil-library/eraser-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/eraser-icon.entry.js +0 -22
- package/dist/stencil-library/eraser-icon.entry.js.map +0 -1
- package/dist/stencil-library/house-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/house-icon.entry.js +0 -22
- package/dist/stencil-library/house-icon.entry.js.map +0 -1
- package/dist/stencil-library/icon-selector.entry.esm.js.map +0 -1
- package/dist/stencil-library/icon-selector.entry.js +0 -44
- package/dist/stencil-library/icon-selector.entry.js.map +0 -1
- package/dist/stencil-library/index-CChkgM3J.js +0 -414
- package/dist/stencil-library/index-CChkgM3J.js.map +0 -1
- package/dist/stencil-library/index-Cx8GOJRA.js +0 -4172
- package/dist/stencil-library/index-Cx8GOJRA.js.map +0 -1
- package/dist/stencil-library/jpeg-CjOJHUd1.js.map +0 -1
- package/dist/stencil-library/lerc-BQF80JgE.js.map +0 -1
- package/dist/stencil-library/loading-widget.entry.js +0 -20
- package/dist/stencil-library/loading-widget.entry.js.map +0 -1
- package/dist/stencil-library/lzw-PA2aOuVK.js.map +0 -1
- package/dist/stencil-library/map-draw-CaQc1QTP.js +0 -25429
- package/dist/stencil-library/map-draw-CaQc1QTP.js.map +0 -1
- package/dist/stencil-library/map-draw.entry.esm.js.map +0 -1
- package/dist/stencil-library/map-draw.entry.js +0 -12
- package/dist/stencil-library/map-draw.entry.js.map +0 -1
- package/dist/stencil-library/map-selector.entry.esm.js.map +0 -1
- package/dist/stencil-library/map-selector.entry.js +0 -171
- package/dist/stencil-library/map-selector.entry.js.map +0 -1
- package/dist/stencil-library/move-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/move-icon.entry.js +0 -22
- package/dist/stencil-library/move-icon.entry.js.map +0 -1
- package/dist/stencil-library/octagon-minus-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/octagon-minus-icon.entry.js +0 -22
- package/dist/stencil-library/octagon-minus-icon.entry.js.map +0 -1
- package/dist/stencil-library/packbits-BMYGgS0z.js.map +0 -1
- package/dist/stencil-library/pako.esm-CPorU236.js +0 -6881
- package/dist/stencil-library/polygon-buttons.entry.esm.js.map +0 -1
- package/dist/stencil-library/polygon-buttons.entry.js +0 -30
- package/dist/stencil-library/polygon-buttons.entry.js.map +0 -1
- package/dist/stencil-library/polygon-information.entry.esm.js.map +0 -1
- package/dist/stencil-library/polygon-information.entry.js +0 -53
- package/dist/stencil-library/polygon-information.entry.js.map +0 -1
- package/dist/stencil-library/raw-D-Vfg78n.js +0 -20
- package/dist/stencil-library/raw-D-Vfg78n.js.map +0 -1
- package/dist/stencil-library/search-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/search-icon.entry.js +0 -22
- package/dist/stencil-library/search-icon.entry.js.map +0 -1
- package/dist/stencil-library/settings-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/settings-icon.entry.js +0 -22
- package/dist/stencil-library/settings-icon.entry.js.map +0 -1
- package/dist/stencil-library/settings-modal.entry.esm.js.map +0 -1
- package/dist/stencil-library/settings-modal.entry.js +0 -58
- package/dist/stencil-library/settings-modal.entry.js.map +0 -1
- package/dist/stencil-library/solar-calculator.entry.esm.js.map +0 -1
- package/dist/stencil-library/solar-calculator.entry.js +0 -26666
- package/dist/stencil-library/solar-calculator.entry.js.map +0 -1
- package/dist/stencil-library/solar-expert.entry.esm.js.map +0 -1
- package/dist/stencil-library/solar-expert.entry.js +0 -241
- package/dist/stencil-library/solar-expert.entry.js.map +0 -1
- package/dist/stencil-library/solar-system-form.entry.esm.js.map +0 -1
- package/dist/stencil-library/solar-system-form.entry.js +0 -444
- package/dist/stencil-library/solar-system-form.entry.js.map +0 -1
- package/dist/stencil-library/store-4trH9erz.js.map +0 -1
- package/dist/stencil-library/tool-box.entry.esm.js.map +0 -1
- package/dist/stencil-library/tool-box.entry.js +0 -36
- package/dist/stencil-library/tool-box.entry.js.map +0 -1
- package/dist/stencil-library/tools-BCET7NeO.js.map +0 -1
- package/dist/stencil-library/undo-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/undo-icon.entry.js +0 -22
- package/dist/stencil-library/undo-icon.entry.js.map +0 -1
- package/dist/stencil-library/utils-BCUZxI9u.js.map +0 -1
- package/dist/types/components/solar-calculator/solar-calculator.d.ts +0 -15
- /package/dist/{stencil-library → esm}/app-globals-CX8V3eiN.js +0 -0
- /package/dist/{stencil-library → esm}/app-globals-CX8V3eiN.js.map +0 -0
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
import { getAssetPath, h, } from "@stencil/core";
|
|
2
|
+
import { fetchSolarData, getBestFittingRoofSegment, getOptimalSolarPositionFully, } from "harmonia-sim";
|
|
3
|
+
import { getBuildingImages } from "../../utils/solar";
|
|
4
|
+
import { CanvasManager, CanvasUtils, renderRGB, Tool, } from "harmonia-draw";
|
|
5
|
+
import { markRoofEdgeTool, moveTool, obstructionTool, roofTool, } from "../../utils/render/tools";
|
|
6
|
+
import { DEFAULT_SOLAR_EXPERT_CONFIG, DEFAULT_SOLAR_PANEL_TYPE, } from "../../config";
|
|
7
|
+
import { getPixelInMeters } from "../../utils/utils";
|
|
8
|
+
import { BORDER_INSET } from "../../constants";
|
|
9
|
+
import { getLanguageStrings } from "../../utils/lang/general";
|
|
10
|
+
import { onChange, state } from "../../store";
|
|
11
|
+
export class MapDraw {
|
|
12
|
+
apiKey = "";
|
|
13
|
+
config = DEFAULT_SOLAR_EXPERT_CONFIG;
|
|
14
|
+
solarPanel = DEFAULT_SOLAR_PANEL_TYPE;
|
|
15
|
+
enableSettings = false;
|
|
16
|
+
showInstructions = true;
|
|
17
|
+
showSettings = false;
|
|
18
|
+
showTutorial = false;
|
|
19
|
+
showMarkEdgeTutorial = false;
|
|
20
|
+
showAdditionalToolsTutorial = false;
|
|
21
|
+
additionalToolsTutorialShown = false;
|
|
22
|
+
firstPolygonClosed = false;
|
|
23
|
+
zoom = 1;
|
|
24
|
+
loadingState = "empty";
|
|
25
|
+
buildingInsightsLoaded = false;
|
|
26
|
+
buildingImagesLoaded = false;
|
|
27
|
+
rgbTiff = null;
|
|
28
|
+
currentTool = roofTool;
|
|
29
|
+
buildingInsights = null;
|
|
30
|
+
pixelInMeters = 0.2;
|
|
31
|
+
interaction = {
|
|
32
|
+
isDrawing: false,
|
|
33
|
+
isDragging: false,
|
|
34
|
+
lastTouchTime: 0,
|
|
35
|
+
};
|
|
36
|
+
currentPolygon = null;
|
|
37
|
+
solarSystem = {};
|
|
38
|
+
el;
|
|
39
|
+
canvasElement;
|
|
40
|
+
polygonCanvas;
|
|
41
|
+
polygonCtx;
|
|
42
|
+
canvasManager;
|
|
43
|
+
preventDefaultTouch;
|
|
44
|
+
gestureStartHandler;
|
|
45
|
+
gestureChangeHandler;
|
|
46
|
+
gestureEndHandler;
|
|
47
|
+
latitudeChangeListener;
|
|
48
|
+
longitudeChangeListener;
|
|
49
|
+
componentDidLoad() {
|
|
50
|
+
// Set up change listeners for latitude and longitude
|
|
51
|
+
this.latitudeChangeListener = () => {
|
|
52
|
+
if (state.latitude && state.longitude) {
|
|
53
|
+
this.loadingState = "loading";
|
|
54
|
+
this.buildingInsightsLoaded = false;
|
|
55
|
+
this.buildingImagesLoaded = false;
|
|
56
|
+
this.getBuildingImages();
|
|
57
|
+
this.getBuildingInsights();
|
|
58
|
+
// Reset tutorial states for new location
|
|
59
|
+
this.showTutorial = false;
|
|
60
|
+
this.showMarkEdgeTutorial = false;
|
|
61
|
+
this.showAdditionalToolsTutorial = false;
|
|
62
|
+
this.additionalToolsTutorialShown = false;
|
|
63
|
+
this.firstPolygonClosed = false;
|
|
64
|
+
// Show tutorial when coordinates are first set
|
|
65
|
+
this.showTutorial = true;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.longitudeChangeListener = () => {
|
|
69
|
+
if (state.latitude && state.longitude) {
|
|
70
|
+
this.loadingState = "loading";
|
|
71
|
+
this.buildingInsightsLoaded = false;
|
|
72
|
+
this.buildingImagesLoaded = false;
|
|
73
|
+
this.getBuildingImages();
|
|
74
|
+
this.getBuildingInsights();
|
|
75
|
+
// Reset tutorial states for new location
|
|
76
|
+
this.showTutorial = false;
|
|
77
|
+
this.showMarkEdgeTutorial = false;
|
|
78
|
+
this.showAdditionalToolsTutorial = false;
|
|
79
|
+
this.additionalToolsTutorialShown = false;
|
|
80
|
+
this.firstPolygonClosed = false;
|
|
81
|
+
// Show tutorial when coordinates are first set
|
|
82
|
+
this.showTutorial = true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
onChange("latitude", this.latitudeChangeListener);
|
|
86
|
+
onChange("longitude", this.longitudeChangeListener);
|
|
87
|
+
// Load data if coordinates already exist
|
|
88
|
+
if (state.latitude && state.longitude) {
|
|
89
|
+
this.loadingState = "loading";
|
|
90
|
+
this.buildingInsightsLoaded = false;
|
|
91
|
+
this.buildingImagesLoaded = false;
|
|
92
|
+
this.getBuildingInsights();
|
|
93
|
+
this.getBuildingImages();
|
|
94
|
+
// Show tutorial if coordinates already exist
|
|
95
|
+
this.showTutorial = true;
|
|
96
|
+
}
|
|
97
|
+
// Wait for the next frame to ensure DOM is ready
|
|
98
|
+
requestAnimationFrame(() => {
|
|
99
|
+
this.initializeCanvas();
|
|
100
|
+
const rect = this.canvasElement.getBoundingClientRect();
|
|
101
|
+
this.sizeCanvas(rect.width, rect.height);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
initializeCanvas() {
|
|
105
|
+
if (this.canvasElement && this.polygonCanvas) {
|
|
106
|
+
// Set initial canvas sizes based on container
|
|
107
|
+
const rect = this.canvasElement.getBoundingClientRect();
|
|
108
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
109
|
+
this.canvasElement.width = rect.width;
|
|
110
|
+
this.canvasElement.height = rect.height;
|
|
111
|
+
this.polygonCanvas.width = rect.width;
|
|
112
|
+
this.polygonCanvas.height = rect.height;
|
|
113
|
+
this.polygonCtx = this.polygonCanvas.getContext("2d");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Add resize listener
|
|
117
|
+
window.addEventListener("resize", this.handleResize);
|
|
118
|
+
}
|
|
119
|
+
handleResize = () => {
|
|
120
|
+
if (this.rgbTiff) {
|
|
121
|
+
this.drawMap();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
this.removeEventListeners();
|
|
126
|
+
window.removeEventListener("resize", this.handleResize);
|
|
127
|
+
window.removeEventListener("resize", this.handleResize);
|
|
128
|
+
}
|
|
129
|
+
setupCanvasManager() {
|
|
130
|
+
if (!this.rgbTiff)
|
|
131
|
+
return;
|
|
132
|
+
if (!this.rgbTiff)
|
|
133
|
+
return;
|
|
134
|
+
// if (this.canvasManager) return;
|
|
135
|
+
this.canvasManager = new CanvasManager({
|
|
136
|
+
coordinateSystem: {
|
|
137
|
+
width: this.rgbTiff.width,
|
|
138
|
+
height: this.rgbTiff.height,
|
|
139
|
+
},
|
|
140
|
+
onStateChange: () => {
|
|
141
|
+
const currentPolygon = this.canvasManager
|
|
142
|
+
?.getCurrentPolygon();
|
|
143
|
+
// Calculate area and create a copy to trigger Stencil re-render
|
|
144
|
+
this.currentPolygon = currentPolygon
|
|
145
|
+
? {
|
|
146
|
+
...currentPolygon,
|
|
147
|
+
points: [...currentPolygon.points],
|
|
148
|
+
area: currentPolygon.area,
|
|
149
|
+
}
|
|
150
|
+
: null;
|
|
151
|
+
CanvasUtils.drawState(this.polygonCtx, this.canvasManager.getState(), this.solarPanel, {
|
|
152
|
+
showGrid: false,
|
|
153
|
+
showPreview: !state.isMobile,
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
onPolygonChange: (polygon) => this.handlePolygonsChange(polygon),
|
|
157
|
+
onLowerRoofEdgeMarked: () => {
|
|
158
|
+
this.calculateSolarPanels();
|
|
159
|
+
if (!this.additionalToolsTutorialShown) {
|
|
160
|
+
this.showAdditionalToolsTutorial = true;
|
|
161
|
+
this.additionalToolsTutorialShown = true;
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
console.log("debug", this.canvasManager?.getDebugString());
|
|
166
|
+
// Add event listeners after canvas is initialized
|
|
167
|
+
this.setupEventListeners();
|
|
168
|
+
// Draw map after canvas manager is set up
|
|
169
|
+
requestAnimationFrame(() => {
|
|
170
|
+
this.drawMap();
|
|
171
|
+
});
|
|
172
|
+
// Draw map after canvas manager is set up
|
|
173
|
+
requestAnimationFrame(() => {
|
|
174
|
+
this.drawMap();
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
setupEventListeners() {
|
|
178
|
+
if (!this.polygonCanvas)
|
|
179
|
+
return;
|
|
180
|
+
this.polygonCanvas.addEventListener("mousedown", this.handleMouseDown, {
|
|
181
|
+
passive: false,
|
|
182
|
+
});
|
|
183
|
+
this.polygonCanvas.addEventListener("touchstart", this.handleTouchStart, {
|
|
184
|
+
passive: false,
|
|
185
|
+
});
|
|
186
|
+
this.polygonCanvas.addEventListener("mousemove", this.handleMouseMove, {
|
|
187
|
+
passive: true,
|
|
188
|
+
});
|
|
189
|
+
this.polygonCanvas.addEventListener("mouseleave", this.handleMouseLeave, {
|
|
190
|
+
passive: true,
|
|
191
|
+
});
|
|
192
|
+
// Document-level event listeners for drag operations
|
|
193
|
+
document.addEventListener("mousemove", this.handleMouseMove, {
|
|
194
|
+
passive: true,
|
|
195
|
+
});
|
|
196
|
+
document.addEventListener("touchmove", this.handleTouchMove, {
|
|
197
|
+
passive: false,
|
|
198
|
+
});
|
|
199
|
+
document.addEventListener("mouseup", this.handleMouseUp, {
|
|
200
|
+
passive: true,
|
|
201
|
+
});
|
|
202
|
+
document.addEventListener("touchend", this.handleTouchEnd, {
|
|
203
|
+
passive: false,
|
|
204
|
+
});
|
|
205
|
+
// Additional touch event prevention
|
|
206
|
+
this.preventDefaultTouch = (e) => {
|
|
207
|
+
if (e.touches.length > 1) {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
this.gestureStartHandler = (e) => e.preventDefault();
|
|
212
|
+
this.gestureChangeHandler = (e) => e.preventDefault();
|
|
213
|
+
this.gestureEndHandler = (e) => e.preventDefault();
|
|
214
|
+
this.polygonCanvas.addEventListener("touchmove", this.preventDefaultTouch, {
|
|
215
|
+
passive: false,
|
|
216
|
+
});
|
|
217
|
+
this.polygonCanvas.addEventListener("gesturestart", this.gestureStartHandler, {
|
|
218
|
+
passive: false,
|
|
219
|
+
});
|
|
220
|
+
this.polygonCanvas.addEventListener("gesturechange", this.gestureChangeHandler, {
|
|
221
|
+
passive: false,
|
|
222
|
+
});
|
|
223
|
+
this.polygonCanvas.addEventListener("gestureend", this.gestureEndHandler, {
|
|
224
|
+
passive: false,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
removeEventListeners() {
|
|
228
|
+
if (!this.polygonCanvas)
|
|
229
|
+
return;
|
|
230
|
+
this.polygonCanvas.removeEventListener("mousedown", this.handleMouseDown);
|
|
231
|
+
this.polygonCanvas.removeEventListener("touchstart", this.handleTouchStart);
|
|
232
|
+
this.polygonCanvas.removeEventListener("mousemove", this.handleMouseMove);
|
|
233
|
+
this.polygonCanvas.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
234
|
+
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
235
|
+
document.removeEventListener("touchmove", this.handleTouchMove);
|
|
236
|
+
document.removeEventListener("mouseup", this.handleMouseUp);
|
|
237
|
+
document.removeEventListener("touchend", this.handleTouchEnd);
|
|
238
|
+
if (this.preventDefaultTouch) {
|
|
239
|
+
this.polygonCanvas.removeEventListener("touchmove", this.preventDefaultTouch);
|
|
240
|
+
}
|
|
241
|
+
if (this.gestureStartHandler) {
|
|
242
|
+
this.polygonCanvas.removeEventListener("gesturestart", this.gestureStartHandler);
|
|
243
|
+
}
|
|
244
|
+
if (this.gestureChangeHandler) {
|
|
245
|
+
this.polygonCanvas.removeEventListener("gesturechange", this.gestureChangeHandler);
|
|
246
|
+
}
|
|
247
|
+
if (this.gestureEndHandler) {
|
|
248
|
+
this.polygonCanvas.removeEventListener("gestureend", this.gestureEndHandler);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
handlePolygonsChange(polygon) {
|
|
252
|
+
this.currentPolygon = polygon;
|
|
253
|
+
// Check if this is the first polygon being closed
|
|
254
|
+
if (polygon.closed && !this.firstPolygonClosed &&
|
|
255
|
+
polygon.type === "roof") {
|
|
256
|
+
this.firstPolygonClosed = true;
|
|
257
|
+
this.showMarkEdgeTutorial = true;
|
|
258
|
+
}
|
|
259
|
+
if (polygon.closed || this.currentTool !== moveTool) {
|
|
260
|
+
this.handleToolSelect(moveTool);
|
|
261
|
+
if (polygon.azimuth && polygon.pitch) {
|
|
262
|
+
if (this.canvasManager?.getPositionedSolarPanels(polygon.id)) {
|
|
263
|
+
this.calculateSolarPanels();
|
|
264
|
+
}
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const bestMatch = getBestFittingRoofSegment(polygon, this.buildingInsights?.solarPotential.roofSegmentStats ?? [], this.rgbTiff.bounds, this.canvasElement);
|
|
268
|
+
if (!bestMatch) {
|
|
269
|
+
const newPolygon = {
|
|
270
|
+
...polygon,
|
|
271
|
+
azimuth: 180,
|
|
272
|
+
pitch: 35,
|
|
273
|
+
};
|
|
274
|
+
this.canvasManager?.updatePolygon(newPolygon);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const newPolygon = {
|
|
278
|
+
...polygon,
|
|
279
|
+
azimuth: polygon.azimuth || bestMatch.azimuthDegrees,
|
|
280
|
+
pitch: polygon.pitch || bestMatch.pitchDegrees,
|
|
281
|
+
};
|
|
282
|
+
this.canvasManager?.updatePolygon(newPolygon);
|
|
283
|
+
}
|
|
284
|
+
if (polygon.closed &&
|
|
285
|
+
this.canvasManager?.getPositionedSolarPanels(polygon.id)) {
|
|
286
|
+
this.calculateSolarPanels();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
handleMouseUp = (event) => {
|
|
290
|
+
if (!this.canvasManager)
|
|
291
|
+
return;
|
|
292
|
+
this.canvasManager.handleMouseUp(event);
|
|
293
|
+
};
|
|
294
|
+
handleTouchEnd = (event) => {
|
|
295
|
+
if (!this.polygonCanvas || !this.canvasManager)
|
|
296
|
+
return;
|
|
297
|
+
// Only prevent default if the touch is on the canvas
|
|
298
|
+
const target = event.target;
|
|
299
|
+
if (this.isTargetCanvas(target)) {
|
|
300
|
+
event.preventDefault();
|
|
301
|
+
event.stopPropagation();
|
|
302
|
+
}
|
|
303
|
+
this.canvasManager.handleTouchEnd(event);
|
|
304
|
+
};
|
|
305
|
+
handleTouchMove = (event) => {
|
|
306
|
+
if (!this.polygonCanvas || !this.canvasManager)
|
|
307
|
+
return;
|
|
308
|
+
// Only prevent default if the touch is on the canvas
|
|
309
|
+
const target = event.target;
|
|
310
|
+
if (this.isTargetCanvas(target)) {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
event.stopPropagation();
|
|
313
|
+
}
|
|
314
|
+
const rect = this.polygonCanvas.getBoundingClientRect();
|
|
315
|
+
this.canvasManager.handleTouchMove(event, rect);
|
|
316
|
+
};
|
|
317
|
+
handleMouseMove = (event) => {
|
|
318
|
+
if (!this.canvasManager)
|
|
319
|
+
return;
|
|
320
|
+
const rect = this.polygonCanvas?.getBoundingClientRect();
|
|
321
|
+
this.canvasManager.handleMouseMove(event, rect);
|
|
322
|
+
};
|
|
323
|
+
handleMouseLeave = () => {
|
|
324
|
+
if (!this.canvasManager)
|
|
325
|
+
return;
|
|
326
|
+
this.canvasManager.handleMouseLeave();
|
|
327
|
+
};
|
|
328
|
+
handleMouseDown = (event) => {
|
|
329
|
+
if (!this.canvasManager)
|
|
330
|
+
return;
|
|
331
|
+
const rect = this.polygonCanvas?.getBoundingClientRect();
|
|
332
|
+
this.canvasManager.handleMouseDown(event, rect);
|
|
333
|
+
};
|
|
334
|
+
handleTouchStart = (event) => {
|
|
335
|
+
if (!this.polygonCanvas || !this.canvasManager)
|
|
336
|
+
return;
|
|
337
|
+
// Only prevent default if the touch is on the canvas
|
|
338
|
+
const target = event.target;
|
|
339
|
+
if (!this.isTargetCanvas(target)) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
event.preventDefault();
|
|
343
|
+
event.stopPropagation();
|
|
344
|
+
const now = Date.now();
|
|
345
|
+
// Prevent double tap zoom with a longer timeout
|
|
346
|
+
if (now - this.interaction.lastTouchTime < 500) {
|
|
347
|
+
event.preventDefault();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.interaction = {
|
|
351
|
+
...this.interaction,
|
|
352
|
+
lastTouchTime: now,
|
|
353
|
+
};
|
|
354
|
+
const rect = this.polygonCanvas.getBoundingClientRect();
|
|
355
|
+
this.canvasManager.handleTouchStart(event, rect);
|
|
356
|
+
};
|
|
357
|
+
isTargetCanvas(target) {
|
|
358
|
+
if (!this.polygonCanvas || !this.canvasElement)
|
|
359
|
+
return false;
|
|
360
|
+
return target === this.polygonCanvas ||
|
|
361
|
+
target === this.canvasElement ||
|
|
362
|
+
this.polygonCanvas.contains(target) ||
|
|
363
|
+
this.canvasElement.contains(target);
|
|
364
|
+
}
|
|
365
|
+
sizeCanvas(width, height) {
|
|
366
|
+
if (this.canvasElement) {
|
|
367
|
+
this.canvasElement.width = width;
|
|
368
|
+
this.canvasElement.height = height;
|
|
369
|
+
}
|
|
370
|
+
if (this.polygonCanvas) {
|
|
371
|
+
this.polygonCanvas.width = width;
|
|
372
|
+
this.polygonCanvas.height = height;
|
|
373
|
+
this.polygonCtx = this.polygonCanvas.getContext("2d");
|
|
374
|
+
if (this.canvasManager) {
|
|
375
|
+
this.canvasManager.updateCanvasSize({
|
|
376
|
+
width: width,
|
|
377
|
+
height: height,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
async getBuildingInsights() {
|
|
383
|
+
if (!state.latitude || !state.longitude) {
|
|
384
|
+
this.buildingInsightsLoaded = true;
|
|
385
|
+
this.checkLoadingComplete();
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (this.buildingInsights) {
|
|
389
|
+
const sameLocation = this.buildingInsights.center.latitude === state.latitude &&
|
|
390
|
+
this.buildingInsights.center.longitude === state.longitude;
|
|
391
|
+
if (sameLocation) {
|
|
392
|
+
this.buildingInsightsLoaded = true;
|
|
393
|
+
this.checkLoadingComplete();
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
this.solarSystem = {};
|
|
397
|
+
this.canvasElement?.getContext("2d")?.clearRect(0, 0, this.canvasElement.width, this.canvasElement.height);
|
|
398
|
+
this.polygonCtx?.clearRect(0, 0, this.polygonCanvas.width, this.polygonCanvas.height);
|
|
399
|
+
this.rgbTiff = null;
|
|
400
|
+
this.canvasManager?.clearPolygons();
|
|
401
|
+
// Reset tutorial states for new location
|
|
402
|
+
this.showTutorial = false;
|
|
403
|
+
this.showMarkEdgeTutorial = false;
|
|
404
|
+
this.showAdditionalToolsTutorial = false;
|
|
405
|
+
this.additionalToolsTutorialShown = false;
|
|
406
|
+
this.firstPolygonClosed = false;
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
this.buildingInsights = await fetchSolarData(state.latitude, state.longitude, this.apiKey);
|
|
410
|
+
if (!this.buildingInsights) {
|
|
411
|
+
console.error("No building insights found. Please enter them manually.");
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
console.error("Failed to get building insights:", error);
|
|
416
|
+
}
|
|
417
|
+
finally {
|
|
418
|
+
this.buildingInsightsLoaded = true;
|
|
419
|
+
this.checkLoadingComplete();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
checkLoadingComplete() {
|
|
423
|
+
if (this.buildingInsightsLoaded && this.buildingImagesLoaded) {
|
|
424
|
+
this.loadingState = "loaded";
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
async getBuildingImages() {
|
|
428
|
+
if (!state.latitude || !state.longitude) {
|
|
429
|
+
this.buildingImagesLoaded = true;
|
|
430
|
+
this.checkLoadingComplete();
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
// Check if we already have building insights for the same location
|
|
434
|
+
if (this.buildingInsights) {
|
|
435
|
+
const sameLocation = this.buildingInsights.center.latitude === state.latitude &&
|
|
436
|
+
this.buildingInsights.center.longitude === state.longitude;
|
|
437
|
+
if (sameLocation) {
|
|
438
|
+
// If we have the same location, we might already have the images too
|
|
439
|
+
this.buildingImagesLoaded = true;
|
|
440
|
+
this.checkLoadingComplete();
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
try {
|
|
445
|
+
this.rgbTiff = await getBuildingImages(state.latitude, state.longitude, this.apiKey, state.radiusMeters);
|
|
446
|
+
if (this.rgbTiff) {
|
|
447
|
+
this.pixelInMeters = getPixelInMeters(this.rgbTiff);
|
|
448
|
+
if (this.canvasManager) {
|
|
449
|
+
this.canvasManager.setMeterToPixelRatio(this.pixelInMeters);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
console.error("Failed to get building images:", error);
|
|
455
|
+
}
|
|
456
|
+
finally {
|
|
457
|
+
this.buildingImagesLoaded = true;
|
|
458
|
+
this.checkLoadingComplete();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
async drawMap() {
|
|
462
|
+
if (!this.canvasElement || !this.rgbTiff) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
// Ensure canvas is properly sized
|
|
466
|
+
if (!this.canvasElement || !this.rgbTiff) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
// Ensure canvas is properly sized
|
|
470
|
+
this.sizeCanvas(this.rgbTiff.width, this.rgbTiff.height);
|
|
471
|
+
// Add a small delay to ensure canvas sizing is complete
|
|
472
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
473
|
+
// Add a small delay to ensure canvas sizing is complete
|
|
474
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
475
|
+
try {
|
|
476
|
+
renderRGB(this.rgbTiff, undefined, this.canvasElement);
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
console.error("Failed to render RGB image:", error);
|
|
480
|
+
}
|
|
481
|
+
try {
|
|
482
|
+
renderRGB(this.rgbTiff, undefined, this.canvasElement);
|
|
483
|
+
}
|
|
484
|
+
catch (error) {
|
|
485
|
+
console.error("Failed to render RGB image:", error);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
undo() {
|
|
489
|
+
if (this.canvasManager?.canUndo()) {
|
|
490
|
+
console.log("undo");
|
|
491
|
+
this.canvasManager.undo();
|
|
492
|
+
// Map harmonia-draw Tool enum back to local Tool
|
|
493
|
+
const harmoniaTool = this.canvasManager.getState().selectedTool;
|
|
494
|
+
switch (harmoniaTool) {
|
|
495
|
+
case Tool.ROOF_POLYGON:
|
|
496
|
+
this.currentTool = roofTool;
|
|
497
|
+
break;
|
|
498
|
+
case Tool.OBSTRUCTION_POLYGON:
|
|
499
|
+
this.currentTool = obstructionTool;
|
|
500
|
+
break;
|
|
501
|
+
case Tool.MOVE:
|
|
502
|
+
this.currentTool = moveTool;
|
|
503
|
+
break;
|
|
504
|
+
case Tool.MARK_ROOF_EDGE:
|
|
505
|
+
this.currentTool = markRoofEdgeTool;
|
|
506
|
+
break;
|
|
507
|
+
default:
|
|
508
|
+
this.currentTool = moveTool;
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
// if (!this.currentPolygon?.closed) {
|
|
512
|
+
// this.handleToolSelect(roofTool);
|
|
513
|
+
// }
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
calculateSolarPanels() {
|
|
517
|
+
if (this.currentPolygon) {
|
|
518
|
+
this.calculateSolarPanelsForPolygon(this.currentPolygon, false);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
markAsFlatRoof() {
|
|
522
|
+
if (this.currentPolygon) {
|
|
523
|
+
const newPolygon = {
|
|
524
|
+
...this.currentPolygon,
|
|
525
|
+
pitch: 15,
|
|
526
|
+
azimuth: 180, // East orientation
|
|
527
|
+
};
|
|
528
|
+
this.canvasManager?.updatePolygon(newPolygon);
|
|
529
|
+
this.currentPolygon = newPolygon;
|
|
530
|
+
this.calculateSolarPanelsForPolygon(newPolygon, true);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
calculateSolarPanelsForPolygon(polygon, isFlatRoof) {
|
|
534
|
+
const convertedSolarPanel = {
|
|
535
|
+
...this.solarPanel,
|
|
536
|
+
widthMeters: this.solarPanel.widthMeters / this.pixelInMeters,
|
|
537
|
+
heightMeters: this.solarPanel.heightMeters / this.pixelInMeters,
|
|
538
|
+
};
|
|
539
|
+
const inset = BORDER_INSET / this.pixelInMeters;
|
|
540
|
+
const solarPanels = getOptimalSolarPositionFully(polygon, this.canvasManager.getObstacles(), convertedSolarPanel, polygon.azimuth, inset, polygon.pitch, state.settings.columnSpacing, state.settings.rowSpacing);
|
|
541
|
+
this.canvasManager.setPositionedSolarPanel(polygon.id, solarPanels);
|
|
542
|
+
// Convert PositionedSolarPanel[] to SolarPanelSystemPart format
|
|
543
|
+
const allPositionedPanels = this.canvasManager
|
|
544
|
+
.getAllPositionedSolarPanels();
|
|
545
|
+
this.solarSystem = Object.keys(allPositionedPanels).reduce((acc, polygonId) => {
|
|
546
|
+
acc[polygonId] = {
|
|
547
|
+
numberOfPanels: allPositionedPanels[polygonId].length,
|
|
548
|
+
panelType: this.solarPanel,
|
|
549
|
+
pitch: polygon.pitch,
|
|
550
|
+
azimuth: polygon.azimuth,
|
|
551
|
+
roofArea: polygon.area,
|
|
552
|
+
isFlatRoof: isFlatRoof,
|
|
553
|
+
inverterType: "central",
|
|
554
|
+
};
|
|
555
|
+
return acc;
|
|
556
|
+
}, {});
|
|
557
|
+
}
|
|
558
|
+
handlePitchChange(event) {
|
|
559
|
+
const target = event.target;
|
|
560
|
+
const pitch = parseFloat(target.value);
|
|
561
|
+
if (this.currentPolygon) {
|
|
562
|
+
const newPolygon = {
|
|
563
|
+
...this.currentPolygon,
|
|
564
|
+
pitch: pitch,
|
|
565
|
+
};
|
|
566
|
+
this.canvasManager?.updatePolygon(newPolygon);
|
|
567
|
+
this.currentPolygon = newPolygon;
|
|
568
|
+
}
|
|
569
|
+
if (this.currentPolygon?.type === "roof" &&
|
|
570
|
+
this.canvasManager?.getPositionedSolarPanels(this.currentPolygon.id)) {
|
|
571
|
+
this.calculateSolarPanels();
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
handleAzimuthChange(event) {
|
|
576
|
+
const target = event.target;
|
|
577
|
+
const azimuth = parseFloat(target.value);
|
|
578
|
+
if (this.currentPolygon) {
|
|
579
|
+
const newPolygon = {
|
|
580
|
+
...this.currentPolygon,
|
|
581
|
+
azimuth: azimuth,
|
|
582
|
+
};
|
|
583
|
+
this.canvasManager?.updatePolygon(newPolygon);
|
|
584
|
+
this.currentPolygon = newPolygon;
|
|
585
|
+
}
|
|
586
|
+
if (this.currentPolygon?.type === "roof" &&
|
|
587
|
+
this.canvasManager?.getPositionedSolarPanels(this.currentPolygon.id)) {
|
|
588
|
+
this.calculateSolarPanels();
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
handleToolSelect(tool) {
|
|
593
|
+
if (this.currentPolygon && !this.currentPolygon.closed &&
|
|
594
|
+
this.currentPolygon.points.length > 0) {
|
|
595
|
+
alert("Please close the polygon before selecting a tool");
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.currentTool = tool;
|
|
599
|
+
// Map legacy tools to harmonia-draw tools
|
|
600
|
+
if (this.canvasManager) {
|
|
601
|
+
switch (tool.name) {
|
|
602
|
+
case "roof":
|
|
603
|
+
this.canvasManager.setSelectedTool(Tool.ROOF_POLYGON);
|
|
604
|
+
break;
|
|
605
|
+
case "obstruction":
|
|
606
|
+
this.canvasManager.setSelectedTool(Tool.OBSTRUCTION_POLYGON);
|
|
607
|
+
break;
|
|
608
|
+
case "move":
|
|
609
|
+
this.canvasManager.setSelectedTool(Tool.MOVE);
|
|
610
|
+
break;
|
|
611
|
+
case "markRoofEdge":
|
|
612
|
+
this.canvasManager.setSelectedTool(Tool.MARK_ROOF_EDGE);
|
|
613
|
+
break;
|
|
614
|
+
default:
|
|
615
|
+
// For other tools like delete, etc., we handle them manually
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
handleSettingsClose = () => {
|
|
621
|
+
this.showSettings = false;
|
|
622
|
+
};
|
|
623
|
+
handleSettingsSave = (event) => {
|
|
624
|
+
state.settings = event.detail;
|
|
625
|
+
state.settingsVersion++;
|
|
626
|
+
};
|
|
627
|
+
handleTutorialClose = () => {
|
|
628
|
+
this.showTutorial = false;
|
|
629
|
+
};
|
|
630
|
+
handleMarkEdgeTutorialClose = () => {
|
|
631
|
+
this.showMarkEdgeTutorial = false;
|
|
632
|
+
};
|
|
633
|
+
handleAdditionalToolsTutorialClose = () => {
|
|
634
|
+
this.showAdditionalToolsTutorial = false;
|
|
635
|
+
};
|
|
636
|
+
render() {
|
|
637
|
+
const t = getLanguageStrings(state.settings.language);
|
|
638
|
+
return (h("div", { key: 'deed6c1f74dbf3902ec65c09a05cae5c32fe437f', class: "flex flex-col justify-center items-center w-full h-full gap-4", id: "map-draw" }, this.showTutorial && (h("tutorial-component", { key: 'a76125a68dd04b17429ec16d98357ff20333c313', onClose: this.handleTutorialClose, title: t.mapDraw.tutorial.title, description: t.mapDraw.tutorial.description, videoSource: getAssetPath("./assets/tutorial1.mp4") })), this.showMarkEdgeTutorial && (h("tutorial-component", { key: '366f794b4d41f8d4102a9b27da8cda1f74faa713', onClose: this.handleMarkEdgeTutorialClose, title: t.mapDraw.tutorial.markEdge.title, description: t.mapDraw.tutorial.markEdge
|
|
639
|
+
.description, videoSource: getAssetPath("./assets/tutorial2.mp4") })), this.showAdditionalToolsTutorial && (h("tutorial-component", { key: 'c995cfefb6cedef0adb2702db1074fb158d917f4', onClose: this
|
|
640
|
+
.handleAdditionalToolsTutorialClose, title: t.mapDraw.tutorial.additionalTools.title, description: t.mapDraw.tutorial.additionalTools
|
|
641
|
+
.description, videoSource: getAssetPath("./assets/tutorial3.mp4") })), (state.latitude && state.longitude &&
|
|
642
|
+
this.loadingState === "loading") && (h("div", { key: 'c506d8dd8c598c0ab2e6e358d252d49d527c2eb3', class: "flex items-center justify-center w-full bg-opacity-75 z-20 pt-7 rounded-4xl" }, h("div", { key: 'cfeb62d4b47fe6eebe7c933532b0ee848a490221', class: "animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-secondary" }))), h("div", { key: 'e501cff31404ec0a6689dd33a8516cfbb44ea7b3', class: "flex items-start justify-center h-full w-full bg-primary rounded-4xl" }, h("div", { key: '0e34861a06dd7bc66eb098fdacfcc9f3f9e52de2', class: "relative h-full flex items-center justify-center w-full rounded-4xl bg-secondary", style: {
|
|
643
|
+
aspectRatio: this.rgbTiff
|
|
644
|
+
? `${this.rgbTiff.width}/${this.rgbTiff.height}`
|
|
645
|
+
: "1/1",
|
|
646
|
+
} }, h("canvas", { key: '25c2a1e181f62ac8114b5e0dbb75176cf6f1eac7', ref: (el) => this.canvasElement = el, class: "absolute top-0 left-0 w-full h-full rounded-4xl", id: "map-draw-canvas", style: {
|
|
647
|
+
cursor: this.currentTool.cursor,
|
|
648
|
+
} }), h("canvas", { key: 'aed95e405efa0feb1ca742416ded22d2b59edbf4', ref: (el) => this.polygonCanvas = el, class: "absolute top-0 left-0 w-full h-full rounded-4xl", style: {
|
|
649
|
+
cursor: this.currentTool.cursor,
|
|
650
|
+
} }))), h("div", { key: 'd60deae8244d9eb37d5c52f690acd5f77ba1f08b', class: "w-full" }, h("tool-box", { key: 'eb88b074bd5dbb8fe1879942001c08bb5c9bb400', currentTool: this.currentTool, onToolSelect: (tool) => this.handleToolSelect(tool), undoCallback: () => this.undo() })), h("div", { key: '4b401da3fd5592f555de4d0371a81f0b1e03e61f', class: "w-full" }, h("polygon-information", { key: '5e9351c5cb88cee4bdc7ae5729741df4a95cf1bf', currentPolygon: this.currentPolygon, numberOfPanels: this.currentPolygon
|
|
651
|
+
? this
|
|
652
|
+
.solarSystem[this.currentPolygon.id]
|
|
653
|
+
?.numberOfPanels
|
|
654
|
+
: undefined, handleAzimuthChange: (event) => this.handleAzimuthChange(event), handlePitchChange: (event) => this.handlePitchChange(event), calculateSolarPanels: () => this.calculateSolarPanels(), markAsFlatRoof: () => this.markAsFlatRoof(), currentTool: this.currentTool.name })), h("div", { key: '94745e50a078e9b89e10ad70e75d2e63f12314f4', class: "w-full" }, h("solar-system-form", { key: '3f039715b008f5861f404ba547217dc43cf82805', systemConfigs: this.solarSystem, polygons: this.canvasManager?.getPolygons(), roofCanvas: this.canvasElement, polygonCanvas: this.polygonCanvas })), this.showSettings && (h("settings-modal", { key: '93aacedcce3f43792c570579ff7b58d49ab9c822', settings: state.settings, onClose: this.handleSettingsClose, onSave: this.handleSettingsSave }))));
|
|
655
|
+
}
|
|
656
|
+
static get is() { return "map-draw"; }
|
|
657
|
+
static get originalStyleUrls() {
|
|
658
|
+
return {
|
|
659
|
+
"$": ["../../output.css"]
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
static get styleUrls() {
|
|
663
|
+
return {
|
|
664
|
+
"$": ["../../output.css"]
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
static get properties() {
|
|
668
|
+
return {
|
|
669
|
+
"apiKey": {
|
|
670
|
+
"type": "string",
|
|
671
|
+
"attribute": "api-key",
|
|
672
|
+
"mutable": false,
|
|
673
|
+
"complexType": {
|
|
674
|
+
"original": "string",
|
|
675
|
+
"resolved": "string",
|
|
676
|
+
"references": {}
|
|
677
|
+
},
|
|
678
|
+
"required": false,
|
|
679
|
+
"optional": false,
|
|
680
|
+
"docs": {
|
|
681
|
+
"tags": [],
|
|
682
|
+
"text": ""
|
|
683
|
+
},
|
|
684
|
+
"getter": false,
|
|
685
|
+
"setter": false,
|
|
686
|
+
"reflect": false,
|
|
687
|
+
"defaultValue": "\"\""
|
|
688
|
+
},
|
|
689
|
+
"config": {
|
|
690
|
+
"type": "unknown",
|
|
691
|
+
"attribute": "config",
|
|
692
|
+
"mutable": false,
|
|
693
|
+
"complexType": {
|
|
694
|
+
"original": "SolarExpertConfig",
|
|
695
|
+
"resolved": "SolarExpertConfig",
|
|
696
|
+
"references": {
|
|
697
|
+
"SolarExpertConfig": {
|
|
698
|
+
"location": "import",
|
|
699
|
+
"path": "../../config",
|
|
700
|
+
"id": "src/config.ts::SolarExpertConfig"
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
"required": false,
|
|
705
|
+
"optional": false,
|
|
706
|
+
"docs": {
|
|
707
|
+
"tags": [],
|
|
708
|
+
"text": ""
|
|
709
|
+
},
|
|
710
|
+
"getter": false,
|
|
711
|
+
"setter": false,
|
|
712
|
+
"defaultValue": "DEFAULT_SOLAR_EXPERT_CONFIG"
|
|
713
|
+
},
|
|
714
|
+
"solarPanel": {
|
|
715
|
+
"type": "unknown",
|
|
716
|
+
"attribute": "solar-panel",
|
|
717
|
+
"mutable": false,
|
|
718
|
+
"complexType": {
|
|
719
|
+
"original": "SolarPanelType",
|
|
720
|
+
"resolved": "SolarPanelType",
|
|
721
|
+
"references": {
|
|
722
|
+
"SolarPanelType": {
|
|
723
|
+
"location": "import",
|
|
724
|
+
"path": "harmonia-types",
|
|
725
|
+
"id": "../../../harmonia/packages/harmonia-types/dist/index.d.ts::SolarPanelType"
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"required": false,
|
|
730
|
+
"optional": false,
|
|
731
|
+
"docs": {
|
|
732
|
+
"tags": [],
|
|
733
|
+
"text": ""
|
|
734
|
+
},
|
|
735
|
+
"getter": false,
|
|
736
|
+
"setter": false,
|
|
737
|
+
"defaultValue": "DEFAULT_SOLAR_PANEL_TYPE"
|
|
738
|
+
},
|
|
739
|
+
"enableSettings": {
|
|
740
|
+
"type": "boolean",
|
|
741
|
+
"attribute": "enable-settings",
|
|
742
|
+
"mutable": false,
|
|
743
|
+
"complexType": {
|
|
744
|
+
"original": "boolean",
|
|
745
|
+
"resolved": "boolean",
|
|
746
|
+
"references": {}
|
|
747
|
+
},
|
|
748
|
+
"required": false,
|
|
749
|
+
"optional": false,
|
|
750
|
+
"docs": {
|
|
751
|
+
"tags": [],
|
|
752
|
+
"text": ""
|
|
753
|
+
},
|
|
754
|
+
"getter": false,
|
|
755
|
+
"setter": false,
|
|
756
|
+
"reflect": false,
|
|
757
|
+
"defaultValue": "false"
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
static get states() {
|
|
762
|
+
return {
|
|
763
|
+
"showInstructions": {},
|
|
764
|
+
"showSettings": {},
|
|
765
|
+
"showTutorial": {},
|
|
766
|
+
"showMarkEdgeTutorial": {},
|
|
767
|
+
"showAdditionalToolsTutorial": {},
|
|
768
|
+
"additionalToolsTutorialShown": {},
|
|
769
|
+
"firstPolygonClosed": {},
|
|
770
|
+
"zoom": {},
|
|
771
|
+
"loadingState": {},
|
|
772
|
+
"buildingInsightsLoaded": {},
|
|
773
|
+
"buildingImagesLoaded": {},
|
|
774
|
+
"rgbTiff": {},
|
|
775
|
+
"currentTool": {},
|
|
776
|
+
"buildingInsights": {},
|
|
777
|
+
"pixelInMeters": {},
|
|
778
|
+
"interaction": {},
|
|
779
|
+
"currentPolygon": {},
|
|
780
|
+
"solarSystem": {}
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
static get elementRef() { return "el"; }
|
|
784
|
+
static get watchers() {
|
|
785
|
+
return [{
|
|
786
|
+
"propName": "rgbTiff",
|
|
787
|
+
"methodName": "setupCanvasManager"
|
|
788
|
+
}, {
|
|
789
|
+
"propName": "rgbTiff",
|
|
790
|
+
"methodName": "drawMap"
|
|
791
|
+
}, {
|
|
792
|
+
"propName": "canvasElement",
|
|
793
|
+
"methodName": "drawMap"
|
|
794
|
+
}];
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
//# sourceMappingURL=map-draw.js.map
|