AUI.add("aui-parse-content",function(E){var M=E.Lang,D=M.isString,N="append",B="documentElement",P="firstChild",J="head",O="host",G="innerHTML",H="ParseContent",F="queue",K="script",I="src";var C=E.Component.create({NAME:H,NS:H,ATTRS:{queue:{value:null}},EXTENDS:E.Plugin.Base,prototype:{initializer:function(){var A=this;C.superclass.initializer.apply(this,arguments);A.set(F,new E.AsyncQueue());A._bindAOP();},globalEval:function(Q){var R=E.getDoc();var L=R.one(J)||R.get(B);var A=document.createElement(K);A.type="text/javascript";if(Q){A.text=M.trim(Q);}L.appendChild(A).remove();},parseContent:function(Q){var A=this;var L=A._clean(Q);A._dispatch(L);return L;},_bindAOP:function(){var A=this;this.doBefore("insert",function(R){var Q=Array.prototype.slice.call(arguments);var L=A.parseContent(R);Q.splice(0,1,L.fragment);return new E.Do.AlterArgs(null,Q);});this.doBefore("setContent",function(Q){var L=A.parseContent(Q);return new E.Do.AlterArgs(null,[L.fragment]);});},_clean:function(Q){var A={};var L=E.Node.create("<div></div>");L.append("<div>_</div>");if(D(Q)){E.DOM.addHTML(L,Q,N);}else{L.append(Q);}A.js=L.all(K).each(function(S,R){S.remove();});L.get(P).remove();A.fragment=L.get("childNodes").toFrag();return A;},_dispatch:function(Q){var L=this;var A=L.get(F);Q.js.each(function(S,R){var T=S.get(I);if(T){A.add({autoContinue:false,fn:function(){E.Get.script(T,{onEnd:function(U){U.purge();A.run();}});},timeout:0});}else{A.add({fn:function(){var U=S._node;L.globalEval(U.text||U.textContent||U.innerHTML||"");},timeout:0});}});A.run();}}});E.namespace("Plugin").ParseContent=C;},"1.0.1",{skinnable:false,requires:["async-queue","aui-base","plugin"]});