angular.module("app").controller("NewDropModalController",["$modalScope","$element","core","utils","modal","state","packageManager",function(e,t,n,r,o,a,l){e.core=n,e.utils=r,e.search="",e.droplets=null,e.templates=$.extend(!0,{},n.templates),e.packageManager=l,e.isFrontendEditMode=!!window.kk_frontend_mode;var getInstanceCount=function(e){return n.settings&&n.settings.drops&&n.settings.drops.length?n.settings.drops.filter((function(t){return t._internal.dropId===e})).length:0};for(var s in e.templates){e.templates[s]._instanceCount=getInstanceCount(s)}if(e.filterTemplates=function(t){var n={},o=e.templates;for(var l in o){if(!0===t||!1===t){var s=r.Drops.canAddDrop(l);if(!0===t&&!s)continue;if(!1===t&&s)continue}var i=o[l];i&&i.hidden||(i&&!1===i.frontendEditable&&a.isFrontendMode||(n[l]=i))}return n},e.showPackageManager=function(e,t,n){o.show("PackageManagerModal",null,{overviewMode:e||"store",mode:t||"overview",package:n||null})},setTimeout((function(){t.find(".search").get(0).focus()}),350),n.templates.KK_Droplet){var i=n.settings.drops.filter((function(e){return r.Drops.isDropletTemplate(e)}));i.sort((function(e,t){return e._template.name<t._template.name?-1:e._template.name>t._template.name?1:0})),e.droplets=i}}]);