YUI.add("tree-lazy",function(e,t){var n="beforeLoad";e.namespace("Plugin.Tree").Lazy=e.Base.create("lazyTreePlugin",e.Plugin.Base,[],{initializer:function(e){this._host=e.host,e.load&&(this.load=e.load),this._host.openNode,this._published={},this._attachEvents()},load:function(e,t){t(new Error("Plugin.Tree.Lazy: Please provide a custom `load` method when instantiating this plugin."))},_attachEvents:function(){this.onHostEvent("open",this._onOpen)},_onOpen:function(e){e=e.node;!e.canHaveChildren||e.state.loaded||e.state.loading||(this._published[n]||(this._published[n]=this.publish(n,{defaultFn:this._defLoadingFn})),this.fire(n,{node:e}))},_defLoadingFn:function(e){var t=e.node,n=this;t.state.loading=!0,this.load(t,function(e){delete t.state.loading,e?n.fire("error",{error:e,src:"load"}):(t.state.loaded=!0,n.fire("load",{node:t}))})}},{NS:"lazy"})},"patched-v3.18.7",{requires:["base-pluginhost","plugin","tree"]});