/*! For license information please see content_maps.js.LICENSE.txt */ (()=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(e)}function e(r){return function(r){if(Array.isArray(r))return y(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||d(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.push.apply(n,t)}return n}function t(r){for(var e=1;e3?(o=d===t)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=r):i[0]<=h&&((o=n<2&&ht||t>d)&&(i[4]=n,i[5]=t,p.n=d,a=0))}if(o||n>1)return c;throw f=!0,t}return function(o,u,d){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,d),a=u,s=d;(e=a<2?r:s)||!f;){i||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(l=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=r}else if((e=(f=p.n<0)?s:n.call(t,p))!==c)break}catch(e){i=r,a=1,s=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),u}var c={};function l(){}function u(){}function f(){}e=Object.getPrototypeOf;var p=[][t]?e(e([][t]())):(a(e={},t,function(){return this}),e),h=f.prototype=l.prototype=Object.create(p);function d(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,a(r,o,"GeneratorFunction")),r.prototype=Object.create(h),r}return u.prototype=f,a(h,"constructor",f),a(f,"constructor",u),u.displayName="GeneratorFunction",a(f,o,"GeneratorFunction"),a(h),a(h,o,"Generator"),a(h,t,function(){return this}),a(h,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:d}})()}function a(r,e,n,t){var o=Object.defineProperty;try{o({},"",{})}catch(r){o=0}a=function(r,e,n,t){function i(e,n){a(r,e,function(r){return this._invoke(e,n,r)})}e?o?o(r,e,{value:n,enumerable:!t,configurable:!t,writable:!t}):r[e]=n:(i("next",0),i("throw",1),i("return",2))},a(r,e,n,t)}function s(r,e,n,t,o,i,a){try{var s=r[i](a),c=s.value}catch(r){return void n(r)}s.done?e(c):Promise.resolve(c).then(t,o)}function c(r){return function(){var e=this,n=arguments;return new Promise(function(t,o){var i=r.apply(e,n);function a(r){s(i,t,o,a,c,"next",r)}function c(r){s(i,t,o,a,c,"throw",r)}a(void 0)})}}function l(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function u(r,e){for(var n=0;nr.length)&&(e=r.length);for(var n=0,t=Array(e);n1?(e=this.config.addresses.filter(function(r){return r.lat&&r.lng&&r.address}),this.mapEl.innerHTML="",n=this.googleMapsClass.MapClass,t=e[0],this.map=new n(this.mapEl,{zoom:this.config.zoom,mapTypeId:this.config.style,mapId:"DEMO_MAP_ID",center:{lat:parseFloat(t.lat),lng:parseFloat(t.lng)}}),this.addMarkers(e),this.isInitialized=!0):(this.useTemplate(),this.isInitialized=!0),r.n=3;break;case 2:throw r.p=2,o=r.v,console.error("Error creando el mapa:",o),o;case 3:return r.a(2)}},r,this,[[1,2]])})),function(){return r.apply(this,arguments)})},{key:"addMarkers",value:function(r){var e=this;r.forEach(function(r){e.addMarker(r)})}},{key:"addMarker",value:function(r){var e=this;if(!this.map)return p("Mapa no inicializado"),this;if(!r.lat||!r.lng)return p("Marcador no tiene coordenadas o dirección"),this;var n=this.googleMapsClass.MarkerClass,t=this.googleMapsClass.InfoWindowClass,o=new n({position:{lat:parseFloat(r.lat),lng:parseFloat(r.lng)},map:this.map,title:r.title||""});if(r.title){var i,a=new t({content:null!==(i=r.description)&&void 0!==i?i:"",headerContent:r.title});o.addListener("click",function(){e.closeAllInfoWindows(),a.open(e.map,o)}),o.infoWindow=a}return this.markers.push(o),this}},{key:"closeAllInfoWindows",value:function(){this.markers.forEach(function(r){r.infoWindow&&r.infoWindow.close()})}},{key:"clearMarkers",value:function(){return this.markers.forEach(function(r){return r.setMap(null)}),this.markers=[],this}},{key:"useTemplate",value:function(){var r,e;arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.destroy();var n=null!==(r=null===(e=this.config.addresses[0])||void 0===e?void 0:e.address)&&void 0!==r?r:"",t="satellite"===this.config.style?"&t=k":"",o=this.config.zoom,i='\n \n ');this.mapEl.innerHTML=i}},{key:"destroy",value:function(){this.clearMarkers(),this.map&&(this.map=null),this.isInitialized=!1}}]);var r,e,n}(),g=function(){return f(function r(){l(this,r),this.instances=[],this.apiLoaded=!1,this.apiKey="AIzaSyAAIoF1gXu5yHUHejMBx_oxkFvQMalNFsw",this.loadingPromise=null,this.isDestroyed=!1,y.init()},[{key:"loadGoogleMapsAPI",value:(h=c(i().m(function r(){var e,t,o,a,s,c,l,f;return i().w(function(r){for(;;)switch(r.p=r.n){case 0:if(!(this.apiLoaded||null!==(e=n.google)&&void 0!==e&&e.maps)){r.n=1;break}return this.apiLoaded=!0,r.a(2,Promise.resolve());case 1:if(this.apiKey){r.n=2;break}throw new Error("Google Maps API key no configurada");case 2:if(r.p=2,null!==(t=n.google)&&void 0!==t&&null!==(t=t.maps)&&void 0!==t&&t.importLibrary){r.n=3;break}return r.n=3,this.initDynamicLoader();case 3:return r.n=4,google.maps.importLibrary("maps");case 4:return o=r.v,a=o.Map,s=o.InfoWindow,r.n=5,google.maps.importLibrary("marker");case 5:return c=r.v,l=c.AdvancedMarkerElement,this.MapClass=a,this.MarkerClass=l,this.InfoWindowClass=s,this.apiLoaded=!0,u("Google Maps API cargada correctamente con Dynamic Loader"),r.a(2);case 6:throw r.p=6,f=r.v,d("Error cargando Google Maps API"),new Error("Error cargando Google Maps API: ".concat(f.message));case 7:return r.a(2)}},r,this,[[2,6]])})),function(){return h.apply(this,arguments)})},{key:"initDynamicLoader",value:(p=c(i().m(function r(){var e=this;return i().w(function(r){for(;;)if(0===r.n)return r.a(2,new Promise(function(r){var t;if(null!==(t=n.google)&&void 0!==t&&null!==(t=t.maps)&&void 0!==t&&t.importLibrary)r();else{var i=o.createElement("script"),a=e.apiKey;i.textContent='\n (g=>{\n var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;\n b=b[c]||(b[c]={});\n var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,\n u=()=>h||(h=new Promise(async(f,n)=>{\n await (a=m.createElement("script"));\n e.set("libraries",[...r]+"");\n for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);\n e.set("callback",c+".maps."+q);\n a.src=`https://maps.${c}apis.com/maps/api/js?`+e;\n d[q]=f;\n a.onerror=()=>h=n(Error(p+" could not load."));\n a.nonce=m.querySelector("script[nonce]")?.nonce||"";\n m.head.append(a)\n }));\n d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))\n })({\n key: "'.concat(a,'",\n v: "weekly",\n });\n '),o.head.appendChild(i),r()}}))},r)})),function(){return p.apply(this,arguments)})},{key:"initAll",value:(s=c(i().m(function r(){var n,t,a,s,c,l,f=this,p=arguments;return i().w(function(r){for(;;)switch(r.p=r.n){case 0:if(n=p.length>0&&void 0!==p[0]?p[0]:"[data-component-maps][data-ss-maps]",!this.isDestroyed){r.n=1;break}throw new Error("El SDK ha sido destruido");case 1:if(0!==(t=o.querySelectorAll(n)).length){r.n=2;break}return u("No se encontraron mapas para inicializar"),r.a(2,[]);case 2:return r.p=2,r.n=3,this.loadGoogleMapsAPI();case 3:r.n=5;break;case 4:throw r.p=4,c=r.v,d("Error cargando Google Maps API:",c),c;case 5:return r.p=5,s=Array.from(t).map(function(r){return new v(r,f)}),(a=this.instances).push.apply(a,e(s)),u("".concat(s.length," mapas inicializados")),r.a(2,s);case 6:throw r.p=6,l=r.v,d("Error en inicialización masiva:",l),l;case 7:return r.a(2)}},r,this,[[5,6],[2,4]])})),function(){return s.apply(this,arguments)})},{key:"init",value:(a=c(i().m(function e(n){var t;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.loadGoogleMapsAPI();case 1:if("string"!=typeof n){e.n=3;break}if(t=o.querySelector(n)){e.n=2;break}throw new Error("Elemento no encontrado: ".concat(n));case 2:return e.a(2,this.addMap(t));case 3:if("object"!==r(n)){e.n=4;break}return e.a(2,this.addMap(n));case 4:throw new Error("Target debe ser un selector CSS o elemento HTML");case 5:return e.a(2)}},e,this)})),function(r){return a.apply(this,arguments)})},{key:"addMap",value:(t=c(i().m(function r(e){var n;return i().w(function(r){for(;;)switch(r.n){case 0:if(!this.isDestroyed){r.n=1;break}throw new Error("El SDK ha sido destruido");case 1:return r.n=2,this.loadGoogleMapsAPI();case 2:return n=new v(e,this),this.instances.push(n),r.a(2,n)}},r,this)})),function(r){return t.apply(this,arguments)})},{key:"destroyMap",value:function(r){var e=this.getInstance(r);e&&(e.destroy(),this.instances=this.instances.filter(function(e){return e.mapEl!==r}))}},{key:"getInstance",value:function(r){return this.instances.find(function(e){return e.mapEl===r})}},{key:"destroy",value:function(){u("Destruyendo SDK..."),this.instances.forEach(function(r){try{r.destroy()}catch(r){d("Error destruyendo instancia:",r)}}),this.instances=[],this.apiLoaded=!1,this.apiKey=null,this.loadingPromise=null,this.isDestroyed=!0,y.destroy(),u("SDK destruido")}}]);var t,a,s,p,h}(),b=new g,w=a;n[w]||(n[w]={}),n[w].GoogleMaps=b,o.addEventListener("DOMContentLoaded",function(){s&&b.initAll().catch(function(r){d("Error en auto-inicialización:",r)})})}(window,document)})();