angular.module("app").controller("UrlPickerModalController",["$modalScope","urlPickerModel","urlPickerConfig","typeConfig",function(e,t,r,n){e.typeConfig=n,e.urlPickerConfig=r,e.modelToSetting=function(e){var t={openExternal:!1};return e?(e.type&&(t[e.type+"Id"]=e.value),t.title=e.title,t.type=e.type,t.openExternal=!!e.openExternal,t):t},e.settingToModel=function(e){var t={};return e?(e.type&&(t.value=e[e.type+"Id"]),t.type=e.type,t.title=e.title,t.openExternal=!!e.openExternal,t._url=!0,t):t},e.isValidLink=function(e){if(!e||!e.type)return!1;let t=e[e.type+"Id"];if(!t)return!1;if("Listing"===e.type){if(!t.params)return;if(!(t.params.category||t.params.vendor||t.params.propertyvalue||t.params.searchspecial||t.params.search))return!1}return!0},e.applySettings=function(t){e.isValidLink(t)&&e.close(e.settingToModel(t))},e.pickerSettings=$.extend({type:"Manual"},e.modelToSetting(t))}]);