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