<commit_before>(function (win, doc) {

    "use strict";

    var dataFromSetver = {
        "data": [
            {
                "lat": -25.363,
                "lng": 131.044,
                "country": "South Korea",
                "point": "Jeju Island",
                "description": "Sun bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region3",
                "preview": "img/promo-map/jeju-island.jpg",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    }
                ]
            },
            {
                "lat": -25.363 + 1,
                "lng": 131.044 + 1,
                "country": "South Korea 2",
                "point": "South Korea 2",
                "description": "Sun!!! bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region2",
                "preview": "img/promo-map/kyoto.jpg",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulssdf",
                        "description": "Tropical Fruit Worldasf"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulsfsa",
                        "description": "Tropical Fruit Worldasf"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulsfas",
                        "description": "Tropical Fruit Worldsaf"
                    }
                ]
            },
            {
                "lat": -25.363 + 0.5,
                "lng": 131.044 + 0.5,
                "country": "South Korea 2",
                "point": "Jeju Island 2",
                "description": "Sun bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region1",
                "preview": "img/promo-map/jeju-island.jpg?ee",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    }
                ]
            }

        ],
        "meta": {
            "name": "Ebash karty, bleat\'!!!"
        }
    };

    var cardTemplate = [

        '<div class="point-card js-point-card">',

            '<a class="point-card__close js-point-card__close" href="#"></a>',
            '<h3 class="point-card__header">{{= it.country }}</h3>',
            '<h4 class="point-card__local-header">{{= it.point }}</h4>',
            '<p class="point-card__local-description">{{= it.description }}</p>',

            '<div class="scroll-area">',
                '<div class="scroll-area__content">',
                    '{{~ it[\'inner-cards\'] :item }}',
                    '<div class="region-preview-item">',
                        '<img src="{{= item.img }}" alt="" class="region-preview-item__image">',
                        '<h3 class="region-preview-item__header">{{= item.header }}</h3>',
                        '<p class="region-preview-item__paragraph">{{= item.description }}</p>',
                    '</div>',
                    '{{~}}',
                '</div>',
            '</div>',

            '<a href="{{= it[\'page-url\'] }}" class="card-go-to">',
                '<span class="card-go-to__text card-go-to__text--go-to">go to</span>',
                '<span class="card-go-to__text">Jeju Island</span>',
            '</a>',

        '</div>'

    ].join('');

    var cardTemplateFn = doT.compile(cardTemplate);

    // var map;

    var pathToMapPoint = 'i/map/map-point.svg';

    function RegionMap() {

        var regionMap = this,
            mapNode = doc.querySelector('.js-google-promo-map');

        if (!mapNode) {
            return;
        }

        regionMap._mapNode = mapNode;

        regionMap._mapData = dataFromSetver;

        regionMap._map = new google.maps.Map(mapNode, {
            center: regionMap._mapData.data[0],
            zoom: 8
        });

        regionMap._markers = [];

        regionMap._addStyle();
        regionMap._addMarkers();

        google.maps.event.addDomListenerOnce(win, 'load', function onLoad() {
            $('img[src="' + pathToMapPoint + '"]').parent().addClass('region-map-point');
        });

        regionMap._map.addListener('click', function() {
            regionMap.hideAll();
        });

        if (!mapNode.classList.contains('js-do-not-click')) {
            google.maps.event.addListenerOnce(regionMap._map, 'tilesloaded', function(){
                new google.maps.event.trigger( regionMap._markers[0], 'mouseover');
                setTimeout(function () {
                    new google.maps.event.trigger( regionMap._markers[0], 'click' );
                }, 1000);
            });
        }

    }

    RegionMap.prototype.hideAll = function () {

        var regionMap = this;

        regionMap._markers.forEach(function (marker) {
            marker.set('icon', pathToMapPoint);
        });

        $('.map-point-clicked').removeClass('map-point-clicked');<commit_msg>maps - still in progress...<commit_after>(function (win, doc) {

    "use strict";

    var dataFromSetver = {
        "data": [
            {
                "lat": -25.363,
                "lng": 131.044,
                "country": "South Korea",
                "point": "Jeju Island",
                "description": "Sun bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region3",
                "preview": "img/promo-map/jeju-island.jpg",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    }
                ]
            },
            {
                "lat": -25.363 + 1,
                "lng": 131.044 + 1,
                "country": "South Korea 2",
                "point": "South Korea 2",
                "description": "Sun!!! bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region2",
                "preview": "img/promo-map/kyoto.jpg",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulssdf",
                        "description": "Tropical Fruit Worldasf"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulsfsa",
                        "description": "Tropical Fruit Worldasf"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoulsfas",
                        "description": "Tropical Fruit Worldsaf"
                    }
                ]
            },
            {
                "lat": -25.363 + 0.5,
                "lng": 131.044 + 0.5,
                "country": "South Korea 2",
                "point": "Jeju Island 2",
                "description": "Sun bathe peer out window, chatter at birds, lure them to mouth but purr while eating chew iPad power cord.",
                "page-url": "#link-to-region1",
                "preview": "img/promo-map/jeju-island.jpg?ee",
                "inner-cards": [
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    },
                    {
                        "img": "img/promo-map/point-preview.jpg",
                        "header": "Seoul",
                        "description": "Tropical Fruit World"
                    }
                ]
            }

        ],
        "meta": {
            "name": "Ebash karty, bleat\'!!!"
        }
    };

    var cardTemplate = [

        '<div class="point-card js-point-card">',

            '<a class="point-card__close js-point-card__close" href="#"></a>',
            '<h3 class="point-card__header">{{= it.country }}</h3>',
            '<h4 class="point-card__local-header">{{= it.point }}</h4>',
            '<p class="point-card__local-description">{{= it.description }}</p>',

            '<div class="scroll-area">',
                '<div class="scroll-area__content">',
                    '{{~ it[\'inner-cards\'] :item }}',
                    '<div class="region-preview-item">',
                        '<img src="{{= item.img }}" alt="" class="region-preview-item__image">',
                        '<h3 class="region-preview-item__header">{{= item.header }}</h3>',
                        '<p class="region-preview-item__paragraph">{{= item.description }}</p>',
                    '</div>',
                    '{{~}}',
                '</div>',
            '</div>',

            '<a href="{{= it[\'page-url\'] }}" class="card-go-to">',
                '<span class="card-go-to__text card-go-to__text--go-to">go to</span>',
                '<span class="card-go-to__text">Jeju Island</span>',
            '</a>',

        '</div>'

    ].join('');

    var cardTemplateFn = doT.compile(cardTemplate);

    // var map;

    var pathToMapPoint = 'i/map/map-point.svg';

    function RegionMap() {

        var regionMap = this,
            mapNode = doc.querySelector('.js-google-promo-map');

        if (!mapNode) {
            return;
        }

        regionMap._mapNode = mapNode;

        regionMap._mapData = dataFromSetver;

        regionMap._createMap();

/*
        regionMap._map = new google.maps.Map(mapNode, {
            center: regionMap._mapData.data[0],
            zoom: 8
        });
*/

        regionMap._markers = [];

        regionMap._addStyle();
        regionMap._addMarkers();

        google.maps.event.addDomListenerOnce(win, 'load', function onLoad() {
            $('img[src="' + pathToMapPoint + '"]').parent().addClass('region-map-point');
        });

        regionMap._map.addListener('click', function() {
            regionMap.hideAll();
        });

        if (!mapNode.classList.contains('js-do-not-click')) {
            google.maps.event.addListenerOnce(regionMap._map, 'tilesloaded', function(){
                new google.maps.event.trigger( regionMap._markers[0], 'mouseover');
                setTimeout(function () {
                    new google.maps.event.trigger( regionMap._markers[0], 'click' );
                }, 1000);
            });
        }

    }

    RegionMap.prototype._createMap = function () {


        // Create an array of styles.
        var styles = [
            {
                stylers: [
                    { color: "#95CC72" }
                ]
            },
            {
                featureType: "water",
                elementType: "geometry",
                stylers: [
                    // { hue: "#00ffe6" },
                    { color: "#C5F4FE" }
                    // { saturation: -20 }
                ]
            },
            {
                featureType: "all",
                elementType: "labels.text",
                stylers: [
                    { color: "#CC0000" }
                ]
            },
            {
                featureType: "all",
                elementType: "labels.text.fill",
                stylers: [
                    { color: "#FFFFFF" }
                ]
            }

        ];
/*
        var styles = [
            {
                stylers: [
                    { hue: "#00ffe6" },
                    { saturation: -20 }
                ]
            },
            {
                featureType: "road",
                elementType: "geometry",
                stylers: [
                    { lightness: 100 },
                    { visibility: "simplified" }
                ]
            },{
                featureType: "road",
                elementType: "labels",
                stylers: [
                    { visibility: "off" }
                ]
            }
        ];
*/

        // Create a new StyledMapType object, passing it the array of styles,
        // as well as the name to be displayed on the map type control.
        var styledMap = new google.maps.StyledMapType(styles,
            {name: "Styled Map"});

        // Create a map object, and include the MapTypeId to add
        // to the map type control.
        var regionMap = this;

        var mapOptions = {
            zoom: 4,
            center: regionMap._mapData.data[0],
            mapTypeControlOptions: {
                mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']
            }
        };

        var mapNode = doc.querySelector('.js-google-promo-map');

        var map = new google.maps.Map(mapNode,
            mapOptions);

        map.mapTypes.set('map_style', styledMap);
        map.setMapTypeId('map_style');

        regionMap._map = map;

    };

    RegionMap.prototype.hideAll = function () {

        var regionMap = this;

        regionMap._markers.forEach(function (marker) {
            marker.set('icon', pathToMapPoint);
        });

        $('.map-point-clicked').removeClass('map-point-clicked');
{'fraction_non_alphanumeric': 0.14393251135626217, 'fraction_numerical': 0.009409474367293965, 'mean_word_length': 1.1693412162162162, 'pattern_counts': {'":': 108, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6179303', 'n_tokens_mistral': 4386, 'n_tokens_neox': 4023, 'n_words': 789}