define(["ember","text!./input-uploader-tmpl.hbs"],function(a,b){var c=["jpg","jpeg","png"],d=function(a){var b=a.split(".").pop().toLowerCase();return c.any(function(a){return a===b})};return a.Component.extend({tagName:"ul",classNameBindings:["theme"],theme:"scpic",layout:a.Handlebars.compile(b),multiple:!1,btnpreview:!1,limit:null,accept:"image/png, image/jpeg",initialize:function(){this.set("images",this.get("images")?this.get("images"):[]),this.set("appendImages",[])}.on("init"),didSelect:function(){var a=this.get("images"),b=this.get("limit"),c=this.get("appendImages").filter(function(b){return b instanceof Blob&&!d(b.path)?!1:!a.any(function(a){return b instanceof Blob?a instanceof Blob?a.path===b.path:!1:a instanceof Blob?!1:a===b})});b&&(c=c.filter(function(c,d){return d<b-a.length})),this.get("images").addObjects(c)}.observes("appendImages"),setPaths:function(){var a=this.get("images");this.set("value",a.map(function(a){return a instanceof Blob?a.path:a}).join(";"))}.observes("images.@each"),appendable:function(){var a=this.get("images"),b=this.get("limit"),c=this.get("multiple");return c?b?!(a.length>b-1):!0:!a.length>0}.property("images.@each"),actions:{delImage:function(a){a instanceof Blob?this.get("images").removeObject(a):this.sendAction("remoteDel",a)},preview:function(a){this.sendAction("preview",a instanceof Blob?a.path:a)}}})});