(this.webpackChunktocco_widget_showcase=this.webpackChunktocco_widget_showcase||[]).push([[7268],{87268(e,t,a){e=a.nmd(e),ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],(function(e,t,a){"use strict";var r=e("../token_iterator").TokenIterator;function s(e,t){return e.type.lastIndexOf(t+".xml")>-1}t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.formatOptions={lineBreaksAfterCommasInCurlyBlock:!0},t.beautify=function(e){for(var a,o,n,i=new r(e,0,0),c=i.getCurrentToken(),u=e.getTabString(),l=t.singletonTags,m=t.blockTags,p=t.formatOptions||{},h=!1,f=!1,g=!1,y="",d="",b="",k=0,w=0,$=0,v=0,x=0,C=0,T=0,R=0,_=0,B=!1,O=!1,I=!1,q=!1,A={0:0},F=[],S=!1,K=function(){a&&a.value&&"string.regexp"!==a.type&&(a.value=a.value.replace(/^\s*/,""))},L=function(){for(var e=y.length-1;0!=e&&" "===y[e];)e-=1;y=y.slice(0,e+1)},V=function(){y=y.trimRight(),h=!1};null!==c;){if(R=i.getCurrentTokenRow(),i.$rowTokens,a=i.stepForward(),void 0!==c){if(d=c.value,x=0,I="style"===b||"ace/mode/css"===e.$modeId,s(c,"tag-open")?(O=!0,a&&(q=-1!==m.indexOf(a.value)),"</"===d&&(q&&!h&&_<1&&_++,I&&(_=1),x=1,q=!1)):s(c,"tag-close")?O=!1:s(c,"comment.start")?q=!0:s(c,"comment.end")&&(q=!1),O||_||"paren.rparen"!==c.type||"}"!==c.value.substr(0,1)||_++,R!==o&&(_=R,o&&(_-=o)),_){for(V();_>0;_--)y+="\n";h=!0,s(c,"comment")||c.type.match(/^(comment|string)$/)||(d=d.trimLeft())}if(d){if("keyword"===c.type&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(F[k]=d,K(),g=!0,d.match(/^(else|elseif)$/)&&y.match(/\}[\s]*$/)&&(V(),f=!0)):"paren.lparen"===c.type?(K(),"{"===d.substr(-1)&&(g=!0,B=!1,O||(_=1)),"{"===d.substr(0,1)&&(f=!0,"["!==y.substr(-1)&&"["===y.trimRight().substr(-1)?(V(),f=!1):")"===y.trimRight().substr(-1)?V():L())):"paren.rparen"===c.type?(x=1,"}"===d.substr(0,1)&&("case"===F[k-1]&&x++,"{"===y.trimRight().substr(-1)?V():(f=!0,I&&(_+=2))),"]"===d.substr(0,1)&&"}"!==y.substr(-1)&&"}"===y.trimRight().substr(-1)&&(f=!1,v++,V()),")"===d.substr(0,1)&&"("!==y.substr(-1)&&"("===y.trimRight().substr(-1)&&(f=!1,v++,V()),L()):"keyword.operator"!==c.type&&"keyword"!==c.type||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?"punctuation.operator"===c.type&&";"===d?(V(),K(),g=!0,I&&_++):"punctuation.operator"===c.type&&d.match(/^(:|,)$/)?(V(),K(),d.match(/^(,)$/)&&T>0&&0===C&&p.lineBreaksAfterCommasInCurlyBlock?_++:(g=!0,h=!1)):"support.php_tag"!==c.type||"?>"!==d||h?s(c,"attribute-name")&&y.substr(-1).match(/^\s$/)?f=!0:s(c,"attribute-equals")?(L(),K()):s(c,"tag-close")?(L(),"/>"===d&&(f=!0)):"keyword"===c.type&&d.match(/^(case|default)$/)&&S&&(x=1):(V(),f=!0):(V(),K(),f=!0,g=!0),h&&(!c.type.match(/^(comment)$/)||d.substr(0,1).match(/^[/#]$/))&&(!c.type.match(/^(string)$/)||d.substr(0,1).match(/^['"@]$/))){if(v=$,k>w)for(v++,n=k;n>w;n--)A[n]=v;else k<w&&(v=A[k]);for(w=k,$=v,x&&(v-=x),B&&!C&&(v++,B=!1),n=0;n<v;n++)y+=u}if("keyword"===c.type&&d.match(/^(case|default)$/)?!1===S&&(F[k]=d,k++,S=!0):"keyword"===c.type&&d.match(/^(break)$/)&&F[k-1]&&F[k-1].match(/^(case|default)$/)&&(k--,S=!1),"paren.lparen"===c.type&&(C+=(d.match(/\(/g)||[]).length,T+=(d.match(/\{/g)||[]).length,k+=d.length),"keyword"===c.type&&d.match(/^(if|else|elseif|for|while)$/)?(B=!0,C=0):!C&&d.trim()&&"comment"!==c.type&&(B=!1),"paren.rparen"===c.type)for(C-=(d.match(/\)/g)||[]).length,T-=(d.match(/\}/g)||[]).length,n=0;n<d.length;n++)k--,"}"===d.substr(n,1)&&"case"===F[k]&&k--;"text"==c.type&&(d=d.replace(/\s+$/," ")),f&&!h&&(L(),"\n"!==y.substr(-1)&&(y+=" ")),y+=d,g&&(y+=" "),h=!1,f=!1,g=!1,(s(c,"tag-close")&&(q||-1!==m.indexOf(b))||s(c,"doctype")&&">"===d)&&(_=q&&a&&"</"===a.value?-1:1),a&&-1===l.indexOf(a.value)&&(s(c,"tag-open")&&"</"===d?k--:s(c,"tag-open")&&"<"===d?k++:s(c,"tag-close")&&"/>"===d&&k--),s(c,"tag-name")&&(b=d),o=R}}c=a}y=y.trim(),e.doc.setValue(y)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]})),ace.require(["ace/ext/beautify"],(function(t){e&&(e.exports=t)}))}}]);