YUI.add("moodle-atto_collapse-button",function(s,t){var o="atto_collapse",e="showgroups",l="collapse",a="collapsed",n=".atto_group";s.namespace("M.atto_collapse").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{initializer:function(){var t,i=s.Object.size(this.get("host").get("plugins"));i<=1+parseInt(this.get(e),10)||this.toolbar.all(n).size()>this.get(e)||(t=this.addButton({icon:"icon",iconComponent:o,callback:this._toggle}),this.get("host").on("pluginsloaded",function(t,i){this._setVisibility(i),this.toolbar.all(n).item(this.get(e)).insert('<div class="toolbarbreak"></div>',"before")},this,t))},_toggle:function(t){t.preventDefault();var i=this.buttons[l];i.getData(a)?(this.highlightButtons(l),this._setVisibility(i,!0)):(this.unHighlightButtons(l),this._setVisibility(i)),this.buttons[this.name].focus()},_setVisibility:function(t,i){var s=this.toolbar.all(n).slice(this.get(e));i?(t.set("title",M.util.get_string("showfewer",o)),s.show(),t.setData(a,!1)):(t.set("title",M.util.get_string("showmore",o)),s.hide(),t.setData(a,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});