define("googleMap",["react","lodash","core","utils","reactDOM","santaProps"],function(a,b,c,d,e,f){"use strict";var g=c.compMixins;var h=["da","de","en","es","fr","it","ja","ko","nl","no","pl","pt","ru","sv","tr"];var i={pt:"pt-BR"};var j=function(a){var c=a.compProp.language;var e=c==="userLang"?d.wixUserApi.getLanguage(a.requestModelCookie,a.currentUrl):c;var f=b.includes(h,e)?e:"en";return i[f]||f};function k(a){return{address:a.compData.address,addressInfo:a.compData.addressInfo,mapType:a.compProp.mapType,mapInteractive:a.compProp.mapDragging,showZoom:a.compProp.showZoom,showStreetView:a.compProp.showStreetView,showMapType:a.compProp.showMapType,lat:a.compData.latitude,long:a.compData.longitude,ts:a.structure.layout.width+a.structure.layout.height,mapStyle:JSON.stringify(a.compData.mapStyle||[])}}function l(a){var b="language="+j(a);return a.santaBase+"/static/external/googleMap.html?"+b}return{displayName:"GoogleMap",mixins:[g.skinBasedComp],propTypes:{compData:f.Types.Component.compData.isRequired,compProp:f.Types.Component.compProp.isRequired,structure:f.Types.Component.structure.isRequired,requestModelCookie:f.Types.requestModel.cookie.isRequired,currentUrl:f.Types.currentUrl.isRequired,santaBase:f.Types.santaBase.isRequired,cannotHideIframeWithinRoundedCorners:f.Types.mobile.cannotHideIframeWithinRoundedCorners.isRequired},statics:{useSantaTypes:true},getInitialState:function(){var a={};if(this.props.cannotHideIframeWithinRoundedCorners){a.$corners="squared"}this.restartMap(this.props);return a},componentDidMount:function(){this.iFrameNode=e.findDOMNode(this.refs.iframe);this.iFrameNode.onload=function(){var a=k(this.props);this.updateMapParams(a)}.bind(this)},componentWillReceiveProps:function(a){var b=k(a);var c=j(this.props)===j(a);if(c){this.updateMapParams(b)}else{this.restartMap(a)}},updateMapParams:function(a){var b=e.findDOMNode(this.refs.iframe);b.contentWindow.postMessage(JSON.stringify(a),"*")},restartMap:function(a){this.iframeUrl=l(a)},getMapParamsFromProps:k,getSkinProperties:function(){return{mapContainer:{key:"mapContainer",children:[a.DOM.iframe({ref:"iframe",src:this.iframeUrl,width:"100%",height:"100%",frameBorder:"0",scrolling:"no","background-color":"red"})]}}}}});