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