diff --git a/app/assets/javascripts/darkswarm/all.js.coffee b/app/assets/javascripts/darkswarm/all.js.coffee index e7a53a9268..f6baa6f5bf 100644 --- a/app/assets/javascripts/darkswarm/all.js.coffee +++ b/app/assets/javascripts/darkswarm/all.js.coffee @@ -11,8 +11,9 @@ #= require leaflet-1.6.0.js #= require leaflet-providers.js #= require lodash.underscore.js -# bluebird.js is a dependency of angular-google-maps.js 2.0.0 +# bluebird.js and angular-simple-logger are dependencies of angular-google-maps.js 2.0.0 #= require bluebird.js +#= require angular-simple-logger.min.js #= require angular-scroll.min.js #= require angular-google-maps.min.js #= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js @@ -58,4 +59,4 @@ $ -> # Hacky fix for issue - http://foundation.zurb.com/forum/posts/2112-foundation-5100-syntax-error-in-js Foundation.set_namespace "" - $(document).foundation() + $(document).foundation() \ No newline at end of file diff --git a/app/assets/javascripts/darkswarm/controllers/registration/registration_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/registration/registration_controller.js.coffee index c935461d91..276f9da3fe 100644 --- a/app/assets/javascripts/darkswarm/controllers/registration/registration_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/registration/registration_controller.js.coffee @@ -1,9 +1,12 @@ -Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries) -> +Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries, GmapsGeo) -> $scope.currentStep = RegistrationService.currentStep $scope.enterprise = EnterpriseRegistrationService.enterprise $scope.select = RegistrationService.select - + $scope.geocodedAddress = '' + $scope.latLong = null + $scope.addressConfirmed $scope.steps = ['details', 'contact', 'type', 'about', 'images', 'social'] + $scope.enableMapConfirm = GmapsGeo and GmapsGeo.OK # Filter countries without states since the form requires a state to be selected. # Consider changing the form to require a state only if a country requires them (Spree option). @@ -22,3 +25,26 @@ Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, Enterpris $scope.countryHasStates = -> $scope.enterprise.country.states.length > 0 + + $scope.map = {center: {latitude: 0.000000, longitude: 0.000000 }, zoom: 1} + $scope.options = {scrollwheel: false} + $scope.locateAddress = () -> + { address1, address2, city, state_id, zipcode } = $scope.enterprise.address + addressQuery = [address1, address2, city, state_id, zipcode].filter((value) => !!value).join(", ") + GmapsGeo.geocode addressQuery, (results, status) => + $scope.geocodedAddress = results && results[0]?.formatted_address + location = results[0]?.geometry?.location + if location + $scope.$apply(() => + $scope.latLong = {latitude: location.lat(), longitude: location.lng()} + $scope.map = {center: {latitude: location.lat(), longitude: location.lng()}, zoom: 16 } + ) + + $scope.confirmAddressChange = (isConfirmed) -> + $scope.addressConfirmed = isConfirmed + if isConfirmed + $scope.enterprise.address.latitude = $scope.latLong.latitude + $scope.enterprise.address.longitude = $scope.latLong.longitude + else + $scope.enterprise.address.latitude = null + $scope.enterprise.address.longitude = null diff --git a/app/assets/stylesheets/darkswarm/registration.scss b/app/assets/stylesheets/darkswarm/registration.scss index f97f2b9271..1486e644c4 100644 --- a/app/assets/stylesheets/darkswarm/registration.scss +++ b/app/assets/stylesheets/darkswarm/registration.scss @@ -167,6 +167,26 @@ height: 166px; } } + + .map-container--registration { + width: 100%; + height: 244px; + margin-bottom: 1em; + + map, .angular-google-map-container, google-map, .angular-google-map { + display: block; + height: 220px; + width: 100%; + } + } + + .center { + justify-content: center; + } + + .button.primary { + border-radius: 0; + } } #registration-type { diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 135358fdc7..c902490edd 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -100,7 +100,6 @@ class Enterprise < ActiveRecord::Base before_validation :initialize_permalink, if: lambda { permalink.nil? } before_validation :set_unused_address_fields - after_validation :geocode_address after_validation :ensure_owner_is_manager, if: lambda { owner_id_changed? && !owner_id.nil? } after_touch :touch_distributors diff --git a/app/models/spree/address.rb b/app/models/spree/address.rb index 5dbd0dd535..b8cc969cc4 100644 --- a/app/models/spree/address.rb +++ b/app/models/spree/address.rb @@ -10,12 +10,16 @@ module Spree has_one :enterprise, dependent: :restrict_with_exception has_many :shipments + before_validation :geocode, if: :use_geocoder? + validates :firstname, :lastname, :address1, :city, :country, presence: true validates :zipcode, presence: true, if: :require_zipcode? validates :phone, presence: true, if: :require_phone? validate :state_validate + attr_accessor :use_geocoder + after_save :touch_enterprise alias_attribute :first_name, :firstname @@ -107,6 +111,10 @@ module Spree private + def use_geocoder? + @use_geocoder == true || @use_geocoder == 'true' || @use_geocoder == '1' + end + def require_phone? true end diff --git a/app/services/permitted_attributes/address.rb b/app/services/permitted_attributes/address.rb index 4c7a538caf..a527efb22d 100644 --- a/app/services/permitted_attributes/address.rb +++ b/app/services/permitted_attributes/address.rb @@ -6,7 +6,8 @@ module PermittedAttributes [ :firstname, :lastname, :address1, :address2, :city, :country_id, :state_id, :zipcode, - :phone, :state_name, :alternative_phone, :company + :phone, :state_name, :alternative_phone, :company, + :latitude, :longitude, :use_geocoder ] end end diff --git a/app/views/admin/enterprises/_new_form.html.haml b/app/views/admin/enterprises/_new_form.html.haml index 84102ce63b..de522c5a7a 100644 --- a/app/views/admin/enterprises/_new_form.html.haml +++ b/app/views/admin/enterprises/_new_form.html.haml @@ -97,10 +97,28 @@ %input.ofn-select2.fullwidth#enterprise_address_attributes_state_id{ name: 'enterprise[address_attributes][state_id]', type: 'number', data: 'countriesById[Enterprise.address.country_id].states', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.state_id' } } .five.columns.omega %input.ofn-select2.fullwidth#enterprise_address_attributes_country_id{ name: 'enterprise[address_attributes][country_id]', type: 'number', data: 'countries', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.country_id' } } - + .row + .three.columns.alpha + = af.label :latitude, t(:latitude) + \/ + = af.label :longitude, t(:longitude) + %span.required * + %div{'ofn-with-tip' => t('latitude_longitude_tip')} + %a= t('admin.whats_this') + .four.columns + = af.text_field :latitude, { placeholder: t(:latitude_placeholder) } + .four.columns.omega + = af.text_field :longitude, { placeholder: t(:longitude_placeholder) } + .row + .three.columns.alpha + = " ".html_safe + .five.columns.omega + = af.check_box :use_geocoder + = af.label :use_geocoder, t('use_geocoder') .row .twelve.columns.alpha   .row .twelve.columns.alpha = render partial: "spree/admin/shared/new_resource_links" + \ No newline at end of file diff --git a/app/views/admin/enterprises/form/_address.html.haml b/app/views/admin/enterprises/form/_address.html.haml index 88dc9f6520..ee728cb545 100644 --- a/app/views/admin/enterprises/form/_address.html.haml +++ b/app/views/admin/enterprises/form/_address.html.haml @@ -35,3 +35,21 @@ %input.ofn-select2.fullwidth#enterprise_address_attributes_state_id{ name: 'enterprise[address_attributes][state_id]', type: 'number', data: 'countriesById[Enterprise.address.country_id].states', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.state_id' } } .four.columns.omega{ "ng-controller" => "countryCtrl" } %input.ofn-select2.fullwidth#enterprise_address_attributes_country_id{ name: 'enterprise[address_attributes][country_id]', type: 'number', data: 'countries', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.country_id' } } +.row + .three.columns.alpha + = af.label :latitude, t(:latitude) + \/ + = af.label :longitude, t(:longitude) + %span.required * + %div{'ofn-with-tip' => t('latitude_longitude_tip')} + %a= t('admin.whats_this') + .four.columns + = af.text_field :latitude, { placeholder: t(:latitude_placeholder) } + .four.columns.omega + = af.text_field :longitude, { placeholder: t(:longitude_placeholder) } +.row + .three.columns.alpha + = " ".html_safe + .five.columns.omega + = af.check_box :use_geocoder + = af.label :use_geocoder, t('use_geocoder') \ No newline at end of file diff --git a/app/views/layouts/registration.html.haml b/app/views/layouts/registration.html.haml index e3faffe939..a60c58f2e1 100644 --- a/app/views/layouts/registration.html.haml +++ b/app/views/layouts/registration.html.haml @@ -27,7 +27,7 @@ #footer %loading - %script{src: "//maps.googleapis.com/maps/api/js?libraries=places"} + %script{src: "//maps.googleapis.com/maps/api/js?libraries=places#{ ENV['GOOGLE_MAPS_API_KEY'] ? '&key=' + ENV['GOOGLE_MAPS_API_KEY'] : ''}"} = javascript_include_tag "darkswarm/all" = yield :scripts @@ -36,3 +36,4 @@ = render "layouts/i18n_script" = render "layouts/bugherd_script" + \ No newline at end of file diff --git a/app/views/registration/steps/_details.html.haml b/app/views/registration/steps/_details.html.haml index 6639919830..d105fae4ca 100644 --- a/app/views/registration/steps/_details.html.haml +++ b/app/views/registration/steps/_details.html.haml @@ -7,7 +7,6 @@ %h2= t('.headline') %h5{ ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise") %h5{ ng: { if: "::enterprise.type == 'own'" } }= t(".producer") - %form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('contact',details)" } } .row @@ -57,8 +56,25 @@ %select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{Spree::Config[:default_country_id]})", model: 'enterprise.country', options: 'c as c.name for c in countries' } } %span.error{ ng: { show: "details.country.$error.required && submitted" } } = t(".country_field_error") - + %div{ ng: {if: "enableMapConfirm"}} + .center{ ng: {if: "latLong"}} + %strong {{'registration.steps.details.drag_pin' | t}} + .small-12.medium-9.large-12.columns.end + .map-container--registration{id: "registration-map", ng: {if: "!!map"}} + %ui-gmap-google-map{ center: "map.center", zoom: "map.zoom"} + %ui-gmap-marker{idKey: 1, coords: "latLong", options: '{ draggable: true}'} + + .center + %input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } } + .center{ ng: {if: "latLong"}} + .field + %input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { model: 'addressConfirmed', change: 'confirmAddressChange(confirmAddress)'} } + %label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}} + .small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}} + .field + %strong {{'registration.steps.details.drag_map_marker' | t}} .row.buttons .small-12.columns %hr %input.button.primary.right{ type: "submit", value: "{{'continue' | t}}" } + \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index fe50504b40..e1536771d2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1391,6 +1391,12 @@ en: address2: Address (contd.) city: City city_placeholder: eg. Northcote + latitude: Latitude + latitude_placeholder: eg. -37.4713077 + latitude_longitude_tip: Latitude and longitude are needed to display your enterprise on the map. + longitude: Longitude + longitude_placeholder: eg. 144.7851531 + use_geocoder: Calculate latitude and longitude automatically from address? state: State postcode: Postcode postcode_placeholder: eg. 3070 @@ -1970,7 +1976,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using details: title: "Details" headline: "Let's Get Started" - enterprise: "Woot! First need to know a little bit about your enterprise:" + enterprise: "Woot! First we need to know a little bit about your enterprise:" producer: "Woot! First we need to know a little bit about your farm:" enterprise_name_field: "Enterprise Name:" producer_name_field: "Farm Name:" @@ -1990,6 +1996,11 @@ See the %{link} to find out more about %{sitename}'s features and to start using state_field_error: "State required" country_field: "Country:" country_field_error: "Please select a country" + map_location: "Map Location" + locate_address: "Locate address on map" + drag_pin: "Drag and drop the pin to the correct location if not accurate." + confirm_address: "I confirm that the indicated position of the enterprise on the map is correct." + drag_map_marker: "Due to many producers operating in rural areas, the accuracy of maps is always being improved on. Help us to understand where you’re located better by interacting with the map above to move the pin by clicking or tapping to hold the pin and then dragging to the location that is more accurate based off your knowledge." contact: title: "Contact" who_is_managing_enterprise: "Who is responsible for managing %{enterprise}?" diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 3f87f2dbed..4d5a37a8c8 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -51,6 +51,8 @@ feature ' fill_in 'enterprise_address_attributes_address1', with: '35 Ballantyne St' fill_in 'enterprise_address_attributes_city', with: 'Thornbury' fill_in 'enterprise_address_attributes_zipcode', with: '3072' + fill_in 'enterprise_address_attributes_latitude', with: '-37.4713077' + fill_in 'enterprise_address_attributes_longitude', with: '144.7851531' # default country (Australia in this test) should be selected by default select2_select 'Victoria', from: 'enterprise_address_attributes_state_id' @@ -167,6 +169,8 @@ feature ' fill_in 'enterprise_address_attributes_address1', with: '35 Ballantyne St' fill_in 'enterprise_address_attributes_city', with: 'Thornbury' fill_in 'enterprise_address_attributes_zipcode', with: '3072' + fill_in 'enterprise_address_attributes_latitude', with: '-37.4713077' + fill_in 'enterprise_address_attributes_longitude', with: '144.7851531' # default country (Australia in this test) should be selected by default select2_select 'Victoria', from: 'enterprise_address_attributes_state_id' diff --git a/vendor/assets/javascripts/angular-google-maps.min.js b/vendor/assets/javascripts/angular-google-maps.min.js index 295fe9cc13..58a017ce18 100644 --- a/vendor/assets/javascripts/angular-google-maps.min.js +++ b/vendor/assets/javascripts/angular-google-maps.min.js @@ -1,9 +1,14 @@ -/*! angular-google-maps 2.0.0 2014-10-09 + +/*! angular-google-maps 2.4.1 2017-01-05 * AngularJS directives for Google Maps * git: https://github.com/angular-ui/angular-google-maps.git */ -(function(){String.prototype.contains=function(a,b){return-1!==this.indexOf(a,b)},String.prototype.flare=function(a){return null==a&&(a="uiGmap"),a+this},String.prototype.ns=String.prototype.flare}).call(this),function(){_.intersectionObjects=function(a,b,c){var d;return null==c&&(c=void 0),d=_.map(a,function(){return function(a){return _.find(b,function(b){return null!=c?c(a,b):_.isEqual(a,b)})}}(this)),_.filter(d,function(a){return null!=a})},_.containsObject=_.includeObject=function(a,b,c){return null==c&&(c=void 0),null===a?!1:_.any(a,function(){return function(a){return null!=c?c(a,b):_.isEqual(a,b)}}(this))},_.differenceObjects=function(a,b,c){return null==c&&(c=void 0),_.filter(a,function(a){return!_.containsObject(b,a,c)})},_.withoutObjects=_.differenceObjects,_.indexOfObject=function(a,b,c,d){var e,f;if(null==a)return-1;if(e=0,f=a.length,d){if("number"!=typeof d)return e=_.sortedIndex(a,b),a[e]===b?e:-1;e=0>d?Math.max(0,f+d):d}for(;f>e;){if(null!=c){if(c(a[e],b))return e}else if(_.isEqual(a[e],b))return e;e++}return-1},_["extends"]=function(a){return _.reduce(a,function(a,b){return _.extend(a,b)},{})},_.isNullOrUndefined=function(a){return _.isNull(a||_.isUndefined(a))}}.call(this),function(){angular.module("google-maps.providers".ns(),[]),angular.module("google-maps.wrapped".ns(),[]),angular.module("google-maps.extensions".ns(),["google-maps.wrapped".ns(),"google-maps.providers".ns()]),angular.module("google-maps.directives.api.utils".ns(),["google-maps.extensions".ns()]),angular.module("google-maps.directives.api.managers".ns(),[]),angular.module("google-maps.directives.api.options".ns(),["google-maps.directives.api.utils".ns()]),angular.module("google-maps.directives.api.options.builders".ns(),[]),angular.module("google-maps.directives.api.models.child".ns(),["google-maps.directives.api.utils".ns(),"google-maps.directives.api.options".ns(),"google-maps.directives.api.options.builders".ns()]),angular.module("google-maps.directives.api.models.parent".ns(),["google-maps.directives.api.managers".ns(),"google-maps.directives.api.models.child".ns(),"google-maps.providers".ns()]),angular.module("google-maps.directives.api".ns(),["google-maps.directives.api.models.parent".ns()]),angular.module("google-maps".ns(),["google-maps.directives.api".ns(),"google-maps.providers".ns()]).factory("debounce".ns(),["$timeout",function(a){return function(b){var c;return c=0,function(){var d,e,f;return f=this,d=arguments,c++,e=function(a){return function(){return a===c?b.apply(f,d):void 0}}(c),a(e,0,!0)}}}])}.call(this),function(){angular.module("google-maps.providers".ns()).factory("MapScriptLoader".ns(),["$q",function(a){return{load:function(b){var c,d,e,f;return c=a.defer(),angular.isDefined(window.google)&&angular.isDefined(window.google.maps)?(c.resolve(window.google.maps),c.promise):(e=b.callback="onGoogleMapsReady"+Math.round(1e3*Math.random()),window[e]=function(){window[e]=null,c.resolve(window.google.maps)},d=_.map(b,function(a,b){return b+"="+a}),d=d.join("&"),f=document.createElement("script"),f.type="text/javascript",f.src="https://maps.googleapis.com/maps/api/js?"+d,document.body.appendChild(f),c.promise)}}}]).provider("GoogleMapApi".ns(),function(){return this.options={v:"3.16",libraries:"places",language:"en",sensor:"false"},this.configure=function(a){angular.extend(this.options,a)},this.$get=["MapScriptLoader".ns(),function(a){return function(b){return a.promise=b.load(a.options),a.promise}}(this)],this})}.call(this),function(){angular.module("google-maps.extensions".ns()).service("ExtendGWin".ns(),function(){return{init:_.once(function(){return google||("undefined"!=typeof google&&null!==google?google.maps:void 0)||null!=google.maps.InfoWindow?(google.maps.InfoWindow.prototype._open=google.maps.InfoWindow.prototype.open,google.maps.InfoWindow.prototype._close=google.maps.InfoWindow.prototype.close,google.maps.InfoWindow.prototype._isOpen=!1,google.maps.InfoWindow.prototype.open=function(a,b,c){null==c&&(this._isOpen=!0,this._open(a,b,!0))},google.maps.InfoWindow.prototype.close=function(a){null==a&&(this._isOpen=!1,this._close(!0))},google.maps.InfoWindow.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},window.InfoBox&&(window.InfoBox.prototype._open=window.InfoBox.prototype.open,window.InfoBox.prototype._close=window.InfoBox.prototype.close,window.InfoBox.prototype._isOpen=!1,window.InfoBox.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},window.InfoBox.prototype.close=function(){this._isOpen=!1,this._close()},window.InfoBox.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a}),window.MarkerLabel_?(window.MarkerLabel_.prototype.setContent=function(){var a;a=this.marker_.get("labelContent"),a&&!_.isEqual(this.oldContent,a)&&("undefined"==typeof(null!=a?a.nodeType:void 0)?(this.labelDiv_.innerHTML=a,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML,this.oldContent=a):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(a),a=a.cloneNode(!0),this.eventDiv_.appendChild(a),this.oldContent=a))},window.MarkerLabel_.prototype.onRemove=function(){null!=this.labelDiv_.parentNode&&this.labelDiv_.parentNode.removeChild(this.labelDiv_),null!=this.eventDiv_.parentNode&&this.eventDiv_.parentNode.removeChild(this.eventDiv_),this.listeners_&&this.listeners_.length&&this.listeners_.forEach(function(a){return google.maps.event.removeListener(a)})}):void 0):void 0})}})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("_sync".ns(),[function(){return{fakePromise:function(){var a;return a=void 0,{then:function(b){return a=b},resolve:function(){return a.apply(void 0,arguments)}}}}}]).factory("_async".ns(),[function(){var a,b,c,d,e;return a=20,e=function(a,b){return a.existingPieces=a.existingPieces?a.existingPieces.then(function(){return b()}):b()},b=function(a,c,d,e,f,g,h){var i,j,k;try{for(i=c&&c0?c(a,function(a){return h.push(b(a))},d,e,f,g).then(function(){return h}):Promise.resolve(h)},{each:c,map:d,waitOrGo:e,defaultChunkSize:a}}])}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("google-maps.directives.api.utils".ns()).factory("BaseObject".ns(),function(){var b,c;return c=["extended","included"],b=function(){function b(){}return b.extend=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this[d]=e);return null!=(f=b.extended)&&f.apply(this),this},b.include=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this.prototype[d]=e);return null!=(f=b.included)&&f.apply(this),this},b}()})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).factory("ChildEvents".ns(),function(){return{onChildCreation:function(){}}})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("CtrlHandle".ns(),["$q",function(a){var b;return b={handle:function(b){return b.deferred=a.defer(),{getScope:function(){return b}}},mapPromise:function(a,b){var c;return c=b.getScope(),c.deferred.promise.then(function(b){return a.map=b}),c.deferred.promise}}}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("EventsHelper".ns(),["Logger".ns(),function(a){return{setEvents:function(b,c,d,e){return angular.isDefined(c.events)&&null!=c.events&&angular.isObject(c.events)?_.compact(_.map(c.events,function(f,g){var h;return e&&(h=_(e).contains(g)),c.events.hasOwnProperty(g)&&angular.isFunction(c.events[g])&&!h?google.maps.event.addListener(b,g,function(){return c.$apply(f.apply(c,[b,g,d,arguments]))}):a.info("EventHelper: invalid event listener "+g)})):void 0},removeEvents:function(a){return null!=a?a.forEach(function(a){return google.maps.event.removeListener(a)}):void 0}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.utils".ns()).factory("FitHelper".ns(),["BaseObject".ns(),"Logger".ns(),"_async".ns(),function(a,c,d){var e;return e=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.fit=function(a,b){var c,e;return b&&a&&a.length>0?(c=new google.maps.LatLngBounds,e=!1,d.each(a,function(){return function(a){return a?(e||(e=!0),c.extend(a.getPosition())):void 0}}(this)).then(function(){return e?b.fitBounds(c):void 0})):void 0},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("GmapUtil".ns(),["Logger".ns(),"$compile",function(a,b){var c,d,e,f;return d=function(a){return Array.isArray(a)&&2===a.length?a[1]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[1]:a.latitude},e=function(a){return Array.isArray(a)&&2===a.length?a[0]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[0]:a.longitude},c=function(a){return a?Array.isArray(a)&&2===a.length?new google.maps.LatLng(a[1],a[0]):angular.isDefined(a.type)&&"Point"===a.type?new google.maps.LatLng(a.coordinates[1],a.coordinates[0]):new google.maps.LatLng(a.latitude,a.longitude):void 0},f=function(a){if(angular.isUndefined(a))return!1;if(_.isArray(a)){if(2===a.length)return!0}else if(null!=a&&(null!=a?a.type:void 0)&&"Point"===a.type&&_.isArray(a.coordinates)&&2===a.coordinates.length)return!0;return a&&angular.isDefined((null!=a?a.latitude:void 0)&&angular.isDefined(null!=a?a.longitude:void 0))?!0:!1},{setCoordsFromEvent:function(a,b){return a?(Array.isArray(a)&&2===a.length?(a[1]=b.lat(),a[0]=b.lng()):angular.isDefined(a.type)&&"Point"===a.type?(a.coordinates[1]=b.lat(),a.coordinates[0]=b.lng()):(a.latitude=b.lat(),a.longitude=b.lng()),a):void 0},getLabelPositionPoint:function(a){var b,c;return void 0===a?void 0:(a=/^([-\d\.]+)\s([-\d\.]+)$/.exec(a),b=parseFloat(a[1]),c=parseFloat(a[2]),null!=b&&null!=c?new google.maps.Point(b,c):void 0)},createWindowOptions:function(d,e,f,g){var h;return null!=f&&null!=g&&null!=b?(h=angular.extend({},g,{content:this.buildContent(e,g,f),position:null!=g.position?g.position:angular.isObject(d)?d.getPosition():c(e.coords)}),null!=d&&null==(null!=h?h.pixelOffset:void 0)&&(h.pixelOffset=null==h.boxClass?{height:-40,width:0}:{height:0,width:-2}),h):g?g:(a.error("infoWindow defaults not defined"),f?void 0:a.error("infoWindow content not defined"))},buildContent:function(a,c,d){var e,f;return null!=c.content?f=c.content:null!=b?(e=b(d)(a),e.length>0&&(f=e[0])):f=d,f},defaultDelay:50,isTrue:function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},isFalse:function(a){return-1!==["false","FALSE",0,"n","N","no","NO"].indexOf(a)},getCoords:c,validateCoords:f,equalCoords:function(a,b){return d(a)===d(b)&&e(a)===e(b)},validatePath:function(a){var b,c,d,e;if(c=0,angular.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},e),d=a.coordinates[e.index],b=d[0],b.length<4)return!1}else{if("LineString"!==a.type)return!1;if(a.coordinates.length<2)return!1;b=a.coordinates}for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},f),b=a.coordinates[f.index][0]):"LineString"===a.type&&(b=a.coordinates);cd;)l=j.getAt(d),h=a[d],"function"==typeof h.equals?h.equals(l)||(j.setAt(d,h),c=!0):(l.lat()!==h.latitude||l.lng()!==h.longitude)&&(j.setAt(d,new google.maps.LatLng(h.latitude,h.longitude)),c=!0),d++;for(;g>d;)h=a[d],j.push("function"==typeof h.lat&&"function"==typeof h.lng?h:new google.maps.LatLng(h.latitude,h.longitude)),c=!0,d++;for(;k>d;)j.pop(),c=!0,d++}return i=!1,c?e(j):void 0},h=function(a){var c,d,f,g,h,j,k,l,n;if(i=!0,k=b,d=!1,a){for("Polygon"===m.type?c=a.coordinates[0]:"LineString"===m.type&&(c=a.coordinates),f=0,l=k.getLength(),h=c.length,g=Math.min(l,h),j=void 0;g>f;)n=k.getAt(f),j=c[f],(n.lat()!==j[1]||n.lng()!==j[0])&&(k.setAt(f,new google.maps.LatLng(j[1],j[0])),d=!0),f++;for(;h>f;)j=c[f],k.push(new google.maps.LatLng(j[1],j[0])),d=!0,f++;for(;l>f;)k.pop(),d=!0,f++}return i=!1,d?e(k):void 0},c["static"]||(n=angular.isUndefined(m.type)?c.$watchCollection(d,k):c.$watch(d,h,!0)),function(){return l&&(l(),l=null),n?(n(),n=null):void 0}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.options.builders".ns()).service("CommonOptionsBuilder".ns(),["BaseObject".ns(),"Logger".ns(),function(b,d){var e;return e=function(b){function e(){return this.watchProps=a(this.watchProps,this),this.buildOpts=a(this.buildOpts,this),e.__super__.constructor.apply(this,arguments)}return c(e,b),e.prototype.props=["clickable","draggable","editable","visible",{prop:"stroke",isColl:!0}],e.prototype.buildOpts=function(a,b){var c,e,f,g,h,i;return null==a&&(a={}),null==b&&(b={}),this.scope?this.map?(c=_(this.scope).chain().keys().contains("model").value(),e=c?this.scope.model:this.scope,f=angular.extend(a,this.DEFAULTS,{map:this.map,strokeColor:null!=(g=e.stroke)?g.color:void 0,strokeOpacity:null!=(h=e.stroke)?h.opacity:void 0,strokeWeight:null!=(i=e.stroke)?i.weight:void 0}),angular.forEach(angular.extend(b,{clickable:!0,draggable:!1,editable:!1,"static":!1,fit:!1,visible:!0,zIndex:0}),function(){return function(a,b){return f[b]=angular.isUndefined(e[b]||null===e[b])?a:e[b]}}(this)),f["static"]&&(f.editable=!1),f):void d.error("this.map not defined in CommonOptionsBuilder can not buildOpts"):void d.error("this.scope not defined in CommonOptionsBuilder can not buildOpts")},e.prototype.watchProps=function(a){return null==a&&(a=this.props),a.forEach(function(a){return function(b){return null!=a.attrs[b]||null!=a.attrs[null!=b?b.prop:void 0]?(null!=b?b.isColl:void 0)?a.scope.$watchCollection(b.prop,a.setMyOptions):a.scope.$watch(b,a.setMyOptions):void 0}}(this))},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.options.builders".ns()).factory("PolylineOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("ShapeOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a,b){var d,e;return a=angular.extend(a,{fillColor:null!=(d=this.scope.fill)?d.color:void 0,fillOpacity:null!=(e=this.scope.fill)?e.opacity:void 0}),c.__super__.buildOpts.call(this,a,b)},c}(a)}]).factory("PolygonOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("RectangleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{bounds:a})},c}(a)}]).factory("CircleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{center:a,radius:b})},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.options".ns()).service("MarkerOptions".ns(),["Logger".ns(),"GmapUtil".ns(),function(a,b){return _.extend(b,{createOptions:function(a,c,d,e){var f;return null==e&&(e=void 0),null==d&&(d={}),f=angular.extend({},d,{position:null!=d.position?d.position:b.getCoords(a),visible:null!=d.visible?d.visible:b.validateCoords(a)}),(null!=d.icon||null!=c)&&(f=angular.extend(f,{icon:null!=d.icon?d.icon:c})),null!=e&&(f.map=e),f},isLabel:function(a){return null!=a.labelContent||null!=a.labelAnchor||null!=a.labelClass||null!=a.labelStyle||null!=a.labelVisible?!0:!1}})}])}.call(this),function(){angular.module("google-maps.directives.api.models.child".ns()).factory("DrawFreeHandChildModel".ns(),["Logger".ns(),"$q",function(a,b){var c,d;return c=function(a,b,c){var d,e;return this.polys=b,e=new google.maps.Polyline({map:a,clickable:!1}),d=google.maps.event.addListener(a,"mousemove",function(a){return e.getPath().push(a.latLng)}),void google.maps.event.addListenerOnce(a,"mouseup",function(){var f;return google.maps.event.removeListener(d),f=e.getPath(),e.setMap(null),b.push(new google.maps.Polygon({map:a,path:f})),e=null,google.maps.event.clearListeners(a.getDiv(),"mousedown"),c() -})},d=function(d){var e,f;return this.map=d,f=function(a){return function(){var b;return null!=(b=a.deferred)&&b.resolve(),a.map.setOptions(a.oldOptions)}}(this),e=function(b){return function(){return a.info("disabling map move"),b.oldOptions=d.getOptions(),b.map.setOptions({draggable:!1,zoomControl:!1,scrollwheel:!1,disableDoubleClickZoom:!1})}}(this),this.engage=function(d){return function(g){return d.polys=g,d.deferred=b.defer(),e(),a.info("DrawFreeHandChildModel is engaged (drawing)."),google.maps.event.addDomListener(d.map.getDiv(),"mousedown",function(){return c(d.map,d.polys,f)}),d.deferred.promise}}(this),this}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child".ns()).factory("MarkerChildModel".ns(),["ModelKey".ns(),"GmapUtil".ns(),"Logger".ns(),"EventsHelper".ns(),"MarkerOptions".ns(),function(b,d,e,f,g){var h,i;return i=["coords","icon","options","fit"],h=function(b){function h(b,c,d,f,g,j,k,l,m){this.model=c,this.keys=d,this.gMap=f,this.defaults=g,this.doClick=j,this.gMarkerManager=k,this.doDrawSelf=null!=l?l:!0,this.trackModel=null!=m?m:!0,this.internalEvents=a(this.internalEvents,this),this.setLabelOptions=a(this.setLabelOptions,this),this.setOptions=a(this.setOptions,this),this.setIcon=a(this.setIcon,this),this.setCoords=a(this.setCoords,this),this.maybeSetScopeValue=a(this.maybeSetScopeValue,this),this.createMarker=a(this.createMarker,this),this.setMyScope=a(this.setMyScope,this),this.destroy=a(this.destroy,this),_.each(this.keys,function(a){return function(b,c){return a[c+"Key"]=_.isFunction(a.keys[c])?a.keys[c]():a.keys[c]}}(this)),this.idKey=this.idKeyKey||"id",null!=this.model[this.idKey]&&(this.id=this.model[this.idKey]),this.needRedraw=!1,this.deferred=Promise.defer(),h.__super__.constructor.call(this,b),this.setMyScope(this.model,void 0,!0),this.createMarker(this.model),this.trackModel?(this.scope.model=this.model,this.scope.$watch("model",function(a){return function(b,c){return b!==c?(a.setMyScope(b,c),a.needRedraw=!0):void 0}}(this),!0)):_.each(this.keys,function(a){return function(b,c){return a.scope.$watch(c,function(){return a.setMyScope(a.scope)})}}(this)),this.scope.$on("$destroy",function(a){return function(){return i(a)}}(this)),e.info(this)}var i;return c(h,b),h.include(d),h.include(f),h.include(g),i=function(a){return null!=(null!=a?a.gMarker:void 0)&&(a.removeEvents(a.externalListeners),a.removeEvents(a.internalListeners),null!=a?a.gMarker:void 0)?(null!=a&&a.gMarkerManager.remove(null!=a?a.gMarker:void 0,!0),delete a.gMarker):void 0},h.prototype.destroy=function(){return this.scope.$destroy()},h.prototype.setMyScope=function(a,b,c){return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("icon",a,b,this.iconKey,this.evalModelHandle,c,this.setIcon),this.maybeSetScopeValue("coords",a,b,this.coordsKey,this.evalModelHandle,c,this.setCoords),_.isFunction(this.clickKey)?this.scope.click=function(a){return function(){return a.clickKey(a.gMarker,"click",a.model,void 0)}}(this):(this.maybeSetScopeValue("click",a,b,this.clickKey,this.evalModelHandle,c),this.createMarker(a,b,c))},h.prototype.createMarker=function(a,b,c){return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("options",a,b,this.optionsKey,this.evalModelHandle,c,this.setOptions)},h.prototype.maybeSetScopeValue=function(a,b,c,d,e,f,g){var h,i;return null==g&&(g=void 0),void 0===c?(this.scope[a]=e(b,d),void(f||null!=g&&g(this.scope))):(i=e(c,d),h=e(b,d),h!==i&&(this.scope[a]=h,!f&&(null!=g&&g(this.scope),this.doDrawSelf))?this.gMarkerManager.draw():void 0)},h.prototype.setCoords=function(a){return a.$id===this.scope.$id&&void 0!==this.gMarker?null!=a.coords?this.validateCoords(this.scope.coords)?(this.gMarker.setPosition(this.getCoords(a.coords)),this.gMarker.setVisible(this.validateCoords(a.coords)),this.gMarkerManager.add(this.gMarker)):void e.debug("MarkerChild does not have coords yet. They may be defined later."):this.gMarkerManager.remove(this.gMarker):void 0},h.prototype.setIcon=function(a){return a.$id===this.scope.$id&&void 0!==this.gMarker?(this.gMarkerManager.remove(this.gMarker),this.gMarker.setIcon(a.icon),this.gMarkerManager.add(this.gMarker),this.gMarker.setPosition(this.getCoords(a.coords)),this.gMarker.setVisible(this.validateCoords(a.coords))):void 0},h.prototype.setOptions=function(a){var b;if(a.$id===this.scope.$id&&(null!=this.gMarker&&(this.gMarkerManager.remove(this.gMarker),delete this.gMarker),null!=(b=a.coords)?b:"function"==typeof a.icon?a.icon(null!=a.options):void 0))return this.opts=this.createOptions(a.coords,a.icon,a.options),delete this.gMarker,this.gMarker=this.isLabel(this.opts)?new MarkerWithLabel(this.setLabelOptions(this.opts)):new google.maps.Marker(this.opts),this.gMarker?this.deferred.resolve(this.gMarker):this.deferred.reject("gMarker is null"),this.model.fitKey&&this.gMarkerManager.fit(),this.externalListeners&&this.removeEvents(this.externalListeners),this.internalListeners&&this.removeEvents(this.internalListeners),this.externalListeners=this.setEvents(this.gMarker,this.scope,this.model,["dragend"]),this.internalListeners=this.setEvents(this.gMarker,{events:this.internalEvents(),$apply:function(){}},this.model),null!=this.id&&(this.gMarker.key=this.id),this.gMarkerManager.add(this.gMarker)},h.prototype.setLabelOptions=function(a){return a.labelAnchor=this.getLabelPositionPoint(a.labelAnchor),a},h.prototype.internalEvents=function(){return{dragend:function(a){return function(b,c,d,e){var f,g;return f=a.setCoordsFromEvent(a.modelOrKey(a.scope.model,a.coordsKey),a.gMarker.getPosition()),a.scope.model=a.setVal(d,a.coordsKey,f),null!=(null!=(g=a.scope.events)?g.dragend:void 0)&&a.scope.events.dragend(b,c,a.scope.model,e),a.scope.$apply()}}(this),click:function(a){return function(b,c,d,e){return a.doClick&&null!=a.scope.click?a.scope.$apply(a.scope.click(b,c,a.model,e)):void 0}}(this)}},h}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("PolygonChildModel".ns(),["PolygonOptionsBuilder".ns(),"Logger".ns(),"$timeout","array-sync".ns(),"GmapUtil".ns(),"EventsHelper".ns(),function(a,c,d,e,f,g){var h;return h=function(a){function d(a,b,d,f,h){var i,j,k;return this.scope=a,this.attrs=b,this.map=d,this.defaults=f,this.model=h,this.listeners=void 0,angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void c.error("polygon: no valid path attribute found"):(j=this.convertPathPoints(a.path),k=new google.maps.Polygon(this.buildOpts(j)),a.fit&&this.extendMapBounds(this.map,j),!a["static"]&&angular.isDefined(a.editable)&&a.$watch("editable",function(a,b){return a!==b?k.setEditable(a):void 0}),angular.isDefined(a.draggable)&&a.$watch("draggable",function(a,b){return a!==b?k.setDraggable(a):void 0}),angular.isDefined(a.visible)&&a.$watch("visible",function(a,b){return a!==b?k.setVisible(a):void 0}),angular.isDefined(a.geodesic)&&a.$watch("geodesic",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.opacity)&&a.$watch("stroke.opacity",function(a){return function(){return k.setOptions(a.buildOpts(k.getPath()))}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.weight)&&a.$watch("stroke.weight",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.color)&&a.$watch("stroke.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.color)&&a.$watch("fill.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.opacity)&&a.$watch("fill.opacity",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.zIndex)&&a.$watch("zIndex",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)&&(this.listeners=g.setEvents(k,a,a)),i=e(k.getPath(),a,"path",function(b){return function(c){return a.fit?b.extendMapBounds(b.map,c):void 0}}(this)),void a.$on("$destroy",function(a){return function(){return k.setMap(null),a.removeEvents(a.listeners),i?(i(),i=null):void 0}}(this)))}return b(d,a),d.include(f),d.include(g),d}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("PolylineChildModel".ns(),["PolylineOptionsBuilder".ns(),"Logger".ns(),"$timeout","array-sync".ns(),"GmapUtil".ns(),"EventsHelper".ns(),function(b,d,e,f,g,h){var i;return i=function(b){function e(b,c,e,g,h){var i;this.scope=b,this.attrs=c,this.map=e,this.defaults=g,this.model=h,this.clean=a(this.clean,this),i=function(a){return function(){var b;return b=a.convertPathPoints(a.scope.path),null!=a.polyline&&a.clean(),b.length>0&&(a.polyline=new google.maps.Polyline(a.buildOpts(b))),a.polyline?(a.scope.fit&&a.extendMapBounds(e,b),f(a.polyline.getPath(),a.scope,"path",function(b){return a.scope.fit?a.extendMapBounds(e,b):void 0}),a.listeners=a.model?a.setEvents(a.polyline,a.scope,a.model):a.setEvents(a.polyline,a.scope,a.scope)):void 0}}(this),i(),b.$watch("path",function(a){return function(b,c){return _.isEqual(b,c)&&a.polyline?void 0:i()}}(this)),!b["static"]&&angular.isDefined(b.editable)&&b.$watch("editable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setEditable(b):void 0}}(this)),angular.isDefined(b.draggable)&&b.$watch("draggable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setDraggable(b):void 0}}(this)),angular.isDefined(b.visible)&&b.$watch("visible",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setVisible(b):void 0}}(this)),angular.isDefined(b.geodesic)&&b.$watch("geodesic",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.weight)&&b.$watch("stroke.weight",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.color)&&b.$watch("stroke.color",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.opacity)&&b.$watch("stroke.opacity",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.icons)&&b.$watch("icons",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),b.$on("$destroy",function(a){return function(){return a.clean(),a.scope=null}}(this)),d.info(this)}return c(e,b),e.include(g),e.include(h),e.prototype.clean=function(){var a,b;return this.removeEvents(this.listeners),null!=(b=this.polyline)&&b.setMap(null),this.polyline=null,a?(a(),a=null):void 0},e.prototype.destroy=function(){return this.scope.$destroy()},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child".ns()).factory("WindowChildModel".ns(),["BaseObject".ns(),"GmapUtil".ns(),"Logger".ns(),"$compile","$http","$templateCache",function(b,d,e,f,g,h){var i;return i=function(b){function i(b,c,d,f,g,h,i,j,k){this.model=b,this.scope=c,this.opts=d,this.isIconVisibleOnClick=f,this.mapCtrl=g,this.markerCtrl=h,this.element=i,this.needToManualDestroy=null!=j?j:!1,this.markerIsVisibleAfterWindowClose=null!=k?k:!0,this.getGWin=a(this.getGWin,this),this.destroy=a(this.destroy,this),this.remove=a(this.remove,this),this.getLatestPosition=a(this.getLatestPosition,this),this.hideWindow=a(this.hideWindow,this),this.showWindow=a(this.showWindow,this),this.handleClick=a(this.handleClick,this),this.watchOptions=a(this.watchOptions,this),this.watchCoords=a(this.watchCoords,this),this.createGWin=a(this.createGWin,this),this.watchElement=a(this.watchElement,this),this.watchAndDoShow=a(this.watchAndDoShow,this),this.doShow=a(this.doShow,this),this.googleMapsHandles=[],this.$log=e,this.createGWin(),null!=this.markerCtrl&&this.markerCtrl.setClickable(!0),this.watchElement(),this.watchOptions(),this.watchCoords(),this.watchAndDoShow(),this.scope.$on("$destroy",function(a){return function(){return a.destroy()}}(this)),this.$log.info(this)}return c(i,b),i.include(d),i.prototype.doShow=function(){return this.scope.show?this.showWindow():void 0},i.prototype.watchAndDoShow=function(){return null!=this.model.show&&(this.scope.show=this.model.show),this.scope.$watch("show",this.doShow,!0),this.doShow()},i.prototype.watchElement=function(){return this.scope.$watch(function(a){return function(){var b;if(a.element&&a.html)return a.html!==a.element.html()&&a.gWin?(null!=(b=a.opts)&&(b.content=void 0),a.remove(),a.createGWin()):void 0}}(this))},i.prototype.createGWin=function(){var a,b;return null==this.gWin&&(a={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),a=this.opts),this.element&&(this.html=_.isObject(this.element)?this.element.html():this.element),b=this.scope.options?this.scope.options:a,this.opts=this.createWindowOptions(this.markerCtrl,this.scope,this.html,b)),null==this.opts||this.gWin?void 0:(this.gWin=this.opts.boxClass&&window.InfoBox&&"function"==typeof window.InfoBox?new window.InfoBox(this.opts):new google.maps.InfoWindow(this.opts),this.handleClick(),this.doShow(),this.googleMapsHandles.push(google.maps.event.addListener(this.gWin,"closeclick",function(a){return function(){return a.markerCtrl&&(a.markerCtrl.setAnimation(a.oldMarkerAnimation),a.markerIsVisibleAfterWindowClose&&_.delay(function(){return a.markerCtrl.setVisible(!1),a.markerCtrl.setVisible(a.markerIsVisibleAfterWindowClose)},250)),a.gWin.isOpen(!1),null!=a.scope.closeClick?a.scope.$apply(a.scope.closeClick()):void 0}}(this))))},i.prototype.watchCoords=function(){var a;return a=null!=this.markerCtrl?this.scope.$parent:this.scope,a.$watch("coords",function(a){return function(b,c){var d;if(b!==c){if(null==b)return a.hideWindow();if(!a.validateCoords(b))return void a.$log.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(a.model));if(d=a.getCoords(b),a.gWin.setPosition(d),a.opts)return a.opts.position=d}}}(this),!0)},i.prototype.watchOptions=function(){var a;return a=null!=this.markerCtrl?this.scope.$parent:this.scope,this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&(a.opts=b,null!=a.gWin)){if(a.gWin.setOptions(a.opts),null!=a.opts.visible&&a.opts.visible)return a.showWindow();if(null!=a.opts.visible)return a.hideWindow()}}}(this),!0)},i.prototype.handleClick=function(a){var b;if(null!=this.gWin)return b=function(a){return function(){var b;return null==a.gWin&&a.createGWin(),b=a.markerCtrl.getPosition(),null!=a.gWin&&(a.gWin.setPosition(b),a.opts&&(a.opts.position=b),a.showWindow()),a.initialMarkerVisibility=a.markerCtrl.getVisible(),a.oldMarkerAnimation=a.markerCtrl.getAnimation(),a.markerCtrl.setVisible(a.isIconVisibleOnClick)}}(this),null!=this.markerCtrl?(a&&b(),this.googleMapsHandles.push(google.maps.event.addListener(this.markerCtrl,"click",b))):void 0},i.prototype.showWindow=function(){var a,b,c;return b=function(a){return function(){return null==a.gWin||a.gWin.isOpen()?void 0:a.gWin.open(a.mapCtrl)}}(this),this.scope.templateUrl?null!=this.gWin&&g.get(this.scope.templateUrl,{cache:h}).then(function(a){return function(b){var c,d;return d=a.scope.$new(),angular.isDefined(a.scope.templateParameter)&&(d.parameter=a.scope.templateParameter),c=f(b.data)(d),a.gWin.setContent(c[0])}}(this)):this.scope.template&&null!=this.gWin&&(c=this.scope.$new(),angular.isDefined(this.scope.templateParameter)&&(c.parameter=this.scope.templateParameter),a=f(this.scope.template)(c),this.gWin.setContent(a[0])),b()},i.prototype.hideWindow=function(){return null!=this.gWin&&this.gWin.isOpen()?this.gWin.close():void 0},i.prototype.getLatestPosition=function(a){return null==this.gWin||null==this.markerCtrl||a?a?this.gWin.setPosition(a):void 0:this.gWin.setPosition(this.markerCtrl.getPosition())},i.prototype.remove=function(){return this.hideWindow(),_.each(this.googleMapsHandles,function(a){return google.maps.event.removeListener(a)}),this.googleMapsHandles.length=0,delete this.gWin,delete this.opts},i.prototype.destroy=function(a){var b,c;return null==a&&(a=!1),this.remove(),null!=this.scope&&(null!=(c=this.scope)?c.$$destroyed:void 0)&&(this.needToManualDestroy||a)&&this.scope.$destroy(),b=void 0},i.prototype.getGWin=function(){return this.gWin},i}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("CircleParentModel".ns(),["Logger".ns(),"$timeout","GmapUtil".ns(),"EventsHelper".ns(),"CircleOptionsBuilder".ns(),function(a,c,d,e,f){var g;return g=function(f){function g(b,e,f,g,h){var i,j;this.scope=b,this.attrs=f,this.map=g,this.DEFAULTS=h,i=new google.maps.Circle(this.buildOpts(d.getCoords(b.center),b.radius)),this.setMyOptions=function(a){return function(c,e){return _.isEqual(c,e)?void 0:i.setOptions(a.buildOpts(d.getCoords(b.center),b.radius))}}(this),this.props=this.props.concat([{prop:"center",isColl:!0},{prop:"fill",isColl:!0},"radius"]),this.watchProps(),j=this.setEvents(i,b,b),google.maps.event.addListener(i,"radius_changed",function(){return b.radius=i.getRadius(),c(function(){return b.$apply()})}),google.maps.event.addListener(i,"center_changed",function(){return angular.isDefined(b.center.type)?(b.center.coordinates[1]=i.getCenter().lat(),b.center.coordinates[0]=i.getCenter().lng()):(b.center.latitude=i.getCenter().lat(),b.center.longitude=i.getCenter().lng()),c(function(){return b.$apply()})}),b.$on("$destroy",function(a){return function(){return a.removeEvents(j),i.setMap(null)}}(this)),a.info(this)}return b(g,f),g.include(d),g.include(e),g}(f)}])}.call(this),function(){angular.module("google-maps.directives.api.models.parent".ns()).factory("DrawingManagerParentModel".ns(),["Logger".ns(),"$timeout",function(){var a;return a=function(){function a(a,b,c,d){var e;this.scope=a,this.attrs=c,this.map=d,e=new google.maps.drawing.DrawingManager(this.scope.options),e.setMap(this.map),null!=this.scope.control&&(this.scope.control.getDrawingManager=function(){return function(){return e}}(this)),!this.scope["static"]&&this.scope.options&&this.scope.$watch("options",function(){return function(a){return null!=e?e.setOptions(a):void 0}}(this),!0),a.$on("$destroy",function(){return function(){return e.setMap(null),e=null}}(this))}return a}()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("IMarkerParentModel".ns(),["ModelKey".ns(),"Logger".ns(),function(b,d){var e;return e=function(b){function e(b,c,f,g){if(this.scope=b,this.element=c,this.attrs=f,this.map=g,this.onDestroy=a(this.onDestroy,this),this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),e.__super__.constructor.call(this,this.scope),this.$log=d,!this.validateScope(b))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=angular.isDefined(f.click),null!=b.options&&(this.DEFAULTS=b.options),this.watch("coords",this.scope),this.watch("icon",this.scope),this.watch("options",this.scope),b.$on("$destroy",function(a){return function(){return a.onDestroy(b)}}(this))}return c(e,b),e.prototype.DEFAULTS={},e.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},e.prototype.watch=function(a,b){return b.$watch(a,function(c){return function(d,e){return _.isEqual(d,e)?void 0:c.onWatch(a,b,d,e)}}(this),!0)},e.prototype.onWatch=function(){},e.prototype.onDestroy=function(){throw new String("OnDestroy Not Implemented!!")},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("IWindowParentModel".ns(),["ModelKey".ns(),"GmapUtil".ns(),"Logger".ns(),function(a,c,d){var e;return e=function(a){function e(a,b,c,f,g,h,i,j){e.__super__.constructor.call(this,a),this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,this.DEFAULTS={},null!=a.options&&(this.DEFAULTS=a.options)}return b(e,a),e.include(c),e}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("LayerParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g,h){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.onLayerCreated=null!=g?g:void 0,this.$log=null!=h?h:d,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.doShow=!0,angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.layer.setMap(this.gMap),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,a.layer.setMap(b?a.gMap:null)):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return b!==c?(a.layer.setMap(null),a.layer=null,a.createGoogleLayer()):void 0}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.layer.setMap(null)}}(this)))}return c(e,b),e.prototype.createGoogleLayer=function(){var a;return this.layer=null==this.attrs.options?void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),null!=this.layer&&null!=this.onLayerCreated&&(a=this.onLayerCreated(this.scope,this.layer))?a(this.layer):void 0},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("MapTypeParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.$log=null!=g?g:d,this.hideOverlay=a(this.hideOverlay,this),this.showOverlay=a(this.showOverlay,this),this.refreshMapType=a(this.refreshMapType,this),this.createMapType=a(this.createMapType,this),null==this.attrs.options?void this.$log.info("options attribute for the map-type directive is mandatory. Map type creation aborted!!"):(this.id=this.gMap.overlayMapTypesCount=this.gMap.overlayMapTypesCount+1||0,this.doShow=!0,this.createMapType(),angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.showOverlay(),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,b?a.showOverlay():a.hideOverlay()):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),angular.isDefined(this.attrs.refresh)&&this.scope.$watch("refresh",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.hideOverlay(),a.mapType=null}}(this)))}return c(e,b),e.prototype.createMapType=function(){if(null!=this.scope.options.getTile)this.mapType=this.scope.options;else{if(null==this.scope.options.getTileUrl)return void this.$log.info("options should provide either getTile or getTileUrl methods. Map type creation aborted!!");this.mapType=new google.maps.ImageMapType(this.scope.options)}return this.attrs.id&&this.scope.id&&(this.gMap.mapTypes.set(this.scope.id,this.mapType),angular.isDefined(this.attrs.show)||(this.doShow=!1)),this.mapType.layerId=this.id},e.prototype.refreshMapType=function(){return this.hideOverlay(),this.mapType=null,this.createMapType(),this.doShow&&null!=this.gMap?this.showOverlay():void 0},e.prototype.showOverlay=function(){return this.gMap.overlayMapTypes.push(this.mapType)},e.prototype.hideOverlay=function(){var a;return a=!1,this.gMap.overlayMapTypes.forEach(function(b){return function(c,d){a||c.layerId!==b.id||(a=!0,b.gMap.overlayMapTypes.removeAt(d))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("MarkersParentModel".ns(),["IMarkerParentModel".ns(),"ModelsWatcher".ns(),"PropMap".ns(),"MarkerChildModel".ns(),"_async".ns(),"ClustererMarkerManager".ns(),"MarkerManager".ns(),"$timeout","IMarker".ns(),function(b,d,e,f,g,h,i,j,k){var l;return l=function(b){function j(b,c,d,f){this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.updateChild=a(this.updateChild,this),this.pieceMeal=a(this.pieceMeal,this),this.reBuildMarkers=a(this.reBuildMarkers,this),this.createMarkersFromScratch=a(this.createMarkersFromScratch,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this);var g;j.__super__.constructor.call(this,b,c,d,f),g=this,this.scope.markerModels=new e,this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,this.setIdKey(b),this.scope.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.watch("models",b),this.watch("doCluster",b),this.watch("clusterOptions",b),this.watch("clusterEvents",b),this.watch("fit",b),this.watch("idKey",b),this.gMarkerManager=void 0,this.createMarkersFromScratch(b)}return c(j,b),j.include(d),j.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll?this.reBuildMarkers(b):this.pieceMeal(b)},j.prototype.validateScope=function(a){var b;return b=angular.isUndefined(a.models)||void 0===a.models,b&&this.$log.error(this.constructor.name+": no valid models attribute found"),j.__super__.validateScope.call(this,a)||b},j.prototype.createMarkersFromScratch=function(a){return a.doCluster?(a.clusterEvents&&(this.clusterInternalOptions=_.once(function(b){return function(){var c,d,e,f;return c=b,b.origClusterEvents?void 0:(b.origClusterEvents={click:null!=(d=a.clusterEvents)?d.click:void 0,mouseout:null!=(e=a.clusterEvents)?e.mouseout:void 0,mouseover:null!=(f=a.clusterEvents)?f.mouseover:void 0},_.extend(a.clusterEvents,{click:function(a){return c.maybeExecMappedEvent(a,"click")},mouseout:function(a){return c.maybeExecMappedEvent(a,"mouseout")},mouseover:function(a){return c.maybeExecMappedEvent(a,"mouseover")}}))}}(this))()),a.clusterOptions||a.clusterEvents?void 0===this.gMarkerManager?this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions):this.gMarkerManager.opt_options!==a.clusterOptions&&(this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions)):this.gMarkerManager=new h(this.map)):this.gMarkerManager=new i(this.map),g.waitOrGo(this,function(b){return function(){return g.each(a.models,function(c){return b.newChildMarker(c,a)},!1).then(function(){return b.gMarkerManager.draw(),a.fit?b.gMarkerManager.fit():void 0})}}(this)).then(function(a){return function(){return a.existingPieces=void 0}}(this))},j.prototype.reBuildMarkers=function(a){var b;if(a.doRebuild||void 0===a.doRebuild)return(null!=(b=this.scope.markerModels)?b.length:void 0)&&this.onDestroy(a),this.createMarkersFromScratch(a)},j.prototype.pieceMeal=function(a){var b;return b=null!=this.existingPieces?!1:g.defaultChunkSize,null!=this.scope.models&&this.scope.models.length>0&&this.scope.markerModels.length>0?this.figureOutState(this.idKey,a,this.scope.markerModels,this.modelKeyComparison,function(c){return function(d){var e;return e=d,g.waitOrGo(c,function(){return g.each(e.removals,function(a){return null!=a?(null!=a.destroy&&a.destroy(),c.scope.markerModels.remove(a.id)):void 0},b).then(function(){return g.each(e.adds,function(b){return c.newChildMarker(b,a)},b)}).then(function(){return g.each(e.updates,function(a){return c.updateChild(a.child,a.model)},b)}).then(function(){return(e.adds.length>0||e.removals.length>0||e.updates.length>0)&&(c.gMarkerManager.draw(),a.markerModels=c.scope.markerModels,a.fit)?c.gMarkerManager.fit():void 0})}).then(function(){return c.existingPieces=void 0})}}(this)):this.reBuildMarkers(a)},j.prototype.updateChild=function(a,b){return null==b[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):a.setMyScope(b,a.model,!1)},j.prototype.newChildMarker=function(a,b){var c,d,e,g;return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),d=b.$new(!1),d.events=b.events,g={},_.each(k.keys,function(a,c){return g[c]=b[c]}),c=new f(d,a,g,this.map,this.DEFAULTS,this.doClick,this.gMarkerManager,e=!1),this.scope.markerModels.put(a[this.idKey],c),c)},j.prototype.onDestroy=function(){return g.waitOrGo(this,function(a){return function(){return null!=a.gMarkerManager&&a.gMarkerManager.clear(),_.each(a.scope.markerModels.values(),function(a){return null!=a?a.destroy():void 0}),delete a.scope.markerModels,a.scope.markerModels=new e,Promise.resolve() -}}(this))},j.prototype.maybeExecMappedEvent=function(a,b){var c,d;return _.isFunction(null!=(d=this.scope.clusterEvents)?d[b]:void 0)&&(c=this.mapClusterToMarkerModels(a),this.origClusterEvents[b])?this.origClusterEvents[b](c.cluster,c.mapped):void 0},j.prototype.mapClusterToMarkerModels=function(a){var b,c;return b=a.getMarkers().values(),c=b.map(function(a){return function(b){return a.scope.markerModels[b.key].model}}(this)),{cluster:a,mapped:c}},j}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("PolylinesParentModel".ns(),["$timeout","Logger".ns(),"ModelKey".ns(),"ModelsWatcher".ns(),"PropMap".ns(),"PolylineChildModel".ns(),"_async".ns(),function(b,d,e,f,g,h,i){var j;return j=function(b){function e(b,c,f,h,i){var j;this.scope=b,this.element=c,this.attrs=f,this.gMap=h,this.defaults=i,this.modelKeyComparison=a(this.modelKeyComparison,this),this.setChildScope=a(this.setChildScope,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.watch=a(this.watch,this),e.__super__.constructor.call(this,b),j=this,this.$log=d,this.plurals=new g,this.scopePropNames=["path","stroke","clickable","draggable","editable","geodesic","icons","visible"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.models=void 0,this.firstTime=!0,this.$log.info(this),this.watchOurScope(b),this.createChildScopes()}return c(e,b),e.include(f),e.prototype.watch=function(a,b,c){return a.$watch(b,function(a){return function(d,e){return d!==e?(a[c]="function"==typeof d?d():d,i.waitOrGo(a,function(){return i.each(_.values(a.plurals),function(d){return d.scope[b]="self"===a[c]?d:d[a[c]]})})):void 0}}(this))},e.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){return _.isEqual(c,d)?void 0:b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)}}(this),!0)},e.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.plurals.length>0&&b},e.prototype.rebuildAll=function(a,b,c){return i.waitOrGo(this,function(a){return function(){return i.each(a.plurals.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.plurals,a.plurals=new g,b?a.createChildScopes():void 0})}}(this))},e.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.rebuildAll(a,!1,!0)}}(this))},e.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c],b.watch(a,c,d)}}(this))},e.prototype.createChildScopes=function(a){return null==a&&(a=!0),angular.isUndefined(this.scope.models)?void this.$log.error("No models to create polylines from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},e.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},e.prototype.createAllNew=function(a,b){return null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),i.waitOrGo(this,function(b){return function(){return i.each(a.models,function(a){return b.createChild(a,b.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1,a.existingPieces=void 0}}(this))},e.prototype.pieceMeal=function(a,b){var c;return null==b&&(b=!0),c=null!=this.existingPieces?!1:i.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.plurals.length>0?this.figureOutState(this.idKey,a,this.plurals,this.modelKeyComparison,function(a){return function(b){var c;return c=b,i.waitOrGo(a,function(){return i.each(c.removals,function(b){var c;return c=a.plurals[b],null!=c?(c.destroy(),a.plurals.remove(b)):void 0}).then(function(){return i.each(c.adds,function(b){return a.createChild(b,a.gMap)})}).then(function(){return a.existingPieces=void 0})})}}(this)):this.rebuildAll(this.scope,!0,!0)},e.prototype.createChild=function(a,b){var c,d;return d=this.scope.$new(!1),this.setChildScope(d,a),d.$watch("model",function(a){return function(b,c){return b!==c?a.setChildScope(d,b):void 0}}(this),!0),d["static"]=this.scope["static"],c=new h(d,this.attrs,b,this.defaults,a),null==a[this.idKey]?void this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},e.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},e.prototype.modelKeyComparison=function(a,b){return _.isEqual(this.evalModelHandle(a,this.scope.path),this.evalModelHandle(b,this.scope.path))},e}(e)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("RectangleParentModel".ns(),["Logger".ns(),"GmapUtil".ns(),"EventsHelper".ns(),"RectangleOptionsBuilder".ns(),function(a,c,d,e){var f;return f=function(e){function f(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;this.scope=b,this.attrs=d,this.map=e,this.DEFAULTS=f,g=void 0,j=!1,n=[],m=void 0,k=function(a){return function(){return a.isTrue(d.fit)?a.fitMapBounds(a.map,g):void 0}}(this),i=function(c){return function(){var d,e;return null!=b.bounds&&null!=(null!=(d=b.bounds)?d.sw:void 0)&&null!=(null!=(e=b.bounds)?e.ne:void 0)&&c.validateBoundPoints(b.bounds)?(g=c.convertBoundPoints(b.bounds),a.info("new new bounds created: "+o)):null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?g=b.bounds:"undefined"!=typeof bound&&null!==bound?a.error("Invalid bounds for newValue: "+JSON.stringify(b.bounds)):void 0}}(this),i(),o=new google.maps.Rectangle(this.buildOpts(g)),a.info("rectangle created: "+o),p=!1,q=function(){return function(){var a,c,d;return a=o.getBounds(),c=a.getNorthEast(),d=a.getSouthWest(),p?void 0:_.defer(function(){return b.$apply(function(b){return null!=b.bounds&&null!=b.bounds.sw&&null!=b.bounds.ne&&(b.bounds.ne={latitude:c.lat(),longitude:c.lng()},b.bounds.sw={latitude:d.lat(),longitude:d.lng()}),null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?b.bounds=a:void 0})})}}(this),l=function(a){return function(){return k(),a.removeEvents(n),n.push(google.maps.event.addListener(o,"dragstart",function(){return j=!0})),n.push(google.maps.event.addListener(o,"dragend",function(){return j=!1,q()})),n.push(google.maps.event.addListener(o,"bounds_changed",function(){return j?void 0:q()}))}}(this),h=function(a){return function(){return a.removeEvents(n),null!=m&&a.removeEvents(m),o.setMap(null)}}(this),null!=g&&l(),b.$watch("bounds",function(a,b){var c;if(!(_.isEqual(a,b)&&null!=g||j))return p=!0,null==a?void h():(null==g?c=!0:k(),i(),o.setBounds(g),p=!1,c&&null!=g?l():void 0)},!0),this.setMyOptions=function(a){return function(b,c){return _.isEqual(b,c)||null==g||null==b?void 0:o.setOptions(a.buildOpts(g))}}(this),this.props.push("bounds"),this.watchProps(this.props),null!=d.events&&(m=this.setEvents(o,b,b),b.$watch("events",function(a){return function(c,d){return _.isEqual(c,d)?void 0:(null!=m&&a.removeEvents(m),m=a.setEvents(o,b,b))}}(this))),b.$on("$destroy",function(){return function(){return h()}}(this)),a.info(this)}return b(f,e),f.include(c),f.include(d),f}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("SearchBoxParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"EventsHelper".ns(),"$timeout","$http","$templateCache",function(b,d,e){var f;return f=function(b){function f(b,c,e,f,g,h,i){var j;return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.ctrlPosition=g,this.template=h,this.$log=null!=i?i:d,this.getBounds=a(this.getBounds,this),this.setBounds=a(this.setBounds,this),this.createSearchBox=a(this.createSearchBox,this),this.addToParentDiv=a(this.addToParentDiv,this),this.addAsMapControl=a(this.addAsMapControl,this),this.init=a(this.init,this),null==this.attrs.template?void this.$log.error("template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!"):(j=angular.element("
"),j.append(this.template),this.input=j.find("input")[0],void this.init())}return c(f,b),f.include(e),f.prototype.init=function(){return this.createSearchBox(),null!=this.attrs.parentdiv?this.addToParentDiv():this.addAsMapControl(),this.listener=google.maps.event.addListener(this.searchBox,"places_changed",function(a){return function(){return a.places=a.searchBox.getPlaces()}}(this)),this.listeners=this.setEvents(this.searchBox,this.scope,this.scope),this.$log.info(this),this.scope.$watch("options",function(a){return function(b){return angular.isObject(b)&&null!=b.bounds?a.setBounds(b.bounds):void 0}}(this),!0),this.scope.$on("$destroy",function(a){return function(){return a.searchBox=null}}(this))},f.prototype.addAsMapControl=function(){return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input)},f.prototype.addToParentDiv=function(){return this.parentDiv=angular.element(document.getElementById(this.scope.parentdiv)),this.parentDiv.append(this.input)},f.prototype.createSearchBox=function(){return this.searchBox=new google.maps.places.SearchBox(this.input,this.scope.options)},f.prototype.setBounds=function(a){if(angular.isUndefined(a.isEmpty))this.$log.error("Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.");else if(a.isEmpty()===!1&&null!=this.searchBox)return this.searchBox.setBounds(a)},f.prototype.getBounds=function(){return this.searchBox.getBounds()},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("WindowsParentModel".ns(),["IWindowParentModel".ns(),"ModelsWatcher".ns(),"PropMap".ns(),"WindowChildModel".ns(),"Linked".ns(),"_async".ns(),"Logger".ns(),"$timeout","$compile","$http","$templateCache","$interpolate",function(b,d,e,f,g,h,i,j,k,l,m,n){var o;return o=function(b){function o(b,c,d,f,h,i){var n;this.gMap=h,this.markersScope=i,this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMealWindows=a(this.pieceMealWindows,this),this.createAllNewWindows=a(this.createAllNewWindows,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopesWindows=a(this.createChildScopesWindows,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.go=a(this.go,this),o.__super__.constructor.call(this,b,c,d,f,j,k,l,m),n=this,this.windows=new e,this.scopePropNames=["coords","template","templateUrl","templateParameter","isIconVisibleOnClick","closeClick","options","show"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.linked=new g(b,c,d,f),this.models=void 0,this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.firstWatchModels=!0,this.$log.info(n),this.parentScope=void 0,this.go(b)}return c(o,b),o.include(d),o.prototype.go=function(a){return this.watchOurScope(a),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,a.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.createChildScopesWindows()},o.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){var e;return!_.isEqual(c,d)||b.firstWatchModels?(b.firstWatchModels=!1,b.doRebuildAll||b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):(e=0===b.windows.length,null!=b.existingPieces?b.existingPieces.then(function(){return b.createChildScopesWindows(e)}):b.createChildScopesWindows(e))):void 0}}(this))},o.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.windows.length>0&&b},o.prototype.rebuildAll=function(a,b,c){return h.waitOrGo(this,function(a){return function(){return h.each(a.windows.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.windows,a.windows=new e,b&&a.createChildScopesWindows(),Promise.resolve()})}}(this))},o.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.firstWatchModels=!0,b.firstTime=!0,b.rebuildAll(a,!1,!0)}}(this))},o.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c]}}(this))},o.prototype.createChildScopesWindows=function(a){var b,c,d;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,angular.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),b=angular.isUndefined(this.linked.scope.models),!b||void 0!==this.markersScope&&void 0!==(null!=(c=this.markersScope)?c.markerModels:void 0)&&void 0!==(null!=(d=this.markersScope)?d.models:void 0)?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNewWindows(this.linked.scope,!1):this.pieceMealWindows(this.linked.scope,!1)):(this.parentScope=this.markersScope,this.watchIdKey(this.parentScope),a?this.createAllNewWindows(this.markersScope,!0,"markerModels",!1):this.pieceMealWindows(this.markersScope,!0,"markerModels",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derrived from markers!")},o.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},o.prototype.createAllNewWindows=function(a,b,c,d){return null==c&&(c="models"),null==d&&(d=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),h.waitOrGo(this,function(d){return function(){return h.each(a.models,function(e){var f,g;return f=b&&null!=(g=a[c][[e[d.idKey]]])?g.gMarker:void 0,d.createWindow(e,f,d.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1}}(this))},o.prototype.pieceMealWindows=function(a,b,c,d){var e;return null==c&&(c="models"),null==d&&(d=!0),e=null!=this.existingPieces?!1:h.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.windows.length>0?this.figureOutState(this.idKey,a,this.windows,this.modelKeyComparison,function(b){return function(d){var f;return f=d,h.waitOrGo(b,function(){return h.each(f.removals,function(a){return null!=a&&(b.windows.remove(a.id),null!=a.destroy)?a.destroy(!0):void 0},e).then(function(){return h.each(f.adds,function(d){var e,f;if(e=null!=(f=a[c][d[b.idKey]])?f.gMarker:void 0,!e)throw"Gmarker undefined";return b.createWindow(d,e,b.gMap)},e)})}).then(function(){return b.existingPieces=void 0})["catch"](function(){return i.error("Error while pieceMealing Windows!")})}}(this)):this.rebuildAll(this.scope,!0,!0)},o.prototype.setContentKeys=function(a){return a.length>0?this.contentKeys=Object.keys(a[0]):void 0},o.prototype.createWindow=function(a,b,c){var d,e,g,h;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a){return function(b,c){var d;return b!==c&&(a.setChildScope(e,b),a.markersScope)?a.windows[b[a.idKey]].markerCtrl=null!=(d=a.markersScope.markerModels[b[a.idKey]])?d.gMarker:void 0:void 0}}(this),!0),g={html:function(b){return function(){return b.interpolateContent(b.linked.element.html(),a)}}(this)},this.DEFAULTS=this.markersScope?a[this.optionsKey]||{}:this.DEFAULTS,h=this.createWindowOptions(b,e,g.html(),this.DEFAULTS),d=new f(a,e,h,this.isIconVisibleOnClick,c,b,g,!1,!0),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.windows.put(a[this.idKey],d),d)},o.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},o.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=n(a),d={},h=this.contentKeys,f=0,g=h.length;g>f;f++)e=h[f],d[e]=b[e];return c(d)}},o}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("Circle".ns(),["ICircle".ns(),"CircleParentModel".ns(),function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(){return function(e){return new b(a,c,d,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Control".ns(),["IControl".ns(),"$http","$templateCache","$compile","$controller","GoogleMapApi".ns(),function(b,d,e,f,g,h){var i;return i=function(i){function j(){this.link=a(this.link,this),j.__super__.constructor.call(this)}return c(j,i),j.prototype.link=function(a,c,i,j){return h.then(function(c){return function(h){var i,k;return angular.isUndefined(a.template)?void c.$log.error("mapControl: could not find a valid template property"):(i=angular.isDefined(a.index&&!isNaN(parseInt(a.index)))?parseInt(a.index):void 0,k=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_CENTER",h.ControlPosition[k]?b.mapPromise(a,j).then(function(b){var h,j;return h=void 0,j=angular.element("
"),d.get(a.template,{cache:e}).success(function(b){var c,d;return d=a.$new(),j.append(b),i&&(j[0].index=i),angular.isDefined(a.controller)&&(c=g(a.controller,{$scope:d}),j.children().data("$ngControllerController",c)),h=f(j.contents())(d)}).error(function(){return c.$log.error("mapControl: template could not be found")}).then(function(){return b.controls[google.maps.ControlPosition[k]].push(h[0])})}):void c.$log.error("mapControl: invalid position property"))}}(this))},j}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("DrawingManager".ns(),["IDrawingManager".ns(),"DrawingManagerParentModel".ns(),function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(){return function(e){return new b(a,c,d,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("ApiFreeDrawPolygons".ns(),["Logger".ns(),"BaseObject".ns(),"CtrlHandle".ns(),"DrawFreeHandChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function g(){return this.link=a(this.link,this),g.__super__.constructor.apply(this,arguments)}return c(g,d),g.include(e),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^"+"GoogleMap".ns(),g.prototype.scope={polygons:"=",draw:"="},g.prototype.link=function(a,c,d,e){return this.mapPromise(a,e).then(function(){return function(c){var d,e;return a.polygons?_.isArray(a.polygons)?(d=new f(c,a.originalMapOpts),e=void 0,a.draw=function(){return"function"==typeof e&&e(),d.engage(a.polygons).then(function(){var b;return b=!0,e=a.$watch("polygons",function(a,c){var d;return b?void(b=!1):(d=_.differenceObjects(c,a),d.forEach(function(a){return a.setMap(null)}))})})}):b.error("Free Draw Polygons must be of type Array!"):b.error("No polygons to bind to!")}}(this))},g}(d)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).service("ICircle".ns(),[function(){var a;return a={},{restrict:"EA",replace:!0,require:"^"+"GoogleMap".ns(),scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("IControl".ns(),["BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(b,d,e){var f;return f=function(b){function f(){this.link=a(this.link,this),this.restrict="EA",this.replace=!0,this.require="^"+"GoogleMap".ns(),this.scope={template:"@template",position:"@position",controller:"@controller",index:"@index"},this.$log=d}return c(f,b),f.extend(e),f.prototype.link=function(){throw new Exception("Not implemented!!")},f}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).service("IDrawingManager".ns(),[function(){return{restrict:"EA",replace:!0,require:"^"+"GoogleMap".ns(),scope:{"static":"@",control:"=",options:"="}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("IMarker".ns(),["Logger".ns(),"BaseObject".ns(),"CtrlHandle".ns(),function(b,d,e){var f;return f=function(d){function f(){this.link=a(this.link,this),this.$log=b,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.replace=!0,this.scope=f.keys}return c(f,d),f.keys={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit",idKey:"=idkey",control:"=control"},f.extend(e),f.prototype.link=function(a,b,c,d){if(!d)throw new Error("No Map Control! Marker Directive Must be inside the map!")},f}(d)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IPolygon".ns(),["GmapUtil".ns(),"BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^"+"GoogleMap".ns(),f.prototype.scope={path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=","static":"=",events:"=",zIndex:"=zindex",fit:"=",control:"=control"},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IPolyline".ns(),["GmapUtil".ns(),"BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^"+"GoogleMap".ns(),f.prototype.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=","static":"=",fit:"=",events:"="},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).service("IRectangle".ns(),[function(){"use strict";var a;return a={},{restrict:"EMA",require:"^"+"GoogleMap".ns(),replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("IWindow".ns(),["BaseObject".ns(),"ChildEvents".ns(),"Logger".ns(),function(b,d,e){var f;return f=function(b){function f(){this.link=a(this.link,this),this.restrict="EMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require="^"+"GoogleMap".ns(),this.replace=!0,this.scope={coords:"=coords",template:"=template",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options",control:"=control",show:"=show"},this.$log=e}return c(f,b),f.include(d),f.prototype.link=function(){throw new Exception("Not Implemented!!")},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Map".ns(),["$timeout","$q","Logger".ns(),"GmapUtil".ns(),"BaseObject".ns(),"CtrlHandle".ns(),"IsReady".ns(),"uuid".ns(),"ExtendGWin".ns(),"ExtendMarkerClusterer".ns(),"GoogleMapsUtilV3".ns(),"GoogleMapApi".ns(),function(b,d,e,f,g,h,i,j,k,l,m,n){"use strict";var o,p,q;return o=void 0,q=[m,k,l],p=function(b){function d(){this.link=a(this.link,this);var b,c;b=function(a){var b;return b=h.handle(a),a.ctrlType="Map",a.deferred.promise.then(function(){return q.forEach(function(a){return a.init()})}),b.getMap=function(){return a.map},_.extend(this,b)},this.controller=["$scope",b],c=this}return c(d,b),d.include(f),d.prototype.restrict="EMA",d.prototype.transclude=!0,d.prototype.replace=!1,d.prototype.template='
',d.prototype.scope={center:"=",zoom:"=",dragging:"=",control:"=",options:"=",events:"=",styles:"=",bounds:"="},d.prototype.link=function(a,b,c){return n.then(function(d){return function(f){var g,h,k,l,m,n,p,q,r,s,t;if(o={mapTypeId:f.MapTypeId.ROADMAP},r=i.spawn(),p=function(){return r.deferred.resolve({instance:r.instance,map:t})},!d.validateCoords(a.center))return void e.error("angular-google-maps: could not find a valid center property");if(!angular.isDefined(a.zoom))return void e.error("angular-google-maps: map zoom property not set");if(h=angular.element(b),h.addClass("angular-google-map"),n={options:{}},c.options&&(n.options=a.options),c.styles&&(n.styles=a.styles),c.type&&(s=c.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(s)?n.mapTypeId=google.maps.MapTypeId[c.type.toUpperCase()]:e.error("angular-google-maps: invalid map type '"+c.type+"'")),m=angular.extend({},o,n,{center:d.getCoords(a.center),zoom:a.zoom,bounds:a.bounds}),t=new google.maps.Map(h.find("div")[1],m),t["_id".ns()]=j.generate(),g=!1,t?(a.deferred.resolve(t),p()):google.maps.event.addListener(t,"tilesloaded ",function(b){return a.deferred.resolve(b),p()}),google.maps.event.addListener(t,"dragstart",function(){return g=!0,_.defer(function(){return a.$apply(function(a){return null!=a.dragging?a.dragging=g:void 0})})}),google.maps.event.addListener(t,"dragend",function(){return g=!1,_.defer(function(){return a.$apply(function(a){return null!=a.dragging?a.dragging=g:void 0})})}),google.maps.event.addListener(t,"drag",function(){var b;return b=t.center,_.defer(function(){return a.$apply(function(a){return angular.isDefined(a.center.type)?(a.center.coordinates[1]=b.lat(),a.center.coordinates[0]=b.lng()):(a.center.latitude=b.lat(),a.center.longitude=b.lng())})})}),google.maps.event.addListener(t,"zoom_changed",function(){return a.zoom!==t.zoom?_.defer(function(){return a.$apply(function(a){return a.zoom=t.zoom})}):void 0}),q=!1,google.maps.event.addListener(t,"center_changed",function(){var b;return b=t.center,q?void 0:_.defer(function(){return a.$apply(function(a){if(!t.dragging)if(angular.isDefined(a.center.type)){if(a.center.coordinates[1]!==b.lat()&&(a.center.coordinates[1]=b.lat()),a.center.coordinates[0]!==b.lng())return a.center.coordinates[0]=b.lng()}else if(a.center.latitude!==b.lat()&&(a.center.latitude=b.lat()),a.center.longitude!==b.lng())return a.center.longitude=b.lng()})})}),google.maps.event.addListener(t,"idle",function(){var b,c,d;return b=t.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),_.defer(function(){return a.$apply(function(a){return null!==a.bounds&&void 0!==a.bounds&&void 0!==a.bounds?(a.bounds.northeast={latitude:c.lat(),longitude:c.lng()},a.bounds.southwest={latitude:d.lat(),longitude:d.lng()}):void 0})})}),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)){l=function(b){return function(){return a.events[b].apply(a,[t,b,arguments])}};for(k in a.events)a.events.hasOwnProperty(k)&&angular.isFunction(a.events[k])&&google.maps.event.addListener(t,k,l(k))}return t.getOptions=function(){return m},a.map=t,null!=c.control&&null!=a.control&&(a.control.refresh=function(a){var b;if(null!=t)return google.maps.event.trigger(t,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.latitude:void 0)?(b=d.getCoords(a),d.isTrue(c.pan)?t.panTo(b):t.setCenter(b)):void 0},a.control.getGMap=function(){return t},a.control.getMapOptions=function(){return m}),a.$watch("center",function(b){var f;return f=d.getCoords(b),f.lat()!==t.center.lat()||f.lng()!==t.center.lng()?(q=!0,g||(d.validateCoords(b)||e.error("Invalid center for newValue: "+JSON.stringify(b)),d.isTrue(c.pan)&&a.zoom===t.zoom?t.panTo(f):t.setCenter(f)),q=!1):void 0},!0),a.$watch("zoom",function(a){return a!==t.zoom?_.defer(function(){return t.setZoom(a)}):void 0}),a.$watch("bounds",function(a,b){var c,d,f;if(a!==b)return null==a.northeast.latitude||null==a.northeast.longitude||null==a.southwest.latitude||null==a.southwest.longitude?void e.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),f=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(f,d),t.fitBounds(c))}),a.$watch("options",function(a,b){return _.isEqual(a,b)||(n.options=a,null==t)?void 0:t.setOptions(n)},!0),a.$watch("styles",function(a,b){return _.isEqual(a,b)||(n.styles=a,null==t)?void 0:t.setOptions(n)},!0)}}(this))},d}(g)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments) -}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Marker".ns(),["IMarker".ns(),"MarkerChildModel".ns(),"MarkerManager".ns(),function(b,d,e){var f;return f=function(f){function g(){this.link=a(this.link,this),g.__super__.constructor.call(this),this.template='',this.$log.info(this)}return c(g,f),g.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Marker",_.extend(g,b.handle(a,c))}],g.prototype.link=function(a,c,f,g){var h;return a.fit&&(h=!0),b.mapPromise(a,g).then(function(c){return function(f){var g,h,i,j;return c.gMarkerManager||(c.gMarkerManager=new e(f)),i=_.keys(b.keys),i=_.object(i,i),c.promise=new d(a,a,i,f,{},g=!0,c.gMarkerManager,h=!1,j=!1).deferred.promise.then(function(b){return a.deferred.resolve(b)}),null!=a.control?a.control.getGMarkers=c.gMarkerManager.getGMarkers:void 0}}(this))},g}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Markers".ns(),["IMarker".ns(),"MarkersParentModel".ns(),"_sync".ns(),function(b,d){var e;return e=function(e){function f(b){this.link=a(this.link,this),f.__super__.constructor.call(this,b),this.template='',this.scope=_.extend(this.scope||{},{idKey:"=idkey",doRebuildAll:"=dorebuildall",models:"=models",doCluster:"=docluster",clusterOptions:"=clusteroptions",clusterEvents:"=clusterevents"}),this.$log.info(this)}return c(f,e),f.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Markers",_.extend(this,b.handle(a,c))}],f.prototype.link=function(a,c,e,f){var g,h;return g=void 0,h=function(){return function(){return null!=a.control&&(a.control.getGMarkers=function(){var a;return null!=(a=g.gMarkerManager)?a.getGMarkers():void 0},a.control.getChildMarkers=function(){return g.markerModels}),a.deferred.resolve()}}(this),b.mapPromise(a,f).then(function(){return function(b){return g=new d(a,c,e,b),g.existingPieces.then(function(){return h()})}}(this))},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polygon".ns(),["IPolygon".ns(),"$timeout","array-sync".ns(),"PolygonChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){var g,h;return g=[],h=b.mapPromise(a,e),null!=a.control&&(a.control.getInstance=this,a.control.polygons=g,a.control.promise=h),h.then(function(b){return function(c){return g.push(new f(a,d,c,b.DEFAULTS))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polyline".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylineChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){return angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void this.$log.error("polyline: no valid path attribute found"):b.mapPromise(a,e).then(function(b){return function(c){return new f(a,d,c,b.DEFAULTS)}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polylines".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylinesParentModel".ns(),function(b,d,e,f){var g;return g=function(b){function d(){this.link=a(this.link,this),d.__super__.constructor.call(this),this.scope.idKey="=idkey",this.scope.models="=models",this.$log.info(this)}return c(d,b),d.prototype.link=function(a,b,c,d){return angular.isUndefined(a.path)||null===a.path?void this.$log.error("polylines: no valid path attribute found"):a.models?d.getScope().deferred.promise.then(function(d){return function(e){return new f(a,b,c,e,d.DEFAULTS)}}(this)):void this.$log.error("polylines: no models found to create from")},d}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("Rectangle".ns(),["Logger".ns(),"GmapUtil".ns(),"IRectangle".ns(),"RectangleParentModel".ns(),function(a,b,c,d){return _.extend(c,{link:function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Window".ns(),["IWindow".ns(),"GmapUtil".ns(),"WindowChildModel".ns(),function(b,d,e){var f;return f=function(b){function f(){this.link=a(this.link,this),f.__super__.constructor.call(this),this.require=["^"+"GoogleMap".ns(),"^?"+"Marker".ns()],this.template='',this.$log.info(this),this.childWindows=[]}return c(f,b),f.include(d),f.prototype.link=function(a,b,c,d){var e,f,g;return e=d[0].getScope(),f=d.length>1&&null!=d[1]?d[1]:void 0,g=null!=f?f.getScope():void 0,e.deferred.promise.then(function(d){return function(e){var h;return h=!0,angular.isDefined(c.isiconvisibleonclick)&&(h=a.isIconVisibleOnClick),f?g.deferred.promise.then(function(c){return d.init(a,b,h,e,g,c)}):void d.init(a,b,h,e)}}(this))},f.prototype.init=function(a,b,c,d,f,g){var h,i,j,k;return i=null!=a.options?a.options:{},j=null!=a&&this.validateCoords(a.coords),null!=f&&f.$watch("coords",function(a){return function(b,c){return null==g||h.markerCtrl||(h.markerCtrl=g,h.handleClick(!0)),a.validateCoords(b)?angular.equals(b,c)?void 0:h.getLatestPosition(a.getCoords(b)):h.hideWindow()}}(this),!0),k=j?this.createWindowOptions(g,a,b.html(),i):i,null!=d&&(h=new e({},a,k,c,d,g,b),this.childWindows.push(h),a.$on("$destroy",function(a){return function(){return a.childWindows=_.withoutObjects(a.childWindows,[h],function(a,b){return a.scope.$id===b.scope.$id})}}(this))),null!=a.control&&(a.control.getGWindows=function(a){return function(){return a.childWindows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(a){return function(){return a.childWindows}}(this),a.control.showWindow=function(a){return function(){return a.childWindows.map(function(a){return a.showWindow()})}}(this),a.control.hideWindow=function(a){return function(){return a.childWindows.map(function(a){return a.hideWindow()})}}(this)),null!=this.onChildCreation&&null!=h?this.onChildCreation(h):void 0},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Windows".ns(),["IWindow".ns(),"WindowsParentModel".ns(),function(b,d){var e;return e=function(b){function e(){this.init=a(this.init,this),this.link=a(this.link,this),e.__super__.constructor.call(this),this.require=["^"+"GoogleMap".ns(),"^?"+"Markers".ns()],this.template='',this.scope.idKey="=idkey",this.scope.doRebuildAll="=dorebuildall",this.scope.models="=models",this.$log.debug(this)}return c(e,b),e.prototype.link=function(a,b,c,d){var e,f,g;return e=d[0].getScope(),f=d.length>1&&null!=d[1]?d[1]:void 0,g=null!=f?f.getScope():void 0,e.deferred.promise.then(function(e){return function(f){var h,i;return h=(null!=g&&null!=(i=g.deferred)?i.promise:void 0)||Promise.resolve(),h.then(function(){var h,i;return h=null!=(i=e.parentModel)?i.existingPieces:void 0,h?h.then(function(){return e.init(a,b,c,d,f,g)}):e.init(a,b,c,d,f,g)})}}(this))},e.prototype.init=function(a,b,c,e,f,g){var h;return h=new d(a,b,c,e,f,g),null!=a.control?(a.control.getGWindows=function(){return function(){return h.windows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(){return function(){return h.windows}}(this)):void 0},e}(b)}])}.call(this),function(){angular.module("google-maps".ns()).directive("GoogleMap".ns(),["Map".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Marker".ns(),["$timeout","Marker".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Markers".ns(),["$timeout","Markers".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polygon".ns(),["Polygon".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Circle".ns(),["Circle".ns(),function(a){return a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polyline".ns(),["Polyline".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polylines".ns(),["Polylines".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Rectangle".ns(),["Logger".ns(),"Rectangle".ns(),function(a,b){return b}])}.call(this),function(){angular.module("google-maps".ns()).directive("Window".ns(),["$timeout","$compile","$http","$templateCache","Window".ns(),function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Windows".ns(),["$timeout","$compile","$http","$templateCache","$interpolate","Windows".ns(),function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps".ns()).directive("Layer".ns(),["$timeout","Logger".ns(),"LayerParentModel".ns(),function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return null!=a.onCreated?new d(a,b,c,e,a.onCreated):new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){angular.module("google-maps".ns()).directive("MapControl".ns(),["Control".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("DrawingManager".ns(),["DrawingManager".ns(),function(a){return a}])}.call(this),function(){angular.module("google-maps".ns()).directive("FreeDrawPolygons".ns(),["ApiFreeDrawPolygons".ns(),function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps".ns()).directive("MapType".ns(),["$timeout","Logger".ns(),"MapTypeParentModel".ns(),function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",options:"=options",refresh:"=refresh",id:"@"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps".ns()).directive("SearchBox".ns(),["GoogleMapApi".ns(),"Logger".ns(),"SearchBoxParentModel".ns(),"$http","$templateCache",function(b,c,d,e,f){var g;return new(g=function(){function g(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={template:"=template",position:"=position",options:"=options",events:"=events",parentdiv:"=parentdiv"}}return g.prototype.link=function(a,c,g,h){return b.then(function(b){return function(i){return e.get(a.template,{cache:f}).success(function(e){return h.getScope().deferred.promise.then(function(f){var h;return h=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_LEFT",i.ControlPosition[h]?new d(a,c,g,f,h,e):void b.$log.error("searchBox: invalid position property")})})}}(this))},g}())}])}.call(this),angular.module("google-maps.wrapped".ns()).service("uuid".ns(),function(){function a(){}return a.generate=function(){var b=a._gri,c=a._ha;return c(b(32),8)+"-"+c(b(16),4)+"-"+c(16384|b(12),4)+"-"+c(32768|b(14),4)+"-"+c(b(48),12)},a._gri=function(a){return 0>a?0/0:30>=a?0|Math.random()*(1<=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<0;d>>>=1,e+=e)1&d&&(c=e+c);return c},a}),angular.module("google-maps.wrapped".ns()).service("GoogleMapsUtilV3".ns(),function(){return{init:_.once(function(){function a(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&(a.visible="undefined"==typeof a.isHidden?!0:!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function b(a,c){a.getMarkerClusterer().extend(b,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function c(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new b(this,a.getStyles())}function d(a,b,c){this.extend(d,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.imagePath_=c.imagePath||d.IMAGE_PATH,this.imageExtension_=c.imageExtension||d.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||d.IMAGE_SIZES,this.calculator_=c.calculator||d.CALCULATOR,this.batchSize_=c.batchSize||d.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||d.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function e(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function f(a,b){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=f.getSharedCross(b)}function g(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new f(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}a.prototype=new google.maps.OverlayView,a.prototype.createInfoBoxDiv_=function(){var a,b,c,d=this,e=function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},f=function(a){a.returnValue=!1,a.preventDefault&&a.preventDefault(),d.enableEventPropagation_||e(a)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),"undefined"==typeof this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;ag&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){{b.getCenter()}b.panBy(d,e)}}},a.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);"undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},a.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""),a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},a.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},a.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.div_.style.visibility=this.isHidden_?"hidden":"visible"},a.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},a.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},a.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},a.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},a.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},a.prototype.getContent=function(){return this.content_},a.prototype.getPosition=function(){return this.position_},a.prototype.getZIndex=function(){return this.zIndex_},a.prototype.getVisible=function(){var a;return a="undefined"==typeof this.getMap()||null===this.getMap()?!1:!this.isHidden_},a.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},a.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},a.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},a.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;af&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},b.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},b.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},b.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},b.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="",this.div_.innerHTML=a+"
"+this.sums_.text+"
",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display=""}this.visible_=!0},b.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},b.prototype.setCenter=function(a){this.center_=a},b.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.join("")},b.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},c.prototype.getSize=function(){return this.markers_.length},c.prototype.getMarkers=function(){return this.markers_},c.prototype.getCenter=function(){return this.center_},c.prototype.getMap=function(){return this.map_},c.prototype.getMarkerClusterer=function(){return this.markerClusterer_},c.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;ad)a.getMap()!==this.map_&&a.setMap(this.map_);else if(cb;b++)this.markers_[b].setMap(null);else a.setMap(null);return this.updateIcon_(),!0},c.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},c.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},c.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(a0))for(a=0;ad&&(g=d,h=e));h&&h.isMarkerInClusterBounds(a)?h.addMarker(a):(e=new c(this),e.addMarker(a),this.clusters_.push(e))},d.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);gc?a.getMap()!==this.map_&&a.setMap(this.map_):b3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_.values()[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);if(gc&&(f=c,g=d));g&&g.isMarkerInClusterBounds(a)?g.addMarker(a):(d=new NgMapCluster(this),d.addMarker(a),this.clusters_.push(d))},c.prototype.redraw_=function(){this.createClusters_(0)},c.prototype.resetViewport_=function(a){var b;for(b=0;b0&&(f=e[0])):f=c,f},defaultDelay:50,isTrue:function(a){return f(a,!0,["true","TRUE",1,"y","Y","yes","YES"])},isFalse:e,isFalsy:function(a){return f(a,!1,[void 0,null])||e(a)},getCoords:g,validateCoords:j,equalCoords:function(a,b){return h(a)===h(b)&&i(a)===i(b)},validatePath:function(a){var d,e,f,g;if(e=0,b.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;ethis.max)return this.max=a[0].length,this.index=b},g),f=a.coordinates[g.index],d=f[0],d.length<4)return!1}else{if("LineString"!==a.type)return!1;if(a.coordinates.length<2)return!1;d=a.coordinates}for(;ethis.max)return this.max=a[0].length,this.index=b},h),d=a.coordinates[h.index][0]):"LineString"===a.type&&(d=a.coordinates);e0&&(d-=1),f.length&&(f.length-=1)}}}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapLinked",["uiGmapBaseObject",function(b){var c;return c=function(b){function c(a,b,c,d){this.scope=a,this.element=b,this.attrs=c,this.ctrls=d}return a(c,b),c}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapLogger",["nemSimpleLogger",function(a){return a.spawn()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapModelKey",["uiGmapBaseObject","uiGmapGmapUtil",function(e,f){return function(e){function g(b,c){this.scope=b,this.interface=null!=c?c:{scopeKeys:[]},this.modelsLength=a(this.modelsLength,this),this.updateChild=a(this.updateChild,this),this.destroy=a(this.destroy,this),this.setChildScope=a(this.setChildScope,this),this.getChanges=a(this.getChanges,this),this.getProp=a(this.getProp,this),this.setIdKey=a(this.setIdKey,this),this.modelKeyComparison=a(this.modelKeyComparison,this),g.__super__.constructor.call(this),this.defaultIdKey="id",this.idKey=void 0}return d(g,e),g.prototype.evalModelHandle=function(a,b){if(null!=a&&null!=b)return"self"===b?a:(c.isFunction(b)&&(b=b()),f.getPath(a,b))},g.prototype.modelKeyComparison=function(a,b){var d,e,g,h,i,j;if(g=this.interface.scopeKeys.indexOf("coords")>=0,(g&&null!=this.scope.coords||!g)&&(i=this.scope),null==i)throw"No scope set!";return g&&(d=this.scopeOrModelVal("coords",i,a),e=this.scopeOrModelVal("coords",i,b),h=f.equalCoords(d,e),!h)?h:(j=c.without(this.interface.scopeKeys,"coords"),h=c.every(j,function(d){return function(e){var f,g;return f=d.scopeOrModelVal(i[e],i,a),g=d.scopeOrModelVal(i[e],i,b),i.deepComparison?c.isEqual(f,g):f===g}}(this)))},g.prototype.setIdKey=function(a){return this.idKey=null!=a.idKey?a.idKey:this.defaultIdKey},g.prototype.setVal=function(a,b,c){return this.modelOrKey(a,b=c),a},g.prototype.modelOrKey=function(a,b){if(null!=b)return"self"!==b?f.getPath(a,b):a},g.prototype.getProp=function(a,b,c){return this.scopeOrModelVal(a,b,c)},g.prototype.getChanges=function(a,b,d){var e,f,g;d&&(b=c.pick(b,d),a=c.pick(a,d)),f={},g={},e={};for(g in a)b&&b[g]===a[g]||(c.isArray(a[g])?f[g]=a[g]:c.isObject(a[g])?(e=this.getChanges(a[g],b?b[g]:null),c.isEmpty(e)||(f[g]=e)):f[g]=a[g]);return f},g.prototype.scopeOrModelVal=function(a,b,d,e){var f,g,h,i;return null==e&&(e=!1),f=function(a,b,c){return null==c&&(c=!1),c?{isScope:a,value:b}:b},i=c.get(b,a),c.isFunction(i)?f(!0,i(d),e):c.isObject(i)?f(!0,i,e):c.isString(i)?(g=i,h=g?"self"===g?d:c.get(d,g):c.get(d,a),c.isFunction(h)?f(!1,h(),e):f(!1,h,e)):f(!0,i,e)},g.prototype.setChildScope=function(a,b,c){var d,e,f,g;for(e in a)f=a[e],d=this.scopeOrModelVal(f,b,c,!0),null!=(null!=d?d.value:void 0)&&(g=d.value,g!==b[f]&&(b[f]=g));return b.model=c},g.prototype.onDestroy=function(a){},g.prototype.destroy=function(a){var b;return null==a&&(a=!1),null==this.scope||(null!=(b=this.scope)?b.$$destroyed:void 0)||!this.needToManualDestroy&&!a?this.clean():this.scope.$destroy()},g.prototype.updateChild=function(a,b){return null==b[this.idKey]?void this.$log.error("Model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):a.updateModel(b)},g.prototype.modelsLength=function(a){var c,d;return null==a&&(a=void 0),c=0,d=a?a:this.scope.models,null==d?c:c=b.isArray(d)||null!=d.length?d.length:Object.keys(d).length},g}(e)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapModelsWatcher",["uiGmapLogger","uiGmap_async","$q","uiGmapPromise",function(a,b,c,d){return{didQueueInitPromise:function(a,c){return 0===c.models.length&&(b.promiseLock(a,d.promiseTypes.init,null,null,function(){return d.resolve()}),!0)},figureOutState:function(b,c,d,e,f){var g,h,i,j,k;return g=[],i={},j=[],k=[],c.models.forEach(function(f){var h;return null==f[b]?a.error(" id missing for model #{m.toString()},\ncan not use do comparison/insertion"):(i[f[b]]={},null==d.get(f[b])?g.push(f):(h=d.get(f[b]),e(f,h.clonedModel,c)?void 0:k.push({model:f,child:h})))}),h=d.values(),h.forEach(function(c){var d;return null==c?void a.error("child undefined in ModelsWatcher."):null==c.model?void a.error("child.model undefined in ModelsWatcher."):(d=c.model[b],null==i[d]?j.push(c):void 0)}),{adds:g,removals:j,updates:k}}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmapPromise",["$q","$timeout","uiGmapLogger",function(a,b,d){var e,f,g,h,i,j,k,l,m,n,o;return m={create:"create",update:"update",delete:"delete",init:"init"},l={IN_PROGRESS:0,RESOLVED:1,REJECTED:2},o=function(){var a;return a={},a[""+l.IN_PROGRESS]="in-progress",a[""+l.RESOLVED]="resolved",a[""+l.REJECTED]="rejected",a}(),h=function(a){return a.$$state?a.$$state.status===l.IN_PROGRESS:!a.hasOwnProperty("$$v")||void 0},i=function(a){return a.$$state?a.$$state.status===l.RESOLVED:!!a.hasOwnProperty("$$v")||void 0},k=function(a){return o[a]||"done w error"},e=function(b){var c,d,e;return c=a.defer(),d=a.all([b,c.promise]),e=a.defer(),b.then(c.resolve,function(){},function(a){return c.notify(a),e.notify(a)}),d.then(function(a){return e.resolve(a[0]||a[1])},function(a){return e.reject(a)}),e.promise.cancel=function(a){return null==a&&(a="canceled"),c.reject(a)},e.promise.notify=function(a){if(null==a&&(a="cancel safe"),e.notify(a),b.hasOwnProperty("notify"))return b.notify(a)},null!=b.promiseType&&(e.promise.promiseType=b.promiseType),e.promise},f=function(a,b){return{promise:a,promiseType:b}},g=function(){return a.defer()},n=function(){var b;return b=a.defer(),b.resolve.apply(void 0,arguments),b.promise},j=function(e){var f;return c.isFunction(e)?(f=a.defer(),b(function(){var a;return a=e(),f.resolve(a)}),f.promise):void d.error("uiGmapPromise.promise() only accepts functions")},{defer:g,promise:j,resolve:n,promiseTypes:m,isInProgress:h,isResolved:i,promiseStatus:k,ExposedPromise:e,SniffedPromise:f}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapPropMap",function(){var b;return b=function(){function b(){this.removeAll=a(this.removeAll,this),this.slice=a(this.slice,this),this.push=a(this.push,this),this.keys=a(this.keys,this),this.values=a(this.values,this),this.remove=a(this.remove,this),this.put=a(this.put,this),this.stateChanged=a(this.stateChanged,this),this.get=a(this.get,this),this.length=0,this.dict={},this.didValsStateChange=!1,this.didKeysStateChange=!1,this.allVals=[],this.allKeys=[]}return b.prototype.get=function(a){return this.dict[a]},b.prototype.stateChanged=function(){return this.didValsStateChange=!0,this.didKeysStateChange=!0},b.prototype.put=function(a,b){return null==this.get(a)&&this.length++,this.stateChanged(),this.dict[a]=b},b.prototype.remove=function(a,b){var c;if(null==b&&(b=!1),!b||this.get(a))return c=this.dict[a],delete this.dict[a],this.length--,this.stateChanged(),c},b.prototype.valuesOrKeys=function(a){var b,d;return null==a&&(a="Keys"),this["did"+a+"StateChange"]?(d=[],b=[],c.each(this.dict,function(a,c){return d.push(a),b.push(c)}),this.didKeysStateChange=!1,this.didValsStateChange=!1,this.allVals=d,this.allKeys=b,this["all"+a]):this["all"+a]},b.prototype.values=function(){return this.valuesOrKeys("Vals")},b.prototype.keys=function(){return this.valuesOrKeys()},b.prototype.push=function(a,b){return null==b&&(b="key"),this.put(a[b],a)},b.prototype.slice=function(){return this.keys().map(function(a){return function(b){return a.remove(b)}}(this))},b.prototype.removeAll=function(){return this.slice()},b.prototype.each=function(a){return c.each(this.dict,function(b,c){return a(b)})},b.prototype.map=function(a){return c.map(this.dict,function(b,c){return a(b)})},b}()})}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapPropertyAction",["uiGmapLogger",function(a){var b;return b=function(a){return this.setIfChange=function(b){return function(d,e){if(!c.isEqual(e,d))return a(b,d)}},this.sic=this.setIfChange,this}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapClustererMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap","uiGmapEventsHelper",function(c,d,e,f){var g;return g=function(){function g(b,d,f,h){null==d&&(d={}),this.opt_options=null!=f?f:{},this.opt_events=h,this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.destroy=a(this.destroy,this),this.attachEvents=a(this.attachEvents,this),this.clear=a(this.clear,this),this.draw=a(this.draw,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=g.type,this.clusterer=new NgMapMarkerClusterer(b,d,this.opt_options),this.propMapGMarkers=new e,this.attachEvents(this.opt_events,"opt_events"),this.clusterer.setIgnoreHidden(!0),this.noDrawOnSingleAddRemoves=!0,c.info(this)}return g.type="ClustererMarkerManager",g.prototype.checkKey=function(a){var b;if(null==a.key)return b="gMarker.key undefined and it is REQUIRED!!",c.error(b)},g.prototype.add=function(a){return this.checkKey(a),this.clusterer.addMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.put(a.key,a),this.checkSync()},g.prototype.update=function(a){return this.remove(a),this.add(a)},g.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},g.prototype.remove=function(a){var b;return this.checkKey(a),b=this.propMapGMarkers.get(a.key),b&&(this.clusterer.removeMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.remove(a.key)),this.checkSync()},g.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},g.prototype.draw=function(){return this.clusterer.repaint()},g.prototype.clear=function(){return this.removeMany(this.getGMarkers()),this.clusterer.repaint()},g.prototype.attachEvents=function(a,d){var e,f,g;if(this.listeners=[],b.isDefined(a)&&null!=a&&b.isObject(a)){g=[];for(f in a)e=a[f],a.hasOwnProperty(f)&&b.isFunction(a[f])?(c.info(d+": Attaching event: "+f+" to clusterer"),g.push(this.listeners.push(google.maps.event.addListener(this.clusterer,f,a[f])))):g.push(void 0);return g}},g.prototype.clearEvents=function(){return f.removeEvents(this.listeners),this.listeners=[]},g.prototype.destroy=function(){return this.clearEvents(),this.clear()},g.prototype.fit=function(){return d.fit(this.getGMarkers(),this.clusterer.getMap())},g.prototype.getGMarkers=function(){return this.clusterer.getMarkers().values()},g.prototype.checkSync=function(){},g}()}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.managers").service("uiGmapGoogleMapObjectManager",[function(){var a,c;return a=[],c=[],{createMapInstance:function(d,e){var f;return f=null,0===a.length?(f=new google.maps.Map(d,e),c.push(f)):(f=a.pop(),b.element(d).append(f.getDiv()),f.setOptions(e),c.push(f)),f},recycleMapInstance:function(b){var d;if(d=c.indexOf(b),d<0)throw new Error("Expected map instance to be a previously used instance");return c.splice(d,1),a.push(b)}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap",function(b,c,d){var e;return e=function(){function e(c,f,g){this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.handleOptDraw=a(this.handleOptDraw,this),this.clear=a(this.clear,this),this.destroy=a(this.destroy,this),this.draw=a(this.draw,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=e.type,this.gMap=c,this.gMarkers=new d,this.$log=b,this.$log.info(this)}return e.type="MarkerManager",e.prototype.add=function(a,c){var d,e;if(null==c&&(c=!0),null==a.key)throw e="gMarker.key undefined and it is REQUIRED!!",b.error(e),e;if(d=this.gMarkers.get(a.key),!d)return this.handleOptDraw(a,c,!0),this.gMarkers.put(a.key,a)},e.prototype.update=function(a,b){return null==b&&(b=!0),this.remove(a,b),this.add(a,b)},e.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},e.prototype.remove=function(a,b){if(null==b&&(b=!0),this.handleOptDraw(a,b,!1),this.gMarkers.get(a.key))return this.gMarkers.remove(a.key)},e.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},e.prototype.draw=function(){var a;return a=[],this.gMarkers.each(function(b){return function(c){if(!c.isDrawn)return c.doAdd?(c.setMap(b.gMap),c.isDrawn=!0):a.push(c)}}(this)),a.forEach(function(a){return function(b){return b.isDrawn=!1,a.remove(b,!0)}}(this))},e.prototype.destroy=function(){return this.clear()},e.prototype.clear=function(){return this.gMarkers.each(function(a){ +return a.setMap(null)}),delete this.gMarkers,this.gMarkers=new d},e.prototype.handleOptDraw=function(a,b,c){return b===!0?(c?a.setMap(this.gMap):a.setMap(null),a.isDrawn=!0):(a.isDrawn=!1,a.doAdd=c)},e.prototype.fit=function(){return c.fit(this.getGMarkers(),this.gMap)},e.prototype.getGMarkers=function(){return this.gMarkers.values()},e}()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapSpiderfierMarkerManager",["uiGmapLogger","uiGmapFitHelper","uiGmapPropMap","uiGmapMarkerSpiderfier",function(d,e,f,g){var h;return h=function(){function h(b,c,e,i,j){null==c&&(c={}),this.opt_options=null!=e?e:{},this.opt_events=i,this.scope=j,this.isSpiderfied=a(this.isSpiderfied,this),this.getGMarkers=a(this.getGMarkers,this),this.fit=a(this.fit,this),this.destroy=a(this.destroy,this),this.attachEvents=a(this.attachEvents,this),this.clear=a(this.clear,this),this.removeMany=a(this.removeMany,this),this.remove=a(this.remove,this),this.addMany=a(this.addMany,this),this.update=a(this.update,this),this.add=a(this.add,this),this.type=h.type,this.markerSpiderfier=new g(b,this.opt_options),this.propMapGMarkers=new f,this.attachEvents(this.opt_events,"opt_events"),this.noDrawOnSingleAddRemoves=!0,d.info(this)}return h.type="SpiderfierMarkerManager",h.prototype.checkKey=function(a){var b;if(null==a.key)return b="gMarker.key undefined and it is REQUIRED!!",d.error(b)},h.prototype.add=function(a){return a.setMap(this.markerSpiderfier.map),this.checkKey(a),this.markerSpiderfier.addMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.put(a.key,a),this.checkSync()},h.prototype.update=function(a){return this.remove(a),this.add(a)},h.prototype.addMany=function(a){return a.forEach(function(a){return function(b){return a.add(b)}}(this))},h.prototype.remove=function(a){var b;return this.checkKey(a),b=this.propMapGMarkers.get(a.key),b&&(a.setMap(null),this.markerSpiderfier.removeMarker(a,this.noDrawOnSingleAddRemoves),this.propMapGMarkers.remove(a.key)),this.checkSync()},h.prototype.removeMany=function(a){return a.forEach(function(a){return function(b){return a.remove(b)}}(this))},h.prototype.draw=function(){},h.prototype.clear=function(){return this.removeMany(this.getGMarkers())},h.prototype.attachEvents=function(a,e){if(b.isDefined(a)&&null!=a&&b.isObject(a))return c.each(a,function(c){return function(f,g){if(a.hasOwnProperty(g)&&b.isFunction(a[g]))return d.info(e+": Attaching event: "+g+" to markerSpiderfier"),c.markerSpiderfier.addListener(g,function(){return"spiderfy"===g||"unspiderfy"===g?c.scope.$evalAsync(a[g].apply(a,arguments)):c.scope.$evalAsync(a[g].apply(a,[arguments[0],g,arguments[0].model,arguments]))})}}(this))},h.prototype.clearEvents=function(a,c){var e,f;if(b.isDefined(a)&&null!=a&&b.isObject(a))for(f in a)e=a[f],a.hasOwnProperty(f)&&b.isFunction(a[f])&&(d.info(c+": Clearing event: "+f+" to markerSpiderfier"),this.markerSpiderfier.clearListeners(f))},h.prototype.destroy=function(){return this.clearEvents(this.opt_events,"opt_events"),this.clear()},h.prototype.fit=function(){return e.fit(this.getGMarkers(),this.markerSpiderfier.map)},h.prototype.getGMarkers=function(){return this.markerSpiderfier.getMarkers()},h.prototype.isSpiderfied=function(){return c.find(this.getGMarkers(),function(a){return null!=(null!=a?a._omsData:void 0)})},h.prototype.checkSync=function(){},h}()}])}.call(this),function(){b.module("uiGmapgoogle-maps").factory("uiGmapadd-events",["$timeout",function(a){var c,d;return c=function(b,c,d){return google.maps.event.addListener(b,c,function(){return d.apply(this,arguments),a(function(){},!0)})},d=function(a,d,e){var f;return e?c(a,d,e):(f=[],b.forEach(d,function(b,d){return f.push(c(a,d,b))}),function(){return b.forEach(f,function(a){return google.maps.event.removeListener(a)}),f=null})}}])}.call(this),function(){b.module("uiGmapgoogle-maps").factory("uiGmaparray-sync",["uiGmapadd-events",function(a){return function(c,d,e,f){var g,h,i,j,k,l,m,n,o;return j=!1,n=d.$eval(e),d.static||(k={set_at:function(a){var b;if(!j&&(b=c.getAt(a)))return b.lng&&b.lat?(n[a].latitude=b.lat(),n[a].longitude=b.lng()):n[a]=b},insert_at:function(a){var b;if(!j&&(b=c.getAt(a)))return b.lng&&b.lat?n.splice(a,0,{latitude:b.lat(),longitude:b.lng()}):n.splice(a,0,b)},remove_at:function(a){if(!j)return n.splice(a,1)}},"Polygon"===n.type?g=n.coordinates[0]:"LineString"===n.type&&(g=n.coordinates),h={set_at:function(a){var b;if(!j&&(b=c.getAt(a),b&&b.lng&&b.lat))return g[a][1]=b.lat(),g[a][0]=b.lng()},insert_at:function(a){var b;if(!j&&(b=c.getAt(a),b&&b.lng&&b.lat))return g.splice(a,0,[b.lng(),b.lat()])},remove_at:function(a){if(!j)return g.splice(a,1)}},m=a(c,b.isUndefined(n.type)?k:h)),l=function(a){var b,d,e,g,h,i,k,l;if(j=!0,i=c,b=!1,a){for(d=0,k=i.getLength(),g=a.length,e=Math.min(k,g),h=void 0;d0&&(a.gObject=f(a.buildOpts(a.pathPoints,c))),a.gObject?(g(a.gObject.getPath(),a.scope,"path",function(b){if(a.pathPoints=b,null!=h)return h()}),b.isDefined(a.scope.events)&&b.isObject(a.scope.events)&&(a.listeners=a.model?i.setEvents(a.gObject,a.scope,a.model):i.setEvents(a.gObject,a.scope,a.scope)),a.internalListeners=a.model?i.setEvents(a.gObject,{events:a.internalEvents},a.model):i.setEvents(a.gObject,{events:a.internalEvents},a.scope)):void 0}}(this),e(),this.scope.$watch("path",function(a){return function(b,d){if(!c.isEqual(b,d)||!a.gObject)return e()}}(this),!0),!this.scope.static&&b.isDefined(this.scope.editable)&&this.scope.$watch("editable",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setEditable(b):void 0}}(this),!0),b.isDefined(this.scope.draggable)&&this.scope.$watch("draggable",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setDraggable(b):void 0}}(this),!0),b.isDefined(this.scope.visible)&&this.scope.$watch("visible",function(a){return function(b,c){var d;return b!==c&&(b=!a.isFalse(b)),null!=(d=a.gObject)?d.setVisible(b):void 0}}(this),!0),b.isDefined(this.scope.geodesic)&&this.scope.$watch("geodesic",function(a){return function(b,c){var d;if(b!==c)return b=!a.isFalse(b),null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.weight)&&this.scope.$watch("stroke.weight",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.color)&&this.scope.$watch("stroke.color",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.stroke)&&b.isDefined(this.scope.stroke.opacity)&&this.scope.$watch("stroke.opacity",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),b.isDefined(this.scope.icons)&&this.scope.$watch("icons",function(a){return function(b,c){var d;if(b!==c)return null!=(d=a.gObject)?d.setOptions(a.buildOpts(a.gObject.getPath())):void 0}}(this),!0),this.scope.$on("$destroy",function(a){return function(){return a.clean(),a.scope=null}}(this)),b.isDefined(this.scope.fill)&&b.isDefined(this.scope.fill.color)&&this.scope.$watch("fill.color",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this)),b.isDefined(this.scope.fill)&&b.isDefined(this.scope.fill.opacity)&&this.scope.$watch("fill.opacity",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this)),b.isDefined(this.scope.zIndex)&&this.scope.$watch("zIndex",function(a){return function(b,c){if(b!==c)return a.gObject.setOptions(a.buildOpts(a.gObject.getPath()))}}(this))}return d(j,e),j.include(h),j.prototype.clean=function(){var a;return i.removeEvents(this.listeners),i.removeEvents(this.internalListeners),null!=(a=this.gObject)&&a.setMap(null),this.gObject=null},j}(e)}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapDrawFreeHandChildModel",["uiGmapLogger","$q",function(a,b){var d,e;return d=function(a,b,c){var d,e;e=new google.maps.Polyline({map:a,clickable:!1}),d=google.maps.event.addListener(a,"mousemove",function(a){return e.getPath().push(a.latLng)}),google.maps.event.addListenerOnce(a,"mouseup",function(f){var g;return google.maps.event.removeListener(d),g=e.getPath(),e.setMap(null),b.push(new google.maps.Polygon({map:a,path:g})),e=null,google.maps.event.clearListeners(a.getDiv(),"mousedown"),c()})},e=function(e,f){var g,h;return this.map=e,g=function(b){return function(){var c;return c={draggable:!1,disableDefaultUI:!0,scrollwheel:!1,disableDoubleClickZoom:!1},a.info("disabling map move"),b.map.setOptions(c)}}(this),h=function(a){return function(){var b,d;return b={draggable:!0,disableDefaultUI:!1,scrollwheel:!0,disableDoubleClickZoom:!0},null!=(d=a.deferred)&&d.resolve(),c.defer(function(){return a.map.setOptions(c.extend(b,f.options))})}}(this),this.engage=function(c){return function(e){return c.polys=e,c.deferred=b.defer(),g(),a.info("DrawFreeHandChildModel is engaged (drawing)."),google.maps.event.addDomListener(c.map.getDiv(),"mousedown",function(a){return d(c.map,c.polys,h)}),c.deferred.promise}}(this),this}}])}.call(this),function(){var d=function(a,b){return function(){return a.apply(b,arguments)}},e=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},f={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapMarkerChildModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger","uiGmapEventsHelper","uiGmapPropertyAction","uiGmapMarkerOptions","uiGmapIMarker","uiGmapMarkerManager","uiGmapPromise",function(f,g,h,i,j,k,l,m,n){var o;return o=function(f){function o(a){this.internalEvents=d(this.internalEvents,this),this.setLabelOptions=d(this.setLabelOptions,this),this.setOptions=d(this.setOptions,this),this.setIcon=d(this.setIcon,this),this.setCoords=d(this.setCoords,this),this.isNotValid=d(this.isNotValid,this),this.maybeSetScopeValue=d(this.maybeSetScopeValue,this),this.createMarker=d(this.createMarker,this),this.setMyScope=d(this.setMyScope,this),this.updateModel=d(this.updateModel,this),this.handleModelChanges=d(this.handleModelChanges,this),this.destroy=d(this.destroy,this);var b,e,f,g,i,k,l;l=a.scope,this.model=a.model,this.keys=a.keys,this.gMap=a.gMap,this.defaults=null!=(e=a.defaults)?e:{},this.doClick=a.doClick,this.gManager=a.gManager,this.doDrawSelf=null==(f=a.doDrawSelf)||f,this.trackModel=null==(g=a.trackModel)||g,this.needRedraw=null!=(i=a.needRedraw)&&i,this.isScopeModel=null!=(k=a.isScopeModel)&&k,this.isScopeModel&&(this.clonedModel=c.clone(this.model,!0)),this.deferred=n.defer(),c.each(this.keys,function(a){return function(b,d){var e;if(e=a.keys[d],null!=e&&!c.isFunction(e)&&c.isString(e))return a[d+"Key"]=e}}(this)),this.idKey=this.idKeyKey||"id",null!=this.model[this.idKey]&&(this.id=this.model[this.idKey]),o.__super__.constructor.call(this,l),this.scope.getGMarker=function(a){return function(){return a.gObject}}(this),this.firstTime=!0,this.trackModel?(this.scope.model=this.model,this.scope.$watch("model",function(a){return function(b,c){if(b!==c)return a.handleModelChanges(b,c)}}(this),!0)):(b=new j(function(a){return function(b){if(c.isFunction(b)&&(b="all"),!a.firstTime)return a.setMyScope(b,l)}}(this),!1),c.each(this.keys,function(a,c){return l.$watch(c,b.sic(c),!0)})),this.scope.$on("$destroy",function(a){return function(){return p(a)}}(this)),this.createMarker(this.model),h.info(this)}var p;return e(o,f),o.include(g),o.include(i),o.include(k),p=function(a){if(null!=(null!=a?a.gObject:void 0)&&(a.removeEvents(a.externalListeners),a.removeEvents(a.internalListeners),null!=a?a.gObject:void 0))return a.removeFromManager&&a.gManager.remove(a.gObject),a.gObject.setMap(null),a.gObject=null},o.prototype.destroy=function(a){return null==a&&(a=!0),this.removeFromManager=a,this.scope.$destroy()},o.prototype.handleModelChanges=function(a,b){var d,e,f;if(d=this.getChanges(a,b,l.keys),!this.firstTime)return e=0,f=c.keys(d).length,c.each(d,function(c){return function(d,g){var h;return e+=1,h=f===e,c.setMyScope(g,a,b,!1,!0,h),c.needRedraw=!0}}(this))},o.prototype.updateModel=function(a){return this.isScopeModel&&(this.clonedModel=c.clone(a,!0)),this.setMyScope("all",a,this.model)},o.prototype.renderGMarker=function(b,c){var d,e,f;if(null==b&&(b=!0),d=this.getProp("coords",this.scope,this.model),null!=(null!=(f=this.gManager)?f.isSpiderfied:void 0)&&(e=this.gManager.isSpiderfied()),null!=d){if(!this.validateCoords(d))return void h.debug("MarkerChild does not have coords yet. They may be defined later.");if(null!=c&&c(),b&&this.gObject&&this.gManager.add(this.gObject),e)return this.gManager.markerSpiderfier.spiderListener(this.gObject,a.event)}else if(b&&this.gObject)return this.gManager.remove(this.gObject)},o.prototype.setMyScope=function(a,b,d,e,f){var g;switch(null==d&&(d=void 0),null==e&&(e=!1),null==f&&(f=!0),null==b?b=this.model:this.model=b,this.gObject||(this.setOptions(this.scope,f),g=!0),a){case"all":return c.each(this.keys,function(a){return function(c,g){return a.setMyScope(g,b,d,e,f)}}(this));case"icon":return this.maybeSetScopeValue({gSetter:this.setIcon,doDraw:f});case"coords":return this.maybeSetScopeValue({gSetter:this.setCoords,doDraw:f});case"options":if(!g)return this.createMarker(b,d,e,f)}},o.prototype.createMarker=function(a,b,c,d){return null==b&&(b=void 0),null==c&&(c=!1),null==d&&(d=!0),this.maybeSetScopeValue({gSetter:this.setOptions,doDraw:d}),this.firstTime=!1},o.prototype.maybeSetScopeValue=function(a){var b,c,d;if(c=a.gSetter,b=null==(d=a.doDraw)||d,null!=c&&c(this.scope,b),this.doDrawSelf&&b)return this.gManager.draw()},o.prototype.isNotValid=function(a,b){var c,d;return null==b&&(b=!0),d=!!b&&void 0===this.gObject,c=!this.trackModel&&a.$id!==this.scope.$id,c||d},o.prototype.setCoords=function(a,b){if(null==b&&(b=!0),!this.isNotValid(a)&&null!=this.gObject)return this.renderGMarker(b,function(b){return function(){var c,d,e;if(d=b.getProp("coords",a,b.model),c=b.getCoords(d),e=b.gObject.getPosition(),null==e||null==c||c.lng()!==e.lng()||c.lat()!==e.lat())return b.gObject.setPosition(c),b.gObject.setVisible(b.validateCoords(d))}}(this))},o.prototype.setIcon=function(a,b){if(null==b&&(b=!0),!this.isNotValid(a)&&null!=this.gObject)return this.renderGMarker(b,function(b){return function(){var c,d,e;if(e=b.gObject.getIcon(),d=b.getProp("icon",a,b.model),e!==d)return b.gObject.setIcon(d),c=b.getProp("coords",a,b.model),b.gObject.setPosition(b.getCoords(c)),b.gObject.setVisible(b.validateCoords(c))}}(this))},o.prototype.setOptions=function(a,b){var d;if(null==b&&(b=!0),!this.isNotValid(a,!1)){if(this.renderGMarker(b,function(b){return function(){var d,e,f;if(e=b.getProp("coords",a,b.model),f=b.getProp("icon",a,b.model),d=b.getProp("options",a,b.model),b.opts=b.createOptions(e,f,d),b.isLabel(b.gObject)!==b.isLabel(b.opts)&&null!=b.gObject&&(b.gManager.remove(b.gObject),b.gObject=void 0),null!=b.gObject&&b.gObject.setOptions(b.setLabelOptions(b.opts)),b.gObject||(b.isLabel(b.opts)?b.gObject=new MarkerWithLabel(b.setLabelOptions(b.opts)):b.opts.content?(b.gObject=new RichMarker(b.opts),b.gObject.getIcon=b.gObject.getContent,b.gObject.setIcon=b.gObject.setContent):b.gObject=new google.maps.Marker(b.opts),c.extend(b.gObject,{model:b.model})),b.externalListeners&&b.removeEvents(b.externalListeners),b.internalListeners&&b.removeEvents(b.internalListeners),b.externalListeners=b.setEvents(b.gObject,b.scope,b.model,["dragend"]),b.internalListeners=b.setEvents(b.gObject,{events:b.internalEvents(),$evalAsync:function(){}},b.model),null!=b.id)return b.gObject.key=b.id}}(this)),this.gObject&&(this.gObject.getMap()||this.gManager.type!==m.type))this.deferred.resolve(this.gObject);else{if(!this.gObject)return this.deferred.reject("gObject is null");null!=(d=this.gObject)&&d.getMap()&&this.gManager.type===m.type||(h.debug("gObject has no map yet"),this.deferred.resolve(this.gObject))}return this.model[this.fitKey]?this.gManager.fit():void 0}},o.prototype.setLabelOptions=function(a){return a.labelAnchor&&(a.labelAnchor=this.getLabelPositionPoint(a.labelAnchor)),a},o.prototype.internalEvents=function(){return{dragend:function(a){return function(b,c,d,e){var f,g,h;return g=a.trackModel?a.scope.model:a.model,h=a.setCoordsFromEvent(a.modelOrKey(g,a.coordsKey),a.gObject.getPosition()),g=a.setVal(d,a.coordsKey,h),f=a.scope.events,null!=(null!=f?f.dragend:void 0)&&f.dragend(b,c,g,e),a.scope.$apply()}}(this),click:function(a){return function(c,d,e,f){var g;if(g=a.getProp("click",a.scope,a.model),a.doClick&&b.isFunction(g))return a.scope.$evalAsync(g(c,d,a.model,f))}}(this)}},o}(f)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygonChildModel",["uiGmapBasePolyChildModel","uiGmapPolygonOptionsBuilder",function(b,c){var d,e,f;return f=function(a){return new google.maps.Polygon(a)},e=new b(c,f),d=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolylineChildModel",["uiGmapBasePolyChildModel","uiGmapPolylineOptionsBuilder",function(b,c){var d,e,f;return f=function(a){return new google.maps.Polyline(a)},e=b(c,f),d=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return a(c,b),c}(e)}])}.call(this),function(){var d=function(a,b){return function(){return a.apply(b,arguments)}},e=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},f={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapWindowChildModel",["uiGmapBaseObject","uiGmapGmapUtil","uiGmapLogger","$compile","$http","$templateCache","uiGmapChromeFixes","uiGmapEventsHelper",function(f,g,h,i,j,k,l,m){var n;return n=function(f){function n(a){this.updateModel=d(this.updateModel,this),this.destroy=d(this.destroy,this),this.remove=d(this.remove,this),this.getLatestPosition=d(this.getLatestPosition,this),this.hideWindow=d(this.hideWindow,this),this.showWindow=d(this.showWindow,this),this.handleClick=d(this.handleClick,this),this.watchOptions=d(this.watchOptions,this),this.watchCoords=d(this.watchCoords,this),this.createGWin=d(this.createGWin,this),this.watchElement=d(this.watchElement,this),this.watchAndDoShow=d(this.watchAndDoShow,this),this.doShow=d(this.doShow,this);var b,e,f,g,i;this.model=null!=(e=a.model)?e:{},this.scope=a.scope,this.opts=a.opts,this.isIconVisibleOnClick=a.isIconVisibleOnClick,this.gMap=a.gMap,this.markerScope=a.markerScope,this.element=a.element,this.needToManualDestroy=null!=(f=a.needToManualDestroy)&&f,this.markerIsVisibleAfterWindowClose=null==(g=a.markerIsVisibleAfterWindowClose)||g,this.isScopeModel=null!=(i=a.isScopeModel)&&i,this.isScopeModel&&(this.clonedModel=c.clone(this.model,!0)),this.getGmarker=function(){var a,b;if(null!=(null!=(a=this.markerScope)?a.getGMarker:void 0))return null!=(b=this.markerScope)?b.getGMarker():void 0},this.listeners=[],this.createGWin(),b=this.getGmarker(),null!=b&&b.setClickable(!0),this.watchElement(),this.watchOptions(),this.watchCoords(),this.watchAndDoShow(),this.scope.$on("$destroy",function(a){return function(){return a.destroy()}}(this)),h.info(this)}return e(n,f),n.include(g),n.include(m),n.prototype.doShow=function(a){return this.scope.show===!0||a?this.showWindow():this.hideWindow()},n.prototype.watchAndDoShow=function(){return null!=this.model.show&&(this.scope.show=this.model.show),this.scope.$watch("show",this.doShow,!0),this.doShow()},n.prototype.watchElement=function(){return this.scope.$watch(function(a){return function(){var b,c;if(a.element||a.html)return a.html!==a.element.html()&&a.gObject?(null!=(b=a.opts)&&(b.content=void 0),c=a.gObject.isOpen(),a.remove(),a.createGWin(c)):void 0}}(this))},n.prototype.createGWin=function(b){var d,e,f,g,h;if(null==b&&(b=!1),f=this.getGmarker(),e={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),e=this.opts),this.element&&(this.html=c.isObject(this.element)?this.element.html():this.element),d=this.scope.options?this.scope.options:e,this.opts=this.createWindowOptions(f,this.markerScope||this.scope,this.html,d),null!=this.opts)return this.gObject||(this.opts.boxClass&&a.InfoBox&&"function"==typeof a.InfoBox?this.gObject=new a.InfoBox(this.opts):this.gObject=new google.maps.InfoWindow(this.opts),this.listeners.push(google.maps.event.addListener(this.gObject,"domready",function(){return l.maybeRepaint(this.content)})),this.listeners.push(google.maps.event.addListener(this.gObject,"closeclick",function(a){return function(){return f&&(f.setAnimation(a.oldMarkerAnimation),a.markerIsVisibleAfterWindowClose&&c.delay(function(){return f.setVisible(!1),f.setVisible(a.markerIsVisibleAfterWindowClose)},250)),a.gObject.close(),a.model.show=!1,null!=a.scope.closeClick?a.scope.$evalAsync(a.scope.closeClick()):a.scope.$evalAsync()}}(this)))),this.gObject.setContent(this.opts.content),this.handleClick((null!=(g=this.scope)&&null!=(h=g.options)?h.forceClick:void 0)||b),this.doShow(this.gObject.isOpen())},n.prototype.watchCoords=function(){var a;return a=null!=this.markerScope?this.markerScope:this.scope,a.$watch("coords",function(a){return function(b,c){var d;if(b!==c){if(null==b)a.hideWindow();else if(!a.validateCoords(b))return void h.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(a.model));if(d=a.getCoords(b),a.doShow(),a.gObject.setPosition(d),a.opts)return a.opts.position=d}}}(this),!0)},n.prototype.watchOptions=function(){return this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&(a.opts=b,null!=a.gObject)){if(a.gObject.setOptions(a.opts),null!=a.opts.visible&&a.opts.visible)return a.showWindow();if(null!=a.opts.visible)return a.hideWindow()}}}(this),!0)},n.prototype.handleClick=function(a){var b,c;if(null!=this.gObject)return c=this.getGmarker(),b=function(a){return function(){if(null==a.gObject&&a.createGWin(),a.showWindow(),null!=c)return a.initialMarkerVisibility=c.getVisible(),a.oldMarkerAnimation=c.getAnimation(),c.setVisible(a.isIconVisibleOnClick)}}(this),a&&b(),c?this.listeners=this.listeners.concat(this.setEvents(c,{events:{click:b}},this.model)):void 0},n.prototype.showWindow=function(){var a,c,d;if(null!=this.gObject)return d=null,c=function(a){return function(){var b,c,d;if(!a.gObject.isOpen()){if(c=a.getGmarker(),null!=a.gObject&&null!=a.gObject.getPosition&&(d=a.gObject.getPosition()),c&&(d=c.getPosition()),!d)return;if(a.gObject.open(a.gMap,c),b=a.gObject.isOpen(),a.model.show!==b)return a.model.show=b}}}(this),this.scope.templateUrl?j.get(this.scope.templateUrl,{cache:k}).then(function(a){return function(e){var f;return d=a.scope.$new(),b.isDefined(a.scope.templateParameter)&&(d.parameter=a.scope.templateParameter),f=i(e.data)(d),a.gObject.setContent(f[0]),c()}}(this)):this.scope.template?(d=this.scope.$new(),b.isDefined(this.scope.templateParameter)&&(d.parameter=this.scope.templateParameter),a=i(this.scope.template)(d),this.gObject.setContent(a[0]),c()):c(),this.scope.$on("destroy",function(){return d.$destroy()})},n.prototype.hideWindow=function(){if(null!=this.gObject&&this.gObject.isOpen())return this.gObject.close()},n.prototype.getLatestPosition=function(a){var b;return b=this.getGmarker(),null==this.gObject||null==b||a?a?this.gObject.setPosition(a):void 0:this.gObject.setPosition(b.getPosition())},n.prototype.remove=function(){return this.hideWindow(),this.removeEvents(this.listeners),this.listeners.length=0,delete this.gObject,delete this.opts},n.prototype.destroy=function(a){var b;if(null==a&&(a=!1),this.remove(),null!=this.scope&&!(null!=(b=this.scope)?b.$$destroyed:void 0)&&(this.needToManualDestroy||a))return this.scope.$destroy()},n.prototype.updateModel=function(a){return this.isScopeModel&&(this.clonedModel=c.clone(a,!0)),c.extend(this.model,this.clonedModel||a)},n}(f)}])}.call(this), +function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapBasePolysParentModel",["$timeout","uiGmapLogger","uiGmapModelKey","uiGmapModelsWatcher","uiGmapPropMap","uiGmap_async","uiGmapPromise","uiGmapFitHelper",function(e,f,g,h,i,j,k,l){return function(e,m,n){var o;return o=function(g){function o(b,d,g,h,j){this.element=d,this.attrs=g,this.gMap=h,this.defaults=j,this.maybeFit=a(this.maybeFit,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchDestroy=a(this.watchDestroy,this),this.onDestroy=a(this.onDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),o.__super__.constructor.call(this,b),this.interface=e,this.$log=f,this.plurals=new i,c.each(e.scopeKeys,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.models=void 0,this.firstTime=!0,this.$log.info(this),this.createChildScopes()}return d(o,g),o.include(h),o.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){if(c!==d)return b.doINeedToWipe(c)||a.doRebuildAll?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)}}(this),!0)},o.prototype.doINeedToWipe=function(a){var b;return b=null==a||0===a.length,this.plurals.length>0&&b},o.prototype.rebuildAll=function(a,b,c){return this.onDestroy(c).then(function(a){return function(){if(b)return a.createChildScopes()}}(this))},o.prototype.onDestroy=function(){return o.__super__.onDestroy.call(this,this.scope),j.promiseLock(this,k.promiseTypes.delete,void 0,void 0,function(a){return function(){return j.each(a.plurals.values(),function(a){return a.destroy(!0)},j.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){var b;return null!=(b=a.plurals)?b.removeAll():void 0})}}(this))},o.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.rebuildAll(a,!1,!0)}}(this))},o.prototype.createChildScopes=function(a){return null==a&&(a=!0),b.isUndefined(this.scope.models)?void this.$log.error("No models to create "+n+"s from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},o.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){if(c!==d&&null==c)return b.idKey=c,b.rebuildAll(a,!0,!0)}}(this))},o.prototype.createAllNew=function(a,b){var c;if(null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),!this.didQueueInitPromise(this,a))return c=null,j.promiseLock(this,k.promiseTypes.create,"createAllNew",function(a){return c=a},function(b){return function(){return j.map(a.models,function(a){var d;return d=b.createChild(a,b.gMap),c&&(f.debug("createNew should fall through safely"),d.isEnabled=!1),d.pathPoints.getArray()},j.chunkSizeFrom(a.chunk)).then(function(a){return b.maybeFit(a),b.firstTime=!1})}}(this))},o.prototype.pieceMeal=function(a,b){var d,e;if(null==b&&(b=!0),!a.$$destroyed)return d=null,e=null,this.models=a.models,null!=a&&this.modelsLength()&&this.plurals.length?j.promiseLock(this,k.promiseTypes.update,"pieceMeal",function(a){return d=a},function(b){return function(){return k.promise(function(){return b.figureOutState(b.idKey,a,b.plurals,b.modelKeyComparison)}).then(function(f){return e=f,e.updates.length&&j.each(e.updates,function(a){return c.extend(a.child.scope,a.model),a.child.model=a.model}),j.each(e.removals,function(a){if(null!=a)return a.destroy(),b.plurals.remove(a.model[b.idKey]),d},j.chunkSizeFrom(a.chunk))}).then(function(){return j.each(e.adds,function(a){return d&&f.debug("pieceMeal should fall through safely"),b.createChild(a,b.gMap),d},j.chunkSizeFrom(a.chunk)).then(function(){return b.maybeFit()})})}}(this)):(this.inProgress=!1,this.rebuildAll(this.scope,!0,!0))},o.prototype.createChild=function(a,b){var c,d;return d=this.scope.$new(!1),this.setChildScope(e.scopeKeys,d,a),d.$watch("model",function(a){return function(b,c){if(b!==c)return a.setChildScope(e.scopeKeys,d,b)}}(this),!0),d.static=this.scope.static,c=new m({isScopeModel:!0,scope:d,attrs:this.attrs,gMap:b,defaults:this.defaults,model:a,gObjectChangeCb:function(a){return function(){return a.maybeFit()}}(this)}),null==a[this.idKey]?void this.$log.error(n+" model has no id to assign a child to.\nThis is required for performance. Please assign id,\nor redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},o.prototype.maybeFit=function(a){if(null==a&&(a=this.plurals.map(function(a){return a.pathPoints})),this.scope.fit)return a=c.flatten(a),l.fit(a,this.gMap)},o}(g)}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapCircleParentModel",["uiGmapLogger","$timeout","uiGmapGmapUtil","uiGmapEventsHelper","uiGmapCircleOptionsBuilder",function(d,e,f,g,h){var i,j;return j=function(a,b){return a.settingFromDirective=!0,b(),e(function(){return a.settingFromDirective=!1})},i=function(e){function h(a,e,g,h,i){var k,l,m;this.attrs=g,this.gMap=h,this.DEFAULTS=i,this.scope=a,m=null,k=function(a){return function(){if(m=null,null!=a.listeners)return a.removeEvents(a.listeners),a.listeners=void 0}}(this),l=new google.maps.Circle(this.buildOpts(f.getCoords(a.center),a.radius)),this.setMyOptions=function(b){return function(d,e){if(!a.settingFromDirective)return!c.isEqual(d,e)||d!==e||null!=d&&null!=e&&d.coordinates!==e.coordinates?l.setOptions(b.buildOpts(f.getCoords(a.center),a.radius)):void 0}}(this),this.props=this.props.concat([{prop:"center",isColl:!0},{prop:"fill",isColl:!0},"radius","zIndex"]),this.watchProps(),null!=this.scope.control&&(this.scope.control.getCircle=function(){return l}),k(),this.listeners=this.setEvents(l,a,a,["radius_changed"])||[],this.listeners.push(google.maps.event.addListener(l,"radius_changed",function(){var d,e;if(d=l.getRadius(),d!==m)return m=d,e=function(){return j(a,function(){var b,e;if(d!==a.radius&&(a.radius=d),(null!=(b=a.events)?b.radius_changed:void 0)&&c.isFunction(null!=(e=a.events)?e.radius_changed:void 0))return a.events.radius_changed(l,"radius_changed",a,arguments)})},b.mock?e():a.$evalAsync(function(){return e()})})),this.listeners.push(google.maps.event.addListener(l,"center_changed",function(){return a.$evalAsync(function(){return j(a,function(){return b.isDefined(a.center.type)?(a.center.coordinates[1]=l.getCenter().lat(),a.center.coordinates[0]=l.getCenter().lng()):(a.center.latitude=l.getCenter().lat(),a.center.longitude=l.getCenter().lng())})})})),a.$on("$destroy",function(){return k(),l.setMap(null)}),d.info(this)}return a(h,e),h.include(f),h.include(g),h}(h)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapDrawingManagerParentModel",["uiGmapLogger","$timeout","uiGmapBaseObject","uiGmapEventsHelper",function(b,d,e,f){var g;return g=function(b){function d(a,b,d,e){var f,g;this.scope=a,this.attrs=d,this.map=e,f=new google.maps.drawing.DrawingManager(this.scope.options),f.setMap(this.map),g=void 0,null!=this.scope.control&&(this.scope.control.getDrawingManager=function(){return f}),!this.scope.static&&this.scope.options&&this.scope.$watch("options",function(a){return null!=f?f.setOptions(a):void 0},!0),null!=this.scope.events&&(g=this.setEvents(f,this.scope,this.scope),this.scope.$watch("events",function(a){return function(b,d){if(!c.isEqual(b,d))return null!=g&&a.removeEvents(g),g=a.setEvents(f,a.scope,a.scope)}}(this))),this.scope.$on("$destroy",function(a){return function(){return null!=g&&a.removeEvents(g),f.setMap(null),f=null}}(this))}return a(d,b),d.include(f),d}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIMarkerParentModel",["uiGmapModelKey","uiGmapLogger",function(e,f){var g;return g=function(e){function g(c,d,e,h){if(this.scope=c,this.element=d,this.attrs=e,this.map=h,this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),g.__super__.constructor.call(this,this.scope),this.$log=f,!this.validateScope(this.scope))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=b.isDefined(this.attrs.click),null!=this.scope.options&&(this.DEFAULTS=this.scope.options),this.watch("coords",this.scope),this.watch("icon",this.scope),this.watch("options",this.scope),this.scope.$on("$destroy",function(a){return function(){return a.onDestroy(a.scope)}}(this))}return d(g,e),g.prototype.DEFAULTS={},g.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},g.prototype.watch=function(a,b,d){return null==d&&(d=!0),b.$watch(a,function(d){return function(e,f){if(!c.isEqual(e,f))return d.onWatch(a,b,e,f)}}(this),d)},g.prototype.onWatch=function(a,b,c,d){},g}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIWindowParentModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger",function(b,c,d){var e;return e=function(b){function e(a,b,c,f,g,h,i,j){e.__super__.constructor.call(this,a),this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,this.DEFAULTS={},null!=a.options&&(this.DEFAULTS=a.options)}return a(e,b),e.include(c),e.prototype.getItem=function(a,b,c){return"models"===b?a[b][c]:a[b].get(c)},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapLayerParentModel",["uiGmapBaseObject","uiGmapLogger","$timeout",function(d,e,f){var g;return g=function(d){function f(c,d,f,g,h,i){return this.scope=c,this.element=d,this.attrs=f,this.gMap=g,this.onLayerCreated=null!=h?h:void 0,this.$log=null!=i?i:e,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.doShow=!0,b.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.gObject.setMap(this.gMap),this.scope.$watch("show",function(a){return function(b,c){if(b!==c)return a.doShow=b,b?a.gObject.setMap(a.gMap):a.gObject.setMap(null)}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&a.doShow)return a.gObject.setOptions(b)}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.gObject.setMap(null)}}(this)))}return c(f,d),f.prototype.createGoogleLayer=function(){var a;if(null==this.attrs.options?this.gObject=void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:this.gObject=void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),null!=this.gObject&&this.doShow&&this.gObject.setMap(this.gMap),null!=this.gObject&&null!=this.onLayerCreated)return"function"==typeof(a=this.onLayerCreated(this.scope,this.gObject))?a(this.gObject):void 0},f}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMapTypeParentModel",["uiGmapBaseObject","uiGmapLogger",function(e,f){var g;return g=function(e){function g(d,e,g,h,i,j,k){var l,m,n,o;return this.scope=d,this.element=e,this.attrs=g,this.gMap=h,this.$log=null!=i?i:f,this.childModel=j,this.propMap=k,this.refreshShown=a(this.refreshShown,this),this.hideOverlay=a(this.hideOverlay,this),this.showOverlay=a(this.showOverlay,this),this.refreshMapType=a(this.refreshMapType,this),this.createMapType=a(this.createMapType,this),null==this.scope.options?void this.$log.info("options attribute for the map-type directive is mandatory. Map type creation aborted!!"):(this.id=this.gMap.overlayMapTypesCount=this.gMap.overlayMapTypesCount+1||0,this.doShow=!0,this.createMapType(),this.refreshShown(),this.doShow&&null!=this.gMap&&this.showOverlay(),m=function(a){return function(){return a.childModel[a.attrs.show]}}(this),o=this.childModel?m:"show",this.scope.$watch(o,function(a){return function(b,c){if(b!==c)return a.doShow=b,b?a.showOverlay():a.hideOverlay()}}(this)),l=function(a){return function(){return a.childModel[a.attrs.options]}}(this),n=this.childModel?l:"options",this.scope.$watchCollection(n,function(a){return function(b,d){var e,f;if(!c.isEqual(b,d)&&(f=["tileSize","maxZoom","minZoom","name","alt"],e=c.some(f,function(a){return!d||!b||!c.isEqual(b[a],d[a])})))return a.refreshMapType()}}(this)),b.isDefined(this.attrs.refresh)&&this.scope.$watch("refresh",function(a){return function(b,d){if(!c.isEqual(b,d))return a.refreshMapType()}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.hideOverlay(),a.mapType=null}}(this)))}return d(g,e),g.prototype.createMapType=function(){var a,c,d;if(d=this.childModel?this.attrs.options?this.childModel[this.attrs.options]:this.childModel:this.scope.options,null!=d.getTile)this.mapType=d;else{if(null==d.getTileUrl)return void this.$log.info("options should provide either getTile or getTileUrl methods. Map type creation aborted!!");this.mapType=new google.maps.ImageMapType(d)}if(c=this.attrs.id?this.childModel?this.attrs.id:"id":void 0,a=c?this.childModel?this.childModel[c]:this.scope[c]:void 0,a&&(this.gMap.mapTypes.set(a,this.mapType),b.isDefined(this.attrs.show)||(this.doShow=!1)),this.mapType.layerId=this.id,this.childModel&&b.isDefined(this.scope.index))return this.propMap.put(this.mapType.layerId,this.scope.index)},g.prototype.refreshMapType=function(){if(this.hideOverlay(),this.mapType=null,this.createMapType(),this.doShow&&null!=this.gMap)return this.showOverlay()},g.prototype.showOverlay=function(){var a;return b.isDefined(this.scope.index)?(a=!1,this.gMap.overlayMapTypes.getLength()?(this.gMap.overlayMapTypes.forEach(function(c){return function(d,e){var f;a||(f=c.propMap.get(d.layerId.toString()),(f>c.scope.index||!b.isDefined(f))&&(a=!0,c.gMap.overlayMapTypes.insertAt(e,c.mapType)))}}(this)),a?void 0:this.gMap.overlayMapTypes.push(this.mapType)):this.gMap.overlayMapTypes.push(this.mapType)):this.gMap.overlayMapTypes.push(this.mapType)},g.prototype.hideOverlay=function(){var a;return a=!1,this.gMap.overlayMapTypes.forEach(function(b){return function(c,d){a||c.layerId!==b.id||(a=!0,b.gMap.overlayMapTypes.removeAt(d))}}(this))},g.prototype.refreshShown=function(){return this.doShow=!b.isDefined(this.attrs.show)||(this.childModel?this.childModel[this.attrs.show]:this.scope.show)},g}(e)}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMapTypesParentModel",["uiGmapBaseObject","uiGmapLogger","uiGmapMapTypeParentModel","uiGmapPropMap",function(b,c,d,e){var f;return f=function(b){function f(a,b,f,g,h){var i;return this.scope=a,this.element=b,this.attrs=f,this.gMap=g,this.$log=null!=h?h:c,null==this.attrs.mapTypes?void this.$log.info("layers attribute for the map-types directive is mandatory. Map types creation aborted!!"):(i=new e,void this.scope.mapTypes.forEach(function(a){return function(b,c){var e,f;f={options:a.scope.options,show:a.scope.show,refresh:a.scope.refresh},e=a.scope.$new(),e.index=c,new d(e,null,f,a.gMap,a.$log,b,i)}}(this)))}return a(f,b),f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMarkersParentModel",["uiGmapIMarkerParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapMarkerChildModel","uiGmap_async","uiGmapClustererMarkerManager","uiGmapMarkerManager","$timeout","uiGmapIMarker","uiGmapPromise","uiGmapGmapUtil","uiGmapLogger","uiGmapSpiderfierMarkerManager",function(e,f,g,h,i,j,k,l,m,n,o,p,q){var r,s;return s=function(a,b){return b.plurals=new g,b.scope.plurals=b.plurals,b},r=function(e){function l(b,d,e,f){this.maybeExecMappedEvent=a(this.maybeExecMappedEvent,this),this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.pieceMeal=a(this.pieceMeal,this),this.rebuildAll=a(this.rebuildAll,this),this.createAllNew=a(this.createAllNew,this),this.bindToTypeEvents=a(this.bindToTypeEvents,this),this.createChildScopes=a(this.createChildScopes,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this),l.__super__.constructor.call(this,b,d,e,f),this.interface=m,s(new g,this),this.scope.pluralsUpdate={updateCtr:0},this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll&&this.scope.doRebuildAll,this.setIdKey(this.scope),this.scope.$watch("doRebuildAll",function(a){return function(b,c){if(b!==c)return a.doRebuildAll=b}}(this)),this.modelsLength()||(this.modelsRendered=!1),this.scope.$watch("models",function(a){return function(b,d){if(!c.isEqual(b,d)||!a.modelsRendered){if(0===b.length&&0===d.length)return;return a.modelsRendered=!0,a.onWatch("models",a.scope,b,d)}}}(this),!this.isTrue(e.modelsbyref)),this.watch("doCluster",this.scope),this.watch("type",this.scope),this.watch("clusterOptions",this.scope),this.watch("clusterEvents",this.scope),this.watch("typeOptions",this.scope),this.watch("typeEvents",this.scope),this.watch("fit",this.scope),this.watch("idKey",this.scope),this.gManager=void 0,this.createAllNew(this.scope)}return d(l,e),l.include(o),l.include(f),l.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll||"doCluster"===a||"type"===a?this.rebuildAll(b):this.pieceMeal(b)},l.prototype.validateScope=function(a){var c;return c=b.isUndefined(a.models)||void 0===a.models,c&&this.$log.error(this.constructor.name+": no valid models attribute found"),l.__super__.validateScope.call(this,a)||c},l.prototype.createChildScopes=function(a){if(null!=this.gMap&&null!=this.scope.models)return a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)},l.prototype.bindToTypeEvents=function(a,d){var e,f;return null==d&&(d=["click","mouseout","mouseover"]),f=this,this.origTypeEvents?b.extend(a,this.origTypeEvents):(this.origTypeEvents={},c.each(d,function(b){return function(c){return b.origTypeEvents[c]=null!=a?a[c]:void 0}}(this))),e={},c.each(d,function(a){return e[a]=function(b){return f.maybeExecMappedEvent(b,a)}}),b.extend(a,e)},l.prototype.createAllNew=function(a){var b,c,d,e;if(null!=this.gManager&&(this.gManager instanceof q&&(b=this.gManager.isSpiderfied()),this.gManager.clear(),delete this.gManager),d=a.typeEvents||a.clusterEvents,e=a.typeOptions||a.clusterOptions,a.doCluster||"cluster"===a.type?(null!=d&&this.bindToTypeEvents(d),this.gManager=new j(this.map,void 0,e,d)):"spider"===a.type?(null!=d&&this.bindToTypeEvents(d,["spiderfy","unspiderfy"]),this.gManager=new q(this.map,void 0,e,d,this.scope),b&&this.gManager.spiderfy()):this.gManager=new k(this.map),!this.didQueueInitPromise(this,a))return c=null,i.promiseLock(this,n.promiseTypes.create,"createAllNew",function(a){return c=a},function(b){return function(){return i.each(a.models,function(d){return b.newChildMarker(d,a),c},i.chunkSizeFrom(a.chunk)).then(function(){return b.modelsRendered=!0,a.fit&&b.gManager.fit(),b.gManager.draw(),b.scope.pluralsUpdate.updateCtr+=1},i.chunkSizeFrom(a.chunk))}}(this))},l.prototype.rebuildAll=function(a){var b;if(a.doRebuild||void 0===a.doRebuild)return(null!=(b=this.scope.plurals)?b.length:void 0)?this.onDestroy(a).then(function(b){return function(){return b.createAllNew(a)}}(this)):this.createAllNew(a)},l.prototype.pieceMeal=function(a){var b,c;if(!a.$$destroyed)return b=null,c=null,this.modelsLength()&&this.scope.plurals.length?i.promiseLock(this,n.promiseTypes.update,"pieceMeal",function(a){return b=a},function(d){return function(){return n.promise(function(){return d.figureOutState(d.idKey,a,d.scope.plurals,d.modelKeyComparison)}).then(function(e){return c=e,i.each(c.removals,function(a){if(null!=a)return null!=a.destroy&&a.destroy(),d.scope.plurals.remove(a.id),b},i.chunkSizeFrom(a.chunk))}).then(function(){return i.each(c.adds,function(c){return d.newChildMarker(c,a),b},i.chunkSizeFrom(a.chunk))}).then(function(){return i.each(c.updates,function(a){return d.updateChild(a.child,a.model),b},i.chunkSizeFrom(a.chunk))}).then(function(){return(c.adds.length>0||c.removals.length>0||c.updates.length>0)&&(a.plurals=d.scope.plurals,a.fit&&d.gManager.fit(),d.gManager.draw()),d.scope.pluralsUpdate.updateCtr+=1})}}(this)):(this.inProgress=!1,this.rebuildAll(a))},l.prototype.newChildMarker=function(a,b){var c,d,e;if(!a)throw"model undefined";return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),d=b.$new(!1),d.events=b.events,e={},m.scopeKeys.forEach(function(a){return e[a]=b[a]}),c=new h({scope:d,model:a,keys:e,gMap:this.map,defaults:this.DEFAULTS,doClick:this.doClick,gManager:this.gManager,doDrawSelf:!1,isScopeModel:!0}),this.scope.plurals.put(a[this.idKey],c),c)},l.prototype.onDestroy=function(a){return l.__super__.onDestroy.call(this,a),i.promiseLock(this,n.promiseTypes.delete,void 0,void 0,function(a){return function(){return i.each(a.scope.plurals.values(),function(a){if(null!=a)return a.destroy(!1)},i.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){return null!=a.gManager&&a.gManager.destroy(),a.plurals.removeAll(),a.plurals!==a.scope.plurals&&console.error("plurals out of sync for MarkersParentModel"),a.scope.pluralsUpdate.updateCtr+=1})}}(this))},l.prototype.maybeExecMappedEvent=function(a,b){var d,e;if(!this.scope.$$destroyed)return e=this.scope.typeEvents||this.scope.clusterEvents,c.isFunction(null!=e?e[b]:void 0)&&(d=this.mapTypeToPlurals(a),this.origTypeEvents[b])?this.origTypeEvents[b](d.group,d.mapped):void 0},l.prototype.mapTypeToPlurals=function(a){var b,d,e;return c.isArray(a)?b=a:c.isFunction(a.getMarkers)&&(b=a.getMarkers()),null==b?void p.error("Unable to map event as we cannot find the array group to map"):(d=(null!=(e=this.scope.plurals.values())?e.length:void 0)?b.map(function(a){return function(b){return a.scope.plurals.get(b.key).model}}(this)):[],{cluster:a,mapped:d,group:a})},l.prototype.getItem=function(a,b,c){return"models"===b?a[b][c]:a[b].get(c)},l}(e)}])}.call(this),function(){["Polygon","Polyline"].forEach(function(a){return b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmap"+a+"sParentModel",["uiGmapBasePolysParentModel","uiGmap"+a+"ChildModel","uiGmapI"+a,function(b,c,d){return b(d,c,a)}])})}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapRectangleParentModel",["uiGmapLogger","uiGmapGmapUtil","uiGmapEventsHelper","uiGmapRectangleOptionsBuilder",function(b,d,e,f){var g;return g=function(f){function g(a,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;this.scope=a,this.attrs=e,this.gMap=f,this.DEFAULTS=g,h=void 0,k=!1,p=[],o=void 0,l=function(a){return function(){if(a.isTrue(a.attrs.fit))return a.fitMapBounds(a.gMap,h)}}(this),j=function(a){return function(){var c,d,e;return null!=a.scope.bounds&&null!=(null!=(c=a.scope.bounds)?c.sw:void 0)&&null!=(null!=(d=a.scope.bounds)?d.ne:void 0)&&a.validateBoundPoints(a.scope.bounds)?(h=a.convertBoundPoints(a.scope.bounds),b.info("new new bounds created: "+JSON.stringify(h))):null!=a.scope.bounds.getNorthEast&&null!=a.scope.bounds.getSouthWest?h=a.scope.bounds:null!=a.scope.bounds?b.error("Invalid bounds for newValue: "+JSON.stringify(null!=(e=a.scope)?e.bounds:void 0)):void 0}}(this),j(),m=new google.maps.Rectangle(this.buildOpts(h)),b.info("gObject (rectangle) created: "+m),q=!1,r=function(a){return function(){var b,c,d;if(b=m.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),!q)return a.scope.$evalAsync(function(a){if(null!=a.bounds&&null!=a.bounds.sw&&null!=a.bounds.ne&&(a.bounds.ne={latitude:c.lat(),longitude:c.lng()},a.bounds.sw={latitude:d.lat(),longitude:d.lng()}),null!=a.bounds.getNorthEast&&null!=a.bounds.getSouthWest)return a.bounds=b})}}(this),n=function(a){return function(){return l(),a.removeEvents(p),p.push(google.maps.event.addListener(m,"dragstart",function(){return k=!0})),p.push(google.maps.event.addListener(m,"dragend",function(){return k=!1,r()})),p.push(google.maps.event.addListener(m,"bounds_changed",function(){if(!k)return r()}))}}(this),i=function(a){return function(){return a.removeEvents(p),null!=o&&a.removeEvents(o),m.setMap(null)}}(this),null!=h&&n(),this.scope.$watch("bounds",function(a,b){var d;if(!(c.isEqual(a,b)&&null!=h||k))return q=!0,null==a?void i():(null==h?d=!0:l(),j(),m.setBounds(h),q=!1,d&&null!=h?n():void 0)},!0),this.setMyOptions=function(a){return function(b,d){if(!c.isEqual(b,d)&&null!=h&&null!=b)return m.setOptions(a.buildOpts(h))}}(this),this.props.push("bounds"),this.watchProps(this.props),null!=this.attrs.events&&(o=this.setEvents(m,this.scope,this.scope),this.scope.$watch("events",function(a){return function(b,d){if(!c.isEqual(b,d))return null!=o&&a.removeEvents(o),o=a.setEvents(m,a.scope,a.scope)}}(this))),this.scope.$on("$destroy",function(){return i()}),b.info(this)}return a(g,f),g.include(d),g.include(e),g}(f)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapSearchBoxParentModel",["uiGmapBaseObject","uiGmapLogger","uiGmapEventsHelper",function(d,e,f){var g;return g=function(d){function g(c,d,f,g,h,i,j){var k;return this.scope=c,this.element=d,this.attrs=f,this.gMap=g,this.ctrlPosition=h,this.template=i,this.$log=null!=j?j:e,this.setVisibility=a(this.setVisibility,this),this.getBounds=a(this.getBounds,this),this.setBounds=a(this.setBounds,this),this.createSearchBox=a(this.createSearchBox,this),this.addToParentDiv=a(this.addToParentDiv,this),this.addAsMapControl=a(this.addAsMapControl,this),this.init=a(this.init,this),null==this.attrs.template?void this.$log.error("template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!"):(b.isUndefined(this.scope.options)&&(this.scope.options={},this.scope.options.visible=!0),b.isUndefined(this.scope.options.visible)&&(this.scope.options.visible=!0),b.isUndefined(this.scope.options.autocomplete)&&(this.scope.options.autocomplete=!1),this.visible=this.scope.options.visible,this.autocomplete=this.scope.options.autocomplete,k=b.element("
"),k.append(this.template),this.input=k.find("input")[0],void this.init())}return c(g,d),g.include(f),g.prototype.init=function(){return this.createSearchBox(),this.scope.$watch("options",function(a){return function(c,d){if(b.isObject(c)&&(null!=c.bounds&&a.setBounds(c.bounds),null!=c.visible&&a.visible!==c.visible))return a.setVisibility(c.visible)}}(this),!0),null!=this.attrs.parentdiv?this.addToParentDiv():this.addAsMapControl(),this.visible||this.setVisibility(this.visible),this.autocomplete?this.listener=google.maps.event.addListener(this.gObject,"place_changed",function(a){return function(){return a.places=a.gObject.getPlace()}}(this)):this.listener=google.maps.event.addListener(this.gObject,"places_changed",function(a){return function(){return a.places=a.gObject.getPlaces()}}(this)),this.listeners=this.setEvents(this.gObject,this.scope,this.scope),this.$log.info(this),this.scope.$on("$stateChangeSuccess",function(a){return function(){if(null!=a.attrs.parentdiv)return a.addToParentDiv()}}(this)),this.scope.$on("$destroy",function(a){return function(){return a.gObject=null}}(this))},g.prototype.addAsMapControl=function(){return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input)},g.prototype.addToParentDiv=function(){var a;if(this.parentDiv=b.element(document.getElementById(this.scope.parentdiv)),null!=(a=this.parentDiv)?a.length:void 0)return this.parentDiv.append(this.input)},g.prototype.createSearchBox=function(){return this.autocomplete?this.gObject=new google.maps.places.Autocomplete(this.input,this.scope.options):this.gObject=new google.maps.places.SearchBox(this.input,this.scope.options)},g.prototype.setBounds=function(a){if(b.isUndefined(a.isEmpty))this.$log.error("Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.");else if(a.isEmpty()===!1&&null!=this.gObject)return this.gObject.setBounds(a)},g.prototype.getBounds=function(){return this.gObject.getBounds()},g.prototype.setVisibility=function(a){return null!=this.attrs.parentdiv?a===!1?this.parentDiv.addClass("ng-hide"):this.parentDiv.removeClass("ng-hide"):a===!1?this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].clear():this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input),this.visible=a},g}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapWindowsParentModel",["uiGmapIWindowParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapWindowChildModel","uiGmapLinked","uiGmap_async","uiGmapLogger","$timeout","$compile","$http","$templateCache","$interpolate","uiGmapPromise","uiGmapIWindow","uiGmapGmapUtil",function(e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){var t;return t=function(e){function t(b,d,e,f,h,j){this.gMap=h,this.markersScope=j,this.modelKeyComparison=a(this.modelKeyComparison,this), +this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.onDestroy=a(this.onDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.go=a(this.go,this),t.__super__.constructor.call(this,b,d,e,f,l,m,n,o),this.interface=r,this.plurals=new g,c.each(r.scopeKeys,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.linked=new i(b,d,e,f),this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.firstWatchModels=!0,this.$log.info(self),this.parentScope=void 0,this.go(b)}return d(t,e),t.include(f),t.prototype.go=function(a){return this.watchOurScope(a),this.doRebuildAll=null!=this.scope.doRebuildAll&&this.scope.doRebuildAll,a.$watch("doRebuildAll",function(a){return function(b,c){if(b!==c)return a.doRebuildAll=b}}(this)),this.createChildScopes()},t.prototype.watchModels=function(a){var b;return b=null!=this.markersScope?"pluralsUpdate":"models",a.$watch(b,function(b){return function(d,e){var f;if(!c.isEqual(d,e)||b.firstWatchModels)return b.firstWatchModels=!1,b.doRebuildAll||b.doINeedToWipe(a.models)?b.rebuildAll(a,!0,!0):(f=0===b.plurals.length,null!=b.existingPieces?c.last(b.existingPieces._content).then(function(){return b.createChildScopes(f)}):b.createChildScopes(f))}}(this),!0)},t.prototype.doINeedToWipe=function(a){var b;return b=null==a||0===a.length,this.plurals.length>0&&b},t.prototype.rebuildAll=function(a,b,c){return this.onDestroy(c).then(function(a){return function(){if(b)return a.createChildScopes()}}(this))},t.prototype.onDestroy=function(a){return t.__super__.onDestroy.call(this,this.scope),j.promiseLock(this,q.promiseTypes.delete,void 0,void 0,function(a){return function(){return j.each(a.plurals.values(),function(a){return a.destroy(!0)},j.chunkSizeFrom(a.scope.cleanchunk,!1)).then(function(){var b;return null!=(b=a.plurals)?b.removeAll():void 0})}}(this))},t.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.firstWatchModels=!0,b.firstTime=!0,b.rebuildAll(a,!1,!0)}}(this))},t.prototype.watchOurScope=function(a){return c.each(r.scopeKeys,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c]}}(this))},t.prototype.createChildScopes=function(a){var c,d,e;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,b.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),c=b.isUndefined(this.linked.scope.models),!c||void 0!==this.markersScope&&void 0!==(null!=(d=this.markersScope)?d.plurals:void 0)&&void 0!==(null!=(e=this.markersScope)?e.models:void 0)?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNew(this.linked.scope,!1):this.pieceMeal(this.linked.scope,!1)):(this.parentScope=this.markersScope,this.watchIdKey(this.parentScope),a?this.createAllNew(this.markersScope,!0,"plurals",!1):this.pieceMeal(this.markersScope,!0,"plurals",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derived from markers!")},t.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){if(c!==d&&null==c)return b.idKey=c,b.rebuildAll(a,!0,!0)}}(this))},t.prototype.createAllNew=function(a,b,c,d){var e;if(null==c&&(c="models"),null==d&&(d=!1),this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),!this.didQueueInitPromise(this,a))return e=null,j.promiseLock(this,q.promiseTypes.create,"createAllNew",function(a){return e=a},function(d){return function(){return j.each(a.models,function(f){var g,h;return g=b&&null!=(h=d.getItem(a,c,f[d.idKey]))?h.gObject:void 0,e||(!g&&d.markersScope&&k.error("Unable to get gMarker from markersScope!"),d.createWindow(f,g,d.gMap)),e},j.chunkSizeFrom(a.chunk)).then(function(){return d.firstTime=!1})}}(this))},t.prototype.pieceMeal=function(a,b,c,d){var e,f;if(null==c&&(c="models"),null==d&&(d=!0),!a.$$destroyed)return e=null,f=null,null!=a&&this.modelsLength()&&this.plurals.length?j.promiseLock(this,q.promiseTypes.update,"pieceMeal",function(a){return e=a},function(b){return function(){return q.promise(function(){return b.figureOutState(b.idKey,a,b.plurals,b.modelKeyComparison)}).then(function(c){return f=c,j.each(f.removals,function(a){if(null!=a)return b.plurals.remove(a.id),null!=a.destroy&&a.destroy(!0),e},j.chunkSizeFrom(a.chunk))}).then(function(){return j.each(f.adds,function(d){var f,g;if(f=null!=(g=b.getItem(a,c,d[b.idKey]))?g.gObject:void 0,!f)throw"Gmarker undefined";return b.createWindow(d,f,b.gMap),e})}).then(function(){return j.each(f.updates,function(a){return b.updateChild(a.child,a.model),e},j.chunkSizeFrom(a.chunk))})}}(this)):(k.debug("pieceMeal: rebuildAll"),this.rebuildAll(this.scope,!0,!0))},t.prototype.setContentKeys=function(a){if(this.modelsLength(a))return this.contentKeys=Object.keys(a[0])},t.prototype.createWindow=function(a,b,c){var d,e,f,g,i,j;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a){return function(b,c){if(b!==c)return a.setChildScope(e,b)}}(this),!0),f={html:function(b){return function(){return b.interpolateContent(b.linked.element.html(),a)}}(this)},this.DEFAULTS=this.scopeOrModelVal(this.optionsKey,this.scope,a)||{},g=this.createWindowOptions(b,e,f.html(),this.DEFAULTS),d=new h({model:a,scope:e,opts:g,isIconVisibleOnClick:this.isIconVisibleOnClick,gMap:c,markerScope:null!=(i=this.markersScope)&&null!=(j=i.plurals.get(a[this.idKey]))?j.scope:void 0,element:f,needToManualDestroy:!1,markerIsVisibleAfterWindowClose:!0,isScopeModel:!0}),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],d),d)},t.prototype.setChildScope=function(a,b){return c.each(r.scopeKeys,function(c){return function(d){var e,f;if(e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d])return a[d]=f}}(this)),a.model=b},t.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=p(a),e={},h=this.contentKeys,d=0,g=h.length;d"),o=function(a,b,c){return c&&(b[0].index=c),a.controls[google.maps.ControlPosition[n]].push(b[0])},j?l(function(a){return k.append(a),o(d,k.children(),m)}):e.get(a.template,{cache:f}).then(function(c){var d,e,f;return d=c.data,f=a.$new(),k.append(d),b.isDefined(a.controller)&&(e=h(a.controller,{$scope:f}),k.children().data("$ngControllerController",e)),i=g(k.children())(f)}).catch(function(a){return c.$log.error("mapControl: template could not be found")}).then(function(){return o(d,i,m)})}):void c.$log.error("mapControl: invalid position property")}}(this))},k}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapDragZoom",["uiGmapCtrlHandle","uiGmapPropertyAction",function(a,b){return{restrict:"EMA",transclude:!0,template:'',require:"^uiGmapGoogleMap",scope:{keyboardkey:"=",options:"=",spec:"="},controller:["$scope","$element",function(b,d){return b.ctrlType="uiGmapDragZoom",c.extend(this,a.handle(b,d))}],link:function(c,d,e,f){return a.mapPromise(c,f).then(function(a){var d,e,f;return d=function(b){return a.enableKeyDragZoom(b)},e=new b(function(a,b){return b?d({key:b}):d()}),f=new b(function(a,b){if(b)return d(b)}),c.$watch("keyboardkey",e.sic("keyboardkey")),e.sic(c.keyboardkey),c.$watch("options",f.sic("options")),f.sic(c.options)})}}}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapDrawingManager",["uiGmapIDrawingManager","uiGmapDrawingManagerParentModel",function(a,b){return c.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return new b(a,c,d,e)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapApiFreeDrawPolygons",["uiGmapLogger","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapDrawFreeHandChildModel","uiGmapLodash",function(b,e,f,g,h){var i;return i=function(e){function i(){return this.link=a(this.link,this),i.__super__.constructor.apply(this,arguments)}return d(i,e),i.include(f),i.prototype.restrict="EMA",i.prototype.replace=!0,i.prototype.require="^uiGmapGoogleMap",i.prototype.scope={polygons:"=",draw:"="},i.prototype.link=function(a,d,e,f){return this.mapPromise(a,f).then(function(d){return function(d){var e,i;return a.polygons?c.isArray(a.polygons)?(e=new g(d,f.getScope()),i=void 0,a.draw=function(){return"function"==typeof i&&i(),e.engage(a.polygons).then(function(){var b;return b=!0,i=a.$watchCollection("polygons",function(a,c){var d;return b||a===c?void(b=!1):(d=h.differenceObjects(c,a),d.forEach(function(a){return a.setMap(null)}))})})}):b.error("Free Draw Polygons must be of type Array!"):b.error("No polygons to bind to!")}}(this))},i}(e)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapICircle",[function(){return{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"=",events:"=",control:"=",zIndex:"=zindex"}}}])}.call(this),function(){var a=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIControl",["uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,c,d){var e;return e=function(b){function e(){this.restrict="EA",this.replace=!0,this.require="^uiGmapGoogleMap",this.scope={template:"@template",position:"@position",controller:"@controller",index:"@index"},this.$log=c}return a(e,b),e.extend(d),e.prototype.link=function(a,b,c,d){throw new Error("Not implemented!!")},e}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapIDrawingManager",[function(){return{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{static:"@",control:"=",options:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIMarker",["uiGmapBaseObject","uiGmapCtrlHandle",function(b,d){var e;return e=function(b){function e(){this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.replace=!0,this.scope=c.extend(this.scope||{},e.scope)}return a(e,b),e.scope={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit",idKey:"=idkey",control:"=control"},e.scopeKeys=c.keys(e.scope),e.keys=e.scopeKeys,e.extend(d),e}(b)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolygon",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,d,e,f){var g;return g=function(d){function g(){}return a(g,d),g.scope={path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=",static:"=",events:"=",zIndex:"=zindex",fit:"=",control:"=control"},g.scopeKeys=c.keys(g.scope),g.include(b),g.extend(f),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^uiGmapGoogleMap",g.prototype.scope=g.scope,g.prototype.DEFAULTS={},g.prototype.$log=e,g}(d)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolyline",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(b,d,e,f){var g;return g=function(d){function g(){}return a(g,d),g.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=",static:"=",fit:"=",events:"=",zIndex:"=zindex"},g.scopeKeys=c.keys(g.scope),g.include(b),g.extend(f),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^uiGmapGoogleMap",g.prototype.scope=g.scope,g.prototype.DEFAULTS={},g.prototype.$log=e,g}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapIRectangle",[function(){return{restrict:"EMA",require:"^uiGmapGoogleMap",replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIWindow",["uiGmapBaseObject","uiGmapChildEvents","uiGmapCtrlHandle",function(b,d,e){var f;return f=function(b){function f(){this.restrict="EMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require="^uiGmapGoogleMap",this.replace=!0,this.scope=c.extend(this.scope||{},f.scope)}return a(f,b),f.scope={coords:"=coords",template:"=template",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options",control:"=control",show:"=show"},f.scopeKeys=c.keys(f.scope),f.include(d),f.extend(e),f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},e={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMap",["$timeout","$q","$log","uiGmapGmapUtil","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapIsReady","uiGmapuuid","uiGmapExtendGWin","uiGmapExtendMarkerClusterer","uiGmapGoogleMapsUtilV3","uiGmapGoogleMapApi","uiGmapEventsHelper","uiGmapGoogleMapObjectManager",function(e,f,g,h,i,j,k,l,m,n,o,p,q,r){var s,t,u;return s=void 0,u=[o,m,n],t=function(f){function i(){this.link=a(this.link,this);var b;b=function(a){var b,d;return d=void 0,a.$on("$destroy",function(){return k.decrement()}),b=j.handle(a),a.ctrlType="Map",a.deferred.promise.then(function(){return u.forEach(function(a){return a.init()})}),b.getMap=function(){return a.map},d=c.extend(this,b)},this.controller=["$scope",b]}return d(i,f),i.include(h),i.prototype.restrict="EMA",i.prototype.transclude=!0,i.prototype.replace=!1,i.prototype.template='
\n
',i.prototype.scope={center:"=",zoom:"=",dragging:"=",control:"=",options:"=",events:"=",eventOpts:"=",styles:"=",bounds:"=",update:"="},i.prototype.link=function(a,d,f){var h;return h=[],a.$on("$destroy",function(){if(q.removeEvents(h),"true"===f.recycleMapInstance&&a.map)return r.recycleMapInstance(a.map),a.map=null}),a.idleAndZoomChanged=!1,p.then(function(i){return function(j){var m,n,o,p,t,u,v,w,x,y,z,A,B,C,D,E,F;if(s={mapTypeId:j.MapTypeId.ROADMAP},C=k.spawn(),A=function(){return C.deferred.resolve({instance:C.instance,map:m})},!b.isDefined(a.center)&&!b.isDefined(a.bounds))return void g.error("angular-google-maps: a center or bounds property is required");if(b.isDefined(a.center)||(a.center=new google.maps.LatLngBounds(i.getCoords(a.bounds.southwest),i.getCoords(a.bounds.northeast)).getCenter()),b.isDefined(a.zoom)||(a.zoom=10),t=b.element(d),t.addClass("angular-google-map"),y={options:{}},f.options&&(y.options=a.options),f.styles&&(y.styles=a.styles),f.type&&(D=f.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(D)?y.mapTypeId=google.maps.MapTypeId[f.type.toUpperCase()]:g.error("angular-google-maps: invalid map type '"+f.type+"'")),w=b.extend({},s,y,{center:i.getCoords(a.center),zoom:a.zoom,bounds:a.bounds}),m="true"===f.recycleMapInstance?r.createMapInstance(t.find("div")[1],w):new google.maps.Map(t.find("div")[1],w),m.uiGmap_id=l.generate(),p=!1,h.push(google.maps.event.addListenerOnce(m,"idle",function(){return a.deferred.resolve(m),A()})),o=f.events&&null!=(null!=(z=a.events)?z.blacklist:void 0)?a.events.blacklist:[],c.isString(o)&&(o=[o]),x=function(b,d,e){if(!c.includes(o,b))return e&&e(),h.push(google.maps.event.addListener(m,b,function(){var b;if(!(null!=(b=a.update)?b.lazy:void 0))return d()}))},c.includes(o,"all")||(x("dragstart",function(){return p=!0,a.$evalAsync(function(a){if(null!=a.dragging)return a.dragging=p})}),x("dragend",function(){return p=!1,a.$evalAsync(function(a){if(null!=a.dragging)return a.dragging=p})}),E=function(d,e){var f,g;if(null==d&&(d=m.center),null==e&&(e=a),!c.includes(o,"center"))if(f=d.lat(),g=d.lng(),b.isDefined(e.center.type)){if(e.center.coordinates[1]!==f&&(e.center.coordinates[1]=f),e.center.coordinates[0]!==g)return e.center.coordinates[0]=g}else if(e.center.latitude!==f&&(e.center.latitude=f),e.center.longitude!==g)return e.center.longitude=g},B=!1,x("idle",function(){var b,d,e;return b=m.getBounds(),d=b.getNorthEast(),e=b.getSouthWest(),B=!0,a.$evalAsync(function(b){return E(),c.isUndefined(b.bounds)||c.includes(o,"bounds")||(b.bounds.northeast={latitude:d.lat(),longitude:d.lng()},b.bounds.southwest={latitude:e.lat(),longitude:e.lng()}),c.includes(o,"zoom")||(b.zoom=m.zoom,a.idleAndZoomChanged=!a.idleAndZoomChanged),B=!1})})),b.isDefined(a.events)&&null!==a.events&&b.isObject(a.events)){v=function(b){return function(){return a.events[b].apply(a,[m,b,arguments])}},n=[];for(u in a.events)a.events.hasOwnProperty(u)&&b.isFunction(a.events[u])&&n.push(google.maps.event.addListener(m,u,v(u)));h.concat(n)}return m.getOptions=function(){return w},a.map=m,null!=f.control&&null!=a.control&&(a.control.refresh=function(a){var b,c,d;if(null!=m)return null!=("undefined"!=typeof google&&null!==google&&null!=(c=google.maps)&&null!=(d=c.event)?d.trigger:void 0)&&null!=m&&google.maps.event.trigger(m,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.longitude:void 0)?(b=i.getCoords(a),i.isTrue(f.pan)?m.panTo(b):m.setCenter(b)):void 0},a.control.getGMap=function(){return m},a.control.getMapOptions=function(){return w},a.control.getCustomEventListeners=function(){return n},a.control.removeEvents=function(a){return q.removeEvents(a)}),a.$watch("center",function(b,c){var d;if(b!==c&&!B&&(d=i.getCoords(a.center),d.lat()!==m.center.lat()||d.lng()!==m.center.lng()))return p?void 0:(i.validateCoords(b)||g.error("Invalid center for newValue: "+JSON.stringify(b)),i.isTrue(f.pan)&&a.zoom===m.zoom?m.panTo(d):m.setCenter(d))},!0),F=null,a.$watch("zoom",function(b,d){var f,g;if(null!=b&&!c.isEqual(b,d)&&(null!=m?m.getZoom():void 0)!==(null!=a?a.zoom:void 0)&&!B)return null!=F&&e.cancel(F),F=e(function(){return m.setZoom(b)},(null!=(f=a.eventOpts)&&null!=(g=f.debounce)?g.zoomMs:void 0)+20,!1)}),a.$watch("bounds",function(a,b){var c,d,e,f,h,i,j;if(a!==b)return null==(null!=a&&null!=(e=a.northeast)?e.latitude:void 0)||null==(null!=a&&null!=(f=a.northeast)?f.longitude:void 0)||null==(null!=a&&null!=(h=a.southwest)?h.latitude:void 0)||null==(null!=a&&null!=(i=a.southwest)?i.longitude:void 0)?void g.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),j=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(j,d),m.fitBounds(c))}),["options","styles"].forEach(function(b){return a.$watch(b,function(a,d){if(!c.isEqual(a,d))return"options"===b?y.options=a:y.options[b]=a,null!=m?m.setOptions(y):void 0},!0)})}}(this))},i}(i)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarker",["uiGmapIMarker","uiGmapMarkerChildModel","uiGmapMarkerManager","uiGmapLogger",function(b,d,e,f){var g;return g=function(g){function h(){h.__super__.constructor.call(this),this.template='',f.info(this)}return a(h,g),h.prototype.controller=["$scope","$element",function(a,d){return a.ctrlType="Marker",c.extend(this,b.handle(a,d))}],h.prototype.link=function(a,f,g,h){var i;return i=b.mapPromise(a,h),i.then(function(f){var g,h,i;if(g=new e(f),h=c.object(b.keys,b.keys),i=new d({scope:a,model:a,keys:h,gMap:f,doClick:!0,gManager:g,doDrawSelf:!1,trackModel:!1}),i.deferred.promise.then(function(b){return a.deferred.resolve(b)}),null!=a.control)return a.control.getGMarkers=g.getGMarkers}),a.$on("$destroy",function(){var a;return"undefined"!=typeof a&&null!==a&&a.clear(),a=null})},h}(b)}])}.call(this),function(){var a=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarkers",["uiGmapIMarker","uiGmapPlural","uiGmapMarkersParentModel","uiGmap_sync","uiGmapLogger",function(b,d,e,f,g){var h;return h=function(f){function h(){h.__super__.constructor.call(this),this.template='',d.extend(this,{doCluster:"=?docluster",clusterOptions:"=clusteroptions",clusterEvents:"=clusterevents",modelsByRef:"=modelsbyref",type:"=?type",typeOptions:"=?typeoptions",typeEvents:"=?typeevents",deepComparison:"=?deepcomparison"}),g.info(this)}return a(h,f),h.prototype.controller=["$scope","$element",function(a,d){return a.ctrlType="Markers",c.extend(this,b.handle(a,d))}],h.prototype.link=function(a,f,g,h){var i,j;return i=void 0,j=function(){return a.deferred.resolve()},b.mapPromise(a,h).then(function(b){var k;return k=h.getScope(),k.$watch("idleAndZoomChanged",function(){return c.defer(i.gManager.draw)}),i=new e(a,f,g,b),d.link(a,i),null!=a.control&&(a.control.getGMarkers=function(){var a;return null!=(a=i.gManager)?a.getGMarkers():void 0},a.control.getChildMarkers=function(){return i.plurals}),c.last(i.existingPieces._content).then(function(){return j()})})},h}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").service("uiGmapPlural",[function(){var a;return a=function(a,b){if(null!=a.control)return a.control.updateModels=function(c){return a.models=c,b.createChildScopes(!1)},a.control.newModels=function(c){return a.models=c,b.rebuildAll(a,!0,!0)},a.control.clean=function(){return b.rebuildAll(a,!1,!0)},a.control.getPlurals=function(){return b.plurals},a.control.getManager=function(){return b.gManager},a.control.hasManager=function(){return null!=b.gManager==!0},a.control.managerDraw=function(){var b;if(a.control.hasManager())return null!=(b=a.control.getManager())?b.draw():void 0}},{extend:function(a,b){return c.extend(a.scope||{},b||{},{idKey:"=idkey",doRebuildAll:"=dorebuildall",models:"=models",chunk:"=chunk",cleanchunk:"=cleanchunk",control:"=control",deepComparison:"=deepcomparison"})},link:function(b,c){return a(b,c)}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygon",["uiGmapIPolygon","$timeout","uiGmapPolygonChildModel",function(b,d,e){var f;return f=function(d){function f(){return this.link=a(this.link,this),f.__super__.constructor.apply(this,arguments)}return c(f,d),f.prototype.link=function(a,c,d,f){var g,h;return g=[],h=b.mapPromise(a,f),null!=a.control&&(a.control.getInstance=this,a.control.polygons=g,a.control.promise=h),h.then(function(b){return function(c){return g.push(new e({scope:a,attrs:d,gMap:c,defaults:b.DEFAULTS}))}}(this))},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygons",["uiGmapIPolygon","$timeout","uiGmapPolygonsParentModel","uiGmapPlural",function(d,e,f,g){var h;return h=function(d){function e(){this.link=a(this.link,this),e.__super__.constructor.call(this),g.extend(this),this.$log.info(this)}return c(e,d),e.prototype.link=function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return function(h){return(b.isUndefined(a.path)||null===a.path)&&e.$log.warn("polygons: no valid path attribute found"),a.models||e.$log.warn("polygons: no models found to create from"),g.link(a,new f(a,c,d,h,e.DEFAULTS))}}(this))},e}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolyline",["uiGmapIPolyline","$timeout","uiGmapPolylineChildModel",function(d,e,f){var g;return g=function(e){function g(){return this.link=a(this.link,this),g.__super__.constructor.apply(this,arguments)}return c(g,e),g.prototype.link=function(a,c,e,g){return d.mapPromise(a,g).then(function(c){return function(d){return!b.isUndefined(a.path)&&null!==a.path&&c.validatePath(a.path)||c.$log.warn("polyline: no valid path attribute found"),new f({scope:a,attrs:e,gMap:d,defaults:c.DEFAULTS})}}(this))},g}(d)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolylines",["uiGmapIPolyline","$timeout","uiGmapPolylinesParentModel","uiGmapPlural",function(d,e,f,g){var h;return h=function(d){function e(){this.link=a(this.link,this),e.__super__.constructor.call(this),g.extend(this),this.$log.info(this)}return c(e,d),e.prototype.link=function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return function(h){return(b.isUndefined(a.path)||null===a.path)&&e.$log.warn("polylines: no valid path attribute found"),a.models||e.$log.warn("polylines: no models found to create from"),g.link(a,new f(a,c,d,h,e.DEFAULTS))}}(this))},e}(d)}])}.call(this),function(){b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapRectangle",["uiGmapLogger","uiGmapGmapUtil","uiGmapIRectangle","uiGmapRectangleParentModel",function(a,b,d,e){return c.extend(d,{link:function(a,b,c,d){return d.getScope().deferred.promise.then(function(d){return new e(a,b,c,d)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindow",["uiGmapIWindow","uiGmapGmapUtil","uiGmapWindowChildModel","uiGmapLodash","uiGmapLogger",function(d,e,f,g,h){var i;return i=function(i){function j(){this.link=a(this.link,this),j.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarker"],this.template='',h.debug(this),this.childWindows=[]}return c(j,i),j.include(e),j.prototype.link=function(a,c,e,f){var g,h;return g=f.length>1&&null!=f[1]?f[1]:void 0,h=null!=g?g.getScope():void 0,this.mapPromise=d.mapPromise(a,f[0]),this.mapPromise.then(function(d){return function(f){var i;return i=!0,b.isDefined(e.isiconvisibleonclick)&&(i=a.isIconVisibleOnClick),g?h.deferred.promise.then(function(b){return d.init(a,c,i,f,h)}):void d.init(a,c,i,f)}}(this))},j.prototype.init=function(a,b,c,d,e){var h,i,j,k,l;if(i=null!=a.options?a.options:{},k=null!=a&&this.validateCoords(a.coords),null!=(null!=e?e.getGMarker:void 0)&&(j=e.getGMarker()),l=k?this.createWindowOptions(j,a,b.html(),i):i,null!=d&&(h=new f({scope:a,opts:l,isIconVisibleOnClick:c,gMap:d,markerScope:e,element:b}),this.childWindows.push(h),a.$on("$destroy",function(a){return function(){return a.childWindows=g.withoutObjects(a.childWindows,[h],function(a,b){return a.scope.$id===b.scope.$id}),a.childWindows.length=0}}(this))),null!=a.control&&(a.control.getGWindows=function(a){return function(){return a.childWindows.map(function(a){return a.gObject})}}(this),a.control.getChildWindows=function(a){return function(){return a.childWindows}}(this),a.control.getPlurals=a.control.getChildWindows,a.control.showWindow=function(a){return function(){return a.childWindows.map(function(a){return a.showWindow()})}}(this),a.control.hideWindow=function(a){return function(){return a.childWindows.map(function(a){return a.hideWindow()})}}(this)),null!=this.onChildCreation&&null!=h)return this.onChildCreation(h)},j}(d)}])}.call(this),function(){var a=function(a,b){return function(){ +return a.apply(b,arguments)}},c=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},d={}.hasOwnProperty;b.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindows",["uiGmapIWindow","uiGmapPlural","uiGmapWindowsParentModel","uiGmapPromise","uiGmapLogger",function(b,d,e,f,g){var h;return h=function(b){function h(){this.link=a(this.link,this),h.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarkers"],this.template='',d.extend(this),g.debug(this)}return c(h,b),h.prototype.link=function(a,b,c,d){var e,g,h;return e=d[0].getScope(),g=d.length>1&&null!=d[1]?d[1]:void 0,h=null!=g?g.getScope():void 0,e.deferred.promise.then(function(e){return function(g){var i,j;return i=(null!=h&&null!=(j=h.deferred)?j.promise:void 0)||f.resolve(),i.then(function(){var f,i;return f=null!=(i=e.parentModel)?i.existingPieces:void 0,f?f.then(function(){return e.init(a,b,c,d,g,h)}):e.init(a,b,c,d,g,h)})}}(this))},h.prototype.init=function(a,b,c,f,g,h){var i;if(i=new e(a,b,c,f,g,h),d.link(a,i),null!=a.control)return a.control.getGWindows=function(){return i.plurals.map(function(a){return a.gObject})},a.control.getChildWindows=function(){return i.plurals}},h}(b)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapGoogleMap",["uiGmapMap",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMarker",["$timeout","uiGmapMarker",function(a,b){return new b(a)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMarkers",["$timeout","uiGmapMarkers",function(a,b){return new b(a)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolygon",["uiGmapPolygon",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapCircle",["uiGmapCircle",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolyline",["uiGmapPolyline",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolylines",["uiGmapPolylines",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapRectangle",["uiGmapLogger","uiGmapRectangle",function(a,b){return b}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapWindow",["$timeout","$compile","$http","$templateCache","uiGmapWindow",function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapWindows",["$timeout","$compile","$http","$templateCache","$interpolate","uiGmapWindows",function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapLayer",["$timeout","uiGmapLogger","uiGmapLayerParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template="",this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return null!=a.onCreated?new d(a,b,c,e,a.onCreated):new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapMapControl",["uiGmapControl",function(a){return new a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapDragZoom",["uiGmapDragZoom",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapDrawingManager",["uiGmapDrawingManager",function(a){return a}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapFreeDrawPolygons",["uiGmapApiFreeDrawPolygons",function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapMapType",["$timeout","uiGmapLogger","uiGmapMapTypeParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",options:"=options",refresh:"=refresh",id:"@"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapMapTypes",["$timeout","uiGmapLogger","uiGmapMapTypesParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template='',this.scope={mapTypes:"=mapTypes",show:"=show",options:"=options",refresh:"=refresh",id:"=idKey"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(e){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapPolygons",["uiGmapPolygons",function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};b.module("uiGmapgoogle-maps").directive("uiGmapSearchBox",["uiGmapGoogleMapApi","uiGmapLogger","uiGmapSearchBoxParentModel","$http","$templateCache","$compile",function(c,d,e,f,g,h){var i;return new(i=function(){function i(){this.link=a(this.link,this),this.$log=d,this.restrict="EMA",this.require="^uiGmapGoogleMap",this.priority=-1,this.transclude=!0,this.template="",this.replace=!0,this.scope={template:"=template",events:"=events",position:"=?position",options:"=?options",parentdiv:"=?parentdiv",ngModel:"=?"}}return i.prototype.require="ngModel",i.prototype.link=function(a,d,i,j){return c.then(function(c){return function(k){return null==a.template&&(g.put("uigmap-searchbox-default.tpl.html",''),a.template="uigmap-searchbox-default.tpl.html"),f.get(a.template,{cache:g}).then(function(f){var g;return g=f.data,b.isUndefined(a.events)?void c.$log.error("searchBox: the events property is required"):j.getScope().deferred.promise.then(function(f){var j;return j=b.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_LEFT",k.ControlPosition[j]?new e(a,d,i,f,j,h(g)(a)):void c.$log.error("searchBox: invalid position property")})})}}(this))},i}())}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapShow",["$animate","uiGmapLogger",function(a,c){return{scope:{uiGmapShow:"=",uiGmapAfterShow:"&",uiGmapAfterHide:"&"},link:function(d,e){var f,g,h;return f=function(b,c){return a[b](e,"ng-hide").then(function(){return c()})},g=function(b,c){return a[b](e,"ng-hide",c)},h=function(a,d){return b.version.major>1?c.error("uiGmapShow is not supported for Angular Major greater than 1.\nYour Major is "+b.version.major+'"'):1===b.version.major&&b.version.minor<3?g(a,d):f(a,d)},d.$watch("uiGmapShow",function(a){if(a&&h("removeClass",d.uiGmapAfterShow),!a)return h("addClass",d.uiGmapAfterHide)})}}}])}.call(this),function(){b.module("uiGmapgoogle-maps").directive("uiGmapStreetViewPanorama",["uiGmapGoogleMapApi","uiGmapLogger","uiGmapGmapUtil","uiGmapEventsHelper",function(a,c,d,e){var f;return f="uiGmapStreetViewPanorama",{restrict:"EMA",template:'
',replace:!0,scope:{focalcoord:"=",radius:"=?",events:"=?",options:"=?",control:"=?",povoptions:"=?",imagestatus:"="},link:function(g,h,i){return a.then(function(a){return function(a){var i,j,k,l,m,n,o,p,q,r;return p=void 0,r=void 0,k=!1,n=void 0,o=null,q=null,i=function(){if(e.removeEvents(n),null!=p&&(p.unbind("position"),p.setVisible(!1)),null!=r)return null!=(null!=r?r.setVisible:void 0)&&r.setVisible(!1),r=void 0},m=function(a,c){var d;return d=google.maps.geometry.spherical.computeHeading(a,c),k=!0,g.radius=g.radius||50,q=b.extend({heading:d,zoom:1,pitch:0},g.povoptions||{}),o=o=b.extend({navigationControl:!1,addressControl:!1,linksControl:!1,position:a,pov:q,visible:!0},g.options||{}),k=!1},j=function(){var a;return g.focalcoord?g.radius?(i(),null==r&&(r=new google.maps.StreetViewService),g.events&&(n=e.setEvents(r,g,g)),a=d.getCoords(g.focalcoord),r.getPanoramaByLocation(a,g.radius,function(b,c){var d,e,f;if(null!=g.imagestatus&&(g.imagestatus=c),null!=(null!=(f=g.events)?f.image_status_changed:void 0)&&g.events.image_status_changed(r,"image_status_changed",g,c),"OK"===c)return e=b.location.latLng,m(e,a),d=h[0],p=new google.maps.StreetViewPanorama(d,o)})):void c.error(f+": needs a radius to set the camera view from its focal target."):void c.error(f+": focalCoord needs to be defined")},null!=g.control&&(g.control.getOptions=function(){return o},g.control.getPovOptions=function(){return q},g.control.getGObject=function(){return r},g.control.getGPano=function(){return p}),g.$watch("options",function(a,b){if(a!==b&&a!==o&&!k)return j()}),l=!0,g.$watch("focalcoord",function(a,b){if((a!==b||l)&&null!=a)return l=!1,j()}),g.$on("$destroy",function(){return i()})}}(this))}}}])}.call(this),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapuuid",function(){function a(){}return a.generate=function(){var b=a._gri,c=a._ha;return c(b(32),8)+"-"+c(b(16),4)+"-"+c(16384|b(12),4)+"-"+c(32768|b(14),4)+"-"+c(b(48),12)},a._gri=function(a){return 0>a?NaN:30>=a?0|Math.random()*(1<=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<>>=1,e+=e)1&d&&(c=e+c);return c},a}),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapGoogleMapsUtilV3",function(){return{init:c.once(function(){+function(){function b(a,c){a.getMarkerClusterer().extend(b,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function c(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.hideLabel_=a.getHideLabel(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new b(this,a.getStyles())}function e(a,b,c){this.extend(e,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.hideLabel_=!1,void 0!==c.hideLabel&&(this.hideLabel_=c.hideLabel),this.imagePath_=c.imagePath||e.IMAGE_PATH,this.imageExtension_=c.imageExtension||e.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||e.IMAGE_SIZES,this.calculator_=c.calculator||e.CALCULATOR,this.batchSize_=c.batchSize||e.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||e.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function f(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&("undefined"==typeof a.isHidden?a.visible=!0:a.visible=!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function g(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function h(a,b,c){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=h.getSharedCross(b)}function i(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new h(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}function j(a){var b=a||{};this.ready_=!1,this.dragging_=!1,a.visible==d&&(a.visible=!0),a.shadow==d&&(a.shadow="7px -3px 5px rgba(88,88,88,0.7)"),a.anchor==d&&(a.anchor=k.BOTTOM),this.setValues(b)}b.prototype.onAdd=function(){var a,b,c=this;this.div_=document.createElement("div"),this.div_.className=this.className_,this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){b=a}),google.maps.event.addDomListener(this.div_,"mousedown",function(){a=!0,b=!1}),google.maps.event.addDomListener(this.div_,"click",function(d){if(a=!1,!b){var e,f,g=c.cluster_.getMarkerClusterer();google.maps.event.trigger(g,"click",c.cluster_),google.maps.event.trigger(g,"clusterclick",c.cluster_),g.getZoomOnClick()&&(f=g.getMaxZoom(),e=c.cluster_.getBounds(),g.getMap().fitBounds(e),setTimeout(function(){g.getMap().fitBounds(e),null!==f&&g.getMap().getZoom()>f&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},b.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},b.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},b.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},b.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="",this.div_.innerHTML=a+"
"+(this.cluster_.hideLabel_?" ":this.sums_.text)+"
",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display=""}this.visible_=!0},b.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},b.prototype.setCenter=function(a){this.center_=a},b.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.join("")},b.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},c.prototype.getSize=function(){return this.markers_.length},c.prototype.getMarkers=function(){return this.markers_},c.prototype.getCenter=function(){return this.center_},c.prototype.getMap=function(){return this.map_},c.prototype.getMarkerClusterer=function(){return this.markerClusterer_},c.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;ad)a.getMap()!==this.map_&&a.setMap(this.map_);else if(cb;b++)this.markers_[b].setMap(null);else a.setMap(null);return!0},c.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},c.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},c.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(ab;b++)if(a===this.markers_[b])return!0;return!1},e.prototype.onAdd=function(){var a=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){a.resetViewport_(!1),(this.getZoom()===(this.get("minZoom")||0)||this.getZoom()===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")}),google.maps.event.addListener(this.getMap(),"idle",function(){a.redraw_()})]},e.prototype.onRemove=function(){var a;for(a=0;a0))for(a=0;ad&&(g=d,h=e));h&&h.isMarkerInClusterBounds(a)?h.addMarker(a):(e=new c(this),e.addMarker(a),this.clusters_.push(e))},e.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);if(gthis.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;ag&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){b.getCenter();b.panBy(d,e)}}},f.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);this.div_.style.WebkitTransform="translateZ(0)","undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*this.div_.style.opacity+')"',this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},f.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""), +a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},f.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},f.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.isHidden_?this.div_.style.visibility="hidden":this.div_.style.visibility="visible"},f.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},f.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},f.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},f.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},f.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},f.prototype.getContent=function(){return this.content_},f.prototype.getPosition=function(){return this.position_},f.prototype.getZIndex=function(){return this.zIndex_},f.prototype.getVisible=function(){var a;return a="undefined"!=typeof this.getMap()&&null!==this.getMap()&&!this.isHidden_},f.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},f.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},f.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},f.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;ab.left&&a.leftb.top&&a.topg;b=0<=g?++f:--f)if(c[b]===e){h=[c[c.length-1],c[b]],c[b]=h[0],c[c.length-1]=h[1],c.pop();break}return c.concat(d)},a.prototype.forEachNode=function(a){var b,d,e;e=this._nodes;for(b in e)c.call(e,b)&&(d=e[b],a(d,b))},a.prototype.forEachEdge=function(a){var b,d,e,f,g,h;g=this._nodes;for(d in g)if(c.call(g,d)){e=g[d],h=e._outEdges;for(f in h)c.call(h,f)&&(b=h[f],a(b))}},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e;b=function(){function a(a){var b,c,d,e,f,g;for(null==a&&(a=[]),this._data=[void 0],d=0,f=a.length;d1)for(b=e=2,g=this._data.length;2<=g?eg;b=2<=g?++e:--e)this._upHeap(b);this.size=this._data.length-1}return a.prototype.add=function(a){if(null!=a)return this._data.push(a),this._upHeap(this._data.length-1),this.size++,a},a.prototype.removeMin=function(){var a;if(1!==this._data.length)return this.size--,2===this._data.length?this._data.pop():(a=this._data[1],this._data[1]=this._data.pop(),this._downHeap(),a)},a.prototype.peekMin=function(){return this._data[1]},a.prototype._upHeap=function(a){var b,c;for(b=this._data[a];this._data[a]1;)c=[this._data[d(a)],this._data[a]],this._data[a]=c[0],this._data[d(a)]=c[1],a=d(a)},a.prototype._downHeap=function(){var a,b,d;for(a=1;c(a>1},c=function(a){return a<<1},e=function(a){return(a<<1)+1},a.exports=b}).call(this)},function(a,b){(function(){var b;b=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this.head={prev:void 0,value:void 0,next:void 0},this.tail={prev:void 0,value:void 0,next:void 0},this.size=0,c=0,d=a.length;c=this.size)return-1;for(b=Math.max(0,this._adjust(b)),c=this.at(b),d=b;c&&c.value!==a;)c=c.next,d++;return d===this.size?-1:d},a.prototype._adjust=function(a){return a<0?this.size+a:a},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e,f={}.hasOwnProperty;c="_mapId_",b=function(){function a(b){var c,d;this._content={},this._itemId=0,this._id=a._newMapId(),this.size=0;for(c in b)f.call(b,c)&&(d=b[c],this.set(c,d))}return a._mapIdTracker=0,a._newMapId=function(){return this._mapIdTracker++},a.prototype.hash=function(a,b){var f,g;return null==b&&(b=!1),g=d(a),e(a)?(f=c+this._id,b&&!a[f]&&(a[f]=this._itemId++),f+"_"+a[f]):g+"_"+a},a.prototype.set=function(a,b){return this.has(a)||this.size++,this._content[this.hash(a,!0)]=[b,a],b},a.prototype.get=function(a){var b;return null!=(b=this._content[this.hash(a)])?b[0]:void 0},a.prototype.has=function(a){return this.hash(a)in this._content},a.prototype.delete=function(a){var b;return b=this.hash(a),b in this._content&&(delete this._content[b],e(a)&&delete a[c+this._id],this.size--,!0)},a.prototype.forEach=function(a){var b,c,d;d=this._content;for(b in d)f.call(d,b)&&(c=d[b],a(c[1],c[0]))},a}(),e=function(a){var b,c,e,f,g;for(b=["Boolean","Number","String","Undefined","Null","RegExp","Function"],e=d(a),f=0,g=b.length;fthis._content.length&&(this._content=this._content.slice(this._dequeueIndex),this._dequeueIndex=0),a},a.prototype.peek=function(){return this._content[this._dequeueIndex]},a}(),a.exports=b}).call(this)},function(a,b){(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;c=0,d=1,e=2,h=3,f=1,b=2,g=function(){function a(a){var b,c,d;for(null==a&&(a=[]),this._root,this.size=0,c=0,d=a.length;c=1)&&!f(g[c][1],1);c=k<=1?++i:--i)delete g[c-1][1][g[c][0]];return f(this._root[g[0][0]],1)||delete this._root[g[0][0]],a}}},a}(),f=function(a,b){var c,d;if(0===b)return!0;d=0;for(c in a)if(g.call(a,c)&&(d++,d>=b))return!0;return!1},a.exports=d}).call(this)}]),b.module("uiGmapgoogle-maps.wrapped").service("uiGmapMarkerSpiderfier",["uiGmapGoogleMapApi",function(b){var c=this;return+function(){var b={}.hasOwnProperty,c=[].slice;this.OverlappingMarkerSpiderfier=function(){function d(a,c){var d,f,g,h,i,j;this.map=a,null==c&&(c={});for(f in c)b.call(c,f)&&(j=c[f],this[f]=j);for(this.projHelper=new this.constructor.ProjHelper(this.map),this.initMarkerArrays(),this.listeners={},i=["click","zoom_changed","maptypeid_changed"],g=0,h=i.length;gj;g=0<=j?++h:--h)c=this.circleStartAngle+g*d,k.push(new f.Point(b.x+i*Math.cos(c),b.y+i*Math.sin(c)));return k},l.generatePtsSpiral=function(a,b){var c,d,e,g,h,i,j;for(g=this.spiralLengthStart,c=0,j=[],d=e=0,i=a;0<=i?ei;d=0<=i?++e:--e)c+=this.spiralFootSeparation/g+5e-4*d,h=new f.Point(b.x+g*Math.cos(c),b.y+g*Math.sin(c)),g+=n*this.spiralLengthFactor/c,j.push(h);return j},l.spiderListener=function(b,c){var d,e,f,g,h,i,j,k,m,n,o,p,q;if(k=null!=b._omsData,k&&this.keepSpiderfied||("mouseover"===this.event?(d=this,e=function(){return d.unspiderfy()},a.clearTimeout(l.timeout),l.timeout=setTimeout(e,3e3)):this.unspiderfy()),k||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",b,c);for(n=[],o=[],m=this.nearbyDistance,p=m*m,j=this.llToPt(b.position),q=this.markers,f=0,g=q.length;f=this.circleSpiralSwitchover?this.generatePtsSpiral(n,c).reverse():this.generatePtsCircle(n,c),o=function(){var b,c,l;for(l=[],b=0,c=h.length;bc?a.getMap()!==this.map_&&a.setMap(this.map_):b3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length),h=this.markers_.values();for(b=a;b",this.div_.innerHTML=a+"
"+this.sums_.text+"
","undefined"==typeof this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""}this.visible_=!0},b}(MarkerClusterer)}).call(this)})}}])}(window,angular,_); +//# sourceMappingURL=angular-google-maps-street-view_dev_mapped.min.js.map \ No newline at end of file diff --git a/vendor/assets/javascripts/angular-simple-logger.min.js b/vendor/assets/javascripts/angular-simple-logger.min.js new file mode 100644 index 0000000000..9f2ade91f9 --- /dev/null +++ b/vendor/assets/javascripts/angular-simple-logger.min.js @@ -0,0 +1 @@ +!function e(r,n,o){function t(i,u){if(!n[i]){if(!r[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[i]={exports:{}};r[i][0].call(l.exports,function(e){var n=r[i][1][e];return t(n?n:e)},l,l.exports,e,r,n,o)}return n[i].exports}for(var s="function"==typeof require&&require,i=0;il;f=++l)h=i[f],r[h]=f;return a=function(e,r,n){return e>=r?n():void 0},u=function(e){var r,n,o;if(r=!1,!e)return r;for(n=0,o=i.length;o>n&&(h=i[n],r=null!=e[h]&&"function"==typeof e[h],r);n++);return r},c=function(e,r){var n,o,t,u;for(null==s[e]&&(s[e]=d(e)),n=s[e],u={},o=0,t=i.length;t>o;o++)h=i[o],u[h]="debug"===h?n:r[h];return u},n=function(){function e(e){var n,s,c,l,f;if(this.$log=e,this.spawn=o(this.spawn,this),!this.$log)throw"internalLogger undefined";if(!u(this.$log))throw"@$log is invalid";for(this.doLog=!0,f={},n=function(e){return function(n){return f[n]=function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],e.doLog?a(r[n],e.currentLevel,function(){var r;return(r=e.$log)[n].apply(r,o)}):void 0},e[n]=f[n]}}(this),s=0,c=i.length;c>s;s++)l=i[s],n(l);this.LEVELS=r,this.currentLevel=r.error}return e.prototype.spawn=function(r){if("string"==typeof r){if(!u(this.$log))throw"@$log is invalid";if(!d)throw"nemDebug is undefined this is probably the light version of this library sep debug logggers is not supported!";return c(r,this.$log)}return new e(r||this.$log)},e}(),this.decorator=["$log",function(e){var o;return o=new n(e),o.currentLevel=r.debug,o}],this.$get=["$log",function(e){return new n(e)}],this}])},{debug:2}],2:[function(e,r,n){function o(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function t(){var e=arguments,r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+n.humanize(this.diff),!r)return e;var o="color: "+this.color;e=[e[0],o,"color: inherit"].concat(Array.prototype.slice.call(e,1));var t=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(s=t))}),e.splice(s,0,o),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(r){}}function u(){var e;try{e=n.storage.debug}catch(r){}return e}function a(){try{return window.localStorage}catch(e){}}n=r.exports=e("./debug"),n.log=s,n.formatArgs=t,n.save=i,n.load=u,n.useColors=o,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:a(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(u())},{"./debug":3}],3:[function(e,r,n){function o(){return n.colors[l++%n.colors.length]}function t(e){function r(){}function t(){var e=t,r=+new Date,s=r-(c||r);e.diff=s,e.prev=c,e.curr=r,c=r,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=o());var i=Array.prototype.slice.call(arguments);i[0]=n.coerce(i[0]),"string"!=typeof i[0]&&(i=["%o"].concat(i));var u=0;i[0]=i[0].replace(/%([a-z%])/g,function(r,o){if("%%"===r)return r;u++;var t=n.formatters[o];if("function"==typeof t){var s=i[u];r=t.call(e,s),i.splice(u,1),u--}return r}),"function"==typeof n.formatArgs&&(i=n.formatArgs.apply(e,i));var a=t.log||n.log||console.log.bind(console);a.apply(e,i)}r.enabled=!1,t.enabled=!0;var s=n.enabled(e)?t:r;return s.namespace=e,s}function s(e){n.save(e);for(var r=(e||"").split(/[\s,]+/),o=r.length,t=0;o>t;t++)r[t]&&(e=r[t].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function i(){n.enable("")}function u(e){var r,o;for(r=0,o=n.skips.length;o>r;r++)if(n.skips[r].test(e))return!1;for(r=0,o=n.names.length;o>r;r++)if(n.names[r].test(e))return!0;return!1}function a(e){return e instanceof Error?e.stack||e.message:e}n=r.exports=t,n.coerce=a,n.disable=i,n.enable=s,n.enabled=u,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var c,l=0},{ms:4}],4:[function(e,r,n){function o(e){if(e=""+e,!(e.length>1e4)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]),o=(r[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function t(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function s(e){return i(e,l,"day")||i(e,c,"hour")||i(e,a,"minute")||i(e,u,"second")||e+" ms"}function i(e,r,n){return r>e?void 0:1.5*r>e?Math.floor(e/r)+" "+n:Math.ceil(e/r)+" "+n+"s"}var u=1e3,a=60*u,c=60*a,l=24*c,f=365.25*l;r.exports=function(e,r){return r=r||{},"string"==typeof e?o(e):r["long"]?s(e):t(e)}},{}]},{},[1]); \ No newline at end of file