<commit_before>/**
 * @fileoverview Description of file, its uses and information
 * about its dependencies.
 */

'use strict';

/**
 * @type {*|exports|module.exports}
 */
var cloud;

/**
 * @type {*|exports|module.exports}
 */
var backboneEvents;

/**
 * @type {*|exports|module.exports}
 */
var meta;

/**
 * @type {*|exports|module.exports}
 */
var advancedInfo;

/**
 * @type {*|exports|module.exports}
 */
var _layers;

/**
 * @type {*|exports|module.exports}
 */
var editor;

/**
 *
 * @type {*|exports|module.exports}
 */
var urlparser = require('./urlparser');

/**
 * @type {string}
 */
var db = urlparser.db;

var JSONSchemaForm = require("react-jsonschema-form");
const Form = JSONSchemaForm.default;

/**
 *
 * @type {string}
 */
var BACKEND = require('../../config/config.js').backend;


/**
 *
 * @type {{set: module.exports.set, init: module.exports.init, reset: module.exports.reset}}
 */
module.exports = {

    /**
     * @param o
     * @returns {exports}
     */
    set: function (o) {
        cloud = o.cloud;
        meta = o.meta;
        advancedInfo = o.advancedInfo;
        backboneEvents = o.backboneEvents;
        editor = o.editor;
        _layers = o.layers;
        return this;
    },

    /**
     *
     * @param qstore {array}
     * @param wkt {string}
     * @param proj {string}
     * @param callBack {string}
     * @param num {int}
     */
    init: function (qstore, wkt, proj, callBack, num) {
        var layers, count = {index: 0}, hit = false, distance,
            metaDataKeys = meta.getMetaDataKeys();

        this.reset(qstore);
        layers = _layers.getLayers() ? _layers.getLayers().split(",") : [];

        // Remove not queryable layers from array
        for (var i = layers.length - 1; i >= 0; i--) {
            if (typeof metaDataKeys[layers[i]] !== "undefined" && metaDataKeys[layers[i]].not_querable) {
                layers.splice(i, 1);
            }
        }

        /**
         * A default template for GC2, with a loop
         * @type {string}
         */
        var defaultTemplate =
            '<div class="cartodb-popup-content">' +
            '<button id="popup-edit-btn">Edit</button>' +
            '   {{#_vidi_content.fields}}' +
            '       {{#title}}<h4>{{title}}</h4>{{/title}}' +
            '       {{#value}}' +
            '           <p {{#type}}class="{{ type }}"{{/type}}>{{{ value }}}</p>' +
            '       {{/value}}' +
            '       {{^value}}' +
            '           <p class="empty">null</p>' +
            '       {{/value}}' +
            '   {{/_vidi_content.fields}}' +<commit_msg>comment out edit button<commit_after>/**
 * @fileoverview Description of file, its uses and information
 * about its dependencies.
 */

'use strict';

/**
 * @type {*|exports|module.exports}
 */
var cloud;

/**
 * @type {*|exports|module.exports}
 */
var backboneEvents;

/**
 * @type {*|exports|module.exports}
 */
var meta;

/**
 * @type {*|exports|module.exports}
 */
var advancedInfo;

/**
 * @type {*|exports|module.exports}
 */
var _layers;

/**
 * @type {*|exports|module.exports}
 */
var editor;

/**
 *
 * @type {*|exports|module.exports}
 */
var urlparser = require('./urlparser');

/**
 * @type {string}
 */
var db = urlparser.db;

var JSONSchemaForm = require("react-jsonschema-form");
const Form = JSONSchemaForm.default;

/**
 *
 * @type {string}
 */
var BACKEND = require('../../config/config.js').backend;


/**
 *
 * @type {{set: module.exports.set, init: module.exports.init, reset: module.exports.reset}}
 */
module.exports = {

    /**
     * @param o
     * @returns {exports}
     */
    set: function (o) {
        cloud = o.cloud;
        meta = o.meta;
        advancedInfo = o.advancedInfo;
        backboneEvents = o.backboneEvents;
        editor = o.editor;
        _layers = o.layers;
        return this;
    },

    /**
     *
     * @param qstore {array}
     * @param wkt {string}
     * @param proj {string}
     * @param callBack {string}
     * @param num {int}
     */
    init: function (qstore, wkt, proj, callBack, num) {
        var layers, count = {index: 0}, hit = false, distance,
            metaDataKeys = meta.getMetaDataKeys();

        this.reset(qstore);
        layers = _layers.getLayers() ? _layers.getLayers().split(",") : [];

        // Remove not queryable layers from array
        for (var i = layers.length - 1; i >= 0; i--) {
            if (typeof metaDataKeys[layers[i]] !== "undefined" && metaDataKeys[layers[i]].not_querable) {
                layers.splice(i, 1);
            }
        }

        /**
         * A default template for GC2, with a loop
         * @type {string}
         */
        var defaultTemplate =
            '<div class="cartodb-popup-content">' +
            '<!--<button id="popup-edit-btn">Edit</button>-->' +
            '   {{#_vidi_content.fields}}' +
            '       {{#title}}<h4>{{title}}</h4>{{/title}}' +
            '       {{#value}}' +
            '           <p {{#type}}class="{{ type }}"{{/type}}>{{{ value }}}</p>' +
            '       {{/value}}' +
            '       {{^value}}' +
            '           <p class="empty">null</p>' +
            '       {{/value}}' +
            '   {{/_vidi_content.fields}}' +
{'fraction_non_alphanumeric': 0.18870444571646633, 'fraction_numerical': 0.0026712459454302615, 'mean_word_length': 1.9920091324200913, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, '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': '330016', 'n_tokens_mistral': 1724, 'n_tokens_neox': 1676, 'n_words': 355}