!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n,r={exports:{}}; /*! grapesjs - 0.21.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,n=()=>(()=>{var e={410:(t,e,n)=>{var r,o,i;o=[n(50),n(316)],void 0===(i="function"==typeof(r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function o(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=o(arguments,1)),t.all(n,function(t){return t in e}))}var a,s,l=(a=!1,s=-1,function(){return a||(s++,a=!0,t.defer(function(){a=!1})),s});function c(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,r,o){for(var i,a=0,s=n.length;at.maximumStackLength&&(t.shift(),t.pointer--)}}}c.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,function(t){return this.registeredObjects[t]},this).concat(this.registeredObjects)}};var h={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,o){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),o&&o.unsetData&&o.unsetData.before&&o.unsetData.before.length&&t.each(o.unsetData.before,e.unset,e))},redo:function(e,n,r,o){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),o&&o.unsetData&&o.unsetData.after&&o.unsetData.after.length&&t.each(o.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),o=t.keys(r),i=t.pick(e.previousAttributes(),o),a=t.keys(i),s=(n||(n={})).unsetData={after:[],before:[]};return o.length!=a.length&&(o.length>a.length?t.each(o,function(t){t in i||s.before.push(t)},this):t.each(a,function(t){t in r||s.after.push(t)})),{object:e,before:i,after:r,options:t.clone(n)}}},reset:{undo:function(t,e){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function g(){}function v(e,n,r,o){if("object"==typeof n)return t.each(n,function(t,n){2===e?v(e,t,r,o):v(e,n,t,r)});switch(e){case 0:i(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(o[n]=r);break;case 1:o[n]&&t.isObject(r)&&(o[n]=t.extend({},o[n],r));break;case 2:delete o[n]}return this}g.prototype=h;var y=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(){p("undo",this.attributes)},redo:function(){p("redo",this.attributes)}}),m=e.Collection.extend({model:y,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),b=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new m,this.objectRegistry=new c,this.undoTypes=new g,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(t,e){this.stack.setMaxLength(e)},this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){d(this.stack,t,o(arguments,1),this.undoTypes)},register:function(){u("on",arguments,this._addToStack,this)},unregister:function(){u("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){f("undo",this,this.stack,t)},undoAll:function(){f("undo",this,this.stack,!1,!0)},redo:function(t){f("redo",this,this.stack,t)},redoAll:function(){f("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer{var r,o,i;i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(50),n(895),e],o=function(t,e,n){i.Backbone=function(t,e,n,r){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.4.1",e.$=r,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,s=e.Events={},l=/\s+/,c=function(t,e,r,o,i){var a,s=0;if(r&&"object"==typeof r){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(a=n.keys(r);sthis.length&&(o=this.length),o<0&&(o+=this.length+1);var i,a,s=[],l=[],c=[],u=[],p={},f=e.add,d=e.merge,h=e.remove,g=!1,v=this.comparator&&null==o&&!1!==e.sort,y=n.isString(this.comparator)?this.comparator:null;for(a=0;a7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(z,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),R.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!R.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(B,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new R,y.extend=m.extend=D.extend=k.extend=R.extend=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};var U=function(){throw new Error('A "url" property or function must be specified')},W=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}(i,n,t,e)}.apply(e,r),void 0===o||(t.exports=o)},210:(t,e,n)=>{!function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,o){var i=!1;return"html"==this.configuration&&(i=!!o.context&&e.test(o.context.tagName)),!i&&("tag"==t&&/>$/.test(n)&&o.context||/^-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+i.commentStart.length,s)+t.substr(s+i.commentEnd.length)),o.replaceRange(t,n,r)}})}),t.defineExtension("autoIndentRange",function(t,e){var n=this;this.operation(function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")})}),t.defineExtension("autoFormatRange",function(e,n){var r=this,o=r.getMode(),i=r.getRange(e,n).split("\n"),a=t.copyState(o,r.getTokenAt(e).state),s=r.getOption("tabSize"),l="",c=0,u=0===e.ch;function p(){l+="\n",u=!0,++c}for(var f=0;f2),y=/Android/.test(t),m=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),w=/\bCrOS\b/.test(t),_=/win/i.test(e),x=f&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,l=!0);var C=b&&(c||f&&(null==x||x<12.11)),S=n||a&&s>=9;function O(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,k=function(t,e){var n=t.className,r=O(e).exec(n);if(r){var o=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function P(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function E(t,e){return P(t).appendChild(e)}function A(t,e,n,r){var o=document.createElement(t);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof e)o.appendChild(document.createTextNode(e));else if(e)for(var i=0;i=e)return a+(e-i);a+=s-i,a+=n-a%n,i=s+1}}v?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};function z(t,e){for(var n=0;n=e)return r+Math.min(a,e-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||Q.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ot(t){return t.charCodeAt(0)>=768&&rt.test(t)}function it(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var o=(e+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+r}}var st=null;function lt(t,e,n){var r;st=null;for(var o=0;oe)return o;i.to==e&&(i.from!=i.to&&"before"==n?r=o:st=o),i.from==e&&(i.from!=i.to&&"before"!=n?r=o:st=o)}return null!=r?r:st}var ct=function(){function t(t){return t<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,i=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(s,l){var c="ltr"==l?"L":"R";if(0==s.length||"ltr"==l&&!e.test(s))return!1;for(var u=s.length,p=[],f=0;f-1&&(r[e]=o.slice(0,i).concat(o.slice(i+1)))}}}function gt(t,e){var n=dt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function bt(t){t.prototype.on=function(t,e){ft(this,t,e)},t.prototype.off=function(t,e){ht(this,t,e)}}function wt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function _t(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function xt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Ct(t){wt(t),_t(t)}function St(t){return t.target||t.srcElement}function Ot(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),b&&t.ctrlKey&&1==e&&(e=3),e}var Tt,kt,Pt=function(){if(a&&s<9)return!1;var t=A("div");return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==Tt){var e=A("span","​");E(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Tt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Tt?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function At(t){if(null!=kt)return kt;var e=E(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),r=T(e,1,2).getBoundingClientRect();return P(t),!(!n||n.left==n.right)&&(kt=r.right-n.right<3)}var jt,Mt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var o=t.indexOf("\n",e);-1==o&&(o=t.length);var i=t.slice(e,"\r"==t.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),e+=a+1):(n.push(i),e=o+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Lt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Dt="oncopy"in(jt=A("div"))||(jt.setAttribute("oncopy","return;"),"function"==typeof jt.oncopy),Nt=null,It={},Ft={};function Vt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),It[t]=e}function Rt(t){if("string"==typeof t&&Ft.hasOwnProperty(t))t=Ft[t];else if(t&&"string"==typeof t.name&&Ft.hasOwnProperty(t.name)){var e=Ft[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Rt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Rt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ht(t,e){e=Rt(e);var n=It[e.name];if(!n)return Ht(t,"text/plain");var r=n(t,e);if(zt.hasOwnProperty(e.name)){var o=zt[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var zt={};function Bt(t,e){V(e,zt.hasOwnProperty(t)?zt[t]:zt[t]={})}function Ut(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Wt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function $t(t,e,n){return!t.startState||t.startState(e,n)}var qt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Gt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(e=t.first&&en?ee(n,Gt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?ee(t.line,e):n<0?ee(t.line,0):t}(e,Gt(t,e.line).text.length)}function ce(t,e){for(var n=[],r=0;r=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pose},qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},qt.prototype.backUp=function(t){this.pos-=t},qt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ue=function(t,e){this.state=t,this.lookAhead=e},pe=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function fe(t,e,n,r){var o=[t.state.modeGen],i={};_e(t,e.text,t.doc.mode,n,function(t,e){return o.push(t,e)},i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=t.state.overlays[r],l=1,c=0;n.state=!0,_e(t,e.text,s.mode,n,function(t,e){for(var n=l;ct&&o.splice(l,1,t,o[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)o.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Ut(t.doc.mode,r.state),i=fe(t,e,r);o&&(r.state=o),e.stateAfter=r.save(!o),e.styles=i.styles,i.classes?e.styleClasses=i.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function he(t,e,n){var r=t.doc,o=t.display;if(!r.mode.startState)return new pe(r,!0,e);var i=function(t,e,n){for(var r,o,i=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=i.first)return i.first;var l=Gt(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ue?c.lookAhead:0)<=i.modeFrontier))return s;var u=R(l.text,null,t.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}(t,e,n),a=i>r.first&&Gt(r,i-1).stateAfter,s=a?pe.fromSaved(r,a,i):new pe(r,$t(r.mode),i);return r.iter(i,e,function(n){ge(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=o.viewFrom&&re.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}pe.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},pe.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},pe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pe.fromSaved=function(t,e,n){return e instanceof ue?new pe(t,Ut(t.mode,e.state),n,e.lookAhead):new pe(t,Ut(t.mode,e),n)},pe.prototype.save=function(t){var e=!1!==t?Ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(e,this.maxLookAhead):e};var me=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function be(t,e,n,r){var o,i,a=t.doc,s=a.mode,l=Gt(a,(e=le(a,e)).line),c=he(t,e.line,n),u=new qt(l.text,t.options.tabSize,c);for(r&&(i=[]);(r||u.post.options.maxHighlightLength?(s=!1,a&&ge(t,e,r,p.pos),p.pos=e.length,l=null):l=we(ye(n,p,r.state,f),i),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||u!=l){for(;c=e:i.to>e);(r||(r=[])).push(new Se(a,i.from,s?null:i.to))}}return r}(n,o,a),l=function(t,e,n){var r;if(t)for(var o=0;o=e:i.to>e)||i.from==e&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=e:i.from0&&s)for(var b=0;be)&&(!n||Le(n,i.marker)<0)&&(n=i.marker)}return n}function Ve(t,e,n,r,o){var i=Gt(t,e),a=Ce&&i.markedSpans;if(a)for(var s=0;s=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ne(c.to,n)>=0:ne(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ne(c.from,r)<=0:ne(c.from,r)<0)))return!0}}}function Re(t){for(var e;e=Ne(t);)t=e.find(-1,!0).line;return t}function He(t,e){var n=Gt(t,e),r=Re(n);return n==r?e:Jt(r)}function ze(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!Be(t,r))return e;for(;n=Ie(r);)r=n.find(1,!0).line;return Jt(r)+1}function Be(t,e){var n=Ce&&e.markedSpans;if(n)for(var r=void 0,o=0;oe.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}var Ge=function(t,e,n){this.text=t,Ae(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ee(t)}Ge.prototype.lineNo=function(){return Jt(this)},bt(Ge);var Ye={},Xe={};function Je(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){var n=j("span",null,null,l?"padding-right: .1px":null),r={pre:j("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var o=0;o<=(e.rest?e.rest.length:0);o++){var i=o?e.rest[o-1]:e.line,a=void 0;r.pos=0,r.addToken=tn,At(t.display.measure)&&(a=ut(i,t.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],rn(i,r,de(t,i,e!=t.display.externalMeasured&&Jt(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=N(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=N(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Et(t.display.measure))),0==o?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return gt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Qe(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function tn(t,e,n,r,o,i,l){if(e){var c,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",o=0;oc&&p.from<=c);f++);if(p.to>=u)return t(n,r,o,i,a,s,l);t(n,r.slice(0,p.to-c),o,i,null,s,l),i=null,r=r.slice(p.to-c),c=p.to}}}function nn(t,e,n,r){var o=!r&&n.widgetNode;o&&t.map.push(t.pos,t.pos+e,o),!r&&t.cm.display.input.needsContentAttribute&&(o||(o=t.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(t.cm.display.input.setUneditable(o),t.content.appendChild(o)),t.pos+=e,t.trailingSpace=!1}function rn(t,e,n){var r=t.markedSpans,o=t.text,i=0;if(r)for(var a,s,l,c,u,p,f,d=o.length,h=0,g=1,v="",y=0;;){if(y==h){l=c=u=s="",f=null,p=null,y=1/0;for(var m=[],b=void 0,w=0;wh||x.collapsed&&_.to==h&&_.from==h)){if(null!=_.to&&_.to!=h&&y>_.to&&(y=_.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&_.from==h&&(u+=" "+x.startStyle),x.endStyle&&_.to==y&&(b||(b=[])).push(x.endStyle,_.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var C in x.attributes)(f||(f={}))[C]=x.attributes[C];x.collapsed&&(!p||Le(p.marker,x)<0)&&(p=_)}else _.from>h&&y>_.from&&(y=_.from)}if(b)for(var S=0;S=d)break;for(var T=Math.min(d,y);;){if(v){var k=h+v.length;if(!p){var P=k>T?v.slice(0,T-h):v;e.addToken(e,P,a?a+l:l,u,h+P.length==y?c:"",s,f)}if(k>=T){v=v.slice(T-h),h=T;break}h=k,u=""}v=o.slice(i,i=n[g++]),a=Je(n[g++],e.cm.options)}}else for(var E=1;En)return{map:t.measure.maps[o],cache:t.measure.caches[o],before:!0}}}function jn(t,e,n,r){return Dn(t,Ln(t,e),n,r)}function Mn(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(i=function(t,e,n,r){var o,i=Fn(e.map,n,r),l=i.node,c=i.start,u=i.end,p=i.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;c&&ot(e.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,o))}else{var d;c>0&&(p=r="right"),o=t.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==r?d.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+ir(t.display),top:h.top,bottom:h.bottom}:In}for(var g=o.top-e.rect.top,v=o.bottom-e.rect.top,y=(g+v)/2,m=e.view.measure.heights,b=0;be)&&(o=(i=l-s)-1,e>=l&&(a="right")),null!=o){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c=0&&(n=t[o]).left==n.right;o--);return n}function Rn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var p=lt(s,l,c),f=st,d=u(l,p,"before"==c);return null!=f&&(d.other=u(l,f,"before"!=c)),d}function Yn(t,e){var n=0;e=le(t.doc,e),t.options.lineWrapping||(n=ir(t.display)*e.ch);var r=Gt(t.doc,e.line),o=We(r)+Sn(t.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Xn(t,e,n,r,o){var i=ee(t,e,n);return i.xRel=o,r&&(i.outside=r),i}function Jn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var o=Zt(r,n),i=r.first+r.size-1;if(o>i)return Xn(r.first+r.size-1,Gt(r,i).text.length,null,1,1);e<0&&(e=0);for(var a=Gt(r,o);;){var s=er(t,a,o,e,n),l=Fe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Gt(r,o=c.line)}}function Zn(t,e,n,r){r-=Wn(e);var o=e.text.length,i=at(function(e){return Dn(t,n,e-1).bottom<=r},o,0);return{begin:i,end:o=at(function(e){return Dn(t,n,e).top>r},i,o)}}function Qn(t,e,n,r){return n||(n=Ln(t,e)),Zn(t,e,n,$n(t,e,Dn(t,n,r),"line").top)}function tr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function er(t,e,n,r,o){o-=We(e);var i=Ln(t,e),a=Wn(e),s=0,l=e.text.length,c=!0,u=ut(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?rr:nr)(t,e,n,i,u,r,o);s=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var f,d,h=null,g=null,v=at(function(e){var n=Dn(t,i,e);return n.top+=a,n.bottom+=a,!!tr(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=e,g=n),!0)},s,l),y=!1;if(g){var m=r-g.left=w.bottom?1:0}return Xn(n,v=it(e.text,v,1),d,y,r-f)}function nr(t,e,n,r,o,i,a){var s=at(function(s){var l=o[s],c=1!=l.level;return tr(Kn(t,ee(n,c?l.to:l.from,c?"before":"after"),"line",e,r),i,a,!0)},0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=Kn(t,ee(n,c?l.from:l.to,c?"after":"before"),"line",e,r);tr(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function rr(t,e,n,r,o,i,a){var s=Zn(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,f=0;f=c||d.to<=l)){var h=Dn(t,r,1!=d.level?Math.min(c,d.to)-1:Math.max(l,d.from)).right,g=hg)&&(u=d,p=g)}}return u||(u=o[o.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function or(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Nn){Nn=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(A("br"));Nn.appendChild(document.createTextNode("x"))}E(t.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),P(t.measure),n||1}function ir(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");E(t.measure,n);var r=e.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(t.cachedCharWidth=o),o||10}function ar(t){for(var e=t.display,n={},r={},o=e.gutters.clientLeft,i=e.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:sr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function sr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function lr(t){var e=or(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/ir(t.display)-3);return function(o){if(Be(t.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a0&&(l=Gt(t.doc,c.line).text).length==c.ch){var u=R(l,l.length,t.options.tabSize)-l.length;c=ee(c.line,Math.max(0,Math.round((i-Tn(t.display).left)/ir(t.display))-u))}return c}function pr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(o.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=o.viewTo)Ce&&He(t.doc,e)o.viewFrom?hr(t):(o.viewFrom+=r,o.viewTo+=r);else if(e<=o.viewFrom&&n>=o.viewTo)hr(t);else if(e<=o.viewFrom){var i=gr(t,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):hr(t)}else if(n>=o.viewTo){var a=gr(t,e,e,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):hr(t)}else{var s=gr(t,e,e,-1),l=gr(t,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(an(t,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):hr(t)}var c=o.externalMeasured;c&&(n=o.lineN&&e=r.viewTo)){var i=r.view[pr(t,e)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==z(a,n)&&a.push(n)}}}function hr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function gr(t,e,n,r){var o,i=pr(t,e),a=t.display.view;if(!Ce||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(i==a.length-1)return null;o=s+a[i].size-e,i++}else o=s-e;e+=o,n+=o}for(;He(t.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function vr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||l.to().line0?a:t.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(t,e){return t.top-e.top||t.left-e.left}function _r(t,e,n){var r=t.display,o=t.doc,i=document.createDocumentFragment(),a=Tn(t.display),s=a.left,l=Math.max(r.sizerWidth,Pn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),i.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function p(e,n,r){var i,a,p=Gt(o,e),f=p.text.length;function d(n,r){return Gn(t,ee(e,n),"div",p,r)}function h(e,n,r){var o=Qn(t,p,null,e),i="ltr"==n==("after"==r)?"left":"right";return d("after"==r?o.begin:o.end-(/\s/.test(p.text.charAt(o.end-1))?2:1),i)[i]}var g=ut(p,o.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var o=!1,i=0;ie||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(e,n,"ltr")}(g,n||0,null==r?f:r,function(t,e,o,p){var v="ltr"==o,y=d(t,v?"left":"right"),m=d(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==f,_=0==p,x=!g||p==g.length-1;if(m.top-y.top<=3){var C=(c?w:b)&&x,S=(c?b:w)&&_?s:(v?y:m).left,O=C?l:(v?m:y).right;u(S,y.top,O-S,y.bottom)}else{var T,k,P,E;v?(T=c&&b&&_?s:y.left,k=c?l:h(t,o,"before"),P=c?s:h(e,o,"after"),E=c&&w&&x?l:m.right):(T=c?h(t,o,"before"):s,k=!c&&b&&_?l:y.right,P=!c&&w&&x?s:m.left,E=c?h(e,o,"after"):l),u(T,y.top,k-T,y.bottom),y.bottom0?e.blinker=setInterval(function(){t.hasFocus()||Tr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Cr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Or(t))}function Sr(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Tr(t))},100)}function Or(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(gt(t,"focus",t,e),t.state.focused=!0,D(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),xr(t))}function Tr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(gt(t,"blur",t,e),t.state.focused=!1,k(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function kr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),o=e.lineDiv.getBoundingClientRect().top,i=0,l=0;l.005||g<-.005)&&(ot.display.sizerWidth){var y=Math.ceil(f/ir(t.display));y>t.display.maxLineLength&&(t.display.maxLineLength=y,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function Pr(t){if(t.widgets)for(var e=0;e=a&&(i=Zt(e,We(Gt(e,l))-t.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Ar(t,e){var n=t.display,r=or(t.display);e.top<0&&(e.top=0);var o=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=En(t),a={};e.bottom-e.top>i&&(e.bottom=e.top+i);var s=t.doc.height+On(n),l=e.tops-r;if(e.topo+i){var u=Math.min(e.top,(c?s:e.bottom)-i);u!=o&&(a.scrollTop=u)}var p=t.options.fixedGutter?0:n.gutters.offsetWidth,f=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-p,d=Pn(t)-n.gutters.offsetWidth,h=e.right-e.left>d;return h&&(e.right=e.left+d),e.left<10?a.scrollLeft=0:e.leftd+f-3&&(a.scrollLeft=e.right+(h?0:10)-d),a}function jr(t,e){null!=e&&(Dr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Mr(t){Dr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Lr(t,e,n){null==e&&null==n||Dr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Dr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Nr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Nr(t,e,n,r){var o=Ar(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Lr(t,o.scrollLeft,o.scrollTop)}function Ir(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||co(t,{top:e}),Fr(t,e,!0),n&&co(t),oo(t,100))}function Fr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Vr(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,fo(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Rr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+On(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Hr=function(t,e,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,t(r),t(o),ft(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")}),ft(o,"scroll",function(){o.clientWidth&&e(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var o=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},Hr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hr.prototype.zeroWidthHack=function(){var t=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new H,this.disableVert=new H},Hr.prototype.enableZeroWidthBar=function(t,e,n){t.style.visibility="",e.set(1e3,function r(){var o=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=t?t.style.visibility="hidden":e.set(1e3,r)})},Hr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var zr=function(){};function Br(t,e){e||(e=Rr(t));var n=t.display.barWidth,r=t.display.barHeight;Ur(t,e);for(var o=0;o<4&&n!=t.display.barWidth||r!=t.display.barHeight;o++)n!=t.display.barWidth&&t.options.lineWrapping&&kr(t),Ur(t,Rr(t)),n=t.display.barWidth,r=t.display.barHeight}function Ur(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Wr={native:Hr,null:zr};function $r(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&k(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Wr[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ft(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?Vr(t,e):Ir(t,e)},t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var qr=0;function Gr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qr,markArrays:null},function(t){sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}(t.curOp)}function Kr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new ao(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&so(t.cm,t.update)}function Jr(t){var e=t.cm,n=e.display;t.updatedDisplay&&kr(e),t.barMeasure=Rr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=jn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Pn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Zr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!g){var i=A("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Sn(t.display))+"px;\n height: "+(e.bottom-e.top+kn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(i),i.scrollIntoView(o),t.display.lineSpace.removeChild(i)}}}(e,function(t,e,n,r){var o;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ee(e.line,e.ch+1,"before"):e,e=e.ch?ee(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var a=!1,s=Kn(t,e),l=n&&n!=e?Kn(t,n):s,c=Ar(t,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(Ir(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Vr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return o}(e,le(r,t.scrollToPos.from),le(r,t.scrollToPos.to),t.scrollToPos.margin));var o=t.maybeHiddenMarkers,i=t.maybeUnhiddenMarkers;if(o)for(var a=0;a=t.display.viewTo)){var n=+new Date+t.options.workTime,r=he(t,e.highlightFrontier),o=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),function(i){if(r.line>=t.display.viewFrom){var a=i.styles,s=i.text.length>t.options.maxHighlightLength?Ut(e.mode,r.state):null,l=fe(t,i,r,!0);s&&(r.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!p&&fn)return oo(t,t.options.workDelay),!0}),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),o.length&&to(t,function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==vr(t))return!1;ho(t)&&(hr(t),e.dims=ar(t));var o=r.first+r.size,i=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(o,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Ce&&(i=He(t.doc,i),a=ze(t.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;(function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=an(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=an(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,pr(t,n)))),r.viewTo=n})(t,i,a),n.viewOffset=We(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=vr(t);if(!s&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=L();if(!e||!M(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&M(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,o=t.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(e){var n=e.nextSibling;return l&&b&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,p=0;p-1&&(d=!1),pn(t,f,u,n)),d&&(P(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(te(t.options,u)))),a=f.node.nextSibling}else{var h=mn(t,f,u,n);i.insertBefore(h,a)}u+=f.size}for(;a;)a=s(a)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=L()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),P(n.cursorDiv),P(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,oo(t,400)),n.updateLineNumbers=null,!0}function lo(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Pn(t))r&&(e.visible=Er(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+On(t.display)-En(t),n.top)}),e.visible=Er(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!so(t,e))break;kr(t);var o=Rr(t);yr(t),Br(t,o),po(t,o),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function co(t,e){var n=new ao(t,e);if(so(t,n)){kr(t),lo(t,n);var r=Rr(t);yr(t),Br(t,r),po(t,r),n.finish()}}function uo(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",cn(t,"gutterChanged",t)}function po(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+kn(t)+"px"}function fo(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=sr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,o=e.gutters.offsetWidth,i=r+"px",a=0;a=102&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout(function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""},100));var r=_o(e),o=r.x,i=r.y,a=wo;0===e.deltaMode&&(o=e.deltaX,i=e.deltaY,a=1);var s=t.display,c=s.scroller,d=c.scrollWidth>c.clientWidth,h=c.scrollHeight>c.clientHeight;if(o&&d||i&&h){if(i&&b&&l)t:for(var g=e.target,v=s.view;g!=c;g=g.parentNode)for(var y=0;y=0&&ne(t,r.to())<=0)return n}return-1};var Oo=function(t,e){this.anchor=t,this.head=e};function To(t,e,n){var r=t&&t.options.selectionsMayTouch,o=e[n];e.sort(function(t,e){return ne(t.from(),e.from())}),n=z(e,o);for(var i=1;i0:l>=0){var c=ae(s.from(),a.from()),u=ie(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,e.splice(--i,2,new Oo(p?u:c,p?c:u))}}return new So(e,n)}function ko(t,e){return new So([new Oo(t,e||t)],0)}function Po(t){return t.text?ee(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Eo(t,e){if(ne(t,e.from)<0)return t;if(ne(t,e.to)<=0)return Po(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Po(e).ch-e.to.ch),ee(n,r)}function Ao(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,h-1),t.insert(s.line+1,y)}cn(t,"change",t,e)}function Io(t,e,n){!function t(r,o,i){if(r.linked)for(var a=0;as-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(i=function(t,e){return e?(zo(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}(o,o.lastOp==r)))a=Y(i.changes),0==ne(e.from,e.to)&&0==ne(e.from,a.to)?a.to=Po(e):i.changes.push(Ho(t,e));else{var l=Y(o.done);for(l&&l.ranges||Wo(t.sel,o.done),i={changes:[Ho(t,e)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=e.origin,a||gt(t,"historyAdded")}function Uo(t,e,n,r){var o=t.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(t,e,n,r){var o=e.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,i,Y(o.done),e))?o.done[o.done.length-1]=e:Wo(e,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&zo(o.undone)}function Wo(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function $o(t,e,n,r){var o=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((o||(o=e["spans_"+t.id]={}))[i]=n.markedSpans),++i})}function qo(t){if(!t)return null;for(var e,n=0;n-1&&(Y(s)[p]=c[p],delete c[p])}}}return r}function Yo(t,e,n,r){if(r){var o=t.anchor;if(n){var i=ne(e,o)<0;i!=ne(n,o)<0?(o=e,e=n):i!=ne(e,n)<0&&(e=n)}return new Oo(o,e)}return new Oo(n||e,e)}function Xo(t,e,n,r,o){null==o&&(o=t.cm&&(t.cm.display.shift||t.extend)),ei(t,new So([Yo(t.sel.primary(),e,n,o)],0),r)}function Jo(t,e,n){for(var r=[],o=t.cm&&(t.cm.display.shift||t.extend),i=0;i=e.ch:s.to>e.ch))){if(o&&(gt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(p=li(t,p,-r,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(f=ne(p,n))&&(r<0?f<0:f>0))return ai(t,p,e,r,o)}var d=l.find(r<0?-1:1);return(r<0?c:u)&&(d=li(t,d,r,d.line==e.line?i:null)),d?ai(t,d,e,r,o):null}}return e}function si(t,e,n,r,o){var i=r||1;return ai(t,e,n,i,o)||!o&&ai(t,e,n,i,!0)||ai(t,e,n,-i,o)||!o&&ai(t,e,n,-i,!0)||(t.cantEdit=!0,ee(t.first,0))}function li(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?le(t,ee(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line0)){var u=[l,1],p=ne(c.from,s.from),f=ne(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(t,e.from,e.to);if(r)for(var o=r.length-1;o>=0;--o)fi(t,{from:r[o].from,to:r[o].to,text:o?[""]:e.text,origin:e.origin});else fi(t,e)}}function fi(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ne(e.from,e.to)){var n=Ao(t,e);Bo(t,e,n,t.cm?t.cm.curOp.id:NaN),gi(t,e,n,ke(t,e));var r=[];Io(t,function(t,n){n||-1!=z(r,t.history)||(bi(t.history,e),r.push(t.history)),gi(t,e,null,ke(t,e))})}}function di(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var o,i=t.history,a=t.sel,s="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c=0;--d){var h=f(d);if(h)return h.v}}}}function hi(t,e){if(0!=e&&(t.first+=e,t.sel=new So(X(t.sel.ranges,function(t){return new Oo(ee(t.anchor.line+e,t.anchor.ch),ee(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){fr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.linei&&(e={from:e.from,to:ee(i,Gt(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Ao(t,e)),t.cm?function(t,e,n){var r=t.doc,o=t.display,i=e.from,a=e.to,s=!1,l=i.line;t.options.lineWrapping||(l=Jt(Re(Gt(r,i.line))),r.iter(l,a.line+1,function(t){if(t==o.maxLine)return s=!0,!0})),r.sel.contains(e.from,e.to)>-1&&yt(t),No(r,e,n,lr(t)),t.options.lineWrapping||(r.iter(l,i.line+e.text.length,function(t){var e=$e(t);e>o.maxLineLength&&(o.maxLine=t,o.maxLineLength=e,o.maxLineChanged=!0,s=!1)}),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var o=Gt(t,r).stateAfter;if(o&&(!(o instanceof ue)||r+o.lookAhead1||!(this.children[0]instanceof _i))){var s=[];this.collapse(s),this.children=[new _i(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=o.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=j("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ve(t,e.line,e,n,i)||e.line!=n.line&&Ve(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ce=!0}i.addToHistory&&Bo(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,function(r){c&&i.collapsed&&!c.options.lineWrapping&&Re(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=e.line&&Xt(r,0),function(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&t.markedSpans&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}(r,new Se(i,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l}),i.collapsed&&t.iter(e.line,n.line+1,function(e){Be(t,e)&&Xt(e,0)}),i.clearOnEnter&&ft(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(xe=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++Oi,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)fr(c,e.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=e.line;u<=n.line;u++)dr(c,u,"text");i.atomic&&oi(c.doc),cn(c,"markerAdded",c,i)}return i}Ti.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Gr(t),mt(this,"clear")){var n=this.find();n&&cn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&fr(t,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&oi(t.doc)),t&&cn(t,"markerCleared",t,this,r,o),e&&Kr(t),this.parent&&this.parent.clear()}},Ti.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var o=0;o=0;l--)pi(this,r[l]);s?ti(this,s):this.cm&&Mr(this.cm)}),undo:ro(function(){di(this,"undo")}),redo:ro(function(){di(this,"redo")}),undoSelection:ro(function(){di(this,"undo",!0)}),redoSelection:ro(function(){di(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(o.marker.parent||o.marker)}return e},findMarks:function(t,e,n){t=le(this,t),e=le(this,e);var r=[],o=t.line;return this.iter(t.line,e.line+1,function(i){var a=i.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&o!=t.line||null!=l.from&&o==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o}),r},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=i,++n}),le(this,ee(n,e))},indexFromPos:function(t){var e=(t=le(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var p=t.dataTransfer.getData("Text");if(p){var f;if(e.state.draggingText&&!e.state.draggingText.copy&&(f=e.listSelections()),ni(e.doc,ko(n,n)),f)for(var d=0;d=0;e--)vi(t.doc,"",r[e].from,r[e].to,"+delete");Mr(t)})}function Qi(t,e,n){var r=it(t.text,e+n,n);return r<0||r>t.text.length?null:r}function ta(t,e,n){var r=Qi(t,e.ch,n);return null==r?null:new ee(e.line,r,n<0?"after":"before")}function ea(t,e,n,r,o){if(t){"rtl"==e.doc.direction&&(o=-o);var i=ut(n,e.doc.direction);if(i){var a,s=o<0?Y(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=Ln(e,n);a=o<0?n.text.length-1:0;var u=Dn(e,c,a).top;a=at(function(t){return Dn(e,c,t).top==u},o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Qi(n,a,1))}else a=o<0?s.to:s.from;return new ee(r,a,l)}}return new ee(r,o<0?n.text.length:0,o<0?"before":"after")}Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi.default=b?Wi.macDefault:Wi.pcDefault;var na={selectAll:ci,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return Zi(t,function(e){if(e.empty()){var n=Gt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)o=new ee(o.line,o.ch+1),t.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),ee(o.line,o.ch-2),o,"+transpose");else if(o.line>t.doc.first){var a=Gt(t.doc,o.line-1).text;a&&(o=new ee(o.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ee(o.line-1,a.length-1),o,"+transpose"))}n.push(new Oo(o,o))}t.setSelections(n)})},newlineAndIndent:function(t){return to(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(ne((o=c.ranges[o]).from(),e)<0||e.xRel>0)&&(ne(o.to(),e)>0||e.xRel<0)?function(t,e,n,r){var o=t.display,i=!1,c=eo(t,function(e){l&&(o.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Sr(t)),ht(o.wrapper.ownerDocument,"mouseup",c),ht(o.wrapper.ownerDocument,"mousemove",u),ht(o.scroller,"dragstart",p),ht(o.scroller,"drop",c),i||(wt(e),r.addNew||Xo(t.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),u=function(t){i=i||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},p=function(){return i=!0};l&&(o.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,ft(o.wrapper.ownerDocument,"mouseup",c),ft(o.wrapper.ownerDocument,"mousemove",u),ft(o.scroller,"dragstart",p),ft(o.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout(function(){return o.input.focus()},20),o.scroller.dragDrop&&o.scroller.dragDrop()}(t,r,e,i):function(t,e,n,r){a&&Sr(t);var o=t.display,i=t.doc;wt(e);var s,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new Oo(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Oo(n,n)),n=ur(t,e,!0,!0),l=-1;else{var p=ma(t,n,r.unit);s=r.extend?Yo(s,p.anchor,p.head,r.extend):p}r.addNew?-1==l?(l=u.length,ei(i,To(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(ei(i,To(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Zo(i,l,s,W):(l=0,ei(i,new So([s],0),W),c=i.sel);var f=n;function d(e){if(0!=ne(f,e))if(f=e,"rectangle"==r.unit){for(var o=[],a=t.options.tabSize,u=R(Gt(i,n.line).text,n.ch,a),p=R(Gt(i,e.line).text,e.ch,a),d=Math.min(u,p),h=Math.max(u,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var y=Gt(i,g).text,m=q(y,d,a);d==h?o.push(new Oo(ee(g,m),ee(g,m))):y.length>m&&o.push(new Oo(ee(g,m),ee(g,q(y,h,a))))}o.length||o.push(new Oo(n,n)),ei(i,To(t,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,_=ma(t,e,r.unit),x=w.anchor;ne(_.anchor,x)>0?(b=_.head,x=ae(w.from(),_.anchor)):(b=_.anchor,x=ie(w.to(),_.head));var C=c.ranges.slice(0);C[l]=function(t,e){var n=e.anchor,r=e.head,o=Gt(t.doc,n.line);if(0==ne(n,r)&&n.sticky==r.sticky)return e;var i=ut(o);if(!i)return e;var a=lt(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=lt(i,r.ch,r.sticky),p=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?p<0:p>0}var f=i[c+(l?-1:0)],d=l==(1==f.level),h=d?f.from:f.to,g=d?"after":"before";return n.ch==h&&n.sticky==g?e:new Oo(new ee(n.line,h,g),r)}(t,new Oo(le(i,x),b)),ei(i,To(t,C,l),W)}}var h=o.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=ur(t,e,!0,"rectangle"==r.unit);if(a)if(0!=ne(a,f)){t.curOp.focus=L(),d(a);var s=Er(o,i);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(eo(t,function(){g==n&&(o.scroller.scrollTop+=l,v(e))}),50)}}function y(e){t.state.selectingText=!1,g=1/0,e&&(wt(e),o.input.focus()),ht(o.wrapper.ownerDocument,"mousemove",m),ht(o.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var m=eo(t,function(t){0!==t.buttons&&Ot(t)?v(t):y(t)}),b=eo(t,y);t.state.selectingText=b,ft(o.wrapper.ownerDocument,"mousemove",m),ft(o.wrapper.ownerDocument,"mouseup",b)}(t,r,e,i)}(e,r,i,t):St(t)==n.scroller&&wt(t):2==o?(r&&Xo(e.doc,r),setTimeout(function(){return n.input.focus()},20)):3==o&&(S?e.display.input.onContextMenu(t):Sr(e)))}}function ma(t,e,n){if("char"==n)return new Oo(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Oo(ee(e.line,0),le(t.doc,ee(e.line+1,0)));var r=n(t,e);return new Oo(r.from,r.to)}function ba(t,e,n,r){var o,i;if(e.touches)o=e.touches[0].clientX,i=e.touches[0].clientY;else try{o=e.clientX,i=e.clientY}catch(u){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&wt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!mt(t,n))return xt(e);i-=s.top-a.viewOffset;for(var l=0;l=o)return gt(t,n,t,Zt(t.doc,i),t.display.gutterSpecs[l].className,e),xt(e)}}function wa(t,e){return ba(t,e,"gutterClick",!0)}function _a(t,e){Cn(t.display,e)||function(t,e){return!!mt(t,"gutterContextMenu")&&ba(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||S||t.display.input.onContextMenu(e)}function xa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(t)}va.prototype.compare=function(t,e,n){return this.time+400>t&&0==ne(e,this.pos)&&n==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},Sa={},Oa={};function Ta(t,e,n){if(!e!=!(n&&n!=Ca)){var r=t.display.dragFunctions,o=e?ft:ht;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function ka(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(k(t.display.wrapper,"CodeMirror-wrap"),qe(t)),cr(t),fr(t),zn(t),setTimeout(function(){return Br(t)},100)}function Pa(t,e){var n=this;if(!(this instanceof Pa))return new Pa(t,e);this.options=e=e?V(e):{},V(Sa,e,!1);var r=e.value;"string"==typeof r?r=new Mi(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var o=new Pa.inputStyles[e.inputStyle](this),i=this.display=new mo(t,r,o,e);for(var c in i.wrapper.CodeMirror=this,xa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new H,keySeq:null,specialChars:null},e.autofocus&&!m&&i.input.focus(),a&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(t){var e=t.display;ft(e.scroller,"mousedown",eo(t,ya)),ft(e.scroller,"dblclick",a&&s<11?eo(t,function(e){if(!vt(t,e)){var n=ur(t,e);if(n&&!wa(t,e)&&!Cn(t.display,e)){wt(e);var r=t.findWordAt(n);Xo(t.doc,r.anchor,r.head)}}}):function(e){return vt(t,e)||wt(e)}),ft(e.scroller,"contextmenu",function(e){return _a(t,e)}),ft(e.input.getField(),"contextmenu",function(n){e.scroller.contains(n.target)||_a(t,n)});var n,r={end:0};function o(){e.activeTouch&&(n=setTimeout(function(){return e.activeTouch=null},1e3),(r=e.activeTouch).end=+new Date)}function i(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}ft(e.scroller,"touchstart",function(o){if(!vt(t,o)&&!i(o)&&!wa(t,o)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==o.touches.length&&(e.activeTouch.left=o.touches[0].pageX,e.activeTouch.top=o.touches[0].pageY)}}),ft(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),ft(e.scroller,"touchend",function(n){var r=e.activeTouch;if(r&&!Cn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=t.coordsChar(e.activeTouch,"page");i=!r.prev||l(r,r.prev)?new Oo(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new Oo(ee(a.line,0),le(t.doc,ee(a.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),wt(n)}o()}),ft(e.scroller,"touchcancel",o),ft(e.scroller,"scroll",function(){e.scroller.clientHeight&&(Ir(t,e.scroller.scrollTop),Vr(t,e.scroller.scrollLeft,!0),gt(t,"scroll",t))}),ft(e.scroller,"mousewheel",function(e){return Co(t,e)}),ft(e.scroller,"DOMMouseScroll",function(e){return Co(t,e)}),ft(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(e){vt(t,e)||Ct(e)},over:function(e){vt(t,e)||(function(t,e){var n=ur(t,e);if(n){var r=document.createDocumentFragment();br(t,n,r),t.display.dragCursor||(t.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),E(t.display.dragCursor,r)}}(t,e),Ct(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Li<100))Ct(e);else if(!vt(t,e)&&!Cn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(t,e)},drop:eo(t,Di),leave:function(e){vt(t,e)||Ni(t)}};var c=e.input.getField();ft(c,"keyup",function(e){return fa.call(t,e)}),ft(c,"keydown",eo(t,pa)),ft(c,"keypress",eo(t,da)),ft(c,"focus",function(e){return Or(t,e)}),ft(c,"blur",function(e){return Tr(t,e)})}(this),Vi(),Gr(this),this.curOp.forceUpdate=!0,Fo(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Or(n)},20):Tr(this),Oa)Oa.hasOwnProperty(c)&&Oa[c](this,e[c],Ca);ho(this),e.finishInit&&e.finishInit(this);for(var u=0;u150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?R(Gt(i,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var p="",f=0;if(t.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)f+=a,p+="\t";if(fa,l=Mt(e),c=null;if(s&&r.ranges.length>1)if(ja&&ja.text.join("\n")==e){if(r.ranges.length%ja.text.length==0){c=[];for(var u=0;u=0;f--){var d=r.ranges[f],h=d.from(),g=d.to();d.empty()&&(n&&n>0?h=ee(h.line,h.ch-n):t.state.overwrite&&!s?g=ee(g.line,Math.min(Gt(i,g.line).text.length,g.ch+Y(l).length)):s&&ja&&ja.lineWise&&ja.text.join("\n")==l.join("\n")&&(h=g=ee(h.line,0)));var v={from:h,to:g,text:c?c[f%c.length]:l,origin:o||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};pi(t.doc,v),cn(t,"inputRead",t,v)}e&&!s&&Na(t,e),Mr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Da(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||to(e,function(){return La(e,n,0,null,"paste")}),!0}function Na(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=t.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Aa(t,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Gt(t.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Aa(t,o.head.line,"smart"));a&&cn(t,"electricInput",t,o.head.line)}}}function Ia(t){for(var e=[],n=[],r=0;r0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ee(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(p?2:1))),-n)}}else a=o?function(t,e,n,r){var o=ut(e,t.doc.direction);if(!o)return ta(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=lt(o,n.ch,n.sticky),a=o[i];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=u.begin)){var d=p?"before":"after";return new ee(n.line,f,d)}}var h=function(t,e,r){for(var i=function(t,e){return e?new ee(n.line,l(t,1),"before"):new ee(n.line,t,"after")};t>=0&&t0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=h(r>0?0:o.length-1,r,c(v)))?null:g}(t.cm,s,e,n):ta(s,e,n);if(null==a){if(i||(c=e.line+l)=t.first+t.size||(e=new ee(c,e.ch,e.sticky),!(s=Gt(t,c))))return!1;e=ea(o,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,p="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||c(!d);d=!1){var h=s.text.charAt(e.ch)||"\n",g=et(h,f)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||d||g||(g="s"),u&&u!=g){n<0&&(n=1,c(),e.sticky="after");break}if(g&&(u=g),n>0&&!c(!d))break}var v=si(t,e,i,a,!0);return re(i,v)&&(v.hitSide=!0),v}function Ha(t,e,n,r){var o,i,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*or(t.display),3);o=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(o=n>0?e.bottom+3:e.top-3);for(;(i=Jn(t,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var za=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ba(t,e){var n=Mn(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),o=An(n,r,e.line),i=ut(r,t.doc.direction),a="left";i&&(a=lt(i,e.ch)%2?"right":"left");var s=Fn(o.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ua(t,e){return e&&(t.bad=!0),t}function Wa(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return Ua(t.clipPos(ee(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var o=0;o=e.display.viewTo||i.line=e.display.viewFrom&&Ba(e,o)||{node:l[0].measure.map[2],offset:0},u=i.liner.firstLine()&&(a=ee(a.line-1,Gt(r.doc,a.line-1).length)),s.ch==Gt(r.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;a.line==o.viewFrom||0==(t=pr(r,a.line))?(e=Jt(o.view[0].line),n=o.view[0].node):(e=Jt(o.view[t].line),n=o.view[t-1].node.nextSibling);var l,c,u=pr(r,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Jt(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(function(t,e,n,r,o){var i="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(t){t&&(c(),i+=t)}function p(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var i,f=e.getAttribute("cm-marker");if(f){var d=t.findMarks(ee(r,0),ee(o+1,0),(v=+f,function(t){return t.id==v}));return void(d.length&&(i=d[0].find(0))&&u(Kt(t.doc,i.from,i.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;h&&c();for(var g=0;g1&&f.length>1;)if(Y(p)==Y(f))p.pop(),f.pop(),l--;else{if(p[0]!=f[0])break;p.shift(),f.shift(),e++}for(var d=0,h=0,g=p[0],v=f[0],y=Math.min(g.length,v.length);da.ch&&m.charCodeAt(m.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;p[p.length-1]=m.slice(0,m.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(d).replace(/\u200b+$/,"");var _=ee(e,d),x=ee(l,f.length?Y(f).length-h:0);return p.length>1||p[0]||ne(_,x)?(vi(r.doc,p,_,x,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},za.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||to(this.cm,function(){return fr(t.cm)})},za.prototype.setUneditable=function(t){t.contentEditable="false"},za.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||eo(this.cm,La)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},za.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var qa,Ga,Ka,Ya=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Ya.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var o=this.textarea;function i(t){if(!vt(r,t)){if(r.somethingSelected())Ma({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Ma({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",o.value=e.text.join("\n"),I(o))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(o.style.width="0px"),ft(o,"input",function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()}),ft(o,"paste",function(t){vt(r,t)||Da(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())}),ft(o,"cut",i),ft(o,"copy",i),ft(t.scroller,"paste",function(e){if(!Cn(t,e)&&!vt(r,e)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=e.clipboardData,o.dispatchEvent(i)}}),ft(t.lineSpace,"selectstart",function(e){Cn(t,e)||wt(e)}),ft(o,"compositionstart",function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ft(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ya.prototype.createField=function(){this.wrapper=Va(),this.textarea=this.wrapper.firstChild},Ya.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},Ya.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=mr(t);if(t.options.moveInputWithCursor){var o=Kn(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Ya.prototype.showSelection=function(t){var e=this.cm.display;E(e.cursorDiv,t.cursors),E(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ya.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ya.prototype.getField=function(){return this.textarea},Ya.prototype.supportsTouch=function(){return!1},Ya.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||L()!=this.textarea))try{this.textarea.focus()}catch(qa){}},Ya.prototype.blur=function(){this.textarea.blur()},Ya.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ya.prototype.receivedFocus=function(){this.slowPoll()},Ya.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},Ya.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))})},Ya.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Lt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var o=n.value;if(o==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l1e3||o.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=o,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ya.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ya.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ya.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,o=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=ur(n,t),c=r.scroller.scrollTop;if(i&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&eo(n,ei)(n.doc,ko(i),U);var u,p=o.style.cssText,d=e.wrapper.style.cssText,h=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=e.prevInput=" "),e.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),S){Ct(t);var g=function(){ht(window,"mouseup",g),setTimeout(y,20)};ft(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=o.selectionStart){var t=n.somethingSelected(),i="​"+(t?o.value:"");o.value="⇚",o.value=i,e.prevInput=t?"":"​",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending==y&&(e.contextMenuPending=!1,e.wrapper.style.cssText=d,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&v();var t=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==e.prevInput?eo(n,ci)(n):t++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Ya.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Ya.prototype.setUneditable=function(){},Ya.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,o,i){t.defaults[n]=r,o&&(e[n]=i?function(t,e,n){n!=Ca&&o(t,e,n)}:o)}t.defineOption=n,t.Init=Ca,n("value","",function(t,e){return t.setValue(e)},!0),n("mode",null,function(t,e){t.doc.modeOption=e,Mo(t)},!0),n("indentUnit",2,Mo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(t){Lo(t),zn(t),fr(t)},!0),n("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter(function(t){for(var o=0;;){var i=t.text.indexOf(e,o);if(-1==i)break;o=i+e.length,n.push(ee(r,i))}r++});for(var o=n.length-1;o>=0;o--)vi(t.doc,e,n[o],ee(n[o].line,n[o].ch+e.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ca&&t.refresh()}),n("specialCharPlaceholder",Qe,function(t){return t.refresh()},!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),n("autocorrect",!1,function(t,e){return t.getInputField().autocorrect=e},!0),n("autocapitalize",!1,function(t,e){return t.getInputField().autocapitalize=e},!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",function(t){xa(t),yo(t)},!0),n("keyMap","default",function(t,e,n){var r=Ji(e),o=n!=Ca&&Ji(n);o&&o.detach&&o.detach(t,r),r.attach&&r.attach(t,o||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ka,!0),n("gutters",[],function(t,e){t.display.gutterSpecs=go(e,t.options.lineNumbers),yo(t)},!0),n("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?sr(t.display)+"px":"0",t.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(t){return Br(t)},!0),n("scrollbarStyle","native",function(t){$r(t),Br(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),n("lineNumbers",!1,function(t,e){t.display.gutterSpecs=go(t.options.gutters,e),yo(t)},!0),n("firstLineNumber",1,yo,!0),n("lineNumberFormatter",function(t){return t},yo,!0),n("showCursorWhenSelecting",!1,yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(t,e){"nocursor"==e&&(Tr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),n("screenReaderLabel",null,function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)}),n("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),n("dragDrop",!0,Ta),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yr,!0),n("singleCursorHeightPerLine",!0,yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Lo,!0),n("addModeClass",!1,Lo,!0),n("pollInterval",100),n("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),n("historyEventDelay",1250),n("viewportMargin",10,function(t){return t.refresh()},!0),n("maxHighlightLength",1e4,Lo,!0),n("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),n("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),n("autofocus",null),n("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0),n("phrases",null)}(Pa),Ga=(qa=Pa).optionHandlers,Ka=qa.helpers={},qa.prototype={constructor:qa,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,e){var n=this.options,r=n[t];n[t]==e&&"mode"!=t||(n[t]=e,Ga.hasOwnProperty(t)&&eo(this,Ga[t])(this,e,r),gt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Ji(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(Aa(this,o.head.line,t,!0),n=o.head.line,r==this.doc.sel.primIndex&&Mr(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Zo(this.doc,r,new Oo(i,c[r].to()),U)}}}),getTokenAt:function(t,e){return be(this,t,e)},getLineTokens:function(t,e){return be(this,ee(t),e,!0)},getTokenTypeAt:function(t){t=le(this.doc,t);var e,n=de(this,Gt(this.doc,t.line)),r=0,o=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]i&&(t=i,o=!0),r=Gt(this.doc,t)}else r=t;return $n(this,r,{top:0,left:0},e||"page",n||o).top+(o?this.doc.height-We(r):0)},defaultTextHeight:function(){return or(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,o){var i=this.display,a=(t=Kn(this,le(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),i.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(i.wrapper.clientHeight,this.doc.height),c=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==o?(s=i.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(i.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&function(t,e){var n=Ar(t,e);null!=n.scrollTop&&Ir(t,n.scrollTop),null!=n.scrollLeft&&Vr(t,n.scrollLeft)}(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:no(pa),triggerOnKeyPress:no(da),triggerOnKeyUp:fa,triggerOnMouseDown:no(ya),execCommand:function(t){if(na.hasOwnProperty(t))return na[t].call(null,this)},triggerElectric:no(function(t){Na(this,t)}),findPosH:function(t,e,n,r){var o=1;e<0&&(o=-1,e=-e);for(var i=le(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&cr(this),gt(this,"refresh",this)}),swapDoc:no(function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Fo(this,t),zn(this),this.display.input.reset(),Lr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,e),e}),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},bt(qa),qa.registerHelper=function(t,e,n){Ka.hasOwnProperty(t)||(Ka[t]=qa[t]={_global:[]}),Ka[t][e]=n},qa.registerGlobalHelper=function(t,e,n,r){qa.registerHelper(t,e,r),Ka[t]._global.push({pred:n,val:r})};var Xa="iter insert remove copy getEditor constructor".split(" ");for(var Ja in Mi.prototype)Mi.prototype.hasOwnProperty(Ja)&&z(Xa,Ja)<0&&(Pa.prototype[Ja]=function(t){return function(){return t.apply(this.doc,arguments)}}(Mi.prototype[Ja]));return bt(Mi),Pa.inputStyles={textarea:Ya,contenteditable:za},Pa.defineMode=function(t){Pa.defaults.mode||"null"==t||(Pa.defaults.mode=t),Vt.apply(this,arguments)},Pa.defineMIME=function(t,e){Ft[t]=e},Pa.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Pa.defineMIME("text/plain","null"),Pa.defineExtension=function(t,e){Pa.prototype[t]=e},Pa.defineDocExtension=function(t,e){Mi.prototype[t]=e},Pa.fromTextArea=function(t,e){if((e=e?V(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=L();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var o;if(t.form&&(ft(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(l){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(ht(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=o))}},t.style.display="none";var s=Pa(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return s},function(t){t.off=ht,t.on=ft,t.wheelEventPixels=xo,t.Doc=Mi,t.splitLines=Mt,t.countColumn=R,t.findColumn=q,t.isWordChar=tt,t.Pass=B,t.signal=gt,t.Line=Ge,t.changeEnd=Po,t.scrollbarModel=Wr,t.Pos=ee,t.cmpPos=ne,t.modes=It,t.mimeModes=Ft,t.resolveMode=Rt,t.getMode=Ht,t.modeExtensions=zt,t.extendMode=Bt,t.copyState=Ut,t.startState=$t,t.innerMode=Wt,t.commands=na,t.keyMap=Wi,t.keyName=Xi,t.isModifierKey=Ki,t.lookupKey=Gi,t.normalizeKeyMap=qi,t.StringStream=qt,t.SharedTextMarker=Pi,t.TextMarker=Ti,t.LineWidget=Ci,t.e_preventDefault=wt,t.e_stopPropagation=_t,t.e_stop=Ct,t.addClass=D,t.contains=M,t.rmClass=k,t.keyNames=Hi}(Pa),Pa.version="5.65.6",Pa}()},629:(t,e,n)=>{!function(t){function e(t){for(var e={},n=0;n*\/]/.test(n)?x(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=O),x("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),x("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):t.match(/^\w+-/)?x("meta","meta"):void 0}function S(t){return function(e,n){for(var r,o=!1;null!=(r=e.next());){if(r==t&&!o){")"==t&&e.backUp(1);break}o=!o&&"\\"==r}return(r==t||!o&&")"!=t)&&(n.tokenize=null),x("string","string")}}function O(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=S(")"),x(null,"(")}function T(t,e,n){this.type=t,this.indent=e,this.prev=n}function k(t,e,n,r){return t.context=new T(n,e.indentation()+(!1===r?0:a),t.context),n}function P(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function E(t,e,n){return M[n.context.type](t,e,n)}function A(t,e,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return E(t,e,n)}function j(t){var e=t.current().toLowerCase();i=y.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return k(n,e,"block");if("}"==t&&n.context.prev)return P(n);if(w&&/@component/i.test(t))return k(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return k(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return k(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return k(n,e,"at");if("hash"==t)i="builtin";else if("word"==t)i="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return k(n,e,"interpolation");if(":"==t)return"pseudo";if(m&&"("==t)return k(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return f.hasOwnProperty(r)?(i="property","maybeprop"):d.hasOwnProperty(r)?(i=_?"string-2":"property","maybeprop"):m?(i=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==t?"block":m||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(i="error","block")},maybeprop:function(t,e,n){return":"==t?k(n,e,"prop"):E(t,e,n)},prop:function(t,e,n){if(";"==t)return P(n);if("{"==t&&m)return k(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return k(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)j(e);else if("interpolation"==t)return k(n,e,"interpolation")}else i+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?P(n):"word"==t?(i="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?P(n):"("==t?k(n,e,"parens"):"interpolation"==t?k(n,e,"interpolation"):("word"==t&&j(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(i="variable-3",n.context.type):E(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(i="tag",n.context.type):M.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return k(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return P(n)&&k(n,e,m?"block":"top");if("interpolation"==t)return k(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"keyword":f.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?_?"string-2":"property":y.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?A(t,e,n):"{"==t?P(n)&&k(n,e,m?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?P(n):"{"==t||"}"==t?A(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?k(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):E(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,P(n)):"word"==t?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(i="variable","keyframes"):"{"==t?k(n,e,"top"):E(t,e,n)},at:function(t,e,n){return";"==t?P(n):"{"==t||"}"==t?A(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?P(n):"{"==t||";"==t?A(t,e,n):("word"==t?i="variable":"variable"!=t&&"("!=t&&")"!=t&&(i="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new T(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||C)(t,e);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(e.state=M[e.state](o,t,e)),i},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-a)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],r=e(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],p=e(u),f=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],d=e(f),h=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=e(v),m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(m),w=n.concat(o).concat(a).concat(l).concat(u).concat(f).concat(v).concat(m);function _(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:s,propertyKeywords:p,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css",helperType:"gss"})}(n(631))},531:(t,e,n)=>{!function(t){var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},n={};function r(t,e){var r=t.match(function(t){return n[t]||(n[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(e));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function o(t,e){return new RegExp((e?"^":"")+"","i")}function i(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),o=t[n],i=o.length-1;i>=0;i--)r.unshift(o[i])}t.defineMode("htmlmixed",function(n,a){var s=t.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),l={},c=a&&a.tags,u=a&&a.scriptTypes;if(i(e,l),c&&i(c,l),u)for(var p=u.length-1;p>=0;p--)l.script.unshift(["type",u[p].matches,u[p].mode]);function f(e,i){var a,c=s.token(e,i.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(e.current())&&(a=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))i.inTag=a+" ";else if(i.inTag&&u&&/>$/.test(e.current())){var p=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var d=">"==e.current()&&function(t,e){for(var n=0;n-1?t.backUp(r.length-o):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}(t,v,e.localMode.token(t,e.localState))},i.localMode=h,i.localState=t.startState(h,s.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=e.current(),e.eol()&&(i.inTag+=" "));return c}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:t.startState(s)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(s,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?s.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||s}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(631),n(589),n(876),n(629))},876:(t,e,n)=>{var r;(r=n(631)).defineMode("javascript",function(t,e){var n,o,i=t.indentUnit,a=e.statementIndent,s=e.jsonld,l=e.json||s,c=!1!==e.trackScope,u=e.typescript,p=e.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),o=t("keyword d"),i=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t,e,r){return n=t,o=r,e}function v(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=function(t){return function(e,n){var r,o=!1;if(s&&"@"==e.peek()&&e.match(h))return n.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||o);)o=!o&&"\\"==r;return o||(n.tokenize=v),g("string","string")}}(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&t.eat(">"))return g("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==n)return t.eat("*")?(e.tokenize=y,y(t,e)):t.eat("/")?(t.skipToEnd(),g("comment","comment")):Qt(t,e,1)?(function(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(t.eat("="),g("operator","operator",t.current()));if("`"==n)return e.tokenize=m,m(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");if("#"==n&&t.eatWhile(p))return g("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");if(d.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?g("."):g("operator","operator",t.current());if(p.test(n)){t.eatWhile(p);var r=t.current();if("."!=e.lastType){if(f.propertyIsEnumerable(r)){var o=f[r];return g(o.type,o.style,r)}if("async"==r&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",r)}return g("variable","variable",r)}}function y(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return g("comment","comment")}function m(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=v;break}r=!r&&"\\"==n}return g("quasi","string-2",t.current())}function b(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(p.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(e.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function _(t,e,n,r,o,i){this.indented=t,this.column=e,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function x(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function C(t,e,n,r,o){var i=t.cc;for(S.state=t,S.stream=o,S.marked=null,S.cc=i,S.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((i.length?i.pop():l?B:H)(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return S.marked?S.marked:"variable"==n&&x(t,r)?"variable-2":e}}var S={state:null,column:null,marked:null,cc:null};function O(){for(var t=arguments.length-1;t>=0;t--)S.cc.push(arguments[t])}function T(){return O.apply(null,arguments),!0}function k(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function P(t){var n=S.state;if(S.marked="def",c){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=E(t,n.context);if(null!=r)return void(n.context=r)}else if(!k(t,n.localVars))return void(n.localVars=new M(t,n.localVars));e.globalVars&&!k(t,n.globalVars)&&(n.globalVars=new M(t,n.globalVars))}}function E(t,e){if(e){if(e.block){var n=E(t,e.prev);return n?n==e.prev?e:new j(n,e.vars,!0):null}return k(t,e.vars)?e:new j(e.prev,new M(t,e.vars),!1)}return null}function A(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function j(t,e,n){this.prev=t,this.vars=e,this.block=n}function M(t,e){this.name=t,this.next=e}var L=new M("this",new M("arguments",null));function D(){S.state.context=new j(S.state.context,S.state.localVars,!1),S.state.localVars=L}function N(){S.state.context=new j(S.state.context,S.state.localVars,!0),S.state.localVars=null}function I(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function F(t,e){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new _(r,S.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function V(){var t=S.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function R(t){return function e(n){return n==t?T():";"==t||"}"==n||")"==n||"]"==n?O():T(e)}}function H(t,e){return"var"==t?T(F("vardef",e),St,R(";"),V):"keyword a"==t?T(F("form"),W,H,V):"keyword b"==t?T(F("form"),H,V):"keyword d"==t?S.stream.match(/^\s*$/,!1)?T():T(F("stat"),q,R(";"),V):"debugger"==t?T(R(";")):"{"==t?T(F("}"),N,lt,V,I):";"==t?T():"if"==t?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==V&&S.state.cc.pop()(),T(F("form"),W,H,V,At)):"function"==t?T(Dt):"for"==t?T(F("form"),N,jt,H,I,V):"class"==t||u&&"interface"==e?(S.marked="keyword",T(F("form","class"==t?t:e),Rt,V)):"variable"==t?u&&"declare"==e?(S.marked="keyword",T(H)):u&&("module"==e||"enum"==e||"type"==e)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==e?T(Jt):"type"==e?T(It,R("operator"),dt,R(";")):T(F("form"),Ot,R("{"),F("}"),lt,V,V)):u&&"namespace"==e?(S.marked="keyword",T(F("form"),B,H,V)):u&&"abstract"==e?(S.marked="keyword",T(H)):T(F("stat"),et):"switch"==t?T(F("form"),W,R("{"),F("}","switch"),N,lt,V,V,I):"case"==t?T(B,R(":")):"default"==t?T(R(":")):"catch"==t?T(F("form"),D,z,H,V,I):"export"==t?T(F("stat"),Ut,V):"import"==t?T(F("stat"),$t,V):"async"==t?T(H):"@"==e?T(B,H):O(F("stat"),B,R(";"),V)}function z(t){if("("==t)return T(Ft,R(")"))}function B(t,e){return $(t,e,!1)}function U(t,e){return $(t,e,!0)}function W(t){return"("!=t?O():T(F(")"),q,R(")"),V)}function $(t,e,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:J;if("("==t)return T(D,F(")"),at(Ft,")"),V,R("=>"),r,I);if("variable"==t)return O(D,Ot,R("=>"),r,I)}var o=n?K:G;return w.hasOwnProperty(t)?T(o):"function"==t?T(Dt,o):"class"==t||u&&"interface"==e?(S.marked="keyword",T(F("form"),Vt,V)):"keyword c"==t||"async"==t?T(n?U:B):"("==t?T(F(")"),q,R(")"),V,o):"operator"==t||"spread"==t?T(n?U:B):"["==t?T(F("]"),Xt,V,o):"{"==t?st(rt,"}",null,o):"quasi"==t?O(Y,o):"new"==t?T(function(t){return function(e){return"."==e?T(t?tt:Q):"variable"==e&&u?T(_t,t?K:G):O(t?U:B)}}(n)):T()}function q(t){return t.match(/[;\}\)\],]/)?O():O(B)}function G(t,e){return","==t?T(q):K(t,e,!1)}function K(t,e,n){var r=0==n?G:K,o=0==n?B:U;return"=>"==t?T(D,n?Z:J,I):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?T(r):u&&"<"==e&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(F(">"),at(dt,">"),V,r):"?"==e?T(B,R(":"),o):T(o):"quasi"==t?O(Y,r):";"!=t?"("==t?st(U,")","call",r):"."==t?T(nt,r):"["==t?T(F("]"),q,R("]"),V,r):u&&"as"==e?(S.marked="keyword",T(dt,r)):"regexp"==t?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),T(o)):void 0:void 0}function Y(t,e){return"quasi"!=t?O():"${"!=e.slice(e.length-2)?T(Y):T(q,X)}function X(t){if("}"==t)return S.marked="string-2",S.state.tokenize=m,T(Y)}function J(t){return b(S.stream,S.state),O("{"==t?H:B)}function Z(t){return b(S.stream,S.state),O("{"==t?H:U)}function Q(t,e){if("target"==e)return S.marked="keyword",T(G)}function tt(t,e){if("target"==e)return S.marked="keyword",T(K)}function et(t){return":"==t?T(V,H):O(G,R(";"),V)}function nt(t){if("variable"==t)return S.marked="property",T()}function rt(t,e){return"async"==t?(S.marked="property",T(rt)):"variable"==t||"keyword"==S.style?(S.marked="property","get"==e||"set"==e?T(ot):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),T(it))):"number"==t||"string"==t?(S.marked=s?"property":S.style+" property",T(it)):"jsonld-keyword"==t?T(it):u&&A(e)?(S.marked="keyword",T(rt)):"["==t?T(B,ct,R("]"),it):"spread"==t?T(U,it):"*"==e?(S.marked="keyword",T(rt)):":"==t?O(it):void 0;var n}function ot(t){return"variable"!=t?O(it):(S.marked="property",T(Dt))}function it(t){return":"==t?T(U):"("==t?O(Dt):void 0}function at(t,e,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),T(function(n,r){return n==e||r==e?O():O(t)},r)}return o==e||i==e?T():n&&n.indexOf(";")>-1?O(t):T(R(e))}return function(n,o){return n==e||o==e?T():O(t,r)}}function st(t,e,n){for(var r=3;r"),dt):"quasi"==t?O(yt,wt):void 0}function ht(t){if("=>"==t)return T(dt)}function gt(t){return t.match(/[\}\)\]]/)?T():","==t||";"==t?T(gt):O(vt,gt)}function vt(t,e){return"variable"==t||"keyword"==S.style?(S.marked="property",T(vt)):"?"==e||"number"==t||"string"==t?T(vt):":"==t?T(dt):"["==t?T(R("variable"),ut,R("]"),vt):"("==t?O(Nt,vt):t.match(/[;\}\)\],]/)?void 0:T()}function yt(t,e){return"quasi"!=t?O():"${"!=e.slice(e.length-2)?T(yt):T(dt,mt)}function mt(t){if("}"==t)return S.marked="string-2",S.state.tokenize=m,T(yt)}function bt(t,e){return"variable"==t&&S.stream.match(/^\s*[?:]/,!1)||"?"==e?T(bt):":"==t?T(dt):"spread"==t?T(bt):O(dt)}function wt(t,e){return"<"==e?T(F(">"),at(dt,">"),V,wt):"|"==e||"."==t||"&"==e?T(dt):"["==t?T(dt,R("]"),wt):"extends"==e||"implements"==e?(S.marked="keyword",T(dt)):"?"==e?T(dt,R(":"),dt):void 0}function _t(t,e){if("<"==e)return T(F(">"),at(dt,">"),V,wt)}function xt(){return O(dt,Ct)}function Ct(t,e){if("="==e)return T(dt)}function St(t,e){return"enum"==e?(S.marked="keyword",T(Jt)):O(Ot,ct,Pt,Et)}function Ot(t,e){return u&&A(e)?(S.marked="keyword",T(Ot)):"variable"==t?(P(e),T()):"spread"==t?T(Ot):"["==t?st(kt,"]"):"{"==t?st(Tt,"}"):void 0}function Tt(t,e){return"variable"!=t||S.stream.match(/^\s*:/,!1)?("variable"==t&&(S.marked="property"),"spread"==t?T(Ot):"}"==t?O():"["==t?T(B,R("]"),R(":"),Tt):T(R(":"),Ot,Pt)):(P(e),T(Pt))}function kt(){return O(Ot,Pt)}function Pt(t,e){if("="==e)return T(U)}function Et(t){if(","==t)return T(St)}function At(t,e){if("keyword b"==t&&"else"==e)return T(F("form","else"),H,V)}function jt(t,e){return"await"==e?T(jt):"("==t?T(F(")"),Mt,V):void 0}function Mt(t){return"var"==t?T(St,Lt):"variable"==t?T(Lt):O(Lt)}function Lt(t,e){return")"==t?T():";"==t?T(Lt):"in"==e||"of"==e?(S.marked="keyword",T(B,Lt)):O(B,Lt)}function Dt(t,e){return"*"==e?(S.marked="keyword",T(Dt)):"variable"==t?(P(e),T(Dt)):"("==t?T(D,F(")"),at(Ft,")"),V,pt,H,I):u&&"<"==e?T(F(">"),at(xt,">"),V,Dt):void 0}function Nt(t,e){return"*"==e?(S.marked="keyword",T(Nt)):"variable"==t?(P(e),T(Nt)):"("==t?T(D,F(")"),at(Ft,")"),V,pt,I):u&&"<"==e?T(F(">"),at(xt,">"),V,Nt):void 0}function It(t,e){return"keyword"==t||"variable"==t?(S.marked="type",T(It)):"<"==e?T(F(">"),at(xt,">"),V):void 0}function Ft(t,e){return"@"==e&&T(B,Ft),"spread"==t?T(Ft):u&&A(e)?(S.marked="keyword",T(Ft)):u&&"this"==t?T(ct,Pt):O(Ot,ct,Pt)}function Vt(t,e){return"variable"==t?Rt(t,e):Ht(t,e)}function Rt(t,e){if("variable"==t)return P(e),T(Ht)}function Ht(t,e){return"<"==e?T(F(">"),at(xt,">"),V,Ht):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(S.marked="keyword"),T(u?dt:B,Ht)):"{"==t?T(F("}"),zt,V):void 0}function zt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&A(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",T(zt)):"variable"==t||"keyword"==S.style?(S.marked="property",T(Bt,zt)):"number"==t||"string"==t?T(Bt,zt):"["==t?T(B,ct,R("]"),Bt,zt):"*"==e?(S.marked="keyword",T(zt)):u&&"("==t?O(Nt,zt):";"==t||","==t?T(zt):"}"==t?T():"@"==e?T(B,zt):void 0}function Bt(t,e){if("!"==e)return T(Bt);if("?"==e)return T(Bt);if(":"==t)return T(dt,Pt);if("="==e)return T(U);var n=S.state.lexical.prev;return O(n&&"interface"==n.info?Nt:Dt)}function Ut(t,e){return"*"==e?(S.marked="keyword",T(Yt,R(";"))):"default"==e?(S.marked="keyword",T(B,R(";"))):"{"==t?T(at(Wt,"}"),Yt,R(";")):O(H)}function Wt(t,e){return"as"==e?(S.marked="keyword",T(R("variable"))):"variable"==t?O(U,Wt):void 0}function $t(t){return"string"==t?T():"("==t?O(B):"."==t?O(G):O(qt,Gt,Yt)}function qt(t,e){return"{"==t?st(qt,"}"):("variable"==t&&P(e),"*"==e&&(S.marked="keyword"),T(Kt))}function Gt(t){if(","==t)return T(qt,Gt)}function Kt(t,e){if("as"==e)return S.marked="keyword",T(qt)}function Yt(t,e){if("from"==e)return S.marked="keyword",T(B)}function Xt(t){return"]"==t?T():O(at(U,"]"))}function Jt(){return O(F("form"),Ot,R("{"),F("}"),at(Zt,"}"),V,V)}function Zt(){return O(Ot,Pt)}function Qt(t,e,n){return e.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return D.lex=N.lex=!0,I.lex=!0,V.lex=!0,{startState:function(t){var n={tokenize:v,lastType:"sof",cc:[],lexical:new _((t||0)-i,0,"block",!1),localVars:e.localVars,context:e.localVars&&new j(null,null,!1),indented:t||0};return e.globalVars&&"object"==typeof e.globalVars&&(n.globalVars=e.globalVars),n},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),b(t,e)),e.tokenize!=y&&t.eatSpace())return null;var r=e.tokenize(t,e);return"comment"==n?r:(e.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",C(e,r,n,o,t))},indent:function(t,n){if(t.tokenize==y||t.tokenize==m)return r.Pass;if(t.tokenize!=v)return 0;var o,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==V)l=l.prev;else if(u!=At&&u!=I)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==G||o==K)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,f=s==p;return"vardef"==p?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==p&&"{"==s?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+(function(t,e){return"operator"==t.lastType||","==t.lastType||d.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}(t,n)?a||i:0):"switch"!=l.info||f||0==e.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:i):l.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Qt,skipExpression:function(t){C(t,"atom","atom","true",new r.StringStream("",2,null))}}}),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})},589:(t,e,n)=>{var r,o,i;r=n(631),o={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},r.defineMode("xml",function(t,e){var n,a,s=t.indentUnit,l={},c=e.htmlMode?o:i;for(var u in c)l[u]=c[u];for(var u in e)l[u]=e[u];function p(t,e){function r(n){return e.tokenize=n,n(t,e)}var o=t.next();return"<"==o?t.eat("!")?t.eat("[")?t.match("CDATA[")?r(d("atom","]]>")):null:t.match("--")?r(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(h(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=d("meta","?>"),"meta"):(n=t.eat("/")?"closeTag":"openTag",e.tokenize=f,"tag bracket"):"&"==o?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function f(t,e){var r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=p,n=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return n="equals",null;if("<"==r){e.tokenize=p,e.state=b,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=function(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=f;break}return"string"};return e.isInAttribute=!0,e}(r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=p;break}n.next()}return t}}function h(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=h(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=p;break}return n.tokenize=h(t-1),n.tokenize(e,n)}}return"meta"}}function g(t){return t&&t.toLowerCase()}function v(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function y(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(g(n))||!l.contextGrabbers[g(n)].hasOwnProperty(g(e)))return;y(t)}}function b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),w):"closeTag"==t?_:b}function w(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,0,n)):(a="error",w)}function _(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",x(t,0,n)):(a="error",C)}function x(t,e,n){return"endTag"!=t?(a="error",x):(y(n),b)}function C(t,e,n){return a="error",x(t,0,n)}function S(t,e,n){if("word"==t)return a="attribute",O;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(g(r))?m(n,r):(m(n,r),n.context=new v(n,r,o==n.indented)),b}return a="error",S}function O(t,e,n){return"equals"==t?T:(l.allowMissing||(a="error"),S(t,0,n))}function T(t,e,n){return"string"==t?k:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,0,n))}function k(t,e,n){return"string"==t?k:S(t,0,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:b,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;n=null;var r=e.tokenize(t,e);return(r||n)&&"comment"!=r&&(a=null,e.state=e.state(n||r,t,e),a&&(r="error"==a?r+" error":a)),r},indent:function(t,e,n){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(o&&o.noIndent)return r.Pass;if(t.tokenize!=f&&t.tokenize!=p)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==T&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}}),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})},858:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},884:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var r=n(50),o=n(163),i=n(668);const a={run:function(t){(0,r.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){" "===(0,o.getKeyChar)(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,r=this.em,o=this.dragger,a=t?"add":"remove";this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),o||(o=new i.Z({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger("canvas:move:start",e)},onDrag:function(t,e){r.trigger("canvas:move",e)},onEnd:function(t,e){r.trigger("canvas:move:end",e)}}),this.dragger=o),t?o.start(e):o.stop()},toggleMove:function(t){var e=this.ppfx,n=t?"add":"remove",r=t?"on":"off",i={on:o.on,off:o.off},a=this.getCanvas(),s=["".concat(e,"is__grab")];!t&&s.push("".concat(e,"is__grabbing")),s.forEach(function(t){return a.classList[n](t)}),i[r](document,"keyup",this.onKeyUp),i[r](a,"mousedown",this.enableDragger),i[r](document,"mouseup",this.disableDragger)}}},790:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s,defineCommand:()=>a});var r,o=n(346),i=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function a(t){return t}const s=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var r=n.config.stylePrefix;return n.pfx=r,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(r,"hover"),n.badgeClass="".concat(r,"badge"),n.plhClass="".concat(r,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return i(e,t),e.prototype.onFrameScroll=function(){},e.prototype.getCanvas=function(){return this.canvas.getElement()},e.prototype.getCanvasBody=function(){return this.canvas.getBody()},e.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},e.prototype.init=function(){},e.prototype.callRun=function(t,e){void 0===e&&(e={});var n=this.id;if(t.trigger("run:".concat(n,":before"),e),!e||!e.abort){var r=e.sender||t,o=this.run(t,r,e);return t.trigger("run:".concat(n),o,e),t.trigger("run",n,o,e),o}t.trigger("abort:".concat(n),e)},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,r=e.sender||t;t.trigger("stop:".concat(n,":before"),e);var o=this.stop(t,r,e);return t.trigger("stop:".concat(n),o,e),t.trigger("stop",n,o,e),o},e.prototype.stopCommand=function(t){this.em.Commands.stop(this.id,t)},e.prototype.run=function(){},e.prototype.stop=function(){},e}(o.Hn)},180:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={run:function(t,e,n){var o=this;void 0===n&&(n={});var i=[],a=n.component||t.getSelectedAll();return(a=(0,r.isArray)(a)?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o{n.r(e),n.d(e,{default:()=>s});var r=n(50),o=n(668),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ');(e=document.createElement("div")).className="".concat(s,"guides"),l.className="".concat(s,"guide-info ").concat(s,"guide-info__x"),c.className="".concat(s,"guide-info ").concat(s,"guide-info__y"),l.innerHTML=u,c.innerHTML=u,e.appendChild(l),e.appendChild(c),o.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=l,this.elGuideInfoY=c,this.elGuideInfoContentX=l.querySelector(".".concat(s,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(s,"guide-info__content")),i.on("canvas:update frame:scroll",(0,r.debounce)(function(){var e;t.updateGuides(),a.debug&&(null===(e=t.guides)||void 0===e||e.forEach(function(e){return t.renderGuide(e)}))},200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),o=n.parentNode,i=void 0===o?{}:o;return(0,r.each)(i.children,function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])}),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,o=this;(t||this.guides).forEach(function(t){var i=t.origin,a=e===i?n:o.getElementPos(i);e=i,n=a,(0,r.each)(o.getGuidePosUpdate(t,a),function(e,n){return t[n]=e}),t.originRect=a})},getGuidePosUpdate:function(t,e){var n={},r=e.top,o=e.height,i=e.left,a=e.width;switch(t.type){case"t":n.y=r;break;case"b":n.y=r+o;break;case"l":n.x=i;break;case"r":n.x=i+a;break;case"x":n.x=i+a/2;break;case"y":n.y=r+o/2}return n},renderGuide:function(t){void 0===t&&(t={});var e=t.guide||document.createElement("div"),n="px",r=t.active?2:1,o=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?"green":"red",";"),e.children.length||((o=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",e.appendChild(o)),t.y?(e.style.width="100%",e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height="100%",e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),o=r.top,a=r.height,s=r.left,l=r.width,c=[{type:"t",y:o},{type:"b",y:o+a},{type:"l",x:s},{type:"r",x:s+l},{type:"x",x:s+l/2},{type:"y",y:o+a/2}].map(function(o){return i(i({},o),{origin:t,originRect:r,guide:n.debug&&e.renderGuide(o)})});return c.forEach(function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)}),c},getTranslate:function(t,e){void 0===e&&(e="x");var n=0;return(t||"").split(" ").forEach(function(t){var r=t.trim(),o="translate".concat(e.toUpperCase(),"(");0===r.indexOf(o)&&(n=parseFloat(r.replace(o,"")))}),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),o="".concat(r).concat(n,")"),i=(t||"").split(" ").map(function(t){return 0===t.trim().indexOf(r)&&(t=o),t}).join(" ");return i.indexOf(r)<0&&(i+=" ".concat(o)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,o=n.top,i=n.transform,a=0,s=0;return e?(a=this.getTranslate(i),s=this.getTranslate(i,"y")):(a=parseFloat(r||0),s=parseFloat(o||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,o=t.end,i=t.position,a=t.width,s=t.height,l=this,c=l.target,u=l.isTran,p=l.em,f=!o,d="".concat(parseInt(e,10)).concat("px"),h="".concat(parseInt(n,10)).concat("px"),g={};if(u){var v=c.getStyle().transform||"";v=this.setTranslate(v,"x",d),g={transform:v=this.setTranslate(v,"y",h),__p:f},c.addStyle(g,{avoidStore:!o})}else{var y={position:i,width:a,height:s},m={left:d,top:h,__p:f};(0,r.keys)(y).forEach(function(t){var e=y[t];e&&(m[t]=e)}),g=m,c.addStyle(g,{avoidStore:!o})}null==p||p.Styles.__emitCmpStyleUpdate(g,{components:p.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this,n=e.target,r=e.editor,o=e.isTran,i=e.opts,a=i.center,s=i.onStart,l=r.Canvas,c=n.getStyle(),u="absolute",p=[u,"relative"];if(s&&s(this._getDragData()),!o&&c.position!==u){var f=l.offset(n.getEl()),d=f.left,h=f.top,g=f.width,v=f.height,y=n.parent(),m=void 0;do{var b=y.getStyle();m=p.indexOf(b.position)>=0?y:null,y=y.parent()}while(y&&!m);if(a){var w=l.getMouseRelativeCanvas(t);d=w.x,h=w.y}else if(m){var _=l.offset(m.getEl());d-=_.left,h-=_.top}this.setPosition({x:d,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:u})}},onDrag:function(){for(var t=this,e=[],n=0;n0}).sort(function(t,e){return t.gap-e.gap}).map(function(t){return t.guide})[0];if(m){var b=m.originRect,w=b.left,_=b.width,x=b.top,C=b.height,S=b.rect,O=u?w{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n=t.components(),r=n&&n.filter(function(t){return t.get("selectable")})[0];r&&e.push(r)}),e.length&&t.select(e)}}}},368:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach(function(t){for(var e=t.parent();e&&!e.get("selectable");)e=e.parent();e&&r.push(e)}),r.length&&t.select(r)}}}},243:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n=t.parent();if(n){var r,o=n.components().length,i=0,a=0;do{i++,r=(a=t.index()+i)<=o?n.getChildAt(a):null}while(r&&!r.get("selectable"));e.push(r||t)}}),e.length&&t.select(e)}}}},400:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach(function(t){var n=t.parent();if(n){var r,o=0,i=0;do{o++,r=(i=t.index()-o)>=0?n.getChildAt(i):null}while(r&&!r.get("selectable"));e.push(r||t)}}),e.length&&t.select(e)}}}},910:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={run:function(t,e,n){void 0===n&&(n={});var o=n.target,i=[];if(!o.get("styles"))return i;var a=o.get("type"),s=t.Pages.getAllWrappers();if(!(0,r.flatten)(s.map(function(t){return t.findType(a)})).length){var l=t.CssComposer.getAll();i=l.filter(function(t){return t.get("group")==="cmp:".concat(a)}),l.remove(i)}return i}}},744:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.getModel(),n=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o{n.r(e),n.d(e,{default:()=>a});var r=n(50),o=n(895),i=n(407);const a=(0,r.extend)({},i.default,{init:function(){(0,r.bindAll)(this,"startDelete","stopDelete","onDelete"),this.hoverClass=this.pfx+"hover-delete",this.badgeClass=this.pfx+"badge-red"},enable:function(){this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=(0,o.default)(t.target);e.data("model").get("removable")&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),(0,o.default)(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=(0,o.default)(t.target);e.data("model").get("removable")&&(e.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html("Remove "+t.getName())}})},457:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={run:function(t,e,n){var o=this;void 0===n&&(n={}),e&&e.set&&e.set("active",0);var i=t.getConfig(),a=t.Modal,s=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var l=this.buildEditor("htmlmixed","hopscotch","HTML"),c=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=l.el,this.cssEditor=c.el;var u=(0,r.default)('
'));u.append(l.$el).append(c.$el),this.$editors=u}a.open({title:i.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return t.stopCommand("".concat(o.id))}),this.htmlEditor.setContent(t.getHtml(n.optsHtml)),this.cssEditor.setContent(t.getCss(n.optsCss))},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var o=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),i=new this.cm.EditorView({model:o,config:this.cm.getConfig()}).render().$el;return o.init(r),{el:o,$el:i}}}},975:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={isEnabled:function(){var t=document;return!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement)},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||"","fullscreenchange"),this.fsChanged))},run:function(t,e,n){void 0===n&&(n={}),this.sender=e;var o=n.target,i=(0,r.isElement)(o)?o:document.querySelector(o),a=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+"fullscreenchange",this.fsChanged),t.trigger("change:canvasOffset")},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable(),t&&t.trigger("change:canvasOffset")}}},191:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var r=n(50),o=n(895),i=n(163),a=n(407),s=n(189);const l=(0,r.extend)({},s.default,a.default,{init:function(t){a.default.init.apply(this,arguments),(0,r.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=[],e=0;e{n.r(e),n.d(e,{default:()=>i});var r=n(50),o=n(491);const i={open:function(t){var e=this,n=this,o=n.editor,i=n.title,a=n.config,s=n.am,l=a.custom;if((0,r.isFunction)(l.open))return l.open(s.__customData());o.Modal.open({title:i,content:t}).onceClose(function(){return o.stopCommand(e.id)})},close:function(){var t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e,n){void 0===n&&(n={});var r=t.AssetManager,i=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t("assetManager.modalTitle")||"",this.editor=t,this.config=i,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:s,options:n}),i.custom)this.rendered=this.rendered||(0,o.ut)("div"),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter(function(t){return t});s&&s.length&&(u=u.filter(function(t){return-1!==s.indexOf(t.get("type"))})),r.render(u),this.rendered=r.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute("accept",l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},117:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o=n(491);const i={open:function(){var t=this,e=t.container,n=t.editor,o=t.bm,i=t.config,a=i.custom,s=i.appendTo;if((0,r.isFunction)(a.open))return a.open(o.__customData());if(this.firstRender&&!s){var l="views-container",c=n.Panels;(c.getPanel(l)||c.addPanel({id:l})).set("appendContent",e).trigger("change:appendContent"),a||e.appendChild(o.render())}e&&(e.style.display="block")},close:function(){var t=this.container,e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display="none")},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,o.ut)("div"),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},614:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var o="views-container",i=document.createElement("div"),a=n.getPanel(o)||n.addPanel({id:o});r.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),a.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"}},stop:function(){var t=this.layers;t&&(t.style.display="none")}}},801:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),o=t.Panels,i="change:appendContent";this.$cn=(0,r.default)("
"),this.$cn2=(0,r.default)("
"),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=o.addPanel({id:"devices-c"}),l=a.render();s.set("appendContent",l).trigger(i)}var c=t.SelectorManager;this.slm=c;var u=c.getConfig();u.custom?c.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(c.render([]));var p=t.StyleManager;this.sm=p;var f=p.getConfig(),d=f.stylePrefix;this.$header=(0,r.default)('
').concat(t.t("styleManager.empty"),"
")),this.$cn.append(this.$header),f.custom?p.__trgCustom({container:this.$cn2.get(0)}):f.appendTo||this.$cn2.append(p.render());var h="views-container";this.panel=o.getPanel(h),this.panel||(this.panel=o.addPanel({id:h})),this.panel.set("appendContent",this.$cn).trigger(i),this.em=t.getModel(),this.listenTo(this.em,p.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t,e,n,r,o=this.sender,i=this.sm;o&&o.get&&!o.get("active")||!i||(i.getSelected()?(null===(t=this.$cn2)||void 0===t||t.show(),null===(e=this.$header)||void 0===e||e.hide()):(null===(n=this.$cn2)||void 0===n||n.hide(),null===(r=this.$header)||void 0===r||r.show()))},stop:function(){var t,e;null===(t=this.$cn2)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},395:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={run:function(t,e){this.sender=e;var n,o=t.getModel(),i=t.Config.stylePrefix,a=t.TraitManager,s=a.getConfig();if(!s.appendTo){if(!this.$cn){this.$cn=(0,r.default)("
"),this.$cn2=(0,r.default)("
"),this.$cn.append(this.$cn2),this.$header=(0,r.default)("
").append('
').concat(o.t("traitManager.empty"),"
")),this.$cn.append(this.$header),this.$cn2.append('
').concat(o.t("traitManager.label"),"
")),this.$cn2.append(a.render());var l=t.Panels;null==(n=l.getPanel("views-container")?l.getPanel("views-container"):l.addPanel({id:"views-container"}))||n.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=t.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get("active")||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},98:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={run:function(t,e,n){void 0===n&&(n={});var o=t.getModel().get("clipboard"),i=t.getSelected();o&&i&&(t.getSelectedAll().forEach(function(e){var i=e.collection;if(i){var a,s={at:e.index()+1,action:n.action||"paste-component"};if((0,r.contains)(o,e)&&e.get("copyable"))a=i.add(e.clone(),s);else{var l=o.filter(function(t){return t.get("copyable")}).filter(function(n){return t.Components.canMove(e.parent(),n).result});a=i.add(l.map(function(t){return t.clone()}),s)}(a=(0,r.isArray)(a)?a:[a]).forEach(function(e){return t.trigger("component:paste",e)})}}),i.emitUpdate())}}},129:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o="core:component-outline";const i={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?"on":"off";if(e){var o=e.Canvas,i=o.getBody(),a=o.getToolbarEl();a&&(a.style.display=t?"none":"");var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,r.each)(s,function(e){return e.style.pointerEvents=t?"all":""}),e[n]("run:tlb-move:before",this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o{n.r(e),n.d(e,{default:()=>o});var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{n.r(e),n.d(e,{default:()=>S});var r,o=n(50),i=n(895),a=n(346),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.defaults=function(){return{command:"",attributes:{}}},e}(a.Hn);var c,u=(c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(a.FE);const f=p;p.prototype.model=l;var d=n(330),h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n').concat(l,"
"):"",'\n
').concat(o.getName(),"
");a.innerHTML=p?p(o):f}var d=a.style;d.display="block";var h=r.getTargetToElementFixed(t,a,{pos:e}).top,g=n.leftOff<0?-n.leftOff:0;d.top=h+"px",d.left=g+"px"}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=""},initResize:function(t){var e,n=this.em,r=this.canvas,i=null==n?void 0:n.Editor,a=(null==n?void 0:n.config).stylePrefix||"",s="".concat(a,"resizing"),l=!(0,o.isElement)(t)&&(0,x.isTaggableNode)(t)?t:n.getSelected(),c=l&&l.get("resizable"),u={},p=function(t,e,n){var r=n.docs;r&&r.forEach(function(e){var n=e.body,r=n.className||"";n.className=("add"==t?"".concat(r," ").concat(s):r.replace(s,"")).trim()})};if(i&&c){var f=(0,o.isElement)(t)?t:l.getEl();u={onStart:function(t,o){void 0===o&&(o={});var i=o.el,a=o.config,s=o.resizer,c=a.keyHeight,u=a.keyWidth,f=a.currentUnit,d=a.keepAutoHeight,h=a.keepAutoWidth;p("add",0,o),e=n.Styles.getModelToStyle(l),r.toggleFramesEvents(!1);var g=getComputedStyle(i),v=e.getStyle(),y=v[u];a.autoWidth=h&&"auto"===y,isNaN(parseFloat(y))&&(y=g[u]);var m=v[c];a.autoHeight=d&&"auto"===m,isNaN(parseFloat(m))&&(m=g[c]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(m),w=!1,f&&(a.unitHeight=(0,x.getUnitFromValue)(m),a.unitWidth=(0,x.getUnitFromValue)(y))},onMove:function(){i.trigger("component:resize")},onEnd:function(t,e){p("remove",0,e),i.trigger("component:resize"),r.toggleFramesEvents(!0),w=!0},updateTarget:function(t,o,i){if(void 0===i&&(i={}),e){var a=i.store,s=i.selectedHandler,c=i.config,u=c.keyHeight,p=c.keyWidth,f=c.autoHeight,d=c.autoWidth,h=c.unitWidth,g=c.unitHeight,v=["tc","bc"].indexOf(s)>=0,y=["cl","cr"].indexOf(s)>=0,m={};if(!v){var b=r.getBody().offsetWidth,w=o.w{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={startSelectPosition:function(t,e,n){var r=this;void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,i=t.ownerDocument.body;o&&!this.sorter&&(this.sorter=new o.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return r.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),t&&this.sorter.startSort(t,{container:i})},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?(0,r.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,r.default)(this.cDim[this.posIndex][5]).parent():(0,r.default)(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,o=e||"before",i=n.length,a=0!==i&&"after"==o&&r==i;return 0!==i&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},804:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});var r=n(50),o=n(895),i=n(163),a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n')).get(0),A=(0,o.default)('
')).get(0),j=g+P+"-el",M="".concat(g+k+"-el"," ").concat(g+k),L="".concat(j," ").concat(g+P);m=(0,o.default)('
')).get(0),b=(0,o.default)('
')).get(0),w=(0,o.default)('
')).get(0),_=(0,o.default)('
')).get(0),x=(0,o.default)('
')).get(0),C=(0,o.default)('
')).get(0),S=(0,o.default)('
')).get(0),O=(0,o.default)('
')).get(0),this["marginT"+l]=m,this["marginB"+l]=b,this["marginL"+l]=w,this["marginR"+l]=_,this["padT"+l]=x,this["padB"+l]=C,this["padL"+l]=S,this["padR"+l]=O,E.appendChild(m),E.appendChild(b),E.appendChild(w),E.appendChild(_),A.appendChild(x),A.appendChild(C),A.appendChild(S),A.appendChild(O),y.appendChild(E),y.appendChild(A),this[v]="1"}var D="px",N=parseFloat(h.marginLeft.replace(D,""))*u,I=parseFloat(h.marginRight.replace(D,""))*u,F=parseFloat(h.marginTop.replace(D,""))*u,V=parseFloat(h.marginBottom.replace(D,""))*u,R=m.style,H=b.style,z=w.style,B=_.style,U=x.style,W=C.style,$=S.style,q=O.style,G=parseFloat(d.left),K=parseFloat(h.width)*u+D;R.height=F+D,R.width=K,R.top=d.top-F+D,R.left=G+D,H.height=V+D,H.width=K,H.top=d.top+d.height+D,H.left=G+D;var Y=d.height+F+V+D,X=d.top-F+D;z.height=Y,z.width=N+D,z.top=X,z.left=G-N+D,B.height=Y,B.width=I+D,B.top=X,B.left=G+d.width+D;var J=parseFloat(h.paddingTop)*u;U.height=J+D;var Z=parseFloat(h.paddingBottom)*u;W.height=Z+D;var Q=d.height-Z-J+D,tt=d.top+J+D;$.height=Q,$.width=parseFloat(h.paddingLeft)*u+D,$.top=tt;var et=parseFloat(h.paddingRight)*u;q.height=Q,q.width=et+D,q.top=tt}},stop:function(t,e,n){void 0===n&&(n={});var r=(n||{}).state||"",o=this.getOffsetMethod(r);t.Canvas[o](n.view).style.opacity=0}}},434:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={init:function(){(0,r.bindAll)(this,"_onFramesChange")},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t,e){var n=this;if(void 0===e&&(e=1),!t.Commands.isActive("preview")){var r=t.Canvas,o=e?"on":"off";r.getFrames().forEach(function(t){return n._upFrame(t,e)}),r.getModel()[o]("change:frames",this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach(function(t){return t.once("loaded",function(){return n._upFrame(t,!0)})})},_upFrame:function(t,e){var n,r=e?"add":"remove";null===(n=t.view)||void 0===n||n.getBody().classList[r]("".concat(this.ppfx,"dashed"))}}},346:(t,e,n)=>{n.d(e,{FE:()=>l,G7:()=>c,Hn:()=>s});var r,o=n(316),i=n.n(o),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(i().Model),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(i().Collection),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(i().View)},330:(t,e,n)=>{n.d(e,{Z:()=>l});var r,o=n(50),i=n(346),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r){void 0===e&&(e={}),void 0===r&&(r=!1);var o=t.call(this,e)||this;return o.itemsView="",o.itemType="type",o.reuseView=!1,o.config=n||e.config||{},r&&o.listenTo(o.collection,"add",o.addTo),o.items=[],o}return a(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,r=e.em,o="".concat(n?"[".concat(n,"]: "):"","'").concat(t,"' type not found");r&&r.logWarning(o)},e.prototype.add=function(t,e){var n,r=this,i=r.config,a=r.reuseView,s=r.items,l=this.itemsView||{},c=e||null,u=this.itemView,p=t.get(this.itemType);l[p]?u=l[p]:!p||l[p]||(0,o.includes)(["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],p)||this.itemViewNotFound(p),n=t.view&&a?t.view:new u({model:t,config:i},i),s&&s.push(n);var f=n.render().el;c?c.appendChild(f):this.$el.append(f)},e.prototype.render=function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(){},e.prototype.onRemove=function(){},e.prototype.remove=function(e){void 0===e&&(e={});var n=this.items;return this.onRemoveBefore(n,e),this.clearItems(),t.prototype.remove.call(this),this.onRemove(n,e),this},e.prototype.clearItems=function(){this.items},e}(i.G7);const l=s;s.prototype.itemView=""},668:(t,e,n)=>{n.d(e,{Z:()=>s});var r=n(50),o=n(163),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=e&&t<=e+r||t<=e&&t>=e-r},t.prototype.setGuideLock=function(t,e){var n=(0,r.isUndefined)(t.x)?"Y":"X",o="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[o]=t):(delete t.active,delete t.lock,delete this[o]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,o=!!e.cancel,i=o?0:n.x,a=o?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,a,!0);var s=this.opts.onEnd;(0,r.isFunction)(s)&&s(t,this,{cancelled:o})},t.prototype.keyHandle=function(t){(0,o.isEscKey)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var o=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+t,c=a.y+e;this.position={x:l,y:c,end:n},(0,r.isFunction)(s)&&s(this.position),o&&(o.style.left="".concat(l,"px"),o.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map(function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow})},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,o.getPointerEvent)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,r.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=t,r=e,o=Math.abs(n),i=Math.abs(r);return r>=o||r<=-o?"x":n>i||n<-i?"y":void 0},t}()},895:(t,e,n)=>{n.r(e),n.d(e,{default:()=>gt});var r="undefined"!=typeof document?document:null,o="undefined"!=typeof window?window:null,i=Array.prototype,a=i.filter,s=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,f=i.splice,d=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function y(t,e){return void 0===e&&(e=r),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function m(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(P(t)){if(e.__cash&&(e=e[0]),!(n=d.test(t)?e.getElementById(t.slice(1)):g.test(t)?ft(t):y(t,e)))return}else if(k(t))return this.ready(t);(n.nodeType||n===o)&&(n=[n]),this.length=n.length;for(var i=0,a=this.length;i=0}):n.value=o})},w.clone=function(){return this.map(function(t,e){return e.cloneNode(!0)})},w.detach=function(){return this.each(function(t,e){e.parentNode&&e.parentNode.removeChild(e)})};var ct,ut=/^\s*<(\w+)[^>]*>/,pt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function ft(t){if(function(){if(!ct){var t=r.createElement("table"),e=r.createElement("tr");ct={"*":r.createElement("div"),tr:r.createElement("tbody"),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!P(t))return[];if(pt.test(t))return[r.createElement(RegExp.$1)];var e=ut.test(t)&&RegExp.$1,n=ct[e]||ct["*"];return n.innerHTML=t,b(n.childNodes).detach().get()}function dt(t,e,n){if(void 0!==e){var r=P(e);!r&&e.length?S(e,function(e){return dt(t,e,n)}):S(t,r?function(t){t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,r){return o=t,i=r?e.cloneNode(!0):e,void(n?o.insertBefore(i,o.childNodes[0]):o.appendChild(i));var o,i})}}b.parseHTML=ft,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return S(arguments,function(e){dt(t,e)}),this},w.appendTo=function(t){return dt(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each(function(t,n){n.innerHTML=e})},w.insertAfter=function(t){var e=this;return b(t).each(function(t,n){var r=n.parentNode;e.each(function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n.nextSibling)})}),this},w.after=function(){var t=this;return S(u.apply(arguments),function(e){u.apply(b(e).slice()).insertAfter(t)}),this},w.insertBefore=function(t){var e=this;return b(t).each(function(t,n){var r=n.parentNode;e.each(function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n)})}),this},w.before=function(){var t=this;return S(arguments,function(e){b(e).insertBefore(t)}),this},w.prepend=function(){var t=this;return S(arguments,function(e){dt(t,e,!0)}),this},w.prependTo=function(t){return dt(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each(function(n,r){var o=r.parentNode;if(o){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;o.replaceChild(i[0],r),b(i[0]).after(i.slice(1))}})},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:"":this.each(function(e,n){n.textContent=t})};var ht=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+o.pageYOffset-ht.clientTop,left:e.left+o.pageXOffset-ht.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each(function(t,n){c.apply(e,n.children)}),e=b(D(e)),t?e.filter(function(e,n){return T(n,t)}):e},w.contents=function(){var t=[];return this.each(function(e,n){c.apply(t,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)}),b(t.length&&D(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n{n.d(e,{$Q:()=>d,FW:()=>u,G1:()=>i,GX:()=>b,L_:()=>s,Mx:()=>a,R3:()=>h,SJ:()=>m,cx:()=>l,dL:()=>f,pn:()=>p,rw:()=>v,sE:()=>c,t3:()=>y,ut:()=>g});var r=n(50),o=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o=i?t.appendChild(e):t.insertBefore(e,o[a])},h=function(t,e){return d(t,e)},g=function(t,e,n){void 0===e&&(e={});var o=document.createElement(t);return e&&(0,r.each)(e,function(t,e){return o.setAttribute(e,t)}),n&&((0,r.isString)(n)?o.innerHTML=n:o.appendChild(n)),o},v=function(t){return document.createTextNode(t)},y=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(o){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf("key")&&(n.keyCodeVal=t.keyCode,["keyCode","which"].forEach(function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})})),n},m=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach(function(e){var n=e.tag||"div",o=e.attributes||{},i=document.createElement(n);(0,r.each)(o,function(t,e){i.setAttribute(e,t)}),t.appendChild(i)})},b=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,r=e.defaultView||window;return{x:(r.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(r.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}}},163:(t,e,n)=>{n.r(e),n.d(e,{appendStyles:()=>f,buildBase64UrlFromSvg:()=>W,camelCase:()=>m,capitalize:()=>V,createId:()=>U,deepMerge:()=>P,escape:()=>T,escapeNodeContent:()=>k,find:()=>O,getElRect:()=>A,getElement:()=>_,getGlobal:()=>s,getKeyChar:()=>L,getKeyCode:()=>M,getModel:()=>E,getPointerEvent:()=>j,getUiClass:()=>p,getUnitFromValue:()=>v,getViewEl:()=>z,hasDnd:()=>w,hasWin:()=>a,isCommentNode:()=>C,isComponent:()=>R,isDef:()=>i,isEmptyObj:()=>F,isEnterKey:()=>N,isEscKey:()=>D,isObject:()=>I,isRule:()=>H,isTaggableNode:()=>S,isTextNode:()=>x,matches:()=>u,normalizeFloat:()=>b,off:()=>g,on:()=>h,setViewEl:()=>B,shallowDiff:()=>d,toLowerCase:()=>l,upFirst:()=>y});var r=n(50),o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0?a!==s&&(n[i]=s):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,r.isUndefined)(t[i])&&(n[i]=e[i]);return n},h=function(t,e,n,r){var o=e.split(/\s+/);t=t instanceof Array?t:[t];for(var i=function(e){t.forEach(function(t){return t&&t.addEventListener(o[e],n,r)})},a=0;a/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},k=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&").replace(//g,">")},P=function(){for(var t=[],e=0;e{var r={"./CanvasClear":858,"./CanvasClear.ts":858,"./CanvasMove":884,"./CanvasMove.ts":884,"./CommandAbstract":790,"./CommandAbstract.ts":790,"./ComponentDelete":180,"./ComponentDelete.ts":180,"./ComponentDrag":544,"./ComponentDrag.ts":544,"./ComponentEnter":236,"./ComponentEnter.ts":236,"./ComponentExit":368,"./ComponentExit.ts":368,"./ComponentNext":243,"./ComponentNext.ts":243,"./ComponentPrev":400,"./ComponentPrev.ts":400,"./ComponentStyleClear":910,"./ComponentStyleClear.ts":910,"./CopyComponent":744,"./CopyComponent.ts":744,"./DeleteComponent":517,"./DeleteComponent.ts":517,"./ExportTemplate":457,"./ExportTemplate.ts":457,"./Fullscreen":975,"./Fullscreen.ts":975,"./MoveComponent":191,"./MoveComponent.ts":191,"./OpenAssets":912,"./OpenAssets.ts":912,"./OpenBlocks":117,"./OpenBlocks.ts":117,"./OpenLayers":614,"./OpenLayers.ts":614,"./OpenStyleManager":801,"./OpenStyleManager.ts":801,"./OpenTraitManager":395,"./OpenTraitManager.ts":395,"./PasteComponent":98,"./PasteComponent.ts":98,"./Preview":129,"./Preview.ts":129,"./Resize":116,"./Resize.ts":116,"./SelectComponent":407,"./SelectComponent.ts":407,"./SelectPosition":189,"./SelectPosition.ts":189,"./ShowOffset":804,"./ShowOffset.ts":804,"./SwitchVisibility":434,"./SwitchVisibility.ts":434};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=828},50:(e,n,r)=>{r.r(n),r.d(n,{VERSION:()=>i,after:()=>Ne,all:()=>en,allKeys:()=>yt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>Pn,compose:()=>De,constant:()=>Q,contains:()=>rn,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>Wn,defaults:()=>It,defer:()=>Ee,delay:()=>Pe,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>se,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>ze,findWhere:()=>Ge,first:()=>On,flatten:()=>En,foldl:()=>Je,foldr:()=>Ze,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>rn,includes:()=>rn,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Je,intersection:()=>Dn,invert:()=>jt,invoke:()=>on,isArguments:()=>X,isArray:()=>G,isArrayBuffer:()=>V,isBoolean:()=>E,isDataView:()=>q,isDate:()=>D,isElement:()=>A,isEmpty:()=>ct,isEqual:()=>vt,isError:()=>I,isFinite:()=>J,isFunction:()=>z,isMap:()=>Ot,isMatch:()=>ut,isNaN:()=>Z,isNull:()=>k,isNumber:()=>L,isObject:()=>T,isRegExp:()=>N,isSet:()=>kt,isString:()=>M,isSymbol:()=>F,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>Tt,isWeakSet:()=>Pt,iteratee:()=>Jt,keys:()=>lt,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>zn,negate:()=>Le,noop:()=>te,now:()=>oe,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Kt,propertyOf:()=>ee,random:()=>re,range:()=>Vn,reduce:()=>Je,reduceRight:()=>Ze,reject:()=>tn,rest:()=>Tn,restArguments:()=>O,result:()=>ve,sample:()=>fn,select:()=>Qe,shuffle:()=>dn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Be,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>zt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Et,where:()=>sn,without:()=>jn,wrap:()=>Me,zip:()=>In});var o={};r.r(o),r.d(o,{VERSION:()=>i,after:()=>Ne,all:()=>en,allKeys:()=>yt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>Pn,compose:()=>De,constant:()=>Q,contains:()=>rn,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>Bn,defaults:()=>It,defer:()=>Ee,delay:()=>Pe,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>se,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>ze,findWhere:()=>Ge,first:()=>On,flatten:()=>En,foldl:()=>Je,foldr:()=>Ze,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>rn,includes:()=>rn,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Je,intersection:()=>Dn,invert:()=>jt,invoke:()=>on,isArguments:()=>X,isArray:()=>G,isArrayBuffer:()=>V,isBoolean:()=>E,isDataView:()=>q,isDate:()=>D,isElement:()=>A,isEmpty:()=>ct,isEqual:()=>vt,isError:()=>I,isFinite:()=>J,isFunction:()=>z,isMap:()=>Ot,isMatch:()=>ut,isNaN:()=>Z,isNull:()=>k,isNumber:()=>L,isObject:()=>T,isRegExp:()=>N,isSet:()=>kt,isString:()=>M,isSymbol:()=>F,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>Tt,isWeakSet:()=>Pt,iteratee:()=>Jt,keys:()=>lt,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>zn,negate:()=>Le,noop:()=>te,now:()=>oe,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Kt,propertyOf:()=>ee,random:()=>re,range:()=>Vn,reduce:()=>Je,reduceRight:()=>Ze,reject:()=>tn,rest:()=>Tn,restArguments:()=>O,result:()=>ve,sample:()=>fn,select:()=>Qe,shuffle:()=>dn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Be,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>zt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Et,where:()=>sn,without:()=>jn,wrap:()=>Me,zip:()=>In});var i="1.13.4",a="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||Function("return this")()||{},s=Array.prototype,l=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,p=s.slice,f=l.toString,d=l.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,g="undefined"!=typeof DataView,v=Array.isArray,y=Object.keys,m=Object.create,b=h&&ArrayBuffer.isView,w=isNaN,_=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1;function O(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),o=0;o=0&&n<=S}}function et(t){return function(e){return null==e?void 0:e[t]}}const nt=et("byteLength"),rt=tt(nt);var ot=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const it=h?function(t){return b?b(t)&&!q(t):rt(t)&&ot.test(f.call(t))}:Q(!1),at=et("length");function st(t,e){e=function(t){for(var e={},n=t.length,r=0;r":">",'"':""","'":"'","`":"`"},se=ie(ae),le=ie(jt(ae)),ce=pt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ue=/(.)^/,pe={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},fe=/\\|'|\r|\n|\u2028|\u2029/g;function de(t){return"\\"+pe[t]}var he=/^\s*(\w|\$)+\s*$/;function ge(t,e,n){!e&&n&&(e=n),e=It({},e,pt.templateSettings);var r=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,function(e,n,r,a,s){return i+=t.slice(o,s).replace(fe,de),o=s+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e}),i+="';\n";var a,s=e.variable;if(s){if(!he.test(s))throw new Error("variable is not a bare identifier: "+s)}else i="with(obj||{}){\n"+i+"}\n",s="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{a=new Function(s,"_",i)}catch(c){throw c.source=i,c}var l=function(t){return a.call(this,t,pt)};return l.source="function("+s+"){\n"+i+"}",l}function ve(t,e,n){var r=(e=Bt(e)).length;if(!r)return z(n)?n.call(t):n;for(var o=0;o1)Oe(s,e-1,n,r),o=r.length;else for(var l=0,c=s.length;le?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=o=i=null},c}function je(t,e,n){var r,o,i,a,s,l=function(){var c=oe()-o;e>c?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(s,i)),r||(i=s=null))},c=O(function(c){return s=this,i=c,o=oe(),r||(r=setTimeout(l,e),n&&(a=t.apply(s,i))),a});return c.cancel=function(){clearTimeout(r),r=i=s=null},c}function Me(t,e){return xe(e,t)}function Le(t){return function(){return!t.apply(this,arguments)}}function De(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Ne(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Ie(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Fe=xe(Ie,2);function Ve(t,e,n){e=Zt(e,n);for(var r,o=lt(t),i=0,a=o.length;i0?0:o-1;i>=0&&i0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=e(p.call(r,a,s),Z))>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&i=3;return function(e,n,r,o){var i=!Se(e)&<(e),a=(i||e).length,s=t>0?0:a-1;for(o||(r=e[i?i[s]:s],s+=t);s>=0&&s=0}const on=O(function(t,e,n){var r,o;return z(e)?o=e:(e=Bt(e),r=e.slice(0,-1),e=e[e.length-1]),Ye(t,function(t){var i=o;if(!i){if(r&&r.length&&(t=Ut(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)})});function an(t,e){return Ye(t,Kt(e))}function sn(t,e){return Qe(t,Gt(e))}function ln(t,e,n){var r,o,i=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=Se(t)?t:Et(t)).length;si&&(i=r);else e=Zt(e,n),Ke(t,function(t,n,r){((o=e(t,n,r))>a||o===-1/0&&i===-1/0)&&(i=t,a=o)});return i}function cn(t,e,n){var r,o,i=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=Se(t)?t:Et(t)).length;sr||void 0===n)return 1;if(n1&&(r=Yt(r,e[1])),e=yt(t)):(r=_n,e=Oe(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o1&&(n=e[1])):(e=Ye(Oe(e,!1,!1),String),r=function(t,n){return!rn(e,n)}),xn(t,r,n)});function Sn(t,e,n){return p.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function On(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Sn(t,t.length-e)}function Tn(t,e,n){return p.call(t,null==e||n?1:e)}function kn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:Tn(t,Math.max(0,t.length-e))}function Pn(t){return Qe(t,Boolean)}function En(t,e){return Oe(t,e,!1)}const An=O(function(t,e){return e=Oe(e,!0,!0),Qe(t,function(t){return!rn(e,t)})}),jn=O(function(t,e){return An(t,e)});function Mn(t,e,n,r){E(e)||(r=n,n=e,e=!1),null!=n&&(n=Zt(n,r));for(var o=[],i=[],a=0,s=at(t);a{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{r.d(o,{default:()=>Ud});var t=r(50),e=r(163);function n(t){for(var n=[],r=1;r',move:'',plus:'',caret:'',delete:'',copy:'',arrowUp:'',chevron:'',eye:'',eyeOff:''},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:!1,multiFrames:!1,customUI:!1};var a,s=r(316),l=r.n(s),c=r(895),u=r(346),p=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e}(u.Hn);const d=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return p(n,e),n.prototype.getByComponent=function(t){var e=this;return this.filter(function(n){return e.getComponent(n)===t})[0]},n.prototype.addComponent=function(e,n){var r=this,o=((0,t.isArray)(e)?e:[e]).filter(function(t){return!r.hasComponent(t)}).map(function(t){return new f({component:t})})[0];return this.push(o,n)},n.prototype.getComponent=function(t){return t.get("component")},n.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},n.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},n.prototype.allComponents=function(){var t=this;return this.map(function(e){return t.getComponent(e)}).filter(function(t){return t})},n.prototype.removeComponent=function(e,n){var r=this,o=((0,t.isArray)(e)?e:[e]).map(function(t){return r.getByComponent(t)});return this.remove(o,n)},n}(u.FE);var h,g=(h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n",frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:["button","a","input[type=checkbox]","input[type=radio]"]};var _=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(t){function e(e,n,r){var o=t.call(this,n,r)||this;return o._module=e,o}return _(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(u.Hn);var C=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const S=function(e){function n(t,n,r){return e.call(this,n,{module:t,modelConstructor:r})||this}return C(n,e),n.prototype.add=function(n,r){var o,i=this,a=(0,t.isArray)(n)?n:(0,t.isUndefined)(n)?void 0:[n];return a=null!==(o=null==a?void 0:a.map(function(t){return t instanceof i.newModel?t:new i.newModel(i.module,t)}))&&void 0!==o?o:[void 0],e.prototype.add.call(this,(0,t.isArray)(n)?a:a[0],r)},n.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},n}(u.FE);var O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(){return T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0&&this.head.splice(o,1)},r.prototype.addLink=function(t){var e="link";!this.getHeadByAttr("href",t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},r.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},r.prototype.addScript=function(t){var e="script";!this.getHeadByAttr("src",t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},r.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},r.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},r.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger("frame:updated",T({frame:this},t))},r.prototype.toJSON=function(e){void 0===e&&(e={});var n=x.prototype.toJSON.call(this,e),r=(0,t.result)(this,"defaults");return e.fromUndo&&delete n.component,delete n.styles,delete n.changesCount,n[P]&&delete n.width,n[E]&&delete n.height,(0,t.forEach)(n,function(t,e){0===e.indexOf("_")&&delete n[e]}),(0,t.forEach)(r,function(t,e){n[e]===t&&delete n[e]}),(0,t.forEach)(["attributes","head"],function(e){(0,t.isEmpty)(n[e])&&delete n[e]}),n},r}(x);const j=A;var M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const L=function(e){function n(n,r){void 0===r&&(r=[]);var o=e.call(this,n,r,j)||this;return o.loadedItems=0,o.itemsToLoad=0,(0,t.bindAll)(o,"itemLoaded"),o.on("reset",o.onReset),o.on("remove",o.onRemove),o}return M(n,e),n.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map(function(t){return n.onRemove(t)})},n.prototype.onRemove=function(t){null==t||t.onRemove()},n.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(!1))},n.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},n.prototype.listenToLoadItems=function(t){var e=this;this.forEach(function(n){return n[t?"on":"off"]("loaded",e.itemLoaded)})},n}(S);var D=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const N=function(e){function n(t,n){void 0===n&&(n={});var r=e.call(this,t,n)||this,o=n.em,i={};r.em=o,t.frames||(i.component=t.component,i.styles=t.styles,["component","styles"].map(function(t){return r.unset(t)}));var a=t.frames||[i],s=new L(o.Canvas,a);s.page=r,r.set("frames",s),!r.getId()&&r.set("id",null==o?void 0:o.get("PageManager")._createId());var l=null==o?void 0:o.get("UndoManager");return null==l||l.add(s),r}return D(n,e),n.prototype.defaults=function(){return{frames:[],_undo:!0}},n.prototype.onRemove=function(){this.getFrames().reset()},n.prototype.getFrames=function(){return this.get("frames")},n.prototype.getId=function(){return this.id},n.prototype.getName=function(){return this.get("name")},n.prototype.setName=function(t){return this.set({name:t})},n.prototype.getAllFrames=function(){return this.getFrames().models||[]},n.prototype.getMainFrame=function(){return this.getFrames().at(0)},n.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},n.prototype.toJSON=function(e){void 0===e&&(e={});var n=u.Hn.prototype.toJSON.call(this,e),r=(0,t.result)(this,"defaults");return(0,t.forEach)(n,function(t,e){0===e.indexOf("_")&&delete n[e]}),(0,t.forEach)(r,function(t,e){n[e]===t&&delete n[e]}),n},n}(u.Hn);var I=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(){return F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n','
\n
\n \n \n \n
\n
\n
\n
\n \n '],['\n
','
\n
\n \n \n \n
\n
\n
\n
\n \n '])),e,r,e,e,e,e,e,e,e)},e.prototype.events=function(){return{change:"updateDevice","click [data-add-trasp]":"startAdd"}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set("device",e?e.val():"")}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get("id"):"")}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n="";return t.forEach(function(t){var r=t.attributes,o=r.name,i=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(i))||o;n+='")}),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,r=t.$el,o=t.el,i=e&&e.t&&e.t("deviceManager.device");return r.html(this.template({ppfx:n,label:i})),this.devicesEl=r.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get("device")),o.className="".concat(n,"devices-c"),this},e}(u.G7);var lt,ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ut=function(){return ut=Object.assign||function(t){for(var e,n=1,r=arguments.length;n";if(n.stopDefault(),n.inAbsoluteMode()){var c=n.Components.getWrapper(),u=c.append({})[0],p=n.Commands.run("core:component-drag",{event:t,guidesInfo:1,center:1,target:u,onEnd:function(t,n,i){var a;if(!i.cancelled){a=c.append(l)[0];var s=r.getOffset(),p=u.getStyle(),f=p.top,d=p.left,h=p.position,g=(0,Tt.GX)(t.target),v=parseInt("".concat(parseFloat(d)+g.x-s.left),10),y=parseInt("".concat(parseFloat(f)+g.y-s.top),10);a.addStyle({left:v+"px",top:y+"px",position:h})}e.handleDragEnd(a,o),u.remove()}});i=function(e){return p.stop(t,{cancel:e})},a=function(t){return l=t}}else{var f=new s.Sorter(Ft({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:r.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(t){return e.handleDragEnd(t,o)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(l),f.startSort(),this.sorter=f,i=function(t){t&&(f.moved=!1),f.endMove()},a=function(t){return f.setDropContent(t)}}this.dragStop=i,this.dragContent=a,n.trigger("canvas:dragenter",o,l)}},n.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set("dragResult",t),n.trigger("canvas:drop",e,t)),n.runDefault({preserveSelected:1})},n.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger("canvas:dragover",t)},n.prototype.handleDrop=function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,r=this.getContentByData(n).content;t.target.style.border="",r&&e&&e(r),this.endDrop(!r,t)},n.prototype.getContentByData=function(e){var n=this.em,r=e&&e.types,o=e&&e.files||[],i=n.get("dragContent"),a=e&&e.getData("text");if(o.length){a=[];for(var s=0;s=0)a=e&&e.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,t.indexOf)(r,"text/uri-list")>=0)a={type:"link",attributes:{href:a},content:a};else if((0,t.indexOf)(r,"text/json")>=0){var u=e&&e.getData("text/json");u&&(a=JSON.parse(u))}else 1===r.length&&"text/plain"===r[0]&&(a="
".concat(a,"
"));var p={content:a};return n.trigger("canvas:dragdata",e,p),p},n}();const Rt=Vt;var Ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zt=function(){return zt=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&(l+=i-s),!(0,t.isUndefined)(e)&&l!==o&&l>0&&l0){var l=n.shift(),u=(0,Tt.ut)("script",zt({type:"text/javascript"},(0,t.isString)(l)?{src:l}:l));u.onerror=u.onload=c.bind(null,n),null===(o=r.contentDocument)||void 0===o||o.head.appendChild(u)}else e.renderBody(),i&&i.trigger(a,s)};r.onload=function(){var t=e.config.frameContent;if(t){var n=e.getDoc();n.open(),n.write(t),n.close()}i&&i.trigger("".concat(a,":before"),s),c(function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o\n ".concat(f.baseCss||i.frameStyle||"",'\n\n [data-gjs-type="wrapper"] {\n min-height: 100vh;\n padding-top: 0.001em;\n }\n\n .').concat(l,"dashed *[data-gjs-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(l,"selected {\n outline: 2px solid #3b97e3 !important;\n outline-offset: -2px;\n }\n\n .").concat(l,"selected-parent {\n outline: 2px solid ").concat("#ffca6f"," !important\n }\n\n .").concat(l,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(l,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(l,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(l,"plh-image {\n background: #f5f5f5;\n border: none;\n height: 100px;\n width: 100px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .").concat(l,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(l,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(l,"is__grabbing,\n .").concat(l,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(f.canvasCss||"","\n ").concat(f.protectedCss||"","\n "));var d=s.getComponent(),h=a.Components.getType("wrapper").view;this.wrapper=new h({model:d,config:zt(zt({},d.config),{em:a,frameView:this})}).render(),(0,Tt.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,Tt.R3)(u,new It({collection:s.getStyles(),config:zt(zt({},a.Css.getConfig()),{frameView:this})}).render().el),(0,Tt.R3)(u,this.getJsContainer()),(0,e.on)(u,"click",function(t){var e;return t&&"A"==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()}),(0,e.on)(u,"submit",function(t){return t&&t.preventDefault()}),[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"mousedown mousemove mouseup",class:"MouseEvent"},{event:"pointerdown pointermove pointerup",class:"PointerEvent"},{event:"wheel",class:"WheelEvent"}].forEach(function(t){return t.event.split(" ").forEach(function(e){c.addEventListener(e,function(e){return r.el.dispatchEvent((0,Tt.t3)(e,t.class))})})}),this._toggleEffects(!0),(0,e.hasDnd)(a)&&(this.droppable=new Rt(a,null===(n=this.wrapper)||void 0===n?void 0:n.el)),s.trigger("loaded")},r.prototype._toggleEffects=function(t){var n=t?e.on:e.off,r=this.getWindow();r&&n(r,"".concat(Tt.G1," resize"),this._emitUpdate)},r.prototype._emitUpdate=function(){this.model._emitUpdated()},r}(Ot);const Ut=Bt;var Wt=r(668),$t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qt=function(){return qt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ').concat(i.get("name")||"",'\n
\n
\n \n
\n \n
\n
\n
\n ')).append(e.el);var l=(0,Tt.ut)("div",{class:"".concat(r,"tools"),style:"pointer-events:none; display: none"},'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '));this.elTools=l;var c=null==o?void 0:o.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector("[data-frame-top]"),elRight:a.querySelector("[data-frame-right]"),elBottom:a.querySelector("[data-frame-bottom]"),elLeft:a.querySelector("[data-frame-left]"),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(Ot);var Kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,"reset",r.render),r.canvasView=n.canvasView,r._module=n.module,r}return Kt(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach(function(t){return t.remove(e)})},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.renderView=function(t){return new Gt(t,this.canvasView)},e}(Pt);const Xt=Yt;var Jt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=function(){return Zt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ')},r.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},r.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,o=t.em,i=n.frames;o.set("readyCanvas",0),i.once("loaded:all",function(){return o.set("readyCanvas",1)}),null==e||e.remove(),this.frames=new Xt({collection:i},Zt(Zt({},r),{canvasView:this}))},r.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,o=this.em.get("currentFrame");r&&(null===(n=t.views)||void 0===n||n.forEach(function(t){t._getFrame()===o&&t.scrollIntoView(r)}))},r.prototype.remove=function(){for(var t,e=[],n=0;n=0&&a>=0&&i<=o.height&&a<=o.width},r.prototype.offset=function(t,n){void 0===n&&(n={});var r=n.noScroll,o=(0,e.getElRect)(t),i=r?{x:0,y:0}:(0,Tt.GX)(t);return{top:o.top+i.y,left:o.left+i.x,width:o.width,height:o.height}},r.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},r.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,o=r?r.frameElement:n;this.frmOff=this.offset(o||n)}return this.frmOff},r.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},r.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.getZoom(),r=this.getFrameOffset(t),o=this.el,i=this.getCanvasOffset(),a=this.offset(t,e),s=e.avoidFrameOffset?0:r.top,l=e.avoidFrameOffset?0:r.left,c=e.avoidFrameZoom?a.top:a.top*n,u=e.avoidFrameZoom?a.left:a.left*n;return{top:e.avoidFrameOffset?c:c+s-i.top+o.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+o.scrollLeft,height:e.avoidFrameZoom?a.height:a.height*n,width:e.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},r.prototype.getElementOffsets=function(t){var n=this;if(!t||(0,e.isTextNode)(t))return{};var r={},o=window.getComputedStyle(t);return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach(function(t){r[t]=parseFloat(o[t])*n.getZoom()}),r},r.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var r=n.body,o=this.getZoom(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:r.scrollTop)*o-a.top,left:i.left+(s?0:r.scrollLeft)*o-a.left,width:a.width,height:a.height}},r.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,Tt.ut)("div",{"data-id":n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML="";var r=document.createElement("script"),o=e.getScriptString(),i=e.get("script-props")?o:"function(){\n".concat(o,"\n;}"),a=JSON.stringify(e.__getScriptProps());r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(i,".bind(item))(").concat(a,")\n }, 1);"),setTimeout(function(){var e=t.scriptContainer;null==e||e.appendChild(r)},0)},r.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},r.prototype.getFrameView=function(t){return(null==t?void 0:t._getFrame())||this.em.get("currentFrame")},r.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,o=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var a=i.at(0),s=null==a?void 0:a.view;r.setCurrentFrame(s),null==o||o.appendChild(n.el),this.frame=s}},r.prototype.render=function(){var t=this,n=t.el,r=t.$el,o=t.ppfx,i=t.config,a=t.em;r.html(this.template());var s=r.find("[data-frames]");this.framesArea=s.get(0);var l=r.find("[data-tools]");return this.toolsWrapper=l.get(0),l.append('\n
\n
\n
\n
\n
\n
\n ').concat(i.extHl?'
'):"",'\n
\n
\n
\n
\n
\n
\n
\n ')),this.toolsEl=n.querySelector("#".concat(o,"tools")),this.hlEl=n.querySelector(".".concat(o,"highlighter")),this.badgeEl=n.querySelector(".".concat(o,"badge")),this.placerEl=n.querySelector(".".concat(o,"placeholder")),this.ghostEl=n.querySelector(".".concat(o,"ghost")),this.toolbarEl=n.querySelector(".".concat(o,"toolbar")),this.resizerEl=n.querySelector(".".concat(o,"resizer")),this.offsetEl=n.querySelector(".".concat(o,"offset-v")),this.fixedOffsetEl=n.querySelector(".".concat(o,"offset-fixed-v")),this.toolsGlobEl=n.querySelector(".".concat(o,"tools-gl")),this.el.className=(0,e.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},r}(Ot);const te=Qt;var ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ne=function(){return ne=Object.assign||function(t){for(var e,n=1,r=arguments.length;ni.top+i.height?i.top+i.height:d,left:f,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:o.top,canvasLeft:o.left,canvasWidth:o.width,canvasHeight:o.height};return c&&this.em&&this.em.trigger(c,h),h}},r.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var o=function(t,e,o){void 0===e&&(e=1);var i,a=r.em.getZoomDecimal(),s=e?"top":"left",l=t.ownerDocument,c=n.offset?null==(i=l.defaultView)?void 0:i.frameElement:{},u=c.offsetTop,p=void 0===u?0:u,f=c.offsetLeft,d=void 0===f?0:f,h=l.body||{},g=h.scrollTop,v=void 0===g?0:g,y=h.scrollLeft,m=e?v:void 0===y?0:y,b=e?p:d;return o[s]-(m-b)*a};return{top:o(t,1,e),left:o(t,0,e)}},r.prototype.getTargetToElementFixed=function(e,n,r){void 0===r&&(r={});var o=r.pos||this.getElementPos(e,{noScroll:!0}),i=r.canvasOff||this.canvasRectOffset(e,o),a=n.offsetHeight||0,s=n.offsetWidth||0,l=o.left+o.width,c=this.getCanvasView(),u=c.getPosition(),p=c.getFrameOffset(e),f=r.event,d=-a,h=(0,t.isUndefined)(r.left)?o.width-s:r.left;if(h=o.left<-h?-o.left:h,h=l>u.width?h-(l-u.width):h,i.top"!=="".concat(s.outerHTML).slice(-2)||(d.void=!0);var T=d.components;if(!d.type&&T){for(var k=1,P=0,E=0;E".concat(e,""),l=o.parseFromString(s,i);if(a){var c=l.head,u=l.body,p=c.querySelectorAll("script");(0,t.each)(p,function(t){return u.appendChild(t)});var f=[];(0,t.each)(c.children,function(t){return f.push(t)}),(0,t.each)(f,function(t,e){return u.insertBefore(t,u.children[e])}),r=u}else r=l.firstChild;return r}(r,u),f=p.querySelectorAll("script"),d=f.length;if(!((0,t.isUndefined)(s.allowScripts)?u.allowScripts:s.allowScripts))for(;d--;)f[d].parentNode.removeChild(f[d]);if(u.allowUnsafeAttr||this.__clearUnsafeAttr(p),o){for(var h=p.querySelectorAll("style"),g=h.length,v="";g--;)v=h[g].innerHTML+v,h[g].parentNode.removeChild(h[g]);v&&(l.css=o.parse(v))}e&&e.trigger("".concat(ce,":root"),{input:r,root:p});var y=this.parseNode(p,c),m=1!==y.length||c.returnArray?y:y[0];return l.html=m,e&&e.trigger(ce,{input:r,output:l}),l},__clearUnsafeAttr:function(e){var n=this,r=e.attributes||[],o=e.childNodes||[],i=[];(0,t.each)(r,function(t){var e=t.nodeName||"";0===e.indexOf("on")&&i.push(e)}),i.map(function(t){return e.removeAttribute(t)}),(0,t.each)(o,function(t){return n.__clearUnsafeAttr(t)})}}};var pe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0:i,s="".concat(r[o]).concat(a?" !important":""),l="__"==o.substr(0,2);s&&!l&&n.push("".concat(o,":").concat(s,";"))}return n.join("")},r.prototype.getSelectors=function(){return this.get("selectors")||this.get("classes")},r.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},r}(u.Hn);var ge=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=function(){return ve=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&d.reset(f,r)}else p.components=f}return p})},_e=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ge(n,e),n.prototype.initialize=function(t,e){void 0===e&&(e={}),this.opt=e,this.listenTo(this,"add",this.onAdd),this.listenTo(this,"remove",this.removeChildren),this.listenTo(this,"reset",this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||(null==n?void 0:n.Components)},n.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var r=this,o=e.previousModels||[],i=o.filter(function(e){return!t.get(e.cid)}),a=be(t),s=be(o).filter(function(t){return a.indexOf(t)>=0});e.keepIds=(e.keepIds||[]).concat(s),i.forEach(function(t){return n.removeChildren(t,r,e)}),t.each(function(t){return n.onAdd(t)})},n.prototype.resetFromString=function(t,e){var n,r;void 0===t&&(t=""),void 0===e&&(e={}),e.keepIds=be(this);var o=this,i=o.domc,a=o.em,s=o.parent,l=null==a?void 0:a.Css,c=(null==i?void 0:i.allById())||{},u=this.parseString(t,e),p=we(u,c,e),f=e.visitedCmps,d=void 0===f?{}:f;Object.keys(d).forEach(function(t){var e=d[t];if(e.length){var n=(null==l?void 0:l.getRules("#".concat(t)))||[];n.length&&e.forEach(function(t){n.forEach(function(e){var n=e.clone();n.set("selectors",["#".concat(t.attributes.id)]),l.getAll().add(n)})})}}),this.reset(p,e),null==a||a.trigger("component:content",s,e,t),null===(r=(n=s).__checkInnerChilds)||void 0===r||r.call(n)},n.prototype.removeChildren=function(t,e,n){var r=this;if(void 0===n&&(n={}),t){var o=this.domc,i=this.em,a=n.temporary||n.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(s)<0;delete(o?o.allById():{})[s];var p=u?c.remove(c.filter(function(t){return t.getSelectors().getFullString()==="#".concat(s)}),n):[];l.remove(p.map(function(t){return t.getSelectors().at(0)})),t.opt.temporary||(i.Commands.run("core:component-style-clear",{target:t}),t.removed(),t.trigger("removed"),i.trigger("component:remove",t)),t.components().forEach(function(t){return r.removeChildren(t,e,n)})}var f=t.components();i.stopListening(f),i.stopListening(t),i.stopListening(t.get("classes")),t.__postRemove()}},n.prototype.model=function(t,e){var n,r=e.collection.opt,o=r.em,i=o.Components.componentTypes;e.em=o,e.config=r.config,e.componentTypes=i,e.domc=r.domc;for(var a=0;a=0&&this.set("void",!0),n.em=i,this.opt=n,this.em=i,this.frame=n.frame,this.config=n.config||{},this.set("attributes",Fe(Fe({},(0,t.result)(this,"defaults").attributes||{}),this.get("attributes")||{})),this.ccid=r.createId(this,n),this.initClasses(),this.initComponents(),this.initTraits(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,"change:script",this.scriptUpdated),this.listenTo(this,"change:tagName",this.tagUpdated),this.listenTo(this,"change:attributes",this.attrUpdated),this.listenTo(this,"change:attributes:id",this._idUpdated),this.on("change:toolbar",this.__emitUpdateTlb),this.on("change",this.__onChange),this.on($e,this.__propToParent),this.set("status",""),this.views=[],["classes","traits","components"].forEach(function(t){var e="add remove ".concat("components"!==t?"change":"");o.listenTo(o.get(t),e.trim(),function(){for(var e=[],n=0;n=0})},r.prototype.__getSymbToUp=function(t){var e=this;void 0===t&&(t={});var n=[],r=t.changed;if(t.fromInstance||t.noPropagate||t.fromUndo||r&&this.__isSymbOvrd(r))return n;var o=this.__getSymbols()||[],i=this.__getSymbol();return(i?Ve([i],i.__getSymbols()||[],!0):o).filter(function(t){return t!==e}).filter(function(t){return!(r&&t.__isSymbOvrd(r))})},r.prototype.__getSymbTop=function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e},r.prototype.__upSymbProps=function(n,r){var o=this;void 0===r&&(r={});var i=this.changedAttributes()||{},a=i.attributes||{};if(delete i.status,delete i.open,delete i[ze],delete i[Be],delete i[Ue],delete i.attributes,delete a.id,(0,e.isEmptyObj)(a)||(i.attributes=a),!(0,e.isEmptyObj)(i)){var s=this.__getSymbToUp(r);(0,t.keys)(i).map(function(t){o.__isSymbOvrd(t)&&delete i[t]}),this.__logSymbol("props",s,{opts:r,changed:i}),s.forEach(function(e){var n=Fe({},i);(0,t.keys)(n).map(function(t){e.__isSymbOvrd(t)&&delete n[t]}),e.set(n,Fe({fromInstance:o},r))})}},r.prototype.__upSymbCls=function(t,e,n){var r=this;void 0===n&&(n={});var o=this.__getSymbToUp(n);this.__logSymbol("classes",o,{opts:n}),o.forEach(function(t){t.set("classes",r.get("classes"),{fromInstance:r})}),this.__changesUp(n)},r.prototype.__upSymbComps=function(t,e,n){var r=this,o=n||e||{},i={fromInstance:o.fromInstance,fromUndo:o.fromUndo},a=t.opt.temporary;if(n)if(n.add){var s=[],l=!!this.__getSymbols();if((y=this.__getSymbToUp(Fe(Fe({},i),{changed:"components:add"}))).length){var c=t.__getSymbol();s=(c?c.__getSymbols():t.__getSymbols())||[],(s=Ve([],s,!0)).push(c||t)}!a&&this.__logSymbol("add",y,{opts:n,addedInstances:s.map(function(t){return t.cid}),added:t.cid}),y.forEach(function(e){var o=e.__getSymbTop(),i=s.filter(function(t){var e=t.__getSymbTop({prev:1});return o&&e&&e===o})[0]||t.clone({symbol:!0,symbolInv:l});e.append(i,Fe({fromInstance:r},n))})}else{var u=t.__getSymbol();if(u&&!n.temporary&&u.set(ze,u.__getSymbols().filter(function(e){return e!==t})),!t.__isSymbolTop()){var p="components:remove",f=n.index,d=t.parent(),h=Fe({fromInstance:t},n),g=t.__isSymbolNested(),v=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(h)};y=(null==d?void 0:d.__isSymbOvrd(p))?[]:t.__getSymbToUp(i),g&&(y=null==d?void 0:d.__getSymbToUp(Fe(Fe({},i),{changed:p})),v=function(t){var e=t.components().at(f);e&&e.remove(Fe({fromInstance:d},h))}),!a&&this.__logSymbol("remove",y,{opts:n,removed:t.cid,isSymbNested:g}),y.forEach(v)}}else{var y=this.__getSymbToUp(Fe(Fe({},i),{changed:"components:reset"})),m=t.models;this.__logSymbol("reset",y,{components:m}),y.forEach(function(t){var n=m.map(function(t){return t.clone({symbol:!0})});t.components().reset(n,Fe({fromInstance:r},e))})}this.__changesUp(o)},r.prototype.initClasses=function(e,n,r){void 0===r&&(r={});var o=this.get("attributes").class||[],i=[this,"change:classes",this.initClasses],a=this.get("classes")||o,s=(0,t.isString)(a)?a.split(" "):a;this.stopListening.apply(this,i);var l=this.normalizeClasses(s),c=new Ee([]);return this.set("classes",c,r),c.add(l),c.on("add remove reset",this.__upSymbCls),this.listenTo.apply(this,i),this},r.prototype.initComponents=function(){var e=[this,"change:components",this.initComponents];this.stopListening.apply(this,e);var n=new xe([],this.opt);n.parent=this;var r=this.get("components"),o=!this.opt.avoidChildren;return this.set("components",n),o&&r&&n.add((0,t.isFunction)(r)?r(this):r,this.opt),n.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,e),this},r.prototype.initTraits=function(t){var e=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var r=Fe({},this.get("attributes")),o=this.traits;return o.each(function(t){if(!t.get("changeProp")){var e=t.get("name"),n=t.getInitValue();e&&n&&(r[e]=n)}}),o.length&&this.set("attributes",r),this.on(n,this.initTraits),t&&e&&e.trigger("component:toggled"),this},r.prototype.initScriptProps=function(){if(!this.opt.temporary){var t="script-props",e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],o=n.map(function(t){return"change:".concat(t)}).join(" "),i=r.map(function(t){return"change:".concat(t)}).join(" ");o&&this.off(o,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},r.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger("rerender")},r.prototype.append=function(e,n){void 0===n&&(n={});var r=((0,t.isArray)(e)?Ve([],e,!0):[e]).map(function(e){return(0,t.isString)(e)||e.collection&&e.collection.remove(e,{temporary:!0}),e}),o=this.components().add(r,n);return(0,t.isArray)(o)?o:[o]},r.prototype.components=function(e,n){void 0===n&&(n={});var r=this.get("components");return(0,t.isUndefined)(e)?r:(r.reset(void 0,n),e?this.append(e,n):[])},r.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},r.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},r.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},r.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},r.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},r.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},r.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||"";if(!e.get("toolbar")&&t){var r=[];e.collection&&r.push({label:t.getIcon("arrowUp"),command:function(t){return t.runCommand("core:component-exit",{force:1})}}),e.get("draggable")&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon("move"),command:"tlb-move"}),e.get("copyable")&&r.push({label:t.getIcon("copy"),command:"tlb-clone"}),e.get("removable")&&r.push({label:t.getIcon("delete"),command:"tlb-delete"}),e.set("toolbar",r)}},r.prototype.__loadTraits=function(e,n){void 0===n&&(n={});var r=e||this.traits;if(!(r instanceof Ne)){r=(0,t.isFunction)(r)?r(this):r;var o=new Ne([],this.opt);o.setTarget(this),r.length&&(r.forEach(function(t){return t.attributes&&delete t.attributes.value}),o.add(r)),this.set({traits:o},n)}return this},r.prototype.getTraits=function(){return this.__loadTraits(),Ve([],this.traits.models,!0)},r.prototype.setTraits=function(e){var n=(0,t.isArray)(e)?e:[e];return this.set({traits:n}),this.getTraits()},r.prototype.getTrait=function(t){return this.getTraits().filter(function(e){return e.get("id")===t||e.get("name")===t})[0]||null},r.prototype.updateTrait=function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger("component:toggled"),this},r.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},r.prototype.removeTrait=function(e){var n,r=this,o=((0,t.isArray)(e)?e:[e]).map(function(t){return r.getTrait(t)}),i=this.traits,a=o.length?i.remove(o):[];return null===(n=this.em)||void 0===n||n.trigger("component:toggled"),(0,t.isArray)(a)?a:[a]},r.prototype.addTrait=function(e,n){var r;void 0===n&&(n={}),this.__loadTraits();var o=this.traits.add(e,n);return null===(r=this.em)||void 0===r||r.trigger("component:toggled"),(0,t.isArray)(o)?o:[o]},r.prototype.normalizeClasses=function(t){var e=[],n=this.em,r=null==n?void 0:n.Selectors;return r?t.models?Ve([],t.models,!0):(t.forEach(function(t){return e.push(r.add(t))}),e):[]},r.prototype.clone=function(t){void 0===t&&(t={});var e=this.em,n=Fe({},this.attributes),r=Fe({},this.opt),o=this.getId(),i=null==e?void 0:e.Css;n.attributes=Fe({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=!0),this.get("components").each(function(e,r){n.components[r]=e.clone(Fe(Fe({},t),{_inner:1}))}),this.get("traits").each(function(t,e){n.traits[e]=t.clone()}),this.get("classes").each(function(t,e){n.classes[e]=t.get("name")}),n.status="",r.collection=null;var a=new this.constructor(n,r),s="#".concat(a.getId());(i?i.getRules("#".concat(o)):[]).forEach(function(t){var e=t.clone();e.set("selectors",[s]),i.getAll().add(e)}),a.set(ze,0);var l=this.__getSymbol(),c=this.__getSymbols();t.symbol||!l&&!c?l?(l.set(ze,Ve(Ve([],l.__getSymbols(),!0),[a],!1)),a.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(ze,Ve(Ve([],c,!0),[a],!1)),a.set(Be,this),a.__initSymb()):t.symbolInv?(this.set(ze,[a]),a.set(Be,this),[this,a].map(function(t){return t.__initSymb()})):(a.set(ze,[this]),[this,a].map(function(t){return t.__initSymb()}),this.set(Be,a))):(a.set(Be,0),a.set(ze,0));var u="component:clone";return e&&e.trigger(u,a),this.trigger(u,a),a},r.prototype.getName=function(t){void 0===t&&(t={});var n=this.em,r=this.attributes,o=r.type,i=r.tagName,a=r.name,s=o||i,l=o?"":i,c="domComponents.names.",u=a&&(null==n?void 0:n.t("".concat(c).concat(a))),p=l&&(null==n?void 0:n.t("".concat(c).concat(l))),f=n&&(n.t("".concat(c).concat(o))||n.t("".concat(c).concat(i))),d=this.get("custom-name");return(t.noCustom?"":d)||u||a||p||(0,e.capitalize)(l)||f||(0,e.capitalize)(s)},r.prototype.getIcon=function(){var t=this.get("icon");return t?t+" ":""},r.prototype.toHTML=function(n){void 0===n&&(n={});var r=this,o=[],i=n.tag||r.get("tagName"),a=r.get("void"),s=n.attributes,l=this.getAttrToHTML();if(delete n.tag,s&&((0,t.isFunction)(s)?l=s(r,l)||{}:(0,e.isObject)(s)&&(l=s)),n.withProps){var c=this.toJSON();(0,t.forEach)(c,function(n,r){"_"!==r[0]&&["classes","attributes","components"].indexOf(r)<0&&(l["data-gjs-".concat(r)]=(0,t.isArray)(n)||(0,e.isObject)(n)?JSON.stringify(n):n)})}for(var u in l){var p=l[u];if(!(0,t.isUndefined)(p)&&null!==p)if((0,t.isBoolean)(p))p&&o.push(u);else{var f="";if(n.altQuoteAttr&&(0,t.isString)(p)&&p.indexOf('"')>=0)f="'".concat(p.replace(/'/g,"'"),"'");else{var d=(0,t.isString)(p)?p.replace(/"/g,"""):p;f='"'.concat(d,'"')}o.push("".concat(u,"=").concat(f))}}var h=o.length?" ".concat(o.join(" ")):"",g=r.getInnerHTML(n),v="<".concat(i).concat(h).concat(a?"/":"",">").concat(g);return!a&&(v+="")),v},r.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},r.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map(function(e){return e.toHTML(t)}).join(""):this.get("content")},r.prototype.getAttrToHTML=function(){var t=this.getAttributes();return delete t.style,t},r.prototype.toJSON=function(e){void 0===e&&(e={});var n=s.Model.prototype.toJSON.call(this,e);if(n.attributes=this.getAttributes(),delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,!e.fromUndo){var r=n[Be],o=n[ze];o&&(0,t.isArray)(o)&&(n[ze]=o.filter(function(t){return t}).map(function(t){return t.getId?t.getId():t})),r&&!(0,t.isString)(r)&&(n[Be]=r.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},r.prototype.getChangedProps=function(e){var n=e||s.Model.prototype.toJSON.apply(this),r=(0,t.result)(this,"defaults");return(0,t.forEach)(r,function(t,e){-1===["type"].indexOf(e)&&n[e]===t&&delete n[e]}),(0,t.isEmpty)(n.type)&&delete n.type,(0,t.forEach)(["attributes","style"],function(e){(0,t.isEmpty)(r[e])&&(0,t.isEmpty)(n[e])&&delete n[e]}),(0,t.forEach)(["classes","components"],function(e){(!n[e]||(0,t.isEmpty)(r[e])&&!n[e].length)&&delete n[e]}),n},r.prototype.getId=function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},r.prototype.setId=function(t,e){var n=Fe({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},r.prototype.getEl=function(t){void 0===t&&(t=void 0);var e=this.getView(t);return e&&e.el},r.prototype.getView=function(t){var e=this.view,n=this.views;return t&&(e=n.filter(function(e){return e._getFrame()===t.view})[0]),e},r.prototype.getCurrentView=function(){var t=(this.em.get("currentFrame")||{}).model;return this.getView(t)},r.prototype.__getScriptProps=function(){var t=this.props();return(this.get("script-props")||[]).reduce(function(e,n){return e[n]=t[n],e},{})},r.prototype.getScriptString=function(e){var n=this,r=e||this.get("script")||"";if(!r)return r;if(this.get("script-props"))r=r.toString().trim();else{if("function"==typeof r){var o=r.toString().trim();r=(o=o.replace(/^function[\s\w]*\(\)\s?\{/,"").replace(/\}$/,"")).trim()}var i=this.em.getConfig(),a=Re(i.tagVarStart||"{[ "),s=Re(i.tagVarEnd||" ]}"),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),"g");r=r.replace(l,function(e,r){n.scriptUpdated();var o=n.attributes[r]||"";return(0,t.isArray)(o)||"object"==typeof o?JSON.stringify(o):o})}return r},r.prototype.emitUpdate=function(t){for(var e,n=[],r=1;r=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=a,e),options:n[2]||n[1]||{}})},r.prototype.onAll=function(e){return(0,t.isFunction)(e)&&(e(this),this.components().forEach(function(t){return t.onAll(e)})),this},r.prototype.forEachChild=function(e){(0,t.isFunction)(e)&&this.components().forEach(function(t){e(t),t.forEachChild(e)})},r.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,r=this.collection,o=function(){r&&r.remove(e,Fe(Fe({},t),{action:"remove-component"})),r||(e.components("",t),e.components().removeChildren(e,void 0,t))},i=Fe({},t);return[this,n].map(function(t){return t.trigger("component:remove:before",e,o,i)}),!i.abort&&o(),this},r.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,r=this.index(),o=t===this.parent();o&&(r===n||r===n-1)||(o&&n&&n>r&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this},r.prototype.isInstanceOf=function(t){var e,n,r=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;return!!r&&this instanceof r},r.prototype.isChildOf=function(e){for(var n=(0,t.isString)(e),r=this.parent();r;){if(n){if(r.isInstanceOf(e))return!0}else if(r===e)return!0;r=r.parent()}return!1},r.prototype.resetId=function(){var t=this.em,e=this.getId();if(!e)return this;var n=r.createId(this);this.setId(n);var o=null==t?void 0:t.Css.getIdRule(e),i=null==o?void 0:o.get("selectors").at(0);return null==i||i.set("name",n),this},r.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,r=e||this.getId();return null==n?void 0:n.Css.getIdRule(r)},r.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get("selectors").at(0)},r.prototype._idUpdated=function(t,e,n){if(void 0===n&&(n={}),!n.idUpdate){var o=this.ccid,i=(this.get("attributes")||{}).id,a=(this.previous("attributes")||{}).id||o,s=r.getList(this);if(s[i]||!i&&a)return this.setId(a,{idUpdate:!0});delete s[a],s[i]=this,this.ccid=i;var l=this._getStyleSelector({id:a});l&&l.set({name:i,label:i})}},r.getDefaults=function(){return(0,t.result)(this.prototype,"defaults")},r.isComponent=function(t){return{tagName:(0,e.toLowerCase)(t.tagName)}},r.ensureInList=function(t){var e=r.getList(t),n=t.getId(),o=e[n];if(o){if(o!==t){var i=r.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach(function(t){return r.ensureInList(t)})},r.createId=function(t,e){void 0===e&&(e={});var n,o=r.getList(t),i=e.idMap,a=void 0===i?{}:i,s=t.get("attributes").id;return s?(n=r.getIncrementId(s,o,e),t.setId(n),s!==n&&(a[s]=n)):n=r.getNewId(o),o[n]=t,n},r.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),o="i".concat(n);t[o];)o=r.getNewId(t);return o},r.getIncrementId=function(t,e,n){void 0===n&&(n={});var r=n.keepIds,o=1,i=t;if((void 0===r?[]:r).indexOf(t)<0)for(;e[i];)o++,i="".concat(t,"-").concat(o);return i},r.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,o=n.em,i=r||(null==o?void 0:o.Components);return i?i.componentsById:{}},r.checkId=function(e,n,o,i){void 0===n&&(n=[]),void 0===o&&(o={}),void 0===i&&(i={});var a=(0,t.isArray)(e)?e:[e],s=i.keepIds,l=void 0===s?[]:s;a.forEach(function(e){e.attributes;var a=e.attributes,s=void 0===a?{}:a,c=e.components,u=s.id;if(u&&o[u]&&l.indexOf(u)<0){var p=r.getIncrementId(u,o);s.id=p,(0,t.isArray)(n)&&n.forEach(function(t){var e=t.selectors;e.forEach(function(t,n){t==="#".concat(u)&&(e[n]="#".concat(p))})})}c&&r.checkId(c,n,o,i)})},r}(he);const Ge=qe;var Ke=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ye=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.compView=tn,t}return Ke(n,e),n.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},n.prototype.removeChildren=function(t,e,n){var r=this;void 0===n&&(n={}),t.views.forEach(function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,Tt.L_)(n),t.remove.apply(t)}}),t.components().forEach(function(t){return r.removeChildren(t,e,n)})},n.prototype.addTo=function(t,e,n){void 0===n&&(n={});var r=this.em,o=this.collection.indexOf(t);if(this.addToCollection(t,null,o),r&&!n.temporary){var i=function(t){r.trigger("component:add",t),t.components().forEach(function(t){return i(t)})};i(t)}},n.prototype.addToCollection=function(e,n,r){for(var o=this,i=o.config,a=o.opts,s=o.em,l=n||null,c=i.frameView,u=(null==c?void 0:c.model)&&e.getView(c.model),p=a.componentTypes||(null==s?void 0:s.Components.getTypes()),f=e.get("type")||"default",d=this.compView,g=0;g=c.scrollTop&&l>=c.scrollLeft&&s<=c.scrollBottom&&l<=(null==i?void 0:i.offsetWidth)+o.scrollLeft},r.prototype.scrollIntoView=function(t){var e;void 0===t&&(t={});var n=this.getOffsetRect();if(!this.isInViewport({rect:n})||t.force){var r=this.el;"smooth"!==t.behavior?null===(e=r.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,n.top):r.scrollIntoView(Ze({behavior:"smooth",block:"nearest"},t))}},r.prototype.reset=function(){var t=this.el;this.el="",this._ensureElement(),this._setData(),(0,Tt.dL)(t,this.el),this.render()},r.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},r.prototype._getFrame=function(){var t;return null===(t=this.em)||void 0===t?void 0:t.get("Canvas").config.frameView},r.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new Xe({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,o=n.length;r=0},n}(Ge);var sn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ln=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sn(e,t),e}(tn);var cn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),un=function(){return un=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n '),fallback:"\n \n '),file:""})},enumerable:!1,configurable:!0}),r.prototype.initialize=function(r,o){n.prototype.initialize.call(this,r,o);var i=this.get("attributes").src;i&&(0,e.buildBase64UrlFromSvg)((0,t.result)(this,"defaults").src)!==i&&this.set("src",i,{silent:!0})},r.prototype.initToolbar=function(){n.prototype.initToolbar.call(this);var t=this.em;if(t){var e="image-editor";if(t.Commands.has(e)){for(var r=!1,o=this.get("toolbar"),i=0;i=0)&&delete o.editable})}return o},r}(Qn);const or=rr;var ir=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ar=function(){return ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]-1;return go(go({},i),!u||p?{reason:2}:{result:!0})},n.prototype.allById=function(){return this.componentsById},n.prototype.getById=function(t){return this.componentsById[t]||null},n.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach(function(t){return e[t]&&e[t].remove()}),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach(function(){return{}})},n}(b);const yo=vo,mo={stylePrefix:"css-",rules:[]};var bo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wo=Number.MAX_VALUE,_o=function(n){function r(){var e=n.call(this)||this;return(0,t.bindAll)(e,"sortRules"),e.compCls=[],e.ids=[],e}return bo(r,n),r.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var r="",o=this.em,i=o&&o.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.classes;return this.ids.push("#".concat(t.getId())),s.forEach(function(t){return n.compCls.push(t.getFullName())}),!i&&a&&(r="#".concat(t.getId(),"{").concat(a,"}")),t.components().forEach(function(t){return r+=n.buildFromModel(t,e)}),r},r.prototype.build=function(n,r){var o=this;void 0===r&&(r={});var i=r.json,a=r.em,s=r.cssc||(null==a?void 0:a.Css);this.em=a,this.compCls=[],this.ids=[],this.model=n;var l=[],c=n?this.buildFromModel(n,r):"",u=(0,t.isUndefined)(r.clearStyles)&&a?a.getConfig().clearStyles:r.clearStyles;if(s){var p=r.rules||s.getAll(),f={},d=[];r.onlyMatched&&n&&(0,e.hasWin)()&&(p=this.matchedRules(n,p)),p.forEach(function(t){var e=t.getAtRule();if(e){var n=f[e];n?n.push(t):f[e]=[t]}else{var a=o.buildFromRule(t,d,r);i?l.push(a):c+=a}}),this.sortMediaObject(f).forEach(function(t){var e="",n=t.key;t.value.forEach(function(t){var a=o.buildFromRule(t,d,r);t.get("singleAtRule")?c+="".concat(n,"{").concat(a,"}"):e+=a,i&&l.push(a)}),e&&(c+="".concat(n,"{").concat(e,"}"))}),a&&u&&p.remove&&p.remove(d)}return i?l.filter(function(t){return t}):c},r.prototype.buildFromRule=function(t,e,n){var r,o=this;void 0===n&&(n={});var i,a="",s=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get("selectorsAdd"),u=t.get("singleAtRule");if(null===(r=t.get("selectors"))||void 0===r||r.forEach(function(t){var e=t.getFullName();(o.compCls.indexOf(e)>=0||o.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)}),l&&i||c||u||!s){var p=t.getDeclaration({body:1});p&&(n.json?a=t:a+=p)}else e.push(t);return a},r.prototype.matchedRules=function(t,e){var n=this,r=t.getEl(),o=[];return e.forEach(function(t){try{t.selectorsToString().split(",").some(function(t){return null==r?void 0:r.matches(n.__cleanSelector(t))})&&o.push(t)}catch(e){}}),t.components().forEach(function(t){o=o.concat(n.matchedRules(t,e))}),o=o.filter(function(t,e){return o.indexOf(t)===e})},r.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):wo},r.prototype.sortMediaObject=function(e){var n=this;void 0===e&&(e={});var r=[];return(0,t.each)(e,function(t,e){return r.push({key:e,value:t})}),r.sort(function(t,e){var r=[t.key,e.key].every(function(t){return-1!==t.indexOf("min-width")}),o=r?t.key:e.key,i=r?e.key:t.key;return n.getQueryLength(o)-n.getQueryLength(i)})},r.prototype.sortRules=function(t,e){var n=function(t){return t.get("mediaText")||""},r=[n(t),n(e)].every(function(t){return-1!==t.indexOf("min-width")}),o=n(r?t:e),i=n(r?e:t);return this.getQueryLength(o)-this.getQueryLength(i)},r.prototype.__cleanSelector=function(t){return t.split(" ").map(function(t){return t.split(":")[0]}).join(" ")},r}(u.Hn);const xo=_o;var Co=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),So=function(){return So=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0})},r.prototype.setIdRule=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=r.addOpts,i=void 0===o?{}:o,a=r.mediaText,s=r.state||"",l=(0,t.isUndefined)(a)?this.em.getCurrentMedia():a,c=this.em.Selectors.add({name:e,type:Oe.TYPE_ID},i),u=this.add(c,s,l,{},i);return u.setStyle(n,Mo(Mo({},r),i)),u},r.prototype.getIdRule=function(e,n){void 0===n&&(n={});var r=n.mediaText,o=n.state||"",i=(0,t.isUndefined)(r)?this.em.getCurrentMedia():r,a=this.em.Selectors.get(e,Oe.TYPE_ID);return a&&this.get(a,o,i)},r.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.state||"",o=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:Oe.TYPE_CLASS}),a=this.add(i,r,o);return a.setStyle(e,n),a},r.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||"",r=e.mediaText||this.em.getCurrentMedia(),o=this.em.Selectors.get(t,Oe.TYPE_CLASS);return o&&this.get(o,n,r)},r.prototype.remove=function(e,n){var r=(0,t.isString)(e)?this.getRules(e):e,o=this.getAll().remove(r,n);return(0,t.isArray)(o)?o:[o]},r.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},r.prototype.getComponentRules=function(e,n){void 0===n&&(n={});var r=n.state,o=n.mediaText;n.current&&(r=this.em.get("state")||"",o=this.em.getCurrentMedia());var i=e.getId();return this.getAll().filter(function(e){return!(!(0,t.isUndefined)(r)&&e.get("state")!==r||!(0,t.isUndefined)(o)&&e.get("mediaText")!==o||e.getSelectorsString()!=="#".concat(i))})},r.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new It({collection:this.rules,config:this.config}),this.rulesView.render().el},r.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},r}(b);const Do=Lo,No={appendTo:"",blocks:[],appendOnClick:!1,custom:!1};var Io=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Fo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Io(n,e),n.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},n.prototype.getId=function(){return this.id},n.prototype.getLabel=function(){return this.get("label")},n.prototype.getMedia=function(){return this.get("media")},n.prototype.getContent=function(){return this.get("content")},n.prototype.getCategoryLabel=function(){var e=this.get("category");return(0,t.isFunction)(null==e?void 0:e.get)?e.get("label"):(null==e?void 0:e.label)?null==e?void 0:e.label:e},n}(u.Hn);var Vo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ro=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vo(e,t),e}(u.FE);const Ho=Ro;Ro.prototype.model=Fo;var zo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Bo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zo(e,t),e.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},e}(u.Hn);var Uo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Uo(e,t),e}(u.FE);const $o=Wo;Wo.prototype.model=Bo;var qo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Go=function(n){function r(t,e){void 0===e&&(e={});var r=n.call(this,t)||this,o=r.model;return r.em=e.em,r.config=e,r.endDrag=r.endDrag.bind(r),r.ppfx=e.pStylePrefix||"",r.listenTo(o,"destroy remove",r.remove),r.listenTo(o,"change",r.render),r}return qo(r,n),r.prototype.events=function(){return{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"}},r.prototype.__getModule=function(){return this.em.Blocks},r.prototype.handleClick=function(e){var n=this,r=n.config,o=n.model,i=n.em,a=o.get("onClick")||r.appendOnClick;if(i.trigger("block:click",o,e),a){if((0,t.isFunction)(a))return a(o,null==i?void 0:i.getEditor(),{event:e});var s,l,c=r.getSorter(),u=o.get("content"),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)s=p;else{var f=p.parent();f&&c.validTarget(f.getEl(),u).valid&&(s=f,l=f.components().indexOf(p)+1)}if(!s){var d=i.getWrapper();c.validTarget(d.getEl(),u).valid&&(s=d)}var h=s&&s.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},r.prototype.startDrag=function(t){var n=this,r=n.config,o=n.em,i=n.model,a=i.get("disable");if(0===t.button&&r.getSorter&&!this.el.draggable&&!a){o.refreshCanvas();var s=r.getSorter();s.__currentBlock=i,s.setDragHelper(this.el,t),s.setDropContent(this.model.get("content")),s.startSort(this.el),(0,e.on)(document,"mouseup",this.endDrag)}},r.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},r.prototype.handleDrag=function(t){this.__getModule().__drag(t)},r.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},r.prototype.endDrag=function(){(0,e.off)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},r.prototype.render=function(){var t,n=this,r=n.em,o=n.el,i=n.$el,a=n.ppfx,s=n.model,l=s.get("disable"),c=s.get("attributes")||{},u=c.class||"",p="".concat(a,"block"),f=r&&r.t("blockManager.labels.".concat(s.id))||s.get("label"),d=s.get("render"),h=s.get("media"),g=l?"".concat(p,"--disable"):"".concat(a,"four-color-h");i.attr(c),o.className="".concat(u," ").concat(p," ").concat(a,"one-bg ").concat(g).trim(),o.innerHTML="\n ".concat(h?'
').concat(h,"
"):"",'\n
').concat(f,"
\n "),o.title=c.title||(null===(t=o.textContent)||void 0===t?void 0:t.trim()),o.setAttribute("draggable","".concat(!(!(0,e.hasDnd)(r)||l)));var v=d&&d({el:o,model:s,className:p,prefix:a});return v&&(o.innerHTML=v),this},r}(u.G7);const Ko=Go;var Yo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xo=function(t){function e(e,n){var r=t.call(this,e)||this;r.config=n;var o=n.pStylePrefix||"";return r.em=n.em,r.pfx=o,r.caretR="fa fa-caret-right",r.caretD="fa fa-caret-down",r.iconClass="".concat(o,"caret-icon"),r.activeClass="".concat(o,"open"),r.className="".concat(o,"block-category"),r.listenTo(r.model,"change:open",r.updateVisibility),r.model.view=r,r}return Yo(e,t),e.prototype.events=function(){return{"click [data-title]":"toggle"}},e.prototype.template=function(t){var e=t.pfx,r=t.label;return n(Zo||(Zo=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}(['\n
\n \n ','\n
\n
\n '],['\n
\n \n ','\n
\n
\n '])),e,e,r,e)},e.prototype.attributes=function(){return this.model.get("attributes")||{}},e.prototype.updateVisibility=function(){this.model.get("open")?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=""},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display="none"},e.prototype.toggle=function(){var t=this.model;t.set("open",!t.get("open"))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.pfx,"blocks-c"))),this.blocksEl},e.prototype.append=function(t){this.getBlocksEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,r=t.$el,o=t.model,i=t.pfx,a=e.t("blockManager.categories.".concat(o.id))||o.get("label");return n.innerHTML=this.template({pfx:i,label:a}),r.addClass(this.className),r.css({order:o.get("order")}),this.updateVisibility(),this},e}(u.G7);const Jo=Xo;var Zo,Qo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ti=function(){return ti=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n
\n
\n '),this.collection.each(function(e){return t.add(e,n)}),this.append(n);var r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this},n}(u.G7);const ni=ei;var ri=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oi=function(){return oi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',componentFirst:!1,custom:!1};var vi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vi(e,t),e.prototype.defaults=function(){return{name:"",label:""}},e.prototype.getName=function(){return this.get("name")},e.prototype.getLabel=function(){return this.get("label")||this.getName()},e}(u.Hn);const mi=yi;yi.prototype.idAttribute="name";var bi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wi="contentEditable",_i=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.em=r.em,n.listenTo(n.model,"change:active",n.updateStatus),n}return bi(e,t),e.prototype.template=function(){var t=this,e=t.pfx,r=t.model,o=t.config,i=r.get("label")||"";return n(Ci||(Ci=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}(['\n \n ','\n $'," \n "],['\n \n ','\n $'," \n "])),e,e,e,i,e,e,o.iconTagRemove)},e.prototype.events=function(){return{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[wi]="true",e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),r=n.textContent||"",o=null==e?void 0:e.Selectors;n[wi]="false",null==e||e.setEditing(!1),o&&o.rename(t,r)!==t&&(n.innerText=t.get("label"))},e.prototype.changeStatus=function(){var t=this.model;t.set("active",!t.get("active"))},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,r=t.config,o=r.iconTagOn,i=r.iconTagOff,a=n.find("[data-tag-status]");e.get("active")?(a.html(o),n.removeClass("opac50")):(a.html(i),n.addClass("opac50"))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr("class","".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},e}(u.G7);const xi=_i;var Ci,Si=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Ti=function(e){function r(n){void 0===n&&(n={});var r=e.call(this,n)||this;r.config=n.config||{},r.pfx=r.config.stylePrefix||"",r.ppfx=r.config.pStylePrefix||"",r.className=r.pfx+"tags",r.stateInputId=r.pfx+"states",r.stateInputC=r.pfx+"input-c",r.states=r.config.states||[];var o=r.config.em,i=r.collection;r.target=o;var a=o.Selectors;return r.module=a,r.em=o,r.componentChanged=(0,t.debounce)(r.componentChanged.bind(r),0),r.checkSync=(0,t.debounce)(r.checkSync.bind(r),0),r.listenTo(o,"component:toggled component:update:classes",r.componentChanged),r.listenTo(o,"styleManager:update",r.componentChanged),r.listenTo(o,"component:update:classes change:state",r.__handleStateChange),r.listenTo(o,"styleable:change change:device",r.checkSync),r.listenTo(i,"add",r.addNew),r.listenTo(i,"reset",r.renderClasses),r.listenTo(i,"remove",r.tagRemoved),r.listenTo(a.getAll(),a.events.state,(0,t.debounce)(function(){return r.renderStates()},0)),r.delegateEvents(),r}return Si(r,e),r.prototype.template=function(t){var e=t.labelInfo,r=t.labelHead,o=t.iconSync,i=t.iconAdd,a=t.pfx,s=t.ppfx;return n(Pi||(Pi=Oi(['
\n
','
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $',' \n \n
\n
\n
',':
\n
\n
'],['
\n
','
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $',' \n \n
\n
\n
',':
\n
\n
'])),a,a,a,a,r,a,a,a,s,s,s,a,s,s,a,s,a,a,a,a,a,i,a,a,o,a,a,e,a)},r.prototype.events=function(){return{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"}},r.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.Css,o=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get("state"),a=e.getCurrentMedia(),s=[],l=r.get(o,i,a)||r.add(o,i,a);this.getTargets().forEach(function(e){var n=r.getIdRule(e.getId(),{state:i,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)}),t&&l.addStyle(t),e.trigger("component:toggled"),e.trigger("component:sync-style",{component:n,selectors:o,mediaText:a,rule:l,ruleComponents:s,state:i})},r.prototype.tagRemoved=function(){this.updateStateVis()},r.prototype.addNew=function(t){this.addToClasses(t)},r.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:"none"}),null===(e=this.$input)||void 0===e||e.show().focus()},r.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:""}),null===(e=this.$input)||void 0===e||e.hide().val("")},r.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},r.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},r.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},r.prototype.updateSelection=function(e){var n=e||this.getTargets(),r=[];return(n=(0,t.isArray)(n)?n:[n])&&n.length&&(r=this.getCommonSelectors({targets:n}),this.checkSync({validSelectors:r})),this.collection.reset(r),this.updateStateVis(n),this.module.__trgCustom(),r},r.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,o=void 0===r?{}:r,i=n||this.getTargets();return this.module.__getCommonSelectors(i,o)},r.prototype._commonSelectors=function(){for(var t,e=[],n=0;n',""],['',""])),i,e);else{var u=null==e?void 0:e.getSelectors();if(!u)return"";var p=u.getStyleable(),f=s.get("state"),d=e.getId?n(Ai||(Ai=Oi(['','\n #',""],['','\n #',""])),i,e.getName(),i,e.getId()):"";r=(r=this.collection.getFullString(p))?n(ji||(ji=Oi(['',""],['',""])),i,r):e.get("selectorsAdd")||d,r=c&&d?d:r,r+=f?n(Mi||(Mi=Oi([':',""],[':',""])),i,f):"",r=l?l({result:r,state:f,target:e}):r}return r&&'').concat(r,"")},r.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set("state",n)},r.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},r.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),o=new xi({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(o):r.append(o),o},r.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each(function(n){return t.addToClasses(n,e)}),n.append(e)},r.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},r.prototype.getStates=function(){if(!this.$states){var t=this.$el.find("[data-states]");this.$states=t[0]&&t}return this.$states},r.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},r.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t("selectorManager.emptyState"),r=t.getStates().map(function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return'")}).join(""),o=this.getStates();o&&o.html('").concat(r)),this.checkStates()},r.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,o=t.config,i=t.$el,a=t.el,s=o.render,l={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:e.t("selectorManager.label"),labelInfo:e.t("selectorManager.selected"),ppfx:r,pfx:n,el:a};i.html(this.template(l));var c=s&&s(l);return c&&c!==a&&i.empty().append(c),this.$input=i.find("[data-input]"),this.$addBtn=i.find("[data-add]"),this.$classes=i.find("#"+n+"tags-c"),this.$btnSyncEl=i.find("[data-sync-style]"),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr("class","".concat(this.className," ").concat(r,"one-bg ").concat(r,"two-color")),this},r}(u.G7);const ki=Ti;var Pi,Ei,Ai,ji,Mi,Li=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Di=function(){return Di=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0}):e.slice(1).reduce(function(e,n){return t.__common(e,n)},e[0]):[]},r.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},r}(b);const Ki=Gi,Yi={textTags:["br","b","i","u","a","ul","ol"],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:"text/html",allowScripts:!1,allowUnsafeAttr:!1,keepEmptyTextNodes:!1}};var Xi={4:"media",5:"font-face",6:"page",7:"keyframes",11:"counter-style",12:"supports",13:"document",14:"font-feature-values",15:"viewport"},Ji=(0,t.keys)(Xi),Zi=["5","6","11","15"],Qi=["font-face","page","counter-style","viewport"],ta=function(t){void 0===t&&(t="");for(var e=[],n=[],r=t.split(","),o=0,i=r.length;o=0&&(r.singleAtRule=!0),l&&(r.atRuleType=l),c&&(r.selectorsAdd=c),u&&(r.mediaText=u),s&&(t[o-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},oa=function(t){for(var e=[],n=t.cssRules||[],r=0,o=n.length;r=0;if(p)s=!0,l=Xi[a],c=na(i);else if(Ji.indexOf(a)>=0){var f=oa(i);c=na(i);for(var d=0,h=f.length;d0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]').concat(e,"")},r.prototype.templateInput=function(){var t=this.clsField;return'
')},r.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},r.prototype.removeView=function(){this.remove(),this.removed()},r.prototype.init=function(){},r.prototype.removed=function(){},r.prototype.onRender=function(){},r.prototype.onUpdate=function(){},r.prototype.onEvent=function(){},r.prototype.onChange=function(e){var n=this.getInputElem();n&&!(0,t.isUndefined)(n.value)&&this.model.set("value",n.value),this.onEvent($a($a({},this.getClbOpts()),{event:e}))},r.prototype.getValueForTarget=function(){return this.model.get("value")},r.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},r.prototype.onValueChange=function(t,e,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(t.get("value")),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}},r.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||""),t.find("[data-label]").append(r)},r.prototype.getLabel=function(){var t=this.em,n=this.model.attributes,r=n.label,o=n.name;return t.t("traitManager.traits.labels.".concat(o))||(0,e.capitalize)(r||o).replace(/-/g," ")},r.prototype.getComponent=function(){return this.target},r.prototype.getInputEl=function(){if(!this.$input){var e=this.em,n=this.model,r=n,o=n.attributes.name,i=r.get("placeholder")||r.get("default")||"",a=r.get("type")||"text",s=r.get("min"),l=r.get("max"),u=this.getModelValue(),p=(0,c.default)('')),f=e.t("traitManager.traits.attributes.".concat(o))||{};p.attr($a({placeholder:i},f)),(0,t.isUndefined)(u)||(r.set({value:u},{silent:!0}),p.prop("value",u)),s&&p.prop("min",s),l&&p.prop("max",l),this.$input=p}return this.$input.get(0)},r.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},r.prototype.getModelValue=function(){var e,n=this.model,r=this.target,o=n.getName();if(n.get("changeProp"))e=r.get(o);else{var i=r.get("attributes");e=n.get("value")||i[o]}return(0,t.isUndefined)(e)?"":e},r.prototype.getElInput=function(){return this.elInput},r.prototype.renderField=function(){var e=this,n=e.$el,r=e.appendInput,o=e.model,i=n.find("[data-input]"),a=i[i.length-1],s=o.el;s||(s=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,t.isString)(s)?(a.innerHTML=s,this.elInput=a.firstChild):(r?a.appendChild(s):a.insertBefore(s,a.firstChild),this.elInput=s),o.el=this.elInput},r.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},r.prototype.rerender=function(){delete this.model.el,this.render()},r.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},r.prototype.render=function(){var e=this,n=e.$el,r=e.pfx,o=e.ppfx,i=e.model.attributes,a=i.type,s=i.id,l=this.hasLabel&&this.hasLabel(),c="".concat(r,"trait");delete this.$input;var u='
\n ').concat(l?'
'):"",'\n
\n ').concat(this.templateInput?(0,t.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n
\n
");return n.empty().append(u),l&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(s),this.postUpdate(),this.onRender(this.getClbOpts()),this},r}(u.G7);const Ga=qa;qa.prototype.eventCapture=["change"];var Ka=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ya=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e)||this;r.reuseView=!0,r.itemsView=n;var o=e.config||{},i=o.stylePrefix||"",a=e.editor;return r.config=o,r.em=a,r.pfx=i,r.ppfx=o.pStylePrefix||"",r.className="".concat(i,"traits"),r.listenTo(a,"component:toggled",r.updatedCollection),r.updatedCollection(),r}return Ka(e,t),e.prototype.updatedCollection=function(){var t=this,e=t.ppfx,n=t.className,r=t.em.getSelected();this.el.className="".concat(n," ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=r?r.traits:[],this.render()},e}(Ua.Z);const Xa=Ya;Ya.prototype.itemView=Ga;var Ja=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Za=function(e){function n(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.listenTo(n.model,"change:options",n.rerender),n}return Ja(n,e),n.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'
\n
\n
\n
\n
\n
')},n.prototype.getInputEl=function(){if(!this.$input){var e=this.model,n=this.em,r=e.get("name"),o=e.get("options")||[],i=[],a="",this.$input=(0,c.default)(a);var s=e.getTargetValue(),l=i.indexOf(s)>=0?s:e.get("default");!(0,t.isUndefined)(l)&&this.$input.val(l)}return this.$input.get(0)},n}(Ga);var Qa=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ts=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.appendInput=!1,t}return Qa(n,e),n.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'')},n.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},n.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},n.prototype.getInputEl=function(){for(var e=[],n=0;n')},e.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.elementUpdated=function(){this.model.trigger("el:change")},e.prototype.setValue=function(t){var e=this.model,n=t||e.get("defaults"),r=this.getInputEl();r&&(r.value=n)},e.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},e.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},e.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},e.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,e=this.opts.type||"text",n=t.get("placeholder")||t.get("defaults")||t.get("default")||"";this.inputEl=(0,c.default)(''))}return this.inputEl.get(0)},e.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},e}(u.G7);const rs=ns;ns.prototype.events={change:"handleChange"};var os=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(n){function r(e){void 0===e&&(e={});var r=n.call(this,e)||this;return(0,t.bindAll)(r,"moveIncrement","upIncrement"),r.doc=document,r.listenTo(r.model,"change:unit",r.handleModelChange),r}return os(r,n),r.prototype.template=function(){var t=this.ppfx;return'\n \n \n
\n
\n
\n
\n ')},r.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},r.prototype.setValue=function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),o={value:r.value,unit:""};(r.unit||r.force)&&(o.unit=r.unit),this.model.set(o,n),n.silent&&this.handleModelChange()},r.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},r.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},r.prototype.handleKeyDown=function(t){"ArrowUp"===t.key&&(t.preventDefault(),this.upArrowClick()),"ArrowDown"===t.key&&(t.preventDefault(),this.downArrowClick())},r.prototype.elementUpdated=function(){this.model.trigger("el:change")},r.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},r.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=[''];e.forEach(function(e){var r=e==t.get("unit")?"selected":"";n.push(""))});var r=document.createElement("div");r.innerHTML='"),this.unitEl=r.firstChild}}return this.unitEl},r.prototype.upArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},r.prototype.downArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()},r.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var n=this.model.get("value")||0;n=this.normalizeValue(n),this.current={y:t.pageY,val:n},(0,e.on)(this.doc,"mousemove",this.moveIncrement),(0,e.on)(this.doc,"mouseup",this.upIncrement)},r.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get("step"),r=this.current,o=this.normalizeValue(r.val+(r.y-t.pageY)*n),i=this.validateInputValue(o),a=i.value,s=i.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1},r.prototype.upIncrement=function(){var t=this.model,n=t.get("step");if((0,e.off)(this.doc,"mouseup",this.upIncrement),(0,e.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var r=this.prValue-n;t.set("value",r,{avoidStore:1}).set("value",r+n),this.elementUpdated()}},r.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get("step"),r=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=n.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(t.toFixed(r)):t},r.prototype.validateInputValue=function(e,n){void 0===n&&(n={});var r=0,o=n||{},i=this.model,a=(0,t.isUndefined)(e)?"":e,s=n.units||i.get("units")||[],l=i.get("unit")||s.length&&s[0]||"",c=(0,t.isUndefined)(n.max)?i.get("max"):n.max,u=(0,t.isUndefined)(n.min)?i.get("min"):n.min,p=!!i.get("limitlessMax"),f=!!i.get("limitlessMin");if(o.deepCheck){var d=i.get("fixedValues")||[];if(""===a&&(l=""),a){var h=new RegExp("^"+d.join("|"),"g");if(d.length&&h.test(a))a=a.match(h)[0],l="",r=1;else{var g=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?"":a;var v=g.replace(a,"");(0,t.indexOf)(s,v)>=0&&(l=v)}}}return p||(0,t.isUndefined)(c)||""===c||(a=a>c?c:a),f||(0,t.isUndefined)(u)||""===u||(a=a","
","
▼
",""].join(""),l=function(){var t="";if(i)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
",t,"
","
","
","
","
","","
","
","
","","","
","
","
"].join("")}(),c="spectrum.id";t.fn.spectrum=function(e,u){if("string"==typeof e){var p=this,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=o[t(this).data(c)];if(n){var r=n[e];if(!r)throw new Error("Spectrum: no such method: '"+e+"'");"get"==e?p=n.get():"container"==e?p=n.container:"option"==e?p=n.option.apply(n,f):"destroy"==e?(n.destroy(),t(this).removeData(c)):r.apply(n,f)}}),p}return this.spectrum("destroy").each(function(){var u=function(e,c){var u,p,f,d=function(e,n){var o=t.extend({},r,e);return o.callbacks={move:P(o.move,n),change:P(o.change,n),show:P(o.show,n),hide:P(o.hide,n),beforeShow:P(o.beforeShow,n)},o}(c,e),h=d.flat,g=d.showSelectionPalette,v=d.localStorageKey,y=d.theme,b=d.callbacks,w=(u=Wt,p=10,function(){var t=this,e=arguments,n=function(){f=null,u.apply(t,e)};f||(f=setTimeout(n,p))}),_=!1,x=!1,C=!0,S=0,T=0,j=0,M=0,L=0,D=0,N=0,I=0,F=0,V=0,R=1,H=[],z=[],B={},U=d.selectionPalette.slice(0),W=d.maxSelectionSize,$="sp-dragging",q=null,G=e.ownerDocument,K=(G.body,t(e)),Y=!1,X=t(l,G).addClass(y),J=X.find(".sp-picker-container"),Z=X.find(".sp-color"),Q=X.find(".sp-dragger"),tt=X.find(".sp-hue"),et=X.find(".sp-slider"),nt=X.find(".sp-alpha-inner"),rt=X.find(".sp-alpha"),ot=X.find(".sp-alpha-handle"),it=X.find(".sp-input"),at=X.find(".sp-palette"),st=X.find(".sp-initial"),lt=X.find(".sp-cancel"),ct=X.find(".sp-clear"),ut=X.find(".sp-choose"),pt=X.find(".sp-palette-toggle"),ft=K.is("input"),dt=ft&&"color"===K.attr("type")&&A(),ht=ft&&!h,gt=ht?t(s).addClass(y).addClass(d.className).addClass(d.replacerClassName):t([]),vt=ht?gt:K,yt=gt.find(".sp-preview-inner"),mt=d.color||ft&&K.val(),bt=!1,wt=d.preferredFormat,_t=!d.showButtons||d.clickoutFiresChange,xt=!mt,Ct=d.allowEmpty&&!dt;function St(){if(d.showPaletteOnly&&(d.showPalette=!0),pt.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),d.palette){H=d.palette.slice(0),z=t.isArray(H[0])?H:[H],B={};for(var e=0;e1&&(delete window.localStorage[v],t.each(e,function(t,e){Tt(e)}))}catch(n){}try{U=window.localStorage[v].split(";")}catch(n){}}}function Tt(e){if(g){var n=m(e).toRgbString();if(!B[n]&&-1===t.inArray(n,U))for(U.push(n);U.length>W;)U.shift();if(v&&window.localStorage)try{window.localStorage[v]=U.join(";")}catch(r){}}}function kt(){var e=Rt(),n=t.map(z,function(t,n){return O(t,e,"sp-palette-row sp-palette-row-"+n,d)});Ot(),U&&n.push(O(function(){var t=[];if(d.showPalette)for(var e=0;ep&&p>o?Math.abs(d.left+o-p):0),d.top-=Math.min(d.top,d.top+i>f&&f>i?Math.abs(i+a-r):r),d}(X,vt))),Bt(),d.showPalette&&kt(),K.trigger("reflow.spectrum"))}function $t(){It(),Y=!0,K.attr("disabled",!0),vt.addClass("sp-disabled")}!function(){if(i&&X.find("*:not(input)").attr("unselectable","on"),St(),ht&&K.after(gt).hide(),Ct||ct.hide(),h)K.after(X).hide();else{var e="parent"===d.appendTo?K.parent():t(d.appendTo);1!==e.length&&(e=t("body")),e.append(X)}function n(e){return e.data&&e.data.ignore?(Vt(t(e.target).closest(".sp-thumb-el").data("color")),Ht()):(Vt(t(e.target).closest(".sp-thumb-el").data("color")),Ht(),d.hideAfterPaletteSelect&&(Ut(!0),It())),!1}Ot(),vt.bind("click.spectrum touchstart.spectrum",function(e){Y||Mt(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()}),(K.is(":disabled")||!0===d.disabled)&&$t(),X.click(k),it.change(jt),it.bind("paste",function(){setTimeout(jt,1)}),it.keydown(function(t){13==t.keyCode&&jt()}),lt.text(d.cancelText),lt.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),Ft(),It()}),ct.attr("title",d.clearText),ct.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),xt=!0,Ht(),h&&Ut(!0)}),ut.text(d.chooseText),ut.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),i&&it.is(":focus")&&it.trigger("change"),it.hasClass("sp-validation-error")||(Ut(!0),It())}),pt.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),pt.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),d.showPaletteOnly=!d.showPaletteOnly,d.showPaletteOnly||h||X.css("left","-="+(J.outerWidth(!0)+5)),St()}),E(rt,function(t,e,n){R=t/L,xt=!1,n.shiftKey&&(R=Math.round(10*R)/10),Ht()},Et,At),E(tt,function(t,e){I=parseFloat(e/M),xt=!1,d.showAlpha||(R=1),Ht()},Et,At),E(Z,function(t,e,n){if(n.shiftKey){if(!q){var r=F*S,o=T-V*T,i=Math.abs(t-r)>Math.abs(e-o);q=i?"x":"y"}}else q=null;var a=!q||"y"===q;(!q||"x"===q)&&(F=parseFloat(t/S)),a&&(V=parseFloat((T-e)/T)),xt=!1,d.showAlpha||(R=1),Ht()},Et,At),mt?(Vt(mt),zt(),wt=d.preferredFormat||m(mt).getFormat(),Tt(mt)):zt(),h&&Lt();var r=i?"mousedown.spectrum":"click.spectrum touchstart.spectrum";at.delegate(".sp-thumb-el",r,n),st.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},n)}();var qt={show:Lt,hide:It,toggle:Mt,reflow:Wt,option:function(e,r){return e===n?t.extend({},d):r===n?d[e]:(d[e]=r,"preferredFormat"===e&&(wt=d.preferredFormat),void St())},enable:function(){Y=!1,K.attr("disabled",!1),vt.removeClass("sp-disabled")},disable:$t,offset:function(t){d.offset=t,Wt()},set:function(t){Vt(t),Ut()},get:Rt,destroy:function(){K.show(),vt.unbind("click.spectrum touchstart.spectrum"),X.remove(),gt.remove(),o[qt.id]=null},container:X};return qt.id=o.push(qt)-1,qt}(this,t.extend({},e,t(this).data()));t(this).data(c,u.id)})},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=E,t.fn.spectrum.defaults=r,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("")[0];e._cachedResult="color"===n.type&&""!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t("input[type=color]");e.length&&!A()&&e.spectrum({preferredFormat:"hex6"})};var u=/^[\s,#]+/,p=/\s+$/,f=0,d=Math,h=d.round,g=d.min,v=d.max,y=d.random,m=function(t,e){if(e=e||{},(t=t||"")instanceof m)return t;if(!(this instanceof m))return new m(t,e);var n,r,o,i,a,s,l,c,y=(a={r:0,g:0,b:0},s=1,l=!1,c=!1,"string"==typeof(n=t)&&(n=function(t){t=t.replace(u,"").replace(p,"").toLowerCase();var e,n=!1;if(x[t])t=x[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=S.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=S.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=S.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=S.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=S.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=S.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=S.hex8.exec(t))?{a:tt(e[1]),r:J(e[2]),g:J(e[3]),b:J(e[4]),format:n?"name":"hex8"}:(e=S.hex6.exec(t))?{r:J(e[1]),g:J(e[2]),b:J(e[3]),format:n?"name":"hex"}:!!(e=S.hex3.exec(t))&&{r:J(e[1]+""+e[1]),g:J(e[2]+""+e[2]),b:J(e[3]+""+e[3]),format:n?"name":"hex"}}(n)),"object"==typeof n&&(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b")?(r=n.r,o=n.g,i=n.b,a={r:255*Y(r,255),g:255*Y(o,255),b:255*Y(i,255)},l=!0,c="%"===String(n.r).substr(-1)?"prgb":"rgb"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("v")?(n.s=Q(n.s),n.v=Q(n.v),a=function(t,e,n){t=6*Y(t,360),e=Y(e,100),n=Y(n,100);var r=d.floor(t),o=t-r,i=n*(1-e),a=n*(1-o*e),s=n*(1-(1-o)*e),l=r%6;return{r:255*[n,a,i,i,s,n][l],g:255*[s,n,n,a,i,i][l],b:255*[i,i,s,n,n,a][l]}}(n.h,n.s,n.v),l=!0,c="hsv"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("l")&&(n.s=Q(n.s),n.l=Q(n.l),a=function(t,e,n){var r,o,i;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Y(t,360),e=Y(e,100),n=Y(n,100),0===e)r=o=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),o=a(l,s,t),i=a(l,s,t-1/3)}return{r:255*r,g:255*o,b:255*i}}(n.h,n.s,n.l),l=!0,c="hsl"),n.hasOwnProperty("a")&&(s=n.a)),s=K(s),{ok:l,format:n.format||c,r:g(255,v(a.r,0)),g:g(255,v(a.g,0)),b:g(255,v(a.b,0)),a:s});this._originalInput=t,this._r=y.r,this._g=y.g,this._b=y.b,this._a=y.a,this._roundA=h(100*this._a)/100,this._format=e.format||y.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=y.ok,this._tc_id=f++};m.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=K(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=M(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=j(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=j(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return L(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return D(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+h(this._r)+", "+h(this._g)+", "+h(this._b)+")":"rgba("+h(this._r)+", "+h(this._g)+", "+h(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:h(100*Y(this._r,255))+"%",g:h(100*Y(this._g,255))+"%",b:h(100*Y(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+h(100*Y(this._r,255))+"%, "+h(100*Y(this._g,255))+"%, "+h(100*Y(this._b,255))+"%)":"rgba("+h(100*Y(this._r,255))+"%, "+h(100*Y(this._g,255))+"%, "+h(100*Y(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[L(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+D(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";return t&&(n=m(t).toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(V,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(N,arguments)},saturate:function(){return this._applyModification(I,arguments)},greyscale:function(){return this._applyModification(F,arguments)},spin:function(){return this._applyModification(z,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(q,arguments)},complement:function(){return this._applyCombination(B,arguments)},monochromatic:function(){return this._applyCombination(G,arguments)},splitcomplement:function(){return this._applyCombination($,arguments)},triad:function(){return this._applyCombination(U,arguments)},tetrad:function(){return this._applyCombination(W,arguments)}},m.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Q(t[r]));t=n}return m(t,e)},m.equals=function(t,e){return!(!t||!e)&&m(t).toRgbString()==m(e).toRgbString()},m.random=function(){return m.fromRatio({r:y(),g:y(),b:y()})},m.mix=function(t,e,n){n=0===n?0:n||50;var r,o=m(t).toRgb(),i=m(e).toRgb(),a=n/100,s=2*a-1,l=i.a-o.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:i.r*r+o.r*c,g:i.g*r+o.g*c,b:i.b*r+o.b*c,a:i.a*a+o.a*(1-a)};return m(u)},m.readability=function(t,e){var n=m(t),r=m(e),o=n.toRgb(),i=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=Math.max(o.r,i.r)-Math.min(o.r,i.r)+Math.max(o.g,i.g)-Math.min(o.g,i.g)+Math.max(o.b,i.b)-Math.min(o.b,i.b);return{brightness:Math.abs(a-s),color:l}},m.isReadable=function(t,e){var n=m.readability(t,e);return n.brightness>125&&n.color>500},m.mostReadable=function(t,e){for(var n=null,r=0,o=!1,i=0;i125&&a.color>500,l=a.brightness/125*3+a.color/500;(s&&!o||s&&o&&l>r||!s&&!o&&l>r)&&(o=s,r=l,n=m(e[i]))}return n};var b,w,_,x=m.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=m.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(x),S=(w="[\\s|\\(]+("+(b="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",_="[\\s|\\(]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",{rgb:new RegExp("rgb"+w),rgba:new RegExp("rgba"+_),hsl:new RegExp("hsl"+w),hsla:new RegExp("hsla"+_),hsv:new RegExp("hsv"+w),hsva:new RegExp("hsva"+_),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=m,t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})}function O(e,n,r,o){for(var i=[],s=0;s')}else i.push(t("
").append(t('').attr("title",o.noColorSelectedText)).html())}return"
"+i.join("")+"
"}function T(){}function k(t){t.stopPropagation()}function P(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function E(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,l={},c=0,u=0,p="ontouchstart"in window,f={};function d(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],o=r&&r.pageX||t.pageX,f=r&&r.pageY||t.pageY,h=Math.max(0,Math.min(o-l.left,u)),v=Math.max(0,Math.min(f-l.top,c));p&&d(t),n.apply(e,[h,v,t])}}function g(){s&&(t(a).unbind(f),t(a.body).removeClass("sp-dragging"),setTimeout(function(){o.apply(e,arguments)},0)),s=!1}f.selectstart=d,f.dragstart=d,f["touchmove mousemove"]=h,f["touchend mouseup"]=g,t(e).bind("touchstart mousedown",function(n){(n.which?3==n.which:2==n.button)||s||!1!==r.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(f),t(a.body).addClass("sp-dragging"),h(n),d(n))})}function A(){return t.fn.spectrum.inputTypeColorSupport()}function j(t,e,n){t=Y(t,255),e=Y(e,255),n=Y(n,255);var r,o,i=v(t,e,n),a=g(t,e,n),s=(i+a)/2;if(i==a)r=o=0;else{var l=i-a;switch(o=s>.5?l/(2-i-a):l/(i+a),i){case t:r=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(m(r));return i}function G(t,e){e=e||6;for(var n=m(t).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/e;e--;)a.push(m({h:r,s:o,v:i})),i=(i+s)%1;return a}function K(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Y(t,e){var n;"string"==typeof(n=t)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=g(e,v(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),d.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function X(t){return g(1,v(0,t))}function J(t){return parseInt(t,16)}function Z(t){return 1==t.length?"0"+t:""+t}function Q(t){return t<=1&&(t=100*t+"%"),t}function tt(t){return J(t)/255}}(c.default);var ps=function(t){var e="name"===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,"")};const fs=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return cs(n,e),n.prototype.template=function(){var t=this.ppfx;return'\n
\n
\n
\n
\n
\n
\n ')},n.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.remove=function(){return e.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},n.prototype.handleChange=function(e){e.stopPropagation();var n=e.target.value;(0,t.isUndefined)(n)||this.__onInputChange(n)},n.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,r=t,o=this.getColorEl();if(o){o.spectrum("set",r);var i=o.spectrum("get"),a=r&&ps(i);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})},n.prototype.setValue=function(e,n){void 0===n&&(n={});var r=this.model,o=(0,t.isUndefined)(n.def)?r.get("defaults"):n.def,i=(0,t.isUndefined)(e)?(0,t.isUndefined)(o)?"":o:e,a=this.getInputEl(),s=this.getColorEl(),l="none"!=i?i:"";a.value=i,s.get(0).style.backgroundColor=l,(n.fromTarget||n.fromInput&&!n.avoidStore)&&(s.spectrum("set",l),this.noneColor="none"==i,this.movedColor=l)},n.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,r=e.model,o=e.opts,i=this.ppfx,a=o.onChange,s=(0,c.default)('
')),l=s.get(0).style,u=n&&n.config?n.config.el:"",p=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var f,d=!1;this.$el.find("[data-colorp-c]").append(s);var h=function(t,e){void 0===e&&(e=!0),a?a(t,!e):(e&&r.setValueFromInput(0,!1),r.setValueFromInput(t,e))};s.spectrum(us(us(us({color:r.getValue()||!1,containerClassName:"".concat(i,"one-bg ").concat(i,"two-color"),appendTo:u||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},p),r.get("colorPicker")||{}),{move:function(e){var n=ps(e);t.movedColor=n,l.backgroundColor=n,h(n,!1)},change:function(e){d=!0;var n=ps(e);l.backgroundColor=n,h(n),t.noneColor=!1},show:function(e){d=!1,t.movedColor="",f=a?r.getValue({noDefault:!0}):ps(e)},hide:function(){d||!f&&!a||(t.noneColor&&(f=""),l.backgroundColor=f,s.spectrum("set",f),h(f,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",function(){t.movedColor&&h(t.movedColor),d=!0,t.movedColor="",s.spectrum("hide")}),this.colorEl=s}return this.colorEl},n.prototype.render=function(){return rs.prototype.render.call(this),this.getColorEl(),this},n}(rs);var ds=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const hs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ds(e,t),e.prototype.templateInput=function(){return""},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new fs({model:t,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(Ga);var gs=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vs=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return gs(n,e),n.prototype.templateInput=function(){return""},n.prototype.onChange=function(){this.handleClick()},n.prototype.handleClick=function(){var e=this.model,n=this.em,r=e.get("command");r&&((0,t.isString)(r)?n.Commands.run(r):r(n.Editor,e))},n.prototype.renderLabel=function(){this.model.get("label")&&Ga.prototype.renderLabel.apply(this)},n.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),r=n.labelButton,o=n.text,i=n.full,a=r||o,s="".concat(e,"btn");return'")},n}(Ga);const ys=vs;vs.prototype.eventCapture=["click button"];var ms=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bs=function(){return bs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n ').concat(x,'\n ').concat(C,"\n "):"",'\n
\n
\n
\n ').concat(S,"\n ").concat(m?'').concat(m,""):"",'\n ').concat(y,'\n
\n
\n
\n
').concat(u||"",'
\n
').concat(_||"",'
\n
')},Object.defineProperty(r.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),r.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,"remove add reset",this.checkChildren),[["change:status",this.updateStatus],["change:open",this.updateOpening],["change:layerable",this.updateLayerable],["change:style:display",this.updateVisibility],["rerender:layer",this.render],["change:name change:custom-name",this.updateName]].forEach(function(n){return t.listenTo(e,n[0],n[1])}),this.$el.data("model",e),this.$el.data("collection",r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},r.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},r.prototype.getVisibilityEl=function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},r.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,o="".concat(e,"layer-hidden"),i=r.isVisible(n)?"removeClass":"addClass";this.$el[i](o),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},r.prototype.toggleVisibility=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},r.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName();a[js]="true",a.focus(),document.execCommand("selectAll",!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(o).addClass(i)},r.prototype.handleEditKey=function(t){t.stopPropagation(),((0,e.isEscKey)(t)||(0,e.isEnterKey)(t))&&this.handleEditEnd(t)},r.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[js]="false",this.setName(s,{component:this.model,propName:"custom-name"}),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(o).removeClass(i),this.updateName()},r.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},r.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},r.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o="open",i="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(o),a.addClass(i)):(e.removeClass(o),a.removeClass(i))},r.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get("components").length&&n.setOpen(e,!n.isOpen(e))},r.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},r.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},r.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},r.prototype.startSort=function(t){t.stopPropagation();var e=this.em,n=this.sorter;t.button&&0!==t.button||n&&(n.onStart=function(t){return e.trigger("".concat(He,":start"),t)},n.onMoveClb=function(t){return e.trigger(He,t)},n.startSort(t.target))},r.prototype.updateStatus=function(){tn.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},r.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.$el,o=t.module,i=o.getComponents(e).length,a=r.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),s=this.cnt;s||(s=r.children("[data-count]").get(0),this.cnt=s),a[i?"removeClass":"addClass"](n),s&&(s.innerHTML=i||""),!i&&o.setOpen(e,!1)},r.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))),this.caret},r.prototype.setRoot=function(n){n=(0,t.isString)(n)?this.em.getWrapper().find(n)[0]:n;var r=(0,e.getModel)(n,0);r&&(this.stopListening(),this.model=r,this.initComponent(),this._rendered&&this.render())},r.prototype.updateLayerable=function(){(this.parentView||this).render()},r.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},r.prototype.remove=function(){for(var t=[],e=0;e\n ').concat(this.getPreview(),'\n
\n
\n ').concat(this.getInfo(),'\n
\n
\n ⨯\n
\n ')},n.prototype.updateTarget=function(e){e&&e.set&&(e.set("attributes",(0,t.clone)(e.get("attributes"))),e.set("src",this.model.get("src")))},n.prototype.getPreview=function(){return""},n.prototype.getInfo=function(){return""},n.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},n}(u.G7);const el=tl;var nl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rl=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},ol=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return nl(r,e),r.prototype.getPreview=function(){var t=this,e=t.pfx,r=t.ppfx,o=t.model.get("src");return n(al||(al=rl(['\n
\n
\n '],['\n
\n
\n '])),e,o,e,r)},r.prototype.getInfo=function(){var t=this.pfx,e=this.model,r=e.get("name"),o=e.get("width"),i=e.get("height"),a=e.get("unitDim"),s=o&&i?"".concat(o,"x").concat(i).concat(a):"";return r=r||e.getFilename(),n(sl||(sl=rl(['\n
','
\n
',"
\n "],['\n
','
\n
',"
\n "])),t,r,t,s)},r.prototype.init=function(){var t=this.pfx;this.className+=" ".concat(t,"asset-image")},r.prototype.onClick=function(){var e=this.model,n=this.pfx,r=this.__getBhv().select,o=this.config.onClick,i=this.collection;i.trigger("deselectAll"),this.$el.addClass(n+"highlight"),(0,t.isFunction)(r)?r(e,!1):(0,t.isFunction)(o)?o(e):this.updateTarget(i.target)},r.prototype.onDblClick=function(){var e=this.em,n=this.model,r=this.__getBhv().select,o=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;(0,t.isFunction)(r)?r(n,!0):(0,t.isFunction)(o)?o(n):(this.updateTarget(a),null==e||e.Modal.close()),(0,t.isFunction)(s)&&s(n)},r.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},r}(el);const il=ol;var al,sl;ol.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var ll=function(){return ll=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n \n
\n \n
\n \n ')),'\n
\n
\n ').concat(o,'\n
\n
\n
\n
\n ')},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;if(n){e.value="";var o=this.getAssetsEl();o&&(o.scrollTop=0),r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,r=this.collection,o=this.config,i=new t.typeView({model:t,collection:r,config:o}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each(function(n){return t.addAsset(n,e)}),n.append(e)},e.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},e}(u.G7);const vl=gl;gl.prototype.events={submit:"handleSubmit"};var yl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ml=function(t){function e(n){void 0===n&&(n={});var r=t.call(this,n)||this;r.options=n;var o=n.config||{};r.module=n.module,r.config=o,r.em=r.config.em,r.pfx=o.stylePrefix||"",r.ppfx=o.pStylePrefix||"",r.target=r.options.globalCollection||{},r.uploadId=r.pfx+"uploadFile",r.disabled=void 0!==o.disableUpload?o.disableUpload:!o.upload&&!o.embedAsBase64,r.multiUpload=void 0===o.multiUpload||o.multiUpload;var i=o.uploadFile;return i?r.uploadFile=i.bind(r):!o.upload&&o.embedAsBase64&&(r.uploadFile=e.embedAsBase64),r.delegateEvents(),r}return yl(e,t),e.prototype.template=function(t){var e=t.pfx,r=t.title,o=t.uploadId,i=t.disabled,a=t.multiUpload;return n(wl||(wl=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}(['\n
\n
','
\n \n
\n \n '],['\n
\n
','
\n \n
\n \n '])),e,r,o,i?"disabled":"",a?"multiple":"")},e.prototype.events=function(){return{"change [data-input]":"uploadFile"}},e.prototype.onUploadStart=function(){var t=this.module;t&&t.__propEv("asset:upload:start")},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;n&&n.__propEv("asset:upload:end",t);var r=e.find("input");r&&r.val("")},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv("asset:upload:error",t)},e.prototype.onUploadResponse=function(t,e){var n,r=this,o=r.module,i=r.config,a=r.target;try{n="string"==typeof t?JSON.parse(t):t}catch(s){n=t}o&&o.__propEv("asset:upload:response",n),i.autoAdd&&a&&a.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o=this.config,i=o.beforeUpload;if(!1!==(i&&i(r))){var a=new FormData,s=o.params,l=o.customFetch,c=o.fetchOptions;for(var u in s)a.append(u,s[u]);if(this.multiUpload)for(var p=0;p').concat(r.dropzoneContent,"")),p(),"draggable"in i&&[i,s].forEach(function(t){t.ondragover=f,t.ondragleave=d,t.ondrop=h})},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,r=t.em;return e.html(this.template({title:r&&r.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr("class",n+"file-uploader"),this},e.embedAsBase64=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o={data:[]};if(FileReader){for(var i=[],a=/^(.+)\/(.+)$/,s=function(t){var e=new Promise(function(e,n){var r=new FileReader;r.addEventListener("load",function(){var o,i=t.name,s=a.exec(t.type);if("image"===(o=s?s[1]:t.type)){var l={src:r.result,name:i,type:o,height:0,width:0},c=new Image;c.addEventListener("error",function(t){n(t)}),c.addEventListener("load",function(){l.height=c.height,l.width=c.width,e(l)}),c.src=l.src}else e(o?{src:r.result,name:i,type:o}:r.result)}),r.addEventListener("error",function(t){n(t)}),r.addEventListener("abort",function(){n("Aborted")}),r.readAsDataURL(t)});i.push(e)},l=0,c=r;l0&&(i=e.split(".").reduce(function(e,n){if(!(0,t.isUndefined)(e))return e[n]},o)),i}},r.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)},r.prototype.destroy=function(){},r}(m);const Gl=ql;var Kl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yl=function(){return Yl=Object.assign||function(t){for(var e,n=1,r=arguments.length;na+c-10||os+l-10)return 1},r.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(null==t?void 0:t.pageX)||0,y:(null==t?void 0:t.pageY)||0}},r.prototype.getDim=function(t){var e,n,r,o,i=this.em,a=this.canvasRelative,s=null==i?void 0:i.Canvas,l=s?s.getElementOffsets(t):{};if(a&&i){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,o=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,o=t.offsetWidth}return{top:e,left:n,height:r,width:o,offsets:l}},r.prototype.getChildrenDim=function(n){var r=this,o=[];if(!n)return o;var i=this.getTargetModel(n);if(i&&i.view&&!this.ignoreViewChildren){var a=i.getCurrentView?i.getCurrentView():i.view;n=a.getChildrenContainer()}return(0,t.each)(n.children,function(t,i){var a=t,s=(0,e.getModel)(a,c.default),l=s&&s.index?s.index():i;if((0,e.isTextNode)(a)||r.matches(a,r.itemSel)){var u,p=r.getDim(a),f=r.direction;u="v"==f||"h"!=f&&r.isInFlow(a,n),p.dir=u,p.el=a,p.indexEl=l,o.push(p)}}),o},r.prototype.nearBorders=function(t,e,n){var r=!1,o=this.borderOffset,i=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+o>a||a>s+c-o||l+o>i||i>l+u-o)&&(r=!0),r},r.prototype.findPosition=function(t,e,n){for(var r,o={index:0,indexEl:0,method:"before"},i=0,a=0,s=0,l=0,c=0,u=0,p=0,f=t.length;pa||s&&c>=s||i&&h+vx&&(w.at=d-1))}i&&(_?(delete w.at,a=v.getView().insertComponent(i,w)):a=g.add(i,w)),delete this.dropContent,delete this.prevTarget}else if(s){var S=h.dropInfo||(null==v?void 0:v.get("droppable")),O=h.dragInfo||(null==y?void 0:y.get("draggable"));!g&&f.push("Target collection not found"),!b&&S&&f.push("Target is not droppable, accepts [".concat(S,"]")),!m&&O&&f.push("Component not draggable, acceptable by [".concat(O,"]")),s.logWarning("Invalid target position",{errors:f,model:y,context:"sorter",target:v})}return null==s||s.trigger("sorter:drag:end",{targetCollection:g,modelToDrop:i,warns:f,validResult:h,dst:n,srcEl:p}),a},r.prototype.rollback=function(t){(0,e.off)(this.getDocuments(),"keydown",this.rollback),27==(t.which||t.keyCode)&&(this.moved=!1,this.endMove())},r}(u.G7);const Zl=Jl;var Ql=function(){return Ql=Object.assign||function(t){for(var e,n=1,r=arguments.length;nb?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}for(var w in~y.indexOf("l")&&(v.l+=i.w-v.w),~y.indexOf("t")&&(v.t+=i.h-v.h),v){var _=w;v[_]=parseInt("".concat(v[_]),10)}return v}},n}();const ec=tc;var nc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rc=function(){return rc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0&&fc.splice(r,1),93!=n&&224!=n||(n=91),n in sc)for(e in sc[n]=!1,cc)cc[e]==n&&(mc[e]=!1)}function yc(){for(ic in sc)sc[ic]=!1;for(ic in cc)mc[ic]=!1}function mc(t,e,n){var r,o;r=wc(t),void 0===n&&(n=e,e="all");for(var i=0;i1&&(o=_c(t),t=[t[t.length-1]]),t=t[0],(t=pc(t))in ac||(ac[t]=[]),ac[t].push({shortcut:r[i],scope:e,method:n,key:r[i],mods:o})}for(ic in cc)mc[ic]=!1;function bc(){return lc||"all"}function wc(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function _c(t){for(var e=t.slice(0,t.length-1),n=0;n1&&(s=_c(r)),t=r[r.length-1],t=pc(t),void 0===e&&(e=bc()),!ac[t])return;for(o=0;o0,sc)(!sc[r]&&dc(n.mods,+r)>-1||sc[r]&&-1==dc(n.mods,+r))&&(i=!1);(0!=n.mods.length||sc[16]||sc[18]||sc[17]||sc[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)}),xc(t.document,"keyup",vc),xc(t,"focus",yc)};const Cc=mc,Sc={defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo"},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo"},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"},"core:component-next":{keys:"s",handler:"core:component-next"},"core:component-prev":{keys:"w",handler:"core:component-prev"},"core:component-enter":{keys:"d",handler:"core:component-enter"},"core:component-exit":{keys:"a",handler:"core:component-exit"},"core:component-delete":{keys:"backspace, delete",handler:"core:component-delete",opts:{prevent:!0}}}};var Oc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tc=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o\n
\n
').concat(o,'
\n
⨯
\n
\n
\n
').concat(r,'
\n
\n
\n \n ')},e.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get("content");e.length&&n.append(e),t.empty().append(r)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get("title"))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get("open")?"":"none"},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,r=e.$el,o=e.el,i=[].slice.call(o.attributes).map(function(t){return t.name});r.removeAttr(i.join(" ")),r.attr(Lc(Lc({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||"").trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(Ot);var Nc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ic=function(e){function n(n){var r=e.call(this,n,"Modal",Ec)||this;return r.model=new jc(r),r.model.on("change:open",function(t,e){n.trigger("modal:".concat(e?"open":"close"))}),r.model.on("change",(0,t.debounce)(function(){var e=r._evData(),o=r.config.custom;(0,t.isFunction)(o)&&o(e),n.trigger("modal",e)},0)),r}return Nc(n,e),n.prototype._evData=function(){var e=this,n=this.getTitle(),r=this.getContent(),o=this.model.attributes;return{open:o.open,attributes:o.attributes,title:(0,t.isString)(n)?(0,Tt.rw)(n):n,content:(0,t.isString)(r)?(0,Tt.rw)(r):r.get?r.get(0):r,close:function(){e.close()}}},n.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},n.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set("attributes",e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},n.prototype.close=function(){return this.model.close(),this},n.prototype.onceClose=function(t){return this.em.once("modal:close",t),this},n.prototype.onceOpen=function(t){return this.em.once("modal:open",t),this},n.prototype.isOpen=function(){return!!this.model.get("open")},n.prototype.setTitle=function(t){return this.model.set("title",t),this},n.prototype.getTitle=function(){return this.model.get("title")},n.prototype.setContent=function(t){return this.model.set("content"," "),this.model.set("content",t),this},n.prototype.getContent=function(){return this.model.get("content")},n.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},n.prototype.getModel=function(){return this.model},n.prototype.render=function(){var t;if(!this.config.custom){var e=Dc.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},n.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},n}(m);var Fc="sw-visibility",Vc="export-template",Rc="open-sm",Hc="open-tm",zc="open-layers",Bc="open-blocks",Uc="fullscreen",Wc="preview";const $c={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:Fc,className:"fa fa-square-o",command:"core:component-outline",context:Fc,attributes:{title:"View components"}},{id:Wc,className:"fa fa-eye",command:Wc,context:Wc,attributes:{title:"Preview"}},{id:Uc,className:"fa fa-arrows-alt",command:Uc,context:Uc,attributes:{title:"Fullscreen"}},{id:Vc,className:"fa fa-code",command:Vc,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:Rc,className:"fa fa-paint-brush",command:Rc,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:Hc,className:"fa fa-cog",command:Hc,togglable:!1,attributes:{title:"Settings"}},{id:zc,className:"fa fa-bars",command:zc,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:Bc,className:"fa fa-th-large",command:Bc,togglable:!1,attributes:{title:"Open Blocks"}}]}]};var qc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Gc=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get("buttons").length&&r.set("buttons",new Xc(r.module,r.get("buttons"))),r}return qc(e,t),e.prototype.defaults=function(){return{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get("className")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get("command")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get("active")},set:function(t){this.set("active",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get("togglable")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get("runDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get("stopDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get("disable")},enumerable:!1,configurable:!0}),e}(x);var Kc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yc=function(t){function e(e,n){return t.call(this,e,n,Gc)||this}return Kc(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach(function(n){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},e.prototype.deactivateAll=function(t,e){var n=t||"";this.forEach(function(t){t.get("context")==n&&t!==e&&t.set("active",!1,{fromCollection:!0})})},e.prototype.disableAllButtons=function(t){var e=t||"";this.forEach(function(t){t.get("context")==e&&t.set("disable",!0)})},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach(function(n){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})},e}(S);const Xc=Yc;Yc.prototype.model=Gc;var Jc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Zc=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.get("buttons")||[];return r.buttons=new Xc(e,o),r}return Jc(e,t),e.prototype.defaults=function(){return{id:"",content:"",visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get("buttons")},set:function(t){this.set("buttons",t)},enumerable:!1,configurable:!0}),e}(x);var Qc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tu=function(t){function e(e,n){return t.call(this,e,n,Zc)||this}return Qc(e,t),e}(S);const eu=tu;tu.prototype.model=Zc;var nu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ru=function(){return ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
','
\n
\n \n '],['\n
\n
','
\n
\n
\n '])),e,e,r,e,o,e)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t=this,e=t.model,n=t.pfx,r=t.$el,o=e.toJSON();return o.pfx=n,r.html(this.template(o)),r.attr("class","".concat(n,"editor-c")),r.find("#".concat(n,"code")).append(e.get("input")),this},e}(u.G7);var Mu,Lu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Du=function(e){function n(t){var n=e.call(this,t,"CodeManager",vu)||this;n.EditorView=ju;var r=n.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),n.generators={},n.viewers={},n.defGenerators={html:new mu,css:new xo,json:new _u,js:new Su},n.defViewers={CodeMirror:new Eu},n.loadDefaultGenerators().loadDefaultViewers(),n}return Lu(n,e),n.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},n.prototype.getGenerator=function(t){return this.generators[t]},n.prototype.getGenerators=function(){return this.generators},n.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},n.prototype.getViewer=function(t){return this.viewers[t]},n.prototype.getViewers=function(){return this.viewers},n.prototype.createViewer=function(e){void 0===e&&(e={});var n=(0,t.isUndefined)(e.type)?"CodeMirror":e.type,r=this.getViewer(n)&&this.getViewer(n).clone(),o=document.createElement("div"),i=document.createElement("textarea");return o.appendChild(i),r.set(e),r.init(i),r.setElement(o),r},n.prototype.updateViewer=function(t,e){t.setContent(e)},n.prototype.getCode=function(t,e,n){void 0===n&&(n={}),n.em=this.em;var r=this.getGenerator(e);return r?r.build(t,n):""},n.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},n.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},n.prototype.destroy=function(){},n}(m);const Nu=Du;var Iu=r(410),Fu=r.n(Iu);const Vu={maximumStackLength:500,trackSelection:!0};var Ru=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hu=function(){return Hu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0}))return!1;if((0,t.isBoolean)(n))return!0;if((0,t.isArray)(n)&&Uu(e).some(function(t){return n.indexOf(t)>=0}))return!0}return!1},on:function(e,n,r){var i=this;!this.beforeCache&&(this.beforeCache=e.previousAttributes());var a=r||n||{};if(a.noUndo&&setTimeout(function(){i.beforeCache=null}),!Bu(a)){var s=e.toJSON({fromUndo:o}),l={object:e,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,t.isEmpty)(s))return l}}}),r.um.changeUndoType("add",{on:function(t,e,n){if(void 0===n&&(n={}),!Bu(n)&&r.isRegistered(e))return{object:e,before:void 0,after:t,options:Hu(Hu({},n),{fromUndo:o})}}}),r.um.changeUndoType("remove",{on:function(t,e,n){if(void 0===n&&(n={}),!Bu(n)&&r.isRegistered(e))return{object:e,before:t,after:void 0,options:Hu(Hu({},n),{fromUndo:o})}}}),r.um.changeUndoType("reset",{undo:function(t,e){t.reset(e,{fromUndo:o})},redo:function(t,e,n){t.reset(n,{fromUndo:o})},on:function(t,e){if(void 0===e&&(e={}),!Bu(e)&&r.isRegistered(t))return{object:t,before:e.previousModels,after:zu([],t.models,!0),options:Hu(Hu({},e),{fromUndo:o})}}}),r.um.on("undo redo",function(){n.trigger("change:canvasOffset"),n.getSelectedAll().map(function(t){return t.trigger("rerender:layer")})}),["undo","redo"].forEach(function(t){return r.um.on(t,function(){return n.trigger(t)})}),r}return Ru(n,e),n.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get("selected"))},n.prototype.add=function(t){return this.um.register(t),this},n.prototype.remove=function(t){return this.um.unregister(t),this},n.prototype.removeAll=function(){return this.um.unregisterAll(),this},n.prototype.start=function(){return this.um.startTracking(),this},n.prototype.stop=function(){return this.um.stopTracking(),this},n.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},n.prototype.undoAll=function(){return this.um.undoAll(),this},n.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},n.prototype.redoAll=function(){return this.um.redoAll(),this},n.prototype.hasUndo=function(){return!!this.um.isAvailable("undo")},n.prototype.hasRedo=function(){return!!this.um.isAvailable("redo")},n.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},n.prototype.getStack=function(){return this.um.stack},n.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach(function(n){var r=n.get("magicFusionIndex");e.indexOf(r)<0&&(e.push(r),t.push(n))}),t},n.prototype.skip=function(t){this.stop(),t(),this.start()},n.prototype.getGroupedStack=function(){var e={};return this.getStack().forEach(function(t,n){var r,o,i,a,s,l,c,u=t.get("magicFusionIndex"),p=(r=n,o=t.attributes,i=o.type,a=o.after,s=o.before,l=o.object,c=o.options,{index:r,type:i,after:a,before:s,object:l,options:void 0===c?{}:c});e[u]?e[u].push(p):e[u]=[p]}),Object.keys(e).map(function(n){var r=e[n];return{index:r[r.length-1].index,actions:r,labels:(0,t.unique)(r.reduce(function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t},[]))}})},n.prototype.goToGroup=function(e){var n=this;if(e){var r=this.getPointer(),o=e.index-r;(0,t.times)(Math.abs(o),function(){n[o<0?"undo":"redo"](!1)})}},n.prototype.getPointer=function(){return this.getStack().pointer},n.prototype.clear=function(){return this.um.clear(),this},n.prototype.getInstance=function(){return this.um},n.prototype.destroy=function(){this.clear().removeAll()},n}(m);const $u=Wu,qu={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1};var Gu,Ku=function(){return Ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;nB",attributes:{title:"Bold"},result:function(t){return t.exec("bold")}},italic:{name:"italic",icon:"I",attributes:{title:"Italic"},result:function(t){return t.exec("italic")}},underline:{name:"underline",icon:"U",attributes:{title:"Underline"},result:function(t){return t.exec("underline")}},strikethrough:{name:"strikethrough",icon:"S",attributes:{title:"Strike-through"},result:function(t){return t.exec("strikeThrough")}},link:{icon:'\n \n ',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(t){return t&&t.selection()&&Xu(t)?1:0},result:function(t){Xu(t)?t.exec("unlink"):t.insertHTML('").concat(t.selection(),""),{select:!0})}},wrap:{name:"wrap",icon:'\n \n ',attributes:{title:"Wrap for style"},state:function(t){return(null==t?void 0:t.selection())&&Xu(t,"SPAN")?-1:0},result:function(t){!Xu(t,"SPAN")&&t.insertHTML("").concat(t.selection(),""),{select:!0})}}},Qu=function(){function n(e,n,r){void 0===r&&(r={});var o=this;if(this.em=e,this.settings=r,n[Yu])return n[Yu];n[Yu]=this,this.setEl(n),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var i=(r.actions||[]).map(function(e){var n=e;return(0,t.isString)(e)?n=Ku({},Zu[e]):Zu[e.name]&&(n=Ku(Ku({},Zu[e.name]),e)),n}),a=i.length?i:Object.keys(Zu).map(function(t){return Zu[t]});r.classes=Ku({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},r.classes);var s=r.classes,l=r.actionbar;if(this.actionbar=l,this.classes=s,this.actions=a,!l){if(!this.isCustom(r.module)){var c=r.actionbarContainer;(l=document.createElement("div")).className=s.actionbar,null==c||c.appendChild(l),this.actionbar=l}a.forEach(function(t){return o.addAction(t)})}return r.styleWithCSS&&this.exec("styleWithCSS"),this}return n.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!(!(null==e?void 0:e.config.custom)&&!(null==e?void 0:e.customRte))},n.prototype.destroy=function(){},n.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},n.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach(function(e){var n=e.update,r=e.btn,o=t.classes,i=o.active,a=o.inactive,s=o.disabled,l=e.state,c=e.name,u=t.doc,p=Gu.INACTIVE;if(r&&(r.className=r.className.replace(i,"").trim(),r.className=r.className.replace(a,"").trim(),r.className=r.className.replace(s,"").trim()),l){var f=l(t,u);if(p=f,r)switch(f){case 1:r.className+=" ".concat(i);break;case 0:r.className+=" ".concat(a);break;case-1:r.className+=" ".concat(s)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(r&&(r.className+=" ".concat(i)),p=Gu.ACTIVE);e.currentState=p,null==n||n(t,e)}),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},n.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},n.prototype.disable=function(){return this.__toggleEffects(!1)},n.prototype.__toggleEffects=function(t,n){void 0===t&&(t=!1),void 0===n&&(n={});var r=t?e.on:e.off,o=this.el,i=this.doc,a=this.actionbarEl();if(a&&(a.style.display=t?"":"none"),o.contentEditable="".concat(!!t),r(o,"mouseup keyup",this.updateActiveActions),r(i,"keydown",this.__onKeydown),r(i,"paste",this.__onPaste),this.enabled=t,t){var s=n.event;if(this.syncActions(),this.updateActiveActions(),s){var l=null;if(i.caretRangeFromPoint){var c=(0,e.getPointerEvent)(s);l=i.caretRangeFromPoint(c.clientX,c.clientY)}else s.rangeParent&&(l=i.createRange()).setStart(s.rangeParent,s.rangeOffset);var u=i.getSelection();null==u||u.removeAllRanges(),l&&(null==u||u.addRange(l))}o.focus()}return this},n.prototype.__onKeydown=function(t){var e=t,n=this.doc;"Enter"!==e.key||["insertOrderedList","insertUnorderedList"].some(function(t){return n.queryCommandState(t)})||(n.execCommand("insertLineBreak"),e.preventDefault())},n.prototype.__onPaste=function(t){var e=t.clipboardData||window.clipboardData,n=e.getData("text"),r=e.getData("text/html");if(n&&!r){t.preventDefault();var o=n.replace(/(?:\r\n|\r|\n)/g,"
");this.doc.execCommand("insertHTML",!1,o)}},n.prototype.syncActions=function(){var t=this;this.getActions().forEach(function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||"click",r=e.btn;r&&(r["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}})},n.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,r=this.actionbarEl();if(r){var o=t.icon,i=t.attributes,a=void 0===i?{}:i,s=document.createElement("span");for(var l in s.className=this.classes.button,t.btn=s,a)s.setAttribute(l,a[l]);"string"==typeof o?s.innerHTML=o:s.appendChild(o),r.appendChild(s)}n&&(this.actions.push(t),this.syncActions())},n.prototype.getActions=function(){return this.actions},n.prototype.selection=function(){return this.doc.getSelection()},n.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},n.prototype.actionbarEl=function(){return this.actionbar},n.prototype.insertHTML=function(n,r){var o=(void 0===r?{}:r).select,i=this,a=i.em,s=i.doc,l=i.el,c=s.getSelection();if(c&&c.rangeCount){var u=(0,e.getModel)(l),p=s.createElement("div"),f=c.getRangeAt(0);f.deleteContents(),(0,t.isString)(n)?p.innerHTML=n:n&&p.appendChild(n),Array.prototype.slice.call(p.childNodes).forEach(function(t){f.insertNode(t)}),c.removeAllRanges(),c.addRange(f),l.focus(),o&&u&&(u.once("rte:disable",function(){var t=u.find("[".concat(Ju,"]"))[0];t&&(a.setSelected(t),t.removeAttributes(Ju))}),u.trigger("disable"))}},n}();const tp=Qu;var ep=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),np=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{l(r.next(t))}catch(e){i(e)}}function s(t){try{l(r.throw(t))}catch(e){i(e)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},rp=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=0})),g=this.get("onChange"),v={property:this,from:p,to:u,value:l,opts:n};i.__trgEv(i.events.propertyUpdate,v),g&&g(v),h&&this.__upTargetsStyle(((r={})[a]=l,r),n)},r.prototype.__upTargetsStyle=function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get("StyleManager");null==r||r.addStyleTargets(mp(mp({},t),{__p:!!e.avoidStore}),e)},r.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o=0&&i.push(l),r.value=String.prototype.substring.apply(a,i),n.numeric){var u=parseFloat(r.value);r.unit=r.value.replace(u,""),r.value=u}return r},r.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},r.prototype.getFullValue=function(e,n){void 0===n&&(n={});var r=this.get("functionName"),o=this.getDefaultValue(),i=(0,t.isUndefined)(e)?this.get("value"):e,a=!(0,t.isUndefined)(i)&&""!==i;if(i&&o&&i===o)return o;if(r&&a){var s="url"===r?"'".concat(i.replace(/'|"/g,""),"'"):i;i="".concat(r,"(").concat(s,")")}return a&&this.get("important")&&!n.skipImportant&&(i="".concat(i," !important")),i||""},r.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},r.prototype.getParentTarget=function(){return this.get("parentTarget")||null},r.prototype.__parseFn=function(t){void 0===t&&(t="");var e=t.indexOf("(")+1,n=t.lastIndexOf(")");return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}},r.prototype.__checkVisibility=function(n){var r=n.target,o=n.component,i=n.sectors,a=o||r;if(!a)return!1;var s=this.getId(),l=this.getName(),c=this.get("toRequire"),u=this.get("requires"),p=this.get("requiresParent"),f=a.get("unstylable"),d=a.get("stylable-require"),h=a.get("stylable");if((0,t.isArray)(h)&&(h=h.indexOf(l)>=0),(0,t.isArray)(f)&&(h=f.indexOf(l)<0),c&&(h=!r||d&&(d.indexOf(s)>=0||d.indexOf(l)>=0)),i&&u){var g=(0,t.keys)(u);i.forEach(function(e){e.getProperties().forEach(function(e){if((0,t.includes)(g,e.id)){var n=u[e.id];h=h&&(0,t.includes)(n,e.get("value"))}})})}if(p){var v=o&&o.parent(),y=v&&v.getEl();if(y){var m=(0,e.hasWin)()?window.getComputedStyle(y):{};(0,t.each)(p,function(e,n){h=h&&m[n]&&(0,t.includes)(e,m[n])})}else h=!1}return!!h},r}(u.Hn);const _p=wp;wp.callParentInit=function(t,e,n,r){void 0===r&&(r={}),t.prototype.initialize.apply(e,[n,mp(mp({},r),{skipInit:1})])},wp.callInit=function(t,e,n){void 0===n&&(n={}),!n.skipInit&&t.init(e,n)};var xp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cp=function(){return Cp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0?t:void 0},r.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},r.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},r.prototype.moveLayer=function(e,n){void 0===n&&(n=0);var r=e?e.getIndex():-1;r>=0&&(0,t.isNumber)(n)&&n>=0&&n0&&!e},r.prototype.clear=function(t){return void 0===t&&(t={}),this.__getLayers().reset(),this.__upTargetsStyleProps(t),_p.prototype.clear.call(this),this},r.prototype.__canClearProp=function(){return!1},r}(kp);const Hp=Rp;var zp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bp=function(){return Bp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ')},r.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,r=t.parent,o=t.attributes,i=o.icon,a=void 0===i?"":i,s=o.info,l=void 0===s?"":s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||"";return'\n \n ').concat(t.getLabel(),"\n \n ").concat(r?"":'"),"\n ")},r.prototype.templateInput=function(t){return'\n
\n \n
\n ')},r.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach(function(e){return t[e]=null}),this.__destroyFn(this._getClbOpts()),this},r.prototype.updateStatus=function(){var t,e=this,n=e.model,r=e.pfx,o=e.ppfx,i=e.config,a="".concat(o,"four-color"),s="".concat(o,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(a," ").concat(s)),u.display="none",n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(a),i.clearProperties&&(u.display="")):n.hasValue()&&i.highlightComputed&&l.addClass(s),null===(t=this.parent)||void 0===t||t.updateStatus()},r.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},r.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(Up,"]"))),this.clearEl},r.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},r.prototype.onValueChange=function(){this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},r.prototype.setValue=function(e){var n=this.model,r=(0,t.isUndefined)(e)||""===e?n.getDefaultValue():e;if(this.update)return this.__update(r);this.__setValueInput(r)},r.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},r.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector("input")),this.input},r.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},r.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},r.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},r.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(Bp(Bp({},this._getClbOpts()),{value:t}))},r.prototype.__change=function(){for(var t=[],e=0;e\n \n \n ')},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),$p.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get("properties");if(n.length&&!this.props){var r=e.isDetached(),o=new Kp({config:Xp(Xp({},this.config),{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});o.render(),this.$el.find("#".concat(t,"input-holder")).append(o.el),this.props=o}},e.prototype.clearCached=function(){$p.prototype.clearCached.apply(this,arguments),delete this.props},e}($p);var Zp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Zp(n,e),n.prototype.events=function(){return{click:"select","click [data-close-layer]":"removeItem","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"}},n.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.em,o=null==r?void 0:r.getConfig().icons,i=(null==o?void 0:o.close)||"",a=(null==o?void 0:o.move)||"";return'\n
\n
\n ').concat(a,'\n
\n
\n \n
\n ').concat(i,'\n
\n
\n
\n ')},n.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.propertyView=t.propertyView;var r=this.propertyView.model;this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:values",this.updateLabel),this.listenTo(r,"change:selectedLayer",this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},n.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},n.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},n.prototype.select=function(){this.model.select()},n.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},n.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},n.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector("[data-label]")),this.labelEl},n.prototype.updateLabel=function(){var e=this.model,n=e.getLabel();if(this.getLabelEl().innerHTML=n,e.hasPreview()){var r=this.getPreviewEl(),o=e.getStylePreview({number:{min:-3,max:3}}),i=(0,t.keys)(o).map(function(t){return"".concat(t,":").concat(o[t])}).join(";");r.setAttribute("style",i)}},n.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,r=e.model,o=e.propertyView,i=this.getPropertiesWrapper(),a=r.isSelected();i.style.display=a?"":"none",this.$el[a?"addClass":"removeClass"]("".concat(n,"active")),a&&i.appendChild(null===(t=o.props)||void 0===t?void 0:t.el)},n.prototype.render=function(){var t=this,e=t.el,n=t.pfx,r=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),r.hasPreview()&&(e.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},n}(u.G7);const tf=Qp;var ef=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nf=function(t){function e(e){var n=t.call(this,e)||this,r=n.collection,o=e.config||{},i=o.em,a=o.stylePrefix||"",s=o.pStylePrefix||"";n.config=o,n.pfx=a,n.ppfx=s,n.propertyView=e.propertyView,n.className="".concat(a,"layers ").concat(s,"field"),n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(a,"layers"),itemSel:".".concat(a,"layer"),pfx:o.pStylePrefix}):"",r.view=n,n.$el.data("model",r),n.$el.data("collection",r),n}return ef(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=e||null,o=this,i=o.propertyView,a=o.config,s=o.sorter,l=o.$el,c=new tf({model:t,config:a,sorter:s,propertyView:i}),u=c.render().el;if(this.items.push(c),r)r.appendChild(u);else if(void 0!==n){var p="before";l.children().length===n&&(n--,p="after"),n<0?l.append(u):l.children().eq(n)[p](u)}else l.append(u);return u},e.prototype.reset=function(){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),u.G7.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach(function(t){return t.remove()}),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach(function(e){return t.addToCollection(e,r)}),e.append(r),e.attr("class",this.className),n&&(n.plh=null),this},e}(u.G7);const rf=nf;var of=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),af=function(){return af=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n
\n \n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.__getLayers(),"change reset",this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),Jp.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){Jp.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,r=t.config,o=e.get("properties");if(o.length&&!this.props){var i=new Kp({config:af(af({},r),{highlightComputed:!1,highlightChanged:!1}),collection:o,parent:this});i.render();var a=new rf({collection:e.__getLayers(),config:r,propertyView:this});a.render(),n.querySelector("[data-layers-wrapper]").appendChild(a.el),this.props=i,this.layersView=a}},e}(Jp);const lf=sf;var cf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uf=function(){return uf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n
\n \n
\n
\n
\n
\n
\n
').concat(o,"
\n
\n \n ")},n.prototype.__setValueInput=function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),o=n.querySelector("[data-preview-box]"),i=n.querySelector("[data-preview]");o.style.display=t&&t!==r?"":"none",i.style.backgroundImage=t||e.getDefaultValue()},n.prototype.openAssetManager=function(){var e,n=this,r=null===(e=this.em)||void 0===e?void 0:e.Assets;null==r||r.open({select:function(e,o){var i=(0,t.isString)(e)?e:e.get("src");n.model.upValue(i,{partial:!o}),o&&r.close()},types:["image"],accept:"image/*"})},n}($p);var ff=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const df=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ff(e,t),e.prototype.templateInput=function(){return""},e.prototype.init=function(){var t=this.model;this.listenTo(t,"change:unit",this.onValueChange),this.listenTo(t,"change:units",this.render)},e.prototype.setValue=function(){},e.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,r=t.el;if(!this.inputInst){var o=n.input;o.ppfx=e,o.render(),r.querySelector(".".concat(e,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}},e.prototype.clearCached=function(){$p.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}($p);var hf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const gf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hf(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;df.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),["inputInst","$color"].forEach(function(e){return t[e]=null}),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,r=e.model,o=e.em,i=e.el,a=new fs({target:o,model:r,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(a.el),this.input=null===(t=a.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=a}},e}(df);var vf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yf=function(){return yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n
\n
\n
\n \n ')},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var r=[];n.forEach(function(t){var n=e.getOptionId(t),o=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,"""):"",a=i?'style="'.concat(i,'"'):"",s=n.replace(/"/g,""");r.push('"))});var o=this.el.querySelector("#".concat(t,"input-holder"));o.innerHTML=""),this.input=o.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],o=r?e.getOptionId(r):"";n&&(n.value=t||o)},e}($p);var xf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cf=function(){return Cf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n')},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),o=n.getName(),i=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(o),s=n.cid;if(!this.input){var l=[];i.forEach(function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(r):"",u=n.getOptionId(i),p="".concat(o,"-").concat(u,"-").concat(s),f=c?"":n.getOptionLabel(u),d=i.title?'title="'.concat(i.title,'"'):"",h=n.getValue()===u?"checked":"";l.push('\n
\n \n \n
\n "))});var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML='
').concat(l.join(""),"
"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,r=t||n.getDefaultValue(),o=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector('[value="'.concat(r,'"]'));o&&(o.checked=!0)},e}(_f);var kf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(){return Pf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n \n ')},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=""===t?e.getDefaultValue():parseFloat(n.value),df.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){df.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},e.prototype.clearCached=function(){df.prototype.clearCached.apply(this,arguments),delete this.slider},e}(df),If=u.FE.extend(ul).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get("StyleManager"));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:"stack",model:Hp,view:lf,isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:kp,view:Jp,isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:_p,view:pf,isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:_p,view:gf,isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:bf,view:_f,isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:Sf,view:Tf,isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:Mf,view:Nf,isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:Ef,view:df,isType:function(t){if(t&&"integer"==t.type)return t}},{id:"number",model:Ef,view:df,isType:function(t){if(t&&"number"==t.type)return t}},{id:"base",model:_p,view:$p,isType:function(t){return t.type="base",t}}]});var Ff=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vf=function(){return Vf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
$','
\n
',"
\n \n "],['\n
\n
$','
\n
',"
\n
\n "])),s,s,a,s,o)},e.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o=n.isOpen();e[o?"addClass":"removeClass"]("".concat(r,"open")),this.getPropertiesEl().style.display=o?"":"none"},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get("open"))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get("properties");if(n){var r=new Kp({collection:n,config:e});this.$el.append(r.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,r=t.$el,o=n.getId(),i=n.getName();return r.html(this.template({pfx:e,label:i})),this.renderProperties(),r.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(o," no-select")),this.updateOpen(),this},e}(u.G7);const Xf=Yf;var Jf,Zf=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qf=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.module,o=e.config,i=n.collection;return n.pfx=(null==o?void 0:o.stylePrefix)||"",n.ppfx=(null==o?void 0:o.pStylePrefix)||"",n.config=o,n.module=r,n.listenTo(i,"add",n.addTo),n.listenTo(i,"reset",n.render),n}return Zf(e,t),e.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),["config","module","em"].forEach(function(e){return t[e]={}}),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var r=this.config,o=this.el,i=e||o,a=new Xf({model:t,config:r}).render().el;return(0,Tt.$Q)(i,a,n.at),a},e.prototype.render=function(){var t=this,e=this,n=e.$el,r=e.pfx,o=e.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each(function(e){return t.addToCollection(e,i)}),n.append(i),n.addClass("".concat(r,"sectors ").concat(o,"one-bg ").concat(o,"two-color")),this},e}(u.G7);const td=Qf;var ed=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nd=function(){return nd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.getStepsBeforeSave()&&this.store().catch(function(e){return t.logError(e)})},r.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},r.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},r.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set("Editor",t)},r.prototype.getEditor=function(){return this.get("Editor")},r.prototype.handleUpdates=function(t,e,n){var r=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get("ready")||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout(function(){var t=r.getDirtyCount()||0,e=(n.unset,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);og&&(d=(0,t.isUndefined)(d)?r:Math.min(d,r)))}),!(0,t.isUndefined)(c))for(;c!==g;)o.addSelected(h.at(c)),c++;if(!(0,t.isUndefined)(d))for(;d!==g;)o.addSelected(h.at(d)),d--;return o.addSelected(i)}!f&&o.removeSelected(u.filter(function(t){return t!==i})),o.addSelected(i,r)})},r.prototype.addSelected=function(n,r){var o=this;void 0===r&&(r={});var i=(0,e.getModel)(n,c.default);((0,t.isArray)(i)?i:[i]).forEach(function(e){var n=o.selected;e&&e.get("selectable")&&!e.parents().some(function(t){return n.hasComponent(t)})&&(r.forceChange&&o.removeSelected(e,r),n.allComponents().filter(function(n){return(0,t.contains)(n.parents(),e)}).forEach(function(t){return o.removeSelected(t,r)}),n.addComponent(e,r),e&&o.trigger("component:select",e,r))})},r.prototype.removeSelected=function(t,n){void 0===n&&(n={}),this.selected.removeComponent((0,e.getModel)(t,c.default),n)},r.prototype.toggleSelected=function(n,r){var o=this;void 0===r&&(r={});var i=(0,e.getModel)(n,c.default);((0,t.isArray)(i)?i:[i]).forEach(function(t){o.selected.hasComponent(t)?o.removeSelected(t,r):o.addSelected(t,r)})},r.prototype.setHovered=function(t,n){if(void 0===n&&(n={}),!t)return this.set("componentHovered","");var r="component:hover",o=(0,e.getModel)(t,void 0);if(o){if(n.forceChange&&this.set("componentHovered",""),this.trigger("".concat(r,":before"),o,n),!o.get("hoverable")){if(!n.useValid||n.abort)return;for(var i=o&&o.parent();i&&!i.get("hoverable");)i=i.parent();o=i}n.abort||(this.set("componentHovered",o,n),this.trigger(r,o,n))}},r.prototype.getHovered=function(){return this.get("componentHovered")},r.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.get("DomComponents").setComponents(t,e)},r.prototype.getComponents=function(){var t=this.get("DomComponents"),e=this.get("CodeManager");if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},r.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.get("CssComposer");return n.clear(e),n.getAll().add(t,e),this},r.prototype.addStyle=function(e,n){void 0===n&&(n={});var r=this.getStyle().add(e,n);return(0,t.isArray)(r)?r:[r]},r.prototype.getStyle=function(){return this.Css.getAll()},r.prototype.setState=function(t){return this.set("state",t),this},r.prototype.getState=function(){return this.get("state")||""},r.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,r=e.jsInHtml?this.getJs(t):"",o=t.component||this.get("DomComponents").getComponent();return(o?this.get("CodeManager").getCode(o,"html",xd(xd({},n),t)):"")+(r?"