Liferay.Loader.define("frontend-js-web@5.0.33/liferay/util/format_xml.es",["module","exports","require"],(function(e,t,r){window;{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){const{newLine:n,tagIndent:c}=o(o({},v),t);if("string"!=typeof e)throw new TypeError("Parameter content must be a string");const A=[];e=(e=(e=(e=(e=(e=e.trim()).replace(r,(e=>(A.push(e),D)))).replace(P,"><")).replace(d,h+"<")).replace(y,h+"$1$2")).replace(E,(()=>A.shift()));let F=0,L=!1;const S=e.split(h);let T=0,C="";return S.forEach(((e,t)=>{r.test(e)?C+=s(T,n,c)+e:l.test(e)?(C+=s(T,n,c)+e,F++,L=!0,(i.test(e)||p.test(e))&&(F--,L=0!==F)):i.test(e)?(C+=e,F--,L=0!==F):u.exec(S[t-1])&&f.exec(e)&&g.exec(S[t-1]).toString()===w.exec(e)[0].replace("/",x).toString()?(C+=e,L||--T):!b.test(e)||j.test(e)||m.test(e)?b.test(e)&&j.test(e)?C+=L?e:s(T,n,c)+e:j.test(e)?C+=L?e:s(--T,n,c)+e:m.test(e)?C+=L?e:s(T,n,c)+e:a.test(e)?C+=s(T,n,c)+e:C+=O?s(T,n,c)+e:e:C+=L?e:s(T++,n,c)+e,new RegExp("^"+n).test(C)&&(C=C.slice(n.length))})),C};const e="\r\n",r=/<!\[CDATA\[[\0-\uFFFF]*?\]\]>/g,i=/-->|\]>/,l=/<!/,a=/<\?/,p=/!DOCTYPE/,u=/^<\w/,f=/^<\/\w/,g=/^<[\w:\-.,]+/,w=/^<\/[\w:\-.,]+/,b=/<\w/,O=/xmlns(?::|=)/g,y=/\s*(xmlns)(:|=)/g,j=/<\//,d=/</g,m=/\/>/,P=/>\s+</g,x="",h="~::~",D="<"+h+"CDATA"+h+">",E=new RegExp(D,"g"),v={newLine:e,tagIndent:"\t"};function s(e,t,r){return t+new Array(e+1).join(r)}}}));
//# sourceMappingURL=format_xml.es.js.map