{"id":6190,"date":"2023-07-25T16:43:15","date_gmt":"2023-07-25T14:43:15","guid":{"rendered":"https:\/\/faber-solartechnik.de\/?page_id=6190"},"modified":"2024-10-11T09:43:27","modified_gmt":"2024-10-11T07:43:27","slug":"pv-rechner","status":"publish","type":"page","link":"https:\/\/faber-solartechnik.de\/en\/pv-rechner\/","title":{"rendered":"PV calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"6190\" class=\"elementor elementor-6190\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1d039ed elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"1d039ed\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0806db1\" data-id=\"0806db1\" data-element_type=\"column\" data-e-type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5414348 elementor-widget elementor-widget-area-measurement-widget\" data-id=\"5414348\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"area-measurement-widget.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t        <script>\n            jQuery(document).ready(function () {\n                var swal = (typeof Swal !== 'undefined') ? Swal : false;\n                if (!swal) {\n                    var script = document.createElement('script');\n                    script.src = '\/home\/p-lnknlw\/html\/wordpress\/wp-content\/plugins\/lwd_area_measurement\/elementor-widgets\/js\/sweetalert2.all.min.js';\n                    document.head.appendChild(script);\n                }\n            });\n        <\/script>\n                <script>\n            let map, infoWindow;\n            const locationButton = document.createElement(\"button\");\n            const clearButton = document.createElement(\"button\");\n            const drawGeofenceButton = document.createElement(\"button\");\n            const movePolygonButton = document.createElement(\"button\");\n            var input = document.createElement(\"input\");\n            let tri = null;\n            var _myPolygon; \/\/ global variable to store the polygon instance\n            var shapes = [];\n            var selectedShape;\n            var markers = [];\n            \/\/so we don't create duplicates\n            let drawingManager;\n            function initMap() {\n                var iconBase = 'https:\/\/maps.google.com\/mapfiles\/kml\/shapes\/';\n                \/\/initialize the map\n                map = new google.maps.Map(document.getElementById(\"map\"), {\n                    center: {lat: 51.00, lng: 9.00},zoom: 6,                    mapTypeId: \"hybrid\",\n                    mapTypeControl: false,\n                    streetViewControl: false,\n                    fullscreenControl: true,\n                    zoomControl: true,\n                    tilt: 0,\n                    disableDefaultUI: true,\n\n                });\n\n                map.setOptions({\n                    styles: [\n                        \/\/ activate satelite view\n                        {\n                            featureType: \"poi.business\",\n                            stylers: [{ visibility: \"off\" }],\n                        },\n                        {\n                            featureType: \"transit\",\n                            elementType: \"labels.icon\",\n                            stylers: [{ visibility: \"off\" }],\n                        },\n                        {\n                            featureType: \"road\",\n                            elementType: \"geometry\",\n                            stylers: [{ visibility: \"on\" }]\n                        },\n                        {\n                            featureType: \"road\",\n                            elementType: \"labels\",\n                            stylers: [{ visibility: \"on\" }]\n                        },\n                        {\n                            featureType: \"administrative.locality\",\n                            elementType: \"labels\",\n                            stylers: [{ visibility: \"on\" }]\n                        },\n                        {\n                            featureType: \"administrative.country\",\n                            elementType: \"geometry.stroke\",\n                            stylers: [{ visibility: \"on\" }]\n                        }\n                    ],\n                });\n                \/\/info window that displays the coordinates we are using.\n                infoWindow = new google.maps.InfoWindow();\n\n                locationButton.textContent = \"Mein Standort\";\n                locationButton.innerHTML = '<i class=\"fas fa-map-marker-alt location-icon\"><\/i> ' + locationButton.textContent;\n                locationButton.classList.add(\"custom-map-control-button\" , \"location-button\");\n\n                clearButton.textContent = \"\";\n                clearButton.innerHTML = '<i class=\"fas fa-trash-alt\"><\/i> ' + clearButton.textContent;\n                clearButton.classList.add(\"custom-map-control-button\" , \"reset-btn-map\");\n\n                map.controls[google.maps.ControlPosition.TOP_RIGHT].push(clearButton);\n\n                movePolygonButton.textContent = \"Verschieben\";\n                movePolygonButton.innerHTML = '<i class=\"fas fa-arrows-alt\"><\/i> ' + movePolygonButton.textContent;\n                movePolygonButton.classList.add(\"custom-map-control-button\",\"move-polygon-button\");\n                map.controls[google.maps.ControlPosition.TOP_RIGHT].push(movePolygonButton);\n\n                drawGeofenceButton.textContent = \"Fl\u00e4chen markieren\";\n                drawGeofenceButton.innerHTML = '<i class=\"fa fa-plus geofence-plus\"><\/i><i class=\"fas fa-pencil-alt\"><\/i> ' + drawGeofenceButton.textContent;\n                drawGeofenceButton.classList.add(\"custom-map-control-button\",\"draw-geofence-button\");\n                map.controls[google.maps.ControlPosition.TOP_RIGHT].push(drawGeofenceButton);\n\n\n\n                input.setAttribute(\"id\", \"search-input\");\n                input.setAttribute(\"type\", \"text\");\n                input.setAttribute(\"placeholder\", \"Adresse suchen...\");\n                input.classList.add(\"custom-map-control-button\",\"search-input\", \"animate-input-box\");\n\n                const icon = document.createElement(\"i\");\n                icon.classList.add(\"fa\", \"fa-search\", \"search-icon-ms\");\n\n                var container = document.createElement(\"div\");\n                container.classList.add(\"input-container\");\n\n                container.appendChild(input);\n                container.appendChild(icon);\n\n                var SearchBox = new google.maps.places.SearchBox(input);\n\n                SearchBox.addListener(\"places_changed\", function() {\n                    console.log(\"places_changed\");\n                    var places = SearchBox.getPlaces();\n\n                    if (places.length === 0) {\n                        return;\n                    }\n                    if (markers.length > 0) {\n                        markers.forEach(function(marker) {\n                            marker.setMap(null);\n                        });\n                    }\n                    markers = [];\n                    var place = places[0];\n\n                    \/\/ Update the map view\n                    if (place.geometry && place.geometry.location) {\n                        map.setCenter(place.geometry.location);\n                        map.setZoom(19);\n                        var marker = new google.maps.Marker({\n                            position: place.geometry.location,\n                            map: map,\n                            editable: true,\n                        });\n                        markers.push(marker);\n                    }\n                });\n\n                map.controls[google.maps.ControlPosition.TOP_LEFT].push(container);\n                map.controls[google.maps.ControlPosition.TOP_LEFT].push(locationButton);\n\n                setListeners();\n            }\n\n            function setListeners() {\n                \/\/add option inside to create button listener for draw geofence button.\n                movePolygonButton.addEventListener(\"click\", () => {\n                    \/\/ change drawing mode to move polygon\n                    drawingManager.setDrawingMode(null);\n\n                });\n\n                drawGeofenceButton.addEventListener(\"click\", () => {\n                    \/\/ensure we can get rid of the old geofence\n                    if (tri != null && tri !== undefined) {\n                        tri.setMap(null);\n                    }\n                    \/\/to do: add button to clear all paths\n                    \/\/ensure we don't recreate the drawing manager\n                    if (drawingManager != null) {\n                        drawingManager.setMap(null);\n                    }\n                    var polylineOptions = {\n                        strokeWeight: 2,\n                        strokeColor: '#FF0000', \/\/ Specify the desired color here (e.g., red)\n                        fillOpacity: 0.35,\n                        editable: true\n                    };\n                    drawingManager = new google.maps.drawing.DrawingManager({\n                        drawingMode: google.maps.drawing.OverlayType.POLYGON,\n                        drawingControl: false,\n                        drawingControlOptions: {\n\n                            drawingModes: [\n                                google.maps.drawing.OverlayType.POLYGON,\n                            ]\n                        },\n                        polygonOptions: {\n                            fillColor: '#F7AC1C',\n                            fillOpacity: 0.5,\n                            strokeWeight: 2,\n                            clickable: true,\n                            strokeColor: '#F7AC1C', \/\/ Specify the desired color here (e.g., red)\n                            editable: true,\n                            zIndex: 1\n                        },\n                        polylineOptions: polylineOptions,\n                    });\n                    drawingManager.setMap(map);\n                    \/\/ only add the listener if drawingManager is not null\n                    google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {\n                        _myPolygon = e.overlay;\n                        var shape = e.overlay;\n                        shapes.push(shape)\n                        var totalArea = calculateTotalArea();\n                        console.log(\"___________\");\n                        console.log(totalArea);\n                        console.log(\"___________\");\n                        var area = google.maps.geometry.spherical.computeArea(e.overlay.getPath());\n                        console.log()\n                        if (_myPolygon) {\n                            if (_myPolygon instanceof google.maps.Polygon) {\n                                _myPolygon.getPaths().forEach(function (path) {\n                                    google.maps.event.addListener(path, 'insert_at', handlePointChange);\n                                    google.maps.event.addListener(path, 'remove_at', handlePointChange);\n                                    google.maps.event.addListener(path, 'set_at', handlePointChange);\n                                });\n                            } else if (_myPolygon instanceof google.maps.Polyline) {\n                                _myPolygon.getPath().forEach(function (point, index) {\n                                    google.maps.event.addListener(point, 'dragend', handlePointChange);\n                                    google.maps.event.addListener(point, 'mouseup', handlePointChange);\n                                });\n                            }\n                        }\n                        \/\/ write measurement into hidden field\n                        jQuery('#measurement').val(totalArea).trigger('change');\n                        jQuery('#nextStep1').prop('disabled', false); \/\/ .addClass('wiggle');\n                        \/*jQuery('#step1Link').addClass('done');\n                        setTimeout(function () {\n                            jQuery('#nextStep1').removeClass('wiggle');\n                        }, 1000);*\/\n\n                    });\n                });\n                function calculateTotalArea() {\n                    var totalArea = 0;\n\n                    for (var i = 0; i < shapes.length; i++) {\n                        var shape = shapes[i];\n                        var area = google.maps.geometry.spherical.computeArea(shape.getPath());\n                        totalArea += area;\n                    }\n                    return totalArea;\n                }\n                function handlePointChange() {\n                    \/\/ Der Punkt wurde bearbeitet oder verschoben\n                    console.log('Punkt wurde bearbeitet oder verschoben');\n                    if (_myPolygon) {\n                        \/\/ Fl\u00e4che neu berechnen\n                        var area = google.maps.geometry.spherical.computeArea(_myPolygon.getPath());\n                        var measurement = area.toFixed(2);\n                        var totalArea = calculateTotalArea();\n                        jQuery('#measurement').val(totalArea).trigger('change');\n                        console.log('Neue Fl\u00e4che: ' + measurement + ' Quadratmeter');\n                    }\n                }\n                locationButton.addEventListener(\"click\", () => {\n                    if (navigator.permissions) {\n                        navigator.permissions.query({ name: 'geolocation' }).then(function(permissionStatus) {\n                            if (permissionStatus.state === 'granted') {\n                                getGeoLocation();\n                            } else if (permissionStatus.state === 'prompt' || permissionStatus.state === 'denied') {\n                                Swal.fire({\n                                    title: 'Hinweis',\n                                    text: 'Bitte erlauben Sie den Zugriff auf Ihren Standort.',\n                                    icon: 'info',\n                                    confirmButtonText: 'OK',\n                                    timer: 3500,\n                                    timerProgressBar: true,\n                                }).then((result) => {\n                                    if (result.isConfirmed) {\n                                       getGeoLocation();\n                                    } else {\n                                        Swal.fire({\n                                            title: 'Fehler',\n                                            text: 'Bitte erlauben Sie den Zugriff auf Ihren Standort.',\n                                            icon: 'error',\n                                            confirmButtonText: 'OK',\n                                            timer: 3500,\n                                            timerProgressBar: true,\n                                        });\n                                    }\n                                });\n                            } else {\n                                console.log('Geolocation permission denied or unknown state.');\n                            }\n                        });\n                    } else if (navigator.geolocation) {\n                        getGeoLocation();\n                    } else {\n                        \/\/ Geolocation API not supported by the browser\n                        console.log('Geolocation is not supported by this browser.');\n                    }\n\n\n                    function getGeoLocation() {\n                        function geoSuccess() {\n                            console.log('Geolocation success');\n                        }\n                        function geoError(geo) {\n                            if (geo.code === 1) {\n                                console.log('User denied Geolocation');\n                            } else if (geo.code === 2) {\n                                console.log('Position unavailable');\n                            } else if (geo.code === 3) {\n                                console.log('Timeout');\n                            } else {\n                                console.log('ERROR: code ' + geo.code);\n                            }\n                        }\n                        var geoOptions = {\n                            enableHighAccuracy: true,\n                            maximumAge: 30000,\n                            timeout: 27000\n                        };\n                        if (navigator.geolocation) {\n                            console.log('Getting current position...');\n                            navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions);\n                            console.log(\"test\");\n                            navigator.geolocation.getCurrentPosition( (position) => {\n                                console.log(position);\n                                let pos = {\n                                    lat: position.coords.latitude,\n                                    lng: position.coords.longitude\n                                }\n                                console.log('Adding new marker...');\n                                const marker = new google.maps.Marker({\n                                    position: pos,\n                                    map: map,\n                                    icon: \"https:\/\/maps.google.com\/mapfiles\/kml\/shapes\/target.png\",\n                                });\n                                marker.set(\"id\", \"marker\");\n                                marker.set(\"draggable\", true);\n                                map.setCenter(pos);\n                                map.setZoom(19);\n                            },\n                            () => {\n                                handleLocationError(true, infoWindow, map.getCenter());\n                            });\n                        } else {\n                            \/\/ Browser doesn't support Geolocation\n                            handleLocationError(false, infoWindow, map.getCenter());\n                        }\n                    }\n                });\n\n                \/**\n                 * event listener to clear the current geofence options.\n                 *\/\n                clearButton.addEventListener(\"click\", () => {\n                    deleteShapes();\n                    jQuery('#step1Link').click().removeClass('done');\n                    jQuery('#step2Link').removeClass('done');\n                    jQuery('#measurement').val('');\n                });\n            }\n\n            \/**\n             * Based on Google Maps API code for a polygon\n             *\/\n            function showArrays(event) {\n                \/\/ Since this polygon has only one path, we can call getPath() to return the\n                \/\/ MVCArray of LatLngs.\n                const polygon = this;\n                const vertices = polygon.getPath();\n                let contentString =\n                    \"<b>Geofence Triangle polygon<\/b><br>\" +\n                    \"Clicked location: <br>\" +\n                    event.latLng.lat() +\n                    \",\" +\n                    event.latLng.lng() +\n                    \"<br>\";\n\n                \/\/ Iterate over the vertices.\n                for (let i = 0; i < vertices.getLength(); i++) {\n                    const xy = vertices.getAt(i);\n\n                    contentString +=\n                        \"<br>\" + \"Coordinate \" + i + \":<br>\" + xy.lat() + \",\" + xy.lng();\n                }\n                \/\/ Replace the info window's content and position.\n                infoWindow.setContent(contentString);\n                infoWindow.setPosition(event.latLng);\n                infoWindow.open(map);\n            }\n\n            function handleLocationError(browserHasGeolocation, infoWindow, pos) {\n                infoWindow.setPosition(pos);\n                infoWindow.setContent(\n                    browserHasGeolocation\n                        ? \"Error: The Geolocation service failed.\"\n                        : \"Error: Your browser doesn't support geolocation.\"\n                );\n                infoWindow.open(map);\n            }\n\n            function clearSelection() {\n                if (selectedShape) {\n                    selectedShape.setEditable(false);\n                    selectedShape = null;\n                }\n            }\n\n            function setSelection(shape) {\n                clearSelection();\n                selectedShape = shape;\n                shape.setEditable(true);\n            }\n\n            function deleteShapes() {\n                \/\/ check if setMap is available\n                if (!_myPolygon) {\n                    return;\n                }\n                _myPolygon.setMap(null);\n                for (var i = 0; i < shapes.length; i++) {\n                    shapes[i].setMap(null);\n                }\n                shapes = []; \/\/ Clear the shapes array\n            }\n            window.initMap = initMap;\n        <\/script>\n        <script>\n            jQuery(document).ready(function($) {\n                \/\/ Event-Listener f\u00fcr das Klicken der dynamisch erstellten Elemente\n                $(document).on('click', '.location-button, .search-input', function() {\n                    $('.search-input').removeClass('animate-input-box');\n                });\n\n                \/\/ Event-Listener, wenn das dynamisch erstellte Element den Fokus erh\u00e4lt\n                $(document).on('focus', '.search-input', function() {\n                    $(this).removeClass('animate-input-box');\n                });\n            });\n\n        <\/script>\n                <script>\n            \/*\n            * Calculate the kwp based on the measurement and the roofOption\n            * @param measurement - the measurement value\n            * @param roofOption - the roofOption given x faktor for the kwp calculation\n            * @return kwp - the kwp value\n             *\/\n            function calcKwp(measurement, roofOption) {\n                if (roofOption === \"Aufdach\") {\n                    roofOption = 0.13;\n                } else if (roofOption === \"Freifl\u00e4che\") {\n                    roofOption = 0.15;\n                } else {\n                    roofOption = 0.14;\n                }\n                return measurement * roofOption;\n            }\n\n            \/*\n            * Calculate the Erzeugung based on the kwp and the Bundesland\n            * @param kwp - the kwp value\n            * @param bundesland - the Bundesland\n            * @param roofOption - the roofOption\n            * @return erzeugung - the erzeugung value\n             *\/\n            function calcErzeugung(kwp, bundesland, roofOption) {\n                                var calcBundeslandData = {\"Baden-W\\u00fcrttemberg\":{\"Aufdach\":990,\"Freiland\":1108.8},\"Bayern\":{\"Aufdach\":950,\"Freiland\":1064},\"Berlin\":{\"Aufdach\":910,\"Freiland\":1019.2},\"Brandenburg\":{\"Aufdach\":910,\"Freiland\":1019.2},\"Bremen\":{\"Aufdach\":900,\"Freiland\":1008},\"Hamburg\":{\"Aufdach\":900,\"Freiland\":1008},\"Hessen\":{\"Aufdach\":940,\"Freiland\":1052.8},\"Mecklenburg-Vorpommern\":{\"Aufdach\":920,\"Freiland\":1030.4},\"Niedersachsen\":{\"Aufdach\":900,\"Freiland\":1008},\"Nordrhein-Westfalen\":{\"Aufdach\":900,\"Freiland\":1008},\"Rheinland-Pfalz\":{\"Aufdach\":950,\"Freiland\":1064},\"Saarland\":{\"Aufdach\":970,\"Freiland\":1086.4},\"Sachsen\":{\"Aufdach\":950,\"Freiland\":1064},\"Sachsen-Anhalt\":{\"Aufdach\":950,\"Freiland\":1064},\"Schleswig-Holstein\":{\"Aufdach\":900,\"Freiland\":1008},\"Th\\u00fcringen\":{\"Aufdach\":930,\"Freiland\":1041.6}};\n                if (calcBundeslandData && calcBundeslandData[bundesland] && calcBundeslandData[bundesland][roofOption] != null) {\n                    const value = calcBundeslandData[bundesland][roofOption];\n                    return (kwp * value);\n                } else {\n                    \/\/ Calculate the average of all Bundesl\u00e4nder for the specified roofOption\n                    var sum = 0;\n                    var count = 0;\n                    if (calcBundeslandData) {\n                        for (var state in calcBundeslandData) {\n                            if (calcBundeslandData.hasOwnProperty(state) && calcBundeslandData[state][roofOption] != null) {\n                                sum += calcBundeslandData[state][roofOption];\n                                count++;\n                            }\n                        }\n                        var average = sum \/ count;\n                        return (kwp * average);\n                    } else {\n                        console.log(\"calcBundeslandData not found\");\n                        return false;\n                    }\n                }\n            }\n\n            \/*\n                * Berechnung des Energieqoutienten\n                * @param verhaeltnis Verh\u00e4ltnis von Erzeugung zu Verbrauch\n                * @param lastprofil 1 = Werktags 9-17 Uhr, 2 = 24\/7 durchlaufend, 3 = Sonstiges\n                * @return Energieqoutient\n             *\/\n            function calcEnergieQ(verhaeltnis, lastprofil) {\n                    var y;\n                    if (lastprofil === \"1\") {\n                        if (verhaeltnis < 1) {\n                            y = -0.1814 * Math.pow(verhaeltnis, 2) + 0.7075 * verhaeltnis + 0.0075;\n                        } else if (verhaeltnis >= 1 && verhaeltnis <= 3) {\n                            y = -0.08 * Math.pow(verhaeltnis, 2) + 0.442 * verhaeltnis + 0.178;\n                        } else {\n                            y = 0.0007 * Math.pow(verhaeltnis, 3) + 0.0265 * verhaeltnis + 0.7197;\n                        }\n                    } else if (lastprofil === \"2\") {\n                        if (verhaeltnis < 1) {\n                            y = -0.0483 * Math.pow(verhaeltnis, 2) + 0.4129 * verhaeltnis + 0.036;\n                        } else if (verhaeltnis >= 1 && verhaeltnis <= 3) {\n                            y = -0.0483 * Math.pow(verhaeltnis, 2) + 0.4129 * verhaeltnis + 0.036;\n                        } else {\n                            y = -0.0041 * Math.pow(verhaeltnis, 3) - 0.0789 * Math.pow(verhaeltnis, 2) + 0.5007 * verhaeltnis - 0.0634;\n                        }\n                    } else if (lastprofil === \"3\") {\n                        if (verhaeltnis < 1) {\n                            y = -0.1102 * Math.pow(verhaeltnis, 2) + 0.5709 * verhaeltnis + 0.0032;\n                        } else if (verhaeltnis >= 1 && verhaeltnis < 4) {\n                            y = -0.0579 * Math.pow(verhaeltnis, 2) + 0.4477 * verhaeltnis + 0.0789;\n                        } else {\n                            y = -0.0015 * Math.pow(verhaeltnis, 2) + 0.0301 * verhaeltnis + 0.8532;\n                        }\n                    }\n                    return (y * 100);\n\n            }\n            function calcSolarDeck(erzeugung, energieQ, verbrauch) {\n                \/\/ (( erzeugung * energieQ )\/verbrauch)*100\n                return ((erzeugung * energieQ) \/ verbrauch);\n            }\n            \/*\n            * jQuery ready function\n            * Trigger the calculation on click to render the results\n             *\/\n            jQuery(document).ready(function($) {\n                var measurementInput = $('#measurement');\n\n                measurementInput.on('change', function() {\n                    var measurement = $(this).val();\n                    const roofOption = jQuery('#roofOption').val();\n                    const bundesland = jQuery('#bundesland').val();\n                    let verbrauch = jQuery('#verbrauch').val();\n                    verbrauch = verbrauch.replace(\/\\.\/g, '');\n\n                    let lastprofil = jQuery('#lastprofil').val();\n                    \/\/ check if step1 is completed\n                    if ($('#step1Link').hasClass('done')) {\n                         if (!verbrauch) {\n                            Swal.fire({\n                                title: 'Bitte geben Sie einen Verbrauch ein',\n                                icon: 'warning',\n                                confirmButtonText: 'OK'\n                            });\n                            return false;\n                        }\n                    }\n\n                    \/\/ do the calculation\n                    let kwp = calcKwp(measurement, roofOption);\n                    let erzeugung = calcErzeugung(kwp, bundesland, roofOption);\n                    let verhaeltnis = (verbrauch \/ erzeugung);\n                    let energieQ = calcEnergieQ(verhaeltnis, lastprofil);\n                    let solardeck = calcSolarDeck(erzeugung, energieQ, verbrauch);\n                    \/\/ Debug Outputs\n                    console.log(\"verbrauch: \" + verbrauch);\n                    console.log(\"kwp: \" + kwp);\n                    console.log(\"erzeugung: \" + erzeugung)\n                    console.log(\"verhaeltnis: \" + verhaeltnis)\n                    console.log(\"lastprofil: \" + lastprofil)\n                    console.log(\"energieQ: \" + energieQ.toFixed(0));\n                    console.log(\"solardeck: \" + solardeck.toFixed(0));\n                    \/\/\n\n                    let kwh = erzeugung.toFixed(0);\n                    let kgco2 = (erzeugung \/ 1000).toFixed(0);\n                    let measurementInt = parseInt(measurement);\n                    let qm = measurementInt.toFixed(0);\n\n                    const setText = (selector, text) => {\n                        if (jQuery(selector).length > 0) {\n                            jQuery(selector).text(text);\n                        }\n                    };\n                    \/\/ replace the placeholders with the calculated values\n                    if (solardeck > 100) {\n                        solardeck = 100;\n                    } else if (solardeck < 0) {\n                        solardeck = 0;\n                    }\n                    \/\/ add . to all number each thousand\n                    verbrauch = verbrauch.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    kwh = kwh.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    kgco2 = kgco2.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    qm = qm.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    kwp = kwp.toFixed(0).toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    if (energieQ > 100) {\n                        energieQ = 100;\n                    }\n                    energieQ = energieQ.toFixed(0).toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n                    solardeck = solardeck.toFixed(0).toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \".\");\n\n                    setText(\"#step2 .kwh-step2\", kwh);\n                    setText(\"#step2 .kgco2-step2\", kgco2);\n                    setText(\"#step2 .qm-step2\", qm);\n                    setText(\"#step2 .kwp-step2\", kwp);\n                    setText(\"#step2 .energyq-step2\", energieQ + '%');\n                    setText(\"#step2 .solardeck-step2\", solardeck + '%');\n\n                    \/\/ get the cordiantes of the polygon\n\n\n                    \/\/ write to gForm hidden field .area_measurement_hidden\n                    var gForm = jQuery('#gform-area-measurement .area_measurement_hidden textarea');\n                    var string = 'Fl\u00e4che: ' + qm + ' m2\\n' + 'kwh: ' + kwh + ' kWh\\n' + 'Anlagengr\u00f6\u00dfe: ' + kwp + ' kWp\\n' + 'CO2: ' + kgco2 + ' t CO2\\n' + 'Energieqoutient: ' + energieQ + ' %\\n' + 'Solarer Deckungsanteil: ' + solardeck + '\\n' + 'Verh\u00e4ltnis: ' + verhaeltnis + '\\n' + 'Verbrauch: ' + verbrauch + ' kWh\\n' + 'Bundesland: ' + bundesland + '\\n' + 'Lastprofil: ' + lastprofil + '\\n' + 'Dachausrichtung: ' + roofOption;\n                    if (gForm.length > 0) {\n                        var path = _myPolygon.getPath();\n                        if (path) {\n                            var coordinates = [];\n                             for (var i = 0; i < path.length; i++) {\n                                coordinates.push(path.getAt(i).toUrlValue(6));\n                            }\n                            var coordinatesString = coordinates.join(', ');\n                            string += '\\n' + 'Koordinaten: ' + coordinatesString;\n                        }\n                        gForm.html(string);\n                    }\n                });\n            });\n\n        <\/script>\n                <style>#gform-area-measurement {\n                display: block;\n        }<\/style>\n        <script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?key=AIzaSyBmuSgCAeQp99T3KRDIOmfdH9yn0Nv09wk&callback=initMap&libraries=drawing,places\" async><\/script>\n        <div id=\"result\"><\/div>\n        <div class=\"area-measurement\">\n            <div class=\"row\">\n                <div class=\"col-md-8\">\n                    <div id=\"map\" class=\"area-measurement-map\"><\/div>\n                <\/div>\n               <div class=\"col-md-4\">\n                           <div class=\"col-md-12\">\n            <ul class=\"nav nav-pills\">\n                <li class=\"nav-item\">\n                    <a class=\"nav-link active\" id=\"step1Link\" href=\"#step1\">\n                        <span class=\"numberIcon\">1<\/span> <span class=\"iconText\">Bemessen<\/span>                    <\/a>\n                <\/li>\n                <li class=\"nav-item\">\n                    <a class=\"nav-link\" id=\"step2Link\" href=\"#step2\">\n                        <span class=\"numberIcon\">2<\/span> <span class=\"iconText\">Berechnen<\/span>                    <\/a>\n                <\/li>\n                <li class=\"nav-item\">\n                    <a class=\"nav-link\" id=\"step3Link\" href=\"#step3\">\n                        <span class=\"numberIcon\">3<\/span> <span class=\"iconText\">Analysieren<\/span>                    <\/a>\n                <\/li>\n            <\/ul>\n            <div id=\"step1\" class=\"steps-content\">\n                <h2> Jetzt Solarpotenzial berechnen<\/h2>\n                <p>\n                <p>Der Service ist v\u00f6llig kostenlos und unverbindlich.<\/p><p><strong>1. Standort<\/strong> <i class=\"fas fa-map-marker-alt\" aria-hidden=\"true\"><\/i><br \/>Sie k\u00f6nnen Ihre Adresse eingeben oder Ihren aktuellen Standort verwenden.<\/p><p><strong>2.\u00a0Fl\u00e4che markieren<\/strong> <i class=\"fas fa-pencil-alt\" aria-hidden=\"true\"><\/i><br \/>Markieren Sie eine oder mehrere Fl\u00e4chen f\u00fcr Ihre Photovoltaik-Anlage, sei es auf dem Dach oder im Freiland.<\/p><p><strong>3.\u00a0Potenzial berechnen<\/strong> <i class=\"fas fa-calculator\" aria-hidden=\"true\"><\/i><br \/>W\u00e4hlen Sie das Bundesland, in dem die Anlage errichtet wird, das Stromverbrauchsprofil, den Jahresverbrauch in kWh und die Fl\u00e4chenart.<\/p>                <\/p>\n                <div class='fieldset-container-outter'><div class='fieldset-container grid'><fieldset class=\"bundesland-fieldset\"><label for=\"bundesland\">Bundesland<\/label><select id=\"bundesland\" name=\"bundesland\" class=\"bundesland-select\" required><option value=\"false\" selected>Bitte ausw\u00e4hlen<\/option><option value=\"Bremen\">Bremen<\/option><option value=\"Hamburg\">Hamburg<\/option><option value=\"Niedersachsen\">Niedersachsen<\/option><option value=\"Nordrhein-Westfalen\">Nordrhein-Westfalen<\/option><option value=\"Schleswig-Holstein\">Schleswig-Holstein<\/option><option value=\"Berlin\">Berlin<\/option><option value=\"Brandenburg\">Brandenburg<\/option><option value=\"Mecklenburg-Vorpommern\">Mecklenburg-Vorpommern<\/option><option value=\"Th\u00fcringen\">Th\u00fcringen<\/option><option value=\"Hessen\">Hessen<\/option><option value=\"Bayern\">Bayern<\/option><option value=\"Rheinland-Pfalz\">Rheinland-Pfalz<\/option><option value=\"Sachsen\">Sachsen<\/option><option value=\"Sachsen-Anhalt\">Sachsen-Anhalt<\/option><option value=\"Saarland\">Saarland<\/option><option value=\"Baden-W\u00fcrttemberg\">Baden-W\u00fcrttemberg<\/option><\/select><\/fieldset><fieldset class=\"lastprofil-fieldset\"><label for=\"lastprofil-fieldset\">Stromver&shybrauchs&shyprofil<\/label><select id=\"lastprofil\" name=\"lastprofil\" class=\"lastprofil-select\"><option value=\"1\" selected>Werktags 9-17 Uhr<\/option><option value=\"2\">24 \/ 7 durchlaufend<\/option><option value=\"3\">Sonstiges<\/option><\/select><\/fieldset><\/div><div class='fieldset-container grid'><fieldset class=\"verbrauch-fieldset\"><label for=\"verbrauch\">Verbrauch kWh\/Jahr<\/label><input type=\"text\" id=\"verbrauch\" name=\"verbrauch\" class=\"verbrauch-input\" placeholder=\"Pro Jahr in Kilowattstunde\"><\/fieldset><fieldset class=\"roofOption-fieldset\"><label for=\"roofOption\">Fl\u00e4chenart<\/label><select id=\"roofOption\" name=\"roofOption\" class=\"roofOption-select\"><option value=\"Aufdach\">Aufdach<\/option><option value=\"Freiland\">Freiland<\/option><\/select><\/fieldset><\/div><\/div><input type=\"hidden\" id=\"measurement\" name=\"measurement\" value=\"\">                <script>\n                    $(document).ready(function() {\n                        $('#verbrauch').on('input', function() {\n                            let value = $(this).val();\n\n                            \/\/ Entfernen Sie alle Zeichen, die keine Zahlen oder Kommas\/Punkte sind\n                            value = value.replace(\/[^0-9.,]\/g, '');\n\n                            \/\/ Ersetzen Sie Kommas durch nichts (da sie als Tausendertrennzeichen verwendet werden)\n                            value = value.replace(\/,\/g, '');\n\n                            \/\/ Wenn ein Punkt vorhanden ist, stellen Sie sicher, dass es nur ein Punkt ist und er am Ende steht\n                            if (value.includes('.')) {\n                                let parts = value.split('.');\n                                value = parts[0] + '.' + (parts[1] || '');\n                            }\n\n                            $(this).val(value);\n                        });\n                    });\n                <\/script>\n<br>\n                <button class=\"btn btn-primary gform_button button\" id=\"nextStep1\" disabled>Jetzt Potenzial Berechnen<\/button>\n            <\/div>\n            <div id=\"step2\" class=\"steps-content\" style=\"display: none;\">\n                <h2> Sie k\u00f6nnen jedes Jahr ca. <span class=\"highlight-data kwh-step2\">%%kwh%%<\/span> <span class=\"highlight-data\">kWh<\/span> Solarstrom erzeugen und dabei <span class=\"highlight-data kgco2-step2\">%%kgco2%%<\/span> <span class=\"highlight-data\">Tonnen CO<sub>2<\/sub><\/span> sparen.*<\/h2>\n                <p>\n                                <\/p><br>\n                <div class=\"area-data\">\n                    <div class=\"grid\">\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"fas fa-draw-polygon\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"> <p><span class=\"qm-step2\">0<\/span> m\u00b2<\/p><p id=\"randomString\">Gemessene Fl\u00e4che<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"fas fa-solar-panel\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"><p><span class=\"kwp-step2\">0<\/span> kWp<\/p> <p>Anlagengr\u00f6\u00dfe<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"fas fa-plug\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"> <p><span class=\"kwh-step2\">0<\/span> kWh<\/p><p>Solarstrom&shy;erzeugung pro Jahr<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"far fa-lightbulb\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"><p><span class=\"energyq-step2\">0<\/span> <\/p> <p>Eigen&shy;verbrauchs&shy;qoute<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"far fa-sun\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"><p><span class=\"solardeck-step2\">0<\/span> <\/p> <p>Solarer Deckungs&shy;anteil<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"p-2 g-col-6 solar-estimate\">\n\t\t\t\t\t\t\t<div class=\"iconleft\"> <i class=\"fas fa-seedling\"><\/i> <\/div>\n\t\t\t\t\t\t\t<div class=\"descright\"><p><span class=\"kgco2-step2\">0<\/span> Tonnen<\/p> <p>CO2-Ersparnis pro Jahr<\/p><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\n                    <div class=\"grid\">\n                        <div class=\"p-2 g-col-4 solar-estimate solar-estimate-3\">\n                            <div class=\"descright\"><p class=\"blurry-text\">XXXXX<\/p><p>Rendite<\/p><\/div>\n                        <\/div>\n                        <div class=\"p-2 g-col-4 solar-estimate solar-estimate-3\">\n                            <div class=\"descright\"><p class=\"blurry-text\">XXXX<\/p><p>Investitionkosten<\/p><\/div>\n                        <\/div>\n                        <div class=\"p-2 g-col-4 solar-estimate solar-estimate-3\">\n                            <div class=\"descright\"><p class=\"blurry-text\">XXXX<\/p><p>Amortisationsdauer<\/p><\/div>\n                        <\/div>\n                    <\/div>\n\n                    <span class=\"tinyinfo\">Diese Werte basieren auf Vergleichdaten, die wir in \u00fcber 2500+ Geb\u00e4udeanalysen gesammelt haben<\/span>\n                    <hr><br>\n                    <h3>Sie wollen es genau wissen?<\/h3>\n                <\/div>\n\n                <button class=\"btn btn-primary gform_button button\" id=\"nextStep2\">Detailanalyse erhalten <i class=\"fas fa-angle-right\"><\/i><\/button>\n            <\/div>\n            <div id=\"step3\" class=\"steps-content\" style=\"display: none;\">\n                <h2> Machen Sie jetzt den ersten Schritt in Richtung gr\u00fcne Energie<\/h2>\n                <br>\n                        <div id=\"gform-area-measurement\" class=\"area-measurement-form\">\n        <div class='gform-area_measurement-5414348'><script>\nvar gform;gform||(document.addEventListener(\"gform_main_scripts_loaded\",function(){gform.scriptsLoaded=!0}),document.addEventListener(\"gform\/theme\/scripts_loaded\",function(){gform.themeScriptsLoaded=!0}),window.addEventListener(\"DOMContentLoaded\",function(){gform.domLoaded=!0}),gform={domLoaded:!1,scriptsLoaded:!1,themeScriptsLoaded:!1,isFormEditor:()=>\"function\"==typeof InitializeEditor,callIfLoaded:function(o){return!(!gform.domLoaded||!gform.scriptsLoaded||!gform.themeScriptsLoaded&&!gform.isFormEditor()||(gform.isFormEditor()&&console.warn(\"The use of gform.initializeOnLoaded() is deprecated in the form editor context and will be removed in Gravity Forms 3.1.\"),o(),0))},initializeOnLoaded:function(o){gform.callIfLoaded(o)||(document.addEventListener(\"gform_main_scripts_loaded\",()=>{gform.scriptsLoaded=!0,gform.callIfLoaded(o)}),document.addEventListener(\"gform\/theme\/scripts_loaded\",()=>{gform.themeScriptsLoaded=!0,gform.callIfLoaded(o)}),window.addEventListener(\"DOMContentLoaded\",()=>{gform.domLoaded=!0,gform.callIfLoaded(o)}))},hooks:{action:{},filter:{}},addAction:function(o,r,e,t){gform.addHook(\"action\",o,r,e,t)},addFilter:function(o,r,e,t){gform.addHook(\"filter\",o,r,e,t)},doAction:function(o){gform.doHook(\"action\",o,arguments)},applyFilters:function(o){return gform.doHook(\"filter\",o,arguments)},removeAction:function(o,r){gform.removeHook(\"action\",o,r)},removeFilter:function(o,r,e){gform.removeHook(\"filter\",o,r,e)},addHook:function(o,r,e,t,n){null==gform.hooks[o][r]&&(gform.hooks[o][r]=[]);var d=gform.hooks[o][r];null==n&&(n=r+\"_\"+d.length),gform.hooks[o][r].push({tag:n,callable:e,priority:t=null==t?10:t})},doHook:function(r,o,e){var t;if(e=Array.prototype.slice.call(e,1),null!=gform.hooks[r][o]&&((o=gform.hooks[r][o]).sort(function(o,r){return o.priority-r.priority}),o.forEach(function(o){\"function\"!=typeof(t=o.callable)&&(t=window[t]),\"action\"==r?t.apply(null,e):e[0]=t.apply(null,e)})),\"filter\"==r)return e[0]},removeHook:function(o,r,t,n){var e;null!=gform.hooks[o][r]&&(e=(e=gform.hooks[o][r]).filter(function(o,r,e){return!!(null!=n&&n!=o.tag||null!=t&&t!=o.priority)}),gform.hooks[o][r]=e)}});\n<\/script>\n\n                <div class='gf_browser_gecko gform_wrapper gravity-theme gform-theme--no-framework' data-form-theme='gravity-theme' data-form-index='0' id='gform_wrapper_3' ><form method='post' enctype='multipart\/form-data' target='gform_ajax_frame_3' id='gform_3'  action='\/en\/wp-json\/wp\/v2\/pages\/6190' data-formid='3' novalidate>\n                        <div class='gform-body gform_body'><div id='gform_fields_3' class='gform_fields top_label form_sublabel_above description_above validation_below'><div id=\"field_3_5\" class=\"gfield gfield--type-text gfield--width-half gfield_contains_required field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_visible\"  ><label class='gfield_label gform-field-label' for='input_3_5'>Name<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/label><div class='ginput_container ginput_container_text'><input name='input_5' id='input_3_5' type='text' value='' class='large'   tabindex='1'  aria-required=\"true\" aria-invalid=\"false\"   \/><\/div><\/div><div id=\"field_3_2\" class=\"gfield gfield--type-email gfield--width-half gfield_contains_required field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_visible\"  ><label class='gfield_label gform-field-label' for='input_3_2'>E-Mail<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/label><div class='ginput_container ginput_container_email'>\n                            <input name='input_2' id='input_3_2' type='email' value='' class='large' tabindex='2'   aria-required=\"true\" aria-invalid=\"false\"  \/>\n                        <\/div><\/div><div id=\"field_3_6\" class=\"gfield gfield--type-text gfield--width-half gfield_contains_required field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_visible\"  ><label class='gfield_label gform-field-label' for='input_3_6'>Unternehmen<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/label><div class='ginput_container ginput_container_text'><input name='input_6' id='input_3_6' type='text' value='' class='large'   tabindex='3'  aria-required=\"true\" aria-invalid=\"false\"   \/><\/div><\/div><fieldset id=\"field_3_7\" class=\"gfield gfield--type-radio gfield--type-choice gfield--width-half gfield_contains_required field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_visible\"  ><legend class='gfield_label gform-field-label' >Haben Sie noch weitere Geb\u00e4ude?<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/legend><div class='ginput_container ginput_container_radio'><div class='gfield_radio' id='input_3_7'>\n\t\t\t<div class='gchoice gchoice_3_7_0'>\n\t\t\t\t\t<input class='gfield-choice-input' name='input_7' type='radio' value='Ja'  id='choice_3_7_0' onchange='gformToggleRadioOther( this )'  tabindex='4'  \/>\n\t\t\t\t\t<label for='choice_3_7_0' id='label_3_7_0' class='gform-field-label gform-field-label--type-inline'>Ja<\/label>\n\t\t\t<\/div>\n\t\t\t<div class='gchoice gchoice_3_7_1'>\n\t\t\t\t\t<input class='gfield-choice-input' name='input_7' type='radio' value='Nein'  id='choice_3_7_1' onchange='gformToggleRadioOther( this )'  tabindex='5'  \/>\n\t\t\t\t\t<label for='choice_3_7_1' id='label_3_7_1' class='gform-field-label gform-field-label--type-inline'>Nein<\/label>\n\t\t\t<\/div><\/div><\/div><\/fieldset><div id=\"field_3_8\" class=\"gfield gfield--type-textarea gfield--width-full field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_visible\"  ><label class='gfield_label gform-field-label' for='input_3_8'>Wie sind Sie auf uns aufmerksam geworden?<\/label><div class='ginput_container ginput_container_textarea'><textarea name='input_8' id='input_3_8' class='textarea small' tabindex='6'  maxlength='600'   aria-invalid=\"false\"   rows='10' cols='50'><\/textarea><\/div><\/div><div id=\"field_3_10\" class=\"gfield gfield--type-textarea gfield--width-full area_measurement_hidden field_sublabel_above gfield--no-description field_description_above field_validation_below gfield_visibility_hidden\"  ><div class=\"admin-hidden-markup\"><i class=\"gform-icon gform-icon--hidden\" aria-hidden=\"true\" title=\"This field is hidden when viewing the form\"><\/i><span>This field is hidden when viewing the form<\/span><\/div><label class='gfield_label gform-field-label' for='input_3_10'>Area Measurement<\/label><div class='ginput_container ginput_container_textarea'><textarea name='input_10' id='input_3_10' class='textarea large' tabindex='7'     aria-invalid=\"false\"   rows='10' cols='50'>Fl\u00e4che: %%qm%% m2\nkwh: %%kwh%% kwh\nAnlagengr\u00f6\u00dfe:  %%kwp%% kWp\nCO2: %%kgco2%% kg CO2\n<\/textarea><\/div><\/div><\/div><\/div>\n        <div class='gform-footer gform_footer top_label'> <input type='submit' id='gform_submit_button_3' class='gform_button button' onclick='gform.submission.handleButtonClick(this);' data-submission-type='submit' value='Absenden' tabindex='8' \/> <input type='hidden' name='gform_ajax' value='form_id=3&amp;title=&amp;description=&amp;tabindex=1&amp;theme=gravity-theme&amp;hash=add8b55a36274c2bf7bf367cadda183e' \/>\n            <input type='hidden' class='gform_hidden' name='gform_submission_method' data-js='gform_submission_method_3' value='iframe' \/>\n            <input type='hidden' class='gform_hidden' name='gform_theme' data-js='gform_theme_3' id='gform_theme_3' value='gravity-theme' \/>\n            <input type='hidden' class='gform_hidden' name='gform_style_settings' data-js='gform_style_settings_3' id='gform_style_settings_3' value='' \/>\n            <input type='hidden' class='gform_hidden' name='is_submit_3' value='1' \/>\n            <input type='hidden' class='gform_hidden' name='gform_submit' value='3' \/>\n            \n            <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' \/>\n            <input type='hidden' class='gform_hidden' name='state_3' value='WyJ7XCI3XCI6W1wiZGY2NWRjYmE4YWExMThhZTIyODM2MTVkMjYyZTcxZmNcIixcIjY3NWFkMWNkNjQ5NGVjMWI1YmNiMWYzMDg3MGNjNmFiXCJdfSIsIjczMDdhNmRiMmEzYmM5NGU0ZjA3N2YxMDNkNDFmMzA5Il0=' \/>\n            <input type='hidden' autocomplete='off' class='gform_hidden' name='gform_target_page_number_3' id='gform_target_page_number_3' value='0' \/>\n            <input type='hidden' autocomplete='off' class='gform_hidden' name='gform_source_page_number_3' id='gform_source_page_number_3' value='1' \/>\n            <input type='hidden' name='gform_field_values' value='name=&amp;email=&amp;company=' \/>\n            \n        <\/div>\n                        <\/form>\n                        <\/div>\n\t\t                <iframe style='display:none;width:0px;height:0px;' src='about:blank' name='gform_ajax_frame_3' id='gform_ajax_frame_3' title='This iframe contains the logic required to handle Ajax powered Gravity Forms.'><\/iframe>\n\t\t                <script>\ngform.initializeOnLoaded( function() {gformInitSpinner( 3, 'https:\/\/faber-solartechnik.de\/wp-content\/plugins\/gravityforms\/images\/spinner.svg', true );jQuery('#gform_ajax_frame_3').on('load',function(){var contents = jQuery(this).contents().find('*').html();var is_postback = contents.indexOf('GF_AJAX_POSTBACK') >= 0;if(!is_postback){return;}var form_content = jQuery(this).contents().find('#gform_wrapper_3');var is_confirmation = jQuery(this).contents().find('#gform_confirmation_wrapper_3').length > 0;var is_redirect = contents.indexOf('gformRedirect(){') >= 0;var is_form = form_content.length > 0 && ! is_redirect && ! is_confirmation;var mt = parseInt(jQuery('html').css('margin-top'), 10) + parseInt(jQuery('body').css('margin-top'), 10) + 100;if(is_form){jQuery('#gform_wrapper_3').html(form_content.html());if(form_content.hasClass('gform_validation_error')){jQuery('#gform_wrapper_3').addClass('gform_validation_error');} else {jQuery('#gform_wrapper_3').removeClass('gform_validation_error');}setTimeout( function() { \/* delay the scroll by 50 milliseconds to fix a bug in chrome *\/  }, 50 );if(window['gformInitDatepicker']) {gformInitDatepicker();}if(window['gformInitPriceFields']) {gformInitPriceFields();}var current_page = jQuery('#gform_source_page_number_3').val();gformInitSpinner( 3, 'https:\/\/faber-solartechnik.de\/wp-content\/plugins\/gravityforms\/images\/spinner.svg', true );jQuery(document).trigger('gform_page_loaded', [3, current_page]);window['gf_submitting_3'] = false;}else if(!is_redirect){var confirmation_content = jQuery(this).contents().find('.GF_AJAX_POSTBACK').html();if(!confirmation_content){confirmation_content = contents;}jQuery('#gform_wrapper_3').replaceWith(confirmation_content);jQuery(document).trigger('gform_confirmation_loaded', [3]);window['gf_submitting_3'] = false;wp.a11y.speak(jQuery('#gform_confirmation_message_3').text());}else{jQuery('#gform_3').append(contents);if(window['gformRedirect']) {gformRedirect();}}jQuery(document).trigger(\"gform_pre_post_render\", [{ formId: \"3\", currentPage: \"current_page\", abort: function() { this.preventDefault(); } }]);        if (event && event.defaultPrevented) {                return;        }        const gformWrapperDiv = document.getElementById( \"gform_wrapper_3\" );        if ( gformWrapperDiv ) {            const visibilitySpan = document.createElement( \"span\" );            visibilitySpan.id = \"gform_visibility_test_3\";            gformWrapperDiv.insertAdjacentElement( \"afterend\", visibilitySpan );        }        const visibilityTestDiv = document.getElementById( \"gform_visibility_test_3\" );        let postRenderFired = false;        function triggerPostRender() {            if ( postRenderFired ) {                return;            }            postRenderFired = true;            gform.core.triggerPostRenderEvents( 3, current_page );            if ( visibilityTestDiv ) {                visibilityTestDiv.parentNode.removeChild( visibilityTestDiv );            }        }        function debounce( func, wait, immediate ) {            var timeout;            return function() {                var context = this, args = arguments;                var later = function() {                    timeout = null;                    if ( !immediate ) func.apply( context, args );                };                var callNow = immediate && !timeout;                clearTimeout( timeout );                timeout = setTimeout( later, wait );                if ( callNow ) func.apply( context, args );            };        }        const debouncedTriggerPostRender = debounce( function() {            triggerPostRender();        }, 200 );        if ( visibilityTestDiv && visibilityTestDiv.offsetParent === null ) {            const observer = new MutationObserver( ( mutations ) => {                mutations.forEach( ( mutation ) => {                    if ( mutation.type === 'attributes' && visibilityTestDiv.offsetParent !== null ) {                        debouncedTriggerPostRender();                        observer.disconnect();                    }                });            });            observer.observe( document.body, {                attributes: true,                childList: false,                subtree: true,                attributeFilter: [ 'style', 'class' ],            });        } else {            triggerPostRender();        }    } );} );\n<\/script>\n<\/div><\/div>            <\/div>\n        <\/div>\n\n        <style>\n            .area-measurement #nextStep1::after {\n                content: \"Bitte zeichnen Sie zuerst eine Fl\u00e4che ein\";\n            }\n        <\/style>\n        <script>\n            jQuery(document).ready(function($) {\n                var randomStrings = [\n                    \"Gemessene Fl\u00e4che\",\n                    \"Abgemessene Fl\u00e4che\",\n                    \"Festgestellte Fl\u00e4che\",\n                    \"Ermittelte Fl\u00e4che\",\n                    \"Ausgemessene Fl\u00e4che\",\n                    \"Berechnete Fl\u00e4che\",\n                    \"Erfasste Fl\u00e4che\",\n                    ];\n                var randomString = randomStrings[Math.floor(Math.random()*randomStrings.length)];\n                $('#randomString').text(randomString);\n                $('#step3 form').submit(function() {\n                    $('#step3Link').removeClass('active').addClass('done');\n                });\n                \/\/ Step 1\n                $('#nextStep1').click(function() {\n                    var measurementField = $('#measurement');\n                    var measurement = measurementField.val();\n                    const roofOption = jQuery('#roofOption').val();\n                    const bundeslandField = jQuery('#bundesland');\n                    const bundesland = bundeslandField.val();\n                    let verbrauchField = jQuery('#verbrauch');\n                    let verbrauch = verbrauchField.val();\n                    let lastprofil = jQuery('#lastprofil').val();\n                   \/\/ if measurement, roofOption and bundesland and verbrauch and lastprofil are not set return false\n                   if (!measurement || !roofOption || !bundesland || !verbrauch || !lastprofil || bundesland === '' || bundesland === 'false') {\n                       \/\/ mark all fields that are not set red border till they trigger key down\n                        var errorTxt = '';\n                        if (!verbrauch) {\n                           verbrauchField.addClass('border-danger');\n                            verbrauchField.on('keydown', function() {\n                                verbrauchField.removeClass('border-danger');\n                            });\n                        }\n                        if (!bundesland || bundesland === '' || bundesland === 'false') {\n                            bundeslandField.addClass('border-danger');\n                            bundeslandField.on('change', function() {\n                                bundeslandField.removeClass('border-danger');\n                            });\n                            errorTxt += 'Bitte w\u00e4hlen Sie Ihr Bundesland aus!<br>';\n                        }\n                        if (!measurement) {\n                            errorTxt += 'Bitte zeichnen Sie zuerst eine Fl\u00e4che ein!<br>';\n                        }\n                        if (!verbrauch) {\n                            errorTxt += 'Bitte geben Sie Ihren Stromverbrauch ein!';\n                        }\n                        if (!errorTxt || errorTxt === '') {\n                            errorTxt = 'Bitte f\u00fcllen Sie alle Felder aus!';\n                        }\n                       Swal.fire({\n                           icon: 'error',\n                           title: 'Oops...',\n                           html: errorTxt,\n                       });\n                       return false;\n                    }\n                    measurementField.trigger('change');\n                    $('#step1').hide();\n                    $('#step2').show();\n                    $('#step1Link').removeClass('active').addClass('done');\n                    $('#step2Link').addClass('active');\n                });\n\n                \/\/ Step 2\n                $('#nextStep2').click(function() {\n                    $('#step2').hide();\n                    $('#step3').show();\n                    $('#step2Link').removeClass('active').addClass('done');\n                    $('#step3Link').addClass('active');\n                });\n\n                \/\/ Navigation\n                $('#step1Link').click(function() {\n                    $('#step1').show();\n                    $('#step2').hide();\n                    $('#step3').hide();\n                    $('#step1Link').addClass('active');\n                    $('#step2Link').removeClass('active');\n                    $('#step3Link').removeClass('active');\n                });\n\n                $('#step2Link').click(function(e) {\n                    if ($('#step1Link').hasClass('done')) {\n                        $('#step1').hide();\n                        $('#step2').show();\n                        $('#step3').hide();\n                        $('#step1Link').removeClass('active');\n                        $('#step2Link').addClass('active');\n                        $('#step3Link').removeClass('active');\n                        $('#measurement').trigger('change');\n                    } else {\n                        e.preventDefault();\n                    }\n                });\n\n                $('#step3Link').click(function(e) {\n                    if ($('#step1Link').hasClass('done')) {\n                        $('#step1').hide();\n                        $('#step2').hide();\n                        $('#step3').show();\n                        $('#step1Link').removeClass('active');\n                        $('#step2Link').removeClass('active').addClass('done');\n                        $('#step3Link').addClass('active');\n                    } else {\n                        e.preventDefault();\n                    }\n                });\n            });\n        <\/script>\n                       <\/div>\n\n        <\/div>\n\n\n        \t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>1 Bemessen 2 Berechnen 3 Analysieren Jetzt Solarpotenzial berechnen Der Service ist v\u00f6llig kostenlos und unverbindlich. 1. Standort Sie k\u00f6nnen Ihre Adresse eingeben oder Ihren aktuellen Standort verwenden. 2.\u00a0Fl\u00e4che markieren Markieren Sie eine oder mehrere Fl\u00e4chen f\u00fcr Ihre Photovoltaik-Anlage, sei es auf dem Dach oder im Freiland. 3.\u00a0Potenzial berechnen W\u00e4hlen Sie das Bundesland, in dem [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-6190","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/pages\/6190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/comments?post=6190"}],"version-history":[{"count":352,"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/pages\/6190\/revisions"}],"predecessor-version":[{"id":7886,"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/pages\/6190\/revisions\/7886"}],"wp:attachment":[{"href":"https:\/\/faber-solartechnik.de\/en\/wp-json\/wp\/v2\/media?parent=6190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}