{"version":3,"file":"mapsvg-front.umd.js","sources":["../js/mapsvg/Core/globals.js","../js/mapsvg/Map/default-options.ts","../js/mapsvg/Vendor/tinycolor.js","../js/mapsvg/Infrastructure/Server/Server.ts","../js/mapsvg/Core/Events.ts","../js/mapsvg/Core/ArrayIndexed.ts","../js/mapsvg/Infrastructure/Server/SchemaField.ts","../js/mapsvg/Infrastructure/Server/Schema.ts","../js/mapsvg/Infrastructure/Server/Query.ts","../js/mapsvg/Location/LocationAddress.ts","../js/mapsvg/Location/Location.ts","../js/mapsvg/Object/CustomObject.ts","../js/mapsvg/Core/Repository.ts","../js/mapsvg/Map/MapsRepository.ts","../js/mapsvg/Map/MapsV2Repository.ts","../js/mapsvg/Map/Converter.ts","../js/mapsvg/Core/ResizeSensor.ts","../js/mapsvg/Map/MapOptionsInterface.ts","../js/mapsvg/MapObject/MapObject.ts","../js/mapsvg/Marker/Marker.ts","../js/mapsvg/MarkerCluster/MarkerCluster.ts","../js/mapsvg/Region/Region.ts","../js/mapsvg/Infrastructure/Server/SchemaRepository.ts","../js/mapsvg/Core/Controller.ts","../js/mapsvg/Directory/Directory.ts","../js/mapsvg/Details/Details.ts","../js/mapsvg/FormBuilder/FormElements/FormElement.ts","../js/mapsvg/FormBuilder/FormElements/Checkbox/CheckboxFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Checkboxes/CheckboxesFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Date/DateFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Distance/DistanceFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Empty/EmptyFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Id/IdFormElement.ts","../js/vendor/sortable/sortable.min.js","../js/mapsvg/FormBuilder/FormElements/Images/ImagesFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Location/LocationFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Modal/ModalFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Post/PostFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Radio/RadioFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Regions/RegionsFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Save/SaveFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Search/SearchFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Select/SelectFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Status/StatusFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Textarea/TextareaFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Text/TextFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Title/TitleFormElement.ts","../js/mapsvg/FormBuilder/FormElements/Colorpicker/ColorPickerFormElement.ts","../js/mapsvg/FormBuilder/FormElements/FormElementFactory.ts","../js/mapsvg/FormBuilder/FormBuilder.ts","../js/mapsvg/Filters/Filters.ts","../js/mapsvg/Popover/Popover.ts","../js/mapsvg/Tooltips/Tooltip.ts","../js/mapsvg/Map/Map.ts"],"sourcesContent":["/**\n * Global MapSVG class. It contains all other MapSVG classes and some static methods.\n * @constructor\n * @example\n * var mapsvg = MapSVG.get(0); // get first map instance\n * var mapsvg2 = MapSVG.get(1); // get second map instance\n * var mapsvg3 = MapSVG.getById(123); // get map by ID\n *\n * var mapsvg = new MapSVG.Map(\"my-container\",{\n * source: \"/path/to/map.svg\"\n * });\n *\n * var marker = new MapSVG.Marker({\n * location: location,\n * mapsvg: mapsvg\n * });\n *\n * if(MapSVG.isPhone){\n * // do something special for mobile devices\n * }\n *\n *\n */\nvar MapSVG = function () {};\nconst $ = jQuery;\n\nMapSVG.formBuilder = {};\nMapSVG.mediaUploader = {};\n\nif (typeof wp !== \"undefined\" && typeof wp.media !== \"undefined\") {\n MapSVG.mediaUploader = wp.media({\n title: \"Choose images\",\n button: {\n text: \"Choose images\",\n },\n multiple: true,\n });\n}\n\n/**\n * Keeps loaded HBS templates\n * @type {Array}\n * @private\n * @static\n * @property\n */\nMapSVG.templatesLoaded = {};\n\n/**\n * Keeps URLs\n * @type {Array}\n * @private\n * @static\n * @property\n */\nif (typeof mapsvg_paths !== \"undefined\") {\n MapSVG.urls = mapsvg_paths;\n} else {\n MapSVG.urls = {};\n}\nif (typeof ajaxurl !== \"undefined\") {\n MapSVG.urls.ajaxurl = ajaxurl;\n}\n\n/**\n * Keeps map instances\n * @type {Array}\n * @private\n * @static\n * @property\n */\nMapSVG.instances = [];\n\nMapSVG.userAgent = navigator.userAgent.toLowerCase();\n\n/**\n * Determines if current device is touch-device\n * @type {boolean}\n * @static\n * @property\n */\nMapSVG.touchDevice =\n \"ontouchstart\" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\n// (MapSVG.userAgent.indexOf(\"ipad\") > -1) ||\n// (MapSVG.userAgent.indexOf(\"iphone\") > -1) ||\n// (MapSVG.userAgent.indexOf(\"ipod\") > -1) ||\n// (MapSVG.userAgent.indexOf(\"android\") > -1);\n\n/**\n * Determines if current device is iOS-device\n * @type {boolean}\n * @static\n * @property\n */\nMapSVG.ios =\n MapSVG.userAgent.indexOf(\"ipad\") > -1 ||\n MapSVG.userAgent.indexOf(\"iphone\") > -1 ||\n MapSVG.userAgent.indexOf(\"ipod\") > -1;\n\n/**\n * Determines if current device is Android-device\n * @type {boolean}\n * @static\n * @property\n */\nMapSVG.android = MapSVG.userAgent.indexOf(\"android\");\n\n/**\n * Determines if current device is mobile-device\n * @type {boolean}\n * @static\n * @property\n */\nMapSVG.isPhone = window.matchMedia(\"only screen and (max-width: 812px)\").matches;\n\n/**\n * Keeps browser information\n * @type {object}\n * @static\n * @property\n */\nMapSVG.browser = {};\nMapSVG.browser.ie =\n MapSVG.userAgent.indexOf(\"msie\") > -1 ||\n MapSVG.userAgent.indexOf(\"trident\") > -1 ||\n MapSVG.userAgent.indexOf(\"edge\") > -1\n ? {}\n : false;\nMapSVG.browser.firefox = MapSVG.userAgent.indexOf(\"firefox\") > -1;\nMapSVG.browser.safari =\n MapSVG.userAgent.indexOf(\"safari\") > -1 && MapSVG.userAgent.indexOf(\"chrome\") === -1;\n\n/**\n * Contains device information\n * @type {object}\n * @static\n * @property\n */\nvar ua = window.navigator.userAgent;\nMapSVG.device = {};\nMapSVG.device.ios = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);\nMapSVG.device.android = !!ua.match(/Android/i);\n\nif (!String.prototype.trim) {\n String.prototype.trim = function () {\n return this.replace(/^\\s+|\\s+$/g, \"\");\n };\n}\n\n/**\n * Converts mouse event object to x/y coordinates\n * @param e\n * @returns {{x: *, y: *}}\n */\nMapSVG.mouseCoords = function (e) {\n if (e.clientX) {\n return { x: e.clientX + $(document).scrollLeft(), y: e.clientY + $(document).scrollTop() };\n }\n if (e.pageX) {\n return { x: e.pageX, y: e.pageY };\n } else if (MapSVG.touchDevice) {\n e = e.originalEvent || e;\n return e.touches && e.touches[0]\n ? { x: e.touches[0].pageX, y: e.touches[0].pageY }\n : { x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY };\n }\n};\n\n/**\n * Adds new instance of the map\n * @param {MapSVG.Map} mapsvg\n */\nMapSVG.addInstance = function (mapsvg) {\n MapSVG.instances.push(mapsvg);\n};\n\nMapSVG.get = function (index) {\n return MapSVG.instances[index];\n};\n\nMapSVG.getById = function (id) {\n var instance = MapSVG.instances.filter(function (i) {\n return i.id == id;\n });\n if (instance.length > 0) {\n return instance[0];\n }\n};\n\nMapSVG.getByContainerId = function (id) {\n var instance = MapSVG.instances.filter(function (i) {\n return i.$map.attr(\"id\") == id;\n });\n if (instance.length > 0) {\n return instance[0];\n }\n};\n\nMapSVG.extend = function (sub, base) {\n sub.prototype = Object.create(base.prototype);\n sub.prototype.constructor = sub;\n};\n\nMapSVG.ucfirst = function (string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n};\nMapSVG.parseBoolean = function (string) {\n switch (String(string).toLowerCase()) {\n case \"on\":\n case \"true\":\n case \"1\":\n case \"yes\":\n case \"y\":\n return true;\n case \"off\":\n case \"false\":\n case \"0\":\n case \"no\":\n case \"n\":\n return false;\n default:\n return undefined;\n }\n};\nMapSVG.isNumber = function (n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n};\n\nMapSVG.safeURL = function (url) {\n if (url.indexOf(\"http://\") == 0 || url.indexOf(\"https://\") == 0)\n url = \"//\" + url.split(\"://\").pop();\n return url.replace(/^.*\\/\\/[^\\/]+/, \"\");\n};\n\nMapSVG.convertToText = function (obj) {\n //create an array that will later be joined into a string.\n var string = [];\n\n //is object\n // Both arrays and objects seem to return \"object\"\n // when typeof(obj) is applied to them. So instead\n // I am checking to see if they have the property\n // join, which normal objects don't have but\n // arrays do.\n if (obj === null) {\n return null;\n }\n if (obj === undefined) {\n return '\"\"';\n } else if (typeof obj == \"object\" && obj.join == undefined) {\n var prop;\n for (prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n var key = '\"' + prop.replace(/\\\"/g, '\\\\\"') + '\"'; //prop.search(/[^a-zA-Z]+/) === -1 ? prop : ...\n string.push(key + \": \" + MapSVG.convertToText(obj[prop]));\n }\n }\n return \"{\" + string.join(\",\") + \"}\";\n\n //is array\n } else if (typeof obj == \"object\" && !(obj.join == undefined)) {\n var prop;\n for (prop in obj) {\n string.push(MapSVG.convertToText(obj[prop]));\n }\n return \"[\" + string.join(\",\") + \"]\";\n\n //is function\n } else if (typeof obj == \"function\") {\n return obj.toString().replace(\"function anonymous\", \"function\");\n // string.push(obj.toString().replace('function anonymous','function'));\n\n //all other values can be done with JSON.stringify\n } else {\n return JSON.stringify(obj);\n // var s = JSON.stringify(obj);\n // string.push(s);\n }\n\n return string.join(\",\");\n};\n\n// Create Element.remove() function if not exists\nif (!(\"remove\" in Element.prototype)) {\n Element.prototype.remove = function () {\n if (this.parentNode) {\n this.parentNode.removeChild(this);\n }\n };\n}\n\nMath.hypot =\n Math.hypot ||\n function () {\n var y = 0;\n var length = arguments.length;\n\n for (var i = 0; i < length; i++) {\n if (arguments[i] === Infinity || arguments[i] === -Infinity) {\n return Infinity;\n }\n y += arguments[i] * arguments[i];\n }\n return Math.sqrt(y);\n };\nSVGElement.prototype.getTransformToElement =\n SVGElement.prototype.getTransformToElement ||\n function (toElement) {\n let value;\n try {\n value = toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());\n } catch (e) {\n return;\n }\n return value;\n };\n\nMap.prototype.toArray = function () {\n return Array.from(this, ([name, value]) => value);\n};\n\nMapSVG.ResizeSensor = class ResizeSensor {\n constructor(element, callback) {\n var _this = this;\n _this.element = element;\n _this.callback = callback;\n var style = getComputedStyle(element);\n var zIndex = parseInt(style.zIndex);\n if (isNaN(zIndex)) {\n zIndex = 0;\n }\n zIndex--;\n _this.expand = document.createElement(\"div\");\n _this.expand.style.position = \"absolute\";\n _this.expand.style.left = \"0px\";\n _this.expand.style.top = \"0px\";\n _this.expand.style.right = \"0px\";\n _this.expand.style.bottom = \"0px\";\n _this.expand.style.overflow = \"hidden\";\n _this.expand.style.zIndex = zIndex.toString();\n _this.expand.style.visibility = \"hidden\";\n var expandChild = document.createElement(\"div\");\n expandChild.style.position = \"absolute\";\n expandChild.style.left = \"0px\";\n expandChild.style.top = \"0px\";\n expandChild.style.width = \"10000000px\";\n expandChild.style.height = \"10000000px\";\n _this.expand.appendChild(expandChild);\n _this.shrink = document.createElement(\"div\");\n _this.shrink.style.position = \"absolute\";\n _this.shrink.style.left = \"0px\";\n _this.shrink.style.top = \"0px\";\n _this.shrink.style.right = \"0px\";\n _this.shrink.style.bottom = \"0px\";\n _this.shrink.style.overflow = \"hidden\";\n _this.shrink.style.zIndex = zIndex.toString();\n _this.shrink.style.visibility = \"hidden\";\n var shrinkChild = document.createElement(\"div\");\n shrinkChild.style.position = \"absolute\";\n shrinkChild.style.left = \"0px\";\n shrinkChild.style.top = \"0px\";\n shrinkChild.style.width = \"200%\";\n shrinkChild.style.height = \"200%\";\n _this.shrink.appendChild(shrinkChild);\n _this.element.appendChild(_this.expand);\n _this.element.appendChild(_this.shrink);\n var size = element.getBoundingClientRect();\n _this.currentWidth = size.width;\n _this.currentHeight = size.height;\n _this.setScroll();\n _this.expand.addEventListener(\"scroll\", function () {\n _this.onScroll();\n });\n _this.shrink.addEventListener(\"scroll\", function () {\n _this.onScroll();\n });\n }\n onScroll() {\n var _this = this;\n var size = _this.element.getBoundingClientRect();\n var newWidth = size.width;\n var newHeight = size.height;\n if (newWidth != _this.currentWidth || newHeight != _this.currentHeight) {\n _this.currentWidth = newWidth;\n _this.currentHeight = newHeight;\n _this.callback();\n }\n this.setScroll();\n }\n setScroll() {\n this.expand.scrollLeft = 10000000;\n this.expand.scrollTop = 10000000;\n this.shrink.scrollLeft = 10000000;\n this.shrink.scrollTop = 10000000;\n }\n destroy() {\n this.expand.remove();\n this.shrink.remove();\n }\n};\n\nMapSVG.nonce = function () {\n return mapsvg_runtime_vars.nonce;\n};\n\n/**\n * Adds # hash at the beginning of HEX color value\n * @param {String} color\n * @returns {String}\n * @private\n */\nMapSVG.fixColorHash = (color) => {\n const hexColorNoHash = new RegExp(/^([0-9a-f]{3}|[0-9a-f]{6})$/i);\n if (color && color.match(hexColorNoHash) !== null) {\n color = \"#\" + color;\n }\n return color;\n};\n\n/**\n * Delays method execution.\n * For example, it can be used in search input fields to prevent sending\n * an ajax request on each key press.\n * @param {Function} method\n * @param {number} delay\n * @param {object} scope\n * @param {array} params\n * @private\n */\nMapSVG.throttle = (method, delay, scope, params) => {\n clearTimeout(method._tId);\n method._tId = setTimeout(function () {\n method.apply(scope, params);\n }, delay);\n};\nMapSVG.geocode = (query, callback) => {\n if (!window.google) {\n console.error(\"MapSVG: can't do Geocoding - Google Maps API is not loaded.\");\n jQuery.growl.error({\n title: \"Error\",\n message: \"Google Maps API files are not loaded\",\n });\n return false;\n }\n // if (!MapSVG.options.google_api_key) {\n // jQuery.growl.error({\n // title: \"Error\",\n // message: \"Google Maps API key is not provided\",\n // });\n // return false;\n // }\n if (!MapSVG.geocoder) {\n MapSVG.geocoder = new google.maps.Geocoder();\n }\n\n MapSVG.throttle(MapSVG.geocoder.geocode, 500, MapSVG.geocoder, [\n query,\n function (results, status) {\n if (status === \"OK\") {\n callback(results);\n } else {\n jQuery.growl.error({\n title: \"Error: \" + status,\n message:\n \"There is some problem with Google API keys. See browser's console for more details\",\n });\n }\n },\n ]);\n};\n\nMapSVG.handleFailedRequest = (response) => {\n var message = \"\";\n\n if (response.status === 403) {\n if (response.responseText.indexOf(\"Wordfence\") !== -1) {\n message +=\n \"The request has been blocked by Wordfence. \" +\n 'Switch Wordfence to \"Learning mode\", and save the map settings again. ' +\n \"If the settings are saved successfully, you can switch Wordfence back to normal mode.\";\n } else {\n message +=\n \"The request has been blocked by your server. \" +\n \"Do you have mod_sec Apache's module enabled? If that's the case you need to change its settings.\";\n }\n } else {\n if (response && response.responseText) {\n try {\n var _response = JSON.parse(response.responseText);\n if (_response && _response.data && _response.data.error) {\n message = _response.data.error;\n }\n } catch (e) {\n null;\n }\n }\n }\n\n $.growl.error({\n title: \"Error: \" + response.status + \" \" + response.statusText,\n message: message,\n duration: 30000,\n });\n};\n\nif (!Object.values) {\n Object.values = function (object) {\n return Object.keys(object).map(function (k) {\n return object[k];\n });\n };\n}\n\nwindow.MapSVG = MapSVG;\n\nexport { MapSVG };\n","const defRegionTemplate =\n \"
This is the demo content of the Region %templateType%.
\\n\" +\n 'How to edit it: if you are in mapsvg control panel now, click on the following link to open the template editor for this view: Menu > Templates > Region %templateType%.
\\n' +\n 'More information about templates: mapsvg.com/docs/map-editor/templates
\\n' +\n \"Status: {{status_text}}
\\n\\n\" +\n \"\\n\" +\n \"{{#each objects}}\\n\\n\" +\n \" \\n\\n\" +\n \"{{{description}}}
\\n\" +\n \"{{location.address.formatted}}
\\n\\n\" +\n \" \\n\" +\n \" {{#each images}}\\n\" +\n ' \\n' +\n \" \\n\" +\n 'This is the demo content of the DB Object %templateType%.
\\n\" +\n 'How to edit it: if you are in mapsvg control panel now, click on the following link to open the template editor for this view: Menu > Templates > DB Object %templateType%.
\\n' +\n 'More information about templates: mapsvg.com/docs/map-editor/templates
\\n' +\n \"{{{description}}}
\\n\" +\n \"{{location.address.formatted}}
\\n\\n\" +\n \"\\n\" +\n \"{{#each images}}\\n\" +\n ' \\n' +\n \" \\n\" +\n 'Regions: \\n\" +\n \" {{#each regions}}\\n\" +\n \" \\n\" +\n \" {{#if title}}\\n\" +\n \" {{title}}\\n\" +\n \" {{else}}\\n\" +\n \" {{id}}\\n\" +\n \" {{/if}}{{#unless @last}}, {{/unless}}\\n\" +\n \" {{/each}}\\n\" +\n \"
\";\n\nconst dirItemItemTemplate =\n \"\\n\" +\n \"\\n\" +\n \"{{title}}\";\n\nconst DefaultOptions = {\n source: \"\",\n markerLastID: 0,\n regionLastID: 0,\n dataLastID: 1,\n disableAll: false,\n width: null,\n height: null,\n lockAspectRatio: false,\n padding: { top: 0, left: 0, right: 0, bottom: 0 },\n maxWidth: null,\n maxHeight: null,\n minWidth: null,\n minHeight: null,\n loadingText: \"Loading map...\",\n //colors : {base: \"#E1F1F1\", background: \"#eeeeee\", hover: \"#548eac\", selected: \"#065A85\", stroke: \"#7eadc0\"},\n colorsIgnore: false,\n colors: {\n baseDefault: \"#000000\",\n background: \"#eeeeee\",\n selected: 40,\n hover: 20,\n directory: \"#fafafa\",\n detailsView: \"\",\n status: {},\n clusters: \"\",\n clustersBorders: \"\",\n clustersText: \"\",\n clustersHover: \"\",\n clustersHoverBorders: \"\",\n clustersHoverText: \"\",\n markers: {\n base: { opacity: 100, saturation: 100 },\n hovered: { opacity: 100, saturation: 100 },\n unhovered: { opacity: 40, saturation: 100 },\n active: { opacity: 100, saturation: 100 },\n inactive: { opacity: 40, saturation: 100 },\n },\n },\n regions: {},\n clustering: { on: false },\n viewBox: [],\n cursor: \"default\",\n manualRegions: false,\n onClick: null,\n mouseOver: null,\n mouseOut: null,\n menuOnClick: null,\n beforeLoad: null,\n afterLoad: null,\n zoom: {\n on: true,\n limit: [0, 22],\n delta: 2,\n buttons: { on: true, location: \"right\" },\n mousewheel: true,\n fingers: true,\n hideSvg: false,\n hideSvgZoomLevel: 7,\n },\n scroll: { on: true, limit: false, background: false, spacebar: false },\n responsive: true,\n tooltips: { on: false, position: \"bottom-right\", template: \"\", maxWidth: \"\", minWidth: 100 },\n popovers: {\n on: false,\n position: \"top\",\n template: \"\",\n centerOn: true,\n width: 300,\n maxWidth: 50,\n maxHeight: 50,\n },\n multiSelect: false,\n regionStatuses: {\n \"1\": { label: \"Enabled\", value: \"1\", color: \"\", disabled: false },\n \"0\": { label: \"Disabled\", value: \"0\", color: \"\", disabled: true },\n },\n events: {\n afterLoad:\n \"function(){\\n\" +\n \" // var mapsvg = this;\\n\" +\n \" // var regions = mapsvg.regions;\\n\" +\n \" // var dbObjects = mapsvg.database.getLoaded();\\n\" +\n \"}\",\n beforeLoad:\n \"function(){\\n\" +\n \" // var mapsvg = this;\\n\" +\n \" // var settings = mapsvg.options;\\n\" +\n \" // console.log(settings);\\n\" +\n \"}\",\n databaseLoaded:\n \"function (){\\n\" +\n \" // var mapsvg = this;\\n\" +\n \" // var dbObjects = mapsvg.database.getLoaded();\\n\" +\n \"}\",\n \"click.region\":\n \"function (e, mapsvg){\\n\" +\n \" // var region = this;\\n\" +\n \" // console.log(region);\\n\" +\n \"}\",\n \"mouseover.region\":\n \"function (e, mapsvg){\\n\" +\n \" // var region = this;\\n\" +\n \" // console.log(region);\\n\" +\n \"}\",\n \"mouseout.region\":\n \"function (e, mapsvg){\\n\" +\n \" // var region = this;\\n\" +\n \" // console.log(region);\\n\" +\n \"}\",\n \"click.marker\":\n \"function (e, mapsvg){\\n\" +\n \" // var marker = this;\\n\" +\n \" // console.log(marker);\\n\" +\n \"}\",\n \"mouseover.marker\":\n \"function (e, mapsvg){\\n\" +\n \" // var marker = this;\\n\" +\n \" // console.log(marker);\\n\" +\n \"}\",\n \"mouseout.marker\":\n \"function (e, mapsvg){\\n\" +\n \" // var marker = this;\\n\" +\n \" // console.log(marker);\\n\" +\n \"}\",\n \"click.directoryItem\":\n \"function (e, regionOrObject, mapsvg){\\n\" + \" // var itemjQueryObject = this;\\n\" + \"}\",\n \"mouseover.directoryItem\":\n \"function (e, regionOrObject, mapsvg){\\n\" + \" // var itemjQueryObject = this;\\n\" + \"}\",\n \"mouseout.directoryItem\":\n \"function (e, regionOrObject, mapsvg){\\n\" + \" // var itemjQueryObject = this;\\n\" + \"}\",\n \"shown.popover\": \"function (mapsvg){\\n\" + \" // var popoverjQueryObject = this;\\n\" + \"}\",\n \"closed.popover\": \"function (mapsvg){\\n\" + \" // var popoverjQueryObject = this;\\n\" + \"}\",\n \"closed.detailsView\":\n \"function (mapsvg){\\n\" + \" // var detailsjQueryObject = this;\\n\" + \"}\",\n \"shown.detailsView\":\n \"function (mapsvg){\\n\" + \" // var detailsjQueryObject = this;\\n\" + \"}\",\n },\n css:\n \"#mapsvg-map-%id% .mapsvg-tooltip {\\n\\n}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-popover {\\n\\n}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-details-container {\\n\\n}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-directory-item {\\n\\n}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-region-label {\\n\" +\n \" /* background-color: rgba(255,255,255,.6); */\\n\" +\n \" font-size: 11px;\\n\" +\n \" padding: 3px 5px;\\n\" +\n \" border-radius: 4px;\\n\" +\n \"}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-marker-label {\\n\" +\n \" padding: 3px 5px;\\n\" +\n \" /*\\n\" +\n \" border-radius: 4px;\\n\" +\n \" background-color: white;\\n\" +\n \" margin-top: -4px;\\n\" +\n \" */\\n}\\n\" +\n \"#mapsvg-map-%id% .mapsvg-filters-wrap {\\n\\n}\\n\" +\n \"\\n\\n\\n\\n\\n\\n\",\n templates: {\n popoverRegion: defRegionTemplate\n .replace(/%templateType%/g, \"Popover\")\n .replace(/%templateTypeSnake%/g, \"popover\"),\n popoverMarker: defDBTemplate\n .replace(/%templateType%/g, \"Popover\")\n .replace(/%templateTypeSnake%/g, \"popover\"),\n tooltipRegion: \"\\n{{id}} - {{title}}\",\n tooltipMarker: \"\\n{{title}}\",\n directoryItem: dirItemItemTemplate,\n directoryCategoryItem:\n '\\n{{label}}\\n{{counter}}\\n',\n detailsView: defDBTemplate\n .replace(/%templateType%/g, \"Details View\")\n .replace(/%templateTypeSnake%/g, \"detailsView\"),\n detailsViewRegion: defRegionTemplate\n .replace(/%templateType%/g, \"Details View\")\n .replace(/%templateTypeSnake%/g, \"detailsView\"),\n labelMarker: \"\\n{{title}}\",\n labelRegion: \"\\n{{title}}\",\n labelLocation: \"You are here!\",\n },\n choropleth: {\n on: false,\n source: \"regions\",\n sourceFieldSelect: {\n on: false,\n variants: [],\n },\n bubbleMode: false,\n bubbleSize: {\n min: 20,\n max: 40,\n },\n labels: { low: \"low\", high: \"high\" },\n colors: { lowRGB: null, highRGB: null, low: \"#550000\", high: \"#ee0000\", noData: \"#333333\" },\n min: 0,\n max: 0,\n coloring: {\n mode: \"gradient\",\n noData: {\n color: \"#999999\",\n description: \"No data\",\n },\n gradient: {\n colors: {\n lowRGB: null,\n highRGB: null,\n diffRGB: null,\n low: \"#550000\",\n high: \"#ee0000\",\n },\n labels: {\n low: \"low\",\n high: \"high\",\n },\n values: {\n min: null,\n max: null,\n maxAdjusted: null,\n },\n },\n palette: {\n outOfRange: {\n color: \"#ececec\",\n description: \"Out of range\",\n },\n colors: [\n {\n color: \"#550000\",\n valueFrom: 0,\n valueTo: 50,\n description: \"\",\n },\n ],\n },\n legend: {\n on: true,\n layout: \"vertical\",\n container: \"bottom-left\",\n title: \"Choropleth map\",\n text: \"\",\n description: \"\",\n width: \"20%\",\n height: \"20%\",\n },\n },\n },\n filters: {\n on: true,\n source: \"database\",\n location: \"header\",\n modalLocation: \"map\",\n width: \"100%\",\n hide: false,\n showButtonText: \"Filters\",\n clearButtonText: \"Clear all\",\n clearButton: false,\n searchButton: false,\n searchButtonText: \"Search\",\n padding: \"\",\n },\n menu: {\n on: false,\n hideOnMobile: true,\n location: \"leftSidebar\",\n locationMobile: \"leftSidebar\",\n search: false,\n containerId: \"\",\n searchPlaceholder: \"Search...\",\n searchFallback: false,\n source: \"database\",\n showFirst: \"map\",\n showMapOnClick: true,\n minHeight: \"400\",\n sortBy: \"id\",\n sortDirection: \"desc\",\n categories: {\n on: false,\n groupBy: \"\",\n hideEmpty: true,\n collapse: true,\n collapseOther: true,\n },\n clickActions: {\n region: \"default\",\n marker: \"default\",\n directoryItem: {\n triggerClick: true,\n showPopover: false,\n showDetails: true,\n },\n },\n detailsViewLocation: \"overDirectory\",\n noResultsText: \"No results found\",\n filterout: { field: \"\", cond: \"=\", val: \"\" },\n },\n database: {\n pagination: {\n on: true,\n perpage: 30,\n next: \"Next\",\n prev: \"Prev.\",\n showIn: \"both\",\n },\n loadOnStart: true,\n table: \"\",\n },\n actions: {\n map: {\n afterLoad: {\n selectRegion: false,\n },\n },\n region: {\n mouseover: {\n showTooltip: false,\n },\n click: {\n addIdToUrl: false,\n showDetails: true,\n showDetailsFor: \"region\",\n filterDirectory: false,\n loadObjects: false,\n showPopover: false,\n showPopoverFor: \"region\",\n goToLink: false,\n linkField: \"Region.link\",\n },\n touch: {\n showPopover: false,\n },\n },\n marker: {\n mouseover: {\n showTooltip: false,\n },\n click: {\n showDetails: true,\n showPopover: false,\n goToLink: false,\n linkField: \"Object.link\",\n },\n touch: {\n showPopover: false,\n },\n },\n directoryItem: {\n click: {\n showDetails: true,\n showPopover: false,\n goToLink: false,\n selectRegion: true,\n fireRegionOnClick: true,\n linkField: \"Object.link\",\n },\n hover: {\n centerOnMarker: false,\n },\n },\n },\n detailsView: {\n location: \"map\",\n containerId: \"\",\n width: \"100%\",\n mobileFullscreen: true,\n },\n mobileView: {\n labelMap: \"Map\",\n labelList: \"List\",\n labelClose: \"Close\",\n },\n googleMaps: {\n on: false,\n apiKey: \"\",\n loaded: false,\n center: \"auto\", // or {lat: 12, lon: 13}\n type: \"roadmap\",\n minZoom: 1,\n style: \"default\",\n styleJSON: [],\n language: \"en\",\n },\n groups: [],\n floors: [],\n layersControl: {\n on: false,\n position: \"top-left\",\n label: \"Show on map\",\n expanded: true,\n maxHeight: \"100%\",\n },\n floorsControl: {\n on: false,\n position: \"top-left\",\n label: \"Floors\",\n expanded: false,\n maxHeight: \"100%\",\n },\n containers: {\n leftSidebar: { on: false, width: \"250px\" },\n rightSidebar: { on: false, width: \"250px\" },\n header: { on: true, height: \"auto\" },\n footer: { on: false, height: \"auto\" },\n },\n labelsMarkers: { on: false },\n labelsRegions: { on: false },\n svgFileVersion: 1,\n fitMarkers: false,\n fitMarkersOnStart: false,\n fitSingleMarkerZoom: 20,\n controls: {\n location: \"right\",\n zoom: true,\n zoomReset: false,\n userLocation: false,\n previousMap: false,\n },\n previousMapsIds: [],\n};\n\nexport { DefaultOptions };\n","// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n//(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor(color, opts) {\n color = color ? color : \"\";\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n (this._originalInput = color),\n (this._r = rgb.r),\n (this._g = rgb.g),\n (this._b = rgb.b),\n (this._a = rgb.a),\n (this._roundA = mathRound(100 * this._a) / 100),\n (this._format = opts.format || rgb.format);\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) {\n this._r = mathRound(this._r);\n }\n if (this._g < 1) {\n this._g = mathRound(this._g);\n }\n if (this._b < 1) {\n this._b = mathRound(this._b);\n }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function () {\n return this.getBrightness() < 128;\n },\n isLight: function () {\n return !this.isDark();\n },\n isValid: function () {\n return this._ok;\n },\n getOriginalInput: function () {\n return this._originalInput;\n },\n getFormat: function () {\n return this._format;\n },\n getAlpha: function () {\n return this._a;\n },\n getBrightness: function () {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function () {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r / 255;\n GsRGB = rgb.g / 255;\n BsRGB = rgb.b / 255;\n\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n } else {\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n } else {\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n } else {\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n },\n setAlpha: function (value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100 * this._a) / 100;\n return this;\n },\n toHsv: function () {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function () {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360),\n s = mathRound(hsv.s * 100),\n v = mathRound(hsv.v * 100);\n return this._a == 1\n ? \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\"\n : \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \" + this._roundA + \")\";\n },\n toHsl: function () {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function () {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360),\n s = mathRound(hsl.s * 100),\n l = mathRound(hsl.l * 100);\n return this._a == 1\n ? \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\"\n : \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \" + this._roundA + \")\";\n },\n toHex: function (allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function (allow3Char) {\n return \"#\" + this.toHex(allow3Char);\n },\n toHex8: function (allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function (allow4Char) {\n return \"#\" + this.toHex8(allow4Char);\n },\n toRgb: function () {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function () {\n return this._a == 1\n ? \"rgb(\" +\n mathRound(this._r) +\n \", \" +\n mathRound(this._g) +\n \", \" +\n mathRound(this._b) +\n \")\"\n : \"rgba(\" +\n mathRound(this._r) +\n \", \" +\n mathRound(this._g) +\n \", \" +\n mathRound(this._b) +\n \", \" +\n this._roundA +\n \")\";\n },\n toPercentageRgb: function () {\n return {\n r: mathRound(bound01(this._r, 255) * 100) + \"%\",\n g: mathRound(bound01(this._g, 255) * 100) + \"%\",\n b: mathRound(bound01(this._b, 255) * 100) + \"%\",\n a: this._a,\n };\n },\n toPercentageRgbString: function () {\n return this._a == 1\n ? \"rgb(\" +\n mathRound(bound01(this._r, 255) * 100) +\n \"%, \" +\n mathRound(bound01(this._g, 255) * 100) +\n \"%, \" +\n mathRound(bound01(this._b, 255) * 100) +\n \"%)\"\n : \"rgba(\" +\n mathRound(bound01(this._r, 255) * 100) +\n \"%, \" +\n mathRound(bound01(this._g, 255) * 100) +\n \"%, \" +\n mathRound(bound01(this._b, 255) * 100) +\n \"%, \" +\n this._roundA +\n \")\";\n },\n toName: function () {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function (secondColor) {\n var hex8String = \"#\" + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = \"#\" + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return (\n \"progid:DXImageTransform.Microsoft.gradient(\" +\n gradientType +\n \"startColorstr=\" +\n hex8String +\n \",endColorstr=\" +\n secondHex8String +\n \")\"\n );\n },\n toString: function (format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat =\n !formatSet &&\n hasAlpha &&\n (format === \"hex\" ||\n format === \"hex6\" ||\n format === \"hex3\" ||\n format === \"hex4\" ||\n format === \"hex8\" ||\n format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function () {\n return tinycolor(this.toString());\n },\n\n _applyModification: function (fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function () {\n return this._applyModification(lighten, arguments);\n },\n brighten: function () {\n return this._applyModification(brighten, arguments);\n },\n darken: function () {\n return this._applyModification(darken, arguments);\n },\n desaturate: function () {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function () {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function () {\n return this._applyModification(greyscale, arguments);\n },\n spin: function () {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function (fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function () {\n return this._applyCombination(analogous, arguments);\n },\n complement: function () {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function () {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function () {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function () {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function () {\n return this._applyCombination(tetrad, arguments);\n },\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function (color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a,\n };\n}\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n//