angular.module("midcoComm").controller("fargoApartmentController",["$scope","$window","$filter","$sce","fargoApartmentService",function(n,t,i,r,u){function o(t){var r=t&&t.data||[],u=i("filter")(r,{addressLine:n.addressLine})[0];u&&(n.currentAddress=u);n.addresses=r}function s(n){window.console&&console.error("error: "+JSON.stringify(n))}n.submitted=!1;n.addresses=undefined;n.errors=!1;var f="Sorry. We currently do not have permission to connect your building to Midco services. Please contact your property manager to let them know you want access to America's fastest Internet and other great Midco services. <a href='/shop'>Order Now<\/a>",e=t.midco||{},h=e.apartmentStatu||{signed:"Good news! Your building has access to America's fastest Internet and other great Midco services.",unsigned:f,"contacted ":f,"other contract":f,denied:f};n.getStatus=function(n){return n?n.toLowerCase()&&n.toLowerCase()=="signed"?r.trustAsHtml("Good news! Your building has access to America's fastest Internet and other great Midco services."):r.trustAsHtml(f):r.trustAsHtml(f)};n.submit=function(t){return(t&&t.preventDefault&&t.preventDefault(),n.submitted=!0,n.currentAddress=undefined,!n.addressLine)?(n.errors=!0,!1):(n.errors=!1,u.lookupApartment(n.addressLine).then(o,s),!1)};n.trySearchAgain=function(){n.addressLine=undefined;n.addresses=undefined;n.errors=!1;n.submitted=!1};n.select=function(t){n.currentAddress=t}}]);angular.module("midcoComm").factory("fargoApartmentService",["$http",function(n){"use strict";function t(t){var i="/api/fargoapartmentweb/?addressLine="+t;return n.get(i)}return{lookupApartment:t}}])