//>>built
define("dojox/widget/FilePicker",["dijit","dojo","dojox","dojo/i18n!dojox/widget/nls/FilePicker","dojo/require!dojox/widget/RollingList,dojo/i18n"],function(k,e,g){e.provide("dojox.widget.FilePicker");e.require("dojox.widget.RollingList");e.require("dojo.i18n");e.requireLocalization("dojox.widget","FilePicker");e.declare("dojox.widget._FileInfoPane",[g.widget._RollingListPane],{templateString:e.cache("dojox.widget","FilePicker/_FileInfoPane.html",'\x3cdiv class\x3d"dojoxFileInfoPane"\x3e\n\t\x3ctable\x3e\n\t\t\x3ctbody\x3e\n\t\t\t\x3ctr\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoLabel dojoxFileInfoNameLabel"\x3e${_messages.name}\x3c/td\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoName" dojoAttachPoint\x3d"nameNode"\x3e\x3c/td\x3e\n\t\t\t\x3c/tr\x3e\n\t\t\t\x3ctr\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoLabel dojoxFileInfoPathLabel"\x3e${_messages.path}\x3c/td\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoPath" dojoAttachPoint\x3d"pathNode"\x3e\x3c/td\x3e\n\t\t\t\x3c/tr\x3e\n\t\t\t\x3ctr\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoLabel dojoxFileInfoSizeLabel"\x3e${_messages.size}\x3c/td\x3e\n\t\t\t\t\x3ctd class\x3d"dojoxFileInfoSize" dojoAttachPoint\x3d"sizeNode"\x3e\x3c/td\x3e\n\t\t\t\x3c/tr\x3e\n\t\t\x3c/tbody\x3e\n\t\x3c/table\x3e\n\t\x3cdiv dojoAttachPoint\x3d"containerNode" style\x3d"display:none;"\x3e\x3c/div\x3e\n\x3c/div\x3e'),
postMixInProperties:function(){this._messages=e.i18n.getLocalization("dojox.widget","FilePicker",this.lang);this.inherited(arguments)},onItems:function(){var a=this.store,b=this.items[0];b?(this.nameNode.innerHTML=a.getLabel(b),this.pathNode.innerHTML=a.getIdentity(b),this.sizeNode.innerHTML=a.getValue(b,"size"),this.parentWidget.scrollIntoView(this),this.inherited(arguments)):this._onError("Load",Error("No item defined"))}});e.declare("dojox.widget.FilePicker",g.widget.RollingList,{className:"dojoxFilePicker",
pathSeparator:"",topDir:"",parentAttr:"parentDir",pathAttr:"path",preloadItems:50,selectDirectories:!0,selectFiles:!0,_itemsMatch:function(a,b){if(!a&&!b)return!0;if(a&&b){if(a==b)return!0;if(this._isIdentity){var c=[this.store.getIdentity(a),this.store.getIdentity(b)];e.forEach(c,function(d,f){d.lastIndexOf(this.pathSeparator)==d.length-1&&(c[f]=d.substring(0,d.length-1))},this);return c[0]==c[1]}}return!1},startup:function(){if(!this._started){this.inherited(arguments);var a,b=this.getChildren()[0],
c=e.hitch(this,function(){a&&this.disconnect(a);delete a;var d=b.items[0];if(d){var f=this.store,h=f.getValue(d,this.parentAttr);d=f.getValue(d,this.pathAttr);this.pathSeparator=this.pathSeparator||f.pathSeparator;this.pathSeparator||(this.pathSeparator=d.substring(h.length,h.length+1));this.topDir||(this.topDir=h,this.topDir.lastIndexOf(this.pathSeparator)!=this.topDir.length-1&&(this.topDir+=this.pathSeparator))}});this.pathSeparator&&this.topDir||(b.items?c():a=this.connect(b,"onItems",c))}},getChildItems:function(a){var b=
this.inherited(arguments);!b&&this.store.getValue(a,"directory")&&(b=[]);return b},getMenuItemForItem:function(a,b,c){b={iconClass:"dojoxDirectoryItemIcon"};this.store.getValue(a,"directory")||(b.iconClass="dojoxFileItemIcon",a=this.store.getLabel(a),c=a.lastIndexOf("."),0<=c&&(b.iconClass+=" dojoxFileItemIcon_"+a.substring(c+1)),this.selectFiles||(b.disabled=!0));return new k.MenuItem(b)},getPaneForItem:function(a,b,c){b=null;!a||this.store.isItem(a)&&this.store.getValue(a,"directory")?b=new g.widget._RollingListGroupPane({}):
this.store.isItem(a)&&!this.store.getValue(a,"directory")&&(b=new g.widget._FileInfoPane({}));return b},_setPathValueAttr:function(a,b,c){a?(a.lastIndexOf(this.pathSeparator)==a.length-1&&(a=a.substring(0,a.length-1)),this.store.fetchItemByIdentity({identity:a,onItem:function(d){b&&(this._lastExecutedValue=d);this.set("value",d);c&&c()},scope:this})):this.set("value",null)},_getPathValueAttr:function(a){a||(a=this.value);return a&&this.store.isItem(a)?this.store.getValue(a,this.pathAttr):""},_setValue:function(a){delete this._setInProgress;
var b=this.store;if(a&&b.isItem(a)){if((b=this.store.getValue(a,"directory"))&&!this.selectDirectories||!b&&!this.selectFiles)return}else a=null;this._itemsMatch(this.value,a)||(this.value=a,this._onChange(a))}})});