blue-chestnut-solar-expert 0.0.67 → 0.0.68
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/stencil-library/assets/tutorial4.mp4 +0 -0
- package/dist/{collection/config.js → stencil-library/config-CWfV1nKn.js} +10 -4
- package/dist/stencil-library/config-CWfV1nKn.js.map +1 -0
- package/dist/stencil-library/constants-hboFofU4.js +1522 -0
- package/dist/stencil-library/constants-hboFofU4.js.map +1 -0
- package/dist/stencil-library/decoder-DNOvLSaS.js +39 -0
- package/dist/stencil-library/decoder-DNOvLSaS.js.map +1 -0
- package/dist/stencil-library/deflate-0Vdd6-55.js +21 -0
- package/dist/{esm/deflate-DHgPf9CO.js.map → stencil-library/deflate-0Vdd6-55.js.map} +1 -1
- package/dist/stencil-library/eraser-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-CL74Q4VR.js → stencil-library/eraser-icon.entry.js} +9 -27
- package/dist/stencil-library/eraser-icon.entry.js.map +1 -0
- package/dist/stencil-library/house-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-D8w3bTPO.js → stencil-library/house-icon.entry.js} +9 -27
- package/dist/stencil-library/house-icon.entry.js.map +1 -0
- package/dist/{components/loading-widget.js → stencil-library/icon-selector.entry.esm.js.map} +1 -38
- package/dist/stencil-library/icon-selector.entry.js +47 -0
- package/dist/stencil-library/icon-selector.entry.js.map +1 -0
- package/dist/stencil-library/index-CChkgM3J.js +414 -0
- package/dist/stencil-library/index-CChkgM3J.js.map +1 -0
- package/dist/stencil-library/index-ICfDNUMe.js +4172 -0
- package/dist/stencil-library/index-ICfDNUMe.js.map +1 -0
- package/dist/stencil-library/index.esm.js +13 -1
- package/dist/stencil-library/index.esm.js.map +1 -1
- package/dist/{esm/jpeg-CJLm1GkA.js → stencil-library/jpeg-Dd5nnHR5.js} +11 -3
- package/dist/stencil-library/jpeg-Dd5nnHR5.js.map +1 -0
- package/dist/{components/p-BcVa4_YP.js → stencil-library/lerc-7W4E8EBs.js} +27 -1981
- package/dist/stencil-library/lerc-7W4E8EBs.js.map +1 -0
- package/dist/{esm → stencil-library}/loading-widget.entry.js +3 -3
- package/dist/{components/p-P28NBglk.js.map → stencil-library/loading-widget.entry.js.map} +1 -1
- package/dist/{esm/lzw-DaOzWJUD.js → stencil-library/lzw--P4c0ZHH.js} +10 -4
- package/dist/stencil-library/lzw--P4c0ZHH.js.map +1 -0
- package/dist/stencil-library/map-draw-Cx9WZoKH.js +25567 -0
- package/dist/stencil-library/map-draw-Cx9WZoKH.js.map +1 -0
- package/dist/stencil-library/map-draw.entry.esm.js.map +1 -0
- package/dist/stencil-library/map-draw.entry.js +12 -0
- package/dist/stencil-library/map-draw.entry.js.map +1 -0
- package/dist/stencil-library/map-selector.entry.esm.js.map +1 -0
- package/dist/{components/p-C5QieOat.js → stencil-library/map-selector.entry.js} +164 -96
- package/dist/stencil-library/map-selector.entry.js.map +1 -0
- package/dist/{components/loading-widget.js.map → stencil-library/marker-icon.entry.esm.js.map} +1 -1
- package/dist/{components/p-Umz6nJIv.js → stencil-library/marker-icon.entry.js} +9 -27
- package/dist/stencil-library/marker-icon.entry.js.map +1 -0
- package/dist/stencil-library/move-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-FdEV2qPo.js → stencil-library/move-icon.entry.js} +9 -27
- package/dist/stencil-library/move-icon.entry.js.map +1 -0
- package/dist/{components/p-DTXeHbuh.js.map → stencil-library/octagon-minus-icon.entry.esm.js.map} +1 -1
- package/dist/{components/p-BJLO76Yi.js → stencil-library/octagon-minus-icon.entry.js} +9 -27
- package/dist/stencil-library/octagon-minus-icon.entry.js.map +1 -0
- package/dist/{components/p-ByX6QP-E.js → stencil-library/packbits-X3R_utTs.js} +9 -3
- package/dist/stencil-library/packbits-X3R_utTs.js.map +1 -0
- package/dist/stencil-library/pako.esm-CPorU236.js +6881 -0
- package/dist/{esm/pako.esm-B5WTRCh8.js.map → stencil-library/pako.esm-CPorU236.js.map} +1 -1
- package/dist/{components/p-B4X-RCW0.js.map → stencil-library/polygon-buttons.entry.esm.js.map} +1 -1
- package/dist/{cjs/loading-widget.cjs.entry.js → stencil-library/polygon-buttons.entry.js} +16 -10
- package/dist/stencil-library/polygon-buttons.entry.js.map +1 -0
- package/dist/{cjs/loading-widget.cjs.entry.js.map → stencil-library/polygon-information.entry.esm.js.map} +1 -1
- package/dist/{components/p-BFJHTJPM.js → stencil-library/polygon-information.entry.js} +13 -70
- package/dist/stencil-library/polygon-information.entry.js.map +1 -0
- package/dist/stencil-library/raw-BxukYehy.js +20 -0
- package/dist/stencil-library/raw-BxukYehy.js.map +1 -0
- package/dist/stencil-library/search-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-DBwr8xSB.js → stencil-library/search-icon.entry.js} +9 -27
- package/dist/stencil-library/{p-ab0f2031.entry.js → search-icon.entry.js.map} +1 -2
- package/dist/stencil-library/settings-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-DTXeHbuh.js → stencil-library/settings-icon.entry.js} +9 -27
- package/dist/stencil-library/settings-icon.entry.js.map +1 -0
- package/dist/stencil-library/settings-modal.entry.esm.js.map +1 -0
- package/dist/{components/p-B4X-RCW0.js → stencil-library/settings-modal.entry.js} +20 -38
- package/dist/stencil-library/settings-modal.entry.js.map +1 -0
- package/dist/stencil-library/solar-expert.entry.esm.js.map +1 -0
- package/dist/{components/solar-expert.js → stencil-library/solar-expert.entry.js} +14 -150
- package/dist/{components/p-i1uLweD0.js.map → stencil-library/solar-expert.entry.js.map} +1 -1
- package/dist/stencil-library/solar-system-form.entry.esm.js.map +1 -0
- package/dist/stencil-library/solar-system-form.entry.js +553 -0
- package/dist/stencil-library/solar-system-form.entry.js.map +1 -0
- package/dist/stencil-library/stencil-library.esm.js +52 -1
- package/dist/stencil-library/stencil-library.esm.js.map +1 -1
- package/dist/{components/p-eDwaXClX.js → stencil-library/store-CcqrFuBK.js} +24 -3
- package/dist/stencil-library/store-CcqrFuBK.js.map +1 -0
- package/dist/stencil-library/toast-notification.entry.esm.js.map +1 -0
- package/dist/{components/p-P28NBglk.js → stencil-library/toast-notification.entry.js} +9 -30
- package/dist/stencil-library/toast-notification.entry.js.map +1 -0
- package/dist/stencil-library/tool-box.entry.esm.js.map +1 -0
- package/dist/{components/p-i1uLweD0.js → stencil-library/tool-box.entry.js} +27 -35
- package/dist/stencil-library/tool-box.entry.js.map +1 -0
- package/dist/{collection/utils/render/tools.js → stencil-library/tools-BNYKV5H5.js} +14 -8
- package/dist/stencil-library/tools-BNYKV5H5.js.map +1 -0
- package/dist/stencil-library/tutorial-component.entry.esm.js.map +1 -0
- package/dist/{components/p-Dzl6kfPI.js → stencil-library/tutorial-component.entry.js} +42 -35
- package/dist/stencil-library/tutorial-component.entry.js.map +1 -0
- package/dist/stencil-library/undo-icon.entry.esm.js.map +1 -0
- package/dist/{components/p-waOPoUcA.js → stencil-library/undo-icon.entry.js} +9 -27
- package/dist/stencil-library/undo-icon.entry.js.map +1 -0
- package/dist/{collection/utils/utils.js → stencil-library/utils-BCUZxI9u.js} +9 -3
- package/dist/stencil-library/utils-BCUZxI9u.js.map +1 -0
- package/dist/{esm/webimage-BiHardhv.js → stencil-library/webimage-CBrfoxHM.js} +9 -3
- package/dist/{esm/webimage-BiHardhv.js.map → stencil-library/webimage-CBrfoxHM.js.map} +1 -1
- package/dist/types/components/map-draw/map-draw.d.ts +5 -0
- package/dist/types/components/map-draw/tutorial-component.d.ts +7 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/types/lang.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-I24yU8do.js +0 -10
- package/dist/cjs/app-globals-I24yU8do.js.map +0 -1
- package/dist/cjs/basedecoder-CQuzfSgz.js +0 -116
- package/dist/cjs/basedecoder-CQuzfSgz.js.map +0 -1
- package/dist/cjs/deflate-AzGzQSW2.js +0 -17
- package/dist/cjs/deflate-AzGzQSW2.js.map +0 -1
- package/dist/cjs/eraser-icon_19.cjs.entry.js +0 -31
- package/dist/cjs/eraser-icon_19.cjs.entry.js.map +0 -1
- package/dist/cjs/index-HgRXF6kp.js +0 -1470
- package/dist/cjs/index-HgRXF6kp.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -7
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/jpeg-Bx3bTm32.js +0 -904
- package/dist/cjs/jpeg-Bx3bTm32.js.map +0 -1
- package/dist/cjs/lerc-v64rYVDy.js +0 -4427
- package/dist/cjs/lerc-v64rYVDy.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -18
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loading-widget.entry.cjs.js.map +0 -1
- package/dist/cjs/lzw-BmFug486.js +0 -140
- package/dist/cjs/lzw-BmFug486.js.map +0 -1
- package/dist/cjs/packbits-CYx9fB0v.js +0 -35
- package/dist/cjs/packbits-CYx9fB0v.js.map +0 -1
- package/dist/cjs/pako.esm-0mKI6Jik.js +0 -3243
- package/dist/cjs/pako.esm-0mKI6Jik.js.map +0 -1
- package/dist/cjs/raw-DC82yoyr.js +0 -16
- package/dist/cjs/raw-DC82yoyr.js.map +0 -1
- package/dist/cjs/stencil-library.cjs.js +0 -30
- package/dist/cjs/stencil-library.cjs.js.map +0 -1
- package/dist/cjs/webimage-Dc0t2xAB.js +0 -49
- package/dist/cjs/webimage-Dc0t2xAB.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -31
- package/dist/collection/components/icons/eraser.js +0 -64
- package/dist/collection/components/icons/eraser.js.map +0 -1
- package/dist/collection/components/icons/house.js +0 -64
- package/dist/collection/components/icons/house.js.map +0 -1
- package/dist/collection/components/icons/icon.js +0 -108
- package/dist/collection/components/icons/icon.js.map +0 -1
- package/dist/collection/components/icons/marker.js +0 -64
- package/dist/collection/components/icons/marker.js.map +0 -1
- package/dist/collection/components/icons/move.js +0 -64
- package/dist/collection/components/icons/move.js.map +0 -1
- package/dist/collection/components/icons/octagonMinus.js +0 -64
- package/dist/collection/components/icons/octagonMinus.js.map +0 -1
- package/dist/collection/components/icons/search.js +0 -64
- package/dist/collection/components/icons/search.js.map +0 -1
- package/dist/collection/components/icons/settings.js +0 -64
- package/dist/collection/components/icons/settings.js.map +0 -1
- package/dist/collection/components/icons/undo.js +0 -64
- package/dist/collection/components/icons/undo.js.map +0 -1
- package/dist/collection/components/map-draw/map-draw.js +0 -795
- package/dist/collection/components/map-draw/map-draw.js.map +0 -1
- package/dist/collection/components/map-draw/map-selector.js +0 -246
- package/dist/collection/components/map-draw/map-selector.js.map +0 -1
- package/dist/collection/components/map-draw/polygon-buttons.js +0 -86
- package/dist/collection/components/map-draw/polygon-buttons.js.map +0 -1
- package/dist/collection/components/map-draw/polygon-information.js +0 -211
- package/dist/collection/components/map-draw/polygon-information.js.map +0 -1
- package/dist/collection/components/map-draw/tool-box.js +0 -108
- package/dist/collection/components/map-draw/tool-box.js.map +0 -1
- package/dist/collection/components/map-draw/tutorial-component.js +0 -151
- package/dist/collection/components/map-draw/tutorial-component.js.map +0 -1
- package/dist/collection/components/settings/settings.js +0 -127
- package/dist/collection/components/settings/settings.js.map +0 -1
- package/dist/collection/components/solar-expert/solar-expert.js +0 -241
- package/dist/collection/components/solar-expert/solar-expert.js.map +0 -1
- package/dist/collection/components/solar-system-form/solar-system-form.js +0 -596
- package/dist/collection/components/solar-system-form/solar-system-form.js.map +0 -1
- package/dist/collection/components/widgets/loading-widget.js +0 -18
- package/dist/collection/components/widgets/loading-widget.js.map +0 -1
- package/dist/collection/components/widgets/toast-notification.js +0 -133
- package/dist/collection/components/widgets/toast-notification.js.map +0 -1
- package/dist/collection/config.js.map +0 -1
- package/dist/collection/constants.js +0 -90
- package/dist/collection/constants.js.map +0 -1
- package/dist/collection/index.js +0 -2
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/output.css +0 -1126
- package/dist/collection/store.js +0 -43
- package/dist/collection/store.js.map +0 -1
- package/dist/collection/types/lang.js +0 -2
- package/dist/collection/types/lang.js.map +0 -1
- package/dist/collection/types/shapes.js +0 -2
- package/dist/collection/types/shapes.js.map +0 -1
- package/dist/collection/utils/api.js +0 -93
- package/dist/collection/utils/api.js.map +0 -1
- package/dist/collection/utils/images.js +0 -2
- package/dist/collection/utils/images.js.map +0 -1
- package/dist/collection/utils/lang/english.js +0 -157
- package/dist/collection/utils/lang/english.js.map +0 -1
- package/dist/collection/utils/lang/general.js +0 -30
- package/dist/collection/utils/lang/general.js.map +0 -1
- package/dist/collection/utils/lang/german.js +0 -157
- package/dist/collection/utils/lang/german.js.map +0 -1
- package/dist/collection/utils/lang/spanish.js +0 -157
- package/dist/collection/utils/lang/spanish.js.map +0 -1
- package/dist/collection/utils/render/tools.js.map +0 -1
- package/dist/collection/utils/solar.js +0 -136
- package/dist/collection/utils/solar.js.map +0 -1
- package/dist/collection/utils/theme.js +0 -97
- package/dist/collection/utils/theme.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/eraser-icon.js +0 -11
- package/dist/components/eraser-icon.js.map +0 -1
- package/dist/components/house-icon.js +0 -11
- package/dist/components/house-icon.js.map +0 -1
- package/dist/components/icon-selector.js +0 -11
- package/dist/components/icon-selector.js.map +0 -1
- package/dist/components/index.js +0 -1269
- package/dist/components/index.js.map +0 -1
- package/dist/components/map-draw.js +0 -11
- package/dist/components/map-draw.js.map +0 -1
- package/dist/components/map-selector.js +0 -11
- package/dist/components/map-selector.js.map +0 -1
- package/dist/components/marker-icon.js +0 -11
- package/dist/components/marker-icon.js.map +0 -1
- package/dist/components/move-icon.js +0 -11
- package/dist/components/move-icon.js.map +0 -1
- package/dist/components/octagon-minus-icon.js +0 -11
- package/dist/components/octagon-minus-icon.js.map +0 -1
- package/dist/components/p-B54Ul0nf.js +0 -15
- package/dist/components/p-B54Ul0nf.js.map +0 -1
- package/dist/components/p-B5WTRCh8.js +0 -3241
- package/dist/components/p-B5WTRCh8.js.map +0 -1
- package/dist/components/p-BFJHTJPM.js.map +0 -1
- package/dist/components/p-BGoSj_DR.js +0 -902
- package/dist/components/p-BGoSj_DR.js.map +0 -1
- package/dist/components/p-BJLO76Yi.js.map +0 -1
- package/dist/components/p-BcVa4_YP.js.map +0 -1
- package/dist/components/p-Bopprtc7.js +0 -623
- package/dist/components/p-Bopprtc7.js.map +0 -1
- package/dist/components/p-ByX6QP-E.js.map +0 -1
- package/dist/components/p-C5QieOat.js.map +0 -1
- package/dist/components/p-CL74Q4VR.js.map +0 -1
- package/dist/components/p-Cgchl6bA.js +0 -47
- package/dist/components/p-Cgchl6bA.js.map +0 -1
- package/dist/components/p-D8w3bTPO.js.map +0 -1
- package/dist/components/p-DBwr8xSB.js.map +0 -1
- package/dist/components/p-DWirjxpO.js +0 -163
- package/dist/components/p-DWirjxpO.js.map +0 -1
- package/dist/components/p-DlNHVTGB.js +0 -15949
- package/dist/components/p-DlNHVTGB.js.map +0 -1
- package/dist/components/p-Dzl6kfPI.js.map +0 -1
- package/dist/components/p-FdEV2qPo.js.map +0 -1
- package/dist/components/p-PkMjF2if.js +0 -1985
- package/dist/components/p-PkMjF2if.js.map +0 -1
- package/dist/components/p-Umz6nJIv.js.map +0 -1
- package/dist/components/p-WmcSqXD8.js +0 -14
- package/dist/components/p-WmcSqXD8.js.map +0 -1
- package/dist/components/p-eDwaXClX.js.map +0 -1
- package/dist/components/p-j-vOrhhh.js +0 -114
- package/dist/components/p-j-vOrhhh.js.map +0 -1
- package/dist/components/p-q8auDIJ2.js +0 -138
- package/dist/components/p-q8auDIJ2.js.map +0 -1
- package/dist/components/p-waOPoUcA.js.map +0 -1
- package/dist/components/polygon-buttons.js +0 -11
- package/dist/components/polygon-buttons.js.map +0 -1
- package/dist/components/polygon-information.js +0 -11
- package/dist/components/polygon-information.js.map +0 -1
- package/dist/components/search-icon.js +0 -11
- package/dist/components/search-icon.js.map +0 -1
- package/dist/components/settings-icon.js +0 -11
- package/dist/components/settings-icon.js.map +0 -1
- package/dist/components/settings-modal.js +0 -11
- package/dist/components/settings-modal.js.map +0 -1
- package/dist/components/solar-expert.js.map +0 -1
- package/dist/components/solar-system-form.js +0 -11
- package/dist/components/solar-system-form.js.map +0 -1
- package/dist/components/toast-notification.js +0 -11
- package/dist/components/toast-notification.js.map +0 -1
- package/dist/components/tool-box.js +0 -11
- package/dist/components/tool-box.js.map +0 -1
- package/dist/components/tutorial-component.js +0 -11
- package/dist/components/tutorial-component.js.map +0 -1
- package/dist/components/undo-icon.js +0 -11
- package/dist/components/undo-icon.js.map +0 -1
- package/dist/esm/basedecoder-j-vOrhhh.js +0 -114
- package/dist/esm/basedecoder-j-vOrhhh.js.map +0 -1
- package/dist/esm/deflate-DHgPf9CO.js +0 -15
- package/dist/esm/eraser-icon_19.entry.js +0 -7
- package/dist/esm/eraser-icon_19.entry.js.map +0 -1
- package/dist/esm/index-C2JRBB5c.js +0 -1458
- package/dist/esm/index-C2JRBB5c.js.map +0 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/jpeg-CJLm1GkA.js.map +0 -1
- package/dist/esm/lerc-CAiDQjTu.js +0 -4424
- package/dist/esm/lerc-CAiDQjTu.js.map +0 -1
- package/dist/esm/loader.js +0 -16
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loading-widget.entry.js.map +0 -1
- package/dist/esm/lzw-DaOzWJUD.js.map +0 -1
- package/dist/esm/packbits-CZPyx9kx.js +0 -33
- package/dist/esm/packbits-CZPyx9kx.js.map +0 -1
- package/dist/esm/pako.esm-B5WTRCh8.js +0 -3241
- package/dist/esm/raw-pqeeWc2_.js +0 -14
- package/dist/esm/raw-pqeeWc2_.js.map +0 -1
- package/dist/esm/stencil-library.js +0 -26
- package/dist/esm/stencil-library.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil-library/p-B54Ul0nf.js +0 -2
- package/dist/stencil-library/p-B54Ul0nf.js.map +0 -1
- package/dist/stencil-library/p-B5WTRCh8.js +0 -2
- package/dist/stencil-library/p-B5WTRCh8.js.map +0 -1
- package/dist/stencil-library/p-BBtmpSUK.js +0 -2
- package/dist/stencil-library/p-BBtmpSUK.js.map +0 -1
- package/dist/stencil-library/p-BGoSj_DR.js +0 -2
- package/dist/stencil-library/p-BGoSj_DR.js.map +0 -1
- package/dist/stencil-library/p-ByX6QP-E.js +0 -2
- package/dist/stencil-library/p-ByX6QP-E.js.map +0 -1
- package/dist/stencil-library/p-C2JRBB5c.js +0 -3
- package/dist/stencil-library/p-C2JRBB5c.js.map +0 -1
- package/dist/stencil-library/p-CX8V3eiN.js +0 -2
- package/dist/stencil-library/p-CX8V3eiN.js.map +0 -1
- package/dist/stencil-library/p-Cgchl6bA.js +0 -2
- package/dist/stencil-library/p-Cgchl6bA.js.map +0 -1
- package/dist/stencil-library/p-WmcSqXD8.js +0 -2
- package/dist/stencil-library/p-WmcSqXD8.js.map +0 -1
- package/dist/stencil-library/p-ab0f2031.entry.js.map +0 -1
- package/dist/stencil-library/p-cAuhy_jT.js +0 -10
- package/dist/stencil-library/p-cAuhy_jT.js.map +0 -1
- package/dist/stencil-library/p-e7b94dbb.entry.js +0 -2
- package/dist/stencil-library/p-e7b94dbb.entry.js.map +0 -1
- package/dist/stencil-library/p-j-vOrhhh.js +0 -2
- package/dist/stencil-library/p-j-vOrhhh.js.map +0 -1
- package/dist/stencil-library/p-q8auDIJ2.js +0 -2
- package/dist/stencil-library/p-q8auDIJ2.js.map +0 -1
- /package/dist/{esm → stencil-library}/app-globals-CX8V3eiN.js +0 -0
- /package/dist/{esm → stencil-library}/app-globals-CX8V3eiN.js.map +0 -0
|
@@ -0,0 +1,1522 @@
|
|
|
1
|
+
|
|
2
|
+
if (typeof global === "undefined") { var global = globalThis || window || self; }
|
|
3
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
+
|
|
5
|
+
function getDefaultExportFromCjs (x) {
|
|
6
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
10
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
14
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getAugmentedNamespace(n) {
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
|
19
|
+
var f = n.default;
|
|
20
|
+
if (typeof f == "function") {
|
|
21
|
+
var a = function a () {
|
|
22
|
+
if (this instanceof a) {
|
|
23
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
24
|
+
}
|
|
25
|
+
return f.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
a.prototype = f.prototype;
|
|
28
|
+
} else a = {};
|
|
29
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
30
|
+
Object.keys(n).forEach(function (k) {
|
|
31
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
32
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return n[k];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return a;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var dist$1 = {};
|
|
43
|
+
|
|
44
|
+
var geometry = {};
|
|
45
|
+
|
|
46
|
+
var gridMatch = {};
|
|
47
|
+
|
|
48
|
+
var dist = {};
|
|
49
|
+
|
|
50
|
+
var shapes = {};
|
|
51
|
+
|
|
52
|
+
var polygon = {};
|
|
53
|
+
|
|
54
|
+
var hasRequiredPolygon;
|
|
55
|
+
|
|
56
|
+
function requirePolygon () {
|
|
57
|
+
if (hasRequiredPolygon) return polygon;
|
|
58
|
+
hasRequiredPolygon = 1;
|
|
59
|
+
"use strict";
|
|
60
|
+
Object.defineProperty(polygon, "__esModule", { value: true });
|
|
61
|
+
polygon.PolygonType = polygon.Point = void 0;
|
|
62
|
+
class Point {
|
|
63
|
+
constructor(x, y) {
|
|
64
|
+
this.x = x;
|
|
65
|
+
this.y = y;
|
|
66
|
+
}
|
|
67
|
+
equals(other) {
|
|
68
|
+
return this.x === other.x && this.y === other.y;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
polygon.Point = Point;
|
|
72
|
+
var PolygonType;
|
|
73
|
+
(function (PolygonType) {
|
|
74
|
+
PolygonType["ROOF"] = "roof";
|
|
75
|
+
PolygonType["OBSTRUCTION"] = "obstruction";
|
|
76
|
+
})(PolygonType || (polygon.PolygonType = PolygonType = {}));
|
|
77
|
+
|
|
78
|
+
return polygon;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var utils$1 = {};
|
|
82
|
+
|
|
83
|
+
var hasRequiredUtils$1;
|
|
84
|
+
|
|
85
|
+
function requireUtils$1 () {
|
|
86
|
+
if (hasRequiredUtils$1) return utils$1;
|
|
87
|
+
hasRequiredUtils$1 = 1;
|
|
88
|
+
"use strict";
|
|
89
|
+
Object.defineProperty(utils$1, "__esModule", { value: true });
|
|
90
|
+
utils$1.isPointInPolygon = isPointInPolygon;
|
|
91
|
+
utils$1.isPointOnBorder = isPointOnBorder;
|
|
92
|
+
function isPointInPolygon(point, polygon) {
|
|
93
|
+
if (!polygon.closed || polygon.points.length < 3)
|
|
94
|
+
return false;
|
|
95
|
+
const num_vertices = polygon.points.length;
|
|
96
|
+
const x = point.x;
|
|
97
|
+
const y = point.y;
|
|
98
|
+
let inside = false;
|
|
99
|
+
let p1 = polygon.points[0];
|
|
100
|
+
let p2;
|
|
101
|
+
for (let i = 1; i <= num_vertices; i++) {
|
|
102
|
+
p2 = polygon.points[i % num_vertices];
|
|
103
|
+
if (y > Math.min(p1.y, p2.y)) {
|
|
104
|
+
if (y <= Math.max(p1.y, p2.y)) {
|
|
105
|
+
if (x <= Math.max(p1.x, p2.x)) {
|
|
106
|
+
const x_intersection = ((y - p1.y) * (p2.x - p1.x)) / (p2.y - p1.y) + p1.x;
|
|
107
|
+
if (p1.x === p2.x || x <= x_intersection) {
|
|
108
|
+
inside = !inside;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
p1 = p2;
|
|
114
|
+
}
|
|
115
|
+
return inside;
|
|
116
|
+
}
|
|
117
|
+
function isPointOnBorder(point, polygon) {
|
|
118
|
+
if (!polygon.closed || polygon.points.length < 3)
|
|
119
|
+
return false;
|
|
120
|
+
const x = point.x;
|
|
121
|
+
const y = point.y;
|
|
122
|
+
for (let i = 0; i < polygon.points.length; i++) {
|
|
123
|
+
const p1 = polygon.points[i];
|
|
124
|
+
const p2 = polygon.points[(i + 1) % polygon.points.length];
|
|
125
|
+
const distance = Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
|
|
126
|
+
const distanceToPoint = Math.sqrt(Math.pow(p1.x - x, 2) + Math.pow(p1.y - y, 2));
|
|
127
|
+
const distanceFromPoint = Math.sqrt(Math.pow(p2.x - x, 2) + Math.pow(p2.y - y, 2));
|
|
128
|
+
if (distance === distanceToPoint + distanceFromPoint) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return utils$1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var hasRequiredShapes;
|
|
139
|
+
|
|
140
|
+
function requireShapes () {
|
|
141
|
+
if (hasRequiredShapes) return shapes;
|
|
142
|
+
hasRequiredShapes = 1;
|
|
143
|
+
(function (exports) {
|
|
144
|
+
"use strict";
|
|
145
|
+
var __createBinding = (shapes && shapes.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
146
|
+
if (k2 === undefined) k2 = k;
|
|
147
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
148
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
149
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
150
|
+
}
|
|
151
|
+
Object.defineProperty(o, k2, desc);
|
|
152
|
+
}) : (function(o, m, k, k2) {
|
|
153
|
+
if (k2 === undefined) k2 = k;
|
|
154
|
+
o[k2] = m[k];
|
|
155
|
+
}));
|
|
156
|
+
var __exportStar = (shapes && shapes.__exportStar) || function(m, exports) {
|
|
157
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
158
|
+
};
|
|
159
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
160
|
+
__exportStar(requirePolygon(), exports);
|
|
161
|
+
__exportStar(requireUtils$1(), exports);
|
|
162
|
+
|
|
163
|
+
} (shapes));
|
|
164
|
+
return shapes;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
var solar = {};
|
|
168
|
+
|
|
169
|
+
var location = {};
|
|
170
|
+
|
|
171
|
+
var hasRequiredLocation;
|
|
172
|
+
|
|
173
|
+
function requireLocation () {
|
|
174
|
+
if (hasRequiredLocation) return location;
|
|
175
|
+
hasRequiredLocation = 1;
|
|
176
|
+
"use strict";
|
|
177
|
+
Object.defineProperty(location, "__esModule", { value: true });
|
|
178
|
+
|
|
179
|
+
return location;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var solarPanel = {};
|
|
183
|
+
|
|
184
|
+
var hasRequiredSolarPanel;
|
|
185
|
+
|
|
186
|
+
function requireSolarPanel () {
|
|
187
|
+
if (hasRequiredSolarPanel) return solarPanel;
|
|
188
|
+
hasRequiredSolarPanel = 1;
|
|
189
|
+
"use strict";
|
|
190
|
+
Object.defineProperty(solarPanel, "__esModule", { value: true });
|
|
191
|
+
|
|
192
|
+
return solarPanel;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var googleSolar = {};
|
|
196
|
+
|
|
197
|
+
var hasRequiredGoogleSolar;
|
|
198
|
+
|
|
199
|
+
function requireGoogleSolar () {
|
|
200
|
+
if (hasRequiredGoogleSolar) return googleSolar;
|
|
201
|
+
hasRequiredGoogleSolar = 1;
|
|
202
|
+
"use strict";
|
|
203
|
+
var __awaiter = (googleSolar && googleSolar.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
204
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
205
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
206
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
207
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
208
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
209
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
Object.defineProperty(googleSolar, "__esModule", { value: true });
|
|
213
|
+
googleSolar.findClosestBuilding = findClosestBuilding;
|
|
214
|
+
googleSolar.getDataLayerUrls = getDataLayerUrls;
|
|
215
|
+
function findClosestBuilding(location, apiKey) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const args = {
|
|
218
|
+
"location.latitude": location.lat().toFixed(5),
|
|
219
|
+
"location.longitude": location.lng().toFixed(5),
|
|
220
|
+
};
|
|
221
|
+
const params = new URLSearchParams(Object.assign(Object.assign({}, args), { key: apiKey }));
|
|
222
|
+
return fetch(`https://solar.googleapis.com/v1/buildingInsights:findClosest?${params}`).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
const content = yield response.json();
|
|
224
|
+
if (response.status != 200) {
|
|
225
|
+
console.error("findClosestBuilding\n", content);
|
|
226
|
+
throw content;
|
|
227
|
+
}
|
|
228
|
+
return content;
|
|
229
|
+
}));
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function getDataLayerUrls(location, radiusMeters, apiKey) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
const args = {
|
|
235
|
+
"location.latitude": location.latitude.toFixed(5),
|
|
236
|
+
"location.longitude": location.longitude.toFixed(5),
|
|
237
|
+
radius_meters: radiusMeters.toString(),
|
|
238
|
+
required_quality: "LOW",
|
|
239
|
+
};
|
|
240
|
+
const params = new URLSearchParams(Object.assign(Object.assign({}, args), { key: apiKey }));
|
|
241
|
+
return fetch(`https://solar.googleapis.com/v1/dataLayers:get?${params}`)
|
|
242
|
+
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
const content = yield response.json();
|
|
244
|
+
if (response.status != 200) {
|
|
245
|
+
console.error("getDataLayerUrls\n", content);
|
|
246
|
+
throw content;
|
|
247
|
+
}
|
|
248
|
+
return content;
|
|
249
|
+
}));
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return googleSolar;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
var hasRequiredSolar;
|
|
257
|
+
|
|
258
|
+
function requireSolar () {
|
|
259
|
+
if (hasRequiredSolar) return solar;
|
|
260
|
+
hasRequiredSolar = 1;
|
|
261
|
+
(function (exports) {
|
|
262
|
+
"use strict";
|
|
263
|
+
var __createBinding = (solar && solar.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
264
|
+
if (k2 === undefined) k2 = k;
|
|
265
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
266
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
267
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
268
|
+
}
|
|
269
|
+
Object.defineProperty(o, k2, desc);
|
|
270
|
+
}) : (function(o, m, k, k2) {
|
|
271
|
+
if (k2 === undefined) k2 = k;
|
|
272
|
+
o[k2] = m[k];
|
|
273
|
+
}));
|
|
274
|
+
var __exportStar = (solar && solar.__exportStar) || function(m, exports) {
|
|
275
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
276
|
+
};
|
|
277
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
278
|
+
__exportStar(requireLocation(), exports);
|
|
279
|
+
__exportStar(requireSolarPanel(), exports);
|
|
280
|
+
__exportStar(requireGoogleSolar(), exports);
|
|
281
|
+
|
|
282
|
+
} (solar));
|
|
283
|
+
return solar;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
var heating = {};
|
|
287
|
+
|
|
288
|
+
var hasRequiredHeating;
|
|
289
|
+
|
|
290
|
+
function requireHeating () {
|
|
291
|
+
if (hasRequiredHeating) return heating;
|
|
292
|
+
hasRequiredHeating = 1;
|
|
293
|
+
"use strict";
|
|
294
|
+
Object.defineProperty(heating, "__esModule", { value: true });
|
|
295
|
+
|
|
296
|
+
return heating;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
var hasRequiredDist$1;
|
|
300
|
+
|
|
301
|
+
function requireDist$1 () {
|
|
302
|
+
if (hasRequiredDist$1) return dist;
|
|
303
|
+
hasRequiredDist$1 = 1;
|
|
304
|
+
(function (exports) {
|
|
305
|
+
"use strict";
|
|
306
|
+
var __createBinding = (dist && dist.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
307
|
+
if (k2 === undefined) k2 = k;
|
|
308
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
309
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
310
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
311
|
+
}
|
|
312
|
+
Object.defineProperty(o, k2, desc);
|
|
313
|
+
}) : (function(o, m, k, k2) {
|
|
314
|
+
if (k2 === undefined) k2 = k;
|
|
315
|
+
o[k2] = m[k];
|
|
316
|
+
}));
|
|
317
|
+
var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
|
|
318
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
319
|
+
};
|
|
320
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
321
|
+
__exportStar(requireShapes(), exports);
|
|
322
|
+
__exportStar(requireSolar(), exports);
|
|
323
|
+
__exportStar(requireHeating(), exports);
|
|
324
|
+
|
|
325
|
+
} (dist));
|
|
326
|
+
return dist;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
var fitting = {};
|
|
330
|
+
|
|
331
|
+
var utils = {};
|
|
332
|
+
|
|
333
|
+
var solarApi = {};
|
|
334
|
+
|
|
335
|
+
var hasRequiredSolarApi;
|
|
336
|
+
|
|
337
|
+
function requireSolarApi () {
|
|
338
|
+
if (hasRequiredSolarApi) return solarApi;
|
|
339
|
+
hasRequiredSolarApi = 1;
|
|
340
|
+
"use strict";
|
|
341
|
+
var __awaiter = (solarApi && solarApi.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
342
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
343
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
344
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
345
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
346
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
347
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
Object.defineProperty(solarApi, "__esModule", { value: true });
|
|
351
|
+
solarApi.fetchSolarData = fetchSolarData;
|
|
352
|
+
solarApi.getPixelInMeters = getPixelInMeters;
|
|
353
|
+
function fetchSolarData(latitude, longitude, apiKey) {
|
|
354
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
355
|
+
if (latitude === 0 || longitude === 0) {
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
const args = {
|
|
360
|
+
"location.latitude": latitude.toFixed(5),
|
|
361
|
+
"location.longitude": longitude.toFixed(5),
|
|
362
|
+
};
|
|
363
|
+
const params = new URLSearchParams(Object.assign(Object.assign({}, args), { key: apiKey }));
|
|
364
|
+
const response = yield fetch(`https://solar.googleapis.com/v1/buildingInsights:findClosest?${params}`);
|
|
365
|
+
if (!response.ok) {
|
|
366
|
+
const errorText = yield response.text();
|
|
367
|
+
throw new Error(`HTTP error! status: ${response.status}, body: ${errorText}`);
|
|
368
|
+
}
|
|
369
|
+
const contentType = response.headers.get("content-type");
|
|
370
|
+
if (!contentType || !contentType.includes("application/json")) {
|
|
371
|
+
const text = yield response.text();
|
|
372
|
+
console.error("Unexpected content type:", contentType, "Response:", text);
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const rawData = yield response.json();
|
|
376
|
+
return rawData;
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
console.error("Error fetching solar data:", error);
|
|
380
|
+
if (error instanceof TypeError &&
|
|
381
|
+
error.message === "Failed to fetch") {
|
|
382
|
+
throw new Error("Unable to connect to the solar data API.");
|
|
383
|
+
}
|
|
384
|
+
throw error;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function getPixelInMeters(rgbTiff) {
|
|
389
|
+
const latDiff = rgbTiff.bounds.north - rgbTiff.bounds.south;
|
|
390
|
+
const pixelHeight = rgbTiff.height;
|
|
391
|
+
const pixelInMeters = latDiff * 111320 / pixelHeight;
|
|
392
|
+
return pixelInMeters;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return solarApi;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
var hasRequiredUtils;
|
|
399
|
+
|
|
400
|
+
function requireUtils () {
|
|
401
|
+
if (hasRequiredUtils) return utils;
|
|
402
|
+
hasRequiredUtils = 1;
|
|
403
|
+
(function (exports) {
|
|
404
|
+
"use strict";
|
|
405
|
+
var __createBinding = (utils && utils.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
406
|
+
if (k2 === undefined) k2 = k;
|
|
407
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
408
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
409
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
410
|
+
}
|
|
411
|
+
Object.defineProperty(o, k2, desc);
|
|
412
|
+
}) : (function(o, m, k, k2) {
|
|
413
|
+
if (k2 === undefined) k2 = k;
|
|
414
|
+
o[k2] = m[k];
|
|
415
|
+
}));
|
|
416
|
+
var __exportStar = (utils && utils.__exportStar) || function(m, exports) {
|
|
417
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
418
|
+
};
|
|
419
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
420
|
+
exports.latLngToPixel = latLngToPixel;
|
|
421
|
+
const harmonia_types_1 = requireDist$1();
|
|
422
|
+
__exportStar(/*@__PURE__*/ requireSolarApi(), exports);
|
|
423
|
+
function latLngToPixel(bounds, canvas, latLng) {
|
|
424
|
+
const ctx = canvas.getContext("2d");
|
|
425
|
+
if (!ctx) {
|
|
426
|
+
throw new Error("Canvas context not found");
|
|
427
|
+
}
|
|
428
|
+
const latToPixel = (lat) => {
|
|
429
|
+
return canvas.height *
|
|
430
|
+
(1 - (lat - bounds.south) / (bounds.north - bounds.south));
|
|
431
|
+
};
|
|
432
|
+
const lngToPixel = (lng) => {
|
|
433
|
+
return canvas.width * (lng - bounds.west) / (bounds.east - bounds.west);
|
|
434
|
+
};
|
|
435
|
+
return new harmonia_types_1.Point(lngToPixel(latLng.longitude), latToPixel(latLng.latitude));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
} (utils));
|
|
439
|
+
return utils;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
var hasRequiredFitting;
|
|
443
|
+
|
|
444
|
+
function requireFitting () {
|
|
445
|
+
if (hasRequiredFitting) return fitting;
|
|
446
|
+
hasRequiredFitting = 1;
|
|
447
|
+
"use strict";
|
|
448
|
+
Object.defineProperty(fitting, "__esModule", { value: true });
|
|
449
|
+
fitting.projectPoint = projectPoint;
|
|
450
|
+
fitting.projectPolygon = projectPolygon;
|
|
451
|
+
fitting.intersects = intersects;
|
|
452
|
+
fitting.offsetPolygon = offsetPolygon;
|
|
453
|
+
fitting.getBestFittingRoofSegment = getBestFittingRoofSegment;
|
|
454
|
+
const harmonia_types_1 = requireDist$1();
|
|
455
|
+
const utils_1 = /*@__PURE__*/ requireUtils();
|
|
456
|
+
function projectPoint(point, azimuth) {
|
|
457
|
+
const angle = azimuth * (Math.PI / 180);
|
|
458
|
+
const x = point.x * Math.cos(angle) - point.y * Math.sin(angle);
|
|
459
|
+
const y = point.x * Math.sin(angle) + point.y * Math.cos(angle);
|
|
460
|
+
return new harmonia_types_1.Point(x, y);
|
|
461
|
+
}
|
|
462
|
+
function projectPolygon(polygon, azimuth) {
|
|
463
|
+
return {
|
|
464
|
+
points: polygon.points.map((point) => projectPoint(point, azimuth)),
|
|
465
|
+
type: polygon.type,
|
|
466
|
+
closed: polygon.closed,
|
|
467
|
+
id: polygon.id,
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function intersects(line1, line2) {
|
|
471
|
+
const p1 = line1.start;
|
|
472
|
+
const p2 = line1.end;
|
|
473
|
+
const p3 = line2.start;
|
|
474
|
+
const p4 = line2.end;
|
|
475
|
+
if (p1.equals(p3) ||
|
|
476
|
+
p1.equals(p4) ||
|
|
477
|
+
p2.equals(p3) ||
|
|
478
|
+
p2.equals(p4)) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
const d1 = (p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x);
|
|
482
|
+
const d2 = (p4.x - p3.x) * (p2.y - p3.y) - (p4.y - p3.y) * (p2.x - p3.x);
|
|
483
|
+
const d3 = (p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x);
|
|
484
|
+
const d4 = (p2.x - p1.x) * (p4.y - p1.y) - (p2.y - p1.y) * (p4.x - p1.x);
|
|
485
|
+
return (d1 * d2 < 0) && (d3 * d4 < 0);
|
|
486
|
+
}
|
|
487
|
+
function offsetPolygon(polygon, offset) {
|
|
488
|
+
if (polygon.points.length === 0) {
|
|
489
|
+
return { polygon: polygon, offset: { x: 0, y: 0 } };
|
|
490
|
+
}
|
|
491
|
+
let offsetX = 0;
|
|
492
|
+
let offsetY = 0;
|
|
493
|
+
if (!offset) {
|
|
494
|
+
const minX = Math.min(...polygon.points.map((point) => point.x));
|
|
495
|
+
const minY = Math.min(...polygon.points.map((point) => point.y));
|
|
496
|
+
const maxX = Math.max(...polygon.points.map((point) => point.x));
|
|
497
|
+
const maxY = Math.max(...polygon.points.map((point) => point.y));
|
|
498
|
+
offsetX = minX + (maxX - minX) / 2;
|
|
499
|
+
offsetY = minY + (maxY - minY) / 2;
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
offsetX = offset.x;
|
|
503
|
+
offsetY = offset.y;
|
|
504
|
+
}
|
|
505
|
+
const newPoints = polygon.points.map((point) => new harmonia_types_1.Point(point.x - offsetX, point.y - offsetY));
|
|
506
|
+
return {
|
|
507
|
+
polygon: Object.assign(Object.assign({}, polygon), { points: newPoints }),
|
|
508
|
+
offset: { x: offsetX, y: offsetY },
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
function getBestFittingRoofSegment(roof, roofSegmentStats, bounds, canvas) {
|
|
512
|
+
const polygonBounds = {
|
|
513
|
+
minX: Math.min(...roof.points.map((p) => p.x)),
|
|
514
|
+
maxX: Math.max(...roof.points.map((p) => p.x)),
|
|
515
|
+
minY: Math.min(...roof.points.map((p) => p.y)),
|
|
516
|
+
maxY: Math.max(...roof.points.map((p) => p.y)),
|
|
517
|
+
};
|
|
518
|
+
let bestSegment = null;
|
|
519
|
+
let bestIoU = 0;
|
|
520
|
+
for (const segment of roofSegmentStats) {
|
|
521
|
+
const sw = (0, utils_1.latLngToPixel)(bounds, canvas, {
|
|
522
|
+
latitude: segment.boundingBox.sw.latitude,
|
|
523
|
+
longitude: segment.boundingBox.sw.longitude,
|
|
524
|
+
});
|
|
525
|
+
const ne = (0, utils_1.latLngToPixel)(bounds, canvas, {
|
|
526
|
+
latitude: segment.boundingBox.ne.latitude,
|
|
527
|
+
longitude: segment.boundingBox.ne.longitude,
|
|
528
|
+
});
|
|
529
|
+
const segmentBounds = {
|
|
530
|
+
minX: sw.x,
|
|
531
|
+
maxX: ne.x,
|
|
532
|
+
minY: ne.y,
|
|
533
|
+
maxY: sw.y,
|
|
534
|
+
};
|
|
535
|
+
const interLeft = Math.max(polygonBounds.minX, segmentBounds.minX);
|
|
536
|
+
const interRight = Math.min(polygonBounds.maxX, segmentBounds.maxX);
|
|
537
|
+
const interTop = Math.max(polygonBounds.minY, segmentBounds.minY);
|
|
538
|
+
const interBottom = Math.min(polygonBounds.maxY, segmentBounds.maxY);
|
|
539
|
+
const interWidth = interRight - interLeft;
|
|
540
|
+
const interHeight = interBottom - interTop;
|
|
541
|
+
let intersectionArea = 0;
|
|
542
|
+
if (interWidth > 0 && interHeight > 0) {
|
|
543
|
+
intersectionArea = interWidth * interHeight;
|
|
544
|
+
}
|
|
545
|
+
const polygonArea = (polygonBounds.maxX - polygonBounds.minX) *
|
|
546
|
+
(polygonBounds.maxY - polygonBounds.minY);
|
|
547
|
+
const segmentArea = (segmentBounds.maxX - segmentBounds.minX) *
|
|
548
|
+
(segmentBounds.maxY - segmentBounds.minY);
|
|
549
|
+
const unionArea = polygonArea + segmentArea - intersectionArea;
|
|
550
|
+
const iou = unionArea > 0 ? intersectionArea / unionArea : 0;
|
|
551
|
+
if (iou > bestIoU) {
|
|
552
|
+
bestIoU = iou;
|
|
553
|
+
bestSegment = segment;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return bestSegment;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
return fitting;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
var hasRequiredGridMatch;
|
|
563
|
+
|
|
564
|
+
function requireGridMatch () {
|
|
565
|
+
if (hasRequiredGridMatch) return gridMatch;
|
|
566
|
+
hasRequiredGridMatch = 1;
|
|
567
|
+
"use strict";
|
|
568
|
+
Object.defineProperty(gridMatch, "__esModule", { value: true });
|
|
569
|
+
gridMatch.generateGrid = generateGrid;
|
|
570
|
+
gridMatch.solarPanelInObstacle = solarPanelInObstacle;
|
|
571
|
+
gridMatch.solarPanelInPolygon = solarPanelInPolygon;
|
|
572
|
+
gridMatch.isPanelObstructed = isPanelObstructed;
|
|
573
|
+
gridMatch.getSolarPanelsInPolygon = getSolarPanelsInPolygon;
|
|
574
|
+
gridMatch.getOptimalSolarPosition = getOptimalSolarPosition;
|
|
575
|
+
gridMatch.insetPolygon = insetPolygon;
|
|
576
|
+
gridMatch.getOptimalSolarPositionFully = getOptimalSolarPositionFully;
|
|
577
|
+
const harmonia_types_1 = requireDist$1();
|
|
578
|
+
const fitting_1 = /*@__PURE__*/ requireFitting();
|
|
579
|
+
function generateGrid(minMax, solarPanel, horizontal, anker, rowSpacing, columnSpacing) {
|
|
580
|
+
const grid = [];
|
|
581
|
+
const width = horizontal ? solarPanel.heightMeters : solarPanel.widthMeters;
|
|
582
|
+
const widthCount = Math.ceil((minMax.maxX - minMax.minX) / width);
|
|
583
|
+
const height = horizontal
|
|
584
|
+
? solarPanel.widthMeters
|
|
585
|
+
: solarPanel.heightMeters;
|
|
586
|
+
const heightCount = Math.ceil((minMax.maxY - minMax.minY) / height);
|
|
587
|
+
const widthOffset = width / 2;
|
|
588
|
+
const heightOffset = height / 2;
|
|
589
|
+
const startX = anker.x -
|
|
590
|
+
(Math.ceil((anker.x - minMax.minX) / width) * width);
|
|
591
|
+
const startY = anker.y -
|
|
592
|
+
(Math.ceil((anker.y - minMax.minY) / height) * height);
|
|
593
|
+
for (let i = 0; i < heightCount; i++) {
|
|
594
|
+
const row = [];
|
|
595
|
+
for (let j = 0; j < widthCount; j++) {
|
|
596
|
+
const x = startX + j * width + j * columnSpacing + widthOffset;
|
|
597
|
+
const y = startY + i * height + i * rowSpacing + heightOffset;
|
|
598
|
+
const positionedSolarPanel = {
|
|
599
|
+
panel: solarPanel,
|
|
600
|
+
pixelPosition: new harmonia_types_1.Point(x, y),
|
|
601
|
+
horizontal: horizontal,
|
|
602
|
+
};
|
|
603
|
+
row.push(positionedSolarPanel);
|
|
604
|
+
}
|
|
605
|
+
grid.push(row);
|
|
606
|
+
}
|
|
607
|
+
return grid;
|
|
608
|
+
}
|
|
609
|
+
function getSolarPanelLines(positionedSolarPanel, horizontal) {
|
|
610
|
+
const width = horizontal
|
|
611
|
+
? positionedSolarPanel.panel.heightMeters
|
|
612
|
+
: positionedSolarPanel.panel.widthMeters;
|
|
613
|
+
const height = horizontal
|
|
614
|
+
? positionedSolarPanel.panel.widthMeters
|
|
615
|
+
: positionedSolarPanel.panel.heightMeters;
|
|
616
|
+
const p1 = new harmonia_types_1.Point(positionedSolarPanel.pixelPosition.x - width / 2, positionedSolarPanel.pixelPosition.y - height / 2);
|
|
617
|
+
const p2 = new harmonia_types_1.Point(positionedSolarPanel.pixelPosition.x - width / 2, positionedSolarPanel.pixelPosition.y + height / 2);
|
|
618
|
+
const p3 = new harmonia_types_1.Point(positionedSolarPanel.pixelPosition.x + width / 2, positionedSolarPanel.pixelPosition.y + height / 2);
|
|
619
|
+
const p4 = new harmonia_types_1.Point(positionedSolarPanel.pixelPosition.x + width / 2, positionedSolarPanel.pixelPosition.y - height / 2);
|
|
620
|
+
const lines = [
|
|
621
|
+
{
|
|
622
|
+
start: p1,
|
|
623
|
+
end: p2,
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
start: p2,
|
|
627
|
+
end: p3,
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
start: p3,
|
|
631
|
+
end: p4,
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
start: p4,
|
|
635
|
+
end: p1,
|
|
636
|
+
},
|
|
637
|
+
];
|
|
638
|
+
return lines;
|
|
639
|
+
}
|
|
640
|
+
function solarPanelInObstacle(positionedSolarPanel, obstacle, horizontal) {
|
|
641
|
+
const lines = getSolarPanelLines(positionedSolarPanel, horizontal);
|
|
642
|
+
if ((0, harmonia_types_1.isPointInPolygon)(positionedSolarPanel.pixelPosition, obstacle)) {
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
645
|
+
for (let i = 0; i < obstacle.points.length; i++) {
|
|
646
|
+
const point = obstacle.points[i];
|
|
647
|
+
const nextPoint = obstacle.points[(i + 1) % obstacle.points.length];
|
|
648
|
+
const border = {
|
|
649
|
+
start: point,
|
|
650
|
+
end: nextPoint,
|
|
651
|
+
};
|
|
652
|
+
for (const line of lines) {
|
|
653
|
+
if ((0, fitting_1.intersects)(line, border)) {
|
|
654
|
+
return true;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
function solarPanelInPolygon(positionedSolarPanel, polygon, horizontal) {
|
|
661
|
+
const lines = getSolarPanelLines(positionedSolarPanel, horizontal);
|
|
662
|
+
for (let i = 0; i < polygon.points.length; i++) {
|
|
663
|
+
const point = polygon.points[i];
|
|
664
|
+
const nextPoint = polygon.points[(i + 1) % polygon.points.length];
|
|
665
|
+
const border = {
|
|
666
|
+
start: point,
|
|
667
|
+
end: nextPoint,
|
|
668
|
+
};
|
|
669
|
+
for (const line of lines) {
|
|
670
|
+
if ((0, fitting_1.intersects)(line, border)) {
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return (0, harmonia_types_1.isPointInPolygon)(positionedSolarPanel.pixelPosition, polygon);
|
|
676
|
+
}
|
|
677
|
+
function isPanelObstructed(positionedSolarPanel, obstacles, horizontal) {
|
|
678
|
+
for (const obstacle of obstacles) {
|
|
679
|
+
if (solarPanelInObstacle(positionedSolarPanel, obstacle.polygon, horizontal)) {
|
|
680
|
+
return true;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
function getSolarPanelsInPolygon(grid, polygon, horizontal, obstacles) {
|
|
686
|
+
const solarPanels = [];
|
|
687
|
+
for (const row of grid) {
|
|
688
|
+
let newRow = [];
|
|
689
|
+
for (const positionedSolarPanel of row) {
|
|
690
|
+
const isObstructed = isPanelObstructed(positionedSolarPanel, obstacles, horizontal);
|
|
691
|
+
if (solarPanelInPolygon(positionedSolarPanel, polygon, horizontal) && !isObstructed) {
|
|
692
|
+
newRow.push(positionedSolarPanel);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
solarPanels.push(newRow);
|
|
696
|
+
}
|
|
697
|
+
return solarPanels;
|
|
698
|
+
}
|
|
699
|
+
function getOptimalSolarPosition(roof, obstacles, solarPanel, angle, columnSpacing, rowSpacing) {
|
|
700
|
+
const minX = Math.min(...roof.points.map((p) => p.x));
|
|
701
|
+
const maxX = Math.max(...roof.points.map((p) => p.x));
|
|
702
|
+
const minY = Math.min(...roof.points.map((p) => p.y));
|
|
703
|
+
const maxY = Math.max(...roof.points.map((p) => p.y));
|
|
704
|
+
const minMax = {
|
|
705
|
+
minX: minX,
|
|
706
|
+
maxX: maxX,
|
|
707
|
+
minY: minY,
|
|
708
|
+
maxY: maxY,
|
|
709
|
+
};
|
|
710
|
+
const horizontalSolarPanel = Object.assign(Object.assign({}, solarPanel), { widthMeters: solarPanel.widthMeters * Math.cos(angle * Math.PI / 180), heightMeters: solarPanel.heightMeters });
|
|
711
|
+
const verticalSolarPanel = Object.assign(Object.assign({}, solarPanel), { widthMeters: solarPanel.widthMeters, heightMeters: solarPanel.heightMeters * Math.cos(angle * Math.PI / 180) });
|
|
712
|
+
let solarPanels = [];
|
|
713
|
+
let numberOfPanels = 0;
|
|
714
|
+
for (const point of roof.points) {
|
|
715
|
+
for (const horizontal of [true]) {
|
|
716
|
+
const grid = generateGrid(minMax, verticalSolarPanel, horizontal, point, rowSpacing, columnSpacing);
|
|
717
|
+
const solarPanelsInPolygon = getSolarPanelsInPolygon(grid, roof, horizontal, obstacles);
|
|
718
|
+
const numberOfPanelsInPolygon = solarPanelsInPolygon.reduce((acc, row) => acc + row.length, 0);
|
|
719
|
+
if (numberOfPanelsInPolygon > numberOfPanels) {
|
|
720
|
+
numberOfPanels = numberOfPanelsInPolygon;
|
|
721
|
+
solarPanels = solarPanelsInPolygon;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
return solarPanels;
|
|
727
|
+
}
|
|
728
|
+
function projectObstacles(obstacles, azimuth, offset, inset) {
|
|
729
|
+
const result = [];
|
|
730
|
+
for (const obstacle of obstacles) {
|
|
731
|
+
const offsetObstacle = (0, fitting_1.offsetPolygon)(obstacle, offset);
|
|
732
|
+
const projectedObstacle = (0, fitting_1.projectPolygon)(offsetObstacle.polygon, -azimuth);
|
|
733
|
+
const insetObstacle = insetPolygon(projectedObstacle, -inset);
|
|
734
|
+
const minX = Math.min(...insetObstacle.points.map((p) => p.x));
|
|
735
|
+
const maxX = Math.max(...insetObstacle.points.map((p) => p.x));
|
|
736
|
+
const minY = Math.min(...insetObstacle.points.map((p) => p.y));
|
|
737
|
+
const maxY = Math.max(...insetObstacle.points.map((p) => p.y));
|
|
738
|
+
const boundingBox = {
|
|
739
|
+
minX: minX,
|
|
740
|
+
maxX: maxX,
|
|
741
|
+
minY: minY,
|
|
742
|
+
maxY: maxY,
|
|
743
|
+
};
|
|
744
|
+
result.push({
|
|
745
|
+
polygon: projectedObstacle,
|
|
746
|
+
boundingBox: boundingBox,
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
return result;
|
|
750
|
+
}
|
|
751
|
+
function isClockwise(points) {
|
|
752
|
+
let sum = 0;
|
|
753
|
+
for (let i = 0; i < points.length; i++) {
|
|
754
|
+
const curr = points[i];
|
|
755
|
+
const next = points[(i + 1) % points.length];
|
|
756
|
+
sum += (next.x - curr.x) * (next.y + curr.y);
|
|
757
|
+
}
|
|
758
|
+
return sum > 0;
|
|
759
|
+
}
|
|
760
|
+
function insetPolygon(polygon, inset) {
|
|
761
|
+
const points = polygon.points;
|
|
762
|
+
const isClockwisePolygon = isClockwise(points);
|
|
763
|
+
inset = inset * Math.sqrt(2) * (isClockwisePolygon ? -1 : 1);
|
|
764
|
+
const insetPoints = [];
|
|
765
|
+
for (let i = 0; i < points.length; i++) {
|
|
766
|
+
const prev = points[(i - 1 + points.length) % points.length];
|
|
767
|
+
const curr = points[i];
|
|
768
|
+
const next = points[(i + 1) % points.length];
|
|
769
|
+
const v1 = {
|
|
770
|
+
x: curr.x - prev.x,
|
|
771
|
+
y: curr.y - prev.y,
|
|
772
|
+
};
|
|
773
|
+
const v2 = {
|
|
774
|
+
x: next.x - curr.x,
|
|
775
|
+
y: next.y - curr.y,
|
|
776
|
+
};
|
|
777
|
+
const perp1 = {
|
|
778
|
+
x: -v1.y,
|
|
779
|
+
y: v1.x,
|
|
780
|
+
};
|
|
781
|
+
const perp2 = {
|
|
782
|
+
x: -v2.y,
|
|
783
|
+
y: v2.x,
|
|
784
|
+
};
|
|
785
|
+
const length1 = Math.sqrt(perp1.x * perp1.x + perp1.y * perp1.y);
|
|
786
|
+
const length2 = Math.sqrt(perp2.x * perp2.x + perp2.y * perp2.y);
|
|
787
|
+
perp1.x /= length1;
|
|
788
|
+
perp1.y /= length1;
|
|
789
|
+
perp2.x /= length2;
|
|
790
|
+
perp2.y /= length2;
|
|
791
|
+
const bisector = {
|
|
792
|
+
x: perp1.x + perp2.x,
|
|
793
|
+
y: perp1.y + perp2.y,
|
|
794
|
+
};
|
|
795
|
+
const bisectorLength = Math.sqrt(bisector.x * bisector.x + bisector.y * bisector.y);
|
|
796
|
+
bisector.x /= bisectorLength;
|
|
797
|
+
bisector.y /= bisectorLength;
|
|
798
|
+
const insetPoint = new harmonia_types_1.Point(curr.x + bisector.x * inset, curr.y + bisector.y * inset);
|
|
799
|
+
insetPoints.push(insetPoint);
|
|
800
|
+
}
|
|
801
|
+
return {
|
|
802
|
+
points: insetPoints,
|
|
803
|
+
type: polygon.type,
|
|
804
|
+
closed: polygon.closed,
|
|
805
|
+
id: polygon.id,
|
|
806
|
+
area: polygon.area,
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function getOptimalSolarPositionFully(roof, obstacles, solarPanel, azimuth, inset, angle, columnSpacing, rowSpacing) {
|
|
810
|
+
const insetRoof = insetPolygon(roof, inset);
|
|
811
|
+
const offset = (0, fitting_1.offsetPolygon)(insetRoof);
|
|
812
|
+
const projectedOffset = (0, fitting_1.projectPolygon)(offset.polygon, -azimuth);
|
|
813
|
+
const projectedObstacles = projectObstacles(obstacles, azimuth, offset.offset, inset);
|
|
814
|
+
const horizontalSolarPanels = getOptimalSolarPosition(projectedOffset, projectedObstacles, solarPanel, angle, columnSpacing, rowSpacing);
|
|
815
|
+
const unprojectedPanels = [];
|
|
816
|
+
for (const panel of horizontalSolarPanels.flat()) {
|
|
817
|
+
const unprojectedPanel = (0, fitting_1.projectPoint)(panel.pixelPosition, azimuth);
|
|
818
|
+
const offsetPosition = new harmonia_types_1.Point(unprojectedPanel.x + offset.offset.x, unprojectedPanel.y + offset.offset.y);
|
|
819
|
+
unprojectedPanels.push({
|
|
820
|
+
panel: panel.panel,
|
|
821
|
+
pixelPosition: offsetPosition,
|
|
822
|
+
horizontal: panel.horizontal,
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
return unprojectedPanels;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
return gridMatch;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
var hasRequiredGeometry;
|
|
832
|
+
|
|
833
|
+
function requireGeometry () {
|
|
834
|
+
if (hasRequiredGeometry) return geometry;
|
|
835
|
+
hasRequiredGeometry = 1;
|
|
836
|
+
(function (exports) {
|
|
837
|
+
"use strict";
|
|
838
|
+
var __createBinding = (geometry && geometry.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
839
|
+
if (k2 === undefined) k2 = k;
|
|
840
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
841
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
842
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
843
|
+
}
|
|
844
|
+
Object.defineProperty(o, k2, desc);
|
|
845
|
+
}) : (function(o, m, k, k2) {
|
|
846
|
+
if (k2 === undefined) k2 = k;
|
|
847
|
+
o[k2] = m[k];
|
|
848
|
+
}));
|
|
849
|
+
var __exportStar = (geometry && geometry.__exportStar) || function(m, exports) {
|
|
850
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
851
|
+
};
|
|
852
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
853
|
+
__exportStar(/*@__PURE__*/ requireGridMatch(), exports);
|
|
854
|
+
__exportStar(/*@__PURE__*/ requireFitting(), exports);
|
|
855
|
+
|
|
856
|
+
} (geometry));
|
|
857
|
+
return geometry;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
var simulation$1 = {};
|
|
861
|
+
|
|
862
|
+
var simulation = {};
|
|
863
|
+
|
|
864
|
+
var solarCurves = {};
|
|
865
|
+
|
|
866
|
+
var hasRequiredSolarCurves;
|
|
867
|
+
|
|
868
|
+
function requireSolarCurves () {
|
|
869
|
+
if (hasRequiredSolarCurves) return solarCurves;
|
|
870
|
+
hasRequiredSolarCurves = 1;
|
|
871
|
+
"use strict";
|
|
872
|
+
Object.defineProperty(solarCurves, "__esModule", { value: true });
|
|
873
|
+
solarCurves.SOLAR_RADIATION = solarCurves.CONSUMPTION_PROFILES = void 0;
|
|
874
|
+
solarCurves.getSolarRadiation = getSolarRadiation;
|
|
875
|
+
const SOLAR_RADIATION = [
|
|
876
|
+
0,
|
|
877
|
+
0,
|
|
878
|
+
0,
|
|
879
|
+
0,
|
|
880
|
+
0,
|
|
881
|
+
0,
|
|
882
|
+
0,
|
|
883
|
+
0.1,
|
|
884
|
+
0.2,
|
|
885
|
+
0.4,
|
|
886
|
+
0.8,
|
|
887
|
+
0.9,
|
|
888
|
+
1,
|
|
889
|
+
0.95,
|
|
890
|
+
0.9,
|
|
891
|
+
0.7,
|
|
892
|
+
0.5,
|
|
893
|
+
0.3,
|
|
894
|
+
0.16,
|
|
895
|
+
0.02,
|
|
896
|
+
0,
|
|
897
|
+
0,
|
|
898
|
+
0,
|
|
899
|
+
0,
|
|
900
|
+
];
|
|
901
|
+
solarCurves.SOLAR_RADIATION = SOLAR_RADIATION;
|
|
902
|
+
function getSolarRadiation(discountFactor) {
|
|
903
|
+
return SOLAR_RADIATION.map((value) => value * discountFactor);
|
|
904
|
+
}
|
|
905
|
+
const CONSUMPTION_PROFILES = {
|
|
906
|
+
mostly_at_home: [
|
|
907
|
+
0.1,
|
|
908
|
+
0.1,
|
|
909
|
+
0.1,
|
|
910
|
+
0.1,
|
|
911
|
+
0.1,
|
|
912
|
+
0.15,
|
|
913
|
+
0.23,
|
|
914
|
+
0.26,
|
|
915
|
+
0.16,
|
|
916
|
+
0.16,
|
|
917
|
+
0.15,
|
|
918
|
+
0.19,
|
|
919
|
+
0.23,
|
|
920
|
+
0.24,
|
|
921
|
+
0.35,
|
|
922
|
+
0.28,
|
|
923
|
+
0.275,
|
|
924
|
+
0.8,
|
|
925
|
+
0.78,
|
|
926
|
+
0.74,
|
|
927
|
+
0.75,
|
|
928
|
+
0.73,
|
|
929
|
+
0.26,
|
|
930
|
+
0.1,
|
|
931
|
+
],
|
|
932
|
+
mostly_away: [
|
|
933
|
+
0.1,
|
|
934
|
+
0.1,
|
|
935
|
+
0.1,
|
|
936
|
+
0.1,
|
|
937
|
+
0.1,
|
|
938
|
+
0.15,
|
|
939
|
+
0.29,
|
|
940
|
+
0.32,
|
|
941
|
+
0.25,
|
|
942
|
+
0.15,
|
|
943
|
+
0.12,
|
|
944
|
+
0.14,
|
|
945
|
+
0.15,
|
|
946
|
+
0.12,
|
|
947
|
+
0.16,
|
|
948
|
+
0.21,
|
|
949
|
+
0.285,
|
|
950
|
+
1,
|
|
951
|
+
0.81,
|
|
952
|
+
0.77,
|
|
953
|
+
0.79,
|
|
954
|
+
0.73,
|
|
955
|
+
0.26,
|
|
956
|
+
0.1,
|
|
957
|
+
],
|
|
958
|
+
};
|
|
959
|
+
solarCurves.CONSUMPTION_PROFILES = CONSUMPTION_PROFILES;
|
|
960
|
+
|
|
961
|
+
return solarCurves;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
var types = {};
|
|
965
|
+
|
|
966
|
+
var hasRequiredTypes;
|
|
967
|
+
|
|
968
|
+
function requireTypes () {
|
|
969
|
+
if (hasRequiredTypes) return types;
|
|
970
|
+
hasRequiredTypes = 1;
|
|
971
|
+
"use strict";
|
|
972
|
+
Object.defineProperty(types, "__esModule", { value: true });
|
|
973
|
+
types.DEFAULT_GENERAL_SIMULATION_CONFIG = void 0;
|
|
974
|
+
types.DEFAULT_GENERAL_SIMULATION_CONFIG = {
|
|
975
|
+
simulationYears: 25,
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
return types;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
var hasRequiredSimulation$1;
|
|
982
|
+
|
|
983
|
+
function requireSimulation$1 () {
|
|
984
|
+
if (hasRequiredSimulation$1) return simulation;
|
|
985
|
+
hasRequiredSimulation$1 = 1;
|
|
986
|
+
"use strict";
|
|
987
|
+
Object.defineProperty(simulation, "__esModule", { value: true });
|
|
988
|
+
simulation.generateElectricCarChargingHours = generateElectricCarChargingHours;
|
|
989
|
+
simulation.simulateDay = simulateDay;
|
|
990
|
+
simulation.simulate = simulate;
|
|
991
|
+
const solarCurves_1 = /*@__PURE__*/ requireSolarCurves();
|
|
992
|
+
const types_1 = /*@__PURE__*/ requireTypes();
|
|
993
|
+
function generateElectricCarChargingHours(start, end) {
|
|
994
|
+
let hours = new Array(24).fill(false);
|
|
995
|
+
if (start < end) {
|
|
996
|
+
for (let i = start; i <= end; i++) {
|
|
997
|
+
hours[i] = true;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
for (let i = start; i <= 24; i++) {
|
|
1002
|
+
hours[i] = true;
|
|
1003
|
+
}
|
|
1004
|
+
for (let i = 0; i <= end; i++) {
|
|
1005
|
+
hours[i] = true;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return hours;
|
|
1009
|
+
}
|
|
1010
|
+
function simulateDay(production, consumption, dailyConsumption, battery) {
|
|
1011
|
+
let batteryCharge = 0;
|
|
1012
|
+
let soldEnergy = 0;
|
|
1013
|
+
let energyUsageOfProduction = 0;
|
|
1014
|
+
for (let hour = 0; hour < production.length; hour++) {
|
|
1015
|
+
const energyDifference = production[hour] - consumption[hour];
|
|
1016
|
+
if (energyDifference > 0) {
|
|
1017
|
+
energyUsageOfProduction += consumption[hour];
|
|
1018
|
+
if (batteryCharge < battery &&
|
|
1019
|
+
batteryCharge + energyDifference <= battery) {
|
|
1020
|
+
batteryCharge = batteryCharge + energyDifference;
|
|
1021
|
+
}
|
|
1022
|
+
else if (batteryCharge < battery) {
|
|
1023
|
+
const batteryDifference = battery - batteryCharge;
|
|
1024
|
+
batteryCharge = battery;
|
|
1025
|
+
soldEnergy += energyDifference - batteryDifference;
|
|
1026
|
+
}
|
|
1027
|
+
else {
|
|
1028
|
+
soldEnergy += energyDifference;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
if (batteryCharge > 0) {
|
|
1033
|
+
if (batteryCharge >= -energyDifference) {
|
|
1034
|
+
batteryCharge += energyDifference;
|
|
1035
|
+
energyUsageOfProduction += consumption[hour];
|
|
1036
|
+
}
|
|
1037
|
+
else {
|
|
1038
|
+
energyUsageOfProduction += production[hour] + batteryCharge;
|
|
1039
|
+
batteryCharge = 0;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
energyUsageOfProduction += production[hour];
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
if (batteryCharge > 0) {
|
|
1048
|
+
soldEnergy += batteryCharge;
|
|
1049
|
+
}
|
|
1050
|
+
const autonomy = energyUsageOfProduction / dailyConsumption;
|
|
1051
|
+
return {
|
|
1052
|
+
autonomy: autonomy > 1 ? 1 : autonomy,
|
|
1053
|
+
soldEnergy,
|
|
1054
|
+
energyUsageOfProduction,
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function simulate(config) {
|
|
1058
|
+
const generalConfig = Object.assign(Object.assign({}, types_1.DEFAULT_GENERAL_SIMULATION_CONFIG), config.general);
|
|
1059
|
+
const consumption = solarCurves_1.CONSUMPTION_PROFILES[config.householdConsumption.consumptionProfile];
|
|
1060
|
+
const norm = consumption.reduce((acc, curr) => acc + curr, 0);
|
|
1061
|
+
let additionalConsumption = 0;
|
|
1062
|
+
if (config.heatPump) {
|
|
1063
|
+
additionalConsumption =
|
|
1064
|
+
(config.heatPump.m2 || 0) * config.heatPump.consumptionPerM2 || 0;
|
|
1065
|
+
}
|
|
1066
|
+
let electricCarConsumption = 0;
|
|
1067
|
+
let electricCarNorm = 1;
|
|
1068
|
+
let electricCarChargingHours = consumption.map((_) => false);
|
|
1069
|
+
if (config.electricCar) {
|
|
1070
|
+
electricCarChargingHours = config.electricCar.chargingHours;
|
|
1071
|
+
const dailyCarUsage = config.electricCar.averageKilometersPerDay / 100 *
|
|
1072
|
+
config.electricCar.consumptionkWhPer100km;
|
|
1073
|
+
electricCarConsumption = Math.min(dailyCarUsage, config.electricCar.batteryKWh);
|
|
1074
|
+
electricCarNorm = config.electricCar.chargingHours.reduce((acc, curr) => acc + (curr ? 1 : 0), 0);
|
|
1075
|
+
if (electricCarNorm === 0) {
|
|
1076
|
+
electricCarNorm = 1;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
let systemSize = 0;
|
|
1080
|
+
if (config.solarSystems) {
|
|
1081
|
+
systemSize = Object.values(config.solarSystems).reduce((acc, curr) => {
|
|
1082
|
+
return acc + curr.numberOfPanels * curr.panelType.kWattPeak;
|
|
1083
|
+
}, 0);
|
|
1084
|
+
}
|
|
1085
|
+
else if (config.solarSystem) {
|
|
1086
|
+
console.warn("solarSystem is deprecated, use solarSystems instead");
|
|
1087
|
+
systemSize = config.solarSystem.numberOfPanels *
|
|
1088
|
+
config.solarSystem.panelType.kWattPeak;
|
|
1089
|
+
}
|
|
1090
|
+
else {
|
|
1091
|
+
throw new Error("No solar system found");
|
|
1092
|
+
}
|
|
1093
|
+
const summerProduction = (0, solarCurves_1.getSolarRadiation)(config.solarRadiation.summerFactor * systemSize);
|
|
1094
|
+
const winterProduction = (0, solarCurves_1.getSolarRadiation)(config.solarRadiation.winterFactor * systemSize);
|
|
1095
|
+
const summerConsumptionWholeDay = config.householdConsumption.averageConsumption *
|
|
1096
|
+
config.householdConsumption.summerConsumptionFactor +
|
|
1097
|
+
additionalConsumption *
|
|
1098
|
+
config.householdConsumption.summerConsumptionFactor;
|
|
1099
|
+
const summerConsumptionDaily = consumption.map((c, i) => c / norm * summerConsumptionWholeDay +
|
|
1100
|
+
electricCarConsumption / electricCarNorm *
|
|
1101
|
+
(electricCarChargingHours[i] ? 1 : 0));
|
|
1102
|
+
const winterConsumptionWholeDay = config.householdConsumption.averageConsumption *
|
|
1103
|
+
config.householdConsumption.winterConsumptionFactor +
|
|
1104
|
+
additionalConsumption *
|
|
1105
|
+
config.householdConsumption.winterConsumptionFactor;
|
|
1106
|
+
const winterConsumptionDaily = consumption.map((c, i) => c / norm * winterConsumptionWholeDay +
|
|
1107
|
+
electricCarConsumption / electricCarNorm *
|
|
1108
|
+
(electricCarChargingHours[i] ? 1 : 0));
|
|
1109
|
+
const summerDay = simulateDay(summerProduction, summerConsumptionDaily, summerConsumptionWholeDay + electricCarConsumption, config.batteryKWh);
|
|
1110
|
+
const winterDay = simulateDay(winterProduction, winterConsumptionDaily, winterConsumptionWholeDay + electricCarConsumption, config.batteryKWh);
|
|
1111
|
+
let savedCosts = 0;
|
|
1112
|
+
let savedCostsByYear = [];
|
|
1113
|
+
const soldEnergy = (summerDay.soldEnergy + winterDay.soldEnergy) / 2;
|
|
1114
|
+
const ownConsumption = (summerDay.energyUsageOfProduction +
|
|
1115
|
+
winterDay.energyUsageOfProduction) / 2;
|
|
1116
|
+
let energyPrice = config.electricityPrice.purchase;
|
|
1117
|
+
for (let i = 0; i < generalConfig.simulationYears; i++) {
|
|
1118
|
+
const savedCostsThisYear = ownConsumption * energyPrice * 365;
|
|
1119
|
+
savedCosts += savedCostsThisYear;
|
|
1120
|
+
savedCostsByYear.push(savedCostsThisYear);
|
|
1121
|
+
energyPrice = (1 + config.electricityPrice.increase) * energyPrice;
|
|
1122
|
+
}
|
|
1123
|
+
const totalEnergyProduction = (summerProduction.reduce((acc, curr) => acc + curr, 0) +
|
|
1124
|
+
winterProduction.reduce((acc, curr) => acc + curr, 0)) / 2;
|
|
1125
|
+
return {
|
|
1126
|
+
autonomy: (summerDay.autonomy + winterDay.autonomy) / 2,
|
|
1127
|
+
compensationPerDay: soldEnergy * config.electricityPrice.sell,
|
|
1128
|
+
byYearSavedCosts: savedCostsByYear,
|
|
1129
|
+
totalEnergyConsumptionDay: (summerConsumptionWholeDay + winterConsumptionWholeDay) / 2 +
|
|
1130
|
+
electricCarConsumption,
|
|
1131
|
+
totalEnergyProduction,
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
return simulation;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
var heatingSimulation = {};
|
|
1139
|
+
|
|
1140
|
+
var heatingConstants = {};
|
|
1141
|
+
|
|
1142
|
+
var hasRequiredHeatingConstants;
|
|
1143
|
+
|
|
1144
|
+
function requireHeatingConstants () {
|
|
1145
|
+
if (hasRequiredHeatingConstants) return heatingConstants;
|
|
1146
|
+
hasRequiredHeatingConstants = 1;
|
|
1147
|
+
"use strict";
|
|
1148
|
+
Object.defineProperty(heatingConstants, "__esModule", { value: true });
|
|
1149
|
+
heatingConstants.SYSTEM_EFFICIENCY = heatingConstants.INSULATION_FACTORS = heatingConstants.EQUIPMENT_COSTS = heatingConstants.DISTRIBUTION_EFFICIENCY = heatingConstants.DISTRIBUTION_COSTS = heatingConstants.CO2_EMISSIONS = heatingConstants.CLIMATE_DATA = void 0;
|
|
1150
|
+
const CLIMATE_DATA = {
|
|
1151
|
+
"Zone 1": { heatingDegreeHours: 1200, coolingDegreeHours: 2800 },
|
|
1152
|
+
"Zone 2": { heatingDegreeHours: 1800, coolingDegreeHours: 2200 },
|
|
1153
|
+
"Zone 3": { heatingDegreeHours: 2400, coolingDegreeHours: 1800 },
|
|
1154
|
+
"Zone 4": { heatingDegreeHours: 3200, coolingDegreeHours: 1400 },
|
|
1155
|
+
"Zone 5": { heatingDegreeHours: 4200, coolingDegreeHours: 1000 },
|
|
1156
|
+
"Zone 6": { heatingDegreeHours: 5400, coolingDegreeHours: 600 },
|
|
1157
|
+
"Zone 7": { heatingDegreeHours: 6800, coolingDegreeHours: 300 },
|
|
1158
|
+
"Zone 8": { heatingDegreeHours: 8400, coolingDegreeHours: 100 },
|
|
1159
|
+
};
|
|
1160
|
+
heatingConstants.CLIMATE_DATA = CLIMATE_DATA;
|
|
1161
|
+
const INSULATION_FACTORS = {
|
|
1162
|
+
poor: 1.4,
|
|
1163
|
+
fair: 1.2,
|
|
1164
|
+
good: 1.0,
|
|
1165
|
+
excellent: 0.8,
|
|
1166
|
+
};
|
|
1167
|
+
heatingConstants.INSULATION_FACTORS = INSULATION_FACTORS;
|
|
1168
|
+
const CO2_EMISSIONS = {
|
|
1169
|
+
electricity: 0.855,
|
|
1170
|
+
gas: 11.7,
|
|
1171
|
+
oil: 22.4,
|
|
1172
|
+
};
|
|
1173
|
+
heatingConstants.CO2_EMISSIONS = CO2_EMISSIONS;
|
|
1174
|
+
const SYSTEM_EFFICIENCY = {
|
|
1175
|
+
"heat-pump": { heating: 3.2, cooling: 16 },
|
|
1176
|
+
"electric": { heating: 1.0, cooling: 0 },
|
|
1177
|
+
"gas": { heating: 0.85, cooling: 0 },
|
|
1178
|
+
"oil": { heating: 0.8, cooling: 0 },
|
|
1179
|
+
"split-ac": { heating: 2.8, cooling: 14 },
|
|
1180
|
+
"central-ac": { heating: 0, cooling: 13 },
|
|
1181
|
+
};
|
|
1182
|
+
heatingConstants.SYSTEM_EFFICIENCY = SYSTEM_EFFICIENCY;
|
|
1183
|
+
const DISTRIBUTION_EFFICIENCY = {
|
|
1184
|
+
"central-air": 0.85,
|
|
1185
|
+
"radiators": 0.9,
|
|
1186
|
+
"radiant-floor": 0.95,
|
|
1187
|
+
"radiant-ceiling": 0.92,
|
|
1188
|
+
};
|
|
1189
|
+
heatingConstants.DISTRIBUTION_EFFICIENCY = DISTRIBUTION_EFFICIENCY;
|
|
1190
|
+
const EQUIPMENT_COSTS = {
|
|
1191
|
+
"heat-pump": { base: 8000, perSqFt: 3 },
|
|
1192
|
+
"electric": { base: 2000, perSqFt: 1 },
|
|
1193
|
+
"gas": { base: 4000, perSqFt: 2 },
|
|
1194
|
+
"oil": { base: 5000, perSqFt: 2.5 },
|
|
1195
|
+
"split-ac": { base: 6000, perSqFt: 2.5 },
|
|
1196
|
+
"central-ac": { base: 7000, perSqFt: 3 },
|
|
1197
|
+
};
|
|
1198
|
+
heatingConstants.EQUIPMENT_COSTS = EQUIPMENT_COSTS;
|
|
1199
|
+
const DISTRIBUTION_COSTS = {
|
|
1200
|
+
"central-air": { base: 3000, perSqFt: 2 },
|
|
1201
|
+
"radiators": { base: 4000, perSqFt: 3 },
|
|
1202
|
+
"radiant-floor": { base: 8000, perSqFt: 6 },
|
|
1203
|
+
"radiant-ceiling": { base: 6000, perSqFt: 4 },
|
|
1204
|
+
};
|
|
1205
|
+
heatingConstants.DISTRIBUTION_COSTS = DISTRIBUTION_COSTS;
|
|
1206
|
+
|
|
1207
|
+
return heatingConstants;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
var hasRequiredHeatingSimulation;
|
|
1211
|
+
|
|
1212
|
+
function requireHeatingSimulation () {
|
|
1213
|
+
if (hasRequiredHeatingSimulation) return heatingSimulation;
|
|
1214
|
+
hasRequiredHeatingSimulation = 1;
|
|
1215
|
+
"use strict";
|
|
1216
|
+
Object.defineProperty(heatingSimulation, "__esModule", { value: true });
|
|
1217
|
+
heatingSimulation.houseSchema = heatingSimulation.locationSchema = void 0;
|
|
1218
|
+
heatingSimulation.calculateHeatingSystemComparison = calculateHeatingSystemComparison;
|
|
1219
|
+
heatingSimulation.getDefaultUtilityRates = getDefaultUtilityRates;
|
|
1220
|
+
const heatingConstants_1 = /*@__PURE__*/ requireHeatingConstants();
|
|
1221
|
+
function calculateHeatLoss(house, location) {
|
|
1222
|
+
const climateData = heatingConstants_1.CLIMATE_DATA["Zone 1"];
|
|
1223
|
+
const baseHeatLoss = house.size * 30;
|
|
1224
|
+
const insulationFactor = heatingConstants_1.INSULATION_FACTORS[house.insulationLevel];
|
|
1225
|
+
const sharedWallFactor = 1;
|
|
1226
|
+
return baseHeatLoss * insulationFactor * sharedWallFactor *
|
|
1227
|
+
((climateData === null || climateData === void 0 ? void 0 : climateData.heatingDegreeHours) || 3000) / 3000;
|
|
1228
|
+
}
|
|
1229
|
+
function calculateCoolingLoad(house, location) {
|
|
1230
|
+
const climateData = heatingConstants_1.CLIMATE_DATA["Zone 1"];
|
|
1231
|
+
const baseCoolingLoad = house.size * 25;
|
|
1232
|
+
const insulationFactor = heatingConstants_1.INSULATION_FACTORS[house.insulationLevel];
|
|
1233
|
+
return baseCoolingLoad * insulationFactor *
|
|
1234
|
+
((climateData === null || climateData === void 0 ? void 0 : climateData.coolingDegreeHours) || 1500) / 1500;
|
|
1235
|
+
}
|
|
1236
|
+
function calculateEnergyConsumption(heatLoss, coolingLoad, system, hours) {
|
|
1237
|
+
const systemEff = heatingConstants_1.SYSTEM_EFFICIENCY[system.type];
|
|
1238
|
+
const distEff = heatingConstants_1.DISTRIBUTION_EFFICIENCY[system.distribution];
|
|
1239
|
+
const heatingEnergy = (heatLoss * hours) /
|
|
1240
|
+
(systemEff.heating * distEff * 3412);
|
|
1241
|
+
const coolingEnergy = (coolingLoad * hours) /
|
|
1242
|
+
(systemEff.cooling * distEff * 3412);
|
|
1243
|
+
return { heating: heatingEnergy, cooling: coolingEnergy };
|
|
1244
|
+
}
|
|
1245
|
+
function calculateCosts(energy, system, rates) {
|
|
1246
|
+
let cost = 0;
|
|
1247
|
+
if (system.type === "heat-pump" || system.type === "electric" ||
|
|
1248
|
+
system.type === "split-ac" || system.type === "central-ac") {
|
|
1249
|
+
cost = (energy.heating + energy.cooling) * rates.electricity;
|
|
1250
|
+
}
|
|
1251
|
+
else if (system.type === "gas") {
|
|
1252
|
+
cost = (energy.heating * 3412 / 100000) * rates.gas +
|
|
1253
|
+
energy.cooling * rates.electricity;
|
|
1254
|
+
}
|
|
1255
|
+
else if (system.type === "oil") {
|
|
1256
|
+
cost = (energy.heating * 3412 / 138690) * rates.oil +
|
|
1257
|
+
energy.cooling * rates.electricity;
|
|
1258
|
+
}
|
|
1259
|
+
return cost;
|
|
1260
|
+
}
|
|
1261
|
+
function calculateCO2Emissions(energy, system) {
|
|
1262
|
+
let emissions = 0;
|
|
1263
|
+
if (system.type === "heat-pump" || system.type === "electric" ||
|
|
1264
|
+
system.type === "split-ac" || system.type === "central-ac") {
|
|
1265
|
+
emissions = (energy.heating + energy.cooling) *
|
|
1266
|
+
heatingConstants_1.CO2_EMISSIONS.electricity;
|
|
1267
|
+
}
|
|
1268
|
+
else if (system.type === "gas") {
|
|
1269
|
+
emissions = (energy.heating * 3412 / 100000) * heatingConstants_1.CO2_EMISSIONS.gas +
|
|
1270
|
+
energy.cooling * heatingConstants_1.CO2_EMISSIONS.electricity;
|
|
1271
|
+
}
|
|
1272
|
+
else if (system.type === "oil") {
|
|
1273
|
+
emissions = (energy.heating * 3412 / 138690) * heatingConstants_1.CO2_EMISSIONS.oil +
|
|
1274
|
+
energy.cooling * heatingConstants_1.CO2_EMISSIONS.electricity;
|
|
1275
|
+
}
|
|
1276
|
+
return emissions;
|
|
1277
|
+
}
|
|
1278
|
+
function calculateSystemCosts(system, house) {
|
|
1279
|
+
const equipmentCost = heatingConstants_1.EQUIPMENT_COSTS[system.type];
|
|
1280
|
+
const distributionCost = heatingConstants_1.DISTRIBUTION_COSTS[system.distribution];
|
|
1281
|
+
const equipment = equipmentCost.base + (equipmentCost.perSqFt * house.size);
|
|
1282
|
+
const distribution = distributionCost.base +
|
|
1283
|
+
(distributionCost.perSqFt * house.size);
|
|
1284
|
+
const installation = (equipment + distribution) * 0.3;
|
|
1285
|
+
return {
|
|
1286
|
+
equipment: equipment + distribution,
|
|
1287
|
+
installation,
|
|
1288
|
+
total: equipment + distribution + installation,
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
function calculateHeatingSystemComparison(input) {
|
|
1292
|
+
const heatLoss = calculateHeatLoss(input.house, input.location);
|
|
1293
|
+
const coolingLoad = calculateCoolingLoad(input.house, input.location);
|
|
1294
|
+
const operatingHours = 2000;
|
|
1295
|
+
const currentEnergy = calculateEnergyConsumption(heatLoss, coolingLoad, input.currentSystem, operatingHours);
|
|
1296
|
+
const currentCost = calculateCosts(currentEnergy, input.currentSystem, input.utilityRates);
|
|
1297
|
+
const currentCO2 = calculateCO2Emissions(currentEnergy, input.currentSystem);
|
|
1298
|
+
const proposedEnergy = calculateEnergyConsumption(heatLoss, coolingLoad, input.proposedSystem, operatingHours);
|
|
1299
|
+
const proposedCost = calculateCosts(proposedEnergy, input.proposedSystem, input.utilityRates);
|
|
1300
|
+
const proposedCO2 = calculateCO2Emissions(proposedEnergy, input.proposedSystem);
|
|
1301
|
+
const systemCosts = calculateSystemCosts(input.proposedSystem, input.house);
|
|
1302
|
+
const totalCurrentEnergy = currentEnergy.heating + currentEnergy.cooling;
|
|
1303
|
+
const totalProposedEnergy = proposedEnergy.heating + proposedEnergy.cooling;
|
|
1304
|
+
const energySavings = totalCurrentEnergy - totalProposedEnergy;
|
|
1305
|
+
const costSavings = currentCost - proposedCost;
|
|
1306
|
+
const co2Savings = currentCO2 - proposedCO2;
|
|
1307
|
+
const paybackPeriod = costSavings > 0
|
|
1308
|
+
? systemCosts.total / costSavings
|
|
1309
|
+
: Infinity;
|
|
1310
|
+
return {
|
|
1311
|
+
energySavings: {
|
|
1312
|
+
annual: energySavings,
|
|
1313
|
+
percentage: (energySavings / totalCurrentEnergy) * 100,
|
|
1314
|
+
},
|
|
1315
|
+
co2Savings: {
|
|
1316
|
+
annual: co2Savings,
|
|
1317
|
+
percentage: (co2Savings / currentCO2) * 100,
|
|
1318
|
+
},
|
|
1319
|
+
costSavings: {
|
|
1320
|
+
annual: costSavings,
|
|
1321
|
+
monthlyAverage: costSavings / 12,
|
|
1322
|
+
percentage: (costSavings / currentCost) * 100,
|
|
1323
|
+
},
|
|
1324
|
+
newSystemCosts: {
|
|
1325
|
+
equipment: systemCosts.equipment,
|
|
1326
|
+
installation: systemCosts.installation,
|
|
1327
|
+
total: systemCosts.total,
|
|
1328
|
+
paybackPeriod,
|
|
1329
|
+
},
|
|
1330
|
+
efficiency: {
|
|
1331
|
+
current: heatingConstants_1.SYSTEM_EFFICIENCY[input.currentSystem.type].heating,
|
|
1332
|
+
proposed: heatingConstants_1.SYSTEM_EFFICIENCY[input.proposedSystem.type].heating,
|
|
1333
|
+
improvement: ((heatingConstants_1.SYSTEM_EFFICIENCY[input.proposedSystem.type].heating -
|
|
1334
|
+
heatingConstants_1.SYSTEM_EFFICIENCY[input.currentSystem.type].heating) /
|
|
1335
|
+
heatingConstants_1.SYSTEM_EFFICIENCY[input.currentSystem.type].heating) * 100,
|
|
1336
|
+
},
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
function getDefaultUtilityRates(location) {
|
|
1340
|
+
const stateRates = {
|
|
1341
|
+
"CA": { electricity: 0.28, gas: 1.15, oil: 3.20 },
|
|
1342
|
+
"NY": { electricity: 0.20, gas: 1.05, oil: 3.10 },
|
|
1343
|
+
"TX": { electricity: 0.12, gas: 0.95, oil: 2.90 },
|
|
1344
|
+
"FL": { electricity: 0.14, gas: 1.20, oil: 3.00 },
|
|
1345
|
+
};
|
|
1346
|
+
return stateRates[location.address] ||
|
|
1347
|
+
{ electricity: 0.16, gas: 1.00, oil: 3.00 };
|
|
1348
|
+
}
|
|
1349
|
+
heatingSimulation.locationSchema = {
|
|
1350
|
+
city: (value) => value.length > 0 ? null : "City is required",
|
|
1351
|
+
state: (value) => value.length > 0 ? null : "State is required",
|
|
1352
|
+
climateZone: (value) => Object.keys(heatingConstants_1.CLIMATE_DATA).includes(value)
|
|
1353
|
+
? null
|
|
1354
|
+
: "Invalid climate zone",
|
|
1355
|
+
};
|
|
1356
|
+
heatingSimulation.houseSchema = {
|
|
1357
|
+
size: (value) => value > 0 && value < 50000
|
|
1358
|
+
? null
|
|
1359
|
+
: "House size must be between 1 and 50,000 sq ft",
|
|
1360
|
+
sharedWalls: (value) => value >= 0 && value <= 4
|
|
1361
|
+
? null
|
|
1362
|
+
: "Shared walls must be between 0 and 4",
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
return heatingSimulation;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
var hasRequiredSimulation;
|
|
1369
|
+
|
|
1370
|
+
function requireSimulation () {
|
|
1371
|
+
if (hasRequiredSimulation) return simulation$1;
|
|
1372
|
+
hasRequiredSimulation = 1;
|
|
1373
|
+
(function (exports) {
|
|
1374
|
+
"use strict";
|
|
1375
|
+
var __createBinding = (simulation$1 && simulation$1.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1376
|
+
if (k2 === undefined) k2 = k;
|
|
1377
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1378
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1379
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1380
|
+
}
|
|
1381
|
+
Object.defineProperty(o, k2, desc);
|
|
1382
|
+
}) : (function(o, m, k, k2) {
|
|
1383
|
+
if (k2 === undefined) k2 = k;
|
|
1384
|
+
o[k2] = m[k];
|
|
1385
|
+
}));
|
|
1386
|
+
var __exportStar = (simulation$1 && simulation$1.__exportStar) || function(m, exports) {
|
|
1387
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1388
|
+
};
|
|
1389
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1390
|
+
__exportStar(/*@__PURE__*/ requireSimulation$1(), exports);
|
|
1391
|
+
__exportStar(/*@__PURE__*/ requireTypes(), exports);
|
|
1392
|
+
__exportStar(/*@__PURE__*/ requireHeatingSimulation(), exports);
|
|
1393
|
+
|
|
1394
|
+
} (simulation$1));
|
|
1395
|
+
return simulation$1;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
var hasRequiredDist;
|
|
1399
|
+
|
|
1400
|
+
function requireDist () {
|
|
1401
|
+
if (hasRequiredDist) return dist$1;
|
|
1402
|
+
hasRequiredDist = 1;
|
|
1403
|
+
(function (exports) {
|
|
1404
|
+
"use strict";
|
|
1405
|
+
var __createBinding = (dist$1 && dist$1.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1406
|
+
if (k2 === undefined) k2 = k;
|
|
1407
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1408
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1409
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1410
|
+
}
|
|
1411
|
+
Object.defineProperty(o, k2, desc);
|
|
1412
|
+
}) : (function(o, m, k, k2) {
|
|
1413
|
+
if (k2 === undefined) k2 = k;
|
|
1414
|
+
o[k2] = m[k];
|
|
1415
|
+
}));
|
|
1416
|
+
var __exportStar = (dist$1 && dist$1.__exportStar) || function(m, exports) {
|
|
1417
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1418
|
+
};
|
|
1419
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1420
|
+
__exportStar(/*@__PURE__*/ requireGeometry(), exports);
|
|
1421
|
+
__exportStar(/*@__PURE__*/ requireUtils(), exports);
|
|
1422
|
+
__exportStar(/*@__PURE__*/ requireSimulation(), exports);
|
|
1423
|
+
|
|
1424
|
+
} (dist$1));
|
|
1425
|
+
return dist$1;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
var distExports = /*@__PURE__*/ requireDist();
|
|
1429
|
+
|
|
1430
|
+
const OPEN_POLYGON_COLOR = "red"; //"#ffffff";
|
|
1431
|
+
const CLOSED_POLYGON_COLOR = "#fcba03";
|
|
1432
|
+
const DOTTED_LINE_COLOR = "rgba(0, 0, 0, 0.5)";
|
|
1433
|
+
const ROW_SPACING = 1;
|
|
1434
|
+
const COLUMN_SPACING = 1;
|
|
1435
|
+
const BORDER_INSET = 0;
|
|
1436
|
+
const DEFAULT_SUNNINESS = 600;
|
|
1437
|
+
const HEAT_PUMP_CONSUMPTION = 46; // kWh per m² per year
|
|
1438
|
+
const SOLAR_RADIATION = [
|
|
1439
|
+
0,
|
|
1440
|
+
0,
|
|
1441
|
+
0,
|
|
1442
|
+
0,
|
|
1443
|
+
0,
|
|
1444
|
+
0, // 00:00 - 05:00 - 6
|
|
1445
|
+
0,
|
|
1446
|
+
0.1,
|
|
1447
|
+
0.2, // 8
|
|
1448
|
+
0.4,
|
|
1449
|
+
0.8,
|
|
1450
|
+
1, // 06:00 - 11:00 - 12
|
|
1451
|
+
1,
|
|
1452
|
+
1,
|
|
1453
|
+
1,
|
|
1454
|
+
0.7,
|
|
1455
|
+
0.5,
|
|
1456
|
+
0.3, // 12:00 - 17:00 - 18
|
|
1457
|
+
0.16,
|
|
1458
|
+
0.02,
|
|
1459
|
+
0,
|
|
1460
|
+
0,
|
|
1461
|
+
0,
|
|
1462
|
+
0, // 18:00 - 23:00 - 24
|
|
1463
|
+
];
|
|
1464
|
+
const CONSUMPTION_PROFILES = {
|
|
1465
|
+
mostly_at_home: [
|
|
1466
|
+
0.1,
|
|
1467
|
+
0.1,
|
|
1468
|
+
0.1,
|
|
1469
|
+
0.1,
|
|
1470
|
+
0.1,
|
|
1471
|
+
0.15, // 00:00 - 05:00 - 6
|
|
1472
|
+
0.23,
|
|
1473
|
+
0.26,
|
|
1474
|
+
0.16,
|
|
1475
|
+
0.16,
|
|
1476
|
+
0.15,
|
|
1477
|
+
0.19, // 06:00 - 11:00 - 12
|
|
1478
|
+
0.23,
|
|
1479
|
+
0.24,
|
|
1480
|
+
0.35,
|
|
1481
|
+
0.28,
|
|
1482
|
+
0.275,
|
|
1483
|
+
0.8, // 12:00 - 17:00 - 18
|
|
1484
|
+
0.78,
|
|
1485
|
+
0.74,
|
|
1486
|
+
0.75,
|
|
1487
|
+
0.73,
|
|
1488
|
+
0.26,
|
|
1489
|
+
0.1, // 18:00 - 23:00 - 24
|
|
1490
|
+
],
|
|
1491
|
+
mostly_away: [
|
|
1492
|
+
0.1,
|
|
1493
|
+
0.1,
|
|
1494
|
+
0.1,
|
|
1495
|
+
0.1,
|
|
1496
|
+
0.1,
|
|
1497
|
+
0.15, // 00:00 - 05:00 - 6
|
|
1498
|
+
0.29,
|
|
1499
|
+
0.32,
|
|
1500
|
+
0.25,
|
|
1501
|
+
0.15,
|
|
1502
|
+
0.12,
|
|
1503
|
+
0.14, // 06:00 - 11:00 - 12
|
|
1504
|
+
0.15,
|
|
1505
|
+
0.12,
|
|
1506
|
+
0.16,
|
|
1507
|
+
0.21,
|
|
1508
|
+
0.285,
|
|
1509
|
+
1, // 12:00 - 17:00 - 18
|
|
1510
|
+
0.81,
|
|
1511
|
+
0.77,
|
|
1512
|
+
0.79,
|
|
1513
|
+
0.73,
|
|
1514
|
+
0.26,
|
|
1515
|
+
0.1, // 18:00 - 23:00 - 24
|
|
1516
|
+
],
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
export { BORDER_INSET as B, HEAT_PUMP_CONSUMPTION as H, distExports as d, requireDist$1 as r };
|
|
1520
|
+
//# sourceMappingURL=constants-hboFofU4.js.map
|
|
1521
|
+
|
|
1522
|
+
//# sourceMappingURL=constants-hboFofU4.js.map
|