@innovastudio/contentbox 1.6.90 → 1.6.91

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ var ContentBox=function(){"use strict";class t{appendHtml(t,e,i="beforeend"){t.i
16
16
  * @author RubaXa <trash@rubaxa.org>
17
17
  * @author owenm <owen23355@gmail.com>
18
18
  * @license MIT
19
- */function D(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function j(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?D(Object(i),!0).forEach((function(e){F(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function F(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function U(){return U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},U.apply(this,arguments)}function W(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i,n,s={},o=Object.keys(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function G(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Y=G(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),X=G(/Edge/i),V=G(/firefox/i),K=G(/safari/i)&&!G(/chrome/i)&&!G(/android/i),Z=G(/iP(ad|od|hone)/i),Q=G(/chrome/i)&&G(/android/i),J={capture:!1,passive:!1};function tt(t,e,i){t.addEventListener(e,i,!Y&&J)}function et(t,e,i){t.removeEventListener(e,i,!Y&&J)}function it(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function nt(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function st(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&it(t,e):it(t,e))||n&&t===i)return t;if(t===i)break}while(t=nt(t))}return null}var ot,lt=/\s+/g;function at(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(lt," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(lt," ")}}function rt(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function ct(t,e){var i="";if("string"==typeof t)i=t;else do{var n=rt(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(i)}function ut(t,e,i){if(t){var n=t.getElementsByTagName(e),s=0,o=n.length;if(i)for(;s<o;s++)i(n[s],s);return n}return[]}function dt(){var t=document.scrollingElement;return t||document.documentElement}function bt(t,e,i,n,s){if(t.getBoundingClientRect||t===window){var o,l,a,r,c,u,d;if(t!==window&&t.parentNode&&t!==dt()?(l=(o=t.getBoundingClientRect()).top,a=o.left,r=o.bottom,c=o.right,u=o.height,d=o.width):(l=0,a=0,r=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||i)&&t!==window&&(s=s||t.parentNode,!Y))do{if(s&&s.getBoundingClientRect&&("none"!==rt(s,"transform")||i&&"static"!==rt(s,"position"))){var b=s.getBoundingClientRect();l-=b.top+parseInt(rt(s,"border-top-width")),a-=b.left+parseInt(rt(s,"border-left-width")),r=l+o.height,c=a+o.width;break}}while(s=s.parentNode);if(n&&t!==window){var h=ct(s||t),p=h&&h.a,m=h&&h.d;h&&(r=(l/=m)+(u/=m),c=(a/=p)+(d/=p))}return{top:l,left:a,bottom:r,right:c,width:d,height:u}}}function ht(t,e,i){for(var n=vt(t,!0),s=bt(t)[e];n;){var o=bt(n)[i];if(!("top"===i||"left"===i?s>=o:s<=o))return n;if(n===dt())break;n=vt(n,!1)}return!1}function pt(t,e,i,n){for(var s=0,o=0,l=t.children;o<l.length;){if("none"!==l[o].style.display&&l[o]!==Se.ghost&&(n||l[o]!==Se.dragged)&&st(l[o],i.draggable,t,!1)){if(s===e)return l[o];s++}o++}return null}function mt(t,e){for(var i=t.lastElementChild;i&&(i===Se.ghost||"none"===rt(i,"display")||e&&!it(i,e));)i=i.previousElementSibling;return i||null}function gt(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Se.clone||e&&!it(t,e)||i++;return i}function ft(t){var e=0,i=0,n=dt();if(t)do{var s=ct(t),o=s.a,l=s.d;e+=t.scrollLeft*o,i+=t.scrollTop*l}while(t!==n&&(t=t.parentNode));return[e,i]}function vt(t,e){if(!t||!t.getBoundingClientRect)return dt();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var s=rt(i);if(i.clientWidth<i.scrollWidth&&("auto"==s.overflowX||"scroll"==s.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==s.overflowY||"scroll"==s.overflowY)){if(!i.getBoundingClientRect||i===document.body)return dt();if(n||e)return i;n=!0}}}while(i=i.parentNode);return dt()}function yt(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function xt(t,e){return function(){if(!ot){var i=arguments,n=this;1===i.length?t.call(n,i[0]):t.apply(n,i),ot=setTimeout((function(){ot=void 0}),e)}}}function wt(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function St(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}function _t(t,e,i){var n={};return Array.from(t.children).forEach((function(s){var o,l,a,r;if(st(s,e.draggable,t,!1)&&!s.animated&&s!==i){var c=bt(s);n.left=Math.min(null!==(o=n.left)&&void 0!==o?o:1/0,c.left),n.top=Math.min(null!==(l=n.top)&&void 0!==l?l:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(r=n.bottom)&&void 0!==r?r:-1/0,c.bottom)}})),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var kt="Sortable"+(new Date).getTime();function Ct(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==rt(t,"display")&&t!==Se.ghost){e.push({target:t,rect:bt(t)});var i=j({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=ct(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var s=!1,o=0;e.forEach((function(t){var e=0,i=t.target,l=i.fromRect,a=bt(i),r=i.prevFromRect,c=i.prevToRect,u=t.rect,d=ct(i,!0);d&&(a.top-=d.f,a.left-=d.e),i.toRect=a,i.thisAnimationDuration&&yt(r,a)&&!yt(l,a)&&(u.top-a.top)/(u.left-a.left)==(l.top-a.top)/(l.left-a.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(u,r,c,n.options)),yt(a,l)||(i.prevFromRect=l,i.prevToRect=a,e||(e=n.options.animation),n.animate(i,u,a,e)),e&&(s=!0,o=Math.max(o,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),e),i.thisAnimationDuration=e)})),clearTimeout(t),s?t=setTimeout((function(){"function"==typeof i&&i()}),o):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){rt(t,"transition",""),rt(t,"transform","");var s=ct(this.el),o=s&&s.a,l=s&&s.d,a=(e.left-i.left)/(o||1),r=(e.top-i.top)/(l||1);t.animatingX=!!a,t.animatingY=!!r,rt(t,"transform","translate3d("+a+"px,"+r+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),rt(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),rt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){rt(t,"transition",""),rt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),n)}}}}var Lt=[],At={initializeByDefault:!0},Et={mount:function(t){for(var e in At)At.hasOwnProperty(e)&&!(e in t)&&(t[e]=At[e]);Lt.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),Lt.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var s=t+"Global";Lt.forEach((function(n){e[n.pluginName]&&(e[n.pluginName][s]&&e[n.pluginName][s](j({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](j({sortable:e},i)))}))},initializePlugins:function(t,e,i,n){for(var s in Lt.forEach((function(n){var s=n.pluginName;if(t.options[s]||n.initializeByDefault){var o=new n(t,e,t.options);o.sortable=t,o.options=t.options,t[s]=o,U(i,o.defaults)}})),t.options)if(t.options.hasOwnProperty(s)){var o=this.modifyOption(t,s,t.options[s]);void 0!==o&&(t.options[s]=o)}},getEventProperties:function(t,e){var i={};return Lt.forEach((function(n){"function"==typeof n.eventProperties&&U(i,n.eventProperties.call(e[n.pluginName],t))})),i},modifyOption:function(t,e,i){var n;return Lt.forEach((function(s){t[s.pluginName]&&s.optionListeners&&"function"==typeof s.optionListeners[e]&&(n=s.optionListeners[e].call(t[s.pluginName],i))})),n}};var qt=["evt"],Tt=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,s=W(i,qt);Et.pluginEvent.bind(Se)(t,e,j({dragEl:Ot,parentEl:zt,ghostEl:It,rootEl:Rt,nextEl:$t,lastDownEl:Bt,cloneEl:Nt,cloneHidden:Pt,dragStarted:Qt,putSortable:Wt,activeSortable:Se.active,originalEvent:n,oldIndex:Dt,oldDraggableIndex:Ht,newIndex:jt,newDraggableIndex:Ft,hideGhostForTarget:ve,unhideGhostForTarget:ye,cloneNowHidden:function(){Pt=!0},cloneNowShown:function(){Pt=!1},dispatchSortableEvent:function(t){Mt({sortable:e,name:t,originalEvent:n})}},s))};function Mt(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,s=t.targetEl,o=t.cloneEl,l=t.toEl,a=t.fromEl,r=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,b=t.originalEvent,h=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[kt]){var m,g=e.options,f="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||Y||X?(m=document.createEvent("Event")).initEvent(n,!0,!0):m=new CustomEvent(n,{bubbles:!0,cancelable:!0}),m.to=l||i,m.from=a||i,m.item=s||i,m.clone=o,m.oldIndex=r,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=d,m.originalEvent=b,m.pullMode=h?h.lastPutMode:void 0;var v=j(j({},p),Et.getEventProperties(n,e));for(var y in v)m[y]=v[y];i&&i.dispatchEvent(m),g[f]&&g[f].call(e,m)}}(j({putSortable:Wt,cloneEl:Nt,targetEl:Ot,rootEl:Rt,oldIndex:Dt,oldDraggableIndex:Ht,newIndex:jt,newDraggableIndex:Ft},t))}var Ot,zt,It,Rt,$t,Bt,Nt,Pt,Dt,jt,Ht,Ft,Ut,Wt,Gt,Yt,Xt,Vt,Kt,Zt,Qt,Jt,te,ee,ie,ne=!1,se=!1,oe=[],le=!1,ae=!1,re=[],ce=!1,ue=[],de="undefined"!=typeof document,be=Z,he=X||Y?"cssFloat":"float",pe=de&&!Q&&!Z&&"draggable"in document.createElement("div"),me=function(){if(de){if(Y)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ge=function(t,e){var i=rt(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),s=pt(t,0,e),o=pt(t,1,e),l=s&&rt(s),a=o&&rt(o),r=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+bt(s).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+bt(o).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&l.float&&"none"!==l.float){var u="left"===l.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return s&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||r>=n&&"none"===i[he]||o&&"none"===i[he]&&r+c>n)?"vertical":"horizontal"},fe=function(t){function e(t,i){return function(n,s,o,l){var a=n.options.group.name&&s.options.group.name&&n.options.group.name===s.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,s,o,l),i)(n,s,o,l);var r=(i?n:s).options.group.name;return!0===t||"string"==typeof t&&t===r||t.join&&t.indexOf(r)>-1}}var i={},n=t.group;n&&"object"==H(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},ve=function(){!me&&It&&rt(It,"display","none")},ye=function(){!me&&It&&rt(It,"display","")};de&&!Q&&document.addEventListener("click",(function(t){if(se)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),se=!1,!1}),!0);var xe=function(t){if(Ot){t=t.touches?t.touches[0]:t;var e=(s=t.clientX,o=t.clientY,oe.some((function(t){var e=t[kt].options.emptyInsertThreshold;if(e&&!mt(t)){var i=bt(t),n=s>=i.left-e&&s<=i.right+e,a=o>=i.top-e&&o<=i.bottom+e;return n&&a?l=t:void 0}})),l);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[kt]._onDragOver(i)}}var s,o,l},we=function(t){Ot&&Ot.parentNode[kt]._isOutsideThisEl(t.target)};function Se(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=U({},e),t[kt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ge(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Se.supportPointer&&"PointerEvent"in window&&!K,emptyInsertThreshold:5};for(var n in Et.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var s in fe(e),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!e.forceFallback&&pe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?tt(t,"pointerdown",this._onTapStart):(tt(t,"mousedown",this._onTapStart),tt(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(tt(t,"dragover",this),tt(t,"dragenter",this)),oe.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),U(this,Ct())}function _e(t,e,i,n,s,o,l,a){var r,c,u=t[kt],d=u.options.onMove;return!window.CustomEvent||Y||X?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=s||e,r.relatedRect=o||bt(e),r.willInsertAfter=a,r.originalEvent=l,t.dispatchEvent(r),d&&(c=d.call(u,r,l)),c}function ke(t){t.draggable=!1}function Ce(){ce=!1}function Le(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function Ae(t){return setTimeout(t,0)}function Ee(t){return clearTimeout(t)}Se.prototype={constructor:Se,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Jt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ot):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,s=n.preventOnFilter,o=t.type,l=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(l||t).target,r=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;if(function(t){ue.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&ue.push(n)}}(i),!Ot&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!K||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=st(a,n.draggable,i,!1))&&a.animated||Bt===a)){if(Dt=gt(a),Ht=gt(a,n.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Mt({sortable:e,rootEl:r,name:"filter",targetEl:a,toEl:i,fromEl:i}),Tt("filter",e,{evt:t}),void(s&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=st(r,n.trim(),i,!1))return Mt({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),Tt("filter",e,{evt:t}),!0}))))return void(s&&t.cancelable&&t.preventDefault());n.handle&&!st(r,n.handle,i,!1)||this._prepareDragStart(t,l,a)}}},_prepareDragStart:function(t,e,i){var n,s=this,o=s.el,l=s.options,a=o.ownerDocument;if(i&&!Ot&&i.parentNode===o){var r=bt(i);if(Rt=o,zt=(Ot=i).parentNode,$t=Ot.nextSibling,Bt=i,Ut=l.group,Se.dragged=Ot,Gt={target:Ot,clientX:(e||t).clientX,clientY:(e||t).clientY},Kt=Gt.clientX-r.left,Zt=Gt.clientY-r.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ot.style["will-change"]="all",n=function(){Tt("delayEnded",s,{evt:t}),Se.eventCanceled?s._onDrop():(s._disableDelayedDragEvents(),!V&&s.nativeDraggable&&(Ot.draggable=!0),s._triggerDragStart(t,e),Mt({sortable:s,name:"choose",originalEvent:t}),at(Ot,l.chosenClass,!0))},l.ignore.split(",").forEach((function(t){ut(Ot,t.trim(),ke)})),tt(a,"dragover",xe),tt(a,"mousemove",xe),tt(a,"touchmove",xe),tt(a,"mouseup",s._onDrop),tt(a,"touchend",s._onDrop),tt(a,"touchcancel",s._onDrop),V&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ot.draggable=!0),Tt("delayStart",this,{evt:t}),!l.delay||l.delayOnTouchOnly&&!e||this.nativeDraggable&&(X||Y))n();else{if(Se.eventCanceled)return void this._onDrop();tt(a,"mouseup",s._disableDelayedDrag),tt(a,"touchend",s._disableDelayedDrag),tt(a,"touchcancel",s._disableDelayedDrag),tt(a,"mousemove",s._delayedDragTouchMoveHandler),tt(a,"touchmove",s._delayedDragTouchMoveHandler),l.supportPointer&&tt(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(n,l.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ot&&ke(Ot),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;et(t,"mouseup",this._disableDelayedDrag),et(t,"touchend",this._disableDelayedDrag),et(t,"touchcancel",this._disableDelayedDrag),et(t,"mousemove",this._delayedDragTouchMoveHandler),et(t,"touchmove",this._delayedDragTouchMoveHandler),et(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?tt(document,"pointermove",this._onTouchMove):tt(document,e?"touchmove":"mousemove",this._onTouchMove):(tt(Ot,"dragend",this),tt(Rt,"dragstart",this._onDragStart));try{document.selection?Ae((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ne=!1,Rt&&Ot){Tt("dragStarted",this,{evt:e}),this.nativeDraggable&&tt(document,"dragover",we);var i=this.options;!t&&at(Ot,i.dragClass,!1),at(Ot,i.ghostClass,!0),Se.active=this,t&&this._appendGhost(),Mt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Yt){this._lastX=Yt.clientX,this._lastY=Yt.clientY,ve();for(var t=document.elementFromPoint(Yt.clientX,Yt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yt.clientX,Yt.clientY))!==e;)e=t;if(Ot.parentNode[kt]._isOutsideThisEl(t),e)do{if(e[kt]){if(e[kt]._onDragOver({clientX:Yt.clientX,clientY:Yt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);ye()}},_onTouchMove:function(t){if(Gt){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,s=t.touches?t.touches[0]:t,o=It&&ct(It,!0),l=It&&o&&o.a,a=It&&o&&o.d,r=be&&ie&&ft(ie),c=(s.clientX-Gt.clientX+n.x)/(l||1)+(r?r[0]-re[0]:0)/(l||1),u=(s.clientY-Gt.clientY+n.y)/(a||1)+(r?r[1]-re[1]:0)/(a||1);if(!Se.active&&!ne){if(i&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(It){o?(o.e+=c-(Xt||0),o.f+=u-(Vt||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");rt(It,"webkitTransform",d),rt(It,"mozTransform",d),rt(It,"msTransform",d),rt(It,"transform",d),Xt=c,Vt=u,Yt=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!It){var t=this.options.fallbackOnBody?document.body:Rt,e=bt(Ot,!0,be,!0,t),i=this.options;if(be){for(ie=t;"static"===rt(ie,"position")&&"none"===rt(ie,"transform")&&ie!==document;)ie=ie.parentNode;ie!==document.body&&ie!==document.documentElement?(ie===document&&(ie=dt()),e.top+=ie.scrollTop,e.left+=ie.scrollLeft):ie=dt(),re=ft(ie)}at(It=Ot.cloneNode(!0),i.ghostClass,!1),at(It,i.fallbackClass,!0),at(It,i.dragClass,!0),rt(It,"transition",""),rt(It,"transform",""),rt(It,"box-sizing","border-box"),rt(It,"margin",0),rt(It,"top",e.top),rt(It,"left",e.left),rt(It,"width",e.width),rt(It,"height",e.height),rt(It,"opacity","0.8"),rt(It,"position",be?"absolute":"fixed"),rt(It,"zIndex","100000"),rt(It,"pointerEvents","none"),Se.ghost=It,t.appendChild(It),rt(It,"transform-origin",Kt/parseInt(It.style.width)*100+"% "+Zt/parseInt(It.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,s=i.options;Tt("dragStart",this,{evt:t}),Se.eventCanceled?this._onDrop():(Tt("setupClone",this),Se.eventCanceled||((Nt=St(Ot)).removeAttribute("id"),Nt.draggable=!1,Nt.style["will-change"]="",this._hideClone(),at(Nt,this.options.chosenClass,!1),Se.clone=Nt),i.cloneId=Ae((function(){Tt("clone",i),Se.eventCanceled||(i.options.removeCloneOnHide||Rt.insertBefore(Nt,Ot),i._hideClone(),Mt({sortable:i,name:"clone"}))})),!e&&at(Ot,s.dragClass,!0),e?(se=!0,i._loopId=setInterval(i._emulateDragOver,50)):(et(document,"mouseup",i._onDrop),et(document,"touchend",i._onDrop),et(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",s.setData&&s.setData.call(i,n,Ot)),tt(document,"drop",i),rt(Ot,"transform","translateZ(0)")),ne=!0,i._dragStartId=Ae(i._dragStarted.bind(i,e,t)),tt(document,"selectstart",i),Qt=!0,K&&rt(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,s,o=this.el,l=t.target,a=this.options,r=a.group,c=Se.active,u=Ut===r,d=a.sort,b=Wt||c,h=this,p=!1;if(!ce){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=st(l,a.draggable,o,!0),q("dragOver"),Se.eventCanceled)return p;if(Ot.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||h._ignoreWhileAnimating===l)return M(!1);if(se=!1,c&&!a.disabled&&(u?d||(n=zt!==Rt):Wt===this||(this.lastPutMode=Ut.checkPull(this,c,Ot,t))&&r.checkPut(this,c,Ot,t))){if(s="vertical"===this._getDirection(t,l),e=bt(Ot),q("dragOverValid"),Se.eventCanceled)return p;if(n)return zt=Rt,T(),this._hideClone(),q("revert"),Se.eventCanceled||($t?Rt.insertBefore(Ot,$t):Rt.appendChild(Ot)),M(!0);var m=mt(o,a.draggable);if(!m||function(t,e,i){var n=bt(mt(i.el,i.options.draggable)),s=_t(i.el,i.options,It),o=10;return e?t.clientX>s.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>s.bottom+o||t.clientX>n.right&&t.clientY>n.top}(t,s,this)&&!m.animated){if(m===Ot)return M(!1);if(m&&o===t.target&&(l=m),l&&(i=bt(l)),!1!==_e(Rt,o,Ot,e,l,i,t,!!l))return T(),m&&m.nextSibling?o.insertBefore(Ot,m.nextSibling):o.appendChild(Ot),zt=o,O(),M(!0)}else if(m&&function(t,e,i){var n=bt(pt(i.el,0,i.options,!0)),s=_t(i.el,i.options,It),o=10;return e?t.clientX<s.left-o||t.clientY<n.top&&t.clientX<n.right:t.clientY<s.top-o||t.clientY<n.bottom&&t.clientX<n.left}(t,s,this)){var g=pt(o,0,a,!0);if(g===Ot)return M(!1);if(i=bt(l=g),!1!==_e(Rt,o,Ot,e,l,i,t,!1))return T(),o.insertBefore(Ot,g),zt=o,O(),M(!0)}else if(l.parentNode===o){i=bt(l);var f,v,y,x=Ot.parentNode!==o,w=!function(t,e,i){var n=i?t.left:t.top,s=i?t.right:t.bottom,o=i?t.width:t.height,l=i?e.left:e.top,a=i?e.right:e.bottom,r=i?e.width:e.height;return n===l||s===a||n+o/2===l+r/2}(Ot.animated&&Ot.toRect||e,l.animated&&l.toRect||i,s),S=s?"top":"left",_=ht(l,"top","top")||ht(Ot,"top","top"),k=_?_.scrollTop:void 0;if(Jt!==l&&(v=i[S],le=!1,ae=!w&&a.invertSwap||x),f=function(t,e,i,n,s,o,l,a){var r=n?t.clientY:t.clientX,c=n?i.height:i.width,u=n?i.top:i.left,d=n?i.bottom:i.right,b=!1;if(!l)if(a&&ee<c*s){if(!le&&(1===te?r>u+c*o/2:r<d-c*o/2)&&(le=!0),le)b=!0;else if(1===te?r<u+ee:r>d-ee)return-te}else if(r>u+c*(1-s)/2&&r<d-c*(1-s)/2)return function(t){return gt(Ot)<gt(t)?1:-1}(e);if((b=b||l)&&(r<u+c*o/2||r>d-c*o/2))return r>u+c/2?1:-1;return 0}(t,l,i,s,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,ae,Jt===l),0!==f){var C=gt(Ot);do{C-=f,y=zt.children[C]}while(y&&("none"===rt(y,"display")||y===It))}if(0===f||y===l)return M(!1);Jt=l,te=f;var L=l.nextElementSibling,A=!1,E=_e(Rt,o,Ot,e,l,i,t,A=1===f);if(!1!==E)return 1!==E&&-1!==E||(A=1===E),ce=!0,setTimeout(Ce,30),T(),A&&!L?o.appendChild(Ot):l.parentNode.insertBefore(Ot,A?L:l),_&&wt(_,0,k-_.scrollTop),zt=Ot.parentNode,void 0===v||ae||(ee=Math.abs(v-bt(l)[S])),O(),M(!0)}if(o.contains(Ot))return M(!1)}return!1}function q(a,r){Tt(a,h,j({evt:t,isOwner:u,axis:s?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:d,fromSortable:b,target:l,completed:M,onMove:function(i,n){return _e(Rt,o,Ot,e,i,bt(i),t,n)},changed:O},r))}function T(){q("dragOverAnimationCapture"),h.captureAnimationState(),h!==b&&b.captureAnimationState()}function M(e){return q("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==b&&(at(Ot,Wt?Wt.options.ghostClass:c.options.ghostClass,!1),at(Ot,a.ghostClass,!0)),Wt!==h&&h!==Se.active?Wt=h:h===Se.active&&Wt&&(Wt=null),b===h&&(h._ignoreWhileAnimating=l),h.animateAll((function(){q("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(l===Ot&&!Ot.animated||l===o&&!l.animated)&&(Jt=null),a.dragoverBubble||t.rootEl||l===document||(Ot.parentNode[kt]._isOutsideThisEl(t.target),!e&&xe(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function O(){jt=gt(Ot),Ft=gt(Ot,a.draggable),Mt({sortable:h,name:"change",toEl:o,newIndex:jt,newDraggableIndex:Ft,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){et(document,"mousemove",this._onTouchMove),et(document,"touchmove",this._onTouchMove),et(document,"pointermove",this._onTouchMove),et(document,"dragover",xe),et(document,"mousemove",xe),et(document,"touchmove",xe)},_offUpEvents:function(){var t=this.el.ownerDocument;et(t,"mouseup",this._onDrop),et(t,"touchend",this._onDrop),et(t,"pointerup",this._onDrop),et(t,"touchcancel",this._onDrop),et(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;jt=gt(Ot),Ft=gt(Ot,i.draggable),Tt("drop",this,{evt:t}),zt=Ot&&Ot.parentNode,jt=gt(Ot),Ft=gt(Ot,i.draggable),Se.eventCanceled||(ne=!1,ae=!1,le=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ee(this.cloneId),Ee(this._dragStartId),this.nativeDraggable&&(et(document,"drop",this),et(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),K&&rt(document.body,"user-select",""),rt(Ot,"transform",""),t&&(Qt&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),It&&It.parentNode&&It.parentNode.removeChild(It),(Rt===zt||Wt&&"clone"!==Wt.lastPutMode)&&Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),Ot&&(this.nativeDraggable&&et(Ot,"dragend",this),ke(Ot),Ot.style["will-change"]="",Qt&&!ne&&at(Ot,Wt?Wt.options.ghostClass:this.options.ghostClass,!1),at(Ot,this.options.chosenClass,!1),Mt({sortable:this,name:"unchoose",toEl:zt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Rt!==zt?(jt>=0&&(Mt({rootEl:zt,name:"add",toEl:zt,fromEl:Rt,originalEvent:t}),Mt({sortable:this,name:"remove",toEl:zt,originalEvent:t}),Mt({rootEl:zt,name:"sort",toEl:zt,fromEl:Rt,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:zt,originalEvent:t})),Wt&&Wt.save()):jt!==Dt&&jt>=0&&(Mt({sortable:this,name:"update",toEl:zt,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:zt,originalEvent:t})),Se.active&&(null!=jt&&-1!==jt||(jt=Dt,Ft=Ht),Mt({sortable:this,name:"end",toEl:zt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Tt("nulling",this),Rt=Ot=zt=It=$t=Nt=Bt=Pt=Gt=Yt=Qt=jt=Ft=Dt=Ht=Jt=te=Wt=Ut=Se.dragged=Se.ghost=Se.clone=Se.active=null,ue.forEach((function(t){t.checked=!0})),ue.length=Xt=Vt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ot&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,s=i.length,o=this.options;n<s;n++)st(t=i[n],o.draggable,this.el,!1)&&e.push(t.getAttribute(o.dataIdAttr)||Le(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach((function(t,e){var s=n.children[e];st(s,this.options.draggable,n,!1)&&(i[t]=s)}),this),e&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return st(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=Et.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&fe(i)},destroy:function(){Tt("destroy",this);var t=this.el;t[kt]=null,et(t,"mousedown",this._onTapStart),et(t,"touchstart",this._onTapStart),et(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(et(t,"dragover",this),et(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),oe.splice(oe.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Pt){if(Tt("hideClone",this),Se.eventCanceled)return;rt(Nt,"display","none"),this.options.removeCloneOnHide&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),Pt=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Pt){if(Tt("showClone",this),Se.eventCanceled)return;Ot.parentNode!=Rt||this.options.group.revertClone?$t?Rt.insertBefore(Nt,$t):Rt.appendChild(Nt):Rt.insertBefore(Nt,Ot),this.options.group.revertClone&&this.animate(Ot,Nt),rt(Nt,"display",""),Pt=!1}}else this._hideClone()}},de&&tt(document,"touchmove",(function(t){(Se.active||ne)&&t.cancelable&&t.preventDefault()})),Se.utils={on:tt,off:et,css:rt,find:ut,is:function(t,e){return!!st(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:xt,closest:st,toggleClass:at,clone:St,index:gt,nextTick:Ae,cancelNextTick:Ee,detectDirection:ge,getChild:pt},Se.get=function(t){return t[kt]},Se.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Se.utils=j(j({},Se.utils),t.utils)),Et.mount(t)}))},Se.create=function(t,e){return new Se(t,e)},Se.version="1.15.2";var qe,Te,Me,Oe,ze,Ie,Re=[],$e=!1;function Be(){Re.forEach((function(t){clearInterval(t.pid)})),Re=[]}function Ne(){clearInterval(Ie)}var Pe=xt((function(t,e,i,n){if(e.scroll){var s,o=(t.touches?t.touches[0]:t).clientX,l=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,r=e.scrollSpeed,c=dt(),u=!1;Te!==i&&(Te=i,Be(),qe=e.scroll,s=e.scrollFn,!0===qe&&(qe=vt(i,!0)));var d=0,b=qe;do{var h=b,p=bt(h),m=p.top,g=p.bottom,f=p.left,v=p.right,y=p.width,x=p.height,w=void 0,S=void 0,_=h.scrollWidth,k=h.scrollHeight,C=rt(h),L=h.scrollLeft,A=h.scrollTop;h===c?(w=y<_&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),S=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(w=y<_&&("auto"===C.overflowX||"scroll"===C.overflowX),S=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY));var E=w&&(Math.abs(v-o)<=a&&L+y<_)-(Math.abs(f-o)<=a&&!!L),q=S&&(Math.abs(g-l)<=a&&A+x<k)-(Math.abs(m-l)<=a&&!!A);if(!Re[d])for(var T=0;T<=d;T++)Re[T]||(Re[T]={});Re[d].vx==E&&Re[d].vy==q&&Re[d].el===h||(Re[d].el=h,Re[d].vx=E,Re[d].vy=q,clearInterval(Re[d].pid),0==E&&0==q||(u=!0,Re[d].pid=setInterval(function(){n&&0===this.layer&&Se.active._onTouchMove(ze);var e=Re[this.layer].vy?Re[this.layer].vy*r:0,i=Re[this.layer].vx?Re[this.layer].vx*r:0;"function"==typeof s&&"continue"!==s.call(Se.dragged.parentNode[kt],i,e,t,ze,Re[this.layer].el)||wt(Re[this.layer].el,i,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&b!==c&&(b=vt(b,!1)));$e=u}}),30),De=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,s=t.activeSortable,o=t.dispatchSortableEvent,l=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var r=i||s;l();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);a(),r&&!r.el.contains(u)&&(o("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function je(){}function He(){}je.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=pt(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:De},U(je,{pluginName:"revertOnSpill"}),He.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:De},U(He,{pluginName:"removeOnSpill"}),Se.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?tt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?tt(document,"pointermove",this._handleFallbackAutoScroll):e.touches?tt(document,"touchmove",this._handleFallbackAutoScroll):tt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?et(document,"dragover",this._handleAutoScroll):(et(document,"pointermove",this._handleFallbackAutoScroll),et(document,"touchmove",this._handleFallbackAutoScroll),et(document,"mousemove",this._handleFallbackAutoScroll)),Ne(),Be(),clearTimeout(ot),ot=void 0},nulling:function(){ze=Te=qe=$e=Ie=Me=Oe=null,Re.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,o=document.elementFromPoint(n,s);if(ze=t,e||this.options.forceAutoScrollFallback||X||Y||K){Pe(t,this.options,o,e);var l=vt(o,!0);!$e||Ie&&n===Me&&s===Oe||(Ie&&Ne(),Ie=setInterval((function(){var o=vt(document.elementFromPoint(n,s),!0);o!==l&&(l=o,Be()),Pe(t,i.options,o,e)}),10),Me=n,Oe=s)}else{if(!this.options.bubbleScroll||vt(o,!0)===dt())return void Be();Pe(t,this.options,vt(o,!1),!1)}}},U(t,{pluginName:"scroll",initializeByDefault:!0})}),Se.mount(He,je);class Fe{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}loadLightboxFromCdn(t){const e="https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js";if(this.isJsOnContentIncluded(e))this.builder.doc.querySelector("#_skin")||this.builder.doc.body.insertAdjacentHTML("beforeend",`<style>${this.getLightboxCss()}</style>`),t&&t();else{const i=this.builder.doc.createElement("script");i.src=e,i.async=!0,i.onload=()=>{this.loadCssOnContent("https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css"),this.builder.doc.body.insertAdjacentHTML("beforeend",`<style id="_skin">${this.getLightboxCss()}</style>`),t&&t()},this.builder.doc.body.appendChild(i)}}loadLightboxScript(t){const e=this.builder.assetPath+"scripts/glightbox/glightbox.min.js";if(this.isJsOnContentIncluded(e))t&&t();else{const i=this.builder.doc.createElement("script");i.src=e,i.async=!0,i.onload=()=>{this.builder.GLightbox?(this.loadCssOnContent(this.builder.assetPath+"scripts/glightbox/glightbox.min.css"),this.loadCssOnContent(this.builder.assetPath+"scripts/glightbox/skin.css"),t&&t()):this.loadLightboxFromCdn(t)},this.builder.doc.body.appendChild(i),i.onerror=()=>{this.loadLightboxFromCdn(t)}}}refreshLightbox(t,e){this.builder.glightbox&&this.builder.GLightbox?(this.builder.glightbox.destroy(),this.builder.glightbox=this.builder.GLightbox(t),e&&e()):this.loadLightboxScript((()=>{this.builder.GLightbox=this.builder.win.GLightbox,this.builder.glightbox=this.builder.win.GLightbox(t),e&&e()}))}openLightbox(t,e){const i=this.builder.openMediaElm;if(this.builder.glightbox){if(this.builder.doc.body.classList.contains("glightbox-open")){this.builder.glightbox.close();let i=this.builder.doc.querySelector(".goverlay");return i&&i.click(),void setTimeout((()=>{this.openLightbox(t,e)}),400)}let n=[],s=0;if(i){const e=i.closest("[data-gallery]");let o=[];if(e)o=e.querySelectorAll(".is-lightbox"),o.forEach(((e,i)=>{let o=e.getAttribute("href");n.push({href:o}),t===o&&(s=i)}));else{this.builder.doc.querySelectorAll(".is-lightbox,.block-click").forEach((t=>{t.closest("[data-gallery]")||t.classList.contains("lightbox-all")||o.push(t)})),o.forEach(((e,i)=>{let o=e.getAttribute("href");o||(o=e.getAttribute("data-modal-url")),n.push({href:o}),t===o&&(s=i)}))}}n.length>0?(this.builder.glightbox.setElements(n),this.builder.glightbox.openAt(s)):(this.builder.glightbox.setElements([{href:t}]),this.builder.glightbox.open()),this.builder.glightbox.on("close",(()=>{this.builder.glightbox.setElements([]),this.refreshLightbox(e)}))}this.builder.openMediaElm=null}isJsOnContentIncluded(t){const e=this.builder.doc.getElementsByTagName("script");for(let i=0;i<e.length;i++)if(e[i].getAttribute("src")===t)return!0;return!1}loadCssOnContent(t){const e=this.builder.doc.createElement("link");e.href=t,e.rel="stylesheet",this.builder.doc.head.appendChild(e)}showMessage(t,e,i){const n=this.dom;let s="";s=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const o=this.builder.builderStuff;let l=o.querySelector(".modalmessage");l||(n.appendHtml(o,s),l=o.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i&&i()}));let a=l.querySelector(".modalmessage .input-ok");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode&&l.parentNode.removeChild(l),i&&i()})),a.focus(),e&&a.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let s="";s=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const o=this.builder.builderStuff;let l=o.querySelector(".modalmessage");l||(n.appendHtml(o,s),l=o.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i(!1)}));let a=l.querySelector(".modalmessage .input-cancel");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!1)})),a.focus();let r=l.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!0)}))}confirm(t,e,i,n,s){if(!this.builder.deleteConfirm&&!s)return void e(!0);const o=this.dom;let l="";l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(o.appendHtml(a,l),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");o.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let u=r.querySelector(".is-confirm .input-cancel");o.addEventListener(u,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()})),c&&c.focus()}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const s=e=>{t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",o),document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",s),this.builder.doc.removeEventListener("touchstart",s)))},o=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",o),document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",s),this.builder.doc.removeEventListener("touchstart",s)))};t.addEventListener("keydown",o),document.addEventListener("mousedown",s),document.addEventListener("touchstart",s,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.addEventListener("mousedown",s),this.builder.doc.addEventListener("touchstart",s,{passive:!1}))}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}showPopOverlay(t,e,i){const n=this.builder.builderStuff;let s=n.querySelectorAll(".is-pop-overlay");const o=this.makeId(),l=`<div class="is-pop-overlay ${o}" style="display:flex;z-index:10004"></div>`;n.insertAdjacentHTML("beforeend",l);const a=n.querySelector(`.is-pop-overlay.${o}`);0===s.length&&(t.classList.add("pop1"),a.classList.add("pop1")),1===s.length&&(t.classList.add("pop2"),a.classList.add("pop2")),2===s.length&&(t.classList.add("pop3"),a.classList.add("pop3")),4===s.length&&(t.classList.add("pop4"),a.classList.add("pop4"));const r=()=>{a.remove(),t.style.display="",t.classList.remove("active"),t.setAttribute("aria-hidden",!0),a.classList.remove("pop1"),a.classList.remove("pop2"),a.classList.remove("pop3"),a.classList.remove("pop4"),t.classList.remove("pop1"),t.classList.remove("pop2"),t.classList.remove("pop3"),t.classList.remove("pop4"),t.removeEventListener("keydown",c),e&&e(),i&&i.focus()};this.hidePopOverlay=r;const c=t=>{27===t.keyCode&&r()};a.addEventListener("click",(t=>{r(),t.preventDefault(),t.stopImmediatePropagation()})),t.style.display="flex",t.classList.add("active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),t.addEventListener("keydown",c)}showPop(t,e,i,n){const s=this.dom;document.querySelectorAll(".is-pop.active").forEach((e=>{let n=!0;e.contains(i)&&(n=!1),e!==t&&n&&(e.style.display="",s.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),n?this.showPopOverlay(t,e,i):(this.clearAllEventListener(t),t.style.display="flex",s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e(),i&&i.focus())},this.handlePopKeyDown=n=>{27===n.keyCode&&(this.hidePop(t),e&&e(),i&&i.focus())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("mousedown",this.handlePopClickOut),document.addEventListener("touchstart",this.handlePopClickOut,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.addEventListener("mousedown",this.handlePopClickOut),this.builder.doc.addEventListener("touchstart",this.handlePopClickOut,{passive:!1})))}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("mousedown",this.handlePopClickOut),document.removeEventListener("touchstart",this.handlePopClickOut,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",this.handlePopClickOut),this.builder.doc.removeEventListener("touchstart",this.handlePopClickOut,{passive:!1}))}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,s){const o=this.dom;o.addClass(t,"active"),t.setAttribute("aria-hidden",!1),s&&(document.body.style.overflow="hidden");const l=e=>{if(27===e.keyCode){s&&(document.body.style.overflow=""),o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}};t.addEventListener("keydown",l);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");o.addEventListener(e,"click",(()=>{s&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}))}}const u=()=>{s&&(document.body.style.overflow=""),o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()},d=t.querySelector(".is-modal-close");d&&o.addEventListener(d,"click",u)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let s=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(s,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o)),e.contentEditable=!0),o++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let s=3;t.querySelector(".is-row-overlay")&&(s=4);const o=t.childElementCount-s,l=this.builder.opts.row;let a=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=a.length-1;i++)e.removeClass(t,a[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===o){e.addClass(t,r[i][0]);break}1===o&&e.addClass(t,a[a.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==l&&a.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?a=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?a=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?a=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?a=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(a=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=a.length-1;n++)e.removeClass(t,a[n]);1===o&&e.addClass(t,a[11]),2===o&&e.addClass(t,a[5]),3===o&&e.addClass(t,a[3]),4===o&&e.addClass(t,a[2]),5===o&&(5===i?e.addClass(t,a[3]):e.addClass(t,a[1])),6===o&&e.addClass(t,a[1]),7===o&&(i>=6?e.addClass(t,a[0]):e.addClass(t,a[1])),8===o&&(i>=5?e.addClass(t,a[0]):e.addClass(t,a[1])),9===o&&(i>=4?e.addClass(t,a[0]):e.addClass(t,a[1])),10===o&&(i>=3?e.addClass(t,a[0]):e.addClass(t,a[1])),11===o&&(i>=2?e.addClass(t,a[0]):e.addClass(t,a[1])),12===o&&e.addClass(t,a[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const s=this.cellSelected();let o;if(s)o=s.parentNode;else{let t=this.builder.activeElement;if(t&&t.closest(".is-block"));else{if(o=this.builder.doc.querySelector(".row-active"),!o)return;e="row"}}if("cell"===e||"cell-left"===e||"cell-right"===e){let l=4;this.builder.maxColumns&&(l=this.builder.maxColumns);let a,r=3;if(o.querySelector(".is-row-overlay")&&(r=4),o.childElementCount>=l+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),a=this.createElementFromHTML(t)}else{a=s.cloneNode(!0),a.removeAttribute("data-noedit"),a.removeAttribute("data-protected"),a.removeAttribute("data-module"),a.removeAttribute("data-module-desc"),a.removeAttribute("data-dialog-width"),a.removeAttribute("data-html"),a.removeAttribute("data-settings");for(let t=1;t<=20;t++)a.removeAttribute("data-html-"+t);a.removeAttribute("data-noedit"),n.removeClass(a,"cell-active"),n.removeClass(a,"is-light-text"),n.removeClass(a,"is-dark-text"),n.removeClass(a,"padding-0"),n.removeClass(a,"p-0"),a.removeAttribute("data-click"),a.removeAttribute("style"),i&&a.setAttribute(i,""),a.innerHTML=t}o.insertBefore(a,s),"cell"!==e&&"cell-right"!==e||n.moveAfter(a,s);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(o),a.click()}if("row"===e){let e,s;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let o=this.builder.opts.cellFormat,l=o.indexOf("</");t=o.substring(0,l)+t+o.substring(l);let a=n.elementChildren(e);for(;a.length>0&&(a=a[0],n.elementChildren(a).length>0);)a=n.elementChildren(a);a.innerHTML=t,s=a.firstChild,i&&s.setAttribute(i,"")}else s=n.createElement("div"),n.addClass(s,this.builder.opts.cols[this.builder.opts.cols.length-1]),s.innerHTML=t,i&&s.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,s);o.parentNode.insertBefore(e,o),n.moveAfter(e,o);let l=this.builder.doc.querySelector(".builder-active");l&&this.builder.applyBehaviorOn(l),s.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i,s=e;if(s.nextElementSibling||s.closest("[data-subblock]"))s.insertAdjacentHTML("afterend",t),i=s.nextElementSibling;else{let e,o=this.builder.activeCol;n.elementChildren(o).forEach((t=>{t.contains(s)&&(e=t)})),e&&(e.insertAdjacentHTML("afterend",t),i=e.nextElementSibling)}let o=this.builder.doc.querySelector(".builder-active");if(o&&this.builder.applyBehaviorOn(o),"img"===i.tagName.toLowerCase()){let t=setInterval((()=>{i.complete&&(i.click(),clearInterval(t))}),30)}else i.click();let l=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(l)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let s,o,l,a=!1;let r,c=this.builder.builderStuff.querySelector(".quickadd");if(r=c?c.getAttribute("data-mode"):"row",!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(l=document.createElement("div"),l.className=this.builder.opts.cols[this.builder.opts.cols.length-1],l.innerHTML=t,i&&l.setAttribute("data-noedit",""),s=document.createElement("div"),s.className=this.builder.opts.row,s.appendChild(l),o=this.builder.cellSelected(),o?e=o.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],s=n.elementChildren(i);e=s[s.length-1]}e.parentNode.insertBefore(s,e),n.moveAfter(s,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),l.click(),s.className=s.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var u=document.createElement("div");u.innerHTML=t;var d=u.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t,e.classList.add("dummy-module")})),1===u.childNodes.length&&1===u.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=u.childNodes[0].childNodes[0];var b=document.createRange();t.parentNode.insertBefore(b.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let s=this.builder.doc.querySelector(".builder-active");return s||(s=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(s),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(o=this.builder.activeCol,o?e=o.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],s=n.elementChildren(i);e=s[s.length-1]}b=document.createRange(),e.parentNode.insertBefore(b.createContextualFragment(u.innerHTML),e.nextSibling),s=u.childNodes[0],s=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),l=s.querySelector("div"),l&&l.click();this.builder.doc.querySelectorAll(".dummy-module").forEach((t=>{t.querySelectorAll(".grid-sortable").forEach((t=>{new Se(t,{animation:600,dragClass:"hide-drag-class",onStart:()=>{this.builder.uo.saveForUndo(!0)},onSort:()=>{if(t.closest("[data-html]")){const e=t.closest("[data-html]"),i=encodeURIComponent(e.innerHTML);e.setAttribute("data-html",i),this.builder.opts.onChange()}}})}))})),this.builder.doc.querySelectorAll(".dummy-module").forEach((t=>{t.classList.remove("dummy-module")})),s.className=s.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){if(!this.builder.builderStuff)return;let t=this.builder.doc.getElementsByClassName("cell-active");for(;t.length;)t[0].classList.remove("cell-active");for(t=this.builder.doc.getElementsByClassName("row-outline");t.length;)t[0].classList.remove("row-outline");for(t=this.builder.doc.getElementsByClassName("row-active");t.length;)t[0].classList.remove("row-active");for(t=this.builder.doc.getElementsByClassName("builder-active");t.length;)t[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");if(n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null,!this.builder.controlPanel){let i=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")})),i=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")}))}let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const s=document.querySelector(".moveable-control-box"),o=document.querySelector("#divImageResizer");s&&o&&!o.getAttribute("data-resizing")&&(s.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const i=document.querySelector(".moveable-control-box");i&&(i.style.display="none")}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff;this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let n=this.builder.doc.querySelectorAll(".elm-inspected");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-inspected")})),this.builder.inspectedElement=null,n=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-active")})),this.builder.activeElement=null,this.builder.doc.querySelector(".is-element-tool").style.display="";let s=this.builder.doc.querySelector("#divLinkTool");if(s&&(s.style.display=""),t&&!this.builder.controlPanel){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let s=i.querySelector(".elementrte-more-options");s&&(s.style.display="");let o=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(o,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none");let s=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(s,(t=>{t.style.display="block"}));let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let s=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(s,(t=>{t.style.display="block"}));var o=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"active")}));let l=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(l,(t=>{t.removeAttribute("data-saveforundo")})),l=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-inspected")})),!this.builder.controlPanel&&"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let s=e.querySelector(".elementrte-more-options");s&&(s.style.display="")}if(l=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-active")})),!this.builder.controlPanel){let i=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}))}let a=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(a,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let s=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)s.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),s=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(s,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let o,l=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<l.length;t++)i=new RegExp("<"+l[t]+".*?"+l[t]+"(.*?)>","gi"),n=n.replace(i,"");o=e?["style","start"]:["start"];for(let t=0;t<o.length;t++){let e=new RegExp(" "+o[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");const s=P(this.builder);s.querySelector(".is-pop-tabs").style.display="none";const o=window.innerHeight,l=this.getElementPosition(i);let a=l.top,r=l.left,c=l.scaleX,u=l.scaleY;r+=i.offsetWidth*(c*this.builder.opts.zoom)/2-11,a-=i.offsetHeight-i.offsetHeight*u,s.style.display="flex",this.showPop(s,!1,i);const d=s.offsetWidth,b=s.offsetHeight;o-a>b?(a=a+i.offsetHeight*this.builder.opts.zoom-19,s.style.top=a+window.pageYOffset+27+"px",s.style.left=r-d/2+7+"px",e.removeClass(s,"arrow-bottom"),e.removeClass(s,"arrow-right"),e.removeClass(s,"arrow-left"),e.removeClass(s,"center"),e.addClass(s,"arrow-top"),e.addClass(s,"center")):(s.style.top=a+window.pageYOffset-b-8+"px",s.style.left=r-d/2+7+"px",e.removeClass(s,"arrow-top"),e.removeClass(s,"arrow-right"),e.removeClass(s,"arrow-left"),e.removeClass(s,"center"),e.addClass(s,"arrow-bottom"),e.addClass(s,"center")),s.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_pagesize"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.dom.getElm().closest(".is-container"))if(this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var s=this.builder.doc.createElement("div");s.innerHTML=t;for(var o,l,a=this.builder.doc.createDocumentFragment();o=s.firstChild;)l=a.appendChild(o);var r=a.firstChild;n.insertNode(a),l&&((n=n.cloneRange()).setStartAfter(l),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var s=document.createRange();s.setStart(t,0),t.appendChild(s.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o))),o++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,s=e.left;i.style.top=n+35+"px",i.style.left=s-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),s=(n>>16)+e;s>255?s=255:s<0&&(s=0);var o=(n>>8&255)+e;o>255?o=255:o<0&&(o=0);var l=(255&n)+e;return l>255?l=255:l<0&&(l=0),(i?"#":"")+String("000000"+(l|o<<8|s<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" id="__style_helper_input" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" id="__style_helper_select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-select"),n=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(i,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(i.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(n,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let s=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),s}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,s,o;if(this.builder.iframe){let l=document.querySelector(".is-content-view");l||(l=e.parentNode);const a=window.getComputedStyle(l).transform;if("none"!==a){const t=a.match(/matrix\(([0-9., -]+)\)/)[1].split(",");s=parseFloat(t[0]),o=parseFloat(t[3])}else s=1,o=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*o+r.top,n=t.getBoundingClientRect().left*s+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,s=1,o=1;return{top:i,left:n,scaleX:s,scaleY:o}}getLightboxCss(){return"\n /* Light */\n .glightbox-light .gslide-description {\n background: #fff;\n }\n \n .glightbox-light .gdesc-inner {\n padding: 22px 20px;\n }\n \n .glightbox-light .gslide-title {\n font-size: 1em;\n font-weight: normal;\n font-family: arial;\n color: #000;\n margin-bottom: 19px;\n line-height: 1.4em;\n }\n \n .glightbox-light .gslide-desc {\n font-size: 0.86em;\n margin-bottom: 0;\n font-family: arial;\n line-height: 1.4em;\n }\n \n .glightbox-light .gslide-video {\n background: #000;\n }\n \n .glightbox-light .gprev,\n .glightbox-light .gnext,\n .glightbox-light .gclose {\n background-color: rgb(255 255 255 / 0%);\n border-radius: 4px;\n }\n \n .glightbox-light .gprev path,\n .glightbox-light .gnext path,\n .glightbox-light .gclose path {\n fill: #000;\n }\n \n .glightbox-light .gprev {\n position: absolute;\n top: -100%;\n left: 30px;\n width: 40px;\n height: 50px;\n }\n \n .glightbox-light .gnext {\n position: absolute;\n top: -100%;\n right: 30px;\n width: 40px;\n height: 50px;\n }\n \n .glightbox-light .gclose {\n width: 35px;\n height: 35px;\n top: 15px;\n right: 10px;\n position: absolute;\n }\n \n .glightbox-light .gclose svg {\n width: 18px;\n height: auto;\n }\n \n .glightbox-light .gclose:hover {\n opacity: 1;\n }\n \n /**/\n .glightbox-light .gslide-media {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n }\n .glightbox-light .description-left .gdesc-inner,\n .glightbox-light .description-right .gdesc-inner {\n position: absolute;\n height: 100%;\n overflow-y: auto;\n }\n .glightbox-light .gprev,\n .glightbox-light .gnext,\n .glightbox-light .gclose {\n background-color: rgb(255 255 255 / 0%);\n }\n .glightbox-light .gprev:hover,\n .glightbox-light .gnext:hover,\n .glightbox-light .gclose:hover {\n background-color: rgb(255 255 255 / 0%);\n }\n .glightbox-light .gprev {\n top: 45%;\n }\n .glightbox-light .gnext {\n top: 45%;\n }\n \n @media (min-width: 992px) {\n .glightbox-light .gclose {\n opacity: 0.7;\n right: 20px;\n }\n }\n \n /**/\n .glightbox-light .goverlay {\n background: rgb(255 255 255 / 100%) !important;\n }\n @media screen and (max-height: 420px) {\n .goverlay {\n background: rgb(255 255 255 / 100%);\n }\n }\n \n /* override (light) */\n .glightbox-light .gprev,\n .glightbox-light .gnext {\n width: 55px !important;\n height: 70px !important;\n }\n .gclose svg, .gnext svg, .gprev svg {\n width: 50px !important;\n }\n .glightbox-light .gclose {\n width: 55px !important;\n height: 55px !important;\n }\n .glightbox-light .gclose svg {\n width: 30px !important;\n }\n .glightbox-light .gslide-title {\n font-size: 1.2em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n }\n .glightbox-light .gslide-desc {\n font-size: 1em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n } \n \n /* override (clean) */\n .glightbox-clean .gprev,\n .glightbox-clean .gnext {\n width: 55px !important;\n height: 70px !important;\n }\n .gclose svg, .gnext svg, .gprev svg {\n width: 50px !important;\n }\n .glightbox-clean .gclose {\n width: 55px !important;\n height: 55px !important;\n }\n .glightbox-clean .gclose svg {\n width: 30px !important;\n }\n .glightbox-clean .gslide-title {\n font-size: 1.2em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n }\n .glightbox-clean .gslide-desc {\n font-size: 1em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n } \n \n /* other override */\n .gclose.disabled, .gnext.disabled, .gprev.disabled {\n opacity: 0;\n } \n "}}class Ue{constructor(t){this.builder=t}detectMobileOrTablet(){const t=navigator.userAgent.toLowerCase(),e=/ipad|iphone|ipod/.test(t)&&!window.MSStream,i=/android/.test(t),n="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,s=window.innerWidth<=1600;return!(!e&&!i)||!(!n||!s)}getScale(t){let e=window.getComputedStyle(t).transform;if("none"===e)return 1;let i=e.split("(")[1];i=i.split(")")[0],i=i.split(",");let n=i[0],s=i[1];return Math.sqrt(n*n+s*s)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,s,o,l=e.split(" ");for(i=0,s=l.length;i<s;++i)if(l[i])try{let e=l[i],s="",a=t.className.split(" ");for(n=0,o=a.length;n<o;++n)a[n]&&a[n]!==e&&(s+=a[n]+" ");t.className=s.trim()}catch(t){}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let s=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(s,e)){let o=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,{get:function(){return o.get.apply(this,arguments)},set:function(){let t=this[e];o.set.apply(this,arguments);let s=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,s),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),s=this.getElm();if(!s)return void(i&&i(!1));let o;o=s&&s.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,s):this.replaceSelection(t,e,n,s),i&&i(!0,o)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const s=i.getRangeAt(0),o=s.extractContents(),l=this.createSpan(n,t,e);return l.appendChild(o),this.cleanChildren(t,l),this.cleanUnusedSpan(l),s.insertNode(l),i.selectAllChildren(l),this.checkStyleIfSameAsParent(l,t),l}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,s=this.findParentStyle(t,e);if(s&&(n=s.style[e]),i===n){t.style[e]="";let s=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=s}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const s=this.getSelectedBlocks();if(s.length>0)s.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const s=this.builder.win.getSelection();let o=this.getElm();if(!o)return;const l=o&&o.innerText===s.toString().trim();(i||l||""===s.toString().trim())&&("block"===n&&"inline"===this.getStyle(o,"display")&&(o=this.getParentBlock(o)),this.updateSelectionClass(t,e,o))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const s=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)s(e.childNodes[t])};s(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const s=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th","li"];return i.forEach((e=>{const i=e.tagName.toLowerCase();s.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),s=this.getElm();if(!s)return;s&&s.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,s):this.replaceSelectionToggle(t,e,i,n,s)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,s){const o=n.getRangeAt(0),l=o.extractContents(),a=document.createElement("span");if("fontWeight"===t){let t=!1;s.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(s,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(s,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(a,i.fontWeight.defaultNormal):this.addClass(a,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;s.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(s,i.fontStyle.normal)&&(t=!1)),t?this.addClass(a,i.fontStyle.normal):this.addClass(a,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;s.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(a,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;s.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(a,i.textDecoration.linethrough)}if("textTransform"===t){let t="";s.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(a,i.textTransform.uppercase),this.removeClass(a,i.textTransform.lowercase),this.removeClass(a,i.textTransform.capitalize),this.removeClass(a,i.textTransform.normal),""===t&&this.addClass(a,i.textTransform.uppercase)}if("extend"===t){let t=!1;s.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(a,i.extend[e])}return a.appendChild(l),this.cleanChildrenToggle(t,e,a,i),this.cleanUnusedSpan(a),o.insertNode(a),n.selectAllChildren(a),a}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const s=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));s&&s.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let s=Array.prototype.filter.call(n,(t=>0===t.attributes.length));s&&s.length>0&&s.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}countOccurrences(t,e){const i=new RegExp(e,"gi"),n=t.match(i);return n?n.length:0}}var We="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ge={exports:{}},Ye={},Xe={exports:{}},Ve={},Ke={};function Ze(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function Qe(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function Je(t,e){this.__indent_cache=new Qe(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Ze(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Ze.prototype.clone_empty=function(){var t=new Ze(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},Ze.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},Ze.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},Ze.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},Ze.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},Ze.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},Ze.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},Ze.prototype.is_empty=function(){return 0===this.__items.length},Ze.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},Ze.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},Ze.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},Ze.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},Ze.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},Ze.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},Ze.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},Qe.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},Qe.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},Qe.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},Qe.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},Je.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},Je.prototype.get_line_number=function(){return this.__lines.length},Je.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},Je.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},Je.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},Je.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},Je.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},Je.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},Je.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},Je.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},Je.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},Je.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},Je.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},Je.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},Je.prototype.just_added_newline=function(){return this.current_line.is_empty()},Je.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},Je.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new Ze(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},Ke.Output=Je;var ti={};ti.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var ei,ii,ni,si,oi,li={};ii="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",si="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",oi="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(ni="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(ei=li).identifier=new RegExp(oi+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),ei.identifierStart=new RegExp(oi),ei.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+ii+ni+si+"])+"),ei.newline=/[\n\r\u2028\u2029]/,ei.lineBreak=new RegExp("\r\n|"+ei.newline.source),ei.allLineBreaks=new RegExp(ei.lineBreak.source,"g");var ai={},ri={};function ci(t,e){this.raw_options=ui(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function ui(t,e){var i,n={};for(i in t=di(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function di(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}ci.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},ci.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},ci.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},ci.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},ci.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},ci.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},ci.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},ri.Options=ci,ri.normalizeOpts=di,ri.mergeOpts=ui;var bi=ri.Options,hi=["before-newline","after-newline","preserve-newline"];function pi(t){bi.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",hi),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}pi.prototype=new bi,ai.Options=pi;var mi={},gi={},fi=RegExp.prototype.hasOwnProperty("sticky");function vi(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}vi.prototype.restart=function(){this.__position=0},vi.prototype.back=function(){this.__position>0&&(this.__position-=1)},vi.prototype.hasNext=function(){return this.__position<this.__input_length},vi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},vi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},vi.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||fi&&t.sticky||i.index!==e&&(i=null),i},vi.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},vi.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},vi.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},vi.prototype.read=function(t,e,i){var n,s="";return t&&(n=this.match(t))&&(s+=n[0]),!e||!n&&t||(s+=this.readUntil(e,i)),s},vi.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var s=t.exec(this.__input);return s?(n=s.index,e&&(n+=s[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},vi.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},vi.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&fi&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},vi.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},vi.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},vi.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},gi.InputScanner=vi;var yi={},xi={};function wi(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}wi.prototype.restart=function(){this.__position=0},wi.prototype.isEmpty=function(){return 0===this.__tokens_length},wi.prototype.hasNext=function(){return this.__position<this.__tokens_length},wi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},wi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},wi.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},xi.TokenStream=wi;var Si={},_i={};function ki(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}ki.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},ki.prototype.read_match=function(){return this._input.match(this._match_pattern)},ki.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},ki.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},ki.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},ki.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},ki.prototype._create=function(){return new ki(this._input,this)},ki.prototype._update=function(){},_i.Pattern=ki;var Ci=_i.Pattern;function Li(t,e){Ci.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Li.prototype=new Ci,Li.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},Li.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},Li.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},Li.prototype._create=function(){return new Li(this._input,this)},Li.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],s=t.exec(e);s;)n.push(e.substring(i,s.index)),i=s.index+s[0].length,s=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},Si.WhitespacePattern=Li;var Ai=gi.InputScanner,Ei=ti.Token,qi=xi.TokenStream,Ti=Si.WhitespacePattern,Mi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Oi=function(t,e){this._input=new Ai(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Ti(this._input)};Oi.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new qi,this._reset();for(var e=new Ei(Mi.START,""),i=null,n=[],s=new qi;e.type!==Mi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)s.add(t),t=this._get_next_token(e,i);s.isEmpty()||(t.comments_before=s,s=new qi),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Oi.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Oi.prototype._reset=function(){},Oi.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(Mi.RAW,i):this._create_token(Mi.EOF,"")},Oi.prototype._is_comment=function(t){return!1},Oi.prototype._is_opening=function(t){return!1},Oi.prototype._is_closing=function(t,e){return!1},Oi.prototype._create_token=function(t,e){return new Ei(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Oi.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},yi.Tokenizer=Oi,yi.TOKEN=Mi;var zi={};function Ii(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Ii.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Ii.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},zi.Directives=Ii;var Ri={},$i=_i.Pattern,Bi={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Ni(t,e){$i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Bi),this._excluded=Object.assign({},Bi),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new $i(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Ni.prototype=new $i,Ni.prototype._create=function(){return new Ni(this._input,this)},Ni.prototype._update=function(){this.__set_templated_pattern()},Ni.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Ni.prototype.read_options=function(t){var e=this._create();for(var i in Bi)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Ni.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Ni.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Ni.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Ni.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ri.TemplatablePattern=Ni;var Pi=gi.InputScanner,Di=yi.Tokenizer,ji=yi.TOKEN,Hi=zi.Directives,Fi=li,Ui=_i.Pattern,Wi=Ri.TemplatablePattern;function Gi(t,e){return-1!==e.indexOf(t)}var Yi={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:ji.START,RAW:ji.RAW,EOF:ji.EOF},Xi=new Hi(/\/\*/,/\*\//),Vi=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,Ki=/[0-9]/,Zi=/[^\d\.]/,Qi=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Ji=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Ji=(Ji="\\?\\.(?!\\d) "+(Ji=Ji.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var tn,en=new RegExp(Ji),nn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),sn=nn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),on=new RegExp("^(?:"+sn.join("|")+")$"),ln=function(t,e){Di.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new Ui(this._input),n=new Wi(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Fi.identifier).matching(Fi.identifierMatch),number:i.matching(Vi),punct:i.matching(en),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Fi.lineBreak),shebang:i.starting_with(/#!/).until_after(Fi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(ln.prototype=new Di)._is_comment=function(t){return t.type===Yi.COMMENT||t.type===Yi.BLOCK_COMMENT||t.type===Yi.UNKNOWN},ln.prototype._is_opening=function(t){return t.type===Yi.START_BLOCK||t.type===Yi.START_EXPR},ln.prototype._is_closing=function(t,e){return(t.type===Yi.END_BLOCK||t.type===Yi.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},ln.prototype._reset=function(){tn=!1},ln.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Yi.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(Yi.UNKNOWN,this._input.next())},ln.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Fi.allLineBreaks,"\n"),t.type!==Yi.DOT&&(t.type!==Yi.RESERVED||"set"!==t.text&&"get"!==t.text)&&on.test(e)?"in"===e||"of"===e?this._create_token(Yi.OPERATOR,e):this._create_token(Yi.RESERVED,e):this._create_token(Yi.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(Yi.WORD,e):void 0},ln.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(Yi.START_EXPR,t):")"===t||"]"===t?e=this._create_token(Yi.END_EXPR,t):"{"===t?e=this._create_token(Yi.START_BLOCK,t):"}"===t?e=this._create_token(Yi.END_BLOCK,t):";"===t?e=this._create_token(Yi.SEMICOLON,t):"."===t&&Zi.test(this._input.peek(1))?e=this._create_token(Yi.DOT,t):","===t&&(e=this._create_token(Yi.COMMA,t)),e&&this._input.next(),e},ln.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(Yi.EQUALS,t):"?."===t?this._create_token(Yi.DOT,t):this._create_token(Yi.OPERATOR,t)},ln.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(Yi.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(Yi.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(Ki)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(Yi.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Fi.newline);)e+=this._input.next();return tn=!0,this._create_token(Yi.COMMENT,e)}}else if(tn&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return tn=!1,this._create_token(Yi.COMMENT,e);return null},ln.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=Xi.get_directives(i);n&&"start"===n.ignore&&(i+=Xi.readIgnored(this._input)),i=i.replace(Fi.allLineBreaks,"\n"),(e=this._create_token(Yi.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(Yi.COMMENT,i))}return e},ln.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Pi(t),s=null;for(;n.hasNext();)if((s=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=s[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())s=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}s=n.match(/u([0-9A-Fa-f]{4})/g)}if(!s)return t;if((i=parseInt(s[1],16))>126&&i<=255&&0===s[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+s[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Fi.allLineBreaks,"\n"),this._create_token(Yi.STRING,e)}return null},ln.prototype._allow_regexp_or_xml=function(t){return t.type===Yi.RESERVED&&Gi(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Yi.END_EXPR&&")"===t.text&&t.opened.previous.type===Yi.RESERVED&&Gi(t.opened.previous.text,["if","while","for"])||Gi(t.type,[Yi.COMMENT,Yi.START_EXPR,Yi.START_BLOCK,Yi.START,Yi.END_BLOCK,Yi.OPERATOR,Yi.EQUALS,Yi.EOF,Yi.SEMICOLON,Yi.COMMA])},ln.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,s=!1;this._input.hasNext()&&(n||s||this._input.peek()!==t)&&!this._input.testChar(Fi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?s=!0:"]"===this._input.peek()&&(s=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Fi.identifier)),this._create_token(Yi.STRING,i)}return null},ln.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var s=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===s.indexOf("{"),l=0;n;){var a=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===s||o&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--l:++l),i+=n[0],l<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Fi.allLineBreaks,"\n"),this._create_token(Yi.STRING,i)}}return null},ln.prototype._read_string_recursive=function(t,e,i){var n,s;"'"===t?s=this.__patterns.single_quote:'"'===t?s=this.__patterns.double_quote:"`"===t?s=this.__patterns.template_text:"}"===t&&(s=this.__patterns.template_expression);for(var o=s.read(),l="";this._input.hasNext();){if((l=this._input.next())===t||!e&&Fi.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):i&&("${"===i&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),i===l&&(l+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=s.read()}return o},mi.Tokenizer=ln,mi.TOKEN=Yi,mi.positionable_operators=Qi.slice(),mi.line_starters=nn.slice();var an=Ke.Output,rn=ti.Token,cn=li,un=ai.Options,dn=mi.Tokenizer,bn=mi.line_starters,hn=mi.positionable_operators,pn=mi.TOKEN;function mn(t,e){return-1!==e.indexOf(t)}function gn(t,e){return t&&t.type===pn.RESERVED&&t.text===e}function fn(t,e){return t&&t.type===pn.RESERVED&&mn(t.text,e)}var vn=["case","return","do","if","throw","else","await","break","continue","async"],yn=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),xn=[yn.before_newline,yn.preserve_newline],wn="BlockStatement",Sn="Statement",_n="ObjectLiteral",kn="ArrayLiteral",Cn="ForInitializer",Ln="Conditional",An="Expression";function En(t,e){e.multiline_frame||e.mode===Cn||e.mode===Ln||t.remove_indent(e.start_line_index)}function qn(t){return t===kn}function Tn(t){return mn(t,[An,Cn,Ln])}function Mn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new un(e)}Mn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new rn(pn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Mn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new an(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(wn);var i=new dn(t,this._options);return this._tokens=i.tokenize(),t},Mn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&cn.lineBreak.test(t||"")&&(e=t.match(cn.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Mn.prototype.handle_token=function(t,e){t.type===pn.START_EXPR?this.handle_start_expr(t):t.type===pn.END_EXPR?this.handle_end_expr(t):t.type===pn.START_BLOCK?this.handle_start_block(t):t.type===pn.END_BLOCK?this.handle_end_block(t):t.type===pn.WORD||t.type===pn.RESERVED?this.handle_word(t):t.type===pn.SEMICOLON?this.handle_semicolon(t):t.type===pn.STRING?this.handle_string(t):t.type===pn.EQUALS?this.handle_equals(t):t.type===pn.OPERATOR?this.handle_operator(t):t.type===pn.COMMA?this.handle_comma(t):t.type===pn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===pn.COMMENT?this.handle_comment(t,e):t.type===pn.DOT?this.handle_dot(t):t.type===pn.EOF?this.handle_eof(t):(t.type,pn.UNKNOWN,this.handle_unknown(t,e))},Mn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&qn(this._flags.mode);if(t.comments_before)for(var s=t.comments_before.next();s;)this.handle_whitespace_and_comments(s,e),this.handle_token(s,e),s=t.comments_before.next();if(n)for(var o=0;o<i;o+=1)this.print_newline(o>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var l=1;l<i;l+=1)this.print_newline(!0,e)}};var On=["async","break","continue","return","throw","yield"];Mn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(mn(this._flags.last_token.text,hn)||mn(t.text,hn)){var n=mn(this._flags.last_token.text,hn)&&mn(this._options.operator_position,xn)||mn(t.text,hn);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(fn(this._flags.last_token,On))return;this._output.set_wrap_point()}}},Mn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==pn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==Sn||this._flags.if_block&&gn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Mn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||qn(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Mn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===pn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Mn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Mn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Mn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Mn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Sn&&En(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Mn.prototype.start_of_object_property=function(){return this._flags.parent.mode===_n&&this._flags.mode===Sn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||fn(this._flags.last_token,["get","set"]))},Mn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||fn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD)||gn(this._flags.last_token,"do"))||!(this._flags.parent.mode===_n&&this._flags.mode===Sn)&&fn(this._flags.last_token,On)&&!t.newlines)||gn(this._flags.last_token,"else")&&!(gn(t,"if")&&!t.comments_before))||this._flags.last_token.type===pn.END_EXPR&&(this._previous_flags.mode===Cn||this._previous_flags.mode===Ln))||this._flags.last_token.type===pn.WORD&&this._flags.mode===wn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==pn.WORD&&t.type!==pn.RESERVED)||this._flags.mode===_n&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||fn(this._flags.last_token,["get","set"])))&&(this.set_mode(Sn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,fn(t,["do","for","if","while"])),!0)},Mn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=An;if("["===t.text){if(this._flags.last_token.type===pn.WORD||")"===this._flags.last_token.text)return fn(this._flags.last_token,bn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=kn,qn(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),mn(this._flags.last_token.type,[pn.START_EXPR,pn.END_EXPR,pn.WORD,pn.OPERATOR,pn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===pn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Cn):mn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ln):mn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(mn(this._flags.last_token.text,bn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===pn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);fn(i,["async","function"])||"*"===i.text&&fn(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_n&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===pn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(mn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&mn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===pn.START_BLOCK?this.print_newline():this._flags.last_token.type!==pn.END_EXPR&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==pn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Mn.prototype.handle_end_expr=function(t){for(;this._flags.mode===Sn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&qn(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==pn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),En(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ln&&(this._previous_flags.mode=An,this._flags.do_block=!1,this._flags.do_while=!1)},Mn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR?(this.set_mode(wn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(wn):i&&(mn(i.text,[":",","])&&mn(e.type,[pn.STRING,pn.WORD,pn.RESERVED])||mn(e.text,["get","set","..."])&&mn(i.type,[pn.WORD,pn.RESERVED]))?mn(this._last_last_text,["class","interface"])?this.set_mode(wn):this.set_mode(_n):this._flags.last_token.type===pn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(wn):mn(this._flags.last_token.type,[pn.EQUALS,pn.START_EXPR,pn.COMMA,pn.OPERATOR])||fn(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_n):this.set_mode(wn);var n=!e.comments_before&&"}"===e.text,s=n&&"function"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR;if(this._options.brace_preserve_inline){var o=0,l=null;this._flags.inline_frame=!0;do{if(o+=1,(l=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(l.type!==pn.EOF&&(l.type!==pn.END_BLOCK||l.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==pn.OPERATOR&&(s||this._flags.last_token.type===pn.EQUALS||fn(this._flags.last_token,vn)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!qn(this._previous_flags.mode)||this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.COMMA||((this._flags.last_token.type===pn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==pn.OPERATOR&&this._flags.last_token.type!==pn.START_EXPR&&(this._flags.last_token.type!==pn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Mn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Sn;)this.restore_mode();var e=this._flags.last_token.type===pn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(qn(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Mn.prototype.handle_word=function(t){if(t.type===pn.RESERVED)if(mn(t.text,["set","get"])&&this._flags.mode!==_n)t.type=pn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=pn.WORD;else if(mn(t.text,["as","from"])&&!this._flags.import_block)t.type=pn.WORD;else if(this._flags.mode===_n){":"===this._tokens.peek().text&&(t.type=pn.WORD)}if(this.start_of_statement(t)?fn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Tn(this._flags.mode)||this._flags.last_token.type===pn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===pn.EQUALS||!this._options.preserve_newlines&&fn(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(gn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&gn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Sn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&fn(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==pn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.EQUALS&&this._flags.last_token.type!==pn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),gn(t,"function"))return(mn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!mn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==pn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD?fn(this._flags.last_token,["get","set","new","export"])||fn(this._flags.last_token,On)||gn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===pn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Tn(this._flags.mode)&&!qn(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===pn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":fn(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&this._flags.mode===wn?e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&Tn(this._flags.mode)?e="SPACE":this._flags.last_token.type===pn.STRING?e="NEWLINE":this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||"*"===this._flags.last_token.text&&(mn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&mn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===pn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===pn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),fn(t,bn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),fn(t,["else","catch","finally"]))?(this._flags.last_token.type!==pn.END_BLOCK||this._previous_flags.mode!==wn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?fn(this._flags.last_token,vn)||"declare"===this._flags.last_token.text&&fn(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==pn.END_EXPR?this._flags.last_token.type===pn.START_EXPR&&fn(t,["var","let","const"])||":"===this._flags.last_token.text||(gn(t,"if")&&gn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):fn(t,bn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&qn(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==pn.WORD&&t.previous.type!==pn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===pn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&gn(t,"from")&&(this._flags.import_block=!1))},Mn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==Sn||this._flags.if_block&&gn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Mn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==pn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR||this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==pn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Mn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Mn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Tn(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_n||this._flags.mode===Sn&&this._flags.parent.mode===_n?(this._flags.mode===Sn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Mn.prototype.handle_operator=function(t){var e="*"===t.text&&(fn(this._flags.last_token,["function","yield"])||mn(this._flags.last_token.type,[pn.START_BLOCK,pn.COMMA,pn.END_BLOCK,pn.SEMICOLON])),i=mn(t.text,["-","+"])&&(mn(this._flags.last_token.type,[pn.START_BLOCK,pn.START_EXPR,pn.EQUALS,pn.OPERATOR])||mn(this._flags.last_token.text,bn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(fn(this._flags.last_token,vn))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==pn.DOT)if("::"!==t.text){if(this._flags.last_token.type===pn.OPERATOR&&mn(this._options.operator_position,xn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==pn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var s=!0,o=!0,l=!1;if(":"===t.text?0===this._flags.ternary_depth?s=!1:(this._flags.ternary_depth-=1,l=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&mn(t.text,hn)){var a=":"===t.text,r=a&&l,c=a&&!l;switch(this._options.operator_position){case yn.before_newline:return this._output.space_before_token=!c,this.print_token(t),a&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case yn.after_newline:return this._output.space_before_token=!0,!a||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case yn.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),s=!(this._output.just_added_newline()||c),this._output.space_before_token=s,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),s=!1;var u=this._tokens.peek();o=u&&mn(u.type,[pn.WORD,pn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),s=this._flags.last_token.type===pn.START_BLOCK,o=!1):(mn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR||this.allow_wrap_or_preserved_newline(t),s=!1,o=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Tn(this._flags.mode)&&(s=!0),this._flags.last_token.type===pn.RESERVED?s=!0:this._flags.last_token.type===pn.END_EXPR?s=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===pn.OPERATOR&&(s=mn(t.text,["--","-","++","+"])&&mn(this._flags.last_token.text,["--","-","++","+"]),mn(t.text,["+","-"])&&mn(this._flags.last_token.text,["--","++"])&&(o=!0)),(this._flags.mode!==wn||this._flags.inline_frame)&&this._flags.mode!==Sn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||s,this.print_token(t),this._output.space_before_token=o}else this.print_token(t);else this.print_token(t)},Mn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):cn.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Mn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(cn.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),s=!1,o=!1,l=t.whitespace_before,a=l.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(s=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),o=function(t,e){for(var i,n=0,s=t.length;n<s;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,l),s&&(this._flags.alignment=1),i=0;i<n.length;i++)s?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):o&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(a))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Mn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Mn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),fn(this._flags.last_token,vn)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Mn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Mn.prototype.handle_eof=function(t){for(;this._flags.mode===Sn;)this.restore_mode();this.handle_whitespace_and_comments(t)},Ve.Beautifier=Mn;var zn=Ve.Beautifier,In=ai.Options;Xe.exports=function(t,e){return new zn(t,e).beautify()},Xe.exports.defaultOptions=function(){return new In};var Rn={exports:{}},$n={},Bn={},Nn=ri.Options;function Pn(t){Nn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Pn.prototype=new Nn,Bn.Options=Pn;var Dn=Bn.Options,jn=Ke.Output,Hn=gi.InputScanner,Fn=new(0,zi.Directives)(/\/\*/,/\*\//),Un=/\r\n|[\r\n]/,Wn=/\r\n|[\r\n]/g,Gn=/\s/,Yn=/(?:\s|\n)+/g,Xn=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,Vn=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Kn(t,e){this._source_text=t||"",this._options=new Dn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Kn.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},Kn.prototype.eatWhitespace=function(t){for(var e=Gn.test(this._input.peek()),i=0;Gn.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},Kn.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},Kn.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},Kn.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},Kn.prototype.indent=function(){this._indentLevel++},Kn.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},Kn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Un.test(t||"")&&(e=t.match(Un)[0]));var i=(t=t.replace(Wn,"\n")).match(/^[\t ]*/)[0];this._output=new jn(this._options,i),this._input=new Hn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,s,o=0,l=!1,a=!1,r=!1,c=!1,u=!1,d=this._ch;n=""!==this._input.read(Yn),s=d,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),d=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var b=this._input.read(Xn),h=Fn.get_directives(b);h&&"start"===h.ignore&&(b+=Fn.readIgnored(this._input)),this.print_string(b),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(Vn)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var p=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);p.match(/[ :]$/)&&(p=this.eatString(": ").replace(/\s$/,""),this.print_string(p),this._output.space_before_token=!0),"extend"===(p=p.replace(/\s$/,""))?c=!0:"import"===p&&(u=!0),p in this.NESTED_AT_RULE?(this._nestedLevel+=1,p in this.CONDITIONAL_GROUP_RULE&&(r=!0)):l||0!==o||-1===p.indexOf(":")||(a=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(a&&(a=!1,this.outdent()),r?(r=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===s&&this._output.trim(!0),u=!1,c=!1,a&&(this.outdent(),a=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!l&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==o?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),a||(a=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===o?(a&&(this.outdent(),a=!1),c=!1,u=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),o++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),o&&(o--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),o++,this.indent()):")"===this._ch?(o&&(o--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||a||0!==o||u||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||a||0!==o?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Gn.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Gn.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},$n.Beautifier=Kn;var Zn=$n.Beautifier,Qn=Bn.Options;Rn.exports=function(t,e){return new Zn(t,e).beautify()},Rn.exports.defaultOptions=function(){return new Qn};var Jn={exports:{}},ts={},es={},is=ri.Options;function ns(t){is.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ns.prototype=new is,es.Options=ns;var ss={},os=yi.Tokenizer,ls=yi.TOKEN,as=zi.Directives,rs=Ri.TemplatablePattern,cs=_i.Pattern,us={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:ls.START,RAW:ls.RAW,EOF:ls.EOF},ds=new as(/<\!--/,/-->/),bs=function(t,e){os.call(this,t,e),this._current_tag_name="";var i=new rs(this._input).read_options(this._options),n=new cs(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var s=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(s).until_after(s)}};(bs.prototype=new os)._is_comment=function(t){return!1},bs.prototype._is_opening=function(t){return t.type===us.TAG_OPEN},bs.prototype._is_closing=function(t,e){return t.type===us.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},bs.prototype._reset=function(){this._current_tag_name=""},bs.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(us.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(us.UNKNOWN,this._input.next())},bs.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=ds.get_directives(i))&&"start"===n.ignore&&(i+=ds.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(us.COMMENT,i)).directives=n));return e},bs.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(us.COMMENT,i)).directives=null)}return e},bs.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(us.TAG_OPEN,i)),n},bs.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(us.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(us.TAG_OPEN,i))),n},bs.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(us.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(us.TAG_CLOSE,"}}"))),n},bs.prototype._read_attribute=function(t,e,i){var n=null,s="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(us.EQUALS,this._input.next());else if('"'===t||"'"===t){var o=this._input.next();o+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(us.VALUE,o)}else(s=this.__patterns.attribute.read())&&(n=e.type===us.EQUALS?this._create_token(us.VALUE,s):this._create_token(us.ATTRIBUTE,s));return n},bs.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},bs.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===us.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var s=e.opened.text.substr(1).toLowerCase();if("script"===s||"style"===s){var o=this._read_comment_or_cdata(t);if(o)return o.type=us.TEXT,o;n=this._input.readUntil(new RegExp("</"+s+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(s)&&(n=this._input.readUntil(new RegExp("</"+s+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(us.TEXT,n):null},bs.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(us.TEXT,e)},ss.Tokenizer=bs,ss.TOKEN=us;var hs=es.Options,ps=Ke.Output,ms=ss.Tokenizer,gs=ss.TOKEN,fs=/\r\n|[\r\n]/,vs=/\r\n|[\r\n]/g,ys=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new ps(t,e)};ys.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},ys.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},ys.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},ys.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},ys.prototype.print_preserved_newlines=function(t){var e=0;t.type!==gs.TEXT&&t.previous.type!==gs.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},ys.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},ys.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},ys.prototype.print_newline=function(t){this._output.add_new_line(t)},ys.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},ys.prototype.indent=function(){this.indent_level++},ys.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var xs=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==gs.EOF&&t.closed!==i;){if(i.type===gs.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===gs.EQUALS&&i.next.next&&i.next.next.type===gs.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function ws(t,e){return-1!==e.indexOf(t)}function Ss(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function _s(t){this._printer=t,this._current_frame=null}function ks(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var s=new hs(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}_s.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_s.prototype.record_tag=function(t){var e=new Ss(this._current_frame,t,this._printer.indent_level);this._current_frame=e},_s.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},_s.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},_s.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},_s.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},ks.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&fs.test(t)&&(e=t.match(fs)[0]));var i=(t=t.replace(vs,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},s=new Cs,o=new ys(this._options,i),l=new ms(t,this._options).tokenize();this._tag_stack=new _s(o);for(var a=null,r=l.next();r.type!==gs.EOF;)r.type===gs.TAG_OPEN||r.type===gs.COMMENT?s=a=this._handle_tag_open(o,r,s,n):r.type===gs.ATTRIBUTE||r.type===gs.EQUALS||r.type===gs.VALUE||r.type===gs.TEXT&&!s.tag_complete?a=this._handle_inside_tag(o,r,s,l):r.type===gs.TAG_CLOSE?a=this._handle_tag_close(o,r,s):r.type===gs.TEXT?a=this._handle_text(o,r,s):o.add_raw_token(r),n=a,r=l.next();return o._output.get_code(e)},ks.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},ks.prototype._handle_inside_tag=function(t,e,i,n){var s=i.has_wrapped_attrs,o={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===gs.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===gs.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===gs.EQUALS||e.type===gs.VALUE&&e.previous.type===gs.EQUALS)&&t.set_space_before_token(!1),e.type===gs.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),s=s||0!==e.newlines),this._is_wrap_attributes_force)){var l=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var a,r=!0,c=0;do{if((a=n.peek(c)).type===gs.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&a.type!==gs.EOF&&a.type!==gs.TAG_CLOSE);l=!r}l&&(t.print_newline(!1),s=!0)}t.print_token(e),s=s||t.previous_token_wrapped(),i.has_wrapped_attrs=s}return o},ks.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},ks.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var s,o=e.text,l=1,a="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?s=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?s=this._css_beautify:"html"===i.custom_beautifier_name&&(s=function(t,e){return new ks(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?l=0:"separate"===this._options.indent_scripts&&(l=-t.indent_level);var c=t.get_full_indent(l);if(o=o.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!u)return void t.add_raw_token(e);a=c+u[1]+"\n",o=u[4],u[5]&&(r=c+u[5]),o=o.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}if(o)if(s){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,o=s(c+o,new d)}else{var b=e.whitespace_before;b&&(o=o.replace(new RegExp("\n("+b+")?","g"),"\n")),o=c+o.replace(/\n/g,"\n"+c)}a&&(o=o?a+o+"\n"+r:a+r),t.print_newline(!1),o&&(e.text=o,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},ks.prototype._handle_tag_open=function(t,e,i,n){var s=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==gs.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,s,i,n),s.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),s.start_tag_token=this._tag_stack.try_pop(s.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(s.alignment_size=e.text.length+1),s.tag_complete||s.is_unformatted||(t.alignment_size=s.alignment_size),s};var Cs=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===gs.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};ks.prototype._get_tag_open_token=function(t){var e=new Cs(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||ws(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&ws(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&ws(e.tag_check,this._options.content_unformatted),e.is_inline_element=ws(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},ks.prototype._set_tag_position=function(t,e,i,n,s){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=xs(i.tag_check,e)))),ws(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&s.type===gs.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var o=!1;o=(o=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(s.type===gs.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==s.type,(i.is_content_unformatted||i.is_unformatted)&&(o=!1),o&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===s.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},ks.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Ls=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],As=["a","audio","del","ins","map","noscript","video"];ks.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Ls.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==As.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ts.Beautifier=ks;var Es=ts.Beautifier,qs=es.Options;Jn.exports=function(t,e,i,n){return new Es(t,e,i,n).beautify()},Jn.exports.defaultOptions=function(){return new qs};var Ts=Xe.exports,Ms=Rn.exports,Os=Jn.exports;function zs(t,e,i,n){return Os(t,e,i=i||Ts,n=n||Ms)}zs.defaultOptions=Os.defaultOptions,Ye.js=Ts,Ye.css=Ms,Ye.html=zs,function(t){var e=Ye;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(Ge);var Is=Ge.exports;function Rs(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function $s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bs(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$s(Object(i),!0).forEach((function(e){Rs(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ns(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i,n,s={},o=Object.keys(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function Ps(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ds(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function js(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Hs(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?js(Object(i),!0).forEach((function(e){Ds(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):js(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Fs(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function Us(t){return function e(){for(var i=this,n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.apply(i,[].concat(s,n))}}}function Ws(t){return{}.toString.call(t).includes("Object")}function Gs(t){return"function"==typeof t}var Ys=Us((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),Xs={changes:function(t,e){return Ws(e)||Ys("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Ys("changeField"),e},selector:function(t){Gs(t)||Ys("selectorType")},handler:function(t){Gs(t)||Ws(t)||Ys("handlerType"),Ws(t)&&Object.values(t).some((function(t){return!Gs(t)}))&&Ys("handlersType")},initial:function(t){var e;t||Ys("initialIsRequired"),Ws(t)||Ys("initialType"),e=t,Object.keys(e).length||Ys("initialContent")}};function Vs(t,e){return Gs(e)?e(t.current):e}function Ks(t,e){return t.current=Hs(Hs({},t.current),e),e}function Zs(t,e,i){return Gs(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var Qs={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xs.initial(t),Xs.handler(e);var i={current:t},n=Us(Zs)(i,e),s=Us(Ks)(i),o=Us(Xs.changes)(t),l=Us(Vs)(i);function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return Xs.selector(t),t(i.current)}function r(t){Fs(n,s,o,l)(t)}return[a,r]}};var Js,to={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},eo=(Js=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return n.length>=Js.length?Js.apply(this,n):function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return t.apply(e,[].concat(n,s))}})(to),io={config:function(t){var e;return t||eo("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||eo("configType"),t.urls?(console.warn(to.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function no(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],no(t[i],e[i]))})),Bs(Bs({},t),e)}var so={type:"cancelation",msg:"operation is manually canceled"};function oo(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(so):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var lo,ao,ro=Qs.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),co=(ao=2,function(t){if(Array.isArray(t))return t}(lo=ro)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,s=!1,o=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done)&&(i.push(l.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(s)throw o}}return i}}(lo,ao)||function(t,e){if(t){if("string"==typeof t)return Ps(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ps(t,e):void 0}}(lo,ao)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),uo=co[0],bo=co[1];function ho(t){return document.body.appendChild(t)}function po(t){var e=uo((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function mo(){var t=uo((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){go(e),t.resolve(e)}),(function(e){t.reject(e)}))}function go(t){uo().monaco||bo({monaco:t})}var fo=new Promise((function(t,e){return bo({resolve:t,reject:e})})),vo={config:function(t){var e=io.config(t),i=e.monaco,n=Ns(e,["monaco"]);bo((function(t){return{config:no(t.config,n),monaco:i}}))},init:function(){var t=uo((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(bo({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),oo(fo);if(window.monaco&&window.monaco.editor)return go(window.monaco),t.resolve(window.monaco),oo(fo);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(ho,po)(mo)}return oo(fo)},__getMonacoInstance:function(){return uo((function(t){return t.monaco}))}};let yo={};class xo{constructor(t){this.builder=t}renderPanel(){const t=this.builder.builderStuff,e=this.builder.util,i=this.builder.dom;let n=t.querySelector(".viewhtml");if(!n){const s=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" id="__tabsupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea id="__viewhtmlmonaco" style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" id="__input_code_editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;i.appendHtml(t,s),n=t.querySelector(".viewhtml");let o=t.querySelector(".viewhtmlmonaco"),l=t.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");i.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=l.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)})),a=l.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)}))}}applyHtml(t){const e=this.builder.util,i=e.cellSelected();i&&i.parentNode.classList.add("row-active");let n=this.builder.codeEditorMode,s=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===n){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===n){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===n){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===n){if(this.builder.docContainer)return this.builder.loadHTML(o),e.clearControls(),void this.builder.hideModal(t);s.innerHTML="";let i=document.createRange();i.setStart(s,0),s.appendChild(i.createContextualFragment(o)),this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff;this.renderPanel();const i=e.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(i,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),i.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=this.builder.builderStuff,e=document.querySelector("textarea[data-source-active]");let i=t.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return vo.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const n=this.builder.monaco.editor.createModel(e.value,"html");this.builder.codeEditorExternal.setModel(n),i.style.opacity=""}view(t,e,i){this.renderPanel();const n=this.builder.util,s=this.builder.builderStuff;let o;o=this.builder.opts.htmlSyntaxHighlighting?s.querySelector(".viewhtmlmonaco"):s.querySelector(".viewhtml");let l=o.querySelector(".is-modal-content"),a=o.querySelector(".input-code-editor");a.style.opacity=.01,"full"===t?(l.style.width=this.builder.codeEditorWidth,l.style.maxWidth=this.builder.codeEditorMaxWidth,a.style.height=this.builder.codeEditorHeight):(l.style.width=this.builder.blockCodeEditorWidth,l.style.maxWidth=this.builder.blockCodeEditorMaxWidth,a.style.height=this.builder.blockCodeEditorHeight);const r=this.builder.doc.querySelector(".row-active");r&&r.classList.remove("row-active"),n.showModal(o,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus());const t=n.cellSelected();t&&t.parentNode.classList.add("row-active")})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.dom,n=this.builder.util,s=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=s.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return vo.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=s.querySelector(".viewhtml");let l=o.querySelector("textarea");if("cell"===t){const t=n.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=n.cellSelected();if(t=e?e.parentNode:n.rowSelected(),!t)return;let s=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,s.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,i.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const i=n.cellSelected();e=i?i.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(l.value,"html");this.builder.codeEditor.setModel(t)}let a=s.querySelector(".is-pop.columnmore");a&&(a.style.display="");let r=s.querySelector(".is-pop.rowmore");r&&(r.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in yo)t=t.replace(e,yo[e]);return t}readHtml(t,e,i,n){const s=this.builder.dom;if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const o=this.builder.util;let l,a=document.createElement("div");a.innerHTML=t.innerHTML;let r=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(r,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,o.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(yo={},r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=o.makeId();yo[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=o.makeId(),yo[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=o.makeId(),yo[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let c=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(c,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),s.removeClass(t,"builder-active");s.elementChildren(t).forEach((t=>{s.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));let u;if(s.elementChildren(a).forEach((t=>{t.style.cursor="";s.elementChildren(t).forEach((t=>{t.style.cursor=""}))})),u=a.querySelectorAll(".sortable-chosen, .sortable-ghost, .elm-active, .icon-active, .elm-inspected, .cell-active, .row-active, .row-outline, .is-builder"),u.forEach((t=>{t.classList.remove("sortable-chosen"),t.classList.remove("sortable-ghost"),t.classList.remove("elm-active"),t.classList.remove("icon-active"),t.classList.remove("elm-inspected"),t.classList.remove("cell-active"),t.classList.remove("row-active"),t.classList.remove("row-outline"),t.classList.remove("is-builder")})),u=a.querySelectorAll("[data-click], [contenteditable], [draggridoutline], [between-blocks-left], [between-blocks-center], [hideelementhighlight], [data-module-active], [draggable]"),u.forEach((t=>{t.removeAttribute("data-click"),t.removeAttribute("contenteditable"),t.removeAttribute("draggridoutline"),t.removeAttribute("between-blocks-left"),t.removeAttribute("between-blocks-center"),t.removeAttribute("hideelementhighlight"),t.removeAttribute("data-module-active"),t.removeAttribute("draggable")})),u=a.querySelectorAll("[data-animated], [data-saveforundo], [hidesnippetaddtool], [gray], [rowoutline], [hidecolumntool], [grayoutline], [hideoutline]"),u.forEach((t=>{t.removeAttribute("data-animated"),t.removeAttribute("data-saveforundo"),t.removeAttribute("hidesnippetaddtool"),t.removeAttribute("gray"),t.removeAttribute("rowoutline"),t.removeAttribute("hidecolumntool"),t.removeAttribute("grayoutline"),t.removeAttribute("hideoutline")})),u=a.querySelectorAll("[leftrowtool], [minimal], [clean], [grideditor], [gridoutline]"),u.forEach((t=>{t.removeAttribute("leftrowtool"),t.removeAttribute("minimal"),t.removeAttribute("clean"),t.removeAttribute("grideditor"),t.removeAttribute("gridoutline")})),u=a.querySelectorAll(".is-row-tool,.is-col-tool,.is-rowadd-tool,.is-canvas-tool,.is-canvasadd-tool,.h-ruler,.v-ruler"),u.forEach((t=>{t.previousSibling&&t.previousSibling.nodeType===Node.TEXT_NODE&&t.previousSibling.remove(),t.nextSibling&&t.nextSibling.nodeType===Node.TEXT_NODE&&t.nextSibling.remove(),t.remove()})),u=a.querySelectorAll(".ovl,.row-add-initial"),u.forEach((t=>{t.remove()})),this.builder.cleanAOS&&(u=a.querySelectorAll(".aos-init, .aos-animate"),u.forEach((t=>{t.classList.remove("aos-init"),t.classList.remove("aos-animate")}))),u=a.querySelectorAll(".skrollable, .skrollable-after, .skrollable-before, .skrollable-between, .is-inview"),u.forEach((t=>{t.classList.remove("skrollable"),t.classList.remove("skrollable-after"),t.classList.remove("skrollable-before"),t.classList.remove("skrollable-between"),t.classList.remove("is-inview")})),a.querySelectorAll('[class=""]').forEach((t=>{t.removeAttribute("class")})),a.querySelectorAll(".is-row-overlay").forEach((t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),s.removeEmptyStyle(a),u=a.querySelectorAll("[data-keep]"),s.removeAttributes(u,"data-keep"),a.querySelectorAll("a").forEach((t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(l="",i){u=a.querySelectorAll(".is-dummy"),u.forEach((t=>{t.remove()})),u=a.querySelectorAll("[data-scroll], [data-scroll-once]"),u.forEach((t=>{t.removeAttribute("data-scroll"),t.removeAttribute("data-scroll-once")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]"),u.forEach((t=>{t.removeAttribute("data-noedit"),t.removeAttribute("data-module"),t.removeAttribute("data-module-desc"),t.removeAttribute("data-dialog-width"),t.removeAttribute("data-dialog-height"),t.removeAttribute("data-html"),t.removeAttribute("data-settings")})),u=a.querySelectorAll("[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]"),u.forEach((t=>{t.removeAttribute("data-html-1"),t.removeAttribute("data-html-2"),t.removeAttribute("data-html-3"),t.removeAttribute("data-html-4"),t.removeAttribute("data-html-5"),t.removeAttribute("data-html-6"),t.removeAttribute("data-html-7"),t.removeAttribute("data-html-8"),t.removeAttribute("data-html-9"),t.removeAttribute("data-html-10")}))),u=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(u,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),u=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"animated"),s.removeClass(t,"pulse"),s.removeClass(t,"bounceIn"),s.removeClass(t,"fadeIn"),s.removeClass(t,"fadeOut"),s.removeClass(t,"fadeInDown"),s.removeClass(t,"fadeInLeft"),s.removeClass(t,"fadeInRight"),s.removeClass(t,"fadeInUp"),s.removeClass(t,"flipInX"),s.removeClass(t,"flipInY"),s.removeClass(t,"slideInUp"),s.removeClass(t,"slideInDown"),s.removeClass(t,"slideInLeft"),s.removeClass(t,"slideInRight"),s.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),u=a.querySelectorAll(".is-appeared, .box-active, .section-active, .section-select, .box-select"),u.forEach((t=>{t.classList.remove("is-appeared"),t.classList.remove("box-active"),t.classList.remove("section-active"),t.classList.remove("section-select"),t.classList.remove("box-select")})),u=a.querySelectorAll(".is-section-tool, .is-box-tool, .is-box-info, .is-section-info"),u.forEach((t=>{t.previousSibling&&t.previousSibling.nodeType===Node.TEXT_NODE&&t.previousSibling.remove(),t.nextSibling&&t.nextSibling.nodeType===Node.TEXT_NODE&&t.nextSibling.remove(),t.remove()})),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),s.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"active"),s.removeClass(t,"multi"),s.removeClass(t,"editable"),s.removeClass(t,"fluid"),s.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t)));var d="",b="",h="";s.elementChildren(a).forEach((t=>{let e=t;if(s.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;l+=o,-1===i.indexOf("is-static")?d+=o+"\n\n":b+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,l+=o,h+=o}));let e=document.querySelector("[data-contentbox]"),i=!1;e&&(i=e.settings.disableStaticSection),i||(l=d+b+h),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]"),u.forEach((t=>{t.removeAttribute("data-noedit"),t.removeAttribute("data-module"),t.removeAttribute("data-module-desc"),t.removeAttribute("data-dialog-width"),t.removeAttribute("data-dialog-height"),t.removeAttribute("data-html"),t.removeAttribute("data-settings")})),u=a.querySelectorAll("[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]"),u.forEach((t=>{t.removeAttribute("data-html-1"),t.removeAttribute("data-html-2"),t.removeAttribute("data-html-3"),t.removeAttribute("data-html-4"),t.removeAttribute("data-html-5"),t.removeAttribute("data-html-6"),t.removeAttribute("data-html-7"),t.removeAttribute("data-html-8"),t.removeAttribute("data-html-9"),t.removeAttribute("data-html-10")}))),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),s.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"active"),s.removeClass(t,"multi"),s.removeClass(t,"editable"),s.removeClass(t,"fluid"),s.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let p=Is.html;return l=p(l),l=l.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),l}beautify(t){return t=(t=(0,Is.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class wo{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,s=this.builder.doc.getElementsByTagName("link");for(i=0;i<s.length;i++)n=s[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&s[i].parentNode.removeChild(s[i]);let o=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(o,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){if(this.builder.docContainer){return this.builder.doc.querySelector(this.builder.docContainer).innerHTML}{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".is-canvas-tool")),e.removeElements(t.querySelectorAll(".is-canvasadd-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),e.removeElements(t.querySelectorAll(".h-ruler")),e.removeElements(t.querySelectorAll(".v-ruler")),n=t.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),e.removeElements(n),n=t.querySelectorAll(".is-block"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"active"),e.removeClass(t,"multi"),e.removeClass(t,"editable"),e.removeClass(t,"fluid"),e.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),t.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly)if(this.builder.docContainer){let e=this.builder.doc.querySelector(this.builder.docContainer),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}else{const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let e=this.builder.doc.querySelector(this.builder.opts.page),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.applyBehaviorCanvas(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new Fe(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.applyBehaviorCanvas(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new Fe(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
19
+ */function D(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function j(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?D(Object(i),!0).forEach((function(e){F(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function F(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function U(){return U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},U.apply(this,arguments)}function W(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i,n,s={},o=Object.keys(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function G(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Y=G(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),X=G(/Edge/i),V=G(/firefox/i),K=G(/safari/i)&&!G(/chrome/i)&&!G(/android/i),Z=G(/iP(ad|od|hone)/i),Q=G(/chrome/i)&&G(/android/i),J={capture:!1,passive:!1};function tt(t,e,i){t.addEventListener(e,i,!Y&&J)}function et(t,e,i){t.removeEventListener(e,i,!Y&&J)}function it(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function nt(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function st(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&it(t,e):it(t,e))||n&&t===i)return t;if(t===i)break}while(t=nt(t))}return null}var ot,lt=/\s+/g;function at(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(lt," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(lt," ")}}function rt(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function ct(t,e){var i="";if("string"==typeof t)i=t;else do{var n=rt(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(i)}function ut(t,e,i){if(t){var n=t.getElementsByTagName(e),s=0,o=n.length;if(i)for(;s<o;s++)i(n[s],s);return n}return[]}function dt(){var t=document.scrollingElement;return t||document.documentElement}function bt(t,e,i,n,s){if(t.getBoundingClientRect||t===window){var o,l,a,r,c,u,d;if(t!==window&&t.parentNode&&t!==dt()?(l=(o=t.getBoundingClientRect()).top,a=o.left,r=o.bottom,c=o.right,u=o.height,d=o.width):(l=0,a=0,r=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||i)&&t!==window&&(s=s||t.parentNode,!Y))do{if(s&&s.getBoundingClientRect&&("none"!==rt(s,"transform")||i&&"static"!==rt(s,"position"))){var b=s.getBoundingClientRect();l-=b.top+parseInt(rt(s,"border-top-width")),a-=b.left+parseInt(rt(s,"border-left-width")),r=l+o.height,c=a+o.width;break}}while(s=s.parentNode);if(n&&t!==window){var h=ct(s||t),p=h&&h.a,m=h&&h.d;h&&(r=(l/=m)+(u/=m),c=(a/=p)+(d/=p))}return{top:l,left:a,bottom:r,right:c,width:d,height:u}}}function ht(t,e,i){for(var n=vt(t,!0),s=bt(t)[e];n;){var o=bt(n)[i];if(!("top"===i||"left"===i?s>=o:s<=o))return n;if(n===dt())break;n=vt(n,!1)}return!1}function pt(t,e,i,n){for(var s=0,o=0,l=t.children;o<l.length;){if("none"!==l[o].style.display&&l[o]!==Se.ghost&&(n||l[o]!==Se.dragged)&&st(l[o],i.draggable,t,!1)){if(s===e)return l[o];s++}o++}return null}function mt(t,e){for(var i=t.lastElementChild;i&&(i===Se.ghost||"none"===rt(i,"display")||e&&!it(i,e));)i=i.previousElementSibling;return i||null}function gt(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Se.clone||e&&!it(t,e)||i++;return i}function ft(t){var e=0,i=0,n=dt();if(t)do{var s=ct(t),o=s.a,l=s.d;e+=t.scrollLeft*o,i+=t.scrollTop*l}while(t!==n&&(t=t.parentNode));return[e,i]}function vt(t,e){if(!t||!t.getBoundingClientRect)return dt();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var s=rt(i);if(i.clientWidth<i.scrollWidth&&("auto"==s.overflowX||"scroll"==s.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==s.overflowY||"scroll"==s.overflowY)){if(!i.getBoundingClientRect||i===document.body)return dt();if(n||e)return i;n=!0}}}while(i=i.parentNode);return dt()}function yt(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function xt(t,e){return function(){if(!ot){var i=arguments,n=this;1===i.length?t.call(n,i[0]):t.apply(n,i),ot=setTimeout((function(){ot=void 0}),e)}}}function wt(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function St(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}function _t(t,e,i){var n={};return Array.from(t.children).forEach((function(s){var o,l,a,r;if(st(s,e.draggable,t,!1)&&!s.animated&&s!==i){var c=bt(s);n.left=Math.min(null!==(o=n.left)&&void 0!==o?o:1/0,c.left),n.top=Math.min(null!==(l=n.top)&&void 0!==l?l:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(r=n.bottom)&&void 0!==r?r:-1/0,c.bottom)}})),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var kt="Sortable"+(new Date).getTime();function Ct(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==rt(t,"display")&&t!==Se.ghost){e.push({target:t,rect:bt(t)});var i=j({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=ct(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var s=!1,o=0;e.forEach((function(t){var e=0,i=t.target,l=i.fromRect,a=bt(i),r=i.prevFromRect,c=i.prevToRect,u=t.rect,d=ct(i,!0);d&&(a.top-=d.f,a.left-=d.e),i.toRect=a,i.thisAnimationDuration&&yt(r,a)&&!yt(l,a)&&(u.top-a.top)/(u.left-a.left)==(l.top-a.top)/(l.left-a.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(u,r,c,n.options)),yt(a,l)||(i.prevFromRect=l,i.prevToRect=a,e||(e=n.options.animation),n.animate(i,u,a,e)),e&&(s=!0,o=Math.max(o,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),e),i.thisAnimationDuration=e)})),clearTimeout(t),s?t=setTimeout((function(){"function"==typeof i&&i()}),o):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){rt(t,"transition",""),rt(t,"transform","");var s=ct(this.el),o=s&&s.a,l=s&&s.d,a=(e.left-i.left)/(o||1),r=(e.top-i.top)/(l||1);t.animatingX=!!a,t.animatingY=!!r,rt(t,"transform","translate3d("+a+"px,"+r+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),rt(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),rt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){rt(t,"transition",""),rt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),n)}}}}var Lt=[],At={initializeByDefault:!0},Et={mount:function(t){for(var e in At)At.hasOwnProperty(e)&&!(e in t)&&(t[e]=At[e]);Lt.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),Lt.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var s=t+"Global";Lt.forEach((function(n){e[n.pluginName]&&(e[n.pluginName][s]&&e[n.pluginName][s](j({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](j({sortable:e},i)))}))},initializePlugins:function(t,e,i,n){for(var s in Lt.forEach((function(n){var s=n.pluginName;if(t.options[s]||n.initializeByDefault){var o=new n(t,e,t.options);o.sortable=t,o.options=t.options,t[s]=o,U(i,o.defaults)}})),t.options)if(t.options.hasOwnProperty(s)){var o=this.modifyOption(t,s,t.options[s]);void 0!==o&&(t.options[s]=o)}},getEventProperties:function(t,e){var i={};return Lt.forEach((function(n){"function"==typeof n.eventProperties&&U(i,n.eventProperties.call(e[n.pluginName],t))})),i},modifyOption:function(t,e,i){var n;return Lt.forEach((function(s){t[s.pluginName]&&s.optionListeners&&"function"==typeof s.optionListeners[e]&&(n=s.optionListeners[e].call(t[s.pluginName],i))})),n}};var qt=["evt"],Tt=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,s=W(i,qt);Et.pluginEvent.bind(Se)(t,e,j({dragEl:Ot,parentEl:zt,ghostEl:It,rootEl:Rt,nextEl:$t,lastDownEl:Bt,cloneEl:Nt,cloneHidden:Pt,dragStarted:Qt,putSortable:Wt,activeSortable:Se.active,originalEvent:n,oldIndex:Dt,oldDraggableIndex:Ht,newIndex:jt,newDraggableIndex:Ft,hideGhostForTarget:ve,unhideGhostForTarget:ye,cloneNowHidden:function(){Pt=!0},cloneNowShown:function(){Pt=!1},dispatchSortableEvent:function(t){Mt({sortable:e,name:t,originalEvent:n})}},s))};function Mt(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,s=t.targetEl,o=t.cloneEl,l=t.toEl,a=t.fromEl,r=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,b=t.originalEvent,h=t.putSortable,p=t.extraEventProperties;if(e=e||i&&i[kt]){var m,g=e.options,f="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||Y||X?(m=document.createEvent("Event")).initEvent(n,!0,!0):m=new CustomEvent(n,{bubbles:!0,cancelable:!0}),m.to=l||i,m.from=a||i,m.item=s||i,m.clone=o,m.oldIndex=r,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=d,m.originalEvent=b,m.pullMode=h?h.lastPutMode:void 0;var v=j(j({},p),Et.getEventProperties(n,e));for(var y in v)m[y]=v[y];i&&i.dispatchEvent(m),g[f]&&g[f].call(e,m)}}(j({putSortable:Wt,cloneEl:Nt,targetEl:Ot,rootEl:Rt,oldIndex:Dt,oldDraggableIndex:Ht,newIndex:jt,newDraggableIndex:Ft},t))}var Ot,zt,It,Rt,$t,Bt,Nt,Pt,Dt,jt,Ht,Ft,Ut,Wt,Gt,Yt,Xt,Vt,Kt,Zt,Qt,Jt,te,ee,ie,ne=!1,se=!1,oe=[],le=!1,ae=!1,re=[],ce=!1,ue=[],de="undefined"!=typeof document,be=Z,he=X||Y?"cssFloat":"float",pe=de&&!Q&&!Z&&"draggable"in document.createElement("div"),me=function(){if(de){if(Y)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ge=function(t,e){var i=rt(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),s=pt(t,0,e),o=pt(t,1,e),l=s&&rt(s),a=o&&rt(o),r=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+bt(s).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+bt(o).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&l.float&&"none"!==l.float){var u="left"===l.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return s&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||r>=n&&"none"===i[he]||o&&"none"===i[he]&&r+c>n)?"vertical":"horizontal"},fe=function(t){function e(t,i){return function(n,s,o,l){var a=n.options.group.name&&s.options.group.name&&n.options.group.name===s.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,s,o,l),i)(n,s,o,l);var r=(i?n:s).options.group.name;return!0===t||"string"==typeof t&&t===r||t.join&&t.indexOf(r)>-1}}var i={},n=t.group;n&&"object"==H(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},ve=function(){!me&&It&&rt(It,"display","none")},ye=function(){!me&&It&&rt(It,"display","")};de&&!Q&&document.addEventListener("click",(function(t){if(se)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),se=!1,!1}),!0);var xe=function(t){if(Ot){t=t.touches?t.touches[0]:t;var e=(s=t.clientX,o=t.clientY,oe.some((function(t){var e=t[kt].options.emptyInsertThreshold;if(e&&!mt(t)){var i=bt(t),n=s>=i.left-e&&s<=i.right+e,a=o>=i.top-e&&o<=i.bottom+e;return n&&a?l=t:void 0}})),l);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[kt]._onDragOver(i)}}var s,o,l},we=function(t){Ot&&Ot.parentNode[kt]._isOutsideThisEl(t.target)};function Se(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=U({},e),t[kt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ge(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Se.supportPointer&&"PointerEvent"in window&&!K,emptyInsertThreshold:5};for(var n in Et.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var s in fe(e),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!e.forceFallback&&pe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?tt(t,"pointerdown",this._onTapStart):(tt(t,"mousedown",this._onTapStart),tt(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(tt(t,"dragover",this),tt(t,"dragenter",this)),oe.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),U(this,Ct())}function _e(t,e,i,n,s,o,l,a){var r,c,u=t[kt],d=u.options.onMove;return!window.CustomEvent||Y||X?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=s||e,r.relatedRect=o||bt(e),r.willInsertAfter=a,r.originalEvent=l,t.dispatchEvent(r),d&&(c=d.call(u,r,l)),c}function ke(t){t.draggable=!1}function Ce(){ce=!1}function Le(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function Ae(t){return setTimeout(t,0)}function Ee(t){return clearTimeout(t)}Se.prototype={constructor:Se,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Jt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ot):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,s=n.preventOnFilter,o=t.type,l=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(l||t).target,r=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;if(function(t){ue.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&ue.push(n)}}(i),!Ot&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!K||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=st(a,n.draggable,i,!1))&&a.animated||Bt===a)){if(Dt=gt(a),Ht=gt(a,n.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Mt({sortable:e,rootEl:r,name:"filter",targetEl:a,toEl:i,fromEl:i}),Tt("filter",e,{evt:t}),void(s&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=st(r,n.trim(),i,!1))return Mt({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),Tt("filter",e,{evt:t}),!0}))))return void(s&&t.cancelable&&t.preventDefault());n.handle&&!st(r,n.handle,i,!1)||this._prepareDragStart(t,l,a)}}},_prepareDragStart:function(t,e,i){var n,s=this,o=s.el,l=s.options,a=o.ownerDocument;if(i&&!Ot&&i.parentNode===o){var r=bt(i);if(Rt=o,zt=(Ot=i).parentNode,$t=Ot.nextSibling,Bt=i,Ut=l.group,Se.dragged=Ot,Gt={target:Ot,clientX:(e||t).clientX,clientY:(e||t).clientY},Kt=Gt.clientX-r.left,Zt=Gt.clientY-r.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ot.style["will-change"]="all",n=function(){Tt("delayEnded",s,{evt:t}),Se.eventCanceled?s._onDrop():(s._disableDelayedDragEvents(),!V&&s.nativeDraggable&&(Ot.draggable=!0),s._triggerDragStart(t,e),Mt({sortable:s,name:"choose",originalEvent:t}),at(Ot,l.chosenClass,!0))},l.ignore.split(",").forEach((function(t){ut(Ot,t.trim(),ke)})),tt(a,"dragover",xe),tt(a,"mousemove",xe),tt(a,"touchmove",xe),tt(a,"mouseup",s._onDrop),tt(a,"touchend",s._onDrop),tt(a,"touchcancel",s._onDrop),V&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ot.draggable=!0),Tt("delayStart",this,{evt:t}),!l.delay||l.delayOnTouchOnly&&!e||this.nativeDraggable&&(X||Y))n();else{if(Se.eventCanceled)return void this._onDrop();tt(a,"mouseup",s._disableDelayedDrag),tt(a,"touchend",s._disableDelayedDrag),tt(a,"touchcancel",s._disableDelayedDrag),tt(a,"mousemove",s._delayedDragTouchMoveHandler),tt(a,"touchmove",s._delayedDragTouchMoveHandler),l.supportPointer&&tt(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(n,l.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ot&&ke(Ot),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;et(t,"mouseup",this._disableDelayedDrag),et(t,"touchend",this._disableDelayedDrag),et(t,"touchcancel",this._disableDelayedDrag),et(t,"mousemove",this._delayedDragTouchMoveHandler),et(t,"touchmove",this._delayedDragTouchMoveHandler),et(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?tt(document,"pointermove",this._onTouchMove):tt(document,e?"touchmove":"mousemove",this._onTouchMove):(tt(Ot,"dragend",this),tt(Rt,"dragstart",this._onDragStart));try{document.selection?Ae((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(ne=!1,Rt&&Ot){Tt("dragStarted",this,{evt:e}),this.nativeDraggable&&tt(document,"dragover",we);var i=this.options;!t&&at(Ot,i.dragClass,!1),at(Ot,i.ghostClass,!0),Se.active=this,t&&this._appendGhost(),Mt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Yt){this._lastX=Yt.clientX,this._lastY=Yt.clientY,ve();for(var t=document.elementFromPoint(Yt.clientX,Yt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yt.clientX,Yt.clientY))!==e;)e=t;if(Ot.parentNode[kt]._isOutsideThisEl(t),e)do{if(e[kt]){if(e[kt]._onDragOver({clientX:Yt.clientX,clientY:Yt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);ye()}},_onTouchMove:function(t){if(Gt){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,s=t.touches?t.touches[0]:t,o=It&&ct(It,!0),l=It&&o&&o.a,a=It&&o&&o.d,r=be&&ie&&ft(ie),c=(s.clientX-Gt.clientX+n.x)/(l||1)+(r?r[0]-re[0]:0)/(l||1),u=(s.clientY-Gt.clientY+n.y)/(a||1)+(r?r[1]-re[1]:0)/(a||1);if(!Se.active&&!ne){if(i&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(It){o?(o.e+=c-(Xt||0),o.f+=u-(Vt||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");rt(It,"webkitTransform",d),rt(It,"mozTransform",d),rt(It,"msTransform",d),rt(It,"transform",d),Xt=c,Vt=u,Yt=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!It){var t=this.options.fallbackOnBody?document.body:Rt,e=bt(Ot,!0,be,!0,t),i=this.options;if(be){for(ie=t;"static"===rt(ie,"position")&&"none"===rt(ie,"transform")&&ie!==document;)ie=ie.parentNode;ie!==document.body&&ie!==document.documentElement?(ie===document&&(ie=dt()),e.top+=ie.scrollTop,e.left+=ie.scrollLeft):ie=dt(),re=ft(ie)}at(It=Ot.cloneNode(!0),i.ghostClass,!1),at(It,i.fallbackClass,!0),at(It,i.dragClass,!0),rt(It,"transition",""),rt(It,"transform",""),rt(It,"box-sizing","border-box"),rt(It,"margin",0),rt(It,"top",e.top),rt(It,"left",e.left),rt(It,"width",e.width),rt(It,"height",e.height),rt(It,"opacity","0.8"),rt(It,"position",be?"absolute":"fixed"),rt(It,"zIndex","100000"),rt(It,"pointerEvents","none"),Se.ghost=It,t.appendChild(It),rt(It,"transform-origin",Kt/parseInt(It.style.width)*100+"% "+Zt/parseInt(It.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,s=i.options;Tt("dragStart",this,{evt:t}),Se.eventCanceled?this._onDrop():(Tt("setupClone",this),Se.eventCanceled||((Nt=St(Ot)).removeAttribute("id"),Nt.draggable=!1,Nt.style["will-change"]="",this._hideClone(),at(Nt,this.options.chosenClass,!1),Se.clone=Nt),i.cloneId=Ae((function(){Tt("clone",i),Se.eventCanceled||(i.options.removeCloneOnHide||Rt.insertBefore(Nt,Ot),i._hideClone(),Mt({sortable:i,name:"clone"}))})),!e&&at(Ot,s.dragClass,!0),e?(se=!0,i._loopId=setInterval(i._emulateDragOver,50)):(et(document,"mouseup",i._onDrop),et(document,"touchend",i._onDrop),et(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",s.setData&&s.setData.call(i,n,Ot)),tt(document,"drop",i),rt(Ot,"transform","translateZ(0)")),ne=!0,i._dragStartId=Ae(i._dragStarted.bind(i,e,t)),tt(document,"selectstart",i),Qt=!0,K&&rt(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,s,o=this.el,l=t.target,a=this.options,r=a.group,c=Se.active,u=Ut===r,d=a.sort,b=Wt||c,h=this,p=!1;if(!ce){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=st(l,a.draggable,o,!0),q("dragOver"),Se.eventCanceled)return p;if(Ot.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||h._ignoreWhileAnimating===l)return M(!1);if(se=!1,c&&!a.disabled&&(u?d||(n=zt!==Rt):Wt===this||(this.lastPutMode=Ut.checkPull(this,c,Ot,t))&&r.checkPut(this,c,Ot,t))){if(s="vertical"===this._getDirection(t,l),e=bt(Ot),q("dragOverValid"),Se.eventCanceled)return p;if(n)return zt=Rt,T(),this._hideClone(),q("revert"),Se.eventCanceled||($t?Rt.insertBefore(Ot,$t):Rt.appendChild(Ot)),M(!0);var m=mt(o,a.draggable);if(!m||function(t,e,i){var n=bt(mt(i.el,i.options.draggable)),s=_t(i.el,i.options,It),o=10;return e?t.clientX>s.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>s.bottom+o||t.clientX>n.right&&t.clientY>n.top}(t,s,this)&&!m.animated){if(m===Ot)return M(!1);if(m&&o===t.target&&(l=m),l&&(i=bt(l)),!1!==_e(Rt,o,Ot,e,l,i,t,!!l))return T(),m&&m.nextSibling?o.insertBefore(Ot,m.nextSibling):o.appendChild(Ot),zt=o,O(),M(!0)}else if(m&&function(t,e,i){var n=bt(pt(i.el,0,i.options,!0)),s=_t(i.el,i.options,It),o=10;return e?t.clientX<s.left-o||t.clientY<n.top&&t.clientX<n.right:t.clientY<s.top-o||t.clientY<n.bottom&&t.clientX<n.left}(t,s,this)){var g=pt(o,0,a,!0);if(g===Ot)return M(!1);if(i=bt(l=g),!1!==_e(Rt,o,Ot,e,l,i,t,!1))return T(),o.insertBefore(Ot,g),zt=o,O(),M(!0)}else if(l.parentNode===o){i=bt(l);var f,v,y,x=Ot.parentNode!==o,w=!function(t,e,i){var n=i?t.left:t.top,s=i?t.right:t.bottom,o=i?t.width:t.height,l=i?e.left:e.top,a=i?e.right:e.bottom,r=i?e.width:e.height;return n===l||s===a||n+o/2===l+r/2}(Ot.animated&&Ot.toRect||e,l.animated&&l.toRect||i,s),S=s?"top":"left",_=ht(l,"top","top")||ht(Ot,"top","top"),k=_?_.scrollTop:void 0;if(Jt!==l&&(v=i[S],le=!1,ae=!w&&a.invertSwap||x),f=function(t,e,i,n,s,o,l,a){var r=n?t.clientY:t.clientX,c=n?i.height:i.width,u=n?i.top:i.left,d=n?i.bottom:i.right,b=!1;if(!l)if(a&&ee<c*s){if(!le&&(1===te?r>u+c*o/2:r<d-c*o/2)&&(le=!0),le)b=!0;else if(1===te?r<u+ee:r>d-ee)return-te}else if(r>u+c*(1-s)/2&&r<d-c*(1-s)/2)return function(t){return gt(Ot)<gt(t)?1:-1}(e);if((b=b||l)&&(r<u+c*o/2||r>d-c*o/2))return r>u+c/2?1:-1;return 0}(t,l,i,s,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,ae,Jt===l),0!==f){var C=gt(Ot);do{C-=f,y=zt.children[C]}while(y&&("none"===rt(y,"display")||y===It))}if(0===f||y===l)return M(!1);Jt=l,te=f;var L=l.nextElementSibling,A=!1,E=_e(Rt,o,Ot,e,l,i,t,A=1===f);if(!1!==E)return 1!==E&&-1!==E||(A=1===E),ce=!0,setTimeout(Ce,30),T(),A&&!L?o.appendChild(Ot):l.parentNode.insertBefore(Ot,A?L:l),_&&wt(_,0,k-_.scrollTop),zt=Ot.parentNode,void 0===v||ae||(ee=Math.abs(v-bt(l)[S])),O(),M(!0)}if(o.contains(Ot))return M(!1)}return!1}function q(a,r){Tt(a,h,j({evt:t,isOwner:u,axis:s?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:d,fromSortable:b,target:l,completed:M,onMove:function(i,n){return _e(Rt,o,Ot,e,i,bt(i),t,n)},changed:O},r))}function T(){q("dragOverAnimationCapture"),h.captureAnimationState(),h!==b&&b.captureAnimationState()}function M(e){return q("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==b&&(at(Ot,Wt?Wt.options.ghostClass:c.options.ghostClass,!1),at(Ot,a.ghostClass,!0)),Wt!==h&&h!==Se.active?Wt=h:h===Se.active&&Wt&&(Wt=null),b===h&&(h._ignoreWhileAnimating=l),h.animateAll((function(){q("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(l===Ot&&!Ot.animated||l===o&&!l.animated)&&(Jt=null),a.dragoverBubble||t.rootEl||l===document||(Ot.parentNode[kt]._isOutsideThisEl(t.target),!e&&xe(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function O(){jt=gt(Ot),Ft=gt(Ot,a.draggable),Mt({sortable:h,name:"change",toEl:o,newIndex:jt,newDraggableIndex:Ft,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){et(document,"mousemove",this._onTouchMove),et(document,"touchmove",this._onTouchMove),et(document,"pointermove",this._onTouchMove),et(document,"dragover",xe),et(document,"mousemove",xe),et(document,"touchmove",xe)},_offUpEvents:function(){var t=this.el.ownerDocument;et(t,"mouseup",this._onDrop),et(t,"touchend",this._onDrop),et(t,"pointerup",this._onDrop),et(t,"touchcancel",this._onDrop),et(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;jt=gt(Ot),Ft=gt(Ot,i.draggable),Tt("drop",this,{evt:t}),zt=Ot&&Ot.parentNode,jt=gt(Ot),Ft=gt(Ot,i.draggable),Se.eventCanceled||(ne=!1,ae=!1,le=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ee(this.cloneId),Ee(this._dragStartId),this.nativeDraggable&&(et(document,"drop",this),et(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),K&&rt(document.body,"user-select",""),rt(Ot,"transform",""),t&&(Qt&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),It&&It.parentNode&&It.parentNode.removeChild(It),(Rt===zt||Wt&&"clone"!==Wt.lastPutMode)&&Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),Ot&&(this.nativeDraggable&&et(Ot,"dragend",this),ke(Ot),Ot.style["will-change"]="",Qt&&!ne&&at(Ot,Wt?Wt.options.ghostClass:this.options.ghostClass,!1),at(Ot,this.options.chosenClass,!1),Mt({sortable:this,name:"unchoose",toEl:zt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Rt!==zt?(jt>=0&&(Mt({rootEl:zt,name:"add",toEl:zt,fromEl:Rt,originalEvent:t}),Mt({sortable:this,name:"remove",toEl:zt,originalEvent:t}),Mt({rootEl:zt,name:"sort",toEl:zt,fromEl:Rt,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:zt,originalEvent:t})),Wt&&Wt.save()):jt!==Dt&&jt>=0&&(Mt({sortable:this,name:"update",toEl:zt,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:zt,originalEvent:t})),Se.active&&(null!=jt&&-1!==jt||(jt=Dt,Ft=Ht),Mt({sortable:this,name:"end",toEl:zt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Tt("nulling",this),Rt=Ot=zt=It=$t=Nt=Bt=Pt=Gt=Yt=Qt=jt=Ft=Dt=Ht=Jt=te=Wt=Ut=Se.dragged=Se.ghost=Se.clone=Se.active=null,ue.forEach((function(t){t.checked=!0})),ue.length=Xt=Vt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ot&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,s=i.length,o=this.options;n<s;n++)st(t=i[n],o.draggable,this.el,!1)&&e.push(t.getAttribute(o.dataIdAttr)||Le(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach((function(t,e){var s=n.children[e];st(s,this.options.draggable,n,!1)&&(i[t]=s)}),this),e&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return st(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=Et.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&fe(i)},destroy:function(){Tt("destroy",this);var t=this.el;t[kt]=null,et(t,"mousedown",this._onTapStart),et(t,"touchstart",this._onTapStart),et(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(et(t,"dragover",this),et(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),oe.splice(oe.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Pt){if(Tt("hideClone",this),Se.eventCanceled)return;rt(Nt,"display","none"),this.options.removeCloneOnHide&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),Pt=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Pt){if(Tt("showClone",this),Se.eventCanceled)return;Ot.parentNode!=Rt||this.options.group.revertClone?$t?Rt.insertBefore(Nt,$t):Rt.appendChild(Nt):Rt.insertBefore(Nt,Ot),this.options.group.revertClone&&this.animate(Ot,Nt),rt(Nt,"display",""),Pt=!1}}else this._hideClone()}},de&&tt(document,"touchmove",(function(t){(Se.active||ne)&&t.cancelable&&t.preventDefault()})),Se.utils={on:tt,off:et,css:rt,find:ut,is:function(t,e){return!!st(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:xt,closest:st,toggleClass:at,clone:St,index:gt,nextTick:Ae,cancelNextTick:Ee,detectDirection:ge,getChild:pt},Se.get=function(t){return t[kt]},Se.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Se.utils=j(j({},Se.utils),t.utils)),Et.mount(t)}))},Se.create=function(t,e){return new Se(t,e)},Se.version="1.15.2";var qe,Te,Me,Oe,ze,Ie,Re=[],$e=!1;function Be(){Re.forEach((function(t){clearInterval(t.pid)})),Re=[]}function Ne(){clearInterval(Ie)}var Pe=xt((function(t,e,i,n){if(e.scroll){var s,o=(t.touches?t.touches[0]:t).clientX,l=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,r=e.scrollSpeed,c=dt(),u=!1;Te!==i&&(Te=i,Be(),qe=e.scroll,s=e.scrollFn,!0===qe&&(qe=vt(i,!0)));var d=0,b=qe;do{var h=b,p=bt(h),m=p.top,g=p.bottom,f=p.left,v=p.right,y=p.width,x=p.height,w=void 0,S=void 0,_=h.scrollWidth,k=h.scrollHeight,C=rt(h),L=h.scrollLeft,A=h.scrollTop;h===c?(w=y<_&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),S=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(w=y<_&&("auto"===C.overflowX||"scroll"===C.overflowX),S=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY));var E=w&&(Math.abs(v-o)<=a&&L+y<_)-(Math.abs(f-o)<=a&&!!L),q=S&&(Math.abs(g-l)<=a&&A+x<k)-(Math.abs(m-l)<=a&&!!A);if(!Re[d])for(var T=0;T<=d;T++)Re[T]||(Re[T]={});Re[d].vx==E&&Re[d].vy==q&&Re[d].el===h||(Re[d].el=h,Re[d].vx=E,Re[d].vy=q,clearInterval(Re[d].pid),0==E&&0==q||(u=!0,Re[d].pid=setInterval(function(){n&&0===this.layer&&Se.active._onTouchMove(ze);var e=Re[this.layer].vy?Re[this.layer].vy*r:0,i=Re[this.layer].vx?Re[this.layer].vx*r:0;"function"==typeof s&&"continue"!==s.call(Se.dragged.parentNode[kt],i,e,t,ze,Re[this.layer].el)||wt(Re[this.layer].el,i,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&b!==c&&(b=vt(b,!1)));$e=u}}),30),De=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,s=t.activeSortable,o=t.dispatchSortableEvent,l=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var r=i||s;l();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);a(),r&&!r.el.contains(u)&&(o("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function je(){}function He(){}je.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=pt(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:De},U(je,{pluginName:"revertOnSpill"}),He.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:De},U(He,{pluginName:"removeOnSpill"}),Se.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?tt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?tt(document,"pointermove",this._handleFallbackAutoScroll):e.touches?tt(document,"touchmove",this._handleFallbackAutoScroll):tt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?et(document,"dragover",this._handleAutoScroll):(et(document,"pointermove",this._handleFallbackAutoScroll),et(document,"touchmove",this._handleFallbackAutoScroll),et(document,"mousemove",this._handleFallbackAutoScroll)),Ne(),Be(),clearTimeout(ot),ot=void 0},nulling:function(){ze=Te=qe=$e=Ie=Me=Oe=null,Re.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,o=document.elementFromPoint(n,s);if(ze=t,e||this.options.forceAutoScrollFallback||X||Y||K){Pe(t,this.options,o,e);var l=vt(o,!0);!$e||Ie&&n===Me&&s===Oe||(Ie&&Ne(),Ie=setInterval((function(){var o=vt(document.elementFromPoint(n,s),!0);o!==l&&(l=o,Be()),Pe(t,i.options,o,e)}),10),Me=n,Oe=s)}else{if(!this.options.bubbleScroll||vt(o,!0)===dt())return void Be();Pe(t,this.options,vt(o,!1),!1)}}},U(t,{pluginName:"scroll",initializeByDefault:!0})}),Se.mount(He,je);class Fe{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}loadLightboxFromCdn(t){const e="https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js";if(this.isJsOnContentIncluded(e))this.builder.doc.querySelector("#_skin")||this.builder.doc.body.insertAdjacentHTML("beforeend",`<style>${this.getLightboxCss()}</style>`),t&&t();else{const i=this.builder.doc.createElement("script");i.src=e,i.async=!0,i.onload=()=>{this.loadCssOnContent("https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css"),this.builder.doc.body.insertAdjacentHTML("beforeend",`<style id="_skin">${this.getLightboxCss()}</style>`),t&&t()},this.builder.doc.body.appendChild(i)}}loadLightboxScript(t){const e=this.builder.assetPath+"scripts/glightbox/glightbox.min.js";if(this.isJsOnContentIncluded(e))t&&t();else{const i=this.builder.doc.createElement("script");i.src=e,i.async=!0,i.onload=()=>{this.builder.GLightbox?(this.loadCssOnContent(this.builder.assetPath+"scripts/glightbox/glightbox.min.css"),this.loadCssOnContent(this.builder.assetPath+"scripts/glightbox/skin.css"),t&&t()):this.loadLightboxFromCdn(t)},this.builder.doc.body.appendChild(i),i.onerror=()=>{this.loadLightboxFromCdn(t)}}}refreshLightbox(t,e){this.builder.glightbox&&this.builder.GLightbox?(this.builder.glightbox.destroy(),this.builder.glightbox=this.builder.GLightbox(t),e&&e()):this.loadLightboxScript((()=>{this.builder.GLightbox=this.builder.win.GLightbox,this.builder.glightbox=this.builder.win.GLightbox(t),e&&e()}))}openLightbox(t,e){const i=this.builder.openMediaElm;if(this.builder.glightbox){if(this.builder.doc.body.classList.contains("glightbox-open")){this.builder.glightbox.close();let i=this.builder.doc.querySelector(".goverlay");return i&&i.click(),void setTimeout((()=>{this.openLightbox(t,e)}),400)}let n=[],s=0;if(i){const e=i.closest("[data-gallery]");let o=[];if(e)o=e.querySelectorAll(".is-lightbox"),o.forEach(((e,i)=>{let o=e.getAttribute("href");n.push({href:o}),t===o&&(s=i)}));else{this.builder.doc.querySelectorAll(".is-lightbox,.block-click").forEach((t=>{t.closest("[data-gallery]")||t.classList.contains("lightbox-all")||o.push(t)})),o.forEach(((e,i)=>{let o=e.getAttribute("href");o||(o=e.getAttribute("data-modal-url")),n.push({href:o}),t===o&&(s=i)}))}}n.length>0?(this.builder.glightbox.setElements(n),this.builder.glightbox.openAt(s)):(this.builder.glightbox.setElements([{href:t}]),this.builder.glightbox.open()),this.builder.glightbox.on("close",(()=>{this.builder.glightbox.setElements([]),this.refreshLightbox(e)}))}this.builder.openMediaElm=null}isJsOnContentIncluded(t){const e=this.builder.doc.getElementsByTagName("script");for(let i=0;i<e.length;i++)if(e[i].getAttribute("src")===t)return!0;return!1}loadCssOnContent(t){const e=this.builder.doc.createElement("link");e.href=t,e.rel="stylesheet",this.builder.doc.head.appendChild(e)}showMessage(t,e,i){const n=this.dom;let s="";s=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const o=this.builder.builderStuff;let l=o.querySelector(".modalmessage");l||(n.appendHtml(o,s),l=o.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i&&i()}));let a=l.querySelector(".modalmessage .input-ok");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode&&l.parentNode.removeChild(l),i&&i()})),a.focus(),e&&a.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let s="";s=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const o=this.builder.builderStuff;let l=o.querySelector(".modalmessage");l||(n.appendHtml(o,s),l=o.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i(!1)}));let a=l.querySelector(".modalmessage .input-cancel");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!1)})),a.focus();let r=l.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!0)}))}confirm(t,e,i,n,s){if(!this.builder.deleteConfirm&&!s)return void e(!0);const o=this.dom;let l="";l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(o.appendHtml(a,l),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");o.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let u=r.querySelector(".is-confirm .input-cancel");o.addEventListener(u,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()})),c&&c.focus()}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const s=e=>{t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",o),document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",s),this.builder.doc.removeEventListener("touchstart",s)))},o=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",o),document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",s),this.builder.doc.removeEventListener("touchstart",s)))};t.addEventListener("keydown",o),document.addEventListener("mousedown",s),document.addEventListener("touchstart",s,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.addEventListener("mousedown",s),this.builder.doc.addEventListener("touchstart",s,{passive:!1}))}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}showPopOverlay(t,e,i){const n=this.builder.builderStuff;let s=n.querySelectorAll(".is-pop-overlay");const o=this.makeId(),l=`<div class="is-pop-overlay ${o}" style="display:flex;z-index:10004"></div>`;n.insertAdjacentHTML("beforeend",l);const a=n.querySelector(`.is-pop-overlay.${o}`);0===s.length&&(t.classList.add("pop1"),a.classList.add("pop1")),1===s.length&&(t.classList.add("pop2"),a.classList.add("pop2")),2===s.length&&(t.classList.add("pop3"),a.classList.add("pop3")),4===s.length&&(t.classList.add("pop4"),a.classList.add("pop4"));const r=()=>{a.remove(),t.style.display="",t.classList.remove("active"),t.setAttribute("aria-hidden",!0),a.classList.remove("pop1"),a.classList.remove("pop2"),a.classList.remove("pop3"),a.classList.remove("pop4"),t.classList.remove("pop1"),t.classList.remove("pop2"),t.classList.remove("pop3"),t.classList.remove("pop4"),t.removeEventListener("keydown",c),e&&e(),i&&i.focus()};this.hidePopOverlay=r;const c=t=>{27===t.keyCode&&r()};a.addEventListener("click",(t=>{r(),t.preventDefault(),t.stopImmediatePropagation()})),t.style.display="flex",t.classList.add("active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),t.addEventListener("keydown",c)}showPop(t,e,i,n){const s=this.dom;document.querySelectorAll(".is-pop.active").forEach((e=>{let n=!0;e.contains(i)&&(n=!1),e!==t&&n&&(e.style.display="",s.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),n?this.showPopOverlay(t,e,i):(this.clearAllEventListener(t),t.style.display="flex",s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e(),i&&i.focus())},this.handlePopKeyDown=n=>{27===n.keyCode&&(this.hidePop(t),e&&e(),i&&i.focus())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("mousedown",this.handlePopClickOut),document.addEventListener("touchstart",this.handlePopClickOut,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.addEventListener("mousedown",this.handlePopClickOut),this.builder.doc.addEventListener("touchstart",this.handlePopClickOut,{passive:!1})))}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("mousedown",this.handlePopClickOut),document.removeEventListener("touchstart",this.handlePopClickOut,{passive:!1}),this.builder.iframeDocument&&(this.builder.doc.removeEventListener("mousedown",this.handlePopClickOut),this.builder.doc.removeEventListener("touchstart",this.handlePopClickOut,{passive:!1}))}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,s){const o=this.dom;o.addClass(t,"active"),t.setAttribute("aria-hidden",!1),s&&(document.body.style.overflow="hidden");const l=e=>{if(27===e.keyCode){s&&(document.body.style.overflow=""),o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}};t.addEventListener("keydown",l);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");o.addEventListener(e,"click",(()=>{s&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}))}}const u=()=>{s&&(document.body.style.overflow=""),o.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()},d=t.querySelector(".is-modal-close");d&&o.addEventListener(d,"click",u)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let s=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(s,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o)),e.contentEditable=!0),o++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let s=3;t.querySelector(".is-row-overlay")&&(s=4);const o=t.childElementCount-s,l=this.builder.opts.row;let a=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=a.length-1;i++)e.removeClass(t,a[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===o){e.addClass(t,r[i][0]);break}1===o&&e.addClass(t,a[a.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==l&&a.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?a=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?a=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?a=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?a=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(a=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=a.length-1;n++)e.removeClass(t,a[n]);1===o&&e.addClass(t,a[11]),2===o&&e.addClass(t,a[5]),3===o&&e.addClass(t,a[3]),4===o&&e.addClass(t,a[2]),5===o&&(5===i?e.addClass(t,a[3]):e.addClass(t,a[1])),6===o&&e.addClass(t,a[1]),7===o&&(i>=6?e.addClass(t,a[0]):e.addClass(t,a[1])),8===o&&(i>=5?e.addClass(t,a[0]):e.addClass(t,a[1])),9===o&&(i>=4?e.addClass(t,a[0]):e.addClass(t,a[1])),10===o&&(i>=3?e.addClass(t,a[0]):e.addClass(t,a[1])),11===o&&(i>=2?e.addClass(t,a[0]):e.addClass(t,a[1])),12===o&&e.addClass(t,a[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const s=this.cellSelected();let o;if(s)o=s.parentNode;else{let t=this.builder.activeElement;if(t&&t.closest(".is-block"));else{if(o=this.builder.doc.querySelector(".row-active"),!o)return;e="row"}}if("cell"===e||"cell-left"===e||"cell-right"===e){let l=4;this.builder.maxColumns&&(l=this.builder.maxColumns);let a,r=3;if(o.querySelector(".is-row-overlay")&&(r=4),o.childElementCount>=l+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),a=this.createElementFromHTML(t)}else{a=s.cloneNode(!0),a.removeAttribute("data-noedit"),a.removeAttribute("data-protected"),a.removeAttribute("data-module"),a.removeAttribute("data-module-desc"),a.removeAttribute("data-dialog-width"),a.removeAttribute("data-html"),a.removeAttribute("data-settings");for(let t=1;t<=20;t++)a.removeAttribute("data-html-"+t);a.removeAttribute("data-noedit"),n.removeClass(a,"cell-active"),n.removeClass(a,"is-light-text"),n.removeClass(a,"is-dark-text"),n.removeClass(a,"padding-0"),n.removeClass(a,"p-0"),a.removeAttribute("data-click"),a.removeAttribute("style"),i&&a.setAttribute(i,""),a.innerHTML=t}o.insertBefore(a,s),"cell"!==e&&"cell-right"!==e||n.moveAfter(a,s);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(o),a.click()}if("row"===e){let e,s;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let o=this.builder.opts.cellFormat,l=o.indexOf("</");t=o.substring(0,l)+t+o.substring(l);let a=n.elementChildren(e);for(;a.length>0&&(a=a[0],n.elementChildren(a).length>0);)a=n.elementChildren(a);a.innerHTML=t,s=a.firstChild,i&&s.setAttribute(i,"")}else s=n.createElement("div"),n.addClass(s,this.builder.opts.cols[this.builder.opts.cols.length-1]),s.innerHTML=t,i&&s.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,s);o.parentNode.insertBefore(e,o),n.moveAfter(e,o);let l=this.builder.doc.querySelector(".builder-active");l&&this.builder.applyBehaviorOn(l),s.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i,s=e;if(s.nextElementSibling||s.closest("[data-subblock]"))s.insertAdjacentHTML("afterend",t),i=s.nextElementSibling;else{let e,o=this.builder.activeCol;n.elementChildren(o).forEach((t=>{t.contains(s)&&(e=t)})),e&&(e.insertAdjacentHTML("afterend",t),i=e.nextElementSibling)}let o=this.builder.doc.querySelector(".builder-active");if(o&&this.builder.applyBehaviorOn(o),"img"===i.tagName.toLowerCase()){let t=setInterval((()=>{i.complete&&(i.click(),clearInterval(t))}),30)}else i.click();let l=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(l)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let s,o,l,a=!1;let r,c=this.builder.builderStuff.querySelector(".quickadd");if(r=c?c.getAttribute("data-mode"):"row",!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(l=document.createElement("div"),l.className=this.builder.opts.cols[this.builder.opts.cols.length-1],l.innerHTML=t,i&&l.setAttribute("data-noedit",""),s=document.createElement("div"),s.className=this.builder.opts.row,s.appendChild(l),o=this.builder.cellSelected(),o?e=o.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],s=n.elementChildren(i);e=s[s.length-1]}e.parentNode.insertBefore(s,e),n.moveAfter(s,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),l.click(),s.className=s.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var u=document.createElement("div");u.innerHTML=t;var d=u.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t,e.classList.add("dummy-module")})),1===u.childNodes.length&&1===u.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=u.childNodes[0].childNodes[0];var b=document.createRange();t.parentNode.insertBefore(b.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let s=this.builder.doc.querySelector(".builder-active");return s||(s=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(s),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(o=this.builder.activeCol,o?e=o.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],s=n.elementChildren(i);e=s[s.length-1]}b=document.createRange(),e.parentNode.insertBefore(b.createContextualFragment(u.innerHTML),e.nextSibling),s=u.childNodes[0],s=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),l=s.querySelector("div"),l&&l.click();this.builder.doc.querySelectorAll(".dummy-module").forEach((t=>{t.querySelectorAll(".grid-sortable").forEach((t=>{new Se(t,{animation:600,dragClass:"hide-drag-class",onStart:()=>{this.builder.uo.saveForUndo(!0)},onSort:()=>{if(t.closest("[data-html]")){const e=t.closest("[data-html]"),i=encodeURIComponent(e.innerHTML);e.setAttribute("data-html",i),this.builder.opts.onChange()}}})}))})),this.builder.doc.querySelectorAll(".dummy-module").forEach((t=>{t.classList.remove("dummy-module")})),s.className=s.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){if(!this.builder.builderStuff)return;let t=this.builder.doc.getElementsByClassName("cell-active");for(;t.length;)t[0].classList.remove("cell-active");for(t=this.builder.doc.getElementsByClassName("row-outline");t.length;)t[0].classList.remove("row-outline");for(t=this.builder.doc.getElementsByClassName("row-active");t.length;)t[0].classList.remove("row-active");for(t=this.builder.doc.getElementsByClassName("builder-active");t.length;)t[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");if(n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null,!this.builder.controlPanel){let i=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")})),i=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")}))}let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const s=document.querySelector(".moveable-control-box"),o=document.querySelector("#divImageResizer");s&&o&&!o.getAttribute("data-resizing")&&(s.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const i=document.querySelector(".moveable-control-box");i&&(i.style.display="none")}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff;this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let n=this.builder.doc.querySelectorAll(".elm-inspected");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-inspected")})),this.builder.inspectedElement=null,n=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-active")})),this.builder.activeElement=null,this.builder.doc.querySelector(".is-element-tool").style.display="";let s=this.builder.doc.querySelector("#divLinkTool");if(s&&(s.style.display=""),t&&!this.builder.controlPanel){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let s=i.querySelector(".elementrte-more-options");s&&(s.style.display="");let o=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(o,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none");let s=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(s,(t=>{t.style.display="block"}));let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let s=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(s,(t=>{t.style.display="block"}));var o=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"active")}));let l=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(l,(t=>{t.removeAttribute("data-saveforundo")})),l=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-inspected")})),!this.builder.controlPanel&&"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let s=e.querySelector(".elementrte-more-options");s&&(s.style.display="")}if(l=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-active")})),!this.builder.controlPanel){let i=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}))}let a=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(a,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let s=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)s.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),s=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(s,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let o,l=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<l.length;t++)i=new RegExp("<"+l[t]+".*?"+l[t]+"(.*?)>","gi"),n=n.replace(i,"");o=e?["style","start"]:["start"];for(let t=0;t<o.length;t++){let e=new RegExp(" "+o[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");const s=P(this.builder);s.querySelector(".is-pop-tabs").style.display="none";const o=window.innerHeight,l=this.getElementPosition(i);let a=l.top,r=l.left,c=l.scaleX,u=l.scaleY;r+=i.offsetWidth*(c*this.builder.opts.zoom)/2-11,a-=i.offsetHeight-i.offsetHeight*u,s.style.display="flex",this.showPop(s,!1,i);const d=s.offsetWidth,b=s.offsetHeight;o-a>b?(a=a+i.offsetHeight*this.builder.opts.zoom-19,s.style.top=a+window.pageYOffset+27+"px",s.style.left=r-d/2+7+"px",e.removeClass(s,"arrow-bottom"),e.removeClass(s,"arrow-right"),e.removeClass(s,"arrow-left"),e.removeClass(s,"center"),e.addClass(s,"arrow-top"),e.addClass(s,"center")):(s.style.top=a+window.pageYOffset-b-8+"px",s.style.left=r-d/2+7+"px",e.removeClass(s,"arrow-top"),e.removeClass(s,"arrow-right"),e.removeClass(s,"arrow-left"),e.removeClass(s,"center"),e.addClass(s,"arrow-bottom"),e.addClass(s,"center")),s.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_pagesize"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.dom.getElm().closest(".is-container"))if(this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var s=this.builder.doc.createElement("div");s.innerHTML=t;for(var o,l,a=this.builder.doc.createDocumentFragment();o=s.firstChild;)l=a.appendChild(o);var r=a.firstChild;n.insertNode(a),l&&((n=n.cloneRange()).setStartAfter(l),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var s=document.createRange();s.setStart(t,0),t.appendChild(s.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var o=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+o)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+o))),o++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,s=e.left;i.style.top=n+35+"px",i.style.left=s-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),s=(n>>16)+e;s>255?s=255:s<0&&(s=0);var o=(n>>8&255)+e;o>255?o=255:o<0&&(o=0);var l=(255&n)+e;return l>255?l=255:l<0&&(l=0),(i?"#":"")+String("000000"+(l|o<<8|s<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" id="__style_helper_input" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" id="__style_helper_select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-select"),n=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(i,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(i.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(n,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let s=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),s}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,s,o;if(this.builder.iframe){let l=document.querySelector(".is-content-view");l||(l=e.parentNode);const a=window.getComputedStyle(l).transform;if("none"!==a){const t=a.match(/matrix\(([0-9., -]+)\)/)[1].split(",");s=parseFloat(t[0]),o=parseFloat(t[3])}else s=1,o=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*o+r.top,n=t.getBoundingClientRect().left*s+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,s=1,o=1;return{top:i,left:n,scaleX:s,scaleY:o}}getLightboxCss(){return"\n /* Light */\n .glightbox-light .gslide-description {\n background: #fff;\n }\n \n .glightbox-light .gdesc-inner {\n padding: 22px 20px;\n }\n \n .glightbox-light .gslide-title {\n font-size: 1em;\n font-weight: normal;\n font-family: arial;\n color: #000;\n margin-bottom: 19px;\n line-height: 1.4em;\n }\n \n .glightbox-light .gslide-desc {\n font-size: 0.86em;\n margin-bottom: 0;\n font-family: arial;\n line-height: 1.4em;\n }\n \n .glightbox-light .gslide-video {\n background: #000;\n }\n \n .glightbox-light .gprev,\n .glightbox-light .gnext,\n .glightbox-light .gclose {\n background-color: rgb(255 255 255 / 0%);\n border-radius: 4px;\n }\n \n .glightbox-light .gprev path,\n .glightbox-light .gnext path,\n .glightbox-light .gclose path {\n fill: #000;\n }\n \n .glightbox-light .gprev {\n position: absolute;\n top: -100%;\n left: 30px;\n width: 40px;\n height: 50px;\n }\n \n .glightbox-light .gnext {\n position: absolute;\n top: -100%;\n right: 30px;\n width: 40px;\n height: 50px;\n }\n \n .glightbox-light .gclose {\n width: 35px;\n height: 35px;\n top: 15px;\n right: 10px;\n position: absolute;\n }\n \n .glightbox-light .gclose svg {\n width: 18px;\n height: auto;\n }\n \n .glightbox-light .gclose:hover {\n opacity: 1;\n }\n \n /**/\n .glightbox-light .gslide-media {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n }\n .glightbox-light .description-left .gdesc-inner,\n .glightbox-light .description-right .gdesc-inner {\n position: absolute;\n height: 100%;\n overflow-y: auto;\n }\n .glightbox-light .gprev,\n .glightbox-light .gnext,\n .glightbox-light .gclose {\n background-color: rgb(255 255 255 / 0%);\n }\n .glightbox-light .gprev:hover,\n .glightbox-light .gnext:hover,\n .glightbox-light .gclose:hover {\n background-color: rgb(255 255 255 / 0%);\n }\n .glightbox-light .gprev {\n top: 45%;\n }\n .glightbox-light .gnext {\n top: 45%;\n }\n \n @media (min-width: 992px) {\n .glightbox-light .gclose {\n opacity: 0.7;\n right: 20px;\n }\n }\n \n /**/\n .glightbox-light .goverlay {\n background: rgb(255 255 255 / 100%) !important;\n }\n @media screen and (max-height: 420px) {\n .goverlay {\n background: rgb(255 255 255 / 100%);\n }\n }\n \n /* override (light) */\n .glightbox-light .gprev,\n .glightbox-light .gnext {\n width: 55px !important;\n height: 70px !important;\n }\n .gclose svg, .gnext svg, .gprev svg {\n width: 50px !important;\n }\n .glightbox-light .gclose {\n width: 55px !important;\n height: 55px !important;\n }\n .glightbox-light .gclose svg {\n width: 30px !important;\n }\n .glightbox-light .gslide-title {\n font-size: 1.2em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n }\n .glightbox-light .gslide-desc {\n font-size: 1em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n } \n \n /* override (clean) */\n .glightbox-clean .gprev,\n .glightbox-clean .gnext {\n width: 55px !important;\n height: 70px !important;\n }\n .gclose svg, .gnext svg, .gprev svg {\n width: 50px !important;\n }\n .glightbox-clean .gclose {\n width: 55px !important;\n height: 55px !important;\n }\n .glightbox-clean .gclose svg {\n width: 30px !important;\n }\n .glightbox-clean .gslide-title {\n font-size: 1.2em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n }\n .glightbox-clean .gslide-desc {\n font-size: 1em !important;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;\n } \n \n /* other override */\n .gclose.disabled, .gnext.disabled, .gprev.disabled {\n opacity: 0;\n } \n "}}class Ue{constructor(t){this.builder=t}detectMobileOrTablet(){const t=navigator.userAgent.toLowerCase(),e=/ipad|iphone|ipod/.test(t)&&!window.MSStream,i=/android/.test(t),n="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,s=window.innerWidth<=1600;return!(!e&&!i)||!(!n||!s)}getScale(t){let e=window.getComputedStyle(t).transform;if("none"===e)return 1;let i=e.split("(")[1];i=i.split(")")[0],i=i.split(",");let n=i[0],s=i[1];return Math.sqrt(n*n+s*s)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,s,o,l=e.split(" ");for(i=0,s=l.length;i<s;++i)if(l[i])try{let e=l[i],s="",a=t.className.split(" ");for(n=0,o=a.length;n<o;++n)a[n]&&a[n]!==e&&(s+=a[n]+" ");t.className=s.trim()}catch(t){}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let s=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(s,e)){let o=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,{get:function(){return o.get.apply(this,arguments)},set:function(){let t=this[e];o.set.apply(this,arguments);let s=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,s),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),s=this.getElm();if(!s)return void(i&&i(!1));let o;o=s&&s.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,s):this.replaceSelection(t,e,n,s),i&&i(!0,o)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const s=i.getRangeAt(0),o=s.extractContents(),l=this.createSpan(n,t,e);return l.appendChild(o),this.cleanChildren(t,l),this.cleanUnusedSpan(l),s.insertNode(l),i.selectAllChildren(l),this.checkStyleIfSameAsParent(l,t),l}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,s=this.findParentStyle(t,e);if(s&&(n=s.style[e]),i===n){t.style[e]="";let s=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=s}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const s=this.getSelectedBlocks();if(s.length>0)s.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const s=this.builder.win.getSelection();let o=this.getElm();if(!o)return;const l=o&&o.innerText===s.toString().trim();(i||l||""===s.toString().trim())&&("block"===n&&"inline"===this.getStyle(o,"display")&&(o=this.getParentBlock(o)),this.updateSelectionClass(t,e,o))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const s=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)s(e.childNodes[t])};s(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const s=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th","li"];return i.forEach((e=>{const i=e.tagName.toLowerCase();s.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),s=this.getElm();if(!s)return;s&&s.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,s):this.replaceSelectionToggle(t,e,i,n,s)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,s){const o=n.getRangeAt(0),l=o.extractContents(),a=document.createElement("span");if("fontWeight"===t){let t=!1;s.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(s,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(s,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(a,i.fontWeight.defaultNormal):this.addClass(a,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;s.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(s,i.fontStyle.normal)&&(t=!1)),t?this.addClass(a,i.fontStyle.normal):this.addClass(a,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;s.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(a,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;s.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(a,i.textDecoration.linethrough)}if("textTransform"===t){let t="";s.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(a,i.textTransform.uppercase),this.removeClass(a,i.textTransform.lowercase),this.removeClass(a,i.textTransform.capitalize),this.removeClass(a,i.textTransform.normal),""===t&&this.addClass(a,i.textTransform.uppercase)}if("extend"===t){let t=!1;s.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(a,i.extend[e])}return a.appendChild(l),this.cleanChildrenToggle(t,e,a,i),this.cleanUnusedSpan(a),o.insertNode(a),n.selectAllChildren(a),a}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const s=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));s&&s.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let s=Array.prototype.filter.call(n,(t=>0===t.attributes.length));s&&s.length>0&&s.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}countOccurrences(t,e){const i=new RegExp(e,"gi"),n=t.match(i);return n?n.length:0}}var We="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ge={exports:{}},Ye={},Xe={exports:{}},Ve={},Ke={};function Ze(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function Qe(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function Je(t,e){this.__indent_cache=new Qe(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Ze(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Ze.prototype.clone_empty=function(){var t=new Ze(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},Ze.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},Ze.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},Ze.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},Ze.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},Ze.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},Ze.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},Ze.prototype.is_empty=function(){return 0===this.__items.length},Ze.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},Ze.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},Ze.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},Ze.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},Ze.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},Ze.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},Ze.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},Qe.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},Qe.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},Qe.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},Qe.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},Je.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},Je.prototype.get_line_number=function(){return this.__lines.length},Je.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},Je.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},Je.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},Je.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},Je.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},Je.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},Je.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},Je.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},Je.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},Je.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},Je.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},Je.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},Je.prototype.just_added_newline=function(){return this.current_line.is_empty()},Je.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},Je.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new Ze(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},Ke.Output=Je;var ti={};ti.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var ei,ii,ni,si,oi,li={};ii="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",si="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",oi="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(ni="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(ei=li).identifier=new RegExp(oi+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),ei.identifierStart=new RegExp(oi),ei.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+ii+ni+si+"])+"),ei.newline=/[\n\r\u2028\u2029]/,ei.lineBreak=new RegExp("\r\n|"+ei.newline.source),ei.allLineBreaks=new RegExp(ei.lineBreak.source,"g");var ai={},ri={};function ci(t,e){this.raw_options=ui(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function ui(t,e){var i,n={};for(i in t=di(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function di(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}ci.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},ci.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},ci.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},ci.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},ci.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},ci.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},ci.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},ri.Options=ci,ri.normalizeOpts=di,ri.mergeOpts=ui;var bi=ri.Options,hi=["before-newline","after-newline","preserve-newline"];function pi(t){bi.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",hi),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}pi.prototype=new bi,ai.Options=pi;var mi={},gi={},fi=RegExp.prototype.hasOwnProperty("sticky");function vi(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}vi.prototype.restart=function(){this.__position=0},vi.prototype.back=function(){this.__position>0&&(this.__position-=1)},vi.prototype.hasNext=function(){return this.__position<this.__input_length},vi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},vi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},vi.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||fi&&t.sticky||i.index!==e&&(i=null),i},vi.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},vi.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},vi.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},vi.prototype.read=function(t,e,i){var n,s="";return t&&(n=this.match(t))&&(s+=n[0]),!e||!n&&t||(s+=this.readUntil(e,i)),s},vi.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var s=t.exec(this.__input);return s?(n=s.index,e&&(n+=s[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},vi.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},vi.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&fi&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},vi.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},vi.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},vi.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},gi.InputScanner=vi;var yi={},xi={};function wi(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}wi.prototype.restart=function(){this.__position=0},wi.prototype.isEmpty=function(){return 0===this.__tokens_length},wi.prototype.hasNext=function(){return this.__position<this.__tokens_length},wi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},wi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},wi.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},xi.TokenStream=wi;var Si={},_i={};function ki(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}ki.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},ki.prototype.read_match=function(){return this._input.match(this._match_pattern)},ki.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},ki.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},ki.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},ki.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},ki.prototype._create=function(){return new ki(this._input,this)},ki.prototype._update=function(){},_i.Pattern=ki;var Ci=_i.Pattern;function Li(t,e){Ci.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}Li.prototype=new Ci,Li.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},Li.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},Li.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},Li.prototype._create=function(){return new Li(this._input,this)},Li.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],s=t.exec(e);s;)n.push(e.substring(i,s.index)),i=s.index+s[0].length,s=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},Si.WhitespacePattern=Li;var Ai=gi.InputScanner,Ei=ti.Token,qi=xi.TokenStream,Ti=Si.WhitespacePattern,Mi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Oi=function(t,e){this._input=new Ai(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Ti(this._input)};Oi.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new qi,this._reset();for(var e=new Ei(Mi.START,""),i=null,n=[],s=new qi;e.type!==Mi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)s.add(t),t=this._get_next_token(e,i);s.isEmpty()||(t.comments_before=s,s=new qi),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Oi.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Oi.prototype._reset=function(){},Oi.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(Mi.RAW,i):this._create_token(Mi.EOF,"")},Oi.prototype._is_comment=function(t){return!1},Oi.prototype._is_opening=function(t){return!1},Oi.prototype._is_closing=function(t,e){return!1},Oi.prototype._create_token=function(t,e){return new Ei(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Oi.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},yi.Tokenizer=Oi,yi.TOKEN=Mi;var zi={};function Ii(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Ii.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Ii.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},zi.Directives=Ii;var Ri={},$i=_i.Pattern,Bi={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Ni(t,e){$i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Bi),this._excluded=Object.assign({},Bi),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new $i(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Ni.prototype=new $i,Ni.prototype._create=function(){return new Ni(this._input,this)},Ni.prototype._update=function(){this.__set_templated_pattern()},Ni.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Ni.prototype.read_options=function(t){var e=this._create();for(var i in Bi)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Ni.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Ni.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Ni.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Ni.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ri.TemplatablePattern=Ni;var Pi=gi.InputScanner,Di=yi.Tokenizer,ji=yi.TOKEN,Hi=zi.Directives,Fi=li,Ui=_i.Pattern,Wi=Ri.TemplatablePattern;function Gi(t,e){return-1!==e.indexOf(t)}var Yi={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:ji.START,RAW:ji.RAW,EOF:ji.EOF},Xi=new Hi(/\/\*/,/\*\//),Vi=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,Ki=/[0-9]/,Zi=/[^\d\.]/,Qi=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Ji=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Ji=(Ji="\\?\\.(?!\\d) "+(Ji=Ji.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var tn,en=new RegExp(Ji),nn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),sn=nn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),on=new RegExp("^(?:"+sn.join("|")+")$"),ln=function(t,e){Di.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new Ui(this._input),n=new Wi(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Fi.identifier).matching(Fi.identifierMatch),number:i.matching(Vi),punct:i.matching(en),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Fi.lineBreak),shebang:i.starting_with(/#!/).until_after(Fi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(ln.prototype=new Di)._is_comment=function(t){return t.type===Yi.COMMENT||t.type===Yi.BLOCK_COMMENT||t.type===Yi.UNKNOWN},ln.prototype._is_opening=function(t){return t.type===Yi.START_BLOCK||t.type===Yi.START_EXPR},ln.prototype._is_closing=function(t,e){return(t.type===Yi.END_BLOCK||t.type===Yi.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},ln.prototype._reset=function(){tn=!1},ln.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Yi.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(Yi.UNKNOWN,this._input.next())},ln.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Fi.allLineBreaks,"\n"),t.type!==Yi.DOT&&(t.type!==Yi.RESERVED||"set"!==t.text&&"get"!==t.text)&&on.test(e)?"in"===e||"of"===e?this._create_token(Yi.OPERATOR,e):this._create_token(Yi.RESERVED,e):this._create_token(Yi.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(Yi.WORD,e):void 0},ln.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(Yi.START_EXPR,t):")"===t||"]"===t?e=this._create_token(Yi.END_EXPR,t):"{"===t?e=this._create_token(Yi.START_BLOCK,t):"}"===t?e=this._create_token(Yi.END_BLOCK,t):";"===t?e=this._create_token(Yi.SEMICOLON,t):"."===t&&Zi.test(this._input.peek(1))?e=this._create_token(Yi.DOT,t):","===t&&(e=this._create_token(Yi.COMMA,t)),e&&this._input.next(),e},ln.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(Yi.EQUALS,t):"?."===t?this._create_token(Yi.DOT,t):this._create_token(Yi.OPERATOR,t)},ln.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(Yi.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(Yi.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(Ki)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(Yi.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Fi.newline);)e+=this._input.next();return tn=!0,this._create_token(Yi.COMMENT,e)}}else if(tn&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return tn=!1,this._create_token(Yi.COMMENT,e);return null},ln.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=Xi.get_directives(i);n&&"start"===n.ignore&&(i+=Xi.readIgnored(this._input)),i=i.replace(Fi.allLineBreaks,"\n"),(e=this._create_token(Yi.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(Yi.COMMENT,i))}return e},ln.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Pi(t),s=null;for(;n.hasNext();)if((s=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=s[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())s=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}s=n.match(/u([0-9A-Fa-f]{4})/g)}if(!s)return t;if((i=parseInt(s[1],16))>126&&i<=255&&0===s[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+s[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Fi.allLineBreaks,"\n"),this._create_token(Yi.STRING,e)}return null},ln.prototype._allow_regexp_or_xml=function(t){return t.type===Yi.RESERVED&&Gi(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Yi.END_EXPR&&")"===t.text&&t.opened.previous.type===Yi.RESERVED&&Gi(t.opened.previous.text,["if","while","for"])||Gi(t.type,[Yi.COMMENT,Yi.START_EXPR,Yi.START_BLOCK,Yi.START,Yi.END_BLOCK,Yi.OPERATOR,Yi.EQUALS,Yi.EOF,Yi.SEMICOLON,Yi.COMMA])},ln.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,s=!1;this._input.hasNext()&&(n||s||this._input.peek()!==t)&&!this._input.testChar(Fi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?s=!0:"]"===this._input.peek()&&(s=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Fi.identifier)),this._create_token(Yi.STRING,i)}return null},ln.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var s=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===s.indexOf("{"),l=0;n;){var a=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===s||o&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--l:++l),i+=n[0],l<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Fi.allLineBreaks,"\n"),this._create_token(Yi.STRING,i)}}return null},ln.prototype._read_string_recursive=function(t,e,i){var n,s;"'"===t?s=this.__patterns.single_quote:'"'===t?s=this.__patterns.double_quote:"`"===t?s=this.__patterns.template_text:"}"===t&&(s=this.__patterns.template_expression);for(var o=s.read(),l="";this._input.hasNext();){if((l=this._input.next())===t||!e&&Fi.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):i&&("${"===i&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),i===l&&(l+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=s.read()}return o},mi.Tokenizer=ln,mi.TOKEN=Yi,mi.positionable_operators=Qi.slice(),mi.line_starters=nn.slice();var an=Ke.Output,rn=ti.Token,cn=li,un=ai.Options,dn=mi.Tokenizer,bn=mi.line_starters,hn=mi.positionable_operators,pn=mi.TOKEN;function mn(t,e){return-1!==e.indexOf(t)}function gn(t,e){return t&&t.type===pn.RESERVED&&t.text===e}function fn(t,e){return t&&t.type===pn.RESERVED&&mn(t.text,e)}var vn=["case","return","do","if","throw","else","await","break","continue","async"],yn=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),xn=[yn.before_newline,yn.preserve_newline],wn="BlockStatement",Sn="Statement",_n="ObjectLiteral",kn="ArrayLiteral",Cn="ForInitializer",Ln="Conditional",An="Expression";function En(t,e){e.multiline_frame||e.mode===Cn||e.mode===Ln||t.remove_indent(e.start_line_index)}function qn(t){return t===kn}function Tn(t){return mn(t,[An,Cn,Ln])}function Mn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new un(e)}Mn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new rn(pn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Mn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new an(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(wn);var i=new dn(t,this._options);return this._tokens=i.tokenize(),t},Mn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&cn.lineBreak.test(t||"")&&(e=t.match(cn.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Mn.prototype.handle_token=function(t,e){t.type===pn.START_EXPR?this.handle_start_expr(t):t.type===pn.END_EXPR?this.handle_end_expr(t):t.type===pn.START_BLOCK?this.handle_start_block(t):t.type===pn.END_BLOCK?this.handle_end_block(t):t.type===pn.WORD||t.type===pn.RESERVED?this.handle_word(t):t.type===pn.SEMICOLON?this.handle_semicolon(t):t.type===pn.STRING?this.handle_string(t):t.type===pn.EQUALS?this.handle_equals(t):t.type===pn.OPERATOR?this.handle_operator(t):t.type===pn.COMMA?this.handle_comma(t):t.type===pn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===pn.COMMENT?this.handle_comment(t,e):t.type===pn.DOT?this.handle_dot(t):t.type===pn.EOF?this.handle_eof(t):(t.type,pn.UNKNOWN,this.handle_unknown(t,e))},Mn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&qn(this._flags.mode);if(t.comments_before)for(var s=t.comments_before.next();s;)this.handle_whitespace_and_comments(s,e),this.handle_token(s,e),s=t.comments_before.next();if(n)for(var o=0;o<i;o+=1)this.print_newline(o>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var l=1;l<i;l+=1)this.print_newline(!0,e)}};var On=["async","break","continue","return","throw","yield"];Mn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(mn(this._flags.last_token.text,hn)||mn(t.text,hn)){var n=mn(this._flags.last_token.text,hn)&&mn(this._options.operator_position,xn)||mn(t.text,hn);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(fn(this._flags.last_token,On))return;this._output.set_wrap_point()}}},Mn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==pn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==Sn||this._flags.if_block&&gn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Mn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||qn(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Mn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===pn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Mn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Mn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Mn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Mn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Sn&&En(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Mn.prototype.start_of_object_property=function(){return this._flags.parent.mode===_n&&this._flags.mode===Sn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||fn(this._flags.last_token,["get","set"]))},Mn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||fn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD)||gn(this._flags.last_token,"do"))||!(this._flags.parent.mode===_n&&this._flags.mode===Sn)&&fn(this._flags.last_token,On)&&!t.newlines)||gn(this._flags.last_token,"else")&&!(gn(t,"if")&&!t.comments_before))||this._flags.last_token.type===pn.END_EXPR&&(this._previous_flags.mode===Cn||this._previous_flags.mode===Ln))||this._flags.last_token.type===pn.WORD&&this._flags.mode===wn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==pn.WORD&&t.type!==pn.RESERVED)||this._flags.mode===_n&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||fn(this._flags.last_token,["get","set"])))&&(this.set_mode(Sn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,fn(t,["do","for","if","while"])),!0)},Mn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=An;if("["===t.text){if(this._flags.last_token.type===pn.WORD||")"===this._flags.last_token.text)return fn(this._flags.last_token,bn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=kn,qn(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),mn(this._flags.last_token.type,[pn.START_EXPR,pn.END_EXPR,pn.WORD,pn.OPERATOR,pn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===pn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Cn):mn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=Ln):mn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(mn(this._flags.last_token.text,bn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===pn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);fn(i,["async","function"])||"*"===i.text&&fn(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_n&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===pn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(mn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&mn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===pn.START_BLOCK?this.print_newline():this._flags.last_token.type!==pn.END_EXPR&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==pn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Mn.prototype.handle_end_expr=function(t){for(;this._flags.mode===Sn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&qn(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==pn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),En(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Ln&&(this._previous_flags.mode=An,this._flags.do_block=!1,this._flags.do_while=!1)},Mn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR?(this.set_mode(wn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(wn):i&&(mn(i.text,[":",","])&&mn(e.type,[pn.STRING,pn.WORD,pn.RESERVED])||mn(e.text,["get","set","..."])&&mn(i.type,[pn.WORD,pn.RESERVED]))?mn(this._last_last_text,["class","interface"])?this.set_mode(wn):this.set_mode(_n):this._flags.last_token.type===pn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(wn):mn(this._flags.last_token.type,[pn.EQUALS,pn.START_EXPR,pn.COMMA,pn.OPERATOR])||fn(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_n):this.set_mode(wn);var n=!e.comments_before&&"}"===e.text,s=n&&"function"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR;if(this._options.brace_preserve_inline){var o=0,l=null;this._flags.inline_frame=!0;do{if(o+=1,(l=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(l.type!==pn.EOF&&(l.type!==pn.END_BLOCK||l.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==pn.OPERATOR&&(s||this._flags.last_token.type===pn.EQUALS||fn(this._flags.last_token,vn)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!qn(this._previous_flags.mode)||this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.COMMA||((this._flags.last_token.type===pn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==pn.OPERATOR&&this._flags.last_token.type!==pn.START_EXPR&&(this._flags.last_token.type!==pn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Mn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===Sn;)this.restore_mode();var e=this._flags.last_token.type===pn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(qn(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Mn.prototype.handle_word=function(t){if(t.type===pn.RESERVED)if(mn(t.text,["set","get"])&&this._flags.mode!==_n)t.type=pn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=pn.WORD;else if(mn(t.text,["as","from"])&&!this._flags.import_block)t.type=pn.WORD;else if(this._flags.mode===_n){":"===this._tokens.peek().text&&(t.type=pn.WORD)}if(this.start_of_statement(t)?fn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Tn(this._flags.mode)||this._flags.last_token.type===pn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===pn.EQUALS||!this._options.preserve_newlines&&fn(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(gn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&gn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Sn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&fn(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==pn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.EQUALS&&this._flags.last_token.type!==pn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),gn(t,"function"))return(mn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!mn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==pn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD?fn(this._flags.last_token,["get","set","new","export"])||fn(this._flags.last_token,On)||gn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===pn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Tn(this._flags.mode)&&!qn(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===pn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":fn(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&this._flags.mode===wn?e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&Tn(this._flags.mode)?e="SPACE":this._flags.last_token.type===pn.STRING?e="NEWLINE":this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||"*"===this._flags.last_token.text&&(mn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&mn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===pn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===pn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),fn(t,bn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),fn(t,["else","catch","finally"]))?(this._flags.last_token.type!==pn.END_BLOCK||this._previous_flags.mode!==wn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?fn(this._flags.last_token,vn)||"declare"===this._flags.last_token.text&&fn(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==pn.END_EXPR?this._flags.last_token.type===pn.START_EXPR&&fn(t,["var","let","const"])||":"===this._flags.last_token.text||(gn(t,"if")&&gn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):fn(t,bn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&qn(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==pn.WORD&&t.previous.type!==pn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===pn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&gn(t,"from")&&(this._flags.import_block=!1))},Mn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==Sn||this._flags.if_block&&gn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Mn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==pn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR||this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==pn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Mn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Mn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Tn(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_n||this._flags.mode===Sn&&this._flags.parent.mode===_n?(this._flags.mode===Sn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Mn.prototype.handle_operator=function(t){var e="*"===t.text&&(fn(this._flags.last_token,["function","yield"])||mn(this._flags.last_token.type,[pn.START_BLOCK,pn.COMMA,pn.END_BLOCK,pn.SEMICOLON])),i=mn(t.text,["-","+"])&&(mn(this._flags.last_token.type,[pn.START_BLOCK,pn.START_EXPR,pn.EQUALS,pn.OPERATOR])||mn(this._flags.last_token.text,bn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(fn(this._flags.last_token,vn))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==pn.DOT)if("::"!==t.text){if(this._flags.last_token.type===pn.OPERATOR&&mn(this._options.operator_position,xn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==pn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var s=!0,o=!0,l=!1;if(":"===t.text?0===this._flags.ternary_depth?s=!1:(this._flags.ternary_depth-=1,l=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&mn(t.text,hn)){var a=":"===t.text,r=a&&l,c=a&&!l;switch(this._options.operator_position){case yn.before_newline:return this._output.space_before_token=!c,this.print_token(t),a&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case yn.after_newline:return this._output.space_before_token=!0,!a||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case yn.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),s=!(this._output.just_added_newline()||c),this._output.space_before_token=s,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),s=!1;var u=this._tokens.peek();o=u&&mn(u.type,[pn.WORD,pn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),s=this._flags.last_token.type===pn.START_BLOCK,o=!1):(mn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR||this.allow_wrap_or_preserved_newline(t),s=!1,o=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Tn(this._flags.mode)&&(s=!0),this._flags.last_token.type===pn.RESERVED?s=!0:this._flags.last_token.type===pn.END_EXPR?s=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===pn.OPERATOR&&(s=mn(t.text,["--","-","++","+"])&&mn(this._flags.last_token.text,["--","-","++","+"]),mn(t.text,["+","-"])&&mn(this._flags.last_token.text,["--","++"])&&(o=!0)),(this._flags.mode!==wn||this._flags.inline_frame)&&this._flags.mode!==Sn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||s,this.print_token(t),this._output.space_before_token=o}else this.print_token(t);else this.print_token(t)},Mn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):cn.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Mn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(cn.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),s=!1,o=!1,l=t.whitespace_before,a=l.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(s=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),o=function(t,e){for(var i,n=0,s=t.length;n<s;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,l),s&&(this._flags.alignment=1),i=0;i<n.length;i++)s?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):o&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(a))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Mn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Mn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),fn(this._flags.last_token,vn)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Mn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Mn.prototype.handle_eof=function(t){for(;this._flags.mode===Sn;)this.restore_mode();this.handle_whitespace_and_comments(t)},Ve.Beautifier=Mn;var zn=Ve.Beautifier,In=ai.Options;Xe.exports=function(t,e){return new zn(t,e).beautify()},Xe.exports.defaultOptions=function(){return new In};var Rn={exports:{}},$n={},Bn={},Nn=ri.Options;function Pn(t){Nn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Pn.prototype=new Nn,Bn.Options=Pn;var Dn=Bn.Options,jn=Ke.Output,Hn=gi.InputScanner,Fn=new(0,zi.Directives)(/\/\*/,/\*\//),Un=/\r\n|[\r\n]/,Wn=/\r\n|[\r\n]/g,Gn=/\s/,Yn=/(?:\s|\n)+/g,Xn=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,Vn=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Kn(t,e){this._source_text=t||"",this._options=new Dn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Kn.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},Kn.prototype.eatWhitespace=function(t){for(var e=Gn.test(this._input.peek()),i=0;Gn.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},Kn.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},Kn.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},Kn.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},Kn.prototype.indent=function(){this._indentLevel++},Kn.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},Kn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Un.test(t||"")&&(e=t.match(Un)[0]));var i=(t=t.replace(Wn,"\n")).match(/^[\t ]*/)[0];this._output=new jn(this._options,i),this._input=new Hn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,s,o=0,l=!1,a=!1,r=!1,c=!1,u=!1,d=this._ch;n=""!==this._input.read(Yn),s=d,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),d=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var b=this._input.read(Xn),h=Fn.get_directives(b);h&&"start"===h.ignore&&(b+=Fn.readIgnored(this._input)),this.print_string(b),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(Vn)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var p=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);p.match(/[ :]$/)&&(p=this.eatString(": ").replace(/\s$/,""),this.print_string(p),this._output.space_before_token=!0),"extend"===(p=p.replace(/\s$/,""))?c=!0:"import"===p&&(u=!0),p in this.NESTED_AT_RULE?(this._nestedLevel+=1,p in this.CONDITIONAL_GROUP_RULE&&(r=!0)):l||0!==o||-1===p.indexOf(":")||(a=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(a&&(a=!1,this.outdent()),r?(r=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===s&&this._output.trim(!0),u=!1,c=!1,a&&(this.outdent(),a=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!l&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==o?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),a||(a=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===o?(a&&(this.outdent(),a=!1),c=!1,u=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),o++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),o&&(o--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),o++,this.indent()):")"===this._ch?(o&&(o--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||a||0!==o||u||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||a||0!==o?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Gn.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Gn.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},$n.Beautifier=Kn;var Zn=$n.Beautifier,Qn=Bn.Options;Rn.exports=function(t,e){return new Zn(t,e).beautify()},Rn.exports.defaultOptions=function(){return new Qn};var Jn={exports:{}},ts={},es={},is=ri.Options;function ns(t){is.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ns.prototype=new is,es.Options=ns;var ss={},os=yi.Tokenizer,ls=yi.TOKEN,as=zi.Directives,rs=Ri.TemplatablePattern,cs=_i.Pattern,us={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:ls.START,RAW:ls.RAW,EOF:ls.EOF},ds=new as(/<\!--/,/-->/),bs=function(t,e){os.call(this,t,e),this._current_tag_name="";var i=new rs(this._input).read_options(this._options),n=new cs(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var s=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(s).until_after(s)}};(bs.prototype=new os)._is_comment=function(t){return!1},bs.prototype._is_opening=function(t){return t.type===us.TAG_OPEN},bs.prototype._is_closing=function(t,e){return t.type===us.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},bs.prototype._reset=function(){this._current_tag_name=""},bs.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(us.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(us.UNKNOWN,this._input.next())},bs.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=ds.get_directives(i))&&"start"===n.ignore&&(i+=ds.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(us.COMMENT,i)).directives=n));return e},bs.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(us.COMMENT,i)).directives=null)}return e},bs.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(us.TAG_OPEN,i)),n},bs.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(us.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(us.TAG_OPEN,i))),n},bs.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(us.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(us.TAG_CLOSE,"}}"))),n},bs.prototype._read_attribute=function(t,e,i){var n=null,s="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(us.EQUALS,this._input.next());else if('"'===t||"'"===t){var o=this._input.next();o+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(us.VALUE,o)}else(s=this.__patterns.attribute.read())&&(n=e.type===us.EQUALS?this._create_token(us.VALUE,s):this._create_token(us.ATTRIBUTE,s));return n},bs.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},bs.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===us.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var s=e.opened.text.substr(1).toLowerCase();if("script"===s||"style"===s){var o=this._read_comment_or_cdata(t);if(o)return o.type=us.TEXT,o;n=this._input.readUntil(new RegExp("</"+s+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(s)&&(n=this._input.readUntil(new RegExp("</"+s+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(us.TEXT,n):null},bs.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(us.TEXT,e)},ss.Tokenizer=bs,ss.TOKEN=us;var hs=es.Options,ps=Ke.Output,ms=ss.Tokenizer,gs=ss.TOKEN,fs=/\r\n|[\r\n]/,vs=/\r\n|[\r\n]/g,ys=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new ps(t,e)};ys.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},ys.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},ys.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},ys.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},ys.prototype.print_preserved_newlines=function(t){var e=0;t.type!==gs.TEXT&&t.previous.type!==gs.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},ys.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},ys.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},ys.prototype.print_newline=function(t){this._output.add_new_line(t)},ys.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},ys.prototype.indent=function(){this.indent_level++},ys.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var xs=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==gs.EOF&&t.closed!==i;){if(i.type===gs.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===gs.EQUALS&&i.next.next&&i.next.next.type===gs.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function ws(t,e){return-1!==e.indexOf(t)}function Ss(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function _s(t){this._printer=t,this._current_frame=null}function ks(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var s=new hs(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}_s.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_s.prototype.record_tag=function(t){var e=new Ss(this._current_frame,t,this._printer.indent_level);this._current_frame=e},_s.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},_s.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},_s.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},_s.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},ks.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&fs.test(t)&&(e=t.match(fs)[0]));var i=(t=t.replace(vs,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},s=new Cs,o=new ys(this._options,i),l=new ms(t,this._options).tokenize();this._tag_stack=new _s(o);for(var a=null,r=l.next();r.type!==gs.EOF;)r.type===gs.TAG_OPEN||r.type===gs.COMMENT?s=a=this._handle_tag_open(o,r,s,n):r.type===gs.ATTRIBUTE||r.type===gs.EQUALS||r.type===gs.VALUE||r.type===gs.TEXT&&!s.tag_complete?a=this._handle_inside_tag(o,r,s,l):r.type===gs.TAG_CLOSE?a=this._handle_tag_close(o,r,s):r.type===gs.TEXT?a=this._handle_text(o,r,s):o.add_raw_token(r),n=a,r=l.next();return o._output.get_code(e)},ks.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},ks.prototype._handle_inside_tag=function(t,e,i,n){var s=i.has_wrapped_attrs,o={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===gs.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===gs.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===gs.EQUALS||e.type===gs.VALUE&&e.previous.type===gs.EQUALS)&&t.set_space_before_token(!1),e.type===gs.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),s=s||0!==e.newlines),this._is_wrap_attributes_force)){var l=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var a,r=!0,c=0;do{if((a=n.peek(c)).type===gs.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&a.type!==gs.EOF&&a.type!==gs.TAG_CLOSE);l=!r}l&&(t.print_newline(!1),s=!0)}t.print_token(e),s=s||t.previous_token_wrapped(),i.has_wrapped_attrs=s}return o},ks.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},ks.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var s,o=e.text,l=1,a="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?s=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?s=this._css_beautify:"html"===i.custom_beautifier_name&&(s=function(t,e){return new ks(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?l=0:"separate"===this._options.indent_scripts&&(l=-t.indent_level);var c=t.get_full_indent(l);if(o=o.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!u)return void t.add_raw_token(e);a=c+u[1]+"\n",o=u[4],u[5]&&(r=c+u[5]),o=o.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}if(o)if(s){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,o=s(c+o,new d)}else{var b=e.whitespace_before;b&&(o=o.replace(new RegExp("\n("+b+")?","g"),"\n")),o=c+o.replace(/\n/g,"\n"+c)}a&&(o=o?a+o+"\n"+r:a+r),t.print_newline(!1),o&&(e.text=o,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},ks.prototype._handle_tag_open=function(t,e,i,n){var s=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==gs.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,s,i,n),s.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),s.start_tag_token=this._tag_stack.try_pop(s.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(s.alignment_size=e.text.length+1),s.tag_complete||s.is_unformatted||(t.alignment_size=s.alignment_size),s};var Cs=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===gs.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};ks.prototype._get_tag_open_token=function(t){var e=new Cs(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||ws(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&ws(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&ws(e.tag_check,this._options.content_unformatted),e.is_inline_element=ws(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},ks.prototype._set_tag_position=function(t,e,i,n,s){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=xs(i.tag_check,e)))),ws(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&s.type===gs.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var o=!1;o=(o=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(s.type===gs.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==s.type,(i.is_content_unformatted||i.is_unformatted)&&(o=!1),o&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===s.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},ks.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Ls=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],As=["a","audio","del","ins","map","noscript","video"];ks.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Ls.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==As.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ts.Beautifier=ks;var Es=ts.Beautifier,qs=es.Options;Jn.exports=function(t,e,i,n){return new Es(t,e,i,n).beautify()},Jn.exports.defaultOptions=function(){return new qs};var Ts=Xe.exports,Ms=Rn.exports,Os=Jn.exports;function zs(t,e,i,n){return Os(t,e,i=i||Ts,n=n||Ms)}zs.defaultOptions=Os.defaultOptions,Ye.js=Ts,Ye.css=Ms,Ye.html=zs,function(t){var e=Ye;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(Ge);var Is=Ge.exports;function Rs(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function $s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bs(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$s(Object(i),!0).forEach((function(e){Rs(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ns(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i,n,s={},o=Object.keys(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||(s[i]=t[i]);return s}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function Ps(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ds(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function js(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Hs(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?js(Object(i),!0).forEach((function(e){Ds(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):js(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Fs(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function Us(t){return function e(){for(var i=this,n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.apply(i,[].concat(s,n))}}}function Ws(t){return{}.toString.call(t).includes("Object")}function Gs(t){return"function"==typeof t}var Ys=Us((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),Xs={changes:function(t,e){return Ws(e)||Ys("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Ys("changeField"),e},selector:function(t){Gs(t)||Ys("selectorType")},handler:function(t){Gs(t)||Ws(t)||Ys("handlerType"),Ws(t)&&Object.values(t).some((function(t){return!Gs(t)}))&&Ys("handlersType")},initial:function(t){var e;t||Ys("initialIsRequired"),Ws(t)||Ys("initialType"),e=t,Object.keys(e).length||Ys("initialContent")}};function Vs(t,e){return Gs(e)?e(t.current):e}function Ks(t,e){return t.current=Hs(Hs({},t.current),e),e}function Zs(t,e,i){return Gs(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var Qs={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Xs.initial(t),Xs.handler(e);var i={current:t},n=Us(Zs)(i,e),s=Us(Ks)(i),o=Us(Xs.changes)(t),l=Us(Vs)(i);function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return Xs.selector(t),t(i.current)}function r(t){Fs(n,s,o,l)(t)}return[a,r]}};var Js,to={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},eo=(Js=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return n.length>=Js.length?Js.apply(this,n):function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return t.apply(e,[].concat(n,s))}})(to),io={config:function(t){var e;return t||eo("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||eo("configType"),t.urls?(console.warn(to.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function no(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],no(t[i],e[i]))})),Bs(Bs({},t),e)}var so={type:"cancelation",msg:"operation is manually canceled"};function oo(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(so):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var lo,ao,ro=Qs.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),co=(ao=2,function(t){if(Array.isArray(t))return t}(lo=ro)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,s=!1,o=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done)&&(i.push(l.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(s)throw o}}return i}}(lo,ao)||function(t,e){if(t){if("string"==typeof t)return Ps(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ps(t,e):void 0}}(lo,ao)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),uo=co[0],bo=co[1];function ho(t){return document.body.appendChild(t)}function po(t){var e=uo((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function mo(){var t=uo((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){go(e),t.resolve(e)}),(function(e){t.reject(e)}))}function go(t){uo().monaco||bo({monaco:t})}var fo=new Promise((function(t,e){return bo({resolve:t,reject:e})})),vo={config:function(t){var e=io.config(t),i=e.monaco,n=Ns(e,["monaco"]);bo((function(t){return{config:no(t.config,n),monaco:i}}))},init:function(){var t=uo((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(bo({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),oo(fo);if(window.monaco&&window.monaco.editor)return go(window.monaco),t.resolve(window.monaco),oo(fo);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(ho,po)(mo)}return oo(fo)},__getMonacoInstance:function(){return uo((function(t){return t.monaco}))}};let yo={};class xo{constructor(t){this.builder=t}renderPanel(){const t=this.builder.builderStuff,e=this.builder.util,i=this.builder.dom;let n=t.querySelector(".viewhtml");if(!n){const s=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" id="__tabsupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea id="__viewhtmlmonaco" style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" id="__input_code_editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;i.appendHtml(t,s),n=t.querySelector(".viewhtml");let o=t.querySelector(".viewhtmlmonaco"),l=t.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");i.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=l.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)})),a=l.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)}))}}applyHtml(t){const e=this.builder.util,i=e.cellSelected();i&&i.parentNode.classList.add("row-active");let n=this.builder.codeEditorMode,s=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===n){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===n){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===n){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender(),t.firstChild&&t.firstChild.click(),t.classList.remove("row-outline"),e.hideColumnTool()}if("full"===n){if(this.builder.docContainer)return this.builder.loadHTML(o),e.clearControls(),void this.builder.hideModal(t);s.innerHTML="";let i=document.createRange();i.setStart(s,0),s.appendChild(i.createContextualFragment(o)),this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff;this.renderPanel();const i=e.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(i,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),i.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=this.builder.builderStuff,e=document.querySelector("textarea[data-source-active]");let i=t.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return vo.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const n=this.builder.monaco.editor.createModel(e.value,"html");this.builder.codeEditorExternal.setModel(n),i.style.opacity=""}view(t,e,i){this.renderPanel();const n=this.builder.util,s=this.builder.builderStuff;let o;o=this.builder.opts.htmlSyntaxHighlighting?s.querySelector(".viewhtmlmonaco"):s.querySelector(".viewhtml");let l=o.querySelector(".is-modal-content"),a=o.querySelector(".input-code-editor");a.style.opacity=.01,"full"===t?(l.style.width=this.builder.codeEditorWidth,l.style.maxWidth=this.builder.codeEditorMaxWidth,a.style.height=this.builder.codeEditorHeight):(l.style.width=this.builder.blockCodeEditorWidth,l.style.maxWidth=this.builder.blockCodeEditorMaxWidth,a.style.height=this.builder.blockCodeEditorHeight);const r=this.builder.doc.querySelector(".row-active");r&&r.classList.remove("row-active"),n.showModal(o,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus());const t=n.cellSelected();t&&t.parentNode.classList.add("row-active")})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.dom,n=this.builder.util,s=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=s.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return vo.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=s.querySelector(".viewhtml");let l=o.querySelector("textarea");if("cell"===t){const t=n.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=n.cellSelected();if(t=e?e.parentNode:n.rowSelected(),!t)return;let s=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,s.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,i.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const i=n.cellSelected();e=i?i.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(l.value,"html");this.builder.codeEditor.setModel(t)}let a=s.querySelector(".is-pop.columnmore");a&&(a.style.display="");let r=s.querySelector(".is-pop.rowmore");r&&(r.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in yo)t=t.replace(e,yo[e]);return t}readHtml(t,e,i,n){const s=this.builder.dom;if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const o=this.builder.util;let l,a=document.createElement("div");a.innerHTML=t.innerHTML;let r=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(r,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,o.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(yo={},r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=o.makeId();yo[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=o.makeId(),yo[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=o.makeId(),yo[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let c=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(c,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),s.removeClass(t,"builder-active");s.elementChildren(t).forEach((t=>{s.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));let u;if(s.elementChildren(a).forEach((t=>{t.style.cursor="";s.elementChildren(t).forEach((t=>{t.style.cursor=""}))})),u=a.querySelectorAll(".sortable-chosen, .sortable-ghost, .elm-active, .icon-active, .elm-inspected, .cell-active, .row-active, .row-outline, .is-builder"),u.forEach((t=>{t.classList.remove("sortable-chosen"),t.classList.remove("sortable-ghost"),t.classList.remove("elm-active"),t.classList.remove("icon-active"),t.classList.remove("elm-inspected"),t.classList.remove("cell-active"),t.classList.remove("row-active"),t.classList.remove("row-outline"),t.classList.remove("is-builder")})),u=a.querySelectorAll("[data-click], [contenteditable], [draggridoutline], [between-blocks-left], [between-blocks-center], [hideelementhighlight], [data-module-active], [draggable]"),u.forEach((t=>{t.removeAttribute("data-click"),t.removeAttribute("contenteditable"),t.removeAttribute("draggridoutline"),t.removeAttribute("between-blocks-left"),t.removeAttribute("between-blocks-center"),t.removeAttribute("hideelementhighlight"),t.removeAttribute("data-module-active"),t.removeAttribute("draggable")})),u=a.querySelectorAll("[data-animated], [data-saveforundo], [hidesnippetaddtool], [gray], [rowoutline], [hidecolumntool], [grayoutline], [hideoutline]"),u.forEach((t=>{t.removeAttribute("data-animated"),t.removeAttribute("data-saveforundo"),t.removeAttribute("hidesnippetaddtool"),t.removeAttribute("gray"),t.removeAttribute("rowoutline"),t.removeAttribute("hidecolumntool"),t.removeAttribute("grayoutline"),t.removeAttribute("hideoutline")})),u=a.querySelectorAll("[leftrowtool], [minimal], [clean], [grideditor], [gridoutline]"),u.forEach((t=>{t.removeAttribute("leftrowtool"),t.removeAttribute("minimal"),t.removeAttribute("clean"),t.removeAttribute("grideditor"),t.removeAttribute("gridoutline")})),u=a.querySelectorAll(".is-row-tool,.is-col-tool,.is-rowadd-tool,.is-canvas-tool,.is-canvasadd-tool,.h-ruler,.v-ruler"),u.forEach((t=>{t.previousSibling&&t.previousSibling.nodeType===Node.TEXT_NODE&&t.previousSibling.remove(),t.nextSibling&&t.nextSibling.nodeType===Node.TEXT_NODE&&t.nextSibling.remove(),t.remove()})),u=a.querySelectorAll(".ovl,.row-add-initial"),u.forEach((t=>{t.remove()})),this.builder.cleanAOS&&(u=a.querySelectorAll(".aos-init, .aos-animate"),u.forEach((t=>{t.classList.remove("aos-init"),t.classList.remove("aos-animate")}))),u=a.querySelectorAll(".skrollable, .skrollable-after, .skrollable-before, .skrollable-between, .is-inview"),u.forEach((t=>{t.classList.remove("skrollable"),t.classList.remove("skrollable-after"),t.classList.remove("skrollable-before"),t.classList.remove("skrollable-between"),t.classList.remove("is-inview")})),a.querySelectorAll('[class=""]').forEach((t=>{t.removeAttribute("class")})),a.querySelectorAll(".is-row-overlay").forEach((t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),s.removeEmptyStyle(a),u=a.querySelectorAll("[data-keep]"),s.removeAttributes(u,"data-keep"),a.querySelectorAll("a").forEach((t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(l="",i){u=a.querySelectorAll(".is-dummy"),u.forEach((t=>{t.remove()})),u=a.querySelectorAll("[data-scroll], [data-scroll-once]"),u.forEach((t=>{t.removeAttribute("data-scroll"),t.removeAttribute("data-scroll-once")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]"),u.forEach((t=>{t.removeAttribute("data-noedit"),t.removeAttribute("data-module"),t.removeAttribute("data-module-desc"),t.removeAttribute("data-dialog-width"),t.removeAttribute("data-dialog-height"),t.removeAttribute("data-html"),t.removeAttribute("data-settings")})),u=a.querySelectorAll("[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]"),u.forEach((t=>{t.removeAttribute("data-html-1"),t.removeAttribute("data-html-2"),t.removeAttribute("data-html-3"),t.removeAttribute("data-html-4"),t.removeAttribute("data-html-5"),t.removeAttribute("data-html-6"),t.removeAttribute("data-html-7"),t.removeAttribute("data-html-8"),t.removeAttribute("data-html-9"),t.removeAttribute("data-html-10")}))),u=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(u,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),u=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"animated"),s.removeClass(t,"pulse"),s.removeClass(t,"bounceIn"),s.removeClass(t,"fadeIn"),s.removeClass(t,"fadeOut"),s.removeClass(t,"fadeInDown"),s.removeClass(t,"fadeInLeft"),s.removeClass(t,"fadeInRight"),s.removeClass(t,"fadeInUp"),s.removeClass(t,"flipInX"),s.removeClass(t,"flipInY"),s.removeClass(t,"slideInUp"),s.removeClass(t,"slideInDown"),s.removeClass(t,"slideInLeft"),s.removeClass(t,"slideInRight"),s.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),u=a.querySelectorAll(".is-appeared, .box-active, .section-active, .section-select, .box-select"),u.forEach((t=>{t.classList.remove("is-appeared"),t.classList.remove("box-active"),t.classList.remove("section-active"),t.classList.remove("section-select"),t.classList.remove("box-select")})),u=a.querySelectorAll(".is-section-tool, .is-box-tool, .is-box-info, .is-section-info"),u.forEach((t=>{t.previousSibling&&t.previousSibling.nodeType===Node.TEXT_NODE&&t.previousSibling.remove(),t.nextSibling&&t.nextSibling.nodeType===Node.TEXT_NODE&&t.nextSibling.remove(),t.remove()})),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),s.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"active"),s.removeClass(t,"multi"),s.removeClass(t,"editable"),s.removeClass(t,"fluid"),s.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t)));var d="",b="",h="";s.elementChildren(a).forEach((t=>{let e=t;if(s.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;l+=o,-1===i.indexOf("is-static")?d+=o+"\n\n":b+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,l+=o,h+=o}));let e=document.querySelector("[data-contentbox]"),i=!1;e&&(i=e.settings.disableStaticSection),i||(l=d+b+h),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]"),u.forEach((t=>{t.removeAttribute("data-noedit"),t.removeAttribute("data-module"),t.removeAttribute("data-module-desc"),t.removeAttribute("data-dialog-width"),t.removeAttribute("data-dialog-height"),t.removeAttribute("data-html"),t.removeAttribute("data-settings")})),u=a.querySelectorAll("[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]"),u.forEach((t=>{t.removeAttribute("data-html-1"),t.removeAttribute("data-html-2"),t.removeAttribute("data-html-3"),t.removeAttribute("data-html-4"),t.removeAttribute("data-html-5"),t.removeAttribute("data-html-6"),t.removeAttribute("data-html-7"),t.removeAttribute("data-html-8"),t.removeAttribute("data-html-9"),t.removeAttribute("data-html-10")}))),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),s.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{s.removeClass(t,"active"),s.removeClass(t,"multi"),s.removeClass(t,"editable"),s.removeClass(t,"fluid"),s.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let p=Is.html;return l=p(l),l=l.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),l}beautify(t){return t=(t=(0,Is.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class wo{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,s=this.builder.doc.getElementsByTagName("link");for(i=0;i<s.length;i++)n=s[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&s[i].parentNode.removeChild(s[i]);let o=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(o,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){if(this.builder.docContainer){return this.builder.doc.querySelector(this.builder.docContainer).innerHTML}{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".is-canvas-tool")),e.removeElements(t.querySelectorAll(".is-canvasadd-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),e.removeElements(t.querySelectorAll(".h-ruler")),e.removeElements(t.querySelectorAll(".v-ruler")),n=t.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),e.removeElements(n),n=t.querySelectorAll(".is-block"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"active"),e.removeClass(t,"multi"),e.removeClass(t,"editable"),e.removeClass(t,"fluid"),e.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),t.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly)if(this.builder.docContainer){let e=this.builder.doc.querySelector(this.builder.docContainer),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}else{const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let e=this.builder.doc.querySelector(this.builder.opts.page),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.applyBehaviorCanvas(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new Fe(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.applyBehaviorCanvas(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new Fe(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
20
20
  /*!
21
21
  Ionicons
22
22
  License: MIT