text: /*! grapesjs - 0.18.1 */
  !function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs"]=e():t["grapesjs"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&'object'==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:t}),2&e&&'string'!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t['default']}:function(){return t};return n.d(e,'a',e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=99)}([function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return kn})),n.d(e,"VERSION",(function(){return i["e"]})),n.d(e,"restArguments",(function(){return o})),n.d(e,"isObject",(function(){return a})),n.d(e,"isNull",(function(){return s})),n.d(e,"isUndefined",(function(){return c})),n.d(e,"isBoolean",(function(){return l})),n.d(e,"isElement",(function(){return u})),n.d(e,"isString",(function(){return h})),n.d(e,"isNumber",(function(){return d})),n.d(e,"isDate",(function(){return p})),n.d(e,"isRegExp",(function(){return g})),n.d(e,"isError",(function(){return v})),n.d(e,"isSymbol",(function(){return m})),n.d(e,"isArrayBuffer",(function(){return y})),n.d(e,"isDataView",(function(){return j})),n.d(e,"isArray",(function(){return P})),n.d(e,"isFunction",(function(){return O})),n.d(e,"isArguments",(function(){return E})),n.d(e,"isFinite",(function(){return D})),n.d(e,"isNaN",(function(){return M})),n.d(e,"isTypedArray",(function(){return V})),n.d(e,"isEmpty",(function(){return U})),n.d(e,"isMatch",(function(){return W})),n.d(e,"isEqual",(function(){return Y})),n.d(e,"isMap",(function(){return ot})),n.d(e,"isWeakMap",(function(){return at})),n.d(e,"isSet",(function(){return st})),n.d(e,"isWeakSet",(function(){return ct})),n.d(e,"keys",(function(){return H})),n.d(e,"allKeys",(function(){return X})),n.d(e,"values",(function(){return lt})),n.d(e,"pairs",(function(){return ut})),n.d(e,"invert",(function(){return ft})),n.d(e,"functions",(function(){return ht})),n.d(e,"methods",(function(){return ht})),n.d(e,"extend",(function(){return pt})),n.d(e,"extendOwn",(function(){return gt})),n.d(e,"assign",(function(){return gt})),n.d(e,"defaults",(function(){return vt})),n.d(e,"create",(function(){return yt})),n.d(e,"clone",(function(){return bt})),n.d(e,"tap",(function(){return wt})),n.d(e,"get",(function(){return kt})),n.d(e,"has",(function(){return St})),n.d(e,"mapObject",(function(){return At})),n.d(e,"identity",(function(){return jt})),n.d(e,"constant",(function(){return A})),n.d(e,"noop",(function(){return Lt})),n.d(e,"toPath",(function(){return Ot})),n.d(e,"property",(function(){return _t})),n.d(e,"propertyOf",(function(){return Rt})),n.d(e,"matcher",(function(){return Pt})),n.d(e,"matches",(function(){return Pt})),n.d(e,"times",(function(){return Nt})),n.d(e,"random",(function(){return It})),n.d(e,"now",(function(){return Ft})),n.d(e,"escape",(function(){return zt})),n.d(e,"unescape",(function(){return Ht})),n.d(e,"templateSettings",(function(){return Ut})),n.d(e,"template",(function(){return Yt})),n.d(e,"result",(function(){return Xt})),n.d(e,"uniqueId",(function(){return Zt})),n.d(e,"chain",(function(){return Qt})),n.d(e,"iteratee",(function(){return Dt})),n.d(e,"partial",(function(){return ne})),n.d(e,"bind",(function(){return re})),n.d(e,"bindAll",(function(){return ae})),n.d(e,"memoize",(function(){return se})),n.d(e,"delay",(function(){return ce})),n.d(e,"defer",(function(){return le})),n.d(e,"throttle",(function(){return ue})),n.d(e,"debounce",(function(){return fe})),n.d(e,"wrap",(function(){return he})),n.d(e,"negate",(function(){return de})),n.d(e,"compose",(function(){return pe})),n.d(e,"after",(function(){return ge})),n.d(e,"before",(function(){return ve})),n.d(e,"once",(function(){return me})),n.d(e,"findKey",(function(){return ye})),n.d(e,"findIndex",(function(){return we})),n.d(e,"findLastIndex",(function(){return Oe})),n.d(e,"sortedIndex",(function(){return xe})),n.d(e,"indexOf",(function(){return ke})),n.d(e,"lastIndexOf",(function(){return Se})),n.d(e,"find",(function(){return je})),n.d(e,"detect",(function(){return je})),n.d(e,"findWhere",(function(){return Pe})),n.d(e,"each",(function(){return _e})),n.d(e,"forEach",(function(){return _e})),n.d(e,"map",(function(){return Te})),n.d(e,"collect",(function(){return Te})),n.d(e,"reduce",(function(){return De})),n.d(e,"foldl",(function(){return De})),n.d(e,"inject",(function(){return De})),n.d(e,"reduceRight",(function(){return Me})),n.d(e,"foldr",(function(){return Me})),n.d(e,"filter",(function(){return Ae})),n.d(e,"select",(function(){return Ae})),n.d(e,"reject",(function(){return Le})),n.d(e,"every",(function(){return Re})),n.d(e,"all",(function(){return Re})),n.d(e,"some",(function(){return Ne})),n.d(e,"any",(function(){return Ne})),n.d(e,"contains",(function(){return Ie})),n.d(e,"includes",(function(){return Ie})),n.d(e,"include",(function(){return Ie})),n.d(e,"invoke",(function(){return Fe})),n.d(e,"pluck",(function(){return Ve})),n.d(e,"where",(function(){return Be})),n.d(e,"max",(function(){return ze})),n.d(e,"min",(function(){return He})),n.d(e,"shuffle",(function(){return We})),n.d(e,"sample",(function(){return Ue})),n.d(e,"sortBy",(function(){return $e})),n.d(e,"groupBy",(function(){return Ge})),n.d(e,"indexBy",(function(){return Ke})),n.d(e,"countBy",(function(){return Ye})),n.d(e,"partition",(function(){return Xe})),n.d(e,"toArray",(function(){return Ze})),n.d(e,"size",(function(){return Qe})),n.d(e,"pick",(function(){return en})),n.d(e,"omit",(function(){return nn})),n.d(e,"first",(function(){return on})),n.d(e,"head",(function(){return on})),n.d(e,"take",(function(){return on})),n.d(e,"initial",(function(){return rn})),n.d(e,"last",(function(){return sn})),n.d(e,"rest",(function(){return an})),n.d(e,"tail",(function(){return an})),n.d(e,"drop",(function(){return an})),n.d(e,"compact",(function(){return cn})),n.d(e,"flatten",(function(){return ln})),n.d(e,"without",(function(){return fn})),n.d(e,"uniq",(function(){return hn})),n.d(e,"unique",(function(){return hn})),n.d(e,"union",(function(){return dn})),n.d(e,"intersection",(function(){return pn})),n.d(e,"difference",(function(){return un})),n.d(e,"unzip",(function(){return gn})),n.d(e,"transpose",(function(){return gn})),n.d(e,"zip",(function(){return vn})),n.d(e,"object",(function(){return mn})),n.d(e,"range",(function(){return yn})),n.d(e,"chunk",(function(){return bn})),n.d(e,"mixin",(function(){return On}));var r={};n.r(r),n.d(r,"VERSION",(function(){return i["e"]})),n.d(r,"restArguments",(function(){return o})),n.d(r,"isObject",(function(){return a})),n.d(r,"isNull",(function(){return s})),n.d(r,"isUndefined",(function(){return c})),n.d(r,"isBoolean",(function(){return l})),n.d(r,"isElement",(function(){return u})),n.d(r,"isString",(function(){return h})),n.d(r,"isNumber",(function(){return d})),n.d(r,"isDate",(function(){return p})),n.d(r,"isRegExp",(function(){return g})),n.d(r,"isError",(function(){return v})),n.d(r,"isSymbol",(function(){return m})),n.d(r,"isArrayBuffer",(function(){return y})),n.d(r,"isDataView",(function(){return j})),n.d(r,"isArray",(function(){return P})),n.d(r,"isFunction",(function(){return O})),n.d(r,"isArguments",(function(){return E})),n.d(r,"isFinite",(function(){return D})),n.d(r,"isNaN",(function(){return M})),n.d(r,"isTypedArray",(function(){return V})),n.d(r,"isEmpty",(function(){return U})),n.d(r,"isMatch",(function(){return W})),n.d(r,"isEqual",(function(){return Y})),n.d(r,"isMap",(function(){return ot})),n.d(r,"isWeakMap",(function(){return at})),n.d(r,"isSet",(function(){return st})),n.d(r,"isWeakSet",(function(){return ct})),n.d(r,"keys",(function(){return H})),n.d(r,"allKeys",(function(){return X})),n.d(r,"values",(function(){return lt})),n.d(r,"pairs",(function(){return ut})),n.d(r,"invert",(function(){return ft})),n.d(r,"functions",(function(){return ht})),n.d(r,"methods",(function(){return ht})),n.d(r,"extend",(function(){return pt})),n.d(r,"extendOwn",(function(){return gt})),n.d(r,"assign",(function(){return gt})),n.d(r,"defaults",(function(){return vt})),n.d(r,"create",(function(){return yt})),n.d(r,"clone",(function(){return bt})),n.d(r,"tap",(function(){return wt})),n.d(r,"get",(function(){return kt})),n.d(r,"has",(function(){return St})),n.d(r,"mapObject",(function(){return At})),n.d(r,"identity",(function(){return jt})),n.d(r,"constant",(function(){return A})),n.d(r,"noop",(function(){return Lt})),n.d(r,"toPath",(function(){return Ot})),n.d(r,"property",(function(){return _t})),n.d(r,"propertyOf",(function(){return Rt})),n.d(r,"matcher",(function(){return Pt})),n.d(r,"matches",(function(){return Pt})),n.d(r,"times",(function(){return Nt})),n.d(r,"random",(function(){return It})),n.d(r,"now",(function(){return Ft})),n.d(r,"escape",(function(){return zt})),n.d(r,"unescape",(function(){return Ht})),n.d(r,"templateSettings",(function(){return Ut})),n.d(r,"template",(function(){return Yt})),n.d(r,"result",(function(){return Xt})),n.d(r,"uniqueId",(function(){return Zt})),n.d(r,"chain",(function(){return Qt})),n.d(r,"iteratee",(function(){return Dt})),n.d(r,"partial",(function(){return ne})),n.d(r,"bind",(function(){return re})),n.d(r,"bindAll",(function(){return ae})),n.d(r,"memoize",(function(){return se})),n.d(r,"delay",(function(){return ce})),n.d(r,"defer",(function(){return le})),n.d(r,"throttle",(function(){return ue})),n.d(r,"debounce",(function(){return fe})),n.d(r,"wrap",(function(){return he})),n.d(r,"negate",(function(){return de})),n.d(r,"compose",(function(){return pe})),n.d(r,"after",(function(){return ge})),n.d(r,"before",(function(){return ve})),n.d(r,"once",(function(){return me})),n.d(r,"findKey",(function(){return ye})),n.d(r,"findIndex",(function(){return we})),n.d(r,"findLastIndex",(function(){return Oe})),n.d(r,"sortedIndex",(function(){return xe})),n.d(r,"indexOf",(function(){return ke})),n.d(r,"lastIndexOf",(function(){return Se})),n.d(r,"find",(function(){return je})),n.d(r,"detect",(function(){return je})),n.d(r,"findWhere",(function(){return Pe})),n.d(r,"each",(function(){return _e})),n.d(r,"forEach",(function(){return _e})),n.d(r,"map",(function(){return Te})),n.d(r,"collect",(function(){return Te})),n.d(r,"reduce",(function(){return De})),n.d(r,"foldl",(function(){return De})),n.d(r,"inject",(function(){return De})),n.d(r,"reduceRight",(function(){return Me})),n.d(r,"foldr",(function(){return Me})),n.d(r,"filter",(function(){return Ae})),n.d(r,"select",(function(){return Ae})),n.d(r,"reject",(function(){return Le})),n.d(r,"every",(function(){return Re})),n.d(r,"all",(function(){return Re})),n.d(r,"some",(function(){return Ne})),n.d(r,"any",(function(){return Ne})),n.d(r,"contains",(function(){return Ie})),n.d(r,"includes",(function(){return Ie})),n.d(r,"include",(function(){return Ie})),n.d(r,"invoke",(function(){return Fe})),n.d(r,"pluck",(function(){return Ve})),n.d(r,"where",(function(){return Be})),n.d(r,"max",(function(){return ze})),n.d(r,"min",(function(){return He})),n.d(r,"shuffle",(function(){return We})),n.d(r,"sample",(function(){return Ue})),n.d(r,"sortBy",(function(){return $e})),n.d(r,"groupBy",(function(){return Ge})),n.d(r,"indexBy",(function(){return Ke})),n.d(r,"countBy",(function(){return Ye})),n.d(r,"partition",(function(){return Xe})),n.d(r,"toArray",(function(){return Ze})),n.d(r,"size",(function(){return Qe})),n.d(r,"pick",(function(){return en})),n.d(r,"omit",(function(){return nn})),n.d(r,"first",(function(){return on})),n.d(r,"head",(function(){return on})),n.d(r,"take",(function(){return on})),n.d(r,"initial",(function(){return rn})),n.d(r,"last",(function(){return sn})),n.d(r,"rest",(function(){return an})),n.d(r,"tail",(function(){return an})),n.d(r,"drop",(function(){return an})),n.d(r,"compact",(function(){return cn})),n.d(r,"flatten",(function(){return ln})),n.d(r,"without",(function(){return fn})),n.d(r,"uniq",(function(){return hn})),n.d(r,"unique",(function(){return hn})),n.d(r,"union",(function(){return dn})),n.d(r,"intersection",(function(){return pn})),n.d(r,"difference",(function(){return un})),n.d(r,"unzip",(function(){return gn})),n.d(r,"transpose",(function(){return gn})),n.d(r,"zip",(function(){return vn})),n.d(r,"object",(function(){return mn})),n.d(r,"range",(function(){return yn})),n.d(r,"chunk",(function(){return bn})),n.d(r,"mixin",(function(){return On})),n.d(r,"default",(function(){return xn}));var i=n(9);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),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function a(t){var e=typeof t;return'function'===e||'object'===e&&!!t}function s(t){return null===t}function c(t){return void 0===t}function l(t){return!0===t||!1===t||'[object Boolean]'===i["t"].call(t)}function u(t){return!(!t||1!==t.nodeType)}function f(t){var e='[object '+t+']';return function(t){return i["t"].call(t)===e}}var h=f('String'),d=f('Number'),p=f('Date'),g=f('RegExp'),v=f('Error'),m=f('Symbol'),y=f('ArrayBuffer'),b=f('Function'),w=i["p"].document&&i["p"].document.childNodes;1&&'object'!=typeof Int8Array&&'function'!=typeof w&&(b=function(t){return'function'==typeof t||!1});var O=b,x=f('Object'),C=i["s"]&&x(new DataView(new ArrayBuffer(8))),k='undefined'!=typeof Map&&x(new Map),S=f('DataView');var j=C?function(t){return null!=t&&O(t.getInt8)&&y(t.buffer)}:S,P=i["k"]||f('Array');function _(t,e){return null!=t&&i["i"].call(t,e)}var T=f('Arguments');!function(){T(arguments)||(T=function(t){return _(t,'callee')})}();var E=T;function D(t){return!m(t)&&Object(i["f"])(t)&&!isNaN(parseFloat(t))}function M(t){return d(t)&&Object(i["g"])(t)}function A(t){return function(){return t}}function L(t){return function(e){var n=t(e);return'number'==typeof n&&n>=0&&n<=i["b"]}}function R(t){return function(e){return null==e?void 0:e[t]}}var N=R('byteLength'),I=L(N),F=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var V=i["r"]?function(t){return i["l"]?Object(i["l"])(t)&&!j(t):I(t)&&F.test(i["t"].call(t))}:A(!1),B=R('length');function z(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=i["n"].length,r=t.constructor,o=O(r)&&r.prototype||i["c"],a='constructor';for(_(t,a)&&!e.contains(a)&&e.push(a);n--;)(a=i["n"][n])in t&&t[a]!==o[a]&&!e.contains(a)&&e.push(a)}function H(t){if(!a(t))return[];if(i["m"])return Object(i["m"])(t);var e=[];for(var n in t)_(t,n)&&e.push(n);return i["h"]&&z(t,e),e}function U(t){if(null==t)return!0;var e=B(t);return'number'==typeof e&&(P(t)||h(t)||E(t))?0===e:0===B(H(t))}function W(t,e){var n=H(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function $(t){return t instanceof $?t:this instanceof $?void(this._wrapped=t):new $(t)}function q(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,N(t))}$.VERSION=i["e"],$.prototype.value=function(){return this._wrapped},$.prototype.valueOf=$.prototype.toJSON=$.prototype.value,$.prototype.toString=function(){return String(this._wrapped)};var G='[object DataView]';function K(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return('function'===o||'object'===o||'object'==typeof e)&&function t(e,n,r,o){e instanceof $&&(e=e._wrapped);n instanceof $&&(n=n._wrapped);var a=i["t"].call(e);if(a!==i["t"].call(n))return!1;if(C&&'[object Object]'==a&&j(e)){if(!j(n))return!1;a=G}switch(a){case'[object RegExp]':case'[object String]':return''+e==''+n;case'[object Number]':return+e!=+e?+n!=+n:0==+e?1/+e==1/n:+e==+n;case'[object Date]':case'[object Boolean]':return+e==+n;case'[object Symbol]':return i["d"].valueOf.call(e)===i["d"].valueOf.call(n);case'[object ArrayBuffer]':case G:return t(q(e),q(n),r,o)}var s='[object Array]'===a;if(!s&&V(e)){if(N(e)!==N(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;s=!0}if(!s){if('object'!=typeof e||'object'!=typeof n)return!1;var c=e.constructor,l=n.constructor;if(c!==l&&!(O(c)&&c instanceof c&&O(l)&&l instanceof l)&&'constructor'in e&&'constructor'in n)return!1}o=o||[];var u=(r=r||[]).length;for(;u--;)if(r[u]===e)return o[u]===n;if(r.push(e),o.push(n),s){if((u=e.length)!==n.length)return!1;for(;u--;)if(!K(e[u],n[u],r,o))return!1}else{var f,h=H(e);if(u=h.length,H(n).length!==u)return!1;for(;u--;)if(f=h[u],!_(n,f)||!K(e[f],n[f],r,o))return!1}return r.pop(),o.pop(),!0}(t,e,n,r)}function Y(t,e){return K(t,e)}function X(t){if(!a(t))return[];var e=[];for(var n in t)e.push(n);return i["h"]&&z(t,e),e}function J(t){var e=B(t);return function(n){if(null==n)return!1;var r=X(n);if(B(r))return!1;for(var i=0;i<e;i++)if(!O(n[t[i]]))return!1;return t!==rt||!O(n[Z])}}var Z='forEach',Q='has',tt=['clear','delete'],et=['get',Q,'set'],nt=tt.concat(Z,et),rt=tt.concat(et),it=['add'].concat(tt,Z,Q),ot=k?J(nt):f('Map'),at=k?J(rt):f('WeakMap'),st=k?J(it):f('Set'),ct=f('WeakSet');function lt(t){for(var e=H(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function ut(t){for(var e=H(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function ft(t){for(var e={},n=H(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function ht(t){var e=[];for(var n in t)O(t[n])&&e.push(n);return e.sort()}function dt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,c=0;c<s;c++){var l=a[c];e&&void 0!==n[l]||(n[l]=o[l])}return n}}var pt=dt(X),gt=dt(H),vt=dt(X,!0);function mt(t){if(!a(t))return{};if(i["j"])return Object(i["j"])(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function yt(t,e){var n=mt(t);return e&&gt(n,e),n}function bt(t){return a(t)?P(t)?t.slice():pt({},t):t}function wt(t,e){return e(t),t}function Ot(t){return P(t)?t:[t]}function xt(t){return $.toPath(t)}function Ct(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function kt(t,e,n){var r=Ct(t,xt(e));return c(r)?n:r}function St(t,e){for(var n=(e=xt(e)).length,r=0;r<n;r++){var i=e[r];if(!_(t,i))return!1;t=t[i]}return!!n}function jt(t){return t}function Pt(t){return t=gt({},t),function(e){return W(e,t)}}function _t(t){return t=xt(t),function(e){return Ct(e,t)}}function Tt(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}function Et(t,e,n){return null==t?jt:O(t)?Tt(t,e,n):a(t)&&!P(t)?Pt(t):_t(t)}function Dt(t,e){return Et(t,e,1/0)}function Mt(t,e,n){return $.iteratee!==Dt?$.iteratee(t,e):Et(t,e,n)}function At(t,e,n){e=Mt(e,n);for(var r=H(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function Lt(){}function Rt(t){return null==t?Lt:function(e){return kt(t,e)}}function Nt(t,e,n){var r=Array(Math.max(0,t));e=Tt(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function It(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}$.toPath=Ot,$.iteratee=Dt;var Ft=Date.now||function(){return(new Date).getTime()};function Vt(t){var e=function(e){return t[e]},n='(?:'+H(t).join('|')+')',r=RegExp(n),i=RegExp(n,'g');return function(t){return t=null==t?'':''+t,r.test(t)?t.replace(i,e):t}}var Bt={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#x27;','`':'&#x60;'},zt=Vt(Bt),Ht=Vt(ft(Bt)),Ut=$.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wt=/(.)^/,$t={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},qt=/\\|'|\r|\n|\u2028|\u2029/g;function Gt(t){return'\\'+$t[t]}var Kt=/^\s*(\w|\$)+\s*$/;function Yt(t,e,n){!e&&n&&(e=n),e=vt({},e,$.templateSettings);var r=RegExp([(e.escape||Wt).source,(e.interpolate||Wt).source,(e.evaluate||Wt).source].join('|')+'|$','g'),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(qt,Gt),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!Kt.test(s))throw new Error('variable is not a bare identifier: '+s)}else o='with(obj||{}){\n'+o+'}\n',s='obj';o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+'return __p;\n';try{a=new Function(s,'_',o)}catch(t){throw t.source=o,t}var c=function(t){return a.call(this,t,$)};return c.source='function('+s+'){\n'+o+'}',c}function Xt(t,e,n){var r=(e=xt(e)).length;if(!r)return O(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=O(o)?o.call(t):o}return t}var Jt=0;function Zt(t){var e=++Jt+'';return t?t+e:e}function Qt(t){var e=$(t);return e._chain=!0,e}function te(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=mt(t.prototype),s=t.apply(o,i);return a(s)?s:o}var ee=o((function(t,e){var n=ee.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return te(t,r,this,this,a)};return r}));ee.placeholder=$;var ne=ee,re=o((function(t,e,n){if(!O(t))throw new TypeError('Bind must be called on a function');var r=o((function(i){return te(t,r,e,this,n.concat(i))}));return r})),ie=L(B);function oe(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var i=r.length,o=0,a=B(t);o<a;o++){var s=t[o];if(ie(s)&&(P(s)||E(s)))if(e>1)oe(s,e-1,n,r),i=r.length;else for(var c=0,l=s.length;c<l;)r[i++]=s[c++];else n||(r[i++]=s)}return r}var ae=o((function(t,e){var n=(e=oe(e,!1,!1)).length;if(n<1)throw new Error('bindAll must be passed function names');for(;n--;){var r=e[n];t[r]=re(t[r],t)}return t}));function se(t,e){var n=function(r){var i=n.cache,o=''+(e?e.apply(this,arguments):r);return _(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n}var ce=o((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),le=ne(ce,$,1);function ue(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Ft(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Ft();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l}function fe(t,e,n){var r,i,a,s,c,l=function(){var o=Ft()-i;e>o?r=setTimeout(l,e-o):(r=null,n||(s=t.apply(c,a)),r||(a=c=null))},u=o((function(o){return c=this,a=o,i=Ft(),r||(r=setTimeout(l,e),n&&(s=t.apply(c,a))),s}));return u.cancel=function(){clearTimeout(r),r=a=c=null},u}function he(t,e){return ne(e,t)}function de(t){return function(){return!t.apply(this,arguments)}}function pe(){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 ge(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function ve(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var me=ne(ve,2);function ye(t,e,n){e=Mt(e,n);for(var r,i=H(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r}function be(t){return function(e,n,r){n=Mt(n,r);for(var i=B(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}var we=be(1),Oe=be(-1);function xe(t,e,n,r){for(var i=(n=Mt(n,r,1))(e),o=0,a=B(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o}function Ce(t,e,n){return function(r,o,a){var s=0,c=B(r);if('number'==typeof a)t>0?s=a>=0?a:Math.max(a+c,s):c=a>=0?Math.min(a+1,c):a+c+1;else if(n&&a&&c)return r[a=n(r,o)]===o?a:-1;if(o!=o)return(a=e(i["q"].call(r,s,c),M))>=0?a+s:-1;for(a=t>0?s:c-1;a>=0&&a<c;a+=t)if(r[a]===o)return a;return-1}}var ke=Ce(1,we,xe),Se=Ce(-1,Oe);function je(t,e,n){var r=(ie(t)?we:ye)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function Pe(t,e){return je(t,Pt(e))}function _e(t,e,n){var r,i;if(e=Tt(e,n),ie(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=H(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t}function Te(t,e,n){e=Mt(e,n);for(var r=!ie(t)&&H(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o}function Ee(t){var e=function(e,n,r,i){var o=!ie(e)&&H(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var c=o?o[s]:s;r=n(r,e[c],c,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,Tt(n,i,4),r,o)}}var De=Ee(1),Me=Ee(-1);function Ae(t,e,n){var r=[];return e=Mt(e,n),_e(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function Le(t,e,n){return Ae(t,de(Mt(e)),n)}function Re(t,e,n){e=Mt(e,n);for(var r=!ie(t)&&H(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0}function Ne(t,e,n){e=Mt(e,n);for(var r=!ie(t)&&H(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1}function Ie(t,e,n,r){return ie(t)||(t=lt(t)),('number'!=typeof n||r)&&(n=0),ke(t,e,n)>=0}var Fe=o((function(t,e,n){var r,i;return O(e)?i=e:(e=xt(e),r=e.slice(0,-1),e=e[e.length-1]),Te(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=Ct(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function Ve(t,e){return Te(t,_t(e))}function Be(t,e){return Ae(t,Pt(e))}function ze(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,c=(t=ie(t)?t:lt(t)).length;s<c;s++)null!=(r=t[s])&&r>o&&(o=r);else e=Mt(e,n),_e(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function He(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,c=(t=ie(t)?t:lt(t)).length;s<c;s++)null!=(r=t[s])&&r<o&&(o=r);else e=Mt(e,n),_e(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o}function Ue(t,e,n){if(null==e||n)return ie(t)||(t=lt(t)),t[It(t.length-1)];var r=ie(t)?bt(t):lt(t),i=B(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=It(a,o),c=r[a];r[a]=r[s],r[s]=c}return r.slice(0,e)}function We(t){return Ue(t,1/0)}function $e(t,e,n){var r=0;return e=Mt(e,n),Ve(Te(t,(function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),'value')}function qe(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=Mt(r,i),_e(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}}var Ge=qe((function(t,e,n){_(t,n)?t[n].push(e):t[n]=[e]})),Ke=qe((function(t,e,n){t[n]=e})),Ye=qe((function(t,e,n){_(t,n)?t[n]++:t[n]=1})),Xe=qe((function(t,e,n){t[n?0:1].push(e)}),!0),Je=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ze(t){return t?P(t)?i["q"].call(t):h(t)?t.match(Je):ie(t)?Te(t,jt):lt(t):[]}function Qe(t){return null==t?0:ie(t)?t.length:H(t).length}function tn(t,e,n){return e in n}var en=o((function(t,e){var n={},r=e[0];if(null==t)return n;O(r)?(e.length>1&&(r=Tt(r,e[1])),e=X(t)):(r=tn,e=oe(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),nn=o((function(t,e){var n,r=e[0];return O(r)?(r=de(r),e.length>1&&(n=e[1])):(e=Te(oe(e,!1,!1),String),r=function(t,n){return!Ie(e,n)}),en(t,r,n)}));function rn(t,e,n){return i["q"].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]:rn(t,t.length-e)}function an(t,e,n){return i["q"].call(t,null==e||n?1:e)}function sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:an(t,Math.max(0,t.length-e))}function cn(t){return Ae(t,Boolean)}function ln(t,e){return oe(t,e,!1)}var un=o((function(t,e){return e=oe(e,!0,!0),Ae(t,(function(t){return!Ie(e,t)}))})),fn=o((function(t,e){return un(t,e)}));function hn(t,e,n,r){l(e)||(r=n,n=e,e=!1),null!=n&&(n=Mt(n,r));for(var i=[],o=[],a=0,s=B(t);a<s;a++){var c=t[a],u=n?n(c,a,t):c;e&&!n?(a&&o===u||i.push(c),o=u):n?Ie(o,u)||(o.push(u),i.push(c)):Ie(i,c)||i.push(c)}return i}var dn=o((function(t){return hn(oe(t,!0,!0))}));function pn(t){for(var e=[],n=arguments.length,r=0,i=B(t);r<i;r++){var o=t[r];if(!Ie(e,o)){var a;for(a=1;a<n&&Ie(arguments[a],o);a++);a===n&&e.push(o)}}return e}function gn(t){for(var e=t&&ze(t,B).length||0,n=Array(e),r=0;r<e;r++)n[r]=Ve(t,r);return n}var vn=o(gn);function mn(t,e){for(var n={},r=0,i=B(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function yn(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}function bn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(i["q"].call(t,r,r+=e));return n}function wn(t,e){return t._chain?$(e).chain():e}function On(t){return _e(ht(t),(function(e){var n=$[e]=t[e];$.prototype[e]=function(){var t=[this._wrapped];return i["o"].apply(t,arguments),wn(this,n.apply($,t))}})),$}_e(['pop','push','reverse','shift','sort','splice','unshift'],(function(t){var e=i["a"][t];$.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),'shift'!==t&&'splice'!==t||0!==n.length||delete n[0]),wn(this,n)}})),_e(['concat','join','slice'],(function(t){var e=i["a"][t];$.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),wn(this,t)}}));var xn=$,Cn=On(r);Cn._=Cn;var kn=Cn},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"isDef",(function(){return c})),n.d(e,"hasWin",(function(){return l})),n.d(e,"getGlobal",(function(){return u})),n.d(e,"toLowerCase",(function(){return f})),n.d(e,"getUiClass",(function(){return p})),n.d(e,"isCommentNode",(function(){return j})),n.d(e,"isTaggableNode",(function(){return P})),n.d(e,"find",(function(){return _})),n.d(e,"escape",(function(){return T})),n.d(e,"on",(function(){return m})),n.d(e,"off",(function(){return y})),n.d(e,"hasDnd",(function(){return C})),n.d(e,"upFirst",(function(){return w})),n.d(e,"matches",(function(){return d})),n.d(e,"getModel",(function(){return E})),n.d(e,"getElRect",(function(){return D})),n.d(e,"camelCase",(function(){return O})),n.d(e,"isTextNode",(function(){return S})),n.d(e,"getKeyCode",(function(){return A})),n.d(e,"getKeyChar",(function(){return L})),n.d(e,"isEscKey",(function(){return R})),n.d(e,"isEnterKey",(function(){return N})),n.d(e,"getElement",(function(){return k})),n.d(e,"shallowDiff",(function(){return v})),n.d(e,"normalizeFloat",(function(){return x})),n.d(e,"getPointerEvent",(function(){return M})),n.d(e,"getUnitFromValue",(function(){return b})),n.d(e,"capitalize",(function(){return V})),n.d(e,"getViewEl",(function(){return H})),n.d(e,"setViewEl",(function(){return U})),n.d(e,"appendStyles",(function(){return g})),n.d(e,"isObject",(function(){return I})),n.d(e,"isEmptyObj",(function(){return F})),n.d(e,"isComponent",(function(){return B})),n.d(e,"createId",(function(){return W})),n.d(e,"isRule",(function(){return z}));var r=n(14),i=n.n(r),o=n(11),a=n.n(o),s=n(0),c=function(t){return void 0!==t},l=function(){return'undefined'!=typeof window},u=function(){return'undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:t},f=function(t){return(t||'').toLowerCase()},h=l()?window.Element.prototype:{},d=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.msMatchesSelector,p=function(t,e){var n=t.getConfig(),r=n.stylePrefix;return[n.customUI&&"".concat(r,"cui"),e].filter((function(t){return t})).join(' ')},g=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(s["isArray"])(e)?a()(e):[e];if(r.length){var i=r.shift();if(i&&(!n.unique||!document.querySelector("link[href=\"".concat(i,"\"]")))){var o=document,c=o.head,l=document.createElement('link');l.href=i,l.rel='stylesheet',n.prepand?c.insertBefore(l,c.firstChild):c.appendChild(l)}t(r)}},v=function(t,e){var n={},r=Object(s["keys"])(e);for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a=e[i];r.indexOf(i)>=0?o!==a&&(n[i]=a):n[i]=null}for(var c in e)e.hasOwnProperty(c)&&Object(s["isUndefined"])(t[c])&&(n[c]=e[c]);return n},m=function(t,e,n,r){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var i=function(i){t.forEach((function(t){return t&&t.addEventListener(e[i],n,r)}))},o=0;o<e.length;++o)i(o)},y=function(t,e,n,r){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var i=function(i){t.forEach((function(t){return t&&t.removeEventListener(e[i],n,r)}))},o=0;o<e.length;++o)i(o)},b=function(t){return t.replace(parseFloat(t),'')},w=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},O=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},x=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var i=e.toString().split('.')[1];r=i?i.length:0}return r?parseFloat(t.toFixed(r)):t},C=function(t){return'draggable'in document.createElement('i')&&(t?t.get('Config').nativeDnD:1)},k=function(t){return Object(s["isElement"])(t)||S(t)?t:t&&t.getEl?t.getEl():void 0},S=function(t){return t&&3===t.nodeType},j=function(t){return t&&8===t.nodeType},P=function(t){return t&&!S(t)&&!j(t)},_=function(t,e){var n=null;return t.some((function(r,i){return e(r,i,t)?(n=r,1):0})),n},T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'';return"".concat(t).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/`/g,'&#96;')},E=function(t,e){var n=t;return Object(s["isElement"])(t)&&(n=e(t).data('model')),n},D=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(S(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},M=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},A=function(t){return t.which||t.keyCode},L=function(t){return String.fromCharCode(A(t))},R=function(t){return 27===A(t)},N=function(t){return 13===A(t)},I=function(t){return null!==t&&!Array.isArray(t)&&'object'===i()(t)},F=function(t){return Object.keys(t).length<=0},V=function(t){return t&&t.charAt(0).toUpperCase()+t.substring(1)},B=function(t){return t&&t.toHTML},z=function(t){return t&&t.toCSS},H=function(t){return t.__gjsv},U=function(t,e){t.__gjsv=e},W=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e='',n='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',r=n.length,i=0;i<t;i++)e+=n.charAt(Math.floor(Math.random()*r));return e}}.call(this,n(33))},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){(function(r){var i,o;!function(a){var s='object'==typeof self&&self.self===self&&self||'object'==typeof r&&r.global===r&&r;if(1)i=[n(0),n(19),e],void 0===(o=function(t,e,n){s.Backbone=function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION='1.3.3',e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=function(t,e,r){n.each(e,(function(e,i){n[i]&&(t.prototype[i]=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],s(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],s(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}}(e,i,r))}))},s=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},l=e.Events={},u=/\s+/,f=function(t,e,r,i,o){var a,s=0;if(r&&'object'==typeof r){void 0!==i&&'context'in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);s<a.length;s++)e=f(t,e,a[s],r[a[s]],o)}else if(r&&u.test(r))for(a=r.split(u);s<a.length;s++)e=t(e,a[s],i,o);else e=t(e,r,i,o);return e};l.on=function(t,e,n){return h(this,t,e,n)};var h=function(t,e,n,r,i){(t._events=f(d,t._events||{},e,n,{context:r,ctx:t,listening:i}),i)&&((t._listeners||(t._listeners={}))[i.id]=i);return t};l.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId('l')),o=this._listeningTo||(this._listeningTo={}),a=o[i];if(!a){var s=this._listenId||(this._listenId=n.uniqueId('l'));a=o[i]={obj:t,objId:i,id:s,listeningTo:o,count:0}}return h(t,e,r,this,a),this};var d=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,a=r.ctx,s=r.listening;s&&s.count++,i.push({callback:n,context:o,ctx:o||a,listening:s})}return t};l.off=function(t,e,n){return this._events?(this._events=f(p,this._events,t,e,{context:n,listeners:this._listeners}),this):this},l.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),a=0;a<o.length;a++){var s=i[o[a]];if(!s)break;s.obj.off(e,r,this)}return this};var p=function(t,e,r,i){if(t){var o,a=0,s=i.context,c=i.listeners;if(e||r||s){for(var l=e?[e]:n.keys(t);a<l.length;a++){var u=t[e=l[a]];if(!u)break;for(var f=[],h=0;h<u.length;h++){var d=u[h];r&&r!==d.callback&&r!==d.callback._callback||s&&s!==d.context?f.push(d):(o=d.listening)&&0==--o.count&&(delete c[o.id],delete o.listeningTo[o.objId])}f.length?t[e]=f:delete t[e]}return t}for(var p=n.keys(c);a<p.length;a++)delete c[(o=c[p[a]]).id],delete o.listeningTo[o.objId]}};l.once=function(t,e,r){var i=f(g,{},t,e,n.bind(this.off,this));return'string'==typeof t&&null==r&&(e=void 0),this.on(i,e,r)},l.listenToOnce=function(t,e,r){var i=f(g,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var g=function(t,e,r,i){if(r){var o=t[e]=n.once((function(){i(e,o),r.apply(this,arguments)}));o._callback=r}return t};l.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return f(v,this._events,t,void 0,n),this};var v=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&m(i,r),o&&m(o,[e].concat(r))}return t},m=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};l.bind=l.on,l.unbind=l.off,n.extend(e,l);var y=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var i=n.result(this,'defaults');r=n.defaults(n.extend({},i,r),i),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(y.prototype,l,{changed:null,validationError:null,idAttribute:'id',cidPrefix:'c',initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if('object'==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,a=r.silent,s=[],c=this._changing;this._changing=!0,c||(this._previousAttributes=n.clone(this.attributes),this.changed={});var l=this.attributes,u=this.changed,f=this._previousAttributes;for(var h in i)e=i[h],n.isEqual(l[h],e)||s.push(h),n.isEqual(f[h],e)?delete u[h]:u[h]=e,o?delete l[h]:l[h]=e;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!a){s.length&&(this._pending=r);for(var d=0;d<s.length;d++)this.trigger('change:'+s[d],this,l[s[d]],r)}if(c)return this;if(!a)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger('change',this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;if(!e.set(i,t))return!1;r&&r.call(t.context,e,n,t),e.trigger('sync',e,n,t)},I(this,t),this.sync('read',this,t)},save:function(t,e,r){var i;null==t||'object'==typeof t?(i=t,r=e):(i={})[t]=e;var o=(r=n.extend({validate:!0,parse:!0},r)).wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var a=this,s=r.success,c=this.attributes;r.success=function(t){a.attributes=c;var e=r.parse?a.parse(t,r):t;if(o&&(e=n.extend({},i,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger('sync',a,t,r)},I(this,r),i&&o&&(this.attributes=n.extend({},c,i));var l=this.isNew()?'create':r.patch?'patch':'update';'patch'!==l||r.attrs||(r.attrs=i);var u=this.sync(l,this,r);return this.attributes=c,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger('destroy',e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger('sync',e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):(I(this,t),a=this.sync('delete',this,t)),i||o(),a},url:function(){var t=n.result(this,'urlRoot')||n.result(this.collection,'url')||N();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,'$&/')+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger('invalid',this,r,n.extend(e,{validationError:r})),!1)}}),a(y,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},'attributes');var b=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},w={add:!0,remove:!0,merge:!0},O={add:!0,remove:!1},x=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,i=Array(t.length-n),o=e.length;for(r=0;r<i.length;r++)i[r]=t[r+n];for(r=0;r<o;r++)t[r+n]=e[r];for(r=0;r<i.length;r++)t[r+o+n]=i[r]};n.extend(b.prototype,l,{model:y,initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,O))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var i=this._removeModels(t,e);return!e.silent&&i.length&&(e.changes={added:[],merged:[],removed:i},this.trigger('update',this,e)),r?i[0]:i},set:function(t,e){if(null!=t){(e=n.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],c=[],l=[],u=[],f={},h=e.add,d=e.merge,p=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){o=t[a];var y=this.get(o);if(y){if(d&&o!==y){var b=this._isModel(o)?o.attributes:o;e.parse&&(b=y.parse(b,e)),y.set(b,e),l.push(y),v&&!g&&(g=y.hasChanged(m))}f[y.cid]||(f[y.cid]=!0,s.push(y)),t[a]=y}else h&&(o=t[a]=this._prepareModel(o,e))&&(c.push(o),this._addReference(o,e),f[o.cid]=!0,s.push(o))}if(p){for(a=0;a<this.length;a++)f[(o=this.models[a]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var O=!1,C=!v&&h&&p;if(s.length&&C?(O=this.length!==s.length||n.some(this.models,(function(t,e){return t!==s[e]})),this.models.length=0,x(this.models,s,0),this.length=this.models.length):c.length&&(v&&(g=!0),x(this.models,c,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<c.length;a++)null!=i&&(e.index=i+a),(o=c[a]).trigger('add',o,this,e);(g||O)&&this.trigger('sort',this,e),(c.length||u.length||l.length)&&(e.changes={added:c,removed:u,merged:l},this.trigger('update',this,e))}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger('reset',this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?'find':'filter'](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error('Cannot sort a set without a comparator');t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger('sort',this,t),this},pluck:function(t){return this.map(t+'')},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,r=this;return t.success=function(n){var i=t.reset?'reset':'set';r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger('sync',r,n,t)},I(this,t),this.sync('read',this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||'id']},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?n.clone(e):{}).collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger('invalid',this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var a=this.modelId(i.attributes);null!=a&&delete this._byId[a],e.silent||(e.index=o,i.trigger('remove',i,this,e)),n.push(i),this._removeReference(i,e)}}return n},_isModel:function(t){return t instanceof y},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on('all',this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off('all',this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(('add'===t||'remove'===t)&&n!==this)return;if('destroy'===t&&this.remove(e,r),'change'===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}}this.trigger.apply(this,arguments)}}),a(b,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},'models');var C=e.View=function(t){this.cid=n.uniqueId('view'),n.extend(this,n.pick(t,S)),this._ensureElement(),this.initialize.apply(this,arguments)},k=/^(\S+)\s*(.*)$/,S=['model','collection','el','id','attributes','className','tagName','events'];n.extend(C.prototype,l,{tagName:'div',$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,'events')),!t)return this;for(var e in this.undelegateEvents(),t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(k);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+'.delegateEvents'+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off('.delegateEvents'+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+'.delegateEvents'+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,'el'));else{var t=n.extend({},n.result(this,'attributes'));this.id&&(t.id=n.result(this,'id')),this.className&&(t['class']=n.result(this,'className')),this.setElement(this._createElement(n.result(this,'tagName'))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=j[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:'json'};if(i.url||(a.url=n.result(r,'url')||N()),null!=i.data||!r||'create'!==t&&'update'!==t&&'patch'!==t||(a.contentType='application/json',a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType='application/x-www-form-urlencoded',a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&('PUT'===o||'DELETE'===o||'PATCH'===o)){a.type='POST',i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader('X-HTTP-Method-Override',o),s)return s.apply(this,arguments)}}'GET'===a.type||i.emulateJSON||(a.processData=!1);var c=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,c&&c.call(i.context,t,e,n)};var l=i.xhr=e.ajax(n.extend(a,i));return r.trigger('request',r,l,i),l};var j={create:'POST',update:'PUT',patch:'PATCH',delete:'DELETE',read:'GET'};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var P=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},_=/\((.*?)\)/g,T=/(\(\?)?:\w+/g,E=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(P.prototype,l,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=''),i||(i=this[r]);var o=this;return e.history.route(t,(function(n){var a=o._extractParameters(t,n);!1!==o.execute(i,a,r)&&(o.trigger.apply(o,['route:'+r].concat(a)),o.trigger('route',r,a),e.history.trigger('route',o,r,a))})),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,'routes');for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(D,'\\$&').replace(_,'(?:$1)?').replace(T,(function(t,e){return e?t:'([^/?]+)'})).replace(E,'([^?]*?)'),new RegExp('^'+t+'(?:\\?([\\s\\S]*))?$')},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var M=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),'undefined'!=typeof window&&(this.location=window.location,this.history=window.history)},A=/^[#\/]|\s+$/g,L=/^\/+|\/+$/g,R=/#.*$/;M.started=!1,n.extend(M.prototype,l,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,'$&/')===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+'/'===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,'%2525'))},getSearch:function(){var t=this.location.href.replace(/#.*/,'').match(/\?.+/);return t?t[0]:''},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:''},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return'/'===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(A,'')},start:function(t){if(M.started)throw new Error('Backbone.history has already been started');if(M.started=!0,this.options=n.extend({root:'/'},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange='onhashchange'in window&&(void 0===document.documentMode||document.documentMode>7),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(L,'/'),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,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash='#'+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent('on'+t,e)};if(this._usePushState?o('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe?o('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),M.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),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(!M.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;if(t=this.decodeFragment(t.replace(R,'')),this.fragment!==t){if(this.fragment=t,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 M;y.extend=b.extend=P.extend=C.extend=M.extend=function(t,e){var r,i=this;return r=t&&n.has(t,'constructor')?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};var N=function(){throw new Error('A "url" property or function must be specified')},I=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}(s,n,t,e)}.apply(e,i))||(t.exports=o);else;}()}).call(this,n(33))},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports["default"]=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(85);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(14)["default"],i=n(86);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";(function(t){n.d(e,"e",(function(){return r})),n.d(e,"p",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"o",(function(){return c})),n.d(e,"q",(function(){return l})),n.d(e,"t",(function(){return u})),n.d(e,"i",(function(){return f})),n.d(e,"r",(function(){return h})),n.d(e,"s",(function(){return d})),n.d(e,"k",(function(){return p})),n.d(e,"m",(function(){return g})),n.d(e,"j",(function(){return v})),n.d(e,"l",(function(){return m})),n.d(e,"g",(function(){return y})),n.d(e,"f",(function(){return b})),n.d(e,"h",(function(){return w})),n.d(e,"n",(function(){return O})),n.d(e,"b",(function(){return x}));var r='1.13.1',i='object'==typeof self&&self.self===self&&self||'object'==typeof t&&t.global===t&&t||Function('return this')()||{},o=Array.prototype,a=Object.prototype,s='undefined'!=typeof Symbol?Symbol.prototype:null,c=o.push,l=o.slice,u=a.toString,f=a.hasOwnProperty,h='undefined'!=typeof ArrayBuffer,d='undefined'!=typeof DataView,p=Array.isArray,g=Object.keys,v=Object.create,m=h&&ArrayBuffer.isView,y=isNaN,b=isFinite,w=!{toString:null}.propertyIsEnumerable('toString'),O=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],x=Math.pow(2,53)-1}).call(this,n(33))},function(t,e,n){"use strict";n.d(e,"b",(function(){return V})),n.d(e,"a",(function(){return $}));var r=n(14),i=n.n(r),o=n(11),a=n.n(o),s=n(28),c=n.n(s),l=n(2),u=n.n(l),f=n(5),h=n.n(f),d=n(6),p=n.n(d),g=n(7),v=n.n(g),m=n(8),y=n.n(m),b=n(4),w=n.n(b),O=n(0),x=n(1),C=n(32),k=n(3),S=n.n(k),j=n(30),P=n(17),_=n(21);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var D,M=S.a.Model.extend({defaults:{type:'text',label:'',name:'',min:'',max:'',unit:'',step:1,value:'',target:'',default:'',placeholder:'',changeProp:0,options:[]},initialize:function(){var t=this.get('target'),e=this.get('name'),n=this.get('changeProp');if(!this.get('id')&&this.set('id',e),t){this.target=t,this.unset('target');var r=n?"change:".concat(e):"change:attributes:".concat(e);this.listenTo(t,r,this.targetUpdated)}},props:function(){return this.attributes},targetUpdated:function(){var t=this.getTargetValue();this.set({value:t},{fromTarget:1})},getValue:function(){return this.getTargetValue()},getTargetValue:function(){var t,e=this.get('name'),n=this.target;return t=this.get('changeProp')?n.get(e):n.getAttributes()[e],Object(O["isUndefined"])(t)?'':t},setTargetValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get('name');if(!Object(O["isUndefined"])(t)){var i=t;if('false'===t?i=!1:'true'===t&&(i=!0),this.get('changeProp'))n.set(r,i,e);else{var o=E({},n.get('attributes'));o[r]=i,n.set('attributes',o,e)}}},setValueFromInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:t};this.set(r,E(E({},n),{},{avoidStore:1})),e&&(this.set('value','',n),this.set(r,n))},getInitValue:function(){var t,e=this.target,n=this.get('name');if(e){var r=e.get('attributes');t=this.get('changeProp')?e.get(n):r[n]}return t||this.get('value')||this.get('default')}}),A=S.a.Collection.extend({model:M,initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em||'',this.listenTo(this,'add',this.handleAdd),this.listenTo(this,'reset',this.handleReset)},handleReset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach((function(t){return t.trigger('remove')}))},handleAdd:function(t){var e=this.target;e&&(t.target=e)},setTarget:function(t){this.target=t},add:function(t,e){var n=this.em;if(Object(O["isString"])(t)||Object(O["isArray"])(t)){var r=n&&n.get&&n.get('TraitManager'),i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];'string'==typeof e&&(e=[e]);for(var r=0;r<e.length;r++){var i={},o=e[r];switch(i.name=o,o){case'target':i.type='select',i.default=!1,i.options=t.optionsTarget}n.push(i)}return n}}}(r&&r.getConfig());Object(O["isString"])(t)&&(t=[t]);for(var o=0,a=t.length;o<a;o++){var s=t[o],c=Object(O["isString"])(s)?i.build(s)[0]:s;c.target=this.target,t[o]=c}}return S.a.Collection.prototype.add.apply(this,[t,e])}});function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=w()(t);if(e){var i=w()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y()(this,n)}}var I=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,'\\$&')},F=function(t){return t&&t.getConfig('avoidInlineStyle')},V='component:drag',B='__symbols',z='__symbol',H='__symbol_ovrd',U='component:update',W="".concat(U,"-inside"),$=function(t){v()(n,t);var e=N(n);function n(){return h()(this,n),e.apply(this,arguments)}return p()(n,[{key:"init",value:function(){}},{key:"updated",value:function(t,e,n){}},{key:"removed",value:function(){}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(O["bindAll"])(this,'__upSymbProps','__upSymbCls','__upSymbComps');var i=r.em,o=this.parent(),a=o&&o.attributes;if(a&&a.propagate){var s={},c=a.propagate;c.forEach((function(t){return s[t]=o.get(t)})),s.propagate=c,s=R(R({},s),e),this.set(s)}var l=this.get('propagate');if(l&&this.set('propagate',Object(O["isArray"])(l)?l:[l]),r&&r.config&&r.config.voidElements.indexOf(this.get('tagName'))>=0&&this.set('void',!0),r.em=i,this.opt=r,this.em=i,this.frame=r.frame,this.config=r.config||{},this.set('attributes',R(R({},Object(O["result"])(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,r),this.initClasses(),this.initTraits(),this.initComponents(),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(W,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(e){var n="add remove ".concat('components'!==e?'change':'');t.listenTo(t.get(e),n.trim(),(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.emitUpdate.apply(t,[e].concat(r))}))})),!r.temporary){var u=i&&i.get('CssComposer'),f=this.attributes,h=f.styles,d=f.type;h&&u&&u.addCollection(h,{},{group:"cmp:".concat(d)}),this.__postAdd(),this.init(),this.__isSymbolOrInst()&&this.__initSymb(),i&&i.trigger('component:create',this)}}},{key:"__postAdd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e&&e.get('UndoManager'),r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=1),t.recursive&&r.map((function(e){return e.__postAdd(t)}))}},{key:"__postRemove",value:function(){var t=this.em,e=t&&t.get('UndoManager');e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)}},{key:"__onChange",value:function(t,e){var n=this.changedAttributes();['status','open','toolbar','traits'].forEach((function(t){return delete n[t]})),Object(x["isEmptyObj"])(n)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:n,options:e}))}},{key:"__changesUp",value:function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))}},{key:"__propSelfToParent",value:function(t){this.trigger(U,t),this.__propToParent(t)}},{key:"__propToParent",value:function(t){var e=this.parent();e&&e.trigger(W,t)}},{key:"__emitUpdateTlb",value:function(){this.emitUpdate('toolbar')}},{key:"is",value:function(t){return!(this.get('type')!=t)}},{key:"props",value:function(){return this.attributes}},{key:"index",value:function(){var t=this.collection;return t?t.indexOf(this):0}},{key:"setDragMode",value:function(t){return this.set('dmode',t)}},{key:"find",value:function(t){var e=[],n=this.view.$el.find(t);return n.each((function(t){var r=n.eq(t).data('model');r&&e.push(r)})),e}},{key:"findType",value:function(t){var e=[];return function n(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))}(this.components()),e}},{key:"closest",value:function(t){var e=this.view.$el.closest(t);return e.length&&e.data('model')}},{key:"closestType",value:function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e}},{key:"contains",value:function(t){var e=!1;if(!t)return e;var n=function n(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e}},{key:"tagUpdated",value:function(){this.trigger('rerender')}},{key:"replaceWith",value:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})}},{key:"attrUpdated",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.get('attributes'),o=i.class;o&&this.setClass(o),delete i.class;var a=i.style;a&&this.setStyle(a),delete i.style;var s=R({},this.previous('attributes')),c=Object(x["shallowDiff"])(s,this.get('attributes'));Object(O["keys"])(c).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,c[t],r)}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set('attributes',R({},t),e),this}},{key:"addAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setAttributes(R(R({},this.getAttributes({noClass:1})),t),e)}},{key:"removeAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=Object(O["isString"])(t)?t:'',i=r?e:t;if(n&&n.getConfig('avoidInlineStyle')&&!i.inline){var o=n.get('state'),a=n.get('CssComposer'),s=a.getIdRule(this.getId(),R({state:o},i));if(this.rule=s,s)return s.getStyle(r)}return C["a"].getStyle.call(this,r)}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.opt;if(r&&r.getConfig('avoidInlineStyle')&&!i.temporary&&!n.inline){var o=this.get('style')||{};e=R(R({},e=Object(O["isString"])(e)?this.parseStyle(e):e),o);var a=r.get('state'),s=r.get('CssComposer'),c=this.getStyle(n);this.rule=s.setIdRule(this.getId(),e,R(R({},n),{},{state:a}));var l=Object(x["shallowDiff"])(c,e);this.set('style','',{silent:1}),Object(O["keys"])(l).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=C["a"].setStyle.apply(this,arguments);return e}},{key:"getAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=[],i=R({},this.get('attributes')),o=n&&n.get('SelectorManager'),a=this.getId();if(e.noClass||(this.get('classes').forEach((function(t){return r.push(Object(O["isString"])(t)?t:t.get('name'))})),r.length&&(i.class=r.join(' '))),!e.noStyle){var s=this.get('style');Object(x["isObject"])(s)&&!Object(x["isEmptyObj"])(s)&&(i.style=this.styleToString({inline:1}))}Object(O["has"])(i,'id')||(F(n)?t=o&&o.get(a,o.Selector.TYPE_ID):Object(O["isEmpty"])(this.getStyle())||(t=1),(this.__getSymbol()||this.__getSymbols())&&(t=1),t&&(i.id=a));return i}},{key:"addClass",value:function(t){var e=this.em.get('SelectorManager').addClass(t);return this.get('classes').add(e)}},{key:"setClass",value:function(t){return this.get('classes').reset(),this.addClass(t)}},{key:"removeClass",value:function(t){var e=[];t=Object(O["isArray"])(t)?t:[t];var n=this.get('classes'),r=P["a"].TYPE_CLASS;return t.forEach((function(t){t.split(' ').forEach((function(t){var i=n.where({name:t,type:r})[0];i&&e.push(n.remove(i))}))})),e}},{key:"getClasses",value:function(){var t=this.getAttributes().class;return t?t.split(' '):[]}},{key:"__logSymbol",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.__getSymbol(),i=this.__getSymbols();(r||i)&&this.em.log(t,{model:this,toUp:e,context:'symbols',opts:n})}},{key:"__initSymb",value:function(){this.__symbReady||(this.on('change',this.__upSymbProps),this.__symbReady=1)}},{key:"__isSymbol",value:function(){return Object(O["isArray"])(this.get(B))}},{key:"__isSymbolOrInst",value:function(){return!(!this.__isSymbol()&&!this.get(z))}},{key:"__isSymbolTop",value:function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())}},{key:"__isSymbolNested",value:function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t}},{key:"__getAllById",value:function(){var t=this.em;return t?t.get('DomComponents').allById():{}}},{key:"__getSymbol",value:function(){var t=this.get(z);if(t&&Object(O["isString"])(t)){var e=this.__getAllById()[t];e?(t=e,this.set(z,e)):t=0}return t}},{key:"__getSymbols",value:function(){var t=this,e=this.get(B);return e&&Object(O["isArray"])(e)&&(e.forEach((function(n,r){n&&Object(O["isString"])(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!Object(O["isString"])(t)}))),e}},{key:"__isSymbOvrd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.get(H),n=t.split(':'),r=c()(n,1),i=r[0],o=t!==i?[t,i]:[t];return!0===e||Object(O["isArray"])(e)&&o.some((function(t){return e.indexOf(t)>=0}))}},{key:"__getSymbToUp",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[],r=this.em,i=e.changed,o=r&&r.get('symbols');if(e.fromInstance||e.noPropagate||e.fromUndo||!o||i&&this.__isSymbOvrd(i))return n;var s=this.__getSymbols()||[],c=this.__getSymbol(),l=c?[c].concat(a()(c.__getSymbols()||[])):s;return n=l.filter((function(e){return e!==t})).filter((function(t){return!(i&&t.__isSymbOvrd(i))}))}},{key:"__getSymbTop",value:function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e}},{key:"__upSymbProps",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.changedAttributes(),i=r.attributes||{};if(delete r.status,delete r.open,delete r[B],delete r[z],delete r[H],delete r.attributes,delete i.id,Object(x["isEmptyObj"])(i)||(r.attributes=i),!Object(x["isEmptyObj"])(r)){var o=this.__getSymbToUp(n);Object(O["keys"])(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),this.__logSymbol('props',o,{opts:n,changed:r}),o.forEach((function(t){var i=R({},r);Object(O["keys"])(i).map((function(e){t.__isSymbOvrd(e)&&delete i[e]})),t.set(i,R({fromInstance:e},n))}))}}},{key:"__upSymbCls",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.__getSymbToUp(r);this.__logSymbol('classes',i,{opts:r}),i.forEach((function(t){t.set('classes',n.get('classes'),{fromInstance:n})})),this.__changesUp(r)}},{key:"__upSymbComps",value:function(t,e,n){var r=this,i=n||e||{},o={fromInstance:i.fromInstance,fromUndo:i.fromUndo},s=t.opt.temporary;if(n)if(n.add){var c=[],l=!!this.__getSymbols(),u=this.__getSymbToUp(R(R({},o),{},{changed:'components:add'}));if(u.length){var f=t.__getSymbol();c=(f?f.__getSymbols():t.__getSymbols())||[],(c=a()(c)).push(f||t)}!s&&this.__logSymbol('add',u,{opts:n,addedInstances:c.map((function(t){return t.cid})),added:t.cid}),u.forEach((function(e){var i=e.__getSymbTop(),o=c.filter((function(t){var e=t.__getSymbTop({prev:1});return i&&e&&e===i}))[0]||t.clone({symbol:1,symbolInv:l});e.append(o,R({fromInstance:r},n))}))}else{var h=t.__getSymbol();if(h&&!n.temporary&&h.set(B,h.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var d='components:remove',p=n.index,g=t.parent(),v=R({fromInstance:t},n),m=t.__isSymbolNested(),y=function(t){var e=t.parent();e&&!e.__isSymbOvrd(d)&&t.remove(v)},b=g.__isSymbOvrd(d)?[]:t.__getSymbToUp(o);m&&(b=g.__getSymbToUp(R(R({},o),{},{changed:d})),y=function(t){var e=t.components().at(p);e&&e.remove(R({fromInstance:g},v))}),!s&&this.__logSymbol('remove',b,{opts:n,removed:t.cid,isSymbNested:m}),b.forEach(y)}}else{var w=this.__getSymbToUp(R(R({},o),{},{changed:'components:reset'}));this.__logSymbol('reset',w,{components:t.models}),w.forEach((function(n){var i=t.models.map((function(t){return t.clone({symbol:1})}));n.components().reset(i,R({fromInstance:r},e))}))}this.__changesUp(i)}},{key:"initClasses",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r='change:classes',i=this.get('attributes').class||[],o=[this,r,this.initClasses],a=this.get('classes')||i,s=Object(O["isString"])(a)?a.split(' '):a;this.stopListening.apply(this,o);var c=this.normalizeClasses(s),l=new _["a"]([]);return this.set('classes',l,n),l.add(c),l.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,o),this}},{key:"initComponents",value:function(){var t=[this,'change:components',this.initComponents];this.stopListening.apply(this,t);var e=new j["a"](null,this.opt);e.parent=this;var n=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',e),r&&n&&e.add(Object(O["isFunction"])(n)?n(this):n,this.opt),e.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,t),this}},{key:"initTraits",value:function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var r=R({},this.get('attributes')),i=this.get('traits');return i.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(r[e]=n)}})),i.length&&this.set('attributes',r),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this}},{key:"initScriptProps",value: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)||[],i=n.map((function(t){return"change:".concat(t)})).join(' '),o=r.map((function(t){return"change:".concat(t)})).join(' ');i&&this.off(i,this.__scriptPropsChange),o&&this.on(o,this.__scriptPropsChange),this.on.apply(this,e)}}},{key:"__scriptPropsChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.avoidStore||this.trigger('rerender')}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(O["isArray"])(t)?t:[t],r=n.map((function(t){return Object(O["isString"])(t)||t.collection&&t.collection.remove(t,{temporary:1}),t})),i=this.components().add(r,e);return Object(O["isArray"])(i)?i:[i]}},{key:"components",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('components');return Object(O["isUndefined"])(t)?n:(n.reset(null,e),t?this.append(t,e):[])}},{key:"getChildAt",value:function(t){return this.components().at(t||0)||null}},{key:"getLastChild",value:function(){var t=this.components();return t.at(t.length-1)||null}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.components().reset(null,t),this}},{key:"parent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.collection||t.prev&&this.prevColl;return e?e.parent:null}},{key:"scriptUpdated",value:function(){this.set('scriptUpdated',1)}},{key:"initToolbar",value:function(){var t=this.em,e=t&&t.getConfig('stylePrefix')||'';if(!this.get('toolbar')){var n=[];this.collection&&n.push({attributes:{class:'fa fa-arrow-up'},command:function(t){return t.runCommand('core:component-exit',{force:1})}}),this.get('draggable')&&n.push({attributes:{class:"fa fa-arrows ".concat(e,"no-touch-actions"),draggable:!0},command:'tlb-move'}),this.get('copyable')&&n.push({attributes:{class:'fa fa-clone'},command:'tlb-clone'}),this.get('removable')&&n.push({attributes:{class:'fa fa-trash-o'},command:'tlb-delete'}),this.set('toolbar',n)}}},{key:"__loadTraits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t||this.get('traits');if(!(n instanceof A)){n=Object(O["isFunction"])(n)?n(this):n;var r=new A([],this.opt);r.setTarget(this),n.length&&(n.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(n)),this.set({traits:r},e)}return this}},{key:"getTraits",value:function(){return this.__loadTraits(),a()(this.get('traits').models)}},{key:"setTraits",value:function(t){var e=Object(O["isArray"])(t)?t:[t];return this.set({traits:e}),this.getTraits()}},{key:"getTrait",value:function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null}},{key:"updateTrait",value: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}},{key:"getTraitIndex",value:function(t){var e=this.getTrait(t);return e?this.get('traits').indexOf(e):-1}},{key:"removeTrait",value:function(t){var e,n=this,r=(Object(O["isArray"])(t)?t:[t]).map((function(t){return n.getTrait(t)})),i=this.get('traits'),o=r.length?i.remove(r):[];return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),Object(O["isArray"])(o)?o:[o]}},{key:"addTrait",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.__loadTraits();var r=this.get('traits').add(t,n);return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),Object(O["isArray"])(r)?r:[r]}},{key:"normalizeClasses",value:function(t){var e=[],n=this.em,r=n&&n.get('SelectorManager');if(r)return t.models?a()(t.models):(t.forEach((function(t){return e.push(r.add(t))})),e)}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=R({},this.attributes),r=R({},this.opt),i=this.getId(),o=e&&e.get('CssComposer');n.attributes=R({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=1),this.get('components').each((function(e,r){n.components[r]=e.clone(R(R({},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 s=new this.constructor(n,r),c="#".concat(s.getId()),l=o?o.getRules("#".concat(i)):[];l.forEach((function(t){var e=t.clone();e.set('selectors',[c]),o.getAll().add(e)})),s.set(B,0);var u=this.__getSymbol(),f=this.__getSymbols();t.symbol||!u&&!f?u?(u.set(B,[].concat(a()(u.__getSymbols()),[s])),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(B,[].concat(a()(f),[s])),s.set(z,this),s.__initSymb()):t.symbolInv?(this.set(B,[s]),s.set(z,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(B,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(z,s))):(s.set(z,0),s.set(B,0));var h='component:clone';return e&&e.trigger(h,s),this.trigger(h,s),s}},{key:"getName",value:function(){var t=this.em,e=this.attributes,n=e.type,r=e.tagName,i=this.get('name'),o='div'==r,a=n||(o?'box':r),s=!n&&r&&!o&&r,c='domComponents.names.',l=i&&t&&t.t("".concat(c).concat(i)),u=s&&t&&t.t("".concat(c).concat(s)),f=t&&(t.t("".concat(c).concat(n))||t.t("".concat(c).concat(r)));return this.get('custom-name')||l||i||u||Object(x["capitalize"])(s)||f||Object(x["capitalize"])(a)}},{key:"getIcon",value:function(){var t=this.get('icon');return t?t+' ':''}},{key:"toHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=t.tag,i=r||e.get('tagName'),o=e.get('void'),a=t.attributes,s=this.getAttrToHTML();for(var c in delete t.tag,a&&(Object(O["isFunction"])(a)?s=a(e,s)||{}:Object(x["isObject"])(a)&&(s=a)),s){var l=s[c],u=Object(O["isString"])(l)?l.replace(/"/g,'&quot;'):l;Object(O["isUndefined"])(u)||(Object(O["isBoolean"])(u)?u&&n.push(c):n.push("".concat(c,"=\"").concat(u,"\"")))}var f=n.length?" ".concat(n.join(' ')):'',h=e.__innerHTML(t),d="<".concat(i).concat(f).concat(o?'/':'',">").concat(h);return!o&&(d+="</".concat(i,">")),d}},{key:"__innerHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')}},{key:"getAttrToHTML",value:function(){var t=this.getAttributes();return delete t.style,t}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=k["Model"].prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,!t.fromUndo){var n=e[z],r=e[B];r&&Object(O["isArray"])(r)&&(e[B]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!Object(O["isString"])(n)&&(e[z]=n.getId())}return this.em.getConfig('avoidDefaults')&&this.getChangedProps(e),e}},{key:"getChangedProps",value:function(t){var e=t||k["Model"].prototype.toJSON.apply(this),n=Object(O["result"])(this,'defaults');return Object(O["forEach"])(n,(function(t,n){-1===['type'].indexOf(n)&&e[n]===t&&delete e[n]})),Object(O["isEmpty"])(e.type)&&delete e.type,Object(O["forEach"])(['attributes','style'],(function(t){Object(O["isEmpty"])(n[t])&&Object(O["isEmpty"])(e[t])&&delete e[t]})),Object(O["forEach"])(['classes','components'],(function(t){(!e[t]||Object(O["isEmpty"])(n[t])&&!e[t].length)&&delete e[t]})),e}},{key:"getId",value:function(){return(this.get('attributes')||{}).id||this.ccid||this.cid}},{key:"setId",value:function(t,e){var n=R({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this}},{key:"getEl",value:function(t){var e=this.getView(t);return e&&e.el}},{key:"getView",value:function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e}},{key:"getCurrentView",value:function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)}},{key:"__getScriptProps",value:function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})}},{key:"getScriptString",value:function(t){var e=this,n=t||this.get('script');if(!n)return n;if(this.get('script-props'))n=n.toString().trim();else{if('function'==typeof n){var r=n.toString().trim();n=(r=r.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var o=this.em.getConfig(),a=I(o.tagVarStart||'{[ '),s=I(o.tagVarEnd||' ]}'),c=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');n=n.replace(c,(function(t,n){e.scriptUpdated();var r=e.attributes[n]||'';return Object(O["isArray"])(r)||'object'==i()(r)?JSON.stringify(r):r}))}return n}},{key:"emitUpdate",value:function(t){for(var e=this.em,n=U+(t?":".concat(t):''),r=t&&this.get(t),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];t&&this.updated.apply(this,[t,r,t&&this.previous(t)].concat(o)),this.trigger.apply(this,[n].concat(o)),e&&e.trigger.apply(e,[n,this].concat(o)),['components','classes'].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:u()({},t,r),options:o[2]||o[1]||{}})}},{key:"onAll",value:function(t){return Object(O["isFunction"])(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=this.collection,i=function(){r&&r.remove(t,e),e.root&&t.components('')},o=R({},e);return[this,n].map((function(e){return e.trigger('component:remove:before',t,i,o)})),!o.abort&&i(),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.remove({temporary:1}),t&&t.append(this,e),this}},{key:"resetId",value:function(){var t=this.em,e=this.getId();if(e){var r=n.createId(this);this.setId(r);var i=t&&t.get('CssComposer').getIdRule(e),o=i&&i.get('selectors').at(0);return o&&o.set('name',r),this}}},{key:"_getStyleRule",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=this.em,r=e||this.getId();return n&&n.get('CssComposer').getIdRule(r)}},{key:"_getStyleSelector",value:function(t){var e=this._getStyleRule(t);return e&&e.get('selectors').at(0)}},{key:"_idUpdated",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.idUpdate){var i=this.ccid,o=this.get('attributes')||{},a=o.id,s=(this.previous('attributes')||{}).id||i,c=n.getList(this);if(c[a]||!a&&s)return this.setId(s,{idUpdate:1});delete c[s],c[a]=this,this.ccid=a;var l=this._getStyleSelector({id:s});l&&l.set({name:a,label:a})}}}]),n}(k["Model"].extend(C["a"]));$.isComponent=function(t){return{tagName:Object(x["toLowerCase"])(t.tagName)}},$.ensureInList=function(t){var e=$.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=$.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return $.ensureInList(t)}))},$.createId=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=$.getList(t),i=n.idMap,o=void 0===i?{}:i,a=t.get('attributes'),s=a.id;return s?(e=$.getIncrementId(s,r,n),t.setId(e),s!==e&&(o[s]=e)):e=$.getNewId(r),r[e]=t,e},$.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=$.getNewId(t);return r},$.getIncrementId=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.keepIds,i=void 0===r?[]:r,o=1,a=t;if(i.indexOf(t)<0)for(;e[a];)o++,a="".concat(t,"-").concat(o);return a},$.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,i=n.em,o=r||i&&i.get('DomComponents');return o?o.componentsById:{}},$.checkId=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object(O["isArray"])(t)?t:[t],o=r.keepIds,a=void 0===o?[]:o;i.forEach((function(t){var i=t.attributes,o=void 0===i?{}:i,s=t.components,c=o.id;if(c&&n[c]&&a.indexOf(c)<0){var l=$.getIncrementId(c,n);o.id=l,Object(O["isArray"])(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(c)&&(e[n]="#".concat(l))}))}))}s&&$.checkId(s,e,n,r)}))},$.getDefaults=function(){return Object(O["result"])(this.prototype,'defaults')},$.prototype.defaults=(D={tagName:'div',type:'',name:'',removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,'stylable-require':'','style-signature':'',unstylable:'',highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,void:!1,state:'',status:'',content:'',icon:'',style:'',styles:'',classes:'',script:'','script-props':'','script-export':'',attributes:'',traits:['id','title'],propagate:'',dmode:'',toolbar:null},u()(D,z,0),u()(D,B,0),u()(D,H,0),u()(D,"_undo",!0),u()(D,"_undoexc",['status','open']),D)},function(t,e,n){var r=n(77),i=n(78),o=n(48),a=n(79);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(3),a=n.n(o),s=n(0),c=n(30),l=n(40),u=n(21),f=n(13),h=n(1);function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=a.a.View.extend({className:function(){return this.getClasses()},tagName:function(){return this.model.get('tagName')},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},r=n.em,i=e.opt||{},o=this.$el,a=this.el;n.draggableComponents;this.opts=t,this.modelOpt=i,this.config=n,this.em=r||'',this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.attr=e.get('attributes'),this.classe=this.attr.class||[],this.listenTo(e,'change:style',this.updateStyle),this.listenTo(e,'change:attributes change:_innertext',this.renderAttributes),this.listenTo(e,'change:highlightable',this.updateHighlight),this.listenTo(e,'change:status',this.updateStatus),this.listenTo(e,'change:script rerender',this.reset),this.listenTo(e,'change:content',this.updateContent),this.listenTo(e,'change',this.handleChange),this.listenTo(e,'active',this.onActive),this.listenTo(e,'disable',this.onDisable),o.data('model',e),Object(h["setViewEl"])(a,this),e.view=this,this._getFrame()&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=p(p({},this.events),this.__isDraggable()&&{dragstart:'handleDragStart'}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())},__isDraggable:function(){var t=this.model,e=this.config,n=t.attributes,r=n._innertext,i=n.draggable;return e.draggableComponents&&i&&!r},_clbObj:function(){var t=this.em,e=this.model,n=this.el;return{editor:t&&t.getEditor(),model:e,el:n}},init:function(){},removed:function(){},onActive:function(){},onDisable:function(){},remove:function(){var t=this;a.a.View.prototype.remove.apply(t,arguments);var e=t.model,n=t._getFrame()||{},r=n.model;e.components().forEach((function(t){var e=t.getView(r);e&&e.remove()}));var i=t.childrenView;i&&i.remove();var o=e.views;return o.splice(o.indexOf(t),1),t.removed(t._clbObj()),t.$el.data({model:'',collection:'',view:''}),t},handleDragStart:function(t){t.preventDefault(),t.stopPropagation(),this.em.get('Commands').run('tlb-move',{target:this.model,event:t})},initClasses:function(){var t=this.model,e='change:classes',n=t.get('classes');n instanceof u["a"]&&(this.stopListening(t,e,this.initClasses),this.listenTo(t,e,this.initClasses),this.listenTo(n,'add remove change',this.updateClasses),n.length&&this.importClasses())},initComponents:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,r=this.childrenView,i='change:components',o=e.get('components'),a=[e,i,this.initComponents];o instanceof c["a"]&&(n.data('collection',o),r&&r.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))},handleChange:function(){var t=this.model,e=Object(s["keys"])(t.changed);if(1!==e.length||'status'!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)},importClasses:function(){var t=this.config.em.get('SelectorManager');t&&this.model.get('classes').each((function(e){t.add(e.get('name'))}))},updateStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e?e.get('Canvas').getConfig():{},r=n.extHl,i=this.el,o=this.model.get('status'),a=this.ppfx,s="".concat(a,"selected"),c="".concat(s,"-parent"),l="".concat(a,"freezed"),u="".concat(a,"hovered"),f=[s,c,l,u],h=r&&!t.noExtHl?'':s;this.$el.removeClass(f.join(' '));var d=i.getAttribute('class')||'',p='';switch(o){case'selected':p="".concat(d," ").concat(h);break;case'selected-parent':p="".concat(d," ").concat(c);break;case'freezed':p="".concat(d," ").concat(l);break;case'freezed-selected':p="".concat(d," ").concat(l," ").concat(h);break;case'hovered':p=t.avoidHover?'':"".concat(d," ").concat(u)}(p=p.trim())&&i.setAttribute('class',p)},updateHighlight:function(){var t=this.model.get('highlightable');this.setAttribute('data-highlightable',t?1:'')},updateStyle:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,i=this.em,o=this.el;if(i&&i.getConfig('avoidInlineStyle')&&!n.inline){var a=r.getStyle(),c=Object(s["isEmpty"])(a);!c&&r.setStyle(a),r.get('_innertext')&&c?o.removeAttribute('id'):o.id=r.getId()}else this.setAttribute('style',r.styleToString(n))},updateClasses:function(){var t=this.model.get('classes').pluck('name').join(' ');this.setAttribute('class',t),this.updateStatus(),this.onAttrUpdate()},setAttribute:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},getClasses:function(){return this.model.getClasses().join(' ')},updateAttributes:function(){var t=[],e=this.model,n=this.$el,r=this.el,i=e.attributes,o=i.highlightable,a=i.textable,c=p(p(p({'data-gjs-type':i.type||'default'},this.__isDraggable()?{draggable:!0}:{}),o?{'data-highlightable':1}:{}),a?{contenteditable:'false','data-gjs-textable':'true'}:{});Object(s["each"])(r.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return n.removeAttr(t)})),this.updateStyle();var l=p(p({},c),e.getAttributes());Object(s["keys"])(l).forEach((function(t){return!1===l[t]&&delete l[t]})),n.attr(l)},updateContent:function(){var t=this.model.get('content'),e=this.model.components().length;this.getChildrenContainer().innerHTML=e?'':t},prevDef:function(t){t.preventDefault()},updateScript:function(){var t=this.model,e=this.em;t.get('script')&&e&&e.get('Canvas').getCanvasView().updateScript(this)},getChildrenContainer:function(){var t=this.el;return'function'==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},getOffsetRect:function(){var t={},e=this.el,n=0,r=0;return function i(o){var a=o.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,i(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)}(e),t},isInViewport:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,a=e||this.getOffsetRect(),s=a.top,c=a.left,l=this._getFrame().getOffsetRect();return s>=l.scrollTop&&c>=l.scrollLeft&&s<=l.scrollBottom&&c<=o.offsetWidth+i.scrollLeft},scrollIntoView:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getOffsetRect(),n=this.isInViewport({rect:e});if(!n||t.force){var r=this.el;'smooth'!==t.behavior?r.ownerDocument.defaultView.scrollTo(0,e.top):r.scrollIntoView(p({behavior:'smooth',block:'nearest'},t))}},reset:function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),Object(f["m"])(t,this.el),this.render()},_setData:function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},_getFrame:function(){return this.config.frameView},renderChildren:function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new l["a"]({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,i=n.length;r<i;r++)t.appendChild(n.shift())},renderAttributes:function(){this.updateAttributes(),this.updateClasses()},onAttrUpdate:function(){},render:function(){return this.renderAttributes(),this.modelOpt.temporary||(this.renderChildren(),this.updateScript(),Object(h["setViewEl"])(this.el,this),this.postRender()),this},postRender:function(){var t=this.em,e=this.model;this.modelOpt.temporary||(this.onRender(this._clbObj()),t&&t.trigger('component:mount',e))},onRender:function(){}})},function(t,e,n){"use strict";n.d(e,"k",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"l",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"j",(function(){return f})),n.d(e,"m",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p})),n.d(e,"f",(function(){return g})),n.d(e,"g",(function(){return v})),n.d(e,"e",(function(){return m})),n.d(e,"c",(function(){return y}));var r=n(0),i='tag',o='attributes',a='transitionend oTransitionEnd transitionend webkitTransitionEnd',s=function(t){return t&&9===t.nodeType},c=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},l=function(t,e){return t.querySelectorAll(e)},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&t.setAttribute&&Object(r["each"])(e,(function(e,n){return t.setAttribute(n,e)}))},f=function(t){return t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},h=function(t,e){t.parentNode.replaceChild(e,t)},d=function(t,e,n){var i=t.childNodes,o=i.length,a=Object(r["isUndefined"])(n)?o:n;Object(r["isString"])(e)&&(t.insertAdjacentHTML('beforeEnd',e),e=t.lastChild,t.removeChild(e)),a>=o?t.appendChild(e):t.insertBefore(e,i[a])},p=function(t,e){return d(t,e)},g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2?arguments[2]:void 0,i=document.createElement(t);return e&&Object(r["each"])(e,(function(t,e){return i.setAttribute(e,t)})),n&&(Object(r["isString"])(n)?i.innerHTML=n:i.appendChild(n)),i},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(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},y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(e)?e:[e];n.forEach((function(e){var n=e[i]||'div',a=e[o]||{},s=document.createElement(n);Object(r["each"])(a,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports["default"]=t.exports,t.exports.__esModule=!0),n(e)}t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},,function(t,e,n){var r=n(80);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(5),i=n.n(r),o=n(6),a=n.n(o),s=n(7),c=n.n(s),l=n(8),u=n.n(l),f=n(4),h=n.n(f),d=n(3),p=n(0);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h()(t);if(e){var i=h()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var v=1,m=2,y=function(t){c()(n,t);var e=g(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"defaults",value:function(){return{name:'',label:'',type:v,active:!0,private:!1,protected:!1,_undo:!0}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.config,i=void 0===r?{}:r,o=this.get('name'),a=this.get('label');o?a||this.set('label',o):this.set('name',a);var s=this.get('name'),c=i.escapeName,l=c?c(s):n.escapeName(s);this.set('name',l),this.em=i.em}},{key:"isId",value:function(){return this.get('type')===m}},{key:"isClass",value:function(){return this.get('type')===v}},{key:"getFullName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.escape,n=this.get('name'),r='';switch(this.get('type')){case v:r='.';break;case m:r='#'}return r+(e?e(n):n)}},{key:"toString",value:function(){return this.getFullName()}},{key:"getLabel",value:function(){return this.get('label')}},{key:"setLabel",value:function(t){return this.set('label',t)}},{key:"getActive",value:function(){return this.get('active')}},{key:"setActive",value:function(t){return this.set('active',t)}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=d["Model"].prototype.toJSON.call(this,[t]),r=Object(p["result"])(this,'defaults');if(e&&e.getConfig('avoidDefaults')){Object(p["forEach"])(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var i=Object(p["keys"])(n).length;1===i&&n.name&&(n=n.name),2===i&&n.name&&n.type&&(n=this.getFullName())}return n}}]),n}(d["Model"]);y.prototype.idAttribute='name',y.TYPE_CLASS=v,y.TYPE_ID=m,y.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,'-')}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1);function i(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=t.raw;return o.reduce((function(t,e,i){var a=n[i-1],s=o[i-1];return Array.isArray(a)?a=a.join(''):s&&'$'===s.slice(-1)?t=t.slice(0,-1):a=Object(r["escape"])(a),t+a+e}))}},function(t,e,n){"use strict";n.r(e);var r='undefined'!=typeof document?document:null,i='undefined'!=typeof window?window:null,o=Array.prototype,a=o.filter,s=o.indexOf,c=o.map,l=o.push,u=o.reverse,f=o.slice,h=o.splice,d=/^#[\w-]*$/,p=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),p.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(_(t)){if(e.__cash&&(e=e[0]),!(n=d.test(t)?e.getElementById(t.slice(1)):g.test(t)?dt(t):m(t,e)))return}else if(P(t))return this.ready(t);(n.nodeType||n===i)&&(n=[n]),this.length=n.length;for(var o=0,a=this.length;o<a;o++)this[o]=n[o]}}function b(t,e){return new y(t,e)}var w=b.fn=b.prototype=y.prototype={constructor:b,__cash:!0,length:0,splice:h};w.get=function(t){return void 0===t?f.call(this):this[t<0?t+this.length:t]},w.eq=function(t){return b(this.get(t))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)},w.map=function(t){return b(c.call(this,(function(e,n){return t.call(e,n,e)})))},w.slice=function(){return b(f.apply(this,arguments))};var O=/(?:^\w|[A-Z]|\b\w)/g,x=/[\s-_]+/g;function C(t){return t.replace(O,(function(t,e){return t[e?'toUpperCase':'toLowerCase']()})).replace(x,'')}function k(t,e){for(var n=0,r=t.length;n<r&&!1!==e.call(t[n],t[n],n,t);n++);}b.camelCase=C,b.each=k,w.each=function(t){return k(this,(function(e,n){return t.call(e,n,e)})),this},w.removeProp=function(t){return this.each((function(e,n){delete n[t]}))},b.extend=w.extend=function(t){void 0===t&&(t=this);for(var e=arguments,n=e.length,r=n<2?0:1;r<n;r++)for(var i in e[r])t[i]=e[r][i];return t};var S=1;function j(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function P(t){return'function'==typeof t}function _(t){return'string'==typeof t}function T(t){return!isNaN(parseFloat(t))&&isFinite(t)}b.guid=S,b.matches=j,b.isFunction=P,b.isString=_,b.isNumeric=T;var E=Array.isArray;function D(t){return _(t)?function(e,n){return j(n,t)}:t.__cash?function(e,n){return t.is(n)}:function(t,e,n){return e===n}}b.isArray=E,w.prop=function(t,e){if(t){if(_(t))return arguments.length<2?this[0]&&this[0][t]:this.each((function(n,r){r[t]=e}));for(var n in t)this.prop(n,t[n]);return this}},w.filter=function(t){if(!t)return b();var e=P(t)?t:D(t);return b(a.call(this,(function(n,r){return e.call(n,r,n,t)})))};var M=/\S+/g;function A(t){return _(t)&&t.match(M)||[]}function L(t){return t.filter((function(t,e,n){return n.indexOf(t)===e}))}function R(t,e,n){if(1===t.nodeType){var r=i.getComputedStyle(t,null);return e?n?r.getPropertyValue(e):r[e]:r}}function N(t,e){return parseInt(R(t,e),10)||0}w.hasClass=function(t){var e=A(t),n=!1;return e.length&&this.each((function(t,r){return!(n=r.classList.contains(e[0]))})),n},w.removeAttr=function(t){var e=A(t);return e.length?this.each((function(t,n){k(e,(function(t){n.removeAttribute(t)}))})):this},w.attr=function(t,e){if(t){if(_(t)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(t);return null===n?void 0:n}return null===e?this.removeAttr(t):this.each((function(n,r){r.setAttribute(t,e)}))}for(var r in t)this.attr(r,t[r]);return this}},w.toggleClass=function(t,e){var n=A(t),r=void 0!==e;return n.length?this.each((function(t,i){k(n,(function(t){r?e?i.classList.add(t):i.classList.remove(t):i.classList.toggle(t)}))})):this},w.addClass=function(t){return this.toggleClass(t,!0)},w.removeClass=function(t){return arguments.length?this.toggleClass(t,!1):this.attr('class','')},b.unique=L,w.add=function(t,e){return b(L(this.get().concat(b(t,e).get())))};var I=/^--/;function F(t){return I.test(t)}var V={},B=r&&r.createElement('div'),z=B?B.style:{},H=['webkit','moz','ms','o'];function U(t,e){if(void 0===e&&(e=F(t)),e)return t;if(!V[t]){var n=C(t),r=''+n.charAt(0).toUpperCase()+n.slice(1);k((n+' '+H.join(r+' ')+r).split(' '),(function(e){if(e in z)return V[t]=e,!1}))}return V[t]}b.prefixedProp=U;var W={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function $(t,e,n){return void 0===n&&(n=F(t)),n||W[t]||!T(e)?e:e+'px'}w.css=function(t,e){if(_(t)){var n=F(t);return t=U(t,n),arguments.length<2?this[0]&&R(this[0],t,n):t?(e=$(t,e,n),this.each((function(r,i){1===i.nodeType&&(n?i.style.setProperty(t,e):i.style[t]=e)}))):this}for(var r in t)this.css(r,t[r]);return this};var q='__cashData',G=/^data-(.*)/;function K(t){return t[q]=t[q]||{}}function Y(t,e){var n=K(t);if(e){if(!(e in n)){var r=t.dataset?t.dataset[e]||t.dataset[C(e)]:b(t).attr('data-'+e);if(void 0!==r){try{r=JSON.parse(r)}catch(t){}n[e]=r}}return n[e]}return n}function X(t,e){return N(t,'border'+(e?'Left':'Top')+'Width')+N(t,'padding'+(e?'Left':'Top'))+N(t,'padding'+(e?'Right':'Bottom'))+N(t,'border'+(e?'Right':'Bottom')+'Width')}function J(t,e){for(var n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])<0)return!1;return!0}function Z(t,e,n){k(t[n],(function(t){t[0];var r=t[1];e.removeEventListener(n,r)})),delete t[n]}b.hasData=function(t){return q in t},w.data=function(t,e){var n=this;if(!t){if(!this[0])return;return k(this[0].attributes,(function(t){var e=t.name.match(G);e&&n.data(e[1])})),Y(this[0])}if(_(t))return void 0===e?this[0]&&Y(this[0],t):this.each((function(n,r){return function(t,e,n){K(t)[e]=n}(r,t,e)}));for(var r in t)this.data(r,t[r]);return this},w.removeData=function(t){return this.each((function(e,n){return function(t,e){void 0===e?delete t[q]:delete K(t)[e]}(n,t)}))},k(['Width','Height'],(function(t){w['inner'+t]=function(){if(this[0])return this[0]===i?i['inner'+t]:this[0]['client'+t]}})),k(['width','height'],(function(t,e){w[t]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each((function(r,i){if(1===i.nodeType){var o=R(i,'boxSizing');i.style[t]=$(t,n+('border-box'===o?X(i,!e):0))}}))):this[0]===i?this[0][C('outer-'+t)]:this[0].getBoundingClientRect()[t]-X(this[0],!e):void 0===n?void 0:this}})),k(['Width','Height'],(function(t,e){w['outer'+t]=function(n){if(this[0])return this[0]===i?i['outer'+t]:this[0]['offset'+t]+(n?N(this[0],'margin'+(e?'Top':'Left'))+N(this[0],'margin'+(e?'Bottom':'Right')):0)}}));var Q='__cashEvents',tt='.';function et(t){return t[Q]=t[Q]||{}}function nt(t){var e=t.split(tt);return[e[0],e.slice(1).sort()]}function rt(t,e,n,r){var i=et(t);if(e){var o=i[e];if(!o)return;r&&(r.guid=r.guid||S++),i[e]=o.filter((function(i){var o=i[0],a=i[1];if(r&&a.guid!==r.guid||!J(o,n))return!0;t.removeEventListener(e,a)}))}else if(n&&n.length)for(e in i)rt(t,e,n,r);else for(e in i)Z(i,t,e)}w.off=function(t,e){var n=this;return void 0===t?this.each((function(t,e){return rt(e)})):k(A(t),(function(t){var r=nt(t),i=r[0],o=r[1];n.each((function(t,n){return rt(n,i,o,e)}))})),this},w.on=function(t,e,n,r){var i=this;if(!_(t)){for(var o in t)this.on(o,e,t[o]);return this}return P(e)&&(n=e,e=!1),k(A(t),(function(t){var o=nt(t),a=o[0],s=o[1];i.each((function(t,i){var o=function t(o){if(!o.namespace||J(s,o.namespace.split(tt))){var c=i;if(e){for(var l=o.target;!j(l,e);){if(l===i)return;if(!(l=l.parentNode))return}c=l}o.namespace=o.namespace||'';var u=n.call(c,o,o.data);r&&rt(i,a,s,t),!1===u&&(o.preventDefault(),o.stopPropagation())}};o.guid=n.guid=n.guid||S++,function(t,e,n,r){r.guid=r.guid||S++;var i=et(t);i[e]=i[e]||[],i[e].push([n,r]),t.addEventListener(e,r)}(i,a,s,o)}))})),this},w.one=function(t,e,n){return this.on(t,e,n,!0)},w.ready=function(t){var e=function(){return t(b)};return'loading'!==r.readyState?setTimeout(e):r.addEventListener('DOMContentLoaded',e),this},w.trigger=function(t,e){var n=t;if(_(t)){var i=nt(t),o=i[0],a=i[1];(n=r.createEvent('HTMLEvents')).initEvent(o,!0,!0),n.namespace=a.join(tt)}return n.data=e,this.each((function(t,e){e.dispatchEvent(n)}))};var it=/select-one/i,ot=/select-multiple/i;function at(t){var e=t.type;return it.test(e)?function(t){return t.selectedIndex<0?null:t.options[t.selectedIndex].value}(t):ot.test(e)?function(t){var e=[];return k(t.options,(function(t){!t.selected||t.disabled||t.parentNode.disabled||e.push(t.value)})),e}(t):t.value}var st=/%20/g;var ct=/file|reset|submit|button|image/i,lt=/radio|checkbox/i;w.serialize=function(){var t='';return this.each((function(e,n){k(n.elements||[n],(function(e){if(!e.disabled&&e.name&&'FIELDSET'!==e.tagName&&!ct.test(e.type)&&(!lt.test(e.type)||e.checked)){var n=at(e);if(void 0!==n)k(E(n)?n:[n],(function(n){t+=function(t,e){return'&'+encodeURIComponent(t)+'='+encodeURIComponent(e).replace(st,'+')}(e.name,n)}))}}))})),t.substr(1)},w.val=function(t){return void 0===t?this[0]&&at(this[0]):this.each((function(e,n){var r=ot.test(n.type),i=null===t?r?[]:'':t;r&&E(i)?k(n.options,(function(t){t.selected=i.indexOf(t.value)>=0})):n.value=i}))},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 ut,ft=/^\s*<(\w+)[^>]*>/,ht=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function dt(t){if(function(){if(!ut){var t=r.createElement('table'),e=r.createElement('tr');ut={'*':r.createElement('div'),tr:r.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!_(t))return[];if(ht.test(t))return[r.createElement(RegExp.$1)];var e=ft.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function pt(t,e,n){if(void 0!==e){var r=_(e);!r&&e.length?k(e,(function(e){return pt(t,e,n)})):k(t,r?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=dt,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 k(arguments,(function(e){pt(t,e)})),this},w.appendTo=function(t){return pt(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,i){r.insertBefore(t?i.cloneNode(!0):i,n.nextSibling)}))})),this},w.after=function(){var t=this;return k(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,i){r.insertBefore(t?i.cloneNode(!0):i,n)}))})),this},w.before=function(){var t=this;return k(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return k(arguments,(function(e){pt(t,e,!0)})),this},w.prependTo=function(t){return pt(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 i=r.parentNode;if(i){var o=n?b(t).clone():b(t);if(!o[0])return e.remove(),!1;i.replaceChild(o[0],r),b(o[0]).after(o.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 gt=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+i.pageYOffset-gt.clientTop,left:e.left+i.pageXOffset-gt.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){l.apply(e,n.children)})),e=b(L(e)),t?e.filter((function(e,n){return j(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){l.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&L(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n<r;n++){var i=m(t,this[n]);i.length&&l.apply(e,i)}return b(e.length&&L(e))},w.has=function(t){var e=_(t)?function(e,n){return!!m(t,n).length}:function(e,n){return n.contains(t)};return this.filter(e)},w.is=function(t){if(!t||!this[0])return!1;var e=D(t),n=!1;return this.each((function(r,i){return!(n=e(r,i,t))})),n},w.next=function(){return b(this[0]&&this[0].nextElementSibling)},w.not=function(t){if(!t||!this[0])return this;var e=D(t);return this.filter((function(n,r){return!e(n,r,t)}))},w.parent=function(){var t=[];return this.each((function(e,n){n&&n.parentNode&&t.push(n.parentNode)})),b(L(t))},w.index=function(t){var e=t?b(t)[0]:this[0],n=t?this:b(e).parent().children();return s.call(n,e)},w.closest=function(t){return t&&this[0]?this.is(t)?this.filter(t):this.parent().closest(t):b()},w.parents=function(t){var e,n=[];return this.each((function(i,o){for(e=o;e&&e.parentNode&&e!==r.body.parentNode;)e=e.parentNode,(!t||t&&j(e,t))&&n.push(e)})),b(L(n))},w.prev=function(){return b(this[0]&&this[0].previousElementSibling)},w.siblings=function(){var t=this[0];return this.parent().children().filter((function(e,n){return n!==t}))},e["default"]=b},function(t,e){t.exports=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(5),i=n.n(r),o=n(6),a=n.n(o),s=n(7),c=n.n(s),l=n(8),u=n.n(l),f=n(4),h=n.n(f),d=n(0),p=n(3),g=n(17);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h()(t);if(e){var i=h()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var m=function t(e,n){return e.reduce((function(r,i,o){return r.concat(t(e.slice(o+1),"".concat(n).concat(i)))}),[n])},y=function(t){c()(n,t);var e=v(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"modelId",value:function(t){return"".concat(t.name,"_").concat(t.type||g["a"].TYPE_CLASS)}},{key:"getStyleable",value:function(){return Object(d["filter"])(this.models,(function(t){return t.get('active')&&!t.get('private')}))}},{key:"getValid",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDisabled;return Object(d["filter"])(this.models,(function(t){return!t.get('private')})).filter((function(t){return e?t.get('active'):1}))}},{key:"getFullString",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=t||this;return r.forEach((function(t){return n.push(t.getFullName(e))})),n.join('').trim()}},{key:"getFullName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.combination,n=t.array,r=[],i=this.map((function(e){return e.getFullName(t)})).sort();return e?i.forEach((function(t,e){r=r.concat(m(i.slice(e+1),t))})):r=i,n?r:e?r.join(','):r.join('')}}]),n}(p["Collection"]);y.prototype.model=g["a"]},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(11),a=n.n(o),s=n(0),c=n(1);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["a"]={getConfig:function(t){return this.__getConfig(t)},__getConfig:function(t){var e=this.config||{};return t?e[t]:e},getAll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?a()(this.all.models):this.all:[]},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},__initConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=u(u({},t),e),this.em=this.config.em},__initListen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=u({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))},__remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=Object(s["isString"])(t)?this.get(t):t,o=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,o,n),!n.abort&&o()},__catchAllEvent:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()},__appendTo:function(){var t=this.getConfig().appendTo;if(t){var e=Object(s["isElement"])(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},__onAllEvent:function(){},__logWarn:function(t){this.em.logWarning("[".concat(this.name,"]: ").concat(t))},_createId:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=Object(c["createId"])(r)}while(i[t]);return t},__listenAdd:function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenRemove:function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenUpdate:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},__destroy:function(){this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0}}},function(t,e,n){"use strict";n.r(e);var r=n(14),i=n.n(r),o=n(2),a=n.n(o),s=n(3),c=n.n(s),l=n(0),u=n(1),f=n(13),h=n(29);function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=c.a.View.extend({events:function(){return this.model.get('events')||{mousedown:'handleClick'}},attributes:function(){return this.model.get('attributes')},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config,n=void 0===e?{}:e;this.em=n.em,this.editor=n.editor},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.editor,n=this.em,r=e.Canvas.getFrameEl().getBoundingClientRect(),i=r.left,o=r.top,a=p(p({},t),{},{clientX:t.clientX-i,clientY:t.clientY-o});n.trigger('toolbar:run:before'),this.execCommand(a)},execCommand:function(t){var e={event:t},n=this.model.get('command'),r=this.editor;'function'==typeof n&&n(r,null,e),'string'==typeof n&&r.runCommand(n,e)},render:function(){var t=this.editor,e=this.$el,n=this.model,r=n.get('id'),i=n.get('label'),o=t.getConfig('stylePrefix');return e.addClass("".concat(o,"toolbar-item")),r&&e.addClass("".concat(o,"toolbar-item__").concat(r)),i&&e.append(i),this}}),v=h["a"].extend({itemView:g,initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config={editor:t.editor||'',em:t.em},this.listenTo(this.collection,'reset',this.render)}}),m=c.a.Model.extend({defaults:{command:'',attributes:{}}}),y=c.a.Collection.extend({model:m});function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var O,x=c.a.$;e["default"]={init:function(t){Object(l["bindAll"])(this,'onHover','onOut','onClick','onFrameScroll','onFrameUpdated','onContainerChange')},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),O=1},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this,n=this.em,r=n.getConfig('listenToEl'),i=n.getContainer().parentNode,o=t?'on':'off',a={on:u["on"],off:u["off"]};!r.length&&i&&r.push(i);a[o](window,'resize',this.onFrameUpdated),a[o](r,'scroll',this.onContainerChange),n[o]('component:toggled component:update',this.onSelect,this),n[o]('change:componentHovered',this.onHovered,this),n[o]('component:resize styleable:change component:input',this.updateGlobalPos,this),n[o]('component:update:toolbar',this._upToolbar,this),n[o]('change:canvasOffset',this.updateAttached,this),n[o]('frame:updated',this.onFrameUpdated,this),n[o]('canvas:updateTools',this.onFrameUpdated,this),n.get('Canvas').getFrames().forEach((function(t){var n,r,i=t.view;i&&(n=i.getWindow(),r=i.getBody(),a[o](r,'mouseover',e.onHover),a[o](r,'mouseleave',e.onOut),a[o](r,'click touchend',e.onClick),a[o](n,'scroll',e.onFrameScroll,!0))}))},onHover:function(t){t.stopPropagation();var e=t.target,n=Object(u["getViewEl"])(e),r=n&&n._getFrame(),i=x(e),o=i.data('model');if(!o)for(var a=i.parent();!o&&a.length&&!Object(f["i"])(a[0]);)o=a.data('model'),a=a.parent();if(o&&!o.get('hoverable')){for(var s=o&&o.parent();s&&!s.get('hoverable');)s=s.parent();o=s}this.currentDoc=e.ownerDocument,this.em.setHovered(o),r&&this.em.set('currentFrame',r)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(t,e){var n=this,r={};e?e.views.forEach((function(t){var i=t.el,o=n.getElementPos(i);r={el:i,pos:o,component:e,view:Object(u["getViewEl"])(i)},n.updateToolsLocal(r),i.ownerDocument===n.currentDoc&&(n.elHovered=r)})):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach((function(t){var e=t.view,r=e&&e.getToolsEl();r&&n.toggleToolsEl(0,0,{el:r})})))},onSelect:Object(l["debounce"])((function(){var t=this.em,e=t.getSelected(),n=t.get('currentFrame')||{},r=e&&e.getView(n.model),i=r&&r.el,o={};i&&Object(f["j"])(i)&&(o={el:i,pos:this.getElementPos(i),component:e,view:Object(u["getViewEl"])(i)});this.elSelected=o,this.updateToolsGlobal(),this.updateLocalPos(o),this.initResize(e)})),updateGlobalPos:function(){var t=this.getElSelected();t.el&&(t.pos=this.getElementPos(t.el),this.updateToolsGlobal())},updateLocalPos:function(t){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal(t))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered(0)},toggleToolsEl:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?'':'none'),r||{}},showElementOffset:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};O&&this.editor.runCommand('show-offset',{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand('show-offset',{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand('show-offset',{el:t,elPos:e,state:'Fixed'})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand('show-offset',{state:'Fixed'})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get('_cmpDrag'))return e.set('_cmpDrag');var n=x(t.target),r=n.data('model');if(!r)for(var i=n.parent();!r&&i.length&&!Object(f["i"])(i[0]);)r=i.data('model'),i=i.parent();if(r)if(r.get('selectable'))this.select(r,t);else{for(var o=r.parent();o&&!o.get('selectable');)o=o.parent();this.select(o,t)}},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(this.editor.select(t,{event:e}),this.initResize(t))},updateBadge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.canvas,i=x(t).data('model');if(i&&i.get('badgable')){var o=this.getBadge(n);if(!n.posOnly){var a=this.canvas.getConfig(),s=i.getIcon(),c=a.pStylePrefix||'',l="".concat(c,"badge"),u=a.customBadgeLabel,f="".concat(s?"<div class=\"".concat(l,"__icon\">").concat(s,"</div>"):'',"\n        <div class=\"").concat(l,"__name\">").concat(i.getName(),"</div>");o.innerHTML=u?u(i):f}var h='px',d=o.style;d.display='block';var p=r.getTargetToElementFixed(t,o,{pos:e}),g=p.top,v=n.leftOff<0?-n.leftOff:0;d.top=g+h,d.left=v+h}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e,n=this.em,r=this.canvas,o=n?n.get('Editor'):'',a=(n?n.get('Config'):'').stylePrefix||'',s="".concat(a,"resizing"),c=!Object(l["isElement"])(t)&&Object(u["isTaggableNode"])(t)?t:n.getSelected(),f=c&&c.get('resizable'),h={},d=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(o&&f){var p=Object(l["isElement"])(t)?t:c.getEl();h={onStart:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.el,a=i.config,s=i.resizer,l=a.keyHeight,f=a.keyWidth,h=a.currentUnit,p=a.keepAutoHeight,g=a.keepAutoWidth;d('add',0,i),e=n.get('StyleManager').getModelToStyle(c),r.toggleFramesEvents();var v=getComputedStyle(o),m=e.getStyle(),y=m[f];a.autoWidth=g&&'auto'===y,isNaN(parseFloat(y))&&(y=v[f]);var b=m[l];a.autoHeight=p&&'auto'===b,isNaN(parseFloat(b))&&(b=v[l]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(b),O=0,h&&(a.unitHeight=Object(u["getUnitFromValue"])(b),a.unitWidth=Object(u["getUnitFromValue"])(y))},onMove:function(){o.trigger('component:resize')},onEnd:function(t,e){d('remove',0,e),o.trigger('component:resize'),r.toggleFramesEvents(1),O=1},updateTarget:function(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=o.store,s=o.selectedHandler,c=o.config,l=c.keyHeight,u=c.keyWidth,f=c.autoHeight,h=c.autoWidth,d=c.unitWidth,p=c.unitHeight,g=['tc','bc'].indexOf(s)>=0,v=['cl','cr'].indexOf(s)>=0,m={},y=a?'':1;if(!g){var b=r.getBody().offsetWidth,O=i.w<b?i.w:b;m[u]=h?'auto':"".concat(O).concat(d)}v||(m[l]=f?'auto':"".concat(i.h).concat(p)),e.addStyle(w(w({},m),{},{en:y}),{avoidStore:!a});var x="update:component:style",C="".concat(x,":").concat(l," ").concat(x,":").concat(u);n&&n.trigger(C,null,null,{noEmit:1})}}},'object'==i()(f)&&(h=w(w(w({},h),f),{},{parent:h})),this.resizer=o.runCommand('resize',{el:p,options:h,force:1})}else o.stopCommand('resize'),this.resizer=null},updateToolbar:function(t){var e=this.config.em,n=t==e?e.getSelected():t,r=this.canvas.getToolbarEl(),i=r.style,o=n.get('toolbar'),a=e.get('Config').showToolbar;if(n&&a&&o&&o.length){if(i.display='',!this.toolbar){r.innerHTML='',this.toolbar=new y(o);var s=new v({collection:this.toolbar,editor:this.editor,em:e});r.appendChild(s.render().el)}this.toolbar.reset(o),i.top='-100px',i.left=0}else i.display='none'},updateToolbarPos:function(t){var e='px',n=this.canvas.getToolbarEl().style;n.top="".concat(t.top).concat(e),n.left="".concat(t.left).concat(e),n.opacity=''},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&'selected'===t.get('status')},updateToolsLocal:function(t){var e=t||this.getElHovered(),n=e.el,r=e.pos,i=e.view,o=e.component;if(n){var a=o.get('hoverable'),s=this.lastHovered!==n,c=s?{}:{posOnly:1};s&&a&&(this.lastHovered=n,this.showHighlighter(i),this.showElementOffset(n,r,{view:i})),this.isCompSelected(o)&&(this.hideHighlighter(i),this.hideElementOffset(i));var l='px',u=this.toggleToolsEl(1,i),f=u.style,h=this.canvas.canvasRectOffset(n,r),d=h.top,p=h.left;this.updateBadge(n,r,w(w({},c),{},{view:i,topOff:d,leftOff:p})),f.top=d+l,f.left=p+l,f.width=r.width+l,f.height=r.height+l,this._trgToolUp('local',{component:o,el:u,top:d,left:p,width:r.width,height:r.height})}else this.lastHovered=0},_upToolbar:Object(l["debounce"])((function(){this.updateToolsGlobal({force:1})})),_trgToolUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em.trigger('canvas:tools:update',w({type:t},e))},updateToolsGlobal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getElSelected(),n=e.el,r=e.pos,i=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var o=this.canvas,a=this.lastSelected!==n;(a||t.force)&&(this.lastSelected=n,this.updateToolbar(i));var s='px',c=this.toggleToolsEl(1),l=c.style,u=o.getTargetToElementFixed(n,o.getToolbarEl(),{pos:r}),f=u.canvasOffsetTop,h=u.canvasOffsetLeft;l.top=f+s,l.left=h+s,l.width=r.width+s,l.height=r.height+s,this.updateToolbarPos({top:u.top,left:u.left}),this._trgToolUp('global',{component:i,el:c,top:f,left:h,width:r.width,height:r.height})},updateAttached:Object(l["debounce"])((function(){this.updateGlobalPos()})),onContainerChange:Object(l["debounce"])((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display='none'},cleanPrevious:function(t){t&&t.set({status:'',state:''})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){Object(u["hasWin"])()&&(this.editor=t&&t.get('Editor'),this.enable())},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object(u["hasWin"])()){var r=this.em,i=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.toggleToolsEl(),i&&i.stopCommand('resize')}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(2),i=n.n(r),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(0),u=n(1);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a()(this,t),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},Object(l["bindAll"])(this,'drag','stop','keyHandle','handleScroll'),this.setOptions(e),this.delta={x:0,y:0},this}return c()(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=h(h({},this.opts),t)}},{key:"toggleDrag",value:function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=t?'on':'off',o={on:u["on"],off:u["off"]};o[i](n,'mousemove dragover',this.drag),o[i](e,'mouseup dragend touchend',this.stop),o[i](e,'keydown',this.keyHandle),o[i](r,'scroll',this.handleScroll)}},{key:"handleScroll",value:function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),r={x:n.x-t.x,y:n.y-t.y};this.move(e.x+r.x,e.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(t){var e=this.opts,n=e.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(t),this.guidesStatic=Object(l["result"])(e,'guidesStatic')||[],this.guidesTarget=Object(l["result"])(e,'guidesTarget')||[],Object(l["isFunction"])(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(t)}},{key:"drag",value:function(t){var e=this,n=this.opts,r=this.lastScrollDiff,i=this.globScrollDiff,o=n.onDrag,a=this.startPointer,s=this.getPointerPos(t),c={x:i.x+r.x,y:i.y+r.y};this.globScrollDiff=c;var u={x:s.x-a.x+c.x,y:s.y-a.y+c.y};this.lastScrollDiff={x:0,y:0};var f=this.lockedAxis;'x'===(f=t.shiftKey?!f&&this.detectAxisLock(u.x,u.y):null)?u.x=a.x:'y'===f&&(u.y=a.y);var d=function(r){['x','y'].forEach((function(t){return r[t]=r[t]*Object(l["result"])(n,'scale')})),e.delta=r,e.move(r.x,r.y),Object(l["isFunction"])(o)&&o(t,e)},p=h({},u);if(this.currentPointer=s,this.lockedAxis=f,this.lastScroll=this.getScrollInfo(),d(u),this.guidesTarget.length){var g=this.snapGuides(p),v=g.newDelta,m=g.trgX,y=g.trgY;(m||y)&&d(v)}0===t.which&&this.stop(t)}},{key:"snapGuides",value:function(t){var e=this,n=t,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=0,e.guidesStatic.forEach((function(o){if(!(n.y&&o.x||n.x&&o.y)){var a=n.y&&o.y,s=a?'y':'x',c=n[s],u=o[s],f=t[s],h=a?i:r;if(e.isPointIn(c,u)&&Object(l["isUndefined"])(h)){var d=f-(c-u);e.setGuideLock(n,d)}}})))})),r=this.trgX,i=this.trgY,['x','y'].forEach((function(r){var i=r.toUpperCase(),o=e["trg".concat(i)];o&&!e.isPointIn(t[r],o.lock)&&(e.setGuideLock(o,null),o=null),o&&!Object(l["isUndefined"])(o.lock)&&(n[r]=o.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return t>=e&&t<=e+i||t<=e&&t>=e-i}},{key:"setGuideLock",value:function(t,e){var n=Object(l["isUndefined"])(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=1,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t}},{key:"stop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=e.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var a=this.opts.onEnd;Object(l["isFunction"])(a)&&a(t,this,{cancelled:r})}},{key:"keyHandle",value:function(t){Object(u["isEscKey"])(t)&&this.stop(t,{cancel:1})}},{key:"move",value:function(t,e,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var a=i.setPosition,s=o.x+t,c=o.y+e;this.position={x:s,y:c,end:n},Object(l["isFunction"])(a)&&a(this.position),r&&(r.style.left="".concat(s,"px"),r.style.top="".concat(c,"px"))}}},{key:"getContainerEl",value:function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))}},{key:"getDocumentEl",value:function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(t){var e=this.opts.getPointerPosition,n=Object(u["getPointerEvent"])(t);return e?e(t):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return Object(l["isFunction"])(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n}},{key:"getScrollInfo",value:function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}}},{key:"detectAxisLock",value:function(t,e){var n=t,r=e,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?'x':n>o||n<-o?'y':void 0}}]),t}()},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=i.a.$;e["a"]=i.a.View.extend({events:{change:'handleChange'},template:function(){return"<span class=\"".concat(this.holderClass(),"\"></span>")},inputClass:function(){return"".concat(this.ppfx,"field")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ppfx||'';this.opts=t,this.ppfx=e,this.em=t.target||{},!t.onChange&&this.listenTo(this.model,'change:value',this.handleModelChange)},elementUpdated:function(){this.model.trigger('el:change')},setValue:function(t){var e=this.model,n=t||e.get('defaults'),r=this.getInputEl();r&&(r.value=n)},handleModelChange:function(t,e,n){this.setValue(e,n)},handleChange:function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},__onInputChange:function(t){this.model.set({value:t},{fromInput:1})},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=o("<input type=\"".concat(e,"\" placeholder=\"").concat(n,"\">"))}return this.inputEl.get(0)},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}})},function(t,e,n){t.exports=n(94)},function(t,e,n){1&&(t.exports=function(){'use strict';var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(t),l=c&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),f=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=h&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),v=/Android/.test(t),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),O=f&&t.match(/Version\/(\d*\.\d*)/);O&&(O=Number(O[1])),O&&O>=15&&(f=!1,c=!0);var x=y&&(l||f&&(null==O||O<12.11)),C=n||a&&s>=9;function k(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,j=function(t,e){var n=t.className,r=k(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function P(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function _(t,e){return P(t).appendChild(e)}function T(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function E(t,e,n,r){var i=T(t,e,n,r);return i.setAttribute("role","presentation"),i}function D(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function M(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function A(t,e){var n=t.className;k(e).test(n)||(t.className+=(n?" ":"")+e)}function L(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!k(n[r]).test(e)&&(e+=" "+n[r]);return e}S=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var R=function(t){t.select()};function N(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function I(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function F(t,e,n,r,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=r||0,a=i||0;;){var s=t.indexOf("\t",o);if(s<0||s>=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}g?R=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(R=function(t){try{t.select()}catch(t){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};function B(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}V.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},V.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var z=50,H={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},W={origin:"*mouse"},$={origin:"+move"};function q(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%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.length;r++)n[r]=e(t[r],r);return n}function J(){}function Z(t,e){var n;return Object.create?n=Object.create(t):(J.prototype=t,n=new J),e&&I(e,n),n}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function tt(t){return/\w/.test(t)||t>""&&(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 it(t){return t.charCodeAt(0)>=768&&rt.test(t)}function ot(t,e,n){for(;(n<0?e>0:e<t.length)&&it(t.charAt(e));)e+=n;return e}function at(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}var st=null;function ct(t,e,n){var r;st=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:st=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:st=i)}return null!=r?r:st}var lt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(t,e,n){this.level=t,this.from=e,this.to=n}return function(c,l){var u="ltr"==l?"L":"R";if(0==c.length||"ltr"==l&&!n.test(c))return!1;for(var f,h=c.length,d=[],p=0;p<h;++p)d.push((f=c.charCodeAt(p))<=247?t.charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?e.charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":8204==f?"b":"L");for(var g=0,v=u;g<h;++g){var m=d[g];"m"==m?d[g]=v:v=m}for(var y=0,b=u;y<h;++y){var w=d[y];"1"==w&&"r"==b?d[y]="n":i.test(w)&&(b=w,"r"==w&&(d[y]="R"))}for(var O=1,x=d[0];O<h-1;++O){var C=d[O];"+"==C&&"1"==x&&"1"==d[O+1]?d[O]="1":","!=C||x!=d[O+1]||"1"!=x&&"n"!=x||(d[O]=x),x=C}for(var k=0;k<h;++k){var S=d[k];if(","==S)d[k]="N";else if("%"==S){var j=void 0;for(j=k+1;j<h&&"%"==d[j];++j);for(var P=k&&"!"==d[k-1]||j<h&&"1"==d[j]?"1":"N",_=k;_<j;++_)d[_]=P;k=j-1}}for(var T=0,E=u;T<h;++T){var D=d[T];"L"==E&&"1"==D?d[T]="L":i.test(D)&&(E=D)}for(var M=0;M<h;++M)if(r.test(d[M])){var A=void 0;for(A=M+1;A<h&&r.test(d[A]);++A);for(var L="L"==(M?d[M-1]:u),R=L==("L"==(A<h?d[A]:u))?L?"L":"R":u,N=M;N<A;++N)d[N]=R;M=A-1}for(var I,F=[],V=0;V<h;)if(o.test(d[V])){var B=V;for(++V;V<h&&o.test(d[V]);++V);F.push(new s(0,B,V))}else{var z=V,H=F.length,U="rtl"==l?1:0;for(++V;V<h&&"L"!=d[V];++V);for(var W=z;W<V;)if(a.test(d[W])){z<W&&(F.splice(H,0,new s(1,z,W)),H+=U);var $=W;for(++W;W<V&&a.test(d[W]);++W);F.splice(H,0,new s(2,$,W)),H+=U,z=W}else++W;z<V&&F.splice(H,0,new s(1,z,V))}return"ltr"==l&&(1==F[0].level&&(I=c.match(/^\s+/))&&(F[0].from=I[0].length,F.unshift(new s(0,0,I[0].length))),1==Y(F).level&&(I=c.match(/\s+$/))&&(Y(F).to-=I[0].length,F.push(new s(0,h-I[0].length,h)))),"rtl"==l?F.reverse():F}}();function ut(t,e){var n=t.order;return null==n&&(n=t.order=lt(t.text,e)),n}var ft=[],ht=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||ft).concat(n)}};function dt(t,e){return t._handlers&&t._handlers[e]||ft}function pt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=B(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function gt(t,e){var n=dt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function vt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),gt(t,n||e.type,t,e),xt(e)||e.codemirrorIgnore}function mt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==B(n,e[r])&&n.push(e[r])}function yt(t,e){return dt(t,e).length>0}function bt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){pt(this,t,e)}}function wt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Ot(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),Ot(t)}function kt(t){return t.target||t.srcElement}function St(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var jt,Pt,_t=function(){if(a&&s<9)return!1;var t=T('div');return"draggable"in t||"dragDrop"in t}();function Tt(t){if(null==jt){var e=T("span","​");_(t,T("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(jt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=jt?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Et(t){if(null!=Pt)return Pt;var e=_(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),r=S(e,1,2).getBoundingClientRect();return P(t),!(!n||n.left==n.right)&&(Pt=r.right-n.right<3)}var Dt,Mt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},At=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Lt="oncopy"in(Dt=T("div"))||(Dt.setAttribute("oncopy","return;"),"function"==typeof Dt.oncopy),Rt=null,Nt={},It={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Nt[t]=e}function Vt(t){if("string"==typeof t&&It.hasOwnProperty(t))t=It[t];else if(t&&"string"==typeof t.name&&It.hasOwnProperty(t.name)){var e=It[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 Vt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Vt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Bt(t,e){e=Vt(e);var n=Nt[e.name];if(!n)return Bt(t,"text/plain");var r=n(t,e);if(zt.hasOwnProperty(e.name)){var i=zt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}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 Ht(t,e){I(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 i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}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 i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function Kt(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,(function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch)),i==e.line&&(o=o.slice(e.ch)),r.push(o),++i})),r}function Yt(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function Xt(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function Jt(t){if(null==t.parent)return null;for(var e=t.parent,n=B(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Zt(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return n+a}function Qt(t,e){return e>=t.first&&e<t.first+t.size}function te(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function ee(t,e,n){if(void 0===n&&(n=null),!(this instanceof ee))return new ee(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ne(t,e){return t.line-e.line||t.ch-e.ch}function re(t,e){return t.sticky==e.sticky&&0==ne(t,e)}function ie(t){return ee(t.line,t.ch)}function oe(t,e){return ne(t,e)<0?e:t}function ae(t,e){return ne(t,e)<0?t:e}function se(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ce(t,e){if(e.line<t.first)return ee(t.first,0);var n=t.first+t.size-1;return e.line>n?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 le(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ce(t,e[r]);return n}qt.prototype.eol=function(){return this.pos>=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.pos<this.string.length)return this.string.charAt(this.pos++)},qt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},qt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},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.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},qt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(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},fe=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 he(t,e,n,r){var i=[t.state.modeGen],o={};Oe(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],c=1,l=0;n.state=!0,Oe(t,e.text,s.mode,n,(function(t,e){for(var n=c;l<t;){var r=i[c];r>t&&i.splice(c,1,t,i[c+1],r),c+=2,l=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,c-n,t,"overlay "+e),c=n+2;else for(;n<c;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},c=0;c<t.state.overlays.length;++c)s(c);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function de(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=pe(t,Jt(e)),i=e.text.length>t.options.maxHighlightLength&&Ut(t.doc.mode,r.state),o=he(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.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 pe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new fe(r,!0,e);var o=function(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var c=Gt(o,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof ue?l.lookAhead:0)<=o.modeFrontier))return s;var u=F(c.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(t,e,n),a=o>r.first&&Gt(r,o-1).stateAfter,s=a?fe.fromSaved(r,a,o):new fe(r,$t(r.mode),o);return r.iter(o,e,(function(n){ge(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function ge(t,e,n,r){var i=t.doc.mode,o=new qt(e,t.options.tabSize,n);for(o.start=o.pos=r||0,""==e&&ve(i,n.state);!o.eol();)me(i,o,n.state),o.start=o.pos}function ve(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Wt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function me(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Wt(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}fe.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},fe.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}},fe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},fe.fromSaved=function(t,e,n){return e instanceof ue?new fe(t,Ut(t.mode,e.state),n,e.lookAhead):new fe(t,Ut(t.mode,e),n)},fe.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 ye=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 i,o,a=t.doc,s=a.mode,c=Gt(a,(e=ce(a,e)).line),l=pe(t,e.line,n),u=new qt(c.text,t.options.tabSize,l);for(r&&(o=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,i=me(s,u,l.state),r&&o.push(new ye(u,i,Ut(a.mode,l.state)));return r?o:new ye(u,i,l.state)}function we(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function Oe(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var c,l=0,u=null,f=new qt(e,t.options.tabSize,r),h=t.options.addModeClass&&[null];for(""==e&&we(ve(n,r.state),o);!f.eol();){if(f.pos>t.options.maxHighlightLength?(s=!1,a&&ge(t,e,r,f.pos),f.pos=e.length,c=null):c=we(me(n,f,r.state,h),o),h){var d=h[0].name;d&&(c="m-"+(c?d+" "+c:d))}if(!s||u!=c){for(;l<f.start;)i(l=Math.min(f.start,l+5e3),u);u=c}f.start=f.pos}for(;l<f.pos;){var p=Math.min(f.pos,l+5e3);i(p,u),l=p}}var xe=!1,Ce=!1;function ke(t,e,n){this.marker=t,this.from=e,this.to=n}function Se(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function je(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Pe(t,e){if(e.full)return null;var n=Qt(t,e.from.line)&&Gt(t,e.from.line).markedSpans,r=Qt(t,e.to.line)&&Gt(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==ne(e.from,e.to),s=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new ke(a,o.from,s?null:o.to))}}return r}(n,i,a),c=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new ke(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return r}(r,o,a),l=1==e.text.length,u=Y(e.text).length+(l?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=Se(c,h.marker);d?l&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(c)for(var p=0;p<c.length;++p){var g=c[p];null!=g.to&&(g.to+=u),null==g.from?Se(s,g.marker)||(g.from=u,l&&(s||(s=[])).push(g)):(g.from+=u,l&&(s||(s=[])).push(g))}s&&(s=_e(s)),c&&c!=s&&(c=_e(c));var v=[s];if(!l){var m,y=e.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new ke(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(c)}return v}function _e(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Te(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Ee(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function De(t){return t.inclusiveLeft?-1:0}function Me(t){return t.inclusiveRight?1:0}function Ae(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=ne(r.from,i.from)||De(t)-De(e);if(o)return-o;var a=ne(r.to,i.to)||Me(t)-Me(e);return a||e.id-t.id}function Le(t,e){var n,r=Ce&&t.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(e?i.from:i.to)&&(!n||Ae(n,i.marker)<0)&&(n=i.marker);return n}function Re(t){return Le(t,!0)}function Ne(t){return Le(t,!1)}function Ie(t,e){var n,r=Ce&&t.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||Ae(n,o.marker)<0)&&(n=o.marker)}return n}function Fe(t,e,n,r,i){var o=Gt(t,e),a=Ce&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var c=a[s];if(c.marker.collapsed){var l=c.marker.find(0),u=ne(l.from,n)||De(c.marker)-De(i),f=ne(l.to,r)||Me(c.marker)-Me(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?ne(l.to,n)>=0:ne(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?ne(l.from,r)<=0:ne(l.from,r)<0)))return!0}}}function Ve(t){for(var e;e=Re(t);)t=e.find(-1,!0).line;return t}function Be(t,e){var n=Gt(t,e),r=Ve(n);return n==r?e:Jt(r)}function ze(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!He(t,r))return e;for(;n=Ne(r);)r=n.find(1,!0).line;return Jt(r)+1}function He(t,e){var n=Ce&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ue(t,e,r))return!0}}function Ue(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return Ue(t,r.line,Se(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if((i=e.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ue(t,e,i))return!0}function We(t){for(var e=0,n=(t=Ve(t)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;e+=s.height}return e}function $e(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Re(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=Ne(r);){var o=e.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function qe(t){var e=t.display,n=t.doc;e.maxLine=Gt(n,n.first),e.maxLineLength=$e(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=$e(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ge=function(t,e,n){this.text=t,Ee(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Te(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=E("span",null,null,c?"padding-right: .1px":null),r={pre:E("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=tn,Et(t.display.measure)&&(a=ut(o,t.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],rn(o,r,de(t,o,e!=t.display.externalMeasured&&Jt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=L(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=L(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Tt(t.display.measure))),0==i?(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(c){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=L(r.pre.className,r.textClass||"")),r}function Qe(t){var e=T("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,i,o,c){if(e){var l,u=t.splitSpaces?function(t,e){if(t.length>1&&!/  /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(e,t.trailingSpace):e,f=t.cm.state.specialChars,h=!1;if(f.test(e)){l=document.createDocumentFragment();for(var d=0;1;){f.lastIndex=d;var p=f.exec(e),g=p?p.index-d:e.length-d;if(g){var v=document.createTextNode(u.slice(d,d+g));a&&s<9?l.appendChild(T("span",[v])):l.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=l.appendChild(T("span",K(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=l.appendChild(T("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?l.appendChild(T("span",[m])):l.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,l=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,l),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||h||o||c){var w=n||"";r&&(w+=r),i&&(w+=i);var O=T("span",[l],w,o);if(c)for(var x in c)c.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&O.setAttribute(x,c[x]);return t.content.appendChild(O)}t.content.appendChild(l)}}function en(t,e){return function(n,r,i,o,a,s,c){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var f=void 0,h=0;h<e.length&&!((f=e[h]).to>l&&f.from<=l);h++);if(f.to>=u)return t(n,r,i,o,a,s,c);t(n,r.slice(0,f.to-l),i,o,null,s,c),o=null,r=r.slice(f.to-l),l=f.to}}}function nn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function rn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,c,l,u,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){c=l=u=s="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var O=r[w],x=O.marker;if("bookmark"==x.type&&O.from==p&&x.widgetNode)y.push(x);else if(O.from<=p&&(null==O.to||O.to>p||x.collapsed&&O.to==p&&O.from==p)){if(null!=O.to&&O.to!=p&&m>O.to&&(m=O.to,l=""),x.className&&(c+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&O.from==p&&(u+=" "+x.startStyle),x.endStyle&&O.to==m&&(b||(b=[])).push(x.endStyle,O.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var C in x.attributes)(h||(h={}))[C]=x.attributes[C];x.collapsed&&(!f||Ae(f.marker,x)<0)&&(f=O)}else O.from>p&&m>O.from&&(m=O.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==m&&(l+=" "+b[k]);if(!f||f.from==p)for(var S=0;S<y.length;++S)nn(e,0,y[S]);if(f&&(f.from||0)==p){if(nn(e,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var j=Math.min(d,m);1;){if(v){var P=p+v.length;if(!f){var _=P>j?v.slice(0,j-p):v;e.addToken(e,_,a?a+c:c,u,p+_.length==m?l:"",s,h)}if(P>=j){v=v.slice(j-p),p=j;break}p=P,u=""}v=i.slice(o,o=n[g++]),a=Je(n[g++],e.cm.options)}}else for(var T=1;T<n.length;T+=2)e.addToken(e,i.slice(o,o=n[T]),Je(n[T+1],e.cm.options))}function on(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=Ne(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?Jt(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=He(t,e)}function an(t,e,n){for(var r,i=[],o=e;o<n;o=r){var a=new on(t.doc,Gt(t.doc,o),o);r=o+a.size,i.push(a)}return i}var sn=null,cn=null;function ln(t,e){var n=dt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:cn?r=cn:(r=cn=[],setTimeout(un,0));for(var o=function(t){r.push((function(){return n[t].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function un(){var t=cn;cn=null;for(var e=0;e<t.length;++e)t[e]()}function fn(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?pn(t,e):"gutter"==o?vn(t,e,n,r):"class"==o?gn(t,e):"widget"==o&&mn(t,e,r)}e.changes=null}function hn(t){return t.node==t.text&&(t.node=T("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),a&&s<8&&(t.node.style.zIndex=2)),t.node}function dn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):Ze(t,e)}function pn(t,e){var n=e.text.className,r=dn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,gn(t,e)):n&&(e.text.className=n)}function gn(t,e){!function(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var r=hn(e);e.background=r.insertBefore(T("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?hn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function vn(t,e,n,r){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var i=hn(e);e.gutterBackground=T("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=hn(e),s=e.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(T("div",te(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var c=0;c<t.display.gutterSpecs.length;++c){var l=t.display.gutterSpecs[c].className,u=o.hasOwnProperty(l)&&o[l];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function mn(t,e,n){e.alignable&&(e.alignable=null);for(var r=k("CodeMirror-linewidget"),i=e.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&e.node.removeChild(i);bn(t,e,n)}function yn(t,e,n,r){var i=dn(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),gn(t,e),vn(t,e,n,r),bn(t,e,r),e.node}function bn(t,e,n){if(wn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)wn(t,e.rest[r],e,n,!1)}function wn(t,e,n,r,i){if(e.widgets)for(var o=hn(n),a=0,s=e.widgets;a<s.length;++a){var c=s[a],l=T("div",[c.node],"CodeMirror-linewidget"+(c.className?" "+c.className:""));c.handleMouseEvents||l.setAttribute("cm-ignore-events","true"),On(c,l,n,r),t.display.input.setUneditable(l),i&&c.above?o.insertBefore(l,n.gutter||n.text):o.appendChild(l),ln(c,"redraw")}}function On(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!D(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),_(e.display.measure,T("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Cn(t,e){for(var n=kt(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function kn(t){return t.lineSpace.offsetTop}function Sn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function jn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=_(t.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function Pn(t){return z-t.display.nativeBarWidth}function _n(t){return t.display.scroller.clientWidth-Pn(t)-t.display.barWidth}function Tn(t){return t.display.scroller.clientHeight-Pn(t)-t.display.barHeight}function En(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if(Jt(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Dn(t,e,n,r){return Ln(t,An(t,e),n,r)}function Mn(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[fr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function An(t,e){var n=Jt(e),r=Mn(t,n);r&&!r.text?r=null:r&&r.changes&&(fn(t,r,n,ar(t)),t.curOp.forceUpdate=!0),r||(r=function(t,e){var n=Jt(e=Ve(e)),r=t.display.externalMeasured=new on(t.doc,e,n);r.lineN=n;var i=r.built=Ze(t,r);return r.text=i.pre,_(t.display.lineMeasure,i.pre),r}(t,e));var i=En(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ln(t,e,n,r,i){e.before&&(n=-1);var o,c=n+(r||"");return e.cache.hasOwnProperty(c)?o=e.cache[c]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var r=t.options.lineWrapping,i=r&&_n(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var c=a[s],l=a[s+1];Math.abs(c.bottom-l.bottom)>2&&o.push((c.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,r){var i,o=In(e.map,n,r),c=o.node,l=o.start,u=o.end,f=o.collapse;if(3==c.nodeType){for(var h=0;h<4;h++){for(;l&&it(e.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+u<o.coverEnd&&it(e.line.text.charAt(o.coverStart+u));)++u;if((i=a&&s<9&&0==l&&u==o.coverEnd-o.coverStart?c.parentNode.getBoundingClientRect():Fn(S(c,l,u).getClientRects(),r)).left||i.right||0==l)break;u=l,l-=1,f="right"}a&&s<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Rt)return Rt;var e=_(t,T("span","x")),n=e.getBoundingClientRect(),r=S(e,0,1).getBoundingClientRect();return Rt=Math.abs(n.left-r.left)>1}(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,i))}else{var d;l>0&&(f=r="right"),i=t.options.lineWrapping&&(d=c.getClientRects()).length>1?d["right"==r?d.length-1:0]:c.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var p=c.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+or(t.display),top:p.top,bottom:p.bottom}:Nn}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,O=y[b],x={left:("right"==f?i.right:i.left)-e.rect.left,right:("left"==f?i.left:i.right)-e.rect.left,top:w,bottom:O};return i.left||i.right||(x.bogus=!0),t.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=v),x}(t,e,n,r)).bogus||(e.cache[c]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Rn,Nn={left:0,right:0,top:0,bottom:0};function In(t,e,n){for(var r,i,o,a,s,c,l=0;l<t.length;l+=3)if(s=t[l],c=t[l+1],e<s?(i=0,o=1,a="left"):e<c?o=(i=e-s)+1:(l==t.length-3||e==c&&t[l+3]>e)&&(i=(o=c-s)-1,e>=c&&(a="right")),null!=i){if(r=t[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&t[l-2]==t[l-3]&&t[l-1].insertLeft;)r=t[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<t.length-3&&t[l+3]==t[l+4]&&!t[l+5].insertLeft;)r=t[(l+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function Fn(t,e){var n=Nn;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var i=t.length-1;i>=0&&(n=t[i]).left==n.right;i--);return n}function Vn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function Bn(t){t.display.externalMeasure=null,P(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Vn(t.display.view[e])}function zn(t){Bn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function Hn(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Un(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Wn(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=xn(t.widgets[n]));return e}function $n(t,e,n,r,i){if(!i){var o=Wn(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=We(e);if("local"==r?a+=kn(t.display):a-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Un());var c=s.left+("window"==r?0:Hn());n.left+=c,n.right+=c}return n.top+=a,n.bottom+=a,n}function qn(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=Hn(),i-=Un();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Gn(t,e,n,r,i){return r||(r=Gt(t.doc,e.line)),$n(t,r,Dn(t,r,e.ch,i),n)}function Kn(t,e,n,r,i,o){function a(e,a){var s=Ln(t,i,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,$n(t,r,s,n)}r=r||Gt(t.doc,e.line),i||(i=An(t,r));var s=ut(r,t.doc.direction),c=e.ch,l=e.sticky;if(c>=r.text.length?(c=r.text.length,l="before"):c<=0&&(c=0,l="after"),!s)return a("before"==l?c-1:c,"before"==l);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var f=ct(s,c,l),h=st,d=u(c,f,"before"==l);return null!=h&&(d.other=u(c,h,"before"!=l)),d}function Yn(t,e){var n=0;e=ce(t.doc,e),t.options.lineWrapping||(n=or(t.display)*e.ch);var r=Gt(t.doc,e.line),i=We(r)+kn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(t,e,n,r,i){var o=ee(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Jn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=Zt(r,n),o=r.first+r.size-1;if(i>o)return Xn(r.first+r.size-1,Gt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Gt(r,i);;){var s=er(t,a,i,e,n),c=Ie(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;a=Gt(r,i=l.line)}}function Zn(t,e,n,r){r-=Wn(e);var i=e.text.length,o=at((function(e){return Ln(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=at((function(e){return Ln(t,n,e).top>r}),o,i)}}function Qn(t,e,n,r){return n||(n=An(t,e)),Zn(t,e,n,$n(t,e,Ln(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,i){i-=We(e);var o=An(t,e),a=Wn(e),s=0,c=e.text.length,l=!0,u=ut(e,t.doc.direction);if(u){var f=(t.options.lineWrapping?rr:nr)(t,e,n,o,u,r,i);s=(l=1!=f.level)?f.from:f.to-1,c=l?f.to:f.from-1}var h,d,p=null,g=null,v=at((function(e){var n=Ln(t,o,e);return n.top+=a,n.bottom+=a,!!tr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,c),m=!1;if(g){var y=r-g.left<g.right-r,b=y==l;v=p+(b?0:1),d=b?"after":"before",h=y?g.left:g.right}else{l||v!=c&&v!=s||v++,d=0==v?"after":v==e.text.length?"before":Ln(t,o,v-(l?1:0)).bottom+a<=i==l?"after":"before";var w=Kn(t,ee(n,v,d),"line",e,o);h=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return Xn(n,v=ot(e.text,v,1),d,m,r-h)}function nr(t,e,n,r,i,o,a){var s=at((function(s){var c=i[s],l=1!=c.level;return tr(Kn(t,ee(n,l?c.to:c.from,l?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),c=i[s];if(s>0){var l=1!=c.level,u=Kn(t,ee(n,l?c.from:c.to,l?"after":"before"),"line",e,r);tr(u,o,a,!0)&&u.top>a&&(c=i[s-1])}return c}function rr(t,e,n,r,i,o,a){var s=Zn(t,e,r,a),c=s.begin,l=s.end;/\s/.test(e.text.charAt(l-1))&&l--;for(var u=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=l||d.to<=c)){var p=Ln(t,r,1!=d.level?Math.min(l,d.to)-1:Math.max(c,d.from)).right,g=p<o?o-p+1e9:p-o;(!u||f>g)&&(u=d,f=g)}}return u||(u=i[i.length-1]),u.from<c&&(u={from:c,to:u.to,level:u.level}),u.to>l&&(u={from:u.from,to:l,level:u.level}),u}function ir(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Rn){Rn=T("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Rn.appendChild(document.createTextNode("x")),Rn.appendChild(T("br"));Rn.appendChild(document.createTextNode("x"))}_(t.measure,Rn);var n=Rn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),P(t.measure),n||1}function or(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=T("span","xxxxxxxxxx"),n=T("pre",[e],"CodeMirror-line-like");_(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.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 cr(t){var e=ir(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/or(t.display)-3);return function(i){if(He(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function lr(t){var e=t.doc,n=cr(t);e.iter((function(t){var e=n(t);e!=t.height&&Xt(t,e)}))}function ur(t,e,n,r){var i=t.display;if(!n&&"true"==kt(e).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var c,l=Jn(t,o,a);if(r&&l.xRel>0&&(c=Gt(t.doc,l.line).text).length==l.ch){var u=F(c,c.length,t.options.tabSize)-c.length;l=ee(l.line,Math.max(0,Math.round((o-jn(t.display).left)/or(t.display))-u))}return l}function fr(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;r<n.length;r++)if((e-=n[r].size)<0)return r}function hr(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ce&&Be(t.doc,e)<i.viewTo&&pr(t);else if(n<=i.viewFrom)Ce&&ze(t.doc,n+r)>i.viewFrom?pr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)pr(t);else if(e<=i.viewFrom){var o=gr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):pr(t)}else if(n>=i.viewTo){var a=gr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pr(t)}else{var s=gr(t,e,e,-1),c=gr(t,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(an(t,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):pr(t)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:e<l.lineN+l.size&&(i.externalMeasured=null))}function dr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[fr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function pr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function gr(t,e,n,r){var i,o=fr(t,e),a=t.display.view;if(!Ce||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,c=0;c<o;c++)s+=a[c].size;if(s!=e){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;Be(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function vr(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function mr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function yr(t,e){void 0===e&&(e=!0);for(var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(e||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom)){var c=s.empty();(c||t.options.showCursorWhenSelecting)&&br(t,s.head,i),c||Or(t,s,o)}}return r}function br(t,e,n){var r=Kn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(T("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var o=Gn(t,e,"div",null,null);o.right-o.left>0&&(i.style.width=o.right-o.left+"px")}if(r.other){var a=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(t,e){return t.top-e.top||t.left-e.left}function Or(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=jn(t.display),s=a.left,c=Math.max(r.sizerWidth,_n(t)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n                             top: "+e+"px; width: "+(null==n?c-t:n)+"px;\n                             height: "+(r-e)+"px"))}function f(e,n,r){var o,a,f=Gt(i,e),h=f.text.length;function d(n,r){return Gn(t,ee(e,n),"div",f,r)}function p(e,n,r){var i=Qn(t,f,null,e),o="ltr"==n==("after"==r)?"left":"right";return d("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=ut(f,i.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var a=t[o];(a.from<n&&a.to>e||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}(g,n||0,null==r?h:r,(function(t,e,i,f){var v="ltr"==i,m=d(t,v?"left":"right"),y=d(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==h,O=0==f,x=!g||f==g.length-1;if(y.top-m.top<=3){var C=(l?w:b)&&x,k=(l?b:w)&&O?s:(v?m:y).left,S=C?c:(v?y:m).right;u(k,m.top,S-k,m.bottom)}else{var j,P,_,T;v?(j=l&&b&&O?s:m.left,P=l?c:p(t,i,"before"),_=l?s:p(e,i,"after"),T=l&&w&&x?c:y.right):(j=l?p(t,i,"before"):s,P=!l&&b&&O?c:m.right,_=!l&&w&&x?s:y.left,T=l?p(e,i,"after"):c),u(j,m.top,P-j,m.bottom),m.bottom<y.top&&u(s,m.bottom,null,y.top),u(_,y.top,T-_,y.bottom)}(!o||wr(m,o)<0)&&(o=m),wr(y,o)<0&&(o=y),(!a||wr(m,a)<0)&&(a=m),wr(y,a)<0&&(a=y)})),{start:o,end:a}}var h=e.from(),d=e.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=Gt(i,h.line),g=Gt(i,d.line),v=Ve(p)==Ve(g),m=f(h.line,h.ch,v?p.text.length+1:null).end,y=f(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(u(m.right,m.top,null,m.bottom),u(s,y.top,y.left,y.bottom)):u(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&u(s,m.bottom,null,y.top)}n.appendChild(o)}function xr(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||jr(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||Sr(t))}function kr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&jr(t))}),100)}function Sr(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,A(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),c&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),xr(t))}function jr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(gt(t,"blur",t,e),t.state.focused=!1,j(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Pr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),i=e.lineDiv.getBoundingClientRect().top,o=0,c=0;c<e.view.length;c++){var l=e.view[c],u=t.options.lineWrapping,f=void 0,h=0;if(!l.hidden){if(i+=l.line.height,a&&s<8){var d=l.node.offsetTop+l.node.offsetHeight;f=d-n,n=d}else{var p=l.node.getBoundingClientRect();f=p.bottom-p.top,!u&&l.text.firstChild&&(h=l.text.firstChild.getBoundingClientRect().right-p.left-1)}var g=l.line.height-f;if((g>.005||g<-.005)&&(i<r&&(o-=g),Xt(l.line,f),_r(l.line),l.rest))for(var v=0;v<l.rest.length;v++)_r(l.rest[v]);if(h>t.display.sizerWidth){var m=Math.ceil(h/or(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=l.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function _r(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Tr(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-kn(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Zt(e,r),a=Zt(e,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<o?(o=s,a=Zt(e,We(Gt(e,s))+t.wrapper.clientHeight)):Math.min(c,e.lastLine())>=a&&(o=Zt(e,We(Gt(e,c))-t.wrapper.clientHeight),a=c)}return{from:o,to:Math.max(a,o+1)}}function Er(t,e){var n=t.display,r=ir(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Tn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Sn(n),c=e.top<r,l=e.bottom>s-r;if(e.top<i)a.scrollTop=c?0:e.top;else if(e.bottom>i+o){var u=Math.min(e.top,(l?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var f=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-f,d=_n(t)-n.gutters.offsetWidth,p=e.right-e.left>d;return p&&(e.right=e.left+d),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left+f-(p?0:10)):e.right>d+h-3&&(a.scrollLeft=e.right+(p?0:10)-d),a}function Dr(t,e){null!=e&&(Lr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Mr(t){Lr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ar(t,e,n){null==e&&null==n||Lr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Lr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Rr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Rr(t,e,n,r){var i=Er(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});Ar(t,i.scrollLeft,i.scrollTop)}function Nr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Ir(t,e,!0),n&&li(t),ii(t,100))}function Ir(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 Fr(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,hi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Vr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Sn(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+Pn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Br=function(t,e,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),ht(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),ht(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.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 i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else 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 o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"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}},Br.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var t=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},Br.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},Br.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var zr=function(){};function Hr(t,e){e||(e=Vr(t));var n=t.display.barWidth,r=t.display.barHeight;Ur(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Pr(t),Ur(t,Vr(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:Br,null:zr};function $r(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&j(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),ht(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?Fr(t,e):Nr(t,e)}),t),t.display.scrollbars.addClass&&A(t.display.wrapper,t.display.scrollbars.addClass)}var qr=0;function Gr(t){var e;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},e=t.curOp,sn?sn.ops.push(e):e.ownsGroup=sn={ops:[e],delayedCallbacks:[]}}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<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}(n)}finally{sn=null,e(n)}}(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,n=0;n<e.length;n++)Yr(e[n]);for(var r=0;r<e.length;r++)Xr(e[r]);for(var i=0;i<e.length;i++)Jr(e[i]);for(var o=0;o<e.length;o++)Zr(e[o]);for(var a=0;a<e.length;a++)Qr(e[a])}(t)}))}function Yr(t){var e=t.cm,n=e.display;!function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Pn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Pn(t)+"px",e.scrollbarsClipped=!0)}(e),t.updateMaxLine&&qe(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new ai(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&si(t.cm,t.update)}function Jr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Pr(e),t.barMeasure=Vr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Dn(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+Pn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-_n(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<e.doc.scrollLeft&&Fr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==M();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&Hr(e,t.barMeasure),t.updatedDisplay&&fi(e,t.barMeasure),t.selectionChanged&&xr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Cr(t.cm)}function Qr(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&ci(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Ir(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Fr(e,t.scrollLeft,!0,!0),t.scrollToPos&&function(t,e){if(!vt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=T("div","​",null,"position: absolute;\n                         top: "+(e.top-n.viewOffset-kn(t.display))+"px;\n                         height: "+(e.bottom-e.top+Pn(t)+n.barHeight)+"px;\n                         left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,n,r){var i;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 o=0;o<5;o++){var a=!1,s=Kn(t,e),c=n&&n!=e?Kn(t,n):s,l=Er(t,i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r}),u=t.doc.scrollTop,f=t.doc.scrollLeft;if(null!=l.scrollTop&&(Nr(t,l.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=l.scrollLeft&&(Fr(t,l.scrollLeft),Math.abs(t.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}(e,ce(r,t.scrollToPos.from),ce(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||gt(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&gt(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&gt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function ti(t,e){if(t.curOp)return e();Gr(t);try{return e()}finally{Kr(t)}}function ei(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Gr(t);try{return e.apply(t,arguments)}finally{Kr(t)}}}function ni(t){return function(){if(this.curOp)return t.apply(this,arguments);Gr(this);try{return t.apply(this,arguments)}finally{Kr(this)}}}function ri(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Gr(e);try{return t.apply(this,arguments)}finally{Kr(e)}}}function ii(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,N(oi,t))}function oi(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=pe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Ut(e.mode,r.state):null,c=he(t,o,r,!0);s&&(r.state=s),o.styles=c.styles;var l=o.styleClasses,u=c.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=t.options.maxHighlightLength&&ge(t,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ii(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&ti(t,(function(){for(var e=0;e<i.length;e++)dr(t,i[e],"text")}))}}var ai=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Tr(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=_n(t),this.force=n,this.dims=ar(t),this.events=[]};function si(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return pr(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==vr(t))return!1;di(t)&&(pr(t),e.dims=ar(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ce&&(o=Be(t.doc,o),a=ze(t.doc,a));var s=o!=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.viewFrom<e&&(r.view=r.view.slice(fr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(an(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,fr(t,n)))),r.viewTo=n}(t,o,a),n.viewOffset=We(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=vr(t);if(!s&&0==l&&!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=M();if(!e||!D(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&D(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 l>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return c&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var l=r.view,u=r.viewFrom,f=0;f<l.length;f++){var h=l[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var d=i&&null!=e&&e<=u&&h.lineNumber;h.changes&&(B(h.changes,"gutter")>-1&&(d=!1),fn(t,h,u,n)),d&&(P(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(te(t.options,u)))),a=h.node.nextSibling}else{var p=yn(t,h,u,n);o.insertBefore(p,a)}u+=h.size}for(;a;)a=s(a)}(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=M()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&D(document.body,t.anchorNode)&&D(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,ii(t,400)),n.updateLineNumbers=null,!0}function ci(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=_n(t))r&&(e.visible=Tr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Sn(t.display)-Tn(t),n.top)}),e.visible=Tr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!si(t,e))break;Pr(t);var i=Vr(t);mr(t),Hr(t,i),fi(t,i),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 li(t,e){var n=new ai(t,e);if(si(t,n)){Pr(t),ci(t,n);var r=Vr(t);mr(t),Hr(t,r),fi(t,r),n.finish()}}function ui(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",ln(t,"gutterChanged",t)}function fi(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+Pn(t)+"px"}function hi(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,i=e.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function di(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=te(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ui(t.display),!0}return!1}function pi(t,e){for(var n=[],r=!1,i=0;i<t.length;i++){var o=t[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;r=!0}n.push({className:o,style:a})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function gi(t){var e=t.gutters,n=t.gutterSpecs;P(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=e.appendChild(T("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",ui(t)}function vi(t){gi(t.display),hr(t),hi(t)}function mi(t,e,r,i){var o=this;this.input=r,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=E("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[l],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute('translate','no'),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),c||n&&m||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pi(i.gutters,i.lineNumbers),gi(o),r.init(o)}ai.prototype.signal=function(t,e){yt(t,e)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var t=0;t<this.events.length;t++)gt.apply(null,this.events[t])};var yi=0,bi=null;function wi(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Oi(t){var e=wi(t);return e.x*=bi,e.y*=bi,e}function xi(t,e){var r=wi(e),i=r.x,o=r.y,a=t.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&l||o&&u){if(o&&y&&c)t:for(var h=e.target,d=a.view;h!=s;h=h.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==h){t.display.currentWheelTarget=h;break t}if(i&&!n&&!f&&null!=bi)return o&&u&&Nr(t,Math.max(0,s.scrollTop+o*bi)),Fr(t,Math.max(0,s.scrollLeft+i*bi)),(!o||o&&u)&&wt(e),void(a.wheelStartX=null);if(o&&null!=bi){var g=o*bi,v=t.doc.scrollTop,m=v+a.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(t.doc.height,m+g+50),li(t,{top:v,bottom:m})}yi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var t=s.scrollLeft-a.wheelStartX,e=s.scrollTop-a.wheelStartY,n=e&&a.wheelDY&&e/a.wheelDY||t&&a.wheelDX&&t/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(bi=(bi*yi+n)/(yi+1),++yi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?bi=-.53:n?bi=15:u?bi=-.7:h&&(bi=-1/3);var Ci=function(t,e){this.ranges=t,this.primIndex=e};Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(!re(n.anchor,r.anchor)||!re(n.head,r.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new ki(ie(this.ranges[e].anchor),ie(this.ranges[e].head));return new Ci(t,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},Ci.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ne(e,r.from())>=0&&ne(t,r.to())<=0)return n}return-1};var ki=function(t,e){this.anchor=t,this.head=e};function Si(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ne(t.from(),e.from())})),n=B(e,i);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],c=ne(s.to(),a.from());if(r&&!a.empty()?c>0:c>=0){var l=ae(s.from(),a.from()),u=oe(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new ki(f?u:l,f?l:u))}}return new Ci(e,n)}function ji(t,e){return new Ci([new ki(t,e||t)],0)}function Pi(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 _i(t,e){if(ne(t,e.from)<0)return t;if(ne(t,e.to)<=0)return Pi(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+=Pi(e).ch-e.to.ch),ee(n,r)}function Ti(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new ki(_i(i.anchor,e),_i(i.head,e)))}return Si(t.cm,n,t.sel.primIndex)}function Ei(t,e,n){return t.line==e.line?ee(n.line,t.ch-e.ch+n.ch):ee(n.line+(t.line-e.line),t.ch)}function Di(t){t.doc.mode=Bt(t.options,t.doc.modeOption),Mi(t)}function Mi(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,ii(t,100),t.state.modeGen++,t.curOp&&hr(t)}function Ai(t,e){return 0==e.from.ch&&0==e.to.ch&&""==Y(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Li(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){!function(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Te(t),Ee(t,n);var i=r?r(t):1;i!=t.height&&Xt(t,i)}(t,n,i,r),ln(t,"change",t,e)}function a(t,e){for(var n=[],o=t;o<e;++o)n.push(new Ge(l[o],i(o),r));return n}var s=e.from,c=e.to,l=e.text,u=Gt(t,s.line),f=Gt(t,c.line),h=Y(l),d=i(l.length-1),p=c.line-s.line;if(e.full)t.insert(0,a(0,l.length)),t.remove(l.length,t.size-l.length);else if(Ai(t,e)){var g=a(0,l.length-1);o(f,f.text,d),p&&t.remove(s.line,p),g.length&&t.insert(s.line,g)}else if(u==f)if(1==l.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(c.ch),d);else{var v=a(1,l.length-1);v.push(new Ge(h+u.text.slice(c.ch),d,r)),o(u,u.text.slice(0,s.ch)+l[0],i(0)),t.insert(s.line+1,v)}else if(1==l.length)o(u,u.text.slice(0,s.ch)+l[0]+f.text.slice(c.ch),i(0)),t.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+l[0],i(0)),o(f,h+f.text.slice(c.ch),d);var m=a(1,l.length-1);p>1&&t.remove(s.line+1,p-1),t.insert(s.line+1,m)}ln(t,"change",t,e)}function Ri(t,e,n){!function t(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var c=o&&s.sharedHist;n&&!c||(e(s.doc,c),t(s.doc,r,c))}}}(t,null,!0)}function Ni(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,lr(t),Di(t),Ii(t),t.options.direction=e.direction,t.options.lineWrapping||qe(t),t.options.mode=e.modeOption,hr(t)}function Ii(t){("rtl"==t.doc.direction?A:j)(t.display.lineDiv,"CodeMirror-rtl")}function Fi(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function Vi(t,e){var n={from:ie(e.from),to:Pi(e),text:Kt(t,e.from,e.to)};return Wi(t,n,e.from.line,e.to.line+1),Ri(t,(function(t){return Wi(t,n,e.from.line,e.to.line+1)}),!0),n}function Bi(t){for(;t.length&&Y(t).ranges;)t.pop()}function zi(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Bi(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}(i,i.lastOp==r)))a=Y(o.changes),0==ne(e.from,e.to)&&0==ne(e.from,a.to)?a.to=Pi(e):o.changes.push(Vi(t,e));else{var c=Y(i.done);for(c&&c.ranges||Ui(t.sel,i.done),o={changes:[Vi(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||gt(t,"historyAdded")}function Hi(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:Ui(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function Ui(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Wi(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function $i(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function qi(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push($i(n[i]));return r}(t,e),r=Pe(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var c=a[s],l=0;l<o.length;++l)if(o[l].marker==c.marker)continue t;o.push(c)}else a&&(n[i]=a)}return n}function Gi(t,e,n){for(var r=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)r.push(n?Ci.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var c=0;c<a.length;++c){var l=a[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),e)for(var f in l)(u=f.match(/^spans_(\d+)$/))&&B(e,Number(u[1]))>-1&&(Y(s)[f]=l[f],delete l[f])}}}return r}function Ki(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ne(e,i)<0;o!=ne(n,i)<0?(i=e,e=n):o!=ne(e,n)<0&&(e=n)}return new ki(i,e)}return new ki(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),to(t,new Ci([Ki(t.sel.primary(),e,n,i)],0),r)}function Xi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)r[o]=Ki(t.sel.ranges[o],e[o],null,i);to(t,Si(t.cm,r,t.sel.primIndex),n)}function Ji(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,to(t,Si(t.cm,i,t.sel.primIndex),r)}function Zi(t,e,n,r){to(t,ji(e,n),r)}function Qi(t,e,n){var r=t.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=e,eo(t,e,n)):to(t,e,n)}function to(t,e,n){eo(t,e,n),Hi(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function eo(t,e,n){(yt(t,"beforeSelectionChange")||t.cm&&yt(t.cm,"beforeSelectionChange"))&&(e=function(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new ki(ce(t,e[n].anchor),ce(t,e[n].head))},origin:n&&n.origin};return gt(t,"beforeSelectionChange",t,r),t.cm&&gt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?Si(t.cm,r.ranges,r.ranges.length-1):e}(t,e,n));var r=n&&n.bias||(ne(e.primary().head,t.sel.primary().head)<0?-1:1);no(t,io(t,e,r,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||Mr(t.cm)}function no(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,mt(t.cm)),ln(t,"cursorActivity",t))}function ro(t){no(t,io(t,t.sel,null,!1))}function io(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],c=ao(t,a.anchor,s&&s.anchor,n,r),l=ao(t,a.head,s&&s.head,n,r);(i||c!=a.anchor||l!=a.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new ki(c,l))}return i?Si(t.cm,i,e.primIndex):e}function oo(t,e,n,r,i){var o=Gt(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],c=s.marker,l="selectLeft"in c?!c.selectLeft:c.inclusiveLeft,u="selectRight"in c?!c.selectRight:c.inclusiveRight;if((null==s.from||(l?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(i&&(gt(c,"beforeCursorEnter"),c.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!c.atomic)continue;if(n){var f=c.find(r<0?1:-1),h=void 0;if((r<0?u:l)&&(f=so(t,f,-r,f&&f.line==e.line?o:null)),f&&f.line==e.line&&(h=ne(f,n))&&(r<0?h<0:h>0))return oo(t,f,e,r,i)}var d=c.find(r<0?-1:1);return(r<0?l:u)&&(d=so(t,d,r,d.line==e.line?o:null)),d?oo(t,d,e,r,i):null}}return e}function ao(t,e,n,r,i){var o=r||1,a=oo(t,e,n,o,i)||!i&&oo(t,e,n,o,!0)||oo(t,e,n,-o,i)||!i&&oo(t,e,n,-o,!0);return a||(t.cantEdit=!0,ee(t.first,0))}function so(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?ce(t,ee(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line<t.first+t.size-1?ee(e.line+1,0):null:new ee(e.line,e.ch+n)}function co(t){t.setSelection(ee(t.firstLine(),0),ee(t.lastLine()),U)}function lo(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,o){e&&(r.from=ce(t,e)),n&&(r.to=ce(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),gt(t,"beforeChange",t,r),t.cm&&gt(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function uo(t,e,n){if(t.cm){if(!t.cm.curOp)return ei(t.cm,uo)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(yt(t,"beforeChange")||t.cm&&yt(t.cm,"beforeChange"))||(e=lo(t,e,!0))){var r=xe&&!n&&function(t,e,n){var r=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),c=0;c<i.length;++c){var l=i[c];if(!(ne(l.to,s.from)<0||ne(l.from,s.to)>0)){var u=[c,1],f=ne(l.from,s.from),h=ne(l.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:l.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)fo(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else fo(t,e)}}function fo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ne(e.from,e.to)){var n=Ti(t,e);zi(t,e,n,t.cm?t.cm.curOp.id:NaN),go(t,e,n,Pe(t,e));var r=[];Ri(t,(function(t,n){n||-1!=B(r,t.history)||(bo(t.history,e),r.push(t.history)),go(t,e,null,Pe(t,e))}))}}function ho(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,c="undo"==e?o.undone:o.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(t.sel):i.ranges);l++);if(l!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Ui(i,c),n&&!i.equals(t.sel))return void to(t,i,{clearRedo:!1});a=i}var u=[];Ui(a,c),c.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=yt(t,"beforeChange")||t.cm&&yt(t.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=e,f&&!lo(t,r,!1))return s.length=0,{};u.push(Vi(t,r));var o=n?Ti(t,r):Y(s);go(t,r,o,qi(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Pi(r)});var a=[];Ri(t,(function(t,e){e||-1!=B(a,t.history)||(bo(t.history,r),a.push(t.history)),go(t,r,null,qi(t,r))}))},d=i.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function po(t,e){if(0!=e&&(t.first+=e,t.sel=new Ci(X(t.sel.ranges,(function(t){return new ki(ee(t.anchor.line+e,t.anchor.ch),ee(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(t.cm,r,"gutter")}}function go(t,e,n,r){if(t.cm&&!t.cm.curOp)return ei(t.cm,go)(t,e,n,r);if(e.to.line<t.first)po(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);po(t,i),e={from:ee(t.first,0),to:ee(e.to.line+i,e.to.ch),text:[Y(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:ee(o,Gt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Ti(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,c=o.line;t.options.lineWrapping||(c=Jt(Ve(Gt(r,o.line))),r.iter(c,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&mt(t),Li(r,e,n,cr(t)),t.options.lineWrapping||(r.iter(c,o.line+e.text.length,(function(t){var e=$e(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=Gt(t,r).stateAfter;if(i&&(!(i instanceof ue)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(r,o.line),ii(t,400);var l=e.text.length-(a.line-o.line)-1;e.full?hr(t):o.line!=a.line||1!=e.text.length||Ai(t.doc,e)?hr(t,o.line,a.line+1,l):dr(t,o.line,"text");var u=yt(t,"changes"),f=yt(t,"change");if(f||u){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};f&&ln(t,"change",t,h),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}(t.cm,e,r):Li(t,e,r),eo(t,n,U),t.cantEdit&&ao(t,ee(t.firstLine(),0))&&(t.cantEdit=!1)}}function vo(t,e,n,r,i){var o;r||(r=n),ne(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),uo(t,{from:n,to:r,text:e,origin:i})}function mo(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function yo(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){o.copied||((o=t[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)mo(o.ranges[s].anchor,e,n,r),mo(o.ranges[s].head,e,n,r)}else{for(var c=0;c<o.changes.length;++c){var l=o.changes[c];if(n<l.from.line)l.from=ee(l.from.line+r,l.from.ch),l.to=ee(l.to.line+r,l.to.ch);else if(e<=l.to.line){a=!1;break}}a||(t.splice(0,i+1),i=0)}}}function bo(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;yo(t.done,n,r,i),yo(t.undone,n,r,i)}function wo(t,e,n,r){var i=e,o=e;return"number"==typeof e?o=Gt(t,se(t,e)):i=Jt(e),null==i?null:(r(o,i)&&t.cm&&dr(t.cm,i,n),o)}function Oo(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function xo(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize(),n+=i.height,i.parent=this}this.size=e,this.height=n,this.parent=null}ki.prototype.from=function(){return ae(this.anchor,this.head)},ki.prototype.to=function(){return oe(this.anchor,this.head)},ki.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Oo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var i=this.lines[n];this.height-=i.height,Ke(i),ln(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(t<i){var o=Math.min(e,i-t),a=r.height;if(r.removeInner(t,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof Oo))){var s=[];this.collapse(s),this.children=[new Oo(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<=o){if(i.insertInner(t,e,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var c=new Oo(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new xo(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=B(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new xo(t.children);r.parent=t,t.children=[r,e],t=r}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<o){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var Co=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function ko(t,e,n){We(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Dr(t,n)}Co.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=Jt(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=xn(this);Xt(n,Math.max(0,n.height-o)),t&&(ti(t,(function(){ko(t,n,-o),dr(t,r,"widget")})),ln(t,"lineWidgetCleared",t,this,r))}},Co.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=xn(this)-e;i&&(He(this.doc,r)||Xt(r,r.height+i),n&&ti(n,(function(){n.curOp.forceUpdate=!0,ko(n,r,i),ln(n,"lineWidgetChanged",n,t,Jt(r))})))},bt(Co);var So=0,jo=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++So};function Po(t,e,n,r,i){if(r&&r.shared)return function(t,e,n,r,i){(r=I(r)).shared=!1;var o=[Po(t,e,n,r,i)],a=o[0],s=r.widgetNode;return Ri(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Po(t,ce(t,e),ce(t,n),r,i));for(var c=0;c<t.linked.length;++c)if(t.linked[c].isParent)return;a=Y(o)})),new _o(o,a)}(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return ei(t.cm,Po)(t,e,n,r,i);var o=new jo(t,i),a=ne(e,n);if(r&&I(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Fe(t,e.line,e,n,o)||e.line!=n.line&&Fe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ce=!0}o.addToHistory&&zi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,c=e.line,l=t.cm;if(t.iter(c,n.line+1,(function(r){l&&o.collapsed&&!l.options.lineWrapping&&Ve(r)==l.display.maxLine&&(s=!0),o.collapsed&&c!=e.line&&Xt(r,0),function(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&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 ke(o,c==e.line?e.ch:null,c==n.line?n.ch:null),t.cm&&t.cm.curOp),++c})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){He(t,e)&&Xt(e,0)})),o.clearOnEnter&&ht(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xe=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)hr(l,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)dr(l,u,"text");o.atomic&&ro(l.doc),ln(l,"markerAdded",l,o)}return o}jo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Gr(t),yt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Se(a.markedSpans,this);t&&!this.collapsed?dr(t,Jt(a),"text"):t&&(null!=s.to&&(i=Jt(a)),null!=s.from&&(r=Jt(a))),a.markedSpans=je(a.markedSpans,s),null==s.from&&this.collapsed&&!He(this.doc,a)&&t&&Xt(a,ir(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=Ve(this.lines[c]),u=$e(l);u>t.display.maxLineLength&&(t.display.maxLine=l,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&hr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ro(t.doc)),t&&ln(t,"markerCleared",t,this,r,i),e&&Kr(t),this.parent&&this.parent.clear()}},jo.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Se(o.markedSpans,this);if(null!=a.from&&(n=ee(e?o:Jt(o),a.from),-1==t))return n;if(null!=a.to&&(r=ee(e?o:Jt(o),a.to),1==t))return r}return n&&{from:n,to:r}},jo.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&ti(r,(function(){var i=e.line,o=Jt(e.line),a=Mn(r,o);if(a&&(Vn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!He(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var c=xn(n)-s;c&&Xt(i,i.height+c)}ln(r,"markerChanged",r,t)}))},jo.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=B(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},jo.prototype.detachLine=function(t){if(this.lines.splice(B(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},bt(jo);var _o=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function To(t){return t.findMarks(ee(t.first,0),t.clipPos(ee(t.lastLine())),(function(t){return t.parent}))}function Eo(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];Ri(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==B(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}_o.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();ln(this,"clear")}},_o.prototype.find=function(t,e){return this.primary.find(t,e)},bt(_o);var Do=0,Mo=function(t,e,n,r,i){if(!(this instanceof Mo))return new Mo(t,e,n,r,i);null==n&&(n=0),xo.call(this,[new Oo([new Ge("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ee(n,0);this.sel=ji(o),this.history=new Fi(null),this.id=++Do,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Li(this,{from:o,to:o,text:t}),to(this,ji(o),U)};Mo.prototype=Z(xo.prototype,{constructor:Mo,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Yt(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:ri((function(t){var e=ee(this.first,0),n=this.first+this.size-1;uo(this,{from:e,to:ee(n,Gt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Ar(this.cm,0,0),to(this,ji(e),U)})),replaceRange:function(t,e,n,r){vo(this,t,e=ce(this,e),n=n?ce(this,n):e,r)},getRange:function(t,e,n){var r=Kt(this,ce(this,t),ce(this,e));return!1===n?r:''===n?r.join(''):r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(Qt(this,t))return Gt(this,t)},getLineNumber:function(t){return Jt(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Gt(this,t)),Ve(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ce(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(t,e,n){Zi(this,ce(this,"number"==typeof t?ee(t,e||0):t),null,n)})),setSelection:ri((function(t,e,n){Zi(this,ce(this,t),ce(this,e||t),n)})),extendSelection:ri((function(t,e,n){Yi(this,ce(this,t),e&&ce(this,e),n)})),extendSelections:ri((function(t,e){Xi(this,le(this,t),e)})),extendSelectionsBy:ri((function(t,e){Xi(this,le(this,X(this.sel.ranges,t)),e)})),setSelections:ri((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new ki(ce(this,t[i].anchor),ce(this,t[i].head||t[i].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),to(this,Si(this.cm,r,e),n)}})),addSelection:ri((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new ki(ce(this,t),ce(this,e||t))),to(this,Si(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Kt(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Kt(this,n[r].from(),n[r].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:ri((function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(t[o]),origin:n}}for(var s=e&&"end"!=e&&function(t,e,n){for(var r=[],i=ee(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],c=Ei(s.from,i,o),l=Ei(Pi(s),i,o);if(i=s.to,o=l,"around"==n){var u=t.sel.ranges[a],f=ne(u.head,u.anchor)<0;r[a]=new ki(f?l:c,f?c:l)}else r[a]=new ki(c,c)}return new Ci(r,t.sel.primIndex)}(this,r,e),c=r.length-1;c>=0;c--)uo(this,r[c]);s?Qi(this,s):this.cm&&Mr(this.cm)})),undo:ri((function(){ho(this,"undo")})),redo:ri((function(){ho(this,"redo")})),undoSelection:ri((function(){ho(this,"undo",!0)})),redoSelection:ri((function(){ho(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.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Fi(this.history),Ri(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Gi(this.history.done),undone:Gi(this.history.undone)}},setHistory:function(t){var e=this.history=new Fi(this.history);e.done=Gi(t.done.slice(0),null,!0),e.undone=Gi(t.undone.slice(0),null,!0)},setGutterMarker:ri((function(t,e,n){return wo(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&nt(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:ri((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&wo(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,nt(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!Qt(this,t))return null;if(e=t,!(t=Gt(this,t)))return null}else if(null==(e=Jt(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:ri((function(t,e,n){return wo(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(k(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:ri((function(t,e,n){return wo(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(k(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ri((function(t,e,n){return function(t,e,n,r){var i=new Co(t,n,r),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),wo(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!He(t,e)){var r=We(e)<t.scrollTop;Xt(e,e.height+xn(i)),r&&Dr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,i,"number"==typeof e?e:Jt(e)),i}(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return Po(this,ce(this,t),ce(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return Po(this,t=ce(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Gt(this,(t=ce(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ce(this,t),e=ce(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var c=a[s];null!=c.to&&i==t.line&&t.ch>=c.to||null==c.from&&i!=t.line||null!=c.from&&i==e.line&&c.from>=e.ch||n&&!n(c.marker)||r.push(c.marker.parent||c.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>t)return e=t,!0;t-=o,++n})),ce(this,ee(n,e))},indexFromPos:function(t){var e=(t=ce(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new Mo(Yt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var r=new Mo(Yt(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(ne(o,a)){var s=Po(t,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,To(this)),r},unlinkDoc:function(t){if(t instanceof Ta&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),Eo(To(this));break}if(t.history==this.history){var n=[t.id];Ri(t,(function(t){return n.push(t.id)}),!0),t.history=new Fi(null),t.history.done=Gi(this.history.done,n),t.history.undone=Gi(this.history.undone,n)}},iterLinkedDocs:function(t){Ri(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Mt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&ti(e=this.cm,(function(){Ii(e),hr(e)})))}))}),Mo.prototype.eachLine=Mo.prototype.iter;var Ao=0;function Lo(t){var e=this;if(Ro(e),!vt(e,t)&&!Cn(e.display,t)){wt(t),a&&(Ao=+new Date);var n=ur(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,c=function(){++s==i&&ei(e,(function(){var t={from:n=ce(e.doc,n),to:n,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};uo(e.doc,t),Qi(e.doc,ji(ce(e.doc,n),ce(e.doc,Pi(t))))}))()},l=function(t,n){if(e.options.allowDropFileTypes&&-1==B(e.options.allowDropFileTypes,t.type))c();else{var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[n]=t),c()},r.readAsText(t)}},u=0;u<r.length;u++)l(r[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var f=t.dataTransfer.getData("Text");if(f){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),eo(e.doc,ji(n,n)),h)for(var d=0;d<h.length;++d)vo(e.doc,"",h[d].anchor,h[d].head,"drag");e.replaceSelection(f,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Ro(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function No(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Io=!1;function Fo(){var t;Io||(ht(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,No(Vo)}),100))})),ht(window,"blur",(function(){return No(jr)})),Io=!0)}function Vo(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Bo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},zo=0;zo<10;zo++)Bo[zo+48]=Bo[zo+96]=String(zo);for(var Ho=65;Ho<=90;Ho++)Bo[Ho]=String.fromCharCode(Ho);for(var Uo=1;Uo<=12;Uo++)Bo[Uo+111]=Bo[Uo+63235]="F"+Uo;var Wo={};function $o(t){var e,n,r,i,o=t.split(/-(?!$)/);t=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function qo(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=X(n.split(" "),$o),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var c=e[s];if(c){if(c!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var l in e)t[l]=e[l];return t}function Go(t,e,n,r){var i=(e=Jo(e)).call?e.call(t,r):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Go(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=Go(t,e.fallthrough[o],n,r);if(a)return a}}}function Ko(t){var e="string"==typeof t?t:Bo[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Yo(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(x?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(x?e.ctrlKey:e.metaKey)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Xo(t,e){if(f&&34==t.keyCode&&t["char"])return!1;var n=Bo[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Yo(n,t,e))}function Jo(t){return"string"==typeof t?Wo[t]:t}function Zo(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&ne(o.from,Y(r).to)<=0;){var a=r.pop();if(ne(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ti(t,(function(){for(var e=r.length-1;e>=0;e--)vo(t.doc,"",r[e].from,r[e].to,"+delete");Mr(t)}))}function Qo(t,e,n){var r=ot(t.text,e+n,n);return r<0||r>t.text.length?null:r}function ta(t,e,n){var r=Qo(t,e.ch,n);return null==r?null:new ee(e.line,r,n<0?"after":"before")}function ea(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ut(n,e.doc.direction);if(o){var a,s=i<0?Y(o):o[0],c=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var l=An(e,n);a=i<0?n.text.length-1:0;var u=Ln(e,l,a).top;a=at((function(t){return Ln(e,l,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Qo(n,a,1))}else a=i<0?s.to:s.from;return new ee(r,a,c)}}return new ee(r,i<0?n.text.length:0,i<0?"before":"after")}Wo.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"},Wo.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"},Wo.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"},Wo.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"]},Wo["default"]=y?Wo.macDefault:Wo.pcDefault;var na={selectAll:co,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return Zo(t,(function(e){if(e.empty()){var n=Gt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:ee(e.head.line+1,0)}:{from:e.head,to:ee(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Zo(t,(function(e){return{from:ee(e.from().line,0),to:ce(t.doc,ee(e.to().line+1,0))}}))},delLineLeft:function(t){return Zo(t,(function(t){return{from:ee(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Zo(t,(function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return Zo(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(ee(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(ee(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return ra(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ia(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return function(t,e){var n=Gt(t.doc,e),r=function(t){for(var e;e=Ne(t);)t=e.find(1,!0).line;return t}(n);return r!=n&&(e=Jt(r)),ea(!0,t,n,e,-1)}(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),$)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),$)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?ia(t,e.head):r}),$)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(t.getLine(o.line),o.ch,r);e.push(K(r-a%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return ti(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,o=Gt(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ee(i.line,i.ch-1)),i.ch>0)i=new ee(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ee(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Gt(t.doc,i.line-1).text;a&&(i=new ee(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ee(i.line-1,a.length-1),i,"+transpose"))}n.push(new ki(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return ti(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<e.length;r++)t.indentLine(e[r].from().line,null,!0);Mr(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ra(t,e){var n=Gt(t.doc,e),r=Ve(n);return r!=n&&(e=Jt(r)),ea(!0,t,r,e,1)}function ia(t,e){var n=ra(t,e.line),r=Gt(t.doc,n.line),i=ut(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return ee(n.line,a?0:o,n.sticky)}return n}function oa(t,e,n){if("string"==typeof e&&!(e=na[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=H}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}var aa=new V;function sa(t,e,n,r){var i=t.state.keySeq;if(i){if(Ko(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:aa.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),ca(t,i+" "+e,n,r))return!0}return ca(t,e,n,r)}function ca(t,e,n,r){var i=function(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Go(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Go(e,t.options.extraKeys,n,t)||Go(e,t.options.keyMap,n,t)}(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&ln(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(wt(n),xr(t)),!!i}function la(t,e){var n=Xo(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?sa(t,"Shift-"+n,e,(function(e){return oa(t,e,!0)}))||sa(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return oa(t,e)})):sa(t,n,e,(function(e){return oa(t,e)})))}var ua=null;function fa(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=M(),vt(e,t)))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var i=la(e,t);f&&(ua=i?r:null,i||88!=r||Lt||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(j(e,"CodeMirror-crosshair"),pt(document,"keyup",n),pt(document,"mouseover",n))}A(e,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n)}(e)}}function ha(t){16==t.keyCode&&(this.doc.sel.shift=!1),vt(this,t)}function da(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Cn(e.display,t)||vt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(f&&n==ua)return ua=null,void wt(t);if(!f||t.which&&!(t.which<10)||!la(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(t,e,n){return sa(t,"'"+n+"'",e,(function(e){return oa(t,e,!0)}))}(e,t,i)||e.display.input.onKeyPress(t))}}}var pa,ga,va=400,ma=function(t,e,n){this.time=t,this.pos=e,this.button=n};function ya(t){var e=this,n=e.display;if(!(vt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Cn(n,t))c||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Oa(e,t)){var r=ur(e,t),i=St(t),o=r?function(t,e){var n=+new Date;return ga&&ga.compare(n,t,e)?(pa=ga=null,"triple"):pa&&pa.compare(n,t,e)?(ga=new ma(n,t,e),pa=null,"double"):(pa=new ma(n,t,e),ga=null,"single")}(r,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&function(t,e,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),sa(t,Yo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,(function(e){if("string"==typeof e&&(e=na[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=H}finally{t.state.suppressEdits=!1}return r}))}(e,i,r,o,t)||(1==i?r?function(t,e,n,r){a?setTimeout(N(Cr,t),0):t.curOp.focus=M();var i,o=function(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(t,n,r),l=t.doc.sel;t.options.dragDrop&&_t&&!t.isReadOnly()&&"single"==n&&(i=l.contains(e))>-1&&(ne((i=l.ranges[i]).from(),e)<0||e.xRel>0)&&(ne(i.to(),e)>0||e.xRel<0)?function(t,e,n,r){var i=t.display,o=!1,l=ei(t,(function(e){c&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:kr(t)),pt(i.wrapper.ownerDocument,"mouseup",l),pt(i.wrapper.ownerDocument,"mousemove",u),pt(i.scroller,"dragstart",f),pt(i.scroller,"drop",l),o||(wt(e),r.addNew||Yi(t.doc,n,null,null,r.extend),c&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},f=function(){return o=!0};c&&(i.scroller.draggable=!0),t.state.draggingText=l,l.copy=!r.moveOnDrag,ht(i.wrapper.ownerDocument,"mouseup",l),ht(i.wrapper.ownerDocument,"mousemove",u),ht(i.scroller,"dragstart",f),ht(i.scroller,"drop",l),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(t,r,e,o):function(t,e,n,r){a&&kr(t);var i=t.display,o=t.doc;wt(e);var s,c,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=o.sel.contains(n),s=c>-1?u[c]:new ki(n,n)):(s=o.sel.primary(),c=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new ki(n,n)),n=ur(t,e,!0,!0),c=-1;else{var f=ba(t,n,r.unit);s=r.extend?Ki(s,f.anchor,f.head,r.extend):f}r.addNew?-1==c?(c=u.length,to(o,Si(t,u.concat([s]),c),{scroll:!1,origin:"*mouse"})):u.length>1&&u[c].empty()&&"char"==r.unit&&!r.extend?(to(o,Si(t,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Ji(o,c,s,W):(c=0,to(o,new Ci([s],0),W),l=o.sel);var h=n;function d(e){if(0!=ne(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,u=F(Gt(o,n.line).text,n.ch,a),f=F(Gt(o,e.line).text,e.ch,a),d=Math.min(u,f),p=Math.max(u,f),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Gt(o,g).text,y=q(m,d,a);d==p?i.push(new ki(ee(g,y),ee(g,y))):m.length>y&&i.push(new ki(ee(g,y),ee(g,q(m,p,a))))}i.length||i.push(new ki(n,n)),to(o,Si(t,l.ranges.slice(0,c).concat(i),c),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,O=ba(t,e,r.unit),x=w.anchor;ne(O.anchor,x)>0?(b=O.head,x=ae(w.from(),O.anchor)):(b=O.anchor,x=oe(w.to(),O.head));var C=l.ranges.slice(0);C[c]=function(t,e){var n=e.anchor,r=e.head,i=Gt(t.doc,n.line);if(0==ne(n,r)&&n.sticky==r.sticky)return e;var o=ut(i);if(!o)return e;var a=ct(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var c,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return e;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ct(o,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);c=u==l-1||u==l?f<0:f>0}var h=o[l+(c?-1:0)],d=c==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?e:new ki(new ee(n.line,p,g),r)}(t,new ki(ce(o,x),b)),to(o,Si(t,C,c),W)}}var p=i.wrapper.getBoundingClientRect(),g=0;function v(e){t.state.selectingText=!1,g=1/0,e&&(wt(e),i.input.focus()),pt(i.wrapper.ownerDocument,"mousemove",m),pt(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var m=ei(t,(function(e){0!==e.buttons&&St(e)?function e(n){var a=++g,s=ur(t,n,!0,"rectangle"==r.unit);if(s)if(0!=ne(s,h)){t.curOp.focus=M(),d(s);var c=Tr(i,o);(s.line>=c.to||s.line<c.from)&&setTimeout(ei(t,(function(){g==a&&e(n)})),150)}else{var l=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;l&&setTimeout(ei(t,(function(){g==a&&(i.scroller.scrollTop+=l,e(n))})),50)}}(e):v(e)})),y=ei(t,v);t.state.selectingText=y,ht(i.wrapper.ownerDocument,"mousemove",m),ht(i.wrapper.ownerDocument,"mouseup",y)}(t,r,e,o)}(e,r,o,t):kt(t)==n.scroller&&wt(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?e.display.input.onContextMenu(t):kr(e)))}}function ba(t,e,n){if("char"==n)return new ki(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ki(ee(e.line,0),ce(t.doc,ee(e.line+1,0)));var r=n(t,e);return new ki(r.from,r.to)}function wa(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&wt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!yt(t,n))return xt(e);o-=s.top-a.viewOffset;for(var c=0;c<t.display.gutterSpecs.length;++c){var l=a.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i)return gt(t,n,t,Zt(t.doc,o),t.display.gutterSpecs[c].className,e),xt(e)}}function Oa(t,e){return wa(t,e,"gutterClick",!0)}function xa(t,e){Cn(t.display,e)||function(t,e){return!!yt(t,"gutterContextMenu")&&wa(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function Ca(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)}ma.prototype.compare=function(t,e,n){return this.time+va>t&&0==ne(e,this.pos)&&n==this.button};var ka={toString:function(){return"CodeMirror.Init"}},Sa={},ja={};function Pa(t,e,n){if(!e!=!(n&&n!=ka)){var r=t.display.dragFunctions,i=e?ht:pt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function _a(t){t.options.lineWrapping?(A(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(j(t.display.wrapper,"CodeMirror-wrap"),qe(t)),lr(t),hr(t),zn(t),setTimeout((function(){return Hr(t)}),100)}function Ta(t,e){var n=this;if(!(this instanceof Ta))return new Ta(t,e);this.options=e=e?I(e):{},I(Sa,e,!1);var r=e.value;"string"==typeof r?r=new Mo(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ta.inputStyles[e.inputStyle](this),o=this.display=new mi(t,r,i,e);for(var l in o.wrapper.CodeMirror=this,Ca(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 V,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",ei(t,ya)),ht(e.scroller,"dblclick",a&&s<11?ei(t,(function(e){if(!vt(t,e)){var n=ur(t,e);if(n&&!Oa(t,e)&&!Cn(t.display,e)){wt(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return vt(t,e)||wt(e)}),ht(e.scroller,"contextmenu",(function(e){return xa(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||xa(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>20*20}ht(e.scroller,"touchstart",(function(i){if(!vt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!Oa(t,i)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(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 a,s=t.coordsChar(e.activeTouch,"page");a=!r.prev||o(r,r.prev)?new ki(s,s):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(s):new ki(ee(s.line,0),ce(t.doc,ee(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),wt(n)}i()})),ht(e.scroller,"touchcancel",i),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Nr(t,e.scroller.scrollTop),Fr(t,e.scroller.scrollLeft,!0),gt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return xi(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return xi(t,e)})),ht(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=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),_(t.display.dragCursor,r)}}(t,e),Ct(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Ao<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&&!h)){var n=T("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:ei(t,Lo),leave:function(e){vt(t,e)||Ro(t)}};var c=e.input.getField();ht(c,"keyup",(function(e){return ha.call(t,e)})),ht(c,"keydown",ei(t,fa)),ht(c,"keypress",ei(t,da)),ht(c,"focus",(function(e){return Sr(t,e)})),ht(c,"blur",(function(e){return jr(t,e)}))}(this),Fo(),Gr(this),this.curOp.forceUpdate=!0,Ni(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):jr(this),ja)ja.hasOwnProperty(l)&&ja[l](this,e[l],ka);di(this),e.finishInit&&e.finishInit(this);for(var u=0;u<Ea.length;++u)Ea[u](this);Kr(this),c&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ta.defaults=Sa,Ta.optionHandlers=ja;var Ea=[];function Da(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=pe(t,e).state:n="prev");var a=t.options.tabSize,s=Gt(o,e),c=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var l,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((l=o.mode.indent(i,s.text.slice(u.length),s.text))==H||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=e>o.first?F(Gt(o,e-1).text,null,a):0:"add"==n?l=c+t.options.indentUnit:"subtract"==n?l=c-t.options.indentUnit:"number"==typeof n&&(l=c+n),l=Math.max(0,l);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(l/a);d;--d)h+=a,f+="\t";if(h<l&&(f+=K(l-h)),f!=u)return vo(o,f,ee(e,0),ee(e,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==e&&g.head.ch<u.length){var v=ee(e,u.length);Ji(o,p,new ki(v,v));break}}}Ta.defineInitHook=function(t){return Ea.push(t)};var Ma=null;function Aa(t){Ma=t}function La(t,e,n,r,i){var o=t.doc;t.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||t.state.pasteIncoming>a,c=Mt(e),l=null;if(s&&r.ranges.length>1)if(Ma&&Ma.text.join("\n")==e){if(r.ranges.length%Ma.text.length==0){l=[];for(var u=0;u<Ma.text.length;u++)l.push(o.splitLines(Ma.text[u]))}}else c.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(l=X(c,(function(t){return[t]})));for(var f=t.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var d=r.ranges[h],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=ee(p.line,p.ch-n):t.state.overwrite&&!s?g=ee(g.line,Math.min(Gt(o,g.line).text.length,g.ch+Y(c).length)):s&&Ma&&Ma.lineWise&&Ma.text.join("\n")==c.join("\n")&&(p=g=ee(p.line,0)));var v={from:p,to:g,text:l?l[h%l.length]:c,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};uo(t.doc,v),ln(t,"inputRead",t,v)}e&&!s&&Na(t,e),Mr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=f),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ra(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||ti(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 i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(e.indexOf(o.electricChars.charAt(s))>-1){a=Da(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Gt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Da(t,i.head.line,"smart"));a&&ln(t,"electricInput",t,i.head.line)}}}function Ia(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,o={anchor:ee(i,0),head:ee(i+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function Fa(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function Va(){var t=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=T("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?t.style.width="1000px":t.setAttribute("wrap","off"),g&&(t.style.border="1px solid black"),Fa(t),e}function Ba(t,e,n,r,i){var o=e,a=n,s=Gt(t,e.line),c=i&&"rtl"==t.direction?-n:n;function l(o){var a,l;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var f=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*(f?2:1))),-n)}}else a=i?function(t,e,n,r){var i=ut(e,t.doc.direction);if(!i)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 o=ct(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return ta(e,n,r);var s,c=function(t,n){return Qo(e,t instanceof ee?t.ch:t,n)},l=function(n){return t.options.lineWrapping?(s=s||An(t,e),Qn(t,e,s,n)):{begin:0,end:e.text.length}},u=l("before"==n.sticky?c(n,-1):n.ch);if("rtl"==t.doc.direction||1==a.level){var f=1==a.level==r<0,h=c(n,f?1:-1);if(null!=h&&(f?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var d=f?"before":"after";return new ee(n.line,h,d)}}var p=function(t,e,r){for(var o=function(t,e){return e?new ee(n.line,c(t,1),"before"):new ee(n.line,t,"after")};t>=0&&t<i.length;t+=e){var a=i[t],s=e>0==(1!=a.level),l=s?r.begin:c(r.end,-1);if(a.from<=l&&l<a.to)return o(l,s);if(l=s?a.from:c(a.to,-1),r.begin<=l&&l<r.end)return o(l,s)}},g=p(o+r,r,u);if(g)return g;var v=r>0?u.end:c(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=p(r>0?0:i.length-1,r,l(v)))?null:g}(t.cm,s,e,n):ta(s,e,n);if(null==a){if(o||(l=e.line+c)<t.first||l>=t.first+t.size||(e=new ee(l,e.ch,e.sticky),!(s=Gt(t,l))))return!1;e=ea(i,t.cm,s,e.line,c)}else e=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,h=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var p=s.text.charAt(e.ch)||"\n",g=et(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||g||(g="s"),u&&u!=g){n<0&&(n=1,l(),e.sticky="after");break}if(g&&(u=g),n>0&&!l(!d))break}var v=ao(t,e,o,a,!0);return re(o,v)&&(v.hitSide=!0),v}function za(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var c=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(c-.5*ir(t.display),3);i=(n>0?e.bottom:e.top)+n*l}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=Jn(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ha=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(t,e){var n=Mn(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=En(n,r,e.line),o=ut(r,t.doc.direction),a="left";o&&(a=ct(o,e.ch)%2?"right":"left");var s=In(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Wa(t,e){return e&&(t.bad=!0),t}function $a(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return Wa(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 i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==r)return qa(o,e,n)}}function qa(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!D(r,e))return Wa(ee(Jt(t.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[n],n=0,!e)){var o=t.rest?Y(t.rest):t.line;return Wa(ee(Jt(o),o.text.length),i)}var a=3==e.nodeType?e:null,s=e;for(a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var c=t.measure,l=c.maps;function u(e,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var o=i<0?c.map:l[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==e||s==n){var u=Jt(i<0?t.line:t.rest[i]),f=o[a]+r;return(r<0||s!=e)&&(f=o[a+(r?1:0)]),ee(u,f)}}}var f=u(a,s,n);if(f)return Wa(f,i);for(var h=s.nextSibling,d=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(f=u(h,h.firstChild,0))return Wa(ee(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=s.previousSibling,g=n;p;p=p.previousSibling){if(f=u(p,p.firstChild,-1))return Wa(ee(f.line,f.ch+g),i);g+=p.textContent.length}}Ha.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(o(t)&&!vt(r,t)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Aa({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,U),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=Ma.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Va(),c=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=Ma.text.join("\n");var l=M();R(c),setTimeout((function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Fa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),ht(i,"paste",(function(t){!o(t)||vt(r,t)||Ra(t,r)||s<=11&&setTimeout(ei(r,(function(){return e.updateFromDOM()})),20)})),ht(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),ht(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),ht(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),ht(i,"touchstart",(function(){return n.forceCompositionEnd()})),ht(i,"input",(function(){e.composing||e.readFromDOMSoon()})),ht(i,"copy",a),ht(i,"cut",a)},Ha.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute('aria-label',t):this.div.removeAttribute('aria-label')},Ha.prototype.prepareSelection=function(){var t=yr(this.cm,!1);return t.focus=M()==this.div,t},Ha.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Ha.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ha.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),i=r.from(),o=r.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var a=$a(e,t.anchorNode,t.anchorOffset),s=$a(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=ne(ae(a,s),i)||0!=ne(oe(a,s),o)){var c=e.display.view,l=i.line>=e.display.viewFrom&&Ua(e,i)||{node:c[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&Ua(e,o);if(!u){var f=c[c.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(l&&u){var d,p=t.rangeCount&&t.getRangeAt(0);try{d=S(l.node,l.offset,u.offset,u.node)}catch(t){}d&&(!n&&e.state.focused?(t.collapse(l.node,l.offset),d.collapsed||(t.removeAllRanges(),t.addRange(d))):(t.removeAllRanges(),t.addRange(d)),p&&null==t.anchorNode?t.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Ha.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},Ha.prototype.showMultipleSelections=function(t){_(this.cm.display.cursorDiv,t.cursors),_(this.cm.display.selectionDiv,t.selection)},Ha.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Ha.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return D(this.div,e)},Ha.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&M()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ha.prototype.blur=function(){this.div.blur()},Ha.prototype.getField=function(){return this.div},Ha.prototype.supportsTouch=function(){return!0},Ha.prototype.receivedFocus=function(){var t=this,e=this;this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):ti(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ha.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Ha.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=$a(e,t.anchorNode,t.anchorOffset),r=$a(e,t.focusNode,t.focusOffset);n&&r&&ti(e,(function(){to(e.doc,ji(n,r),U),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},Ha.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ee(a.line-1,Gt(r.doc,a.line-1).length)),s.ch==Gt(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ee(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(t=fr(r,a.line))?(e=Jt(i.view[0].line),n=i.view[0].node):(e=Jt(i.view[t].line),n=i.view[t-1].node.nextSibling);var c,l,u=fr(r,s.line);if(u==i.view.length-1?(c=i.viewTo-1,l=i.lineDiv.lastChild):(c=Jt(i.view[u+1].line)-1,l=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),c=!1;function l(){a&&(o+=s,c&&(o+=s),a=c=!1)}function u(t){t&&(l(),o+=t)}function f(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var o,h=e.getAttribute("cm-marker");if(h){var d=t.findMarks(ee(r,0),ee(i+1,0),(v=+h,function(t){return t.id==v}));return void(d.length&&(o=d[0].find(0))&&u(Kt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;p&&l();for(var g=0;g<e.childNodes.length;g++)f(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(c=!0),p&&(a=!0)}else 3==e.nodeType&&u(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;f(e),e!=n;)e=e.nextSibling,c=!1;return o}(r,n,l,e,c)),h=Kt(r.doc,ee(e,0),ee(c,Gt(r.doc,c).text.length));f.length>1&&h.length>1;)if(Y(f)==Y(h))f.pop(),h.pop(),c--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),e++}for(var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Y(f),b=Y(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==h.length&&e==a.line)for(;d&&d>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var O=ee(e,d),x=ee(c,h.length?Y(h).length-p:0);return f.length>1||f[0]||ne(O,x)?(vo(r.doc,f,O,x,"+input"),!0):void 0},Ha.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ha.prototype.reset=function(){this.forceCompositionEnd()},Ha.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ha.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))},Ha.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||ti(this.cm,(function(){return hr(t.cm)}))},Ha.prototype.setUneditable=function(t){t.contentEditable="false"},Ha.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ei(this.cm,La)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ha.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ha.prototype.onContextMenu=function(){},Ha.prototype.resetPosition=function(){},Ha.prototype.needsContentAttribute=!0;var Ga=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!vt(r,t)){if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Aa({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",i.value=e.text.join("\n"),R(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),ht(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(i,"paste",(function(t){vt(r,t)||Ra(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ht(i,"cut",o),ht(i,"copy",o),ht(t.scroller,"paste",(function(e){if(!Cn(t,e)&&!vt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),ht(t.lineSpace,"selectstart",(function(e){Cn(t,e)||wt(e)})),ht(i,"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"})}})),ht(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ga.prototype.createField=function(t){this.wrapper=Va(),this.textarea=this.wrapper.firstChild},Ga.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},Ga.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=yr(t);if(t.options.moveInputWithCursor){var i=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Ga.prototype.showSelection=function(t){var e=this.cm.display;_(e.cursorDiv,t.cursors),_(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ga.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&&R(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||M()!=this.textarea))try{this.textarea.focus()}catch(t){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Ga.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))}))},Ga.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||At(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var c=0,l=Math.min(r.length,i.length);c<l&&r.charCodeAt(c)==i.charCodeAt(c);)++c;return ti(e,(function(){La(e,i.slice(c),r.length-c,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=ur(n,t),l=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,to)(n.doc,ji(o),U);var u,h=i.style.cssText,d=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.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);",c&&(u=window.scrollY),r.input.focus(),c&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),C){Ct(t);var g=function(){pt(window,"mouseup",g),setTimeout(m,20)};ht(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=d,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?ei(n,co)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ga.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=ka&&i(t,e,n)}:i)}t.defineOption=n,t.Init=ka,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Di(t)}),!0),n("indentUnit",2,Di,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){Mi(t),zn(t),hr(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 i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(ee(r,o))}r++}));for(var i=n.length-1;i>=0;i--)vo(t.doc,e,n[i],ee(n[i].line,n[i].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!=ka&&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",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ca(t),vi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Jo(e),i=n!=ka&&Jo(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_a,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=pi(e,t.options.lineNumbers),vi(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 Hr(t)}),!0),n("scrollbarStyle","native",(function(t){$r(t),Hr(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=pi(t.options.gutters,e),vi(t)}),!0),n("firstLineNumber",1,vi,!0),n("lineNumberFormatter",(function(t){return t}),vi,!0),n("showCursorWhenSelecting",!1,mr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(jr(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,Pa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,mr,!0),n("singleCursorHeightPerLine",!0,mr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Mi,!0),n("addModeClass",!1,Mi,!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,Mi,!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)}(Ta),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&ei(this,e[t])(this,n,i),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"](Jo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:ni((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(t,e,n){for(var r=0,i=n(e);r<t.length&&n(t[r])<=i;)r++;t.splice(r,0,e)}(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,hr(this)})),removeOverlay:ni((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void hr(this)}})),indentLine:ni((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Qt(this.doc,t)&&Da(this,t,e,n)})),indentSelection:ni((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty())i.head.line>n&&(Da(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&Mr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var c=s;c<n;++c)Da(this,c,t);var l=this.doc.sel.ranges;0==o.ch&&e.length==l.length&&l[r].from().ch>0&&Ji(this.doc,r,new ki(o,l[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=ce(this.doc,t);var e,n=de(this,Gt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=[];if(!n.hasOwnProperty(e))return r;var i=n[e],o=this.getModeAt(t);if("string"==typeof o[e])i[o[e]]&&r.push(i[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=i[o[e][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var c=0;c<i._global.length;c++){var l=i._global[c];l.pred(o,this)&&-1==B(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(t,e){var n=this.doc;return pe(this,(t=se(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return Kn(this,null==t?n.head:"object"==typeof t?ce(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Gn(this,ce(this.doc,t),e||"page")},coordsChar:function(t,e){return Jn(this,(t=qn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=qn(this,{top:t,left:0},e||"page").top,Zt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),r=Gt(this.doc,t)}else r=t;return $n(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-We(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o,a,s,c=this.display,l=(t=Kn(this,ce(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),c.sizer.appendChild(e),"over"==r)l=t.top;else if("above"==r||"near"==r){var f=Math.max(c.wrapper.clientHeight,this.doc.height),h=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth);('above'==r||t.bottom+e.offsetHeight>f)&&t.top>e.offsetHeight?l=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=f&&(l=t.bottom),u+e.offsetWidth>h&&(u=h-e.offsetWidth)}e.style.top=l+"px",e.style.left=e.style.right="","right"==i?(u=c.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(c.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,a={left:u,top:l,right:u+e.offsetWidth,bottom:l+e.offsetHeight},null!=(s=Er(o,a)).scrollTop&&Nr(o,s.scrollTop),null!=s.scrollLeft&&Fr(o,s.scrollLeft))},triggerOnKeyDown:ni(fa),triggerOnKeyPress:ni(da),triggerOnKeyUp:ha,triggerOnMouseDown:ni(ya),execCommand:function(t){if(na.hasOwnProperty(t))return na[t].call(null,this)},triggerElectric:ni((function(t){Na(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=ce(this.doc,t),a=0;a<e&&!(o=Ba(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ni((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ba(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),$)})),deleteH:ni((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Zo(this,(function(n){var i=Ba(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(t,e,n,r){var i=1,o=r;e<0&&(i=-1,e=-e);for(var a=ce(this.doc,t),s=0;s<e;++s){var c=Kn(this,a,"div");if(null==o?o=c.left:c.left=o,(a=za(this,c,i,n)).hitSide)break}return a},moveV:ni((function(t,e){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return t<0?a.from():a.to();var s=Kn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var c=za(n,s,t,e);return"page"==e&&a==r.sel.primary()&&Dr(n,Gn(n,c,"div").top-s.top),c}),$),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(t){var e=Gt(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var i=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var o=e.charAt(n),a=et(o,i)?function(t){return et(t,i)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!et(t)};n>0&&a(e.charAt(n-1));)--n;for(;r<e.length&&a(e.charAt(r));)++r}return new ki(ee(t.line,n),ee(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?A(this.display.cursorDiv,"CodeMirror-overwrite"):j(this.display.cursorDiv,"CodeMirror-overwrite"),gt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ni((function(t,e){Ar(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Pn(this)-this.display.barHeight,width:t.scrollWidth-Pn(this)-this.display.barWidth,clientHeight:Tn(this),clientWidth:_n(this)}},scrollIntoView:ni((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:ee(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?function(t,e){Lr(t),t.curOp.scrollToPos=e}(this,t):Rr(this,t.from,t.to,t.margin)})),setSize:ni((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&Bn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){dr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,gt(this,"refresh",this)})),operation:function(t){return ti(this,t)},startOperation:function(){return Gr(this)},endOperation:function(){return Kr(this)},refresh:ni((function(){var t=this.display.cachedTextHeight;hr(this),this.curOp.forceUpdate=!0,zn(this),Ar(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==t||Math.abs(t-ir(this.display))>.5||this.options.lineWrapping)&&lr(this),gt(this,"refresh",this)})),swapDoc:ni((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ni(this,t),zn(this),this.display.input.reset(),Ar(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(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(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}(Ta);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Mo.prototype)Mo.prototype.hasOwnProperty(Ya)&&B(Ka,Ya)<0&&(Ta.prototype[Ya]=function(t){return function(){return t.apply(this.doc,arguments)}}(Mo.prototype[Ya]));return bt(Mo),Ta.inputStyles={textarea:Ga,contenteditable:Ha},Ta.defineMode=function(t){Ta.defaults.mode||"null"==t||(Ta.defaults.mode=t),Ft.apply(this,arguments)},Ta.defineMIME=function(t,e){It[t]=e},Ta.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ta.defineMIME("text/plain","null"),Ta.defineExtension=function(t,e){Ta.prototype[t]=e},Ta.defineDocExtension=function(t,e){Mo.prototype[t]=e},Ta.fromTextArea=function(t,e){if((e=e?I(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=M();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(ht(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}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&&(pt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Ta((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=pt,t.on=ht,t.wheelEventPixels=Oi,t.Doc=Mo,t.splitLines=Mt,t.countColumn=F,t.findColumn=q,t.isWordChar=tt,t.Pass=H,t.signal=gt,t.Line=Ge,t.changeEnd=Pi,t.scrollbarModel=Wr,t.Pos=ee,t.cmpPos=ne,t.modes=Nt,t.mimeModes=It,t.resolveMode=Vt,t.getMode=Bt,t.modeExtensions=zt,t.extendMode=Ht,t.copyState=Ut,t.startState=$t,t.innerMode=Wt,t.commands=na,t.keyMap=Wo,t.keyName=Xo,t.isModifierKey=Ko,t.lookupKey=Go,t.normalizeKeyMap=qo,t.StringStream=qt,t.SharedTextMarker=_o,t.TextMarker=jo,t.LineWidget=Co,t.e_preventDefault=wt,t.e_stopPropagation=Ot,t.e_stop=Ct,t.addClass=A,t.contains=D,t.rmClass=j,t.keyNames=Bo}(Ta),Ta.version="5.63.0",Ta}())},function(t,e,n){var r=n(87),i=n(88),o=n(48),a=n(89);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n.n(i);e["a"]=o.a.View.extend({itemView:'',itemsView:'',itemType:'type',autoAdd:0,initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;this.config=e||t.config||{},this.autoAdd&&this.listenTo(this.collection,'add',this.addTo),this.items=[],this.init()},init:function(){},addTo:function(t){this.add(t)},itemViewNotFound:function(t){var e=this.config,n=this.ns,r=e.em,i="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");r&&r.logWarning(i)},add:function(t,e){var n,i=this.config,o=this.reuseView,a=this.items,s=this.itemsView,c=void 0===s?{}:s,l=e||null,u=this.itemView,f=t.get(this.itemType);c[f]?u=c[f]:!f||c[f]||Object(r["includes"])(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],f)||this.itemViewNotFound(f),n=t.view&&o?t.view:new u({model:t,config:i},i),a&&a.push(n);var h=n.render().el;l?l.appendChild(h):this.$el.append(h)},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},onRender:function(){},onRemoveBefore:function(){},onRemove:function(){},remove:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.items;this.onRemoveBefore(e,t),this.clearItems(),o.a.View.prototype.remove.apply(this,arguments),this.onRemove(e,t)},clearItems:function(){this.items}})},function(t,e,n){"use strict";var r=n(14),i=n.n(r),o=n(11),a=n.n(o),s=n(2),c=n.n(s),l=n(16),u=n.n(l),f=n(3),h=n.n(f),d=n(0),p=n(10),g=["at"];function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var y=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e||[];return r.forEach((function(e){n.push(e.getId()),t(e.components(),n)})),n},b=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.map((function(e){n.push(e.getId()),t(e.components(),n)})),n};e["a"]=h.a.Collection.extend({initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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||n&&n.get('DomComponents')},resetChildren:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this,i=n.previousModels||[],o=i.filter((function(e){return!t.get(e.cid)})),a=b(t);n.keepIds=y(i).filter((function(t){return a.indexOf(t)>=0})),o.forEach((function(t){return e.removeChildren(t,r,n)})),t.each((function(t){return e.onAdd(t)}))},removeChildren:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var i=this.domc,o=this.em,a=i?i.allById():{},s=r.temporary;if(t.prevColl=this,!s){var c=t.getId(),l=o.get('SelectorManager').getAll(),u=o.get('CssComposer').getAll(),f=(r.keepIds||[]).indexOf(c)<0;delete a[c];var h=f?u.remove(u.filter((function(t){return t.getSelectors().getFullString()==="#".concat(c)})),r):[];l.remove(h.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(o.get('Commands').run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),o.trigger('component:remove',t));var d=t.components();d.forEach((function(t){return n.removeChildren(t,e,r)}))}var p=t.components();o.stopListening(p),o.stopListening(t),o.stopListening(t.get('classes')),t.__postRemove()}},model:function(t,e){var n,r=e.collection.opt,i=r.em,o=i.get('DomComponents').componentTypes;e.em=i,e.config=r.config,e.componentTypes=o,e.domc=r.domc;for(var a=0;a<o.length;a++){if(o[a].id==t.type){n=o[a].model;break}}return n||(n=o[o.length-1].model,i&&t.type&&i.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new n(t,e)},parseString:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.domc,i=n.get('CssComposer'),o=n.get('Parser').parseHtml(t);if(p["a"].checkId(o.html,o.css,r.componentsById,e),o.css&&i&&!e.temporary){e.at;var a=u()(e,g);i.addCollection(o.css,m(m({},a),{},{extend:1}))}return o.html},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.parent;n.keepIds=y(n.previousModels),Object(d["isString"])(t)?t=this.parseString(t,n):Object(d["isArray"])(t)&&(t=a()(t)).forEach((function(r,i){if(Object(d["isString"])(r)){var o=e.parseString(r,n);t[i]=Object(d["isArray"])(o)&&!o.length?null:o}}));var r=Object(d["isArray"])(t);t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?Object(d["flatten"])(t,1):t[0];var i=h.a.Collection.prototype.add.apply(this,[t,n]);return this.__firstAdd=i,i},processDef:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,r=(void 0===n?{}:n).processor,o=t;if(r){var a=r(o=m({},o));a&&(Object(d["each"])(o,(function(t,e){return delete o[e]})),Object(d["extend"])(o,a))}if(o.$$typeof&&'object'==i()(o.props)){(o=m({},o)).props=m({},o.props);var s=e.get('DomComponents'),c=e.get('Parser').parserHtml;Object(d["each"])(o,(function(t,e){Object(d["includes"])(['props','type'],e)||delete o[e]}));var l=o.props,u=l.children;delete l.children,delete o.props;var f=c.splitPropsFromAttr(l);o.attributes=f.attrs,u&&(o.components=u),o.type?s.getType(o.type)||(o.tagName=o.type,delete o.type):o.type='textnode',Object(d["extend"])(o,f.props)}return o},onAdd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.domc,i=this.em,o=t.getStyle(),a=i&&i.getConfig('avoidInlineStyle');if(r&&r.Component.ensureInList(t),!Object(d["isEmpty"])(o)&&!a&&i&&i.get&&i.getConfig('forceClass')&&!n.temporary){var s=t.cid;i.get('CssComposer').setClassRule(s,o);t.setStyle({}),t.addClass(s)}t.__postAdd({recursive:1}),this.__onAddEnd()},__onAddEnd:Object(d["debounce"])((function(){}))})},function(t,e,n){"use strict";n.r(e);var r=n(3);e["default"]=r["Model"].extend({initialize:function(t){this.config=t||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+'hover',this.badgeClass=this.pfx+'badge',this.plhClass=this.pfx+'placeholder',this.freezClass=this.ppfx+'freezed',this.canvas=this.em.get&&this.em.get('Canvas'),this.init(this.config)},onFrameScroll:function(t){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasTools:function(){return this.canvas.getToolsEl()},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},init:function(t){},callRun:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:".concat(n,":before"),e),!e||!e.abort){var r=e.sender||t,i=this.run(t,r,e);return t.trigger("run:".concat(n),i,e),t.trigger('run',n,i,e),i}t.trigger("abort:".concat(n),e)},callStop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=e.sender||t;t.trigger("stop:".concat(n,":before"),e);var i=this.stop(t,r,e);return t.trigger("stop:".concat(n),i,e),t.trigger('stop',n,i,e),i},stopCommand:function(){this.em.get('Commands').stop(this.id)},run:function(t,e){},stop:function(t,e){}})},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(0),a=n(1),s=n(42);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u=Object(s["a"])().parseStyle;e["a"]={parseStyle:u,extendStyle:function(t){return l(l({},this.getStyle()),t)},getStyle:function(t){var e=l({},this.get('style')||{});return t&&Object(o["isString"])(t)?e[t]:e},setStyle:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o["isString"])(e)&&(e=u(e));var r=this.getStyle(n),i=l({},e);this.set('style',i,n);var s=Object(a["shallowDiff"])(r,i);return Object(o["keys"])(s).forEach((function(e){var r=t.em;n.noEvent||(t.trigger("change:style:".concat(e)),r&&(r.trigger("styleable:change",t,e,n),r.trigger("styleable:change:".concat(e),t,e,n)))})),i},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};'string'==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)},removeStyle:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},styleToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle(t);for(var r in n){var i=t.important,a=Object(o["isArray"])(i)?i.indexOf(r)>=0:i,s="".concat(n[r]).concat(a?' !important':''),c='__'==r.substr(0,2);s&&!c&&e.push("".concat(r,":").concat(s,";"))}return e.join('')},getSelectors:function(){return this.get('selectors')||this.get('classes')},getSelectorsString:function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},_validate:function(t,e){var n,r=t.style,i=this.em||e.em,a=null==i||null===(n=i.get('CssComposer'))||void 0===n?void 0:n.getConfig().onBeforeStyle;if(r&&a){var s=a(l({},r));s&&Object(o["keys"])(r).map((function(e){Object(o["isUndefined"])(s[e])&&delete t.style[e]})),s&&Object(o["keys"])(s).map((function(e){t.style[e]=s[e]}))}return!0}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,c,"next",t)}function c(t){n(a,i,o,s,c,"throw",t)}s(void 0)}))}},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r).a.$;e["default"]={startSelectPosition:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get('Utils'),o=t.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),t&&this.sorter.startSort(t,{container:o})},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?i(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?i(this.cDim[this.posIndex][5]).parent():i(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,i=e||'before',o=n.length,a=0!==o&&'after'==i&&r==o;return 0!==o&&(!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()}}},function(t,e,n){"use strict";var r=n(44),i=n(1);Object(i["hasWin"])()&&(window.Promise=window.Promise||r["a"]),e["a"]='function'==typeof fetch?fetch.bind():function(t,e){return new r["a"]((function(n,i){var o=new XMLHttpRequest;for(var a in o.open(e.method||'get',t),o.withCredentials='include'==e.credentials,e.headers||{})o.setRequestHeader(a,e.headers[a]);o.onload=function(t){return n({status:o.status,statusText:o.statusText,text:function(){return r["a"].resolve(o.responseText)}})},o.onerror=i,o.upload&&e.onProgress&&(o.upload.onprogress=e.onProgress),e.body?o.send(e.body):o.send()}))}},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(0),a=n(3),s=n.n(a);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u=s.a.Model,f=s.a.View;e["a"]={types:[],initialize:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r,this.opts=n,this.model=function(){var t,n,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o&&o.type){var s=e.getBaseType();t=(i=e.getType(o.type))?i.model:s.model,n=i?i.view:s.view}else{var c=e.recognizeType(o);t=(i=c.type).model,n=i.view,o=c.attributes}var u=new t(o,l(l({},a),{},{em:r}));return u.typeView=n,u};var i=this.init&&this.init.bind(this);i&&i()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n],i=r.isType(t);if(i='boolean'==typeof i&&i?{type:r.id}:i)return{type:r,attributes:i}}return{type:this.getBaseType(),attributes:t}},getBaseType:function(){var t=this.getTypes();return t[t.length-1]},getTypes:function(){return this.types},getType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n];if(r.id===t)return r}},addType:function(t,e){var n=this.getType(t),r=this.getBaseType(),i=n?n.model:r.model,a=n?n.view:r.view,s=e.model,c=e.view,l=e.isType;s=s instanceof u||Object(o["isFunction"])(s)?s:i.extend(s||{}),c=c instanceof f||Object(o["isFunction"])(c)?c:a.extend(c||{}),!this.extendViewApi||e.model||e.view||(c=c.extend(e)),n?(n.model=s,n.view=c,n.isType=l||n.isType):(e.id=t,e.model=s,e.view=c,e.isType=l||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}}},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(0),a=n(1),s=n(25);i.a.$;e["a"]=s["a"].extend({events:{'change input':'handleChange','change select':'handleUnitChange','click [data-arrow-up]':'upArrowClick','click [data-arrow-down]':'downArrowClick','mousedown [data-arrows]':'downIncrement',keydown:'handleKeyDown'},template:function(){var t=this.ppfx;return"\n      <span class=\"".concat(t,"input-holder\"></span>\n      <span class=\"").concat(t,"field-units\"></span>\n      <div class=\"").concat(t,"field-arrows\" data-arrows>\n        <div class=\"").concat(t,"field-arrow-u\" data-arrow-up></div>\n        <div class=\"").concat(t,"field-arrow-d\" data-arrow-down></div>\n      </div>\n    ")},inputClass:function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},initialize:function(){s["a"].prototype.initialize.apply(this,arguments),Object(o["bindAll"])(this,'moveIncrement','upIncrement'),this.doc=document,this.listenTo(this.model,'change:unit',this.handleModelChange)},setValue:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()},handleChange:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()},handleKeyDown:function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())},elementUpdated:function(){this.model.trigger('el:change')},handleModelChange:function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')},getUnitEl:function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=['<option value="" disabled hidden>-</option>'];e.forEach((function(e){var r=e==t.get('unit')?'selected':'';n.push("<option ".concat(r,">").concat(e,"</option>"))}));var r=document.createElement('div');r.innerHTML="<select class=\"".concat(this.ppfx,"input-unit\">").concat(n.join(''),"</select>"),this.unitEl=r.firstChild}}return this.unitEl},upArrowClick:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));n=this.normalizeValue(n+e);var r=this.validateInputValue(n);t.set('value',r.value),this.elementUpdated()},downArrowClick:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value')),r=this.normalizeValue(n-e),i=this.validateInputValue(r);t.set('value',i.value),this.elementUpdated()},downIncrement:function(t){t.preventDefault(),this.moved=0;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},Object(a["on"])(this.doc,'mousemove',this.moveIncrement),Object(a["on"])(this.doc,'mouseup',this.upIncrement)},moveIncrement:function(t){this.moved=1;var e=this.model,n=e.get('step'),r=this.current,i=this.normalizeValue(r.val+(r.y-t.pageY)*n);return this.prValue=this.validateInputValue(i).value,e.set('value',this.prValue,{avoidStore:1}),!1},upIncrement:function(){var t=this.model,e=t.get('step');if(Object(a["off"])(this.doc,'mouseup',this.upIncrement),Object(a["off"])(this.doc,'mousemove',this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()}},normalizeValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get('step'),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=r.toString().split('.')[1];i=o?o.length:0}return i?parseFloat(t.toFixed(i)):t},validateInputValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=e||{},i=this.model,a='',s=Object(o["isUndefined"])(t)?a:t,c=e.units||i.get('units')||[],l=i.get('unit')||c.length&&c[0]||'',u=Object(o["isUndefined"])(e.max)?i.get('max'):e.max,f=Object(o["isUndefined"])(e.min)?i.get('min'):e.min,h=!!i.get('limitlessMax'),d=!!i.get('limitlessMin');if(r.deepCheck){var p=i.get('fixedValues')||[];if(''===s&&(l=''),s){var g=new RegExp('^'+p.join('|'),'g');if(p.length&&g.test(s))s=s.match(g)[0],l='',n=1;else{var v=s+'';s+='',s=parseFloat(s.replace(',','.')),s=isNaN(s)?a:s;var m=v.replace(s,'');Object(o["indexOf"])(c,m)>=0&&(l=m)}}}return h||Object(o["isUndefined"])(u)||''===u||(s=s>u?u:s),d||Object(o["isUndefined"])(f)||''===f||(s=s<f?f:s),{force:n,value:s,unit:l}},render:function(){s["a"].prototype.render.call(this),this.unitEl=null;var t=this.getUnitEl();return t&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(t),this}})},function(t,e,n){"use strict";n.d(e,"b",(function(){return s}));var r=n(3),i=n.n(r),o=n(0),a=Number.MAX_VALUE,s=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:''};e["a"]=i.a.Model.extend({initialize:function(){Object(o["bindAll"])(this,'sortRules'),this.compCls=[],this.ids=[]},buildFromModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r='',i=this.em,o=i&&i.getConfig('avoidInlineStyle'),a=t.styleToString(),s=t.get('classes'),c=n.wrapperIsBody,l=t.get('wrapper');if(this.ids.push("#".concat(t.getId())),s.each((function(t){return e.compCls.push(t.getFullName())})),!o&&a){var u="#".concat(t.getId());r="".concat(u=c&&l?'body':u,"{").concat(a,"}")}var f=t.components();return f.each((function(t){return r+=e.buildFromModel(t,n)})),r},build:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.json,i=n.em||'',a=n.cssc||i&&i.get('CssComposer');this.em=i,this.compCls=[],this.ids=[],this.model=t;var s=[],c=t?this.buildFromModel(t,n):'',l=Object(o["isUndefined"])(n.clearStyles)&&i?i.getConfig('clearStyles'):n.clearStyles;if(a){var u=n.rules||a.getAll(),f={},h=[];u.forEach((function(t){var i=t.getAtRule();if(i){var o=f[i];o?o.push(t):f[i]=[t]}else{var a=e.buildFromRule(t,h,n);r?s.push(a):c+=a}})),this.sortMediaObject(f).forEach((function(t){var i='',o=t.key;t.value.forEach((function(t){var a=e.buildFromRule(t,h,n);t.get('singleAtRule')?c+="".concat(o,"{").concat(a,"}"):i+=a,r&&s.push(a)})),i&&(c+="".concat(o,"{").concat(i,"}"))})),i&&l&&u.remove&&u.remove(h)}return r?s.filter((function(t){return t})):c},buildFromRule:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o='',a=this.model,s=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),l=t.get('singleAtRule');if(t.get('selectors').each((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||i.keepUnusedStyles)&&(n=1)})),s&&n||c||l||!a){var u=t.getDeclaration({body:1});u&&(i.json?o=t:o+=u)}else e.push(t);return o},getQueryLength:function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):a},sortMediaObject:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return Object(o["each"])(e,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(e,n){var r=[e.key,n.key].every((function(t){return-1!==t.indexOf('min-width')})),i=r?e.key:n.key,o=r?n.key:e.key;return t.getQueryLength(i)-t.getQueryLength(o)}))},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')})),i=n(r?t:e),o=n(r?e:t);return this.getQueryLength(i)-this.getQueryLength(o)}})},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(0);e["a"]=i.a.View.extend({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)},removeChildren:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),n&&n.remove(),t.remove.apply(t)}}));var i=t.components();i.forEach((function(t){return n.removeChildren(t,e,r)}))},addTo:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),n&&!e.temporary){var i=function t(e){n.trigger('component:add',e),e.components().forEach((function(e){return t(e)}))};i(t)}},addToCollection:function(t,e,r){this.compView||(this.compView=n(12).default);for(var i=this.config,a=this.opts,s=this.em,c=e||null,l=i.frameView,u=void 0===l?{}:l,f=u.model&&t.getView(u.model),h=a.componentTypes||s&&s.get('DomComponents').getTypes(),d=t.get('type')||'default',p=this.compView,g=0;g<h.length;g++)if(h[g].id==d){p=h[g].view;break}var v,m=f||new p({model:t,config:i,componentTypes:h});try{v=m.render().el}catch(t){v=document.createTextNode(''),s.logError(t)}if(c)c.appendChild(v);else{var y=this.parentEl,b=y.childNodes;if(Object(o["isUndefined"])(r))y.appendChild(v);else{var w=b.length==r;w&&r--,w||!b.length?y.appendChild(v):y.insertBefore(v,b[r])}}return v},resetChildren:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels,i=void 0===r?[]:r;this.parentEl.innerHTML='',i.forEach((function(t){return e.removeChildren(t,e.collection)})),t.each((function(t){return e.addToCollection(t)}))},render:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML='',n.appendChild(r),this}})},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=i.a.View.extend({tagName:'style',initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,'change',this.render),this.listenTo(e,'destroy remove',this.remove),this.listenTo(e.get('selectors'),'change',this.render)},render:function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this}}),a=o.extend({_createElement:function(t){return document.createTextNode('')},render:function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this}}),s=i.a.$,c=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')};e["a"]=i.a.View.extend({initialize:function(t){var e=t.config||{};this.atRules={},this.config=e,this.em=e.em,this.pfx=e.stylePrefix||'',this.className=this.pfx+'rules';var n=this.collection;this.listenTo(n,'add',this.addTo),this.listenTo(n,'reset',this.render)},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){if(this.renderStarted){var n,r,i=e||null,s={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var l=t.getAtRule(),u=this.atRules[l];if(!u){var f=document.createElement('style');u=document.createTextNode(''),f.appendChild(document.createTextNode("".concat(l,"{"))),f.appendChild(u),f.appendChild(document.createTextNode("}")),this.atRules[l]=u,n=f}r=new a(s),u.appendData(r.render().el.textContent)}else n=(r=new o(s)).render().el;var h=this.className,d=t.get('mediaText'),p=c(h),g=p;if(d&&(g=c(h,this.getMediaWidth(d))),n){var v,m=i||this.el;try{v=m.querySelector("#".concat(g))}catch(t){}v||(v=m.querySelector("#".concat(p))),v.appendChild(n)}return n}},getMediaWidth:function(t){return t&&t.replace("(".concat(this.em.getConfig('mediaCondition'),": "),'').replace(')','')},render:function(){var t=this;this.renderStarted=1,this.atRules={};var e=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var a=e.get('DeviceManager').getAll().pluck('priority');return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return s("<div id=\"".concat(c(r,t),"\"></div>")).appendTo(o)})),i.each((function(e){return t.addToCollection(e,o)})),n.append(o),n.attr('class',r),this}})},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(14),a=n.n(o),s=n(0),c='text/html',l=c,u=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new DOMParser,i=n.htmlType||l,o=i===c,a=o?t:"<div>".concat(t,"</div>"),u=r.parseFromString(a,i);if(o){var f=u.head,h=u.body,d=f.querySelectorAll('script');Object(s["each"])(d,(function(t){return h.appendChild(t)}));var p=[];Object(s["each"])(f.children,(function(t){return p.push(t)})),Object(s["each"])(p,(function(t,e){return h.insertBefore(t,h.children[e])})),e=h}else e=u.firstChild;return e};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["a"]=function(t){var e=t,n='data-gjs-',r='parse:html';return{compTypes:'',modelAttrStart:n,splitPropsFromAttr:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return Object(s["each"])(e,(function(e,o){if(0===o.indexOf(t.modelAttrStart)){var a=o.replace(n,''),c=e.length,l=e&&Object(s["isString"])(e),u=l&&e.substr(0,1),f=l&&e.substr(c-1);e='false'!==(e='true'===e||e)&&e;try{e='{'==u&&'}'==f||'['==u&&']'==f?JSON.parse(e):e}catch(t){}r[a]=e}else i[o]=e})),{props:r,attrs:i}},parseStyle:function(t){for(var e={},n=t.split(';'),r=0,i=n.length;r<i;r++){var o=n[r].trim();if(o){var a=o.split(':');e[a[0].trim()]=a.slice(1).join(':').trim()}}return e},parseClass:function(t){for(var e=[],n=t.split(' '),r=0,i=n.length;r<i;r++){var o=n[r].trim();o&&e.push(o)}return e},parseNode:function(r){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=[],s=r.childNodes,c=0,l=s.length;c<l;c++){var u=s[c],f=u.attributes||[],d=f.length,p=o[o.length-1],g=u.childNodes.length,v=this.compTypes,m={};if(v){var y='',b=u.getAttribute&&u.getAttribute("".concat(n,"type"));if(b)m={type:b};else{for(var w=0;w<v.length;w++){var O=v[w];if(y=O.model.isComponent(u,i)){'object'!==a()(y)&&(y={type:O.id});break}}m=y}}m.tagName||(m.tagName=u.tagName?u.tagName.toLowerCase():''),d&&(m.attributes={});for(var x=0;x<d;x++){var C=f[x].nodeName,k=f[x].nodeValue;if('style'==C)m.style=this.parseStyle(k);else if('class'==C)m.classes=this.parseClass(k);else{if('contenteditable'==C)continue;if(0===C.indexOf(n)){var S=C.replace(n,''),j=k.length,P=k&&k.substr(0,1),_=k&&k.substr(j-1);k='false'!==(k='true'===k||k)&&k;try{k='{'==P&&'}'==_||'['==P&&']'==_?JSON.parse(k):k}catch(t){}m[S]=k}else''===k&&!0===u[C]&&(k=!0),m.attributes[C]=k}}if(g&&!m.components){var T=u.childNodes[0];1===g&&3===T.nodeType?(!m.type&&(m.type='text'),m.components={type:'textnode',content:T.nodeValue}):m.components=this.parseNode(u,h(h({},i),{},{inSvg:i.inSvg||'svg'===m.type}))}if('textnode'==m.type){if(p&&'textnode'==p.type){p.content+=m.content;continue}if(!t.keepEmptyTextNodes){var E=u.nodeValue;if(' '!=E&&!E.trim())continue}}g||'/>'!=="".concat(u.outerHTML).slice(-2)||(m.void=!0);var D=m.components;if(!m.type&&D){for(var M=1,A=0,L=0;L<D.length;L++){var R=D[L],N=R.type;if(['text','textnode'].indexOf(N)<0&&e.textTags.indexOf(R.tagName)<0){M=0;break}'textnode'==N&&(A=1)}M&&A&&(m.type='text')}(m.tagName||'textnode'==m.type)&&o.push(m)}return o},parse:function(n,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=e.em,c=a&&a.get('Config')||{},l={html:null,css:null},f=h(h({},t),o),d=Object(s["isFunction"])(f.parserHtml)?f.parserHtml(n,f):u(n,f),p=d.querySelectorAll('script'),g=p.length;if(!c.allowScripts)for(;g--;)p[g].parentNode.removeChild(p[g]);if(i){for(var v=d.querySelectorAll('style'),m=v.length,y='';m--;)y=v[m].innerHTML+y,v[m].parentNode.removeChild(v[m]);y&&(l.css=i.parse(y))}a&&a.trigger("".concat(r,":root"),{input:n,root:d});var b=this.parseNode(d),w=1!==b.length||e.returnArray?b:b[0];return l.html=w,a&&a.trigger(r,{input:n,output:l}),l}}}},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(3),a=n.n(o),s=n(0),c=n(14),l=n.n(c),u=n(1),f=n(25);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p=a.a.$;p&&function(t,e){if(Object(u["hasWin"])()){var n={beforeShow:_,move:_,change:_,show:_,hide:_,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:'body',maxSelectionSize:7,cancelText:'cancel',chooseText:'choose',togglePaletteMoreText:'more',togglePaletteLessText:'less',clearText:'Clear Color Selection',noColorSelectedText:'No Color Selected',preferredFormat:!1,className:'',containerClassName:'',replacerClassName:'',showAlpha:!1,theme:'sp-light',palette:[['#ffffff','#000000','#ff0000','#ff8000','#ffff00','#008000','#0000ff','#4b0082','#9400d3']],selectionPalette:[],disabled:!1,offset:null},r=[],i=!!/msie/i.exec(window.navigator.userAgent),o=function(){function t(t,e){return!!~(''+t).indexOf(e)}var e=document.createElement('div').style;return e.cssText='background-color:rgba(0,0,0,.5)',t(e.backgroundColor,'rgba')||t(e.backgroundColor,'hsla')}(),a=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>",'</div>'].join(''),s=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>",'</div>','</div>',"<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>",'</div>','</div>','</div>',"<div class='sp-clear sp-clear-display'>",'</div>',"<div class='sp-hue'>","<div class='sp-slider'></div>",t,'</div>','</div>',"<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>",'</div>',"<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />",'</div>',"<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>",'</div>','</div>','</div>'].join('')}(),c='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var i=this,o=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(c)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?i=n.get():'container'==e?i=n.container:'option'==e?i=n.option.apply(n,o):'destroy'==e?(n.destroy(),t(this).removeData(c)):a.apply(n,o)}})),i}return this.spectrum('destroy').each((function(){var n=P(this,t.extend({},e,t(this).data()));t(this).data(c,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=D,t.fn.spectrum.defaults=n,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("<input type='color'/>")[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&&!M()&&e.spectrum({preferredFormat:'hex6'})};var f=/^[\s,#]+/,h=/\s+$/,d=0,p=Math,g=p.round,v=p.min,m=p.max,y=p.random,b=function t(e,n){if(n=n||{},(e=e||'')instanceof t)return e;if(!(this instanceof t))return new t(e,n);var r=function(t){var e={r:0,g:0,b:0},n=1,r=!1,i=!1;'string'==typeof t&&(t=function(t){t=t.replace(f,'').replace(h,'').toLowerCase();var e,n=!1;if(C[t])t=C[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:(r=e[1],Q(r)/255),r:Q(e[2]),g:Q(e[3]),b:Q(e[4]),format:n?'name':'hex8'};var r;if(e=S.hex6.exec(t))return{r:Q(e[1]),g:Q(e[2]),b:Q(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:Q(e[1]+''+e[1]),g:Q(e[2]+''+e[2]),b:Q(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==l()(t)&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(o=t.r,a=t.g,s=t.b,e={r:255*J(o,255),g:255*J(a,255),b:255*J(s,255)},r=!0,i='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=et(t.s),t.v=et(t.v),e=function(t,e,n){t=6*J(t,360),e=J(e,100),n=J(n,100);var r=p.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),c=r%6;return{r:255*[n,a,o,o,s,n][c],g:255*[s,n,n,a,o,o][c],b:255*[o,o,s,n,n,a][c]}}(t.h,t.s,t.v),r=!0,i='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=et(t.s),t.l=et(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=J(t,360),e=J(e,100),n=J(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,c=2*n-s;r=a(c,s,t+1/3),i=a(c,s,t),o=a(c,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,t.s,t.l),r=!0,i='hsl'),t.hasOwnProperty('a')&&(n=t.a));var o,a,s;return n=X(n),{ok:r,format:t.format||i,r:v(255,m(e.r,0)),g:v(255,m(e.g,0)),b:v(255,m(e.b,0)),a:n}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=g(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=r.ok,this._tc_id=d++};b.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=X(t),this._roundA=g(100*this._a)/100,this},toHsv:function(){var t=L(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+r+'%)':'hsva('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHsl:function(){var t=A(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=A(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+r+'%)':'hsla('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHex:function(t){return R(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return N(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+g(this._r)+', '+g(this._g)+', '+g(this._b)+')':'rgba('+g(this._r)+', '+g(this._g)+', '+g(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:g(100*J(this._r,255))+'%',g:g(100*J(this._g,255))+'%',b:g(100*J(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+g(100*J(this._r,255))+'%, '+g(100*J(this._g,255))+'%, '+g(100*J(this._b,255))+'%)':'rgba('+g(100*J(this._r,255))+'%, '+g(100*J(this._g,255))+'%, '+g(100*J(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(k[R(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+N(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?'GradientType = 1, ':'';t&&(n=b(t).toHex8String());return'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(B,arguments)},brighten:function(){return this._applyModification(z,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(I,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(V,arguments)},spin:function(){return this._applyModification(U,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(K,arguments)},complement:function(){return this._applyCombination(W,arguments)},monochromatic:function(){return this._applyCombination(Y,arguments)},splitcomplement:function(){return this._applyCombination(G,arguments)},triad:function(){return this._applyCombination($,arguments)},tetrad:function(){return this._applyCombination(q,arguments)}},b.fromRatio=function(t,e){if('object'==l()(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]='a'===r?t[r]:et(t[r]));t=n}return b(t,e)},b.equals=function(t,e){return!(!t||!e)&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:y(),g:y(),b:y()})},b.mix=function(t,e,n){n=0===n?0:n||50;var r,i=b(t).toRgb(),o=b(e).toRgb(),a=n/100,s=2*a-1,c=o.a-i.a,l=1-(r=((r=s*c==-1?s:(s+c)/(1+s*c))+1)/2),u={r:o.r*r+i.r*l,g:o.g*r+i.g*l,b:o.b*r+i.b*l,a:o.a*a+i.a*(1-a)};return b(u)},b.readability=function(t,e){var n=b(t),r=b(e),i=n.toRgb(),o=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),c=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(a-s),color:c}},b.isReadable=function(t,e){var n=b.readability(t,e);return n.brightness>125&&n.color>500},b.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o<e.length;o++){var a=b.readability(t,e[o]),s=a.brightness>125&&a.color>500,c=3*(a.brightness/125)+a.color/500;(s&&!i||s&&i&&c>r||!s&&!i&&c>r)&&(i=s,r=c,n=b(e[o]))}return n};var w,O,x,C=b.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'},k=b.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(C),S=(O='[\\s|\\(]+('+(w='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',x='[\\s|\\(]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',{rgb:new RegExp('rgb'+O),rgba:new RegExp('rgba'+x),hsl:new RegExp('hsl'+O),hsla:new RegExp('hsla'+x),hsv:new RegExp('hsv'+O),hsva:new RegExp('hsva'+x),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=b,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function j(e,n,r,i){for(var a=[],s=0;s<e.length;s++){var c=e[s];if(c){var l=b(c),u=l.toHsl().l<.5?'sp-thumb-el sp-thumb-dark':'sp-thumb-el sp-thumb-light';u+=b.equals(n,c)?' sp-thumb-active':'';var f=l.toString(i.preferredFormat||'rgb'),h=o?'background-color:'+l.toRgbString():'filter:'+l.toFilter();a.push('<span title="'+f+'" data-color="'+l.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+h+';"></span></span>')}else{a.push(t('<div />').append(t('<span data-color="" style="background-color:transparent;" class="'+'sp-clear-display'+'"></span>').attr('title',i.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+a.join('')+'</div>'}function P(c,l){var u,f,h,d,p=function(e,r){var i=t.extend({},n,e);return i.callbacks={move:E(i.move,r),change:E(i.change,r),show:E(i.show,r),hide:E(i.hide,r),beforeShow:E(i.beforeShow,r)},i}(l,c),g=p.flat,v=p.showSelectionPalette,m=p.localStorageKey,y=p.theme,w=p.callbacks,O=(u=$t,f=10,function(){var t=this,e=arguments,n=function(){d=null,u.apply(t,e)};h&&clearTimeout(d),!h&&d||(d=setTimeout(n,f))}),x=!1,C=!1,k=!0,S=0,P=0,_=0,A=0,L=0,R=0,N=0,I=0,F=0,V=0,B=1,z=[],H=[],U={},W=p.selectionPalette.slice(0),$=p.maxSelectionSize,q='sp-dragging',G=null,K=c.ownerDocument,Y=(K.body,t(c)),X=!1,J=t(s,K).addClass(y),Z=J.find('.sp-picker-container'),Q=J.find('.sp-color'),tt=J.find('.sp-dragger'),et=J.find('.sp-hue'),nt=J.find('.sp-slider'),rt=J.find('.sp-alpha-inner'),it=J.find('.sp-alpha'),ot=J.find('.sp-alpha-handle'),at=J.find('.sp-input'),st=J.find('.sp-palette'),ct=J.find('.sp-initial'),lt=J.find('.sp-cancel'),ut=J.find('.sp-clear'),ft=J.find('.sp-choose'),ht=J.find('.sp-palette-toggle'),dt=Y.is('input'),pt=dt&&'color'===Y.attr('type')&&M(),gt=dt&&!g,vt=gt?t(a).addClass(y).addClass(p.className).addClass(p.replacerClassName):t([]),mt=gt?vt:Y,yt=vt.find('.sp-preview-inner'),bt=p.color||dt&&Y.val(),wt=!1,Ot=p.preferredFormat,xt=!p.showButtons||p.clickoutFiresChange,Ct=!bt,kt=p.allowEmpty&&!pt;function St(){if(p.showPaletteOnly&&(p.showPalette=!0),ht.text(p.showPaletteOnly?p.togglePaletteMoreText:p.togglePaletteLessText),p.palette){z=p.palette.slice(0),H=t.isArray(z[0])?z:[z],U={};for(var e=0;e<H.length;e++)for(var n=0;n<H[e].length;n++){var r=b(H[e][n]).toRgbString();U[r]=!0}}J.toggleClass('sp-flat',g),J.toggleClass('sp-input-disabled',!p.showInput),J.toggleClass('sp-alpha-enabled',p.showAlpha),J.toggleClass('sp-clear-enabled',kt),J.toggleClass('sp-buttons-disabled',!p.showButtons),J.toggleClass('sp-palette-buttons-disabled',!p.togglePaletteOnly),J.toggleClass('sp-palette-disabled',!p.showPalette),J.toggleClass('sp-palette-only',p.showPaletteOnly),J.toggleClass('sp-initial-disabled',!p.showInitial),J.addClass(p.className).addClass(p.containerClassName),$t()}function jt(){if(m&&window.localStorage){try{var e=window.localStorage[m].split(',#');e.length>1&&(delete window.localStorage[m],t.each(e,(function(t,e){Pt(e)})))}catch(t){}try{W=window.localStorage[m].split(';')}catch(t){}}}function Pt(e){if(v){var n=b(e).toRgbString();if(!U[n]&&-1===t.inArray(n,W))for(W.push(n);W.length>$;)W.shift();if(m&&window.localStorage)try{window.localStorage[m]=W.join(';')}catch(t){}}}function _t(){var e=Bt(),n=t.map(H,(function(t,n){return j(t,e,'sp-palette-row sp-palette-row-'+n,p)}));jt(),W&&n.push(j(function(){var t=[];if(p.showPalette)for(var e=0;e<W.length;e++){var n=b(W[e]).toRgbString();U[n]||t.push(W[e])}return t.reverse().slice(0,p.maxSelectionSize)}(),e,'sp-palette-row sp-palette-row-selection',p)),st.html(n.join(''))}function Tt(){if(p.showInitial){var t=wt,e=Bt();ct.html(j([t,e],e,'sp-palette-row-initial',p))}}function Et(){(P<=0||S<=0||A<=0)&&$t(),C=!0,J.addClass(q),G=null,Y.trigger('dragstart.spectrum',[Bt()])}function Dt(){C=!1,J.removeClass(q),Y.trigger('dragstop.spectrum',[Bt()])}function Mt(){var t=at.val();if(null!==t&&''!==t||!kt){var e=b(t);e.isValid()?(Vt(e),Wt(!0)):at.addClass('sp-validation-error')}else Vt(null),Wt(!0)}function At(){x?It():Lt()}function Lt(){var e=t.Event('beforeShow.spectrum');if(x)$t();else if(Y.trigger('beforeShow.spectrum',[Bt()]),!1!==w.beforeShow(Bt())&&!e.isDefaultPrevented()){!function(){for(var t=0;t<r.length;t++)r[t]&&r[t].hide()}(),x=!0;var n=t(K);n.bind('keydown.spectrum',Rt),n.bind('click.spectrum',Nt),t(window).bind('resize.spectrum',O),vt.addClass('sp-active'),J.removeClass('sp-hidden'),$t(),Ht(),wt=Bt(),Tt(),w.show(wt),Y.trigger('show.spectrum',[wt])}}function Rt(t){27===t.keyCode&&It()}function Nt(t){2!=t.button&&(C||(xt?Wt(!0):Ft(),It()))}function It(){x&&!g&&(x=!1,t(K).unbind('keydown.spectrum',Rt),t(K).unbind('click.spectrum',Nt),t(window).unbind('resize.spectrum',O),vt.removeClass('sp-active'),J.addClass('sp-hidden'),w.hide(Bt()),Y.trigger('hide.spectrum',[Bt()]))}function Ft(){Vt(wt,!0)}function Vt(t,e){var n,r;b.equals(t,Bt())?Ht():(!t&&kt?Ct=!0:(Ct=!1,k=!t,r=(n=b(t)).toHsv(),I=r.h%360/360,F=r.s,V=r.v,B=r.a),Ht(),n&&n.isValid()&&!e&&(Ot=p.preferredFormat||n.getFormat()))}function Bt(t){return t=t||{},kt&&Ct?null:b.fromRatio({h:I,s:F,v:V,a:Math.round(100*B)/100},{format:t.format||Ot})}function zt(){Ht(),w.move(Bt()),Y.trigger('move.spectrum',[Bt()])}function Ht(){at.removeClass('sp-validation-error'),Ut();var t=b.fromRatio({h:I,s:1,v:1});Q.css('background-color',t.toHexString());var e=Ot;B<1&&(0!==B||'name'!==e)&&('hex'!==e&&'hex3'!==e&&'hex6'!==e&&'name'!==e||(e='rgb'));var n=Bt({format:e}),r='';if(yt.removeClass('sp-clear-display'),yt.css('background-color','transparent'),!n&&kt)yt.addClass('sp-clear-display');else{var a=n.toHexString(),s=n.toRgbString();if(o||1===n.alpha?yt.css('background-color',s):(yt.css('background-color','transparent'),yt.css('filter',n.toFilter())),p.showAlpha){var c=n.toRgb();c.a=0;var l=b(c).toRgbString(),u='linear-gradient(left, '+l+', '+a+')';i?rt.css('filter',b(l).toFilter({gradientType:1},a)):(rt.css('background','-webkit-'+u),rt.css('background','-moz-'+u),rt.css('background','-ms-'+u),rt.css('background','linear-gradient(to right, '+l+', '+a+')'))}r=n.toString(e)}p.showInput&&at.val(r),p.showPalette&&_t(),Tt()}function Ut(){var t=F,e=V;if(kt&&Ct)ot.hide(),nt.hide(),tt.hide();else{ot.show(),nt.show(),tt.show();var n=t*S,r=P-e*P;n=Math.max(-_,Math.min(S-_,n-_)),r=Math.max(-_,Math.min(P-_,r-_)),tt.css({top:r+'px',left:n+'px'});var i=B*L;ot.css({left:i-R/2+'px'});var o=I*A;nt.css({top:o-N+'px'})}}function Wt(t){var e=Bt(),n='',r=!!k||!b.equals(e,wt);e&&(n=e.toString(Ot),!x&&Pt(e)),dt&&Y.val(n),t&&r&&(w.change(e),Y.trigger('change',[e]))}function $t(){x&&(S=Q.width(),P=Q.height(),_=tt.height(),et.width(),A=et.height(),N=nt.height(),L=it.width(),R=ot.width(),g||(J.css('position','absolute'),p.offset?J.offset(p.offset):J.offset(function(e,n){var r=0,i=e.outerWidth(),o=e.outerHeight(),a=n.outerHeight(),s=e[0].ownerDocument,c=s.documentElement,l=c.clientWidth,u=c.clientHeight,f=t(s).scrollLeft(),h=t(s).scrollTop(),d=l+f,p=u+h,g=n.offset();return g.top+=a,g.left-=Math.min(g.left,g.left+i>d&&d>i?Math.abs(g.left+i-d):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+a-r):r),g}(J,mt))),Ut(),p.showPalette&&_t(),Y.trigger('reflow.spectrum'))}function qt(){It(),X=!0,Y.attr('disabled',!0),mt.addClass('sp-disabled')}!function(){if(i&&J.find('*:not(input)').attr('unselectable','on'),St(),gt&&Y.after(vt).hide(),kt||ut.hide(),g)Y.after(J).hide();else{var e='parent'===p.appendTo?Y.parent():t(p.appendTo);1!==e.length&&(e=t('body')),e.append(J)}function n(e){return e.data&&e.data.ignore?(Vt(t(e.target).closest('.sp-thumb-el').data('color')),zt()):(Vt(t(e.target).closest('.sp-thumb-el').data('color')),zt(),p.hideAfterPaletteSelect&&(Wt(!0),It())),!1}jt(),mt.bind('click.spectrum touchstart.spectrum',(function(e){X||At(),e.stopPropagation(),t(e.target).is('input')||e.preventDefault()})),(Y.is(':disabled')||!0===p.disabled)&&qt(),J.click(T),at.change(Mt),at.bind('paste',(function(){setTimeout(Mt,1)})),at.keydown((function(t){13==t.keyCode&&Mt()})),lt.text(p.cancelText),lt.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ft(),It()})),ut.attr('title',p.clearText),ut.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ct=!0,zt(),g&&Wt(!0)})),ft.text(p.chooseText),ft.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),i&&at.is(':focus')&&at.trigger('change'),at.hasClass('sp-validation-error')||(Wt(!0),It())})),ht.text(p.showPaletteOnly?p.togglePaletteMoreText:p.togglePaletteLessText),ht.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),p.showPaletteOnly=!p.showPaletteOnly,p.showPaletteOnly||g||J.css('left','-='+(Z.outerWidth(!0)+5)),St()})),D(it,(function(t,e,n){B=t/L,Ct=!1,n.shiftKey&&(B=Math.round(10*B)/10),zt()}),Et,Dt),D(et,(function(t,e){I=parseFloat(e/A),Ct=!1,p.showAlpha||(B=1),zt()}),Et,Dt),D(Q,(function(t,e,n){if(n.shiftKey){if(!G){var r=F*S,i=P-V*P,o=Math.abs(t-r)>Math.abs(e-i);G=o?'x':'y'}}else G=null;var a=!G||'y'===G;(!G||'x'===G)&&(F=parseFloat(t/S)),a&&(V=parseFloat((P-e)/P)),Ct=!1,p.showAlpha||(B=1),zt()}),Et,Dt),bt?(Vt(bt),Ht(),Ot=p.preferredFormat||b(bt).getFormat(),Pt(bt)):Ht(),g&&Lt();var r=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',r,n),ct.delegate('.sp-thumb-el:nth-child(1)',r,{ignore:!0},n)}();var Gt={show:Lt,hide:It,toggle:At,reflow:$t,option:function(n,r){return n===e?t.extend({},p):r===e?p[n]:(p[n]=r,'preferredFormat'===n&&(Ot=p.preferredFormat),void St())},enable:function(){X=!1,Y.attr('disabled',!1),mt.removeClass('sp-disabled')},disable:qt,offset:function(t){p.offset=t,$t()},set:function(t){Vt(t),Wt()},get:Bt,destroy:function(){Y.show(),mt.unbind('click.spectrum touchstart.spectrum'),J.remove(),vt.remove(),r[Gt.id]=null},container:J};return Gt.id=r.push(Gt)-1,Gt}function _(){}function T(t){t.stopPropagation()}function E(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function D(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,c={},l=0,u=0,f='ontouchstart'in window,h={};function d(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function p(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,h=r&&r.pageY||t.pageY,p=Math.max(0,Math.min(o-c.left,u)),v=Math.max(0,Math.min(h-c.top,l));f&&d(t),n.apply(e,[p,v,t])}}function g(){s&&(t(a).unbind(h),t(a.body).removeClass('sp-dragging'),setTimeout((function(){o.apply(e,arguments)}),0)),s=!1}h['selectstart']=d,h['dragstart']=d,h['touchmove mousemove']=p,h['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){var i=n.which?3==n.which:2==n.button;i||s||!1!==r.apply(e,arguments)&&(s=!0,l=t(e).height(),u=t(e).width(),c=t(e).offset(),t(a).bind(h),t(a.body).addClass('sp-dragging'),p(n),d(n))}))}function M(){return t.fn.spectrum.inputTypeColorSupport()}function A(t,e,n){t=J(t,255),e=J(e,255),n=J(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var c=o-a;switch(i=s>.5?c/(2-o-a):c/(o+a),o){case t:r=(e-n)/c+(e<n?6:0);break;case e:r=(n-t)/c+2;break;case n:r=(t-e)/c+4}r/=6}return{h:r,s:i,l:s}}function L(t,e,n){t=J(t,255),e=J(e,255),n=J(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=o,c=o-a;if(i=0===o?0:c/o,o==a)r=0;else{switch(o){case t:r=(e-n)/c+(e<n?6:0);break;case e:r=(n-t)/c+2;break;case n:r=(t-e)/c+4}r/=6}return{h:r,s:i,v:s}}function R(t,e,n,r){var i=[tt(g(t).toString(16)),tt(g(e).toString(16)),tt(g(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join('')}function N(t,e,n,r){var i;return[tt((i=r,Math.round(255*parseFloat(i)).toString(16))),tt(g(t).toString(16)),tt(g(e).toString(16)),tt(g(n).toString(16))].join('')}function I(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s-=e/100,n.s=Z(n.s),b(n)}function F(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s+=e/100,n.s=Z(n.s),b(n)}function V(t){return b(t).desaturate(100)}function B(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l+=e/100,n.l=Z(n.l),b(n)}function z(t,e){e=0===e?0:e||10;var n=b(t).toRgb();return n.r=m(0,v(255,n.r-g(255*(-e/100)))),n.g=m(0,v(255,n.g-g(255*(-e/100)))),n.b=m(0,v(255,n.b-g(255*(-e/100)))),b(n)}function H(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l-=e/100,n.l=Z(n.l),b(n)}function U(t,e){var n=b(t).toHsl(),r=(g(n.h)+e)%360;return n.h=r<0?360+r:r,b(n)}function W(t){var e=b(t).toHsl();return e.h=(e.h+180)%360,b(e)}function $(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+120)%360,s:e.s,l:e.l}),b({h:(n+240)%360,s:e.s,l:e.l})]}function q(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+90)%360,s:e.s,l:e.l}),b({h:(n+180)%360,s:e.s,l:e.l}),b({h:(n+270)%360,s:e.s,l:e.l})]}function G(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+72)%360,s:e.s,l:e.l}),b({h:(n+216)%360,s:e.s,l:e.l})]}function K(t,e,n){e=e||6,n=n||30;var r=b(t).toHsl(),i=360/n,o=[b(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(b(r));return o}function Y(t,e){e=e||6;for(var n=b(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(b({h:r,s:i,v:o})),o=(o+s)%1;return a}function X(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function J(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=v(e,m(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),p.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Z(t){return v(1,m(0,t))}function Q(t){return parseInt(t,16)}function tt(t){return 1==t.length?'0'+t:''+t}function et(t){return t<=1&&(t=100*t+'%'),t}}(p);var g=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')};e["a"]=f["a"].extend({template:function(){var t=this.ppfx;return"\n      <div class=\"".concat(this.holderClass(),"\"></div>\n      <div class=\"").concat(t,"field-colorp\">\n        <div class=\"").concat(t,"field-colorp-c\" data-colorp-c>\n          <div class=\"").concat(t,"checker-bg\"></div>\n        </div>\n      </div>\n    ")},inputClass:function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},remove:function(){f["a"].prototype.remove.apply(this,arguments),this.colorEl.spectrum('destroy')},handleChange:function(t){t.stopPropagation();var e=t.target.value;Object(s["isUndefined"])(e)||this.__onInputChange(e)},__onInputChange:function(t){var e=this.model,n=this.opts.onChange,r=t,i=this.getColorEl();if(i){i.spectrum('set',r);var o=i.spectrum('get'),a=r&&g(o);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=Object(s["isUndefined"])(e.def)?n.get('defaults'):e.def,i=Object(s["isUndefined"])(t)?Object(s["isUndefined"])(r)?'':r:t,o=this.getInputEl(),a=this.getColorEl(),c='none'!=i?i:'';o.value=i,a.get(0).style.backgroundColor=c,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum('set',c),this.noneColor='none'==i)},getColorEl:function(){if(!this.colorEl){var t,e=this.em,n=this.model,r=this.opts,i=this,o=this.ppfx,a=r.onChange,s=p("<div class=\"".concat(this.ppfx,"field-color-picker\"></div>")),c=s.get(0).style,l=e&&e.config?e.config.el:'',u=e&&e.getConfig&&e.getConfig('colorPicker')||{},f=0;this.$el.find("[data-colorp-c]").append(s),s.spectrum(d(d(d({color:n.getValue()||!1,containerClassName:"".concat(o,"one-bg ").concat(o,"two-color"),appendTo:l||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},u),n.get('colorPicker')||{}),{},{move:function(t){var e=g(t);c.backgroundColor=e,a?a(e,!0):n.setValueFromInput(e,0)},change:function(t){f=1;var e=g(t);c.backgroundColor=e,a?a(e):(n.setValueFromInput(0,0),n.setValueFromInput(e)),i.noneColor=0},show:function(e){f=0,t=a?n.getValue({noDefault:!0}):g(e)},hide:function(e){f||!t&&!a||(i.noneColor&&(t=''),c.backgroundColor=t,s.spectrum('set',t),a?a(t,!0):n.setValueFromInput(t,0))}})),e&&e.on&&this.listenTo(e,'component:selected',(function(){f=1,s.spectrum('hide')})),this.colorEl=s}return this.colorEl},render:function(){return f["a"].prototype.render.call(this),this.getColorEl(),this}})},function(t,e,n){"use strict";(function(t){var r=n(14),i=n.n(r),o=n(75),a=n(76),s=setTimeout;function c(t){return Boolean(t&&void 0!==t.length)}function l(){}function u(t){if(!(this instanceof u))throw new TypeError('Promises must be constructed via new');if('function'!=typeof t)throw new TypeError('not a function');this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],v(t,this)}function f(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,u._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void d(e.promise,t)}h(e.promise,r)}else(1===t._state?h:d)(e.promise,t._value)}))):t._deferreds.push(e)}function h(t,e){try{if(e===t)throw new TypeError('A promise cannot be resolved with itself.');if(e&&('object'===i()(e)||'function'==typeof e)){var n=e.then;if(e instanceof u)return t._state=3,t._value=e,void p(t);if('function'==typeof n)return void v((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,p(t)}catch(e){d(t,e)}var r,o}function d(t,e){t._state=2,t._value=e,p(t)}function p(t){2===t._state&&0===t._deferreds.length&&u._immediateFn((function(){t._handled||u._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)f(t,t._deferreds[e]);t._deferreds=null}function g(t,e,n){this.onFulfilled='function'==typeof t?t:null,this.onRejected='function'==typeof e?e:null,this.promise=n}function v(t,e){var n=!1;try{t((function(t){n||(n=!0,h(e,t))}),(function(t){n||(n=!0,d(e,t))}))}catch(t){if(n)return;n=!0,d(e,t)}}u.prototype['catch']=function(t){return this.then(null,t)},u.prototype.then=function(t,e){var n=new this.constructor(l);return f(this,new g(t,e,n)),n},u.prototype['finally']=o["a"],u.all=function(t){return new u((function(e,n){if(!c(t))return n(new TypeError('Promise.all accepts an array'));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function a(t,s){try{if(s&&('object'===i()(s)||'function'==typeof s)){var c=s.then;if('function'==typeof c)return void c.call(s,(function(e){a(t,e)}),n)}r[t]=s,0==--o&&e(r)}catch(t){n(t)}}for(var s=0;s<r.length;s++)a(s,r[s])}))},u.allSettled=a["a"],u.resolve=function(t){return t&&'object'===i()(t)&&t.constructor===u?t:new u((function(e){e(t)}))},u.reject=function(t){return new u((function(e,n){n(t)}))},u.race=function(t){return new u((function(e,n){if(!c(t))return n(new TypeError('Promise.race accepts an array'));for(var r=0,i=t.length;r<i;r++)u.resolve(t[r]).then(e,n)}))},u._immediateFn='function'==typeof t&&function(e){t(e)}||function(t){s(t,0)},u._unhandledRejectionFn=function(t){'undefined'!=typeof console&&console&&console.warn('Possible Unhandled Promise Rejection:',t)},e["a"]=u}).call(this,n(82).setImmediate)},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return F})),n.d(e,"evPfx",(function(){return V})),n.d(e,"evPageSelect",(function(){return B})),n.d(e,"evPageSelectBefore",(function(){return z})),n.d(e,"evPageUpdate",(function(){return H})),n.d(e,"evPageAdd",(function(){return U})),n.d(e,"evPageAddBefore",(function(){return W})),n.d(e,"evPageRemove",(function(){return $})),n.d(e,"evPageRemoveBefore",(function(){return q}));var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1),l=n(3),u=n(5),f=n.n(u),h=n(6),d=n.n(h),p=n(7),g=n.n(p),v=n(8),m=n.n(v),y=n(4),b=n.n(y);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var C='__aw',k='__ah',S=function(t){g()(n,t);var e=x(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return{x:0,y:0,changesCount:0,attributes:{},width:null,height:null,head:[],component:'',styles:'',_undo:!0,_undoexc:['changesCount']}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.config,r=n.em,i=this.attributes,o=i.styles,a=i.component,l=r.get('DomComponents'),u=l.getConfig(),f=r.get('CssComposer').getAll(),h={};this.em=r;var d={em:r,config:u,frame:this,idMap:h};if(!Object(c["isComponent"])(a)){var p=Object(c["isObject"])(a)?a:{components:a};!p.type&&(p.type='wrapper');var g=l.getType('wrapper').model;this.set('component',new g(p,d))}if(o){if(!Object(c["isObject"])(o)){var v=Object.keys(h);v.length&&Array.isArray(o)&&o.forEach((function(t){var e=t.selectors;if(e&&1==e.length){var n=e[0],r=n.name&&2===n.type&&n;if(r&&h[r.name])r.name=h[r.name];else if(Object(s["isString"])(n)&&'#'===n[0]){var i=n.substring(1);i&&h[i]&&(e[0]="#".concat(h[i]))}}})),f.add(o),this.set('styles',f)}}else this.set('styles',f);!t.width&&this.set(C,1),!t.height&&this.set(k,1)}},{key:"onRemove",value:function(){this.getComponent().remove({root:1})}},{key:"changesUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.temporary||t.noCount||t.avoidStore||this.set('changesCount',this.get('changesCount')+1)}},{key:"getComponent",value:function(){return this.get('component')}},{key:"getStyles",value:function(){return this.get('styles')}},{key:"disable",value:function(){this.trigger('disable')}},{key:"remove",value:function(){this.view=0;var t=this.collection;return t&&t.remove(this)}},{key:"getHead",value:function(){var t=this.get('head')||[];return i()(t)}},{key:"setHead",value:function(t){return this.set('head',i()(t))}},{key:"addHeadItem",value:function(t){var e=this.getHead();e.push(t),this.setHead(e)}},{key:"getHeadByAttr",value:function(t,e,n){return this.getHead().filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]}},{key:"removeHeadByAttr",value:function(t,e,n){var r=this.getHead(),i=this.getHeadByAttr(t,e,n),o=r.indexOf(i);o>=0&&(r.splice(o,1),this.setHead(r))}},{key:"addLink",value:function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})}},{key:"removeLink",value:function(t){this.removeHeadByAttr('href',t,'link')}},{key:"addScript",value:function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})}},{key:"removeScript",value:function(t){this.removeHeadByAttr('src',t,'script')}},{key:"getPage",value:function(){var t=this.collection;return t&&t.page}},{key:"_emitUpdated",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.em.trigger('frame:updated',O({frame:this},t))}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l["Model"].prototype.toJSON.call(this,t),n=this.em,r=n&&n.get('StorageManager'),i=r&&r.getConfig(),o=Object(s["result"])(this,'defaults');if(i&&!t.fromUndo){var a={component:this.getComponent()};i.storeHtml&&(e.html=n.getHtml(a)),i.storeCss&&(e.css=n.getCss(a))}return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[C]&&delete e.width,e[k]&&delete e.height,Object(s["forEach"])(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),Object(s["forEach"])(o,(function(t,n){e[n]===t&&delete e[n]})),Object(s["forEach"])(['attributes','head'],(function(t){Object(s["isEmpty"])(e[t])&&delete e[t]})),e}}]),n}(l["Model"]);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var T=function(t){g()(n,t);var e=_(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(s["bindAll"])(this,'itemLoaded'),this.config=e,this.on('reset',this.onReset),this.on('remove',this.onRemove)}},{key:"onReset",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels||[];r.map((function(t){return e.onRemove(t)}))}},{key:"onRemove",value:function(t){t&&t.onRemove()}},{key:"itemLoaded",value:function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(0))}},{key:"listenToLoad",value:function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(1)}},{key:"listenToLoadItems",value:function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config;return l["Collection"].prototype.add.call(this,t,P(P({},e),{},{config:n}))}}]),n}(l["Collection"]);function E(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}T.prototype.model=S;var D=function(t){g()(n,t);var e=E(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return{frames:[],_undo:!0}}},{key:"initialize",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.config,i=void 0===r?{}:r,o=i.em,a={};this.em=o,t.frames||(a.component=t.component,a.styles=t.styles,['component','styles'].map((function(t){return e.unset(t)})));var s=t.frames||[a],c=new T(s,i);c.page=this,this.set('frames',c);var l=o&&o.get('UndoManager');l&&l.add(c)}},{key:"onRemove",value:function(){this.get('frames').reset()}},{key:"getFrames",value:function(){return this.get('frames')}},{key:"getId",value:function(){return this.id}},{key:"getName",value:function(){return this.get('name')}},{key:"setName",value:function(t){return this.get({name:t})}},{key:"getAllFrames",value:function(){return this.getFrames().models||[]}},{key:"getMainFrame",value:function(){return this.getFrames().at(0)}},{key:"getMainComponent",value:function(){var t=this.getMainFrame();return t&&t.getComponent()}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l["Model"].prototype.toJSON.call(this,t),n=Object(s["result"])(this,'defaults');return Object(s["forEach"])(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),Object(s["forEach"])(n,(function(t,n){e[n]===t&&delete e[n]})),e}}]),n}(l["Model"]);function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var R=function(t){g()(n,t);var e=L(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=e,this.on('reset',this.onReset),this.on('remove',this.onRemove)}},{key:"onReset",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels||[];r.map((function(t){return e.onRemove(t)}))}},{key:"onRemove",value:function(t){t&&t.onRemove()}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config;return l["Collection"].prototype.add.call(this,t,A(A({},e),{},{config:n}))}}]),n}(l["Collection"]);function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}R.prototype.model=D;var F='page',V="".concat(F,":"),B="".concat(V,"select"),z="".concat(B,":before"),H="".concat(V,"update"),U="".concat(V,"add"),W="".concat(U,":before"),$="".concat(V,"remove"),q="".concat($,":before"),G='change:selected',K='main';e["default"]=function(){return{name:'PageManager',storageKey:'pages',Page:D,Pages:R,events:{all:F,select:B,selectBefore:z,update:H,add:U,addBefore:W,remove:$,removeBefore:q},init:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s["bindAll"])(this,'_onPageChange');var n=e.em,r=I({},e);this.config=r,this.em=n;var i=new R([],r);this.pages=i;var o=new l["Model"]({_undo:!0});return this.model=o,i.on('add',(function(t,e,r){return n.trigger(U,t,r)})),i.on('remove',(function(t,e,r){return n.trigger($,t,r)})),i.on('change',(function(t,e){n.trigger(H,t,t.changedAttributes(),e)})),i.on('reset',(function(e){return e.at(0)&&t.select(e.at(0))})),i.on('all',this.__onChange,this),o.on(G,this._onPageChange),this},__onChange:function(t,e,n,r){var i=r||n;this.em.trigger(F,{event:t,page:e,options:i})},onLoad:function(){var t=this.pages,e={silent:!0};t.add(this.config.pages||[],e);var n=t.length?this.getMain():this.add({type:K},e);this.select(n,e)},_onPageChange:function(t,e,n){var r=this.em,i=r.get('LayerManager'),o=e.getMainComponent();i&&o&&i.setRoot(o),r.trigger(B,e,t.previous('selected')),this.__onChange(G,e,n)},postLoad:function(){var t=this.em,e=this.model,n=t.get('UndoManager');n&&n.add(e),n&&n.add(this.pages)},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em;t.id=t.id||this._createId();var i=function(){var r=e.pages.add(t,n);return n.select&&e.select(r),r};return!n.silent&&r.trigger(W,t,i,n),!n.abort&&i()},remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=Object(s["isString"])(t)?this.get(t):t,o=function(){return i&&e.pages.remove(i,n),i};return!n.silent&&r.trigger(q,i,o,n),!n.abort&&o()},get:function(t){return this.pages.filter((function(e){return e.get('id')===t}))[0]},getMain:function(){var t=this.pages;return t.filter((function(t){return t.get('type')===K}))[0]||t.at(0)},getAll:function(){return i()(this.pages.models)},getAllWrappers:function(){var t=this.getAll();return Object(s["unique"])(Object(s["flatten"])(t.map((function(t){return t.getAllFrames().map((function(t){return t.getComponent()}))}))))},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get('id')]=e,t}),{})},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(s["isString"])(t)?this.get(t):t;return n&&(this.em.trigger(z,n,e),this.model.set('selected',n,e)),this},getSelected:function(){return this.model.get('selected')},destroy:function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),['selected','config','em','pages','model'].map((function(e){return t[e]=0}))},store:function(t){if(!this.em.get('hasPages'))return{};var e={},n=this.config;return e[this.storageKey]=JSON.stringify(this.getAll()),!t&&n.stm&&n.stm.store(e),e},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.storageKey,n=t[e]||[];if('string'==typeof n)try{n=JSON.parse(t[e])}catch(t){}return n&&n.length&&this.pages.reset(n),n},_createId:function(){var t,e=this.getAll().length+16,n=this.getAllMap();do{t=Object(c["createId"])(e)}while(n[t]);return t}}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=i.a.Model.extend({defaults:{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1},initialize:function(t){if(this.get('buttons').length){var e=n(46).default;this.set('buttons',new e(this.get('buttons')))}}});e["default"]=i.a.Collection.extend({model:o,deactivateAllExceptOne:function(t,e){this.forEach((function(n,r){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},deactivateAll:function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:1})}))},disableAllButtons:function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},disableAllButtonsExceptOne:function(t,e){this.forEach((function(n,r){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))}})},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(47);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){1&&function(t){"use strict";function e(t){for(var e={},n=0;n<t.length;++n)e[t[n].toLowerCase()]=!0;return e}t.defineMode("css",(function(e,n){var r=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var i,o,a=e.indentUnit,s=n.tokenHooks,c=n.documentTypes||{},l=n.mediaTypes||{},u=n.mediaFeatures||{},f=n.mediaValueKeywords||{},h=n.propertyKeywords||{},d=n.nonStandardPropertyKeywords||{},p=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},m=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,O=!1!==e.highlightNonStandardPropertyKeywords;function x(t,e){return i=e,t}function C(t,e){var n=t.next();if(s[n]){var r=s[n](t,e);if(!1!==r)return r}return"@"==n?(t.eatWhile(/[\w\\\-]/),x("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?x(null,"compare"):"\""==n||"'"==n?(e.tokenize=k(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==n?(t.match(/^\s*\w*/),x("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),x("number","unit")):"-"!==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=S),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 k(t){return function(e,n){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),x("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=k(")"),x(null,"(")}function j(t,e,n){this.type=t,this.indent=e,this.prev=n}function P(t,e,n,r){return t.context=new j(n,e.indentation()+(!1===r?0:a),t.context),n}function _(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function T(t,e,n){return M[n.context.type](t,e,n)}function E(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return T(t,e,n)}function D(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return P(n,e,"block");if("}"==t&&n.context.prev)return _(n);if(w&&/@component/i.test(t))return P(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return P(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return P(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 P(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return P(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return P(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):d.hasOwnProperty(r)?(o=O?"string-2":"property","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?P(n,e,"prop"):T(t,e,n)},prop:function(t,e,n){if(";"==t)return _(n);if("{"==t&&y)return P(n,e,"propBlock");if("}"==t||"{"==t)return E(t,e,n);if("("==t)return P(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)D(e);else if("interpolation"==t)return P(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?_(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?E(t,e,n):")"==t?_(n):"("==t?P(n,e,"parens"):"interpolation"==t?P(n,e,"interpolation"):("word"==t&&D(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):T(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&c.hasOwnProperty(e.current())?(o="tag",n.context.type):M.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return P(n,e,"atBlock_parens");if("}"==t||";"==t)return E(t,e,n);if("{"==t)return _(n)&&P(n,e,y?"block":"top");if("interpolation"==t)return P(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":l.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?O?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?E(t,e,n):"{"==t?_(n)&&P(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?_(n):"{"==t||"}"==t?E(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?P(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):T(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,_(n)):"word"==t?(o="@font-face"==n.stateArg&&!p.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?(o="variable","keyframes"):"{"==t?P(n,e,"top"):T(t,e,n)},at:function(t,e,n){return";"==t?_(n):"{"==t||"}"==t?E(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?_(n):"{"==t||";"==t?E(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new j(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&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(e.state=M[e.state](i,t,e)),o},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=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)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),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"],s=e(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],l=e(c),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"],f=e(u),h=["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(h),p=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"],m=e(v),y=["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","button-bevel","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","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-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","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","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(y),w=n.concat(i).concat(a).concat(c).concat(u).concat(h).concat(v).concat(y);function O(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:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:f,nonStandardPropertyKeywords:d,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=O,O(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:f,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=O,O(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:o,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:f,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=O,O(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:o,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:d,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=O,O(t,e))}},name:"css",helperType:"gss"})}(n(27))},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(1),o=n(24);e["default"]={run:function(t){Object(r["bindAll"])(this,'onKeyUp','enableDragger','disableDragger'),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){' '===Object(i["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,i=this.dragger,a=t?'add':'remove';this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),i||(i=new o["a"]({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=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?'add':'remove',r=t?'on':'off',o={on:i["on"],off:i["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)})),o[r](document,'keyup',this.onKeyUp),o[r](a,'mousedown',this.enableDragger),o[r](document,'mouseup',this.disableDragger)}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(0);e["default"]={run:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],s=r.component||t.getSelectedAll();return s=Object(o["isArray"])(s)?i()(s):[s],t.select(null),s.forEach((function(t){if(!t||!t.get('removable'))return n.em.logWarning('The element is not removable',{component:t});t.remove(),t.collection&&a.push(t)})),a.length&&t.select(a),s}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a=n(24);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var l='dmode';e["default"]={run:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(o["bindAll"])(this,'setPosition','onStart','onDrag','onEnd','getPosition','getGuidesStatic','renderGuide','getGuidesTarget');var i=r.target,s=r.event,u=r.mode,f=r.dragger,h=void 0===f?{}:f,d=i.getEl(),p=c({doc:d.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=t,this.em=t.getModel(),this.target=i,this.isTran='translate'==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(p):(g=new a["a"](p),this.dragger=g),s&&g.start(s),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this.editor,r=this.em,i=this.opts,a=n.getConfig('stylePrefix'),s=document.createElement('div'),c=document.createElement('div'),l="<div class=\"".concat(a,"guide-info__line ").concat(a,"danger-bg\">\n        <div class=\"").concat(a,"guide-info__content ").concat(a,"danger-color\"></div>\n      </div>");(e=document.createElement('div')).className="".concat(a,"guides"),s.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),c.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),s.innerHTML=l,c.innerHTML=l,e.appendChild(s),e.appendChild(c),n.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=s,this.elGuideInfoY=c,this.elGuideInfoContentX=s.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(a,"guide-info__content")),r.on('canvas:update frame:scroll',Object(o["debounce"])((function(){t.updateGuides(),i.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return Object(o["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,r=this;(t||this.guides).forEach((function(t){var i=t.origin,a=e===i?n:r.getElementPos(i);e=i,n=a,Object(o["each"])(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,i=e.height,o=e.left,a=e.width;switch(t.type){case't':n.y=r;break;case'b':n.y=r+i;break;case'l':n.x=o;break;case'r':n.x=o+a;break;case'x':n.x=o+a/2;break;case'y':n.y=r+i/2}return n},renderGuide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.guide||document.createElement('div'),n='px',r=t.active?2:1,i=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((i=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(i)),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),i=r.top,o=r.height,a=r.left,s=r.width,l=[{type:'t',y:i},{type:'b',y:i+o},{type:'l',x:a},{type:'r',x:a+s},{type:'x',x:a+s/2},{type:'y',y:i+o/2}].map((function(i){return c(c({},i),{},{origin:t,originRect:r,guide:n.debug&&e.renderGuide(i)})}));return l.forEach((function(t){return e.guides.push(t)})),l},getTranslate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'x',n=0;return(t||'').split(' ').forEach((function(t){var r=t.trim(),i="translate".concat(e.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,'')))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(r)&&(t=i),t})).join(' ');return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,i=n.top,o=n.transform,a=0,s=0;return e?(a=this.getTranslate(o),s=this.getTranslate(o,'y')):(a=parseFloat(r||0),s=parseFloat(i||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,i=t.position,a=t.width,s=t.height,c=this.target,l=this.isTran,u=this.em,f='px',h=r?'':1,d="".concat(e).concat(f),p="".concat(n).concat(f),g={};if(l){var v=c.getStyle()['transform']||'';v=this.setTranslate(v,'x',d),g={transform:v=this.setTranslate(v,'y',p),en:h},c.addStyle(g,{avoidStore:!r})}else{var m={position:i,width:a,height:s},y={left:d,top:p,en:h};Object(o["keys"])(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,c.addStyle(g,{avoidStore:!r})}u.getSelected()&&Object(o["keys"])(g).forEach((function(t){return u.trigger("update:component:style:".concat(t))}))},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this.target,n=this.editor,r=this.isTran,i=this.opts,o=i.center,a=i.onStart,s=n.Canvas,c=e.getStyle(),l='absolute',u=[l,'relative'];if(a&&a(this._getDragData()),!r&&c.position!==l){var f,h=s.offset(e.getEl()),d=h.left,p=h.top,g=h.width,v=h.height,m=e.parent();do{var y=m.getStyle();f=u.indexOf(y.position)>=0?m:null,m=m.parent()}while(m&&!f);if(o){var b=s.getMouseRelativeCanvas(t);d=b.x,p=b.y}else if(f){var w=s.offset(f.getEl());d-=w.left,p-=w.top}this.setPosition({x:d,y:p,width:"".concat(g,"px"),height:"".concat(v,"px"),position:l})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,i=this.opts,o=this.id,a=i.onEnd;a&&a(t,n,c(c({event:t},n),this._getDragData())),r.stopCommand(o),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;['X','Y'].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display='none')}))},renderGuideInfo:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var r=e.origin,i=e.x,a=t.getElementPos(r),s=Object(o["isUndefined"])(i)?'y':'x',u='y'===s,f=a[u?'left':'top'],h=a.rect[u?'left':'top'],d=u?f+a.width:f+a.height,p=u?h+a.rect.width:h+a.rect.height,g=t["elGuideInfo".concat(s.toUpperCase())],v=t["elGuideInfoContent".concat(s.toUpperCase())],m=g.style,y=n.filter((function(t){return t.type===e.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,i=e.top,o=e.height,a=u?n+r:i+o;return{gap:a<f?f-a:(u?n:i)-d,guide:t}})).filter((function(t){return t.gap>0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,O=b.width,x=b.top,C=b.height,k=b.rect,S=u?w<a.left:x<a.top,j=u?w:x,P=u?k.left:k.top,_=u?w+O:x+C,T=u?k.left+k.width:k.top+k.height,E=u?e.y:e.x,D=S?_:d,M="".concat(E,"px"),A=S?f-_:j-d,L=S?h-T:P-p;m.display='',m[u?'top':'left']=M,m[u?'left':'top']="".concat(D,"px"),m[u?'width':'height']="".concat(A,"px"),v.innerHTML="".concat(Math.round(L),"px"),t.em.trigger("".concat(l,":active"),c(c({},t.getEventOpts()),{},{guide:e,guidesStatic:n,matched:y,posFirst:E,posSecond:D,size:A,sizeRaw:L,elGuideInfo:g,elGuideInfoCnt:v}))}}))},toggleDrag:function(t){var e=this.ppfx,n=this.editor,r=t?'add':'remove',i=["".concat(e,"is__grabbing")],o=n.Canvas,a=o.getBody();i.forEach((function(t){return a.classList[r](t)})),o[t?'startAutoscroll':'stopAutoscroll']()}}},function(t,e,n){"use strict";n.r(e),e["default"]={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)}}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(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)}}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=n.components().length,o=0,a=0;do{o++,r=(a=t.index()+o)<=i?n.getChildAt(a):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=0,o=0;do{i++,r=(o=t.index()-i)>=0?n.getChildAt(o):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=[];if(!i.get('styles'))return o;var a=i.get('type'),s=t.Pages.getAllWrappers(),c=Object(r["flatten"])(s.map((function(t){return t.findType(a)}))).length;if(!c){var l=t.CssComposer.getAll();o=l.filter((function(t){return t.get('group')==="cmp:".concat(a)})),l.remove(o)}return o}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r);e["default"]={run:function(t){var e=t.getModel(),n=i()(t.getSelectedAll());n.length&&e.set('clipboard',n)}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(3),o=n.n(i),a=n(23),s=o.a.$;e["default"]=Object(r["extend"])({},a["default"],{init:function(t){Object(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=s(t.target);e.data('model').get('removable')&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),s(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.data('model').destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html('Remove '+t.getName())}})},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r).a.$;e["default"]={run:function(t,e){var n=this;e&&e.set&&e.set('active',0);var r=t.getConfig(),o=t.Modal,a=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor('htmlmixed','hopscotch','HTML'),c=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=s.el,this.cssEditor=c.el;var l=i("<div class=\"".concat(a,"export-dl\"></div>"));l.append(s.$el).append(c.$el),this.$editors=l}o.open({title:r.textViewCode,content:this.$editors}).getModel().once('change:open',(function(){return t.stopCommand(n.id)})),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},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 i=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},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():console.warn('Fullscreen not supported'),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,e){document;var n=(t||'')+'fullscreenchange';this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var i=n.target,o=Object(r["isElement"])(i)?i:document.querySelector(i),a=this.enable(o||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')}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(3),o=n.n(i),a=n(1),s=n(23),c=n(35),l=o.a.$;e["default"]=Object(r["extend"])({},c["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),Object(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=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s["default"].enable.apply(this,e),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var r=this.$wrapper;r.css('cursor','move'),r.on('mousedown',this.initSorter),r.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(t){var e=l(t.target).data('model').get('draggable');e&&(this.cacheEl=null,this.startSelectPosition(t.target,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off('mousedown',this.initSorter),Object(a["on"])(this.getContentWindow(),'keydown',this.rollback))},initSorterFromModel:function(t){var e=t.get('draggable');if(e){this.cacheEl=null;var n=t.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),Object(a["on"])(this.getContentWindow(),'keydown',this.rollback)}},initSorterFromModels:function(t){this.cacheEl=null;var e=t[t.length-1],n=(this.em.get('currentFrame')||{}).model,r=e.getEl(n),i=r.ownerDocument;this.startSelectPosition(r,i,{onStart:this.onStart}),this.sorter.draggable=e.get('draggable'),this.sorter.toMove=t,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),Object(a["on"])(this.getContentWindow(),'keydown',this.rollback)},onEndMoveFromModel:function(){Object(a["off"])(this.getContentWindow(),'keydown',this.rollback)},onEndMove:function(){this.enable(),Object(a["off"])(this.getContentWindow(),'keydown',this.rollback)},onSelect:function(t,e){},rollback:function(t,e){(27==(t.which||t.keyCode)||e)&&(this.sorter.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=l(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=l(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s["default"].stop.apply(this,e),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass);var r=this.$wrapper;r.css('cursor','').unbind().removeClass(this.noSelClass)}})},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(13);e["default"]={open:function(t){var e=this,n=this.editor,i=this.title,o=this.config,a=this.am,s=o.custom;if(Object(r["isFunction"])(s.open))return s.open(a.__customData());n.Modal.open({title:i,content:t}).onceClose((function(){return n.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if(Object(r["isFunction"])(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.AssetManager,o=r.getConfig(),a=n.types,s=void 0===a?[]:a,c=n.accept,l=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=o,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:l,types:s,options:n}),o.custom)this.rendered=this.rendered||Object(i["f"])('div'),this.rendered.className="".concat(o.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(c){var f=this.rendered.querySelector("input#".concat(o.stylePrefix,"uploadFile"));f&&f.setAttribute('accept',c)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(13);e["default"]={open:function(){var t=this.container,e=this.editor,n=this.bm,i=this.config,o=i.custom,a=i.appendTo;if(Object(r["isFunction"])(o.open))return o.open(n.__customData());if(this.firstRender&&!a){var s='views-container',c=e.Panels;(c.getPanel(s)||c.addPanel({id:s})).set('appendContent',t).trigger('change:appendContent'),o||t.appendChild(n.render())}t&&(t.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if(Object(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||Object(i["f"])('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()}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t){var e=t.LayerManager,n=t.Panels;if(!e.getConfig().appendTo){if(!this.layers){var r='views-container',i=document.createElement('div'),o=n.getPanel(r)||n.addPanel({id:r});i.appendChild(e.render()),o.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')}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r).a.$;e["default"]={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels,o='change:appendContent';this.$cn=i('<div></div>'),this.$cn2=i('<div></div>'),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=r.addPanel({id:'devices-c'}),c=a.render();s.set('appendContent',c).trigger(o)}var l=t.SelectorManager;this.slm=l;var u=l.getConfig();u.custom?l.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(l.render([]));var f=t.StyleManager;this.sm=f;var h=f.getConfig(),d=h.stylePrefix;this.$header=i("<div class=\"".concat(d,"header\">").concat(t.t('styleManager.empty'),"</div>")),this.$cn.append(this.$header),h.custom?f.__trgCustom({container:this.$cn2.get(0)}):h.appendTo||this.$cn2.append(f.render());var p='views-container';this.panel=r.getPanel(p),this.panel||(this.panel=r.addPanel({id:p})),this.panel.set('appendContent',this.$cn).trigger(o),this.em=t.getModel(),this.listenTo(this.em,f.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t,e,n,r,i=this.sender,o=this.sm;i&&i.get&&!i.get('active')||!o||(o.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()}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r).a.$;e["default"]={run:function(t,e){this.sender=e;var n=t.getModel(),r=t.Config.stylePrefix,o=t.TraitManager,a=o.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=i('<div></div>'),this.$cn2=i('<div></div>'),this.$cn.append(this.$cn2),this.$header=i('<div>').append("<div class=\"".concat(a.stylePrefix,"header\">").concat(n.t('traitManager.empty'),"</div>")),this.$cn.append(this.$header),this.$cn2.append("<div class=\"".concat(r,"traits-label\">").concat(n.t('traitManager.label'),"</div>")),this.$cn2.append(o.render());var s=t.Panels;(s.getPanel('views-container')?s.getPanel('views-container'):s.addPanel({id:'views-container'})).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()}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={run:function(t){var e=t.getModel().get('clipboard'),n=t.getSelected();e&&n&&(t.getSelectedAll().forEach((function(n){if(n){var i=n.collection;if(i){var o,a=i.indexOf(n)+1,s=e.filter((function(t){return t.get('copyable')}));o=Object(r["contains"])(e,n)&&n.get('copyable')?i.add(n.clone(),{at:a}):i.add(s.map((function(t){return t.clone()})),{at:a}),(o=Object(r["isArray"])(o)?o:[o]).forEach((function(e){return t.trigger('component:paste',e)}))}}})),n.emitUpdate())}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(0),a='sw-visibility';e["default"]={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 r=e.get('Canvas'),i=r.getBody(),a=r.getToolbarEl();a&&(a.style.display=t?'none':'');var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));Object(o["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=i()(t.getSelectedAll()),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(a)),this.shouldRunSwVisibility&&t.stopCommand(a),t.getModel().stopDefault();var r=this.getPanels(t),o=t.Canvas.getElement(),s=t.getEl(),c=t.Config.stylePrefix;if(!this.helper){var l=document.createElement('span');l.className="".concat(c,"off-prv fa fa-eye-slash"),s.appendChild(l),l.onclick=function(){return n.stopCommand()},this.helper=l}this.helper.style.display='inline-block',r.forEach((function(t){return t.set('visible',!1)}));var u=o.style;u.width='100%',u.height='100%',u.top='0',u.left='0',u.padding='0',u.margin='0',t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set('active',0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(a),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set('visible',!0)})),t.Canvas.getElement().setAttribute('style',''),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display='none'),t.refresh(),this.tglEffects()}}},function(t,e,n){"use strict";n.r(e),e["default"]={run:function(t,e,n){var r=n||{},i=r.el||'',o=t.Canvas,a=this.canvasResizer,s=r.options||{},c=o.getCanvasView();return s.appendTo=o.getResizerEl(),s.prefix=t.getConfig().stylePrefix,s.posFetcher=c.getElementPos.bind(c),s.mousePosFetcher=o.getMouseRelativePos,a&&!r.forceNew||(this.canvasResizer=t.Utils.Resizer.init(s),a=this.canvasResizer),a.setOptions(s),a.blur(),a.focus(i),a},stop:function(){var t=this.canvasResizer;t&&t.blur()}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(3),a=n.n(o),s=n(0),c=n(1);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var u=a.a.$;e["default"]={getOffsetMethod:function(t){return'get'+(t||'')+'OffsetViewerEl'},run:function(t,e,n){var r=n||{},o=r.state||'',a=t.getConfig(),f=this.em.getZoomDecimal(),h=r.el||'';if(!a.showOffsets||Object(c["isTextNode"])(h)||!a.showOffsetsSelected&&'Fixed'==o)t.stopCommand(this.id,n);else{var d=t.Canvas,p=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},r.elPos||d.getElementPos(h));Object(s["isUndefined"])(r.top)||(p.top=r.top),Object(s["isUndefined"])(r.left)||(p.left=r.left);var g=window.getComputedStyle(h),v=this.ppfx,m=o+'State',y=d[this.getOffsetMethod(o)](n.view);y.style.opacity='';var b=this['marginT'+o],w=this['marginB'+o],O=this['marginL'+o],x=this['marginR'+o],C=this['padT'+o],k=this['padB'+o],S=this['padL'+o],j=this['padR'+o];if(y.childNodes.length&&(this[m]='1',b=y.querySelector('[data-offset-m-t]'),w=y.querySelector('[data-offset-m-b]'),O=y.querySelector('[data-offset-m-l]'),x=y.querySelector('[data-offset-m-r]'),C=y.querySelector('[data-offset-p-t]'),k=y.querySelector('[data-offset-p-b]'),S=y.querySelector('[data-offset-p-l]'),j=y.querySelector('[data-offset-p-r]')),!this[m]){var P=o.toLowerCase(),_=P+'margin-v',T=P+'padding-v',E=u("<div class=\"".concat(v,"marginName\">")).get(0),D=u("<div class=\"".concat(v,"paddingName\">")).get(0),M=v+T+'-el',A="".concat(v+_+'-el'," ").concat(v+_),L="".concat(M," ").concat(v+T);b=u("<div class=\"".concat(A,"-top\"></div>")).get(0),w=u("<div class=\"".concat(A,"-bottom\"></div>")).get(0),O=u("<div class=\"".concat(A,"-left\"></div>")).get(0),x=u("<div class=\"".concat(A,"-right\"></div>")).get(0),C=u("<div class=\"".concat(L,"-top\"></div>")).get(0),k=u("<div class=\"".concat(L,"-bottom\"></div>")).get(0),S=u("<div class=\"".concat(L,"-left\"></div>")).get(0),j=u("<div class=\"".concat(L,"-right\"></div>")).get(0),this['marginT'+o]=b,this['marginB'+o]=w,this['marginL'+o]=O,this['marginR'+o]=x,this['padT'+o]=C,this['padB'+o]=k,this['padL'+o]=S,this['padR'+o]=j,E.appendChild(b),E.appendChild(w),E.appendChild(O),E.appendChild(x),D.appendChild(C),D.appendChild(k),D.appendChild(S),D.appendChild(j),y.appendChild(E),y.appendChild(D),this[m]='1'}var R='px',N=parseFloat(g.marginLeft.replace(R,''))*f,I=parseFloat(g.marginRight.replace(R,''))*f,F=parseFloat(g.marginTop.replace(R,''))*f,V=parseFloat(g.marginBottom.replace(R,''))*f,B=b.style,z=w.style,H=O.style,U=x.style,W=C.style,$=k.style,q=S.style,G=j.style,K=parseFloat(p.left),Y=parseFloat(g.width)*f+R;B.height=F+R,B.width=Y,B.top=p.top-F+R,B.left=K+R,z.height=V+R,z.width=Y,z.top=p.top+p.height+R,z.left=K+R;var X=p.height+F+V+R,J=p.top-F+R;H.height=X,H.width=N+R,H.top=J,H.left=K-N+R,U.height=X,U.width=I+R,U.top=J,U.left=K+p.width+R;var Z=parseFloat(g.paddingTop)*f;W.height=Z+R;var Q=parseFloat(g.paddingBottom)*f;$.height=Q+R;var tt=p.height-Q-Z+R,et=p.top+Z+R;q.height=tt,q.width=parseFloat(g.paddingLeft)*f+R,q.top=et;var nt=parseFloat(g.paddingRight)*f;G.height=tt,G.width=nt+R,G.top=et}},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||'',o=this.getOffsetMethod(i),a=t.Canvas,s=a[o](n.view);s.style.opacity=0}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e["default"]={init:function(){Object(r["bindAll"])(this,'_onFramesChange')},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t.Commands.isActive('preview')){var r=t.Canvas,i=n?'on':'off';r.getFrames().forEach((function(t){return e._upFrame(t,n)})),r.getModel()[i]('change:frames',this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach((function(t){return n._upFrame(t,1)}))},_upFrame:function(t,e){var n=e?'add':'remove';t.view.getBody().classList[n]("".concat(this.ppfx,"dashed"))}}},function(t,e,n){var r,i,o;1&&(i=[n(0),n(3)],void 0===(o='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 i(t,e){return n.call(t,e)}function o(e,n){return null!=e&&(t.isArray(n)||(n=i(arguments,1)),t.all(n,(function(t){return t in e})))}var a,s,c=(a=!1,s=-1,function(){return a||(s++,a=!0,t.defer((function(){a=!1}))),s});function l(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,r,i){for(var o,a=0,s=n.length;a<s;a++)if(o=n[a]){if("on"===e){if(!i.objectRegistry.register(o))continue}else if(!i.objectRegistry.unregister(o))continue;t.isFunction(o[e])&&o[e]("all",r,i)}}function f(e,n){var r=n.type,i=n.undoTypes,o=!i[r]||i[r][e];t.isFunction(o)&&o(n.object,n.before,n.after,n.options)}function h(e,r,i,o,a){if(!(i.isCurrentlyUndoRedoing||"undo"===e&&-1===i.pointer||"redo"===e&&i.pointer===i.length-1)){i.isCurrentlyUndoRedoing=!0;var s,c,l="undo"===e;for(a?c=l&&i.pointer===i.length-1||!l&&-1===i.pointer?t.clone(i.models):n.apply(i.models,l?[0,i.pointer]:[i.pointer,i.length-1]):(s=i.at(l?i.pointer:i.pointer+1),c=o?i.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),i.pointer+=(l?-1:1)*c.length;s=l?c.pop():c.shift();)s[e]();i.isCurrentlyUndoRedoing=!1,r.trigger(e,r)}}function d(t,e,n,i){if(t.track&&!t.isCurrentlyUndoRedoing&&e in i&&function(t,e){var n=t.condition,i=typeof n;return"function"===i?!!r(n,t,e):"boolean"!==i||n}(i[e],n)){var a=r(i[e]["on"],i[e],n);if(o(a,"object","before","after")){if(a.type=e,a.magicFusionIndex=c(),a.undoTypes=i,t.pointer<t.length-1)for(var s=t.length-t.pointer-1;s--;)t.pop();t.pointer=t.length,t.add(a),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}l.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 p={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,i){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&t.each(i.unsetData.before,e.unset,e))},redo:function(e,n,r,i){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&t.each(i.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),i=t.keys(r),o=t.pick(e.previousAttributes(),i),a=t.keys(o),s=(n||(n={})).unsetData={after:[],before:[]};return i.length!=a.length&&(i.length>a.length?t.each(i,(function(t){t in o||s.before.push(t)}),this):t.each(a,(function(t){t in r||s.after.push(t)}))),{object:e,before:o,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,n){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,i){if("object"==typeof n)return t.each(n,(function(t,n){2===e?v(e,t,r,i):v(e,n,t,r)}));switch(e){case 0:o(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(i[n]=r);break;case 1:i[n]&&t.isObject(r)&&(i[n]=t.extend({},i[n],r));break;case 2:delete i[n]}return this}g.prototype=p;var m=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){f("undo",this.attributes)},redo:function(t){f("redo",this.attributes)}}),y=e.Collection.extend({model:m,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 y,this.objectRegistry=new l,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,i(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){h("undo",this,this.stack,t)},undoAll:function(){h("undo",this,this.stack,!1,!0)},redo:function(t){h("redo",this,this.stack,t)},redoAll:function(){h("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<n-1;default:return!1}},merge:function(e){for(var n,r=t.isArray(e)?e:i(arguments);n=r.pop();)n instanceof b&&n.stack instanceof y&&(n.stack=this.stack)},addUndoType:function(t,e){v(0,t,e,this.undoTypes)},changeUndoType:function(t,e){v(1,t,e,this.undoTypes)},removeUndoType:function(t){v(2,t,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return t.extend(b,{defaults:function(e){t.extend(b.prototype.defaults,e)},addUndoType:function(t,e){v(0,t,e,p)},changeUndoType:function(t,e){v(1,t,e,p)},removeUndoType:function(t){v(2,t,void 0,p)}}),e.UndoManager=b})?r.apply(e,i):r)||(t.exports=o))},function(t,e,n){"use strict";e["a"]=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))}},function(t,e,n){"use strict";var r=n(14),i=n.n(r);e["a"]=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(i()(t)+' '+t+' is not iterable(cannot read property Symbol(Symbol.iterator))'));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function a(t,n){if(n&&('object'===i()(n)||'function'==typeof n)){var s=n.then;if('function'==typeof s)return void s.call(n,(function(e){a(t,e)}),(function(n){r[t]={status:'rejected',reason:n},0==--o&&e(r)}))}r[t]={status:'fulfilled',value:n},0==--o&&e(r)}for(var s=0;s<r.length;s++)a(s,r[s])}))}},function(t,e,n){var r=n(47);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(74),a=n.n(o),s=n(0);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n,r,i={maximumStackLength:500,trackSelection:1},o=function(t){return t.avoidStore||t.noUndo},c=function(t){return Object.keys(t.changedAttributes())};return{name:'UndoManager',init:function(){var u=this,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=l(l({},i),f),t=n.em,this.em=t;var h=!0;return(e=new a.a(l({track:!0,register:[]},n))).changeUndoType('change',{condition:function(t){var e=t.get('_undo');if(e){var n=t.get('_undoexc');if(Object(s["isArray"])(n)&&c(t).some((function(t){return n.indexOf(t)>=0})))return!1;if(Object(s["isBoolean"])(e))return!0;if(Object(s["isArray"])(e)&&c(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){!r&&(r=t.previousAttributes());var i=n||e||{};if(i.noUndo&&setTimeout((function(){r=null})),!o(i)){var a=t.toJSON({fromUndo:h}),c={object:t,before:r,after:a};if(r=null,!Object(s["isEmpty"])(a))return c}}}),e.changeUndoType('add',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o(n)&&u.isRegistered(e))return{object:e,before:void 0,after:t,options:l(l({},n),{},{fromUndo:h})}}}),e.changeUndoType('remove',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!o(n)&&u.isRegistered(e))return{object:e,before:t,after:void 0,options:l(l({},n),{},{fromUndo:h})}}}),e.on('undo redo',(function(){t.trigger('change:canvasOffset'),t.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(n){return e.on(n,(function(){return t.trigger(n)}))})),this},postLoad:function(){n.trackSelection&&t&&this.add(t.get('selected'))},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.undo(n),this},undoAll:function(){return e.undoAll(),this},redo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.redo(n),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable('undo')},hasRedo:function(){return e.isAvailable('redo')},isRegistered:function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},getStack:function(){return e.stack},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},skip:function(t){this.stop(),t(),this.start()},__getStackRead:function(){var t={};return this.getStack().forEach((function(e){var n=e.get('magicFusionIndex'),r=function(t){var e=t.attributes;return{type:e.type,after:e.after,before:e.before,object:e.object}}(e);t[n]?t[n].push(r):t[n]=[r]})),Object.keys(t).map((function(e){return t[e]}))},getPointer:function(){return this.getStack().pointer},clear:function(){return e.clear(),this},getInstance:function(){return e},destroy:function(){this.clear().removeAll(),[t,e,n,r].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(83),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(33))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,c=1,l={},u=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return l[c]=i,r(c),c++},h.clearImmediate=d}function d(t){delete l[t]}function p(t){if(u)setTimeout(p,0,t);else{var e=l[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{d(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(33),n(84))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error('setTimeout has not been defined')}function a(){throw new Error('clearTimeout has not been defined')}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n='function'==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r='function'==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,l=[],u=!1,f=-1;function h(){u&&c&&(u=!1,c.length?l=c.concat(l):f=-1,l.length&&d())}function d(){if(!u){var t=s(h);u=!0;for(var e=l.length;e;){for(c=l,l=[];++f<e;)c&&c[f].run();f=-1,e=l.length}c=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||u||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title='browser',i.browser=!0,i.env={},i.argv=[],i.version='',i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error('process.binding is not supported')},i.cwd=function(){return'/'},i.chdir=function(t){throw new Error('process.chdir is not supported')},i.umask=function(){return 0}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports["default"]=t.exports,t.exports.__esModule=!0,n(e,r)}t.exports=n,t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports["default"]=t.exports,t.exports.__esModule=!0},function(t,e,n){1&&function(t){"use strict";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){var e=n[t];return e||(n[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(e));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function o(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}t.defineMode("htmlmixed",(function(n,a){var s=t.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag,allowMissingTagName:a.allowMissingTagName}),c={},l=a&&a.tags,u=a&&a.scriptTypes;if(o(e,c),l&&o(l,c),u)for(var f=u.length-1;f>=0;f--)c.script.unshift(["type",u[f].matches,u[f].mode]);function h(e,o){var a,l=s.token(e,o.htmlState),u=/\btag\b/.test(l);if(u&&!/[<>\s\/]/.test(e.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&u&&/>$/.test(e.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var d=">"==e.current()&&function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(!i[0]||i[1].test(r(e,i[0])))return i[2]}}(c[f[1]],f[2]),p=t.getMode(n,d),g=i(f[1],!0),v=i(f[1],!1);o.token=function(t,e){return t.match(g,!1)?(e.token=h,e.localState=e.localMode=null,null):function(t,e,n){var r=t.current(),i=r.search(e);return i>-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}(t,v,e.localMode.token(t,e.localState))},o.localMode=p,o.localState=t.startState(p,s.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=e.current(),e.eol()&&(o.inTag+=" "));return l}return{startState:function(){return{token:h,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(27),n(91),n(92),n(49))},function(t,e,n){1&&function(t){"use strict";var e={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,c={},l=i.htmlMode?e:n;for(var u in l)c[u]=l[u];for(var u in i)c[u]=i[u];function f(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(d("atom","]]>")):null:t.match("--")?n(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=t(e+1),r.tokenize(n,r);if(">"==i){if(1==e){r.tokenize=f;break}return r.tokenize=t(e-1),r.tokenize(n,r)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(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 h(t,e){var n,r,i=t.next();if(">"==i||"/"==i&&t.eat(">"))return e.tokenize=f,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){e.tokenize=f,e.state=y,e.tagName=e.tagStart=null;var a=e.tokenize(t,e);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(e.tokenize=(n=i,(r=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=h;break}return"string"}).isInAttribute=!0,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=f;break}n.next()}return t}}function p(t){return t&&t.toLowerCase()}function g(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(c.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var n;1;){if(!t.context)return;if(n=t.context.tagName,!c.contextGrabbers.hasOwnProperty(p(n))||!c.contextGrabbers[p(n)].hasOwnProperty(p(e)))return;v(t)}}function y(t,e,n){return"openTag"==t?(n.tagStart=e.column(),b):"closeTag"==t?w:y}function b(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",C):c.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,0,n)):(a="error",b)}function w(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&c.implicitlyClosed.hasOwnProperty(p(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||!1===c.matchClosing?(a="tag",O):(a="tag error",x)}return c.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,0,n)):(a="error",x)}function O(t,e,n){return"endTag"!=t?(a="error",O):(v(n),y)}function x(t,e,n){return a="error",O(t,0,n)}function C(t,e,n){if("word"==t)return a="attribute",k;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||c.autoSelfClosers.hasOwnProperty(p(r))?m(n,r):(m(n,r),n.context=new g(n,r,i==n.indented)),y}return a="error",C}function k(t,e,n){return"equals"==t?S:(c.allowMissing||(a="error"),C(t,0,n))}function S(t,e,n){return"string"==t?j:"word"==t&&c.allowUnquoted?(a="string",C):(a="error",C(t,0,n))}function j(t,e,n){return"string"==t?j:C(t,0,n)}return f.isInText=!0,{startState:function(t){var e={tokenize:f,state:y,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;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=f)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==c.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(c.multilineTagIndentFactor||1);if(c.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!c.implicitlyClosed.hasOwnProperty(p(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=c.contextGrabbers[p(i.tagName)];if(!a||!a.hasOwnProperty(p(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml",skipAttribute:function(t){t.state==S&&(t.state=C)},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()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(27))},function(t,e,n){1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,c=n.json||s,l=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,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:o,typeof:o,instanceof:o,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=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t,e,n){return r=t,i=n,e}function v(t,e){var n,r=t.next();if('"'==r||"'"==r)return e.tokenize=(n=r,function(t,e){var r,i=!1;if(s&&"@"==t.peek()&&t.match(p))return e.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(e.tokenize=v),g("string","string")}),e.tokenize(t,e);if("."==r&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&t.eat(">"))return g("=>","operator");if("0"==r&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return t.eat("*")?(e.tokenize=m,m(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("`"==r)return e.tokenize=y,y(t,e);if("#"==r&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");if("#"==r&&t.eatWhile(f))return g("variable","property");if("<"==r&&t.match("!--")||"-"==r&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");if(d.test(r))return">"==r&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=r&&"="!=r||t.eat("="):/[<>*+\-|&?]/.test(r)&&(t.eat(r),">"==r&&t.eat(r))),"?"==r&&t.eat(".")?g("."):g("operator","operator",t.current());if(f.test(r)){t.eatWhile(f);var i=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(i)){var o=h[i];return g(o.type,o.style,i)}if("async"==i&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",i)}return g("variable","variable",i)}}function m(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return g("comment","comment")}function y(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())}var b="([{}])";function w(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 i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),c=b.indexOf(s);if(c>=0&&c<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(c>=3&&c<6)++i;else if(f.test(s))o=!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(o&&!i){++a;break}}o&&!i&&(e.fatArrowAt=a)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(t,e){if(!l)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 k(t,e,n,r,i){var o=t.cc;for(S.state=t,S.stream=i,S.marked=null,S.cc=o,S.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((o.length?o.pop():c?H:B)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==n&&C(t,r)?"variable-2":e}}var S={state:null,column:null,marked:null,cc:null};function j(){for(var t=arguments.length-1;t>=0;t--)S.cc.push(arguments[t])}function P(){return j.apply(null,arguments),!0}function _(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function T(t){var e=S.state;if(S.marked="def",l){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=function t(e,n){if(n){if(n.block){var r=t(e,n.prev);return r?r==n.prev?n:new D(r,n.vars,!0):null}return _(e,n.vars)?n:new D(n.prev,new M(e,n.vars),!1)}return null}(t,e.context);if(null!=r)return void(e.context=r)}else if(!_(t,e.localVars))return void(e.localVars=new M(t,e.localVars));n.globalVars&&!_(t,e.globalVars)&&(e.globalVars=new M(t,e.globalVars))}}function E(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function D(t,e,n){this.prev=t,this.vars=e,this.block=n}function M(t,e){this.name=t,this.next=e}var A=new M("this",new M("arguments",null));function L(){S.state.context=new D(S.state.context,S.state.localVars,!1),S.state.localVars=A}function R(){S.state.context=new D(S.state.context,S.state.localVars,!0),S.state.localVars=null}function N(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function I(t,e){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new x(r,S.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function F(){var t=S.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function V(t){return function e(n){return n==t?P():";"==t||"}"==n||")"==n||"]"==n?j():P(e)}}function B(t,e){return"var"==t?P(I("vardef",e),kt,V(";"),F):"keyword a"==t?P(I("form"),W,B,F):"keyword b"==t?P(I("form"),B,F):"keyword d"==t?S.stream.match(/^\s*$/,!1)?P():P(I("stat"),q,V(";"),F):"debugger"==t?P(V(";")):"{"==t?P(I("}"),R,ct,F,N):";"==t?P():"if"==t?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==F&&S.state.cc.pop()(),P(I("form"),W,B,F,Et)):"function"==t?P(Lt):"for"==t?P(I("form"),R,Dt,B,N,F):"class"==t||u&&"interface"==e?(S.marked="keyword",P(I("form","class"==t?t:e),Vt,F)):"variable"==t?u&&"declare"==e?(S.marked="keyword",P(B)):u&&("module"==e||"enum"==e||"type"==e)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==e?P(Jt):"type"==e?P(Nt,V("operator"),dt,V(";")):P(I("form"),St,V("{"),I("}"),ct,F,F)):u&&"namespace"==e?(S.marked="keyword",P(I("form"),H,B,F)):u&&"abstract"==e?(S.marked="keyword",P(B)):P(I("stat"),et):"switch"==t?P(I("form"),W,V("{"),I("}","switch"),R,ct,F,F,N):"case"==t?P(H,V(":")):"default"==t?P(V(":")):"catch"==t?P(I("form"),L,z,B,F,N):"export"==t?P(I("stat"),Ut,F):"import"==t?P(I("stat"),$t,F):"async"==t?P(B):"@"==e?P(H,B):j(I("stat"),H,V(";"),F)}function z(t){if("("==t)return P(It,V(")"))}function H(t,e){return $(t,e,!1)}function U(t,e){return $(t,e,!0)}function W(t){return"("!=t?j():P(I(")"),q,V(")"),F)}function $(t,e,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:J;if("("==t)return P(L,I(")"),at(It,")"),F,V("=>"),r,N);if("variable"==t)return j(L,St,V("=>"),r,N)}var i=n?K:G;return O.hasOwnProperty(t)?P(i):"function"==t?P(Lt,i):"class"==t||u&&"interface"==e?(S.marked="keyword",P(I("form"),Ft,F)):"keyword c"==t||"async"==t?P(n?U:H):"("==t?P(I(")"),q,V(")"),F,i):"operator"==t||"spread"==t?P(n?U:H):"["==t?P(I("]"),Xt,F,i):"{"==t?st(rt,"}",null,i):"quasi"==t?j(Y,i):"new"==t?P(function(t){return function(e){return"."==e?P(t?tt:Q):"variable"==e&&u?P(Ot,t?K:G):j(t?U:H)}}(n)):P()}function q(t){return t.match(/[;\}\)\],]/)?j():j(H)}function G(t,e){return","==t?P(q):K(t,e,!1)}function K(t,e,n){var r=0==n?G:K,i=0==n?H:U;return"=>"==t?P(L,n?Z:J,N):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?P(r):u&&"<"==e&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?P(I(">"),at(dt,">"),F,r):"?"==e?P(H,V(":"),i):P(i):"quasi"==t?j(Y,r):";"!=t?"("==t?st(U,")","call",r):"."==t?P(nt,r):"["==t?P(I("]"),q,V("]"),F,r):u&&"as"==e?(S.marked="keyword",P(dt,r)):"regexp"==t?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),P(i)):void 0:void 0}function Y(t,e){return"quasi"!=t?j():"${"!=e.slice(e.length-2)?P(Y):P(q,X)}function X(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,P(Y)}function J(t){return w(S.stream,S.state),j("{"==t?B:H)}function Z(t){return w(S.stream,S.state),j("{"==t?B:U)}function Q(t,e){if("target"==e)return S.marked="keyword",P(G)}function tt(t,e){if("target"==e)return S.marked="keyword",P(K)}function et(t){return":"==t?P(F,B):j(G,V(";"),F)}function nt(t){if("variable"==t)return S.marked="property",P()}function rt(t,e){return"async"==t?(S.marked="property",P(rt)):"variable"==t||"keyword"==S.style?(S.marked="property","get"==e||"set"==e?P(it):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),P(ot))):"number"==t||"string"==t?(S.marked=s?"property":S.style+" property",P(ot)):"jsonld-keyword"==t?P(ot):u&&E(e)?(S.marked="keyword",P(rt)):"["==t?P(H,lt,V("]"),ot):"spread"==t?P(U,ot):"*"==e?(S.marked="keyword",P(rt)):":"==t?j(ot):void 0;var n}function it(t){return"variable"!=t?j(ot):(S.marked="property",P(Lt))}function ot(t){return":"==t?P(U):"("==t?j(Lt):void 0}function at(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),P((function(n,r){return n==e||r==e?j():j(t)}),r)}return i==e||o==e?P():n&&n.indexOf(";")>-1?j(t):P(V(e))}return function(n,i){return n==e||i==e?P():j(t,r)}}function st(t,e,n){for(var r=3;r<arguments.length;r++)S.cc.push(arguments[r]);return P(I(e,n),at(t,e),F)}function ct(t){return"}"==t?P():j(B,ct)}function lt(t,e){if(u){if(":"==t)return P(dt);if("?"==e)return P(lt)}}function ut(t,e){if(u&&(":"==t||"in"==e))return P(dt)}function ft(t){if(u&&":"==t)return S.stream.match(/^\s*\w+\s+is\b/,!1)?P(H,ht,dt):P(dt)}function ht(t,e){if("is"==e)return S.marked="keyword",P()}function dt(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(S.marked="keyword",P("typeof"==e?U:dt)):"variable"==t||"void"==e?(S.marked="type",P(wt)):"|"==e||"&"==e?P(dt):"string"==t||"number"==t||"atom"==t?P(wt):"["==t?P(I("]"),at(dt,"]",","),F,wt):"{"==t?P(I("}"),gt,F,wt):"("==t?P(at(bt,")"),pt,wt):"<"==t?P(at(dt,">"),dt):"quasi"==t?j(mt,wt):void 0}function pt(t){if("=>"==t)return P(dt)}function gt(t){return t.match(/[\}\)\]]/)?P():","==t||";"==t?P(gt):j(vt,gt)}function vt(t,e){return"variable"==t||"keyword"==S.style?(S.marked="property",P(vt)):"?"==e||"number"==t||"string"==t?P(vt):":"==t?P(dt):"["==t?P(V("variable"),ut,V("]"),vt):"("==t?j(Rt,vt):t.match(/[;\}\)\],]/)?void 0:P()}function mt(t,e){return"quasi"!=t?j():"${"!=e.slice(e.length-2)?P(mt):P(dt,yt)}function yt(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,P(mt)}function bt(t,e){return"variable"==t&&S.stream.match(/^\s*[?:]/,!1)||"?"==e?P(bt):":"==t?P(dt):"spread"==t?P(bt):j(dt)}function wt(t,e){return"<"==e?P(I(">"),at(dt,">"),F,wt):"|"==e||"."==t||"&"==e?P(dt):"["==t?P(dt,V("]"),wt):"extends"==e||"implements"==e?(S.marked="keyword",P(dt)):"?"==e?P(dt,V(":"),dt):void 0}function Ot(t,e){if("<"==e)return P(I(">"),at(dt,">"),F,wt)}function xt(){return j(dt,Ct)}function Ct(t,e){if("="==e)return P(dt)}function kt(t,e){return"enum"==e?(S.marked="keyword",P(Jt)):j(St,lt,_t,Tt)}function St(t,e){return u&&E(e)?(S.marked="keyword",P(St)):"variable"==t?(T(e),P()):"spread"==t?P(St):"["==t?st(Pt,"]"):"{"==t?st(jt,"}"):void 0}function jt(t,e){return"variable"!=t||S.stream.match(/^\s*:/,!1)?("variable"==t&&(S.marked="property"),"spread"==t?P(St):"}"==t?j():"["==t?P(H,V(']'),V(':'),jt):P(V(":"),St,_t)):(T(e),P(_t))}function Pt(){return j(St,_t)}function _t(t,e){if("="==e)return P(U)}function Tt(t){if(","==t)return P(kt)}function Et(t,e){if("keyword b"==t&&"else"==e)return P(I("form","else"),B,F)}function Dt(t,e){return"await"==e?P(Dt):"("==t?P(I(")"),Mt,F):void 0}function Mt(t){return"var"==t?P(kt,At):"variable"==t?P(At):j(At)}function At(t,e){return")"==t?P():";"==t?P(At):"in"==e||"of"==e?(S.marked="keyword",P(H,At)):j(H,At)}function Lt(t,e){return"*"==e?(S.marked="keyword",P(Lt)):"variable"==t?(T(e),P(Lt)):"("==t?P(L,I(")"),at(It,")"),F,ft,B,N):u&&"<"==e?P(I(">"),at(xt,">"),F,Lt):void 0}function Rt(t,e){return"*"==e?(S.marked="keyword",P(Rt)):"variable"==t?(T(e),P(Rt)):"("==t?P(L,I(")"),at(It,")"),F,ft,N):u&&"<"==e?P(I(">"),at(xt,">"),F,Rt):void 0}function Nt(t,e){return"keyword"==t||"variable"==t?(S.marked="type",P(Nt)):"<"==e?P(I(">"),at(xt,">"),F):void 0}function It(t,e){return"@"==e&&P(H,It),"spread"==t?P(It):u&&E(e)?(S.marked="keyword",P(It)):u&&"this"==t?P(lt,_t):j(St,lt,_t)}function Ft(t,e){return"variable"==t?Vt(t,e):Bt(t,e)}function Vt(t,e){if("variable"==t)return T(e),P(Bt)}function Bt(t,e){return"<"==e?P(I(">"),at(xt,">"),F,Bt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(S.marked="keyword"),P(u?dt:H,Bt)):"{"==t?P(I("}"),zt,F):void 0}function zt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&E(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",P(zt)):"variable"==t||"keyword"==S.style?(S.marked="property",P(Ht,zt)):"number"==t||"string"==t?P(Ht,zt):"["==t?P(H,lt,V("]"),Ht,zt):"*"==e?(S.marked="keyword",P(zt)):u&&"("==t?j(Rt,zt):";"==t||","==t?P(zt):"}"==t?P():"@"==e?P(H,zt):void 0}function Ht(t,e){if("!"==e)return P(Ht);if("?"==e)return P(Ht);if(":"==t)return P(dt,_t);if("="==e)return P(U);var n=S.state.lexical.prev;return j(n&&"interface"==n.info?Rt:Lt)}function Ut(t,e){return"*"==e?(S.marked="keyword",P(Yt,V(";"))):"default"==e?(S.marked="keyword",P(H,V(";"))):"{"==t?P(at(Wt,"}"),Yt,V(";")):j(B)}function Wt(t,e){return"as"==e?(S.marked="keyword",P(V("variable"))):"variable"==t?j(U,Wt):void 0}function $t(t){return"string"==t?P():"("==t?j(H):"."==t?j(G):j(qt,Gt,Yt)}function qt(t,e){return"{"==t?st(qt,"}"):("variable"==t&&T(e),"*"==e&&(S.marked="keyword"),P(Kt))}function Gt(t){if(","==t)return P(qt,Gt)}function Kt(t,e){if("as"==e)return S.marked="keyword",P(qt)}function Yt(t,e){if("from"==e)return S.marked="keyword",P(H)}function Xt(t){return"]"==t?P():j(at(U,"]"))}function Jt(){return j(I("form"),St,V("{"),I("}"),at(Zt,"}"),F,F)}function Zt(){return j(St,_t)}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 N.lex=!0,F.lex=!0,{startState:function(t){var e={tokenize:v,lastType:"sof",cc:[],lexical:new x((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new D(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),w(t,e)),e.tokenize!=m&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",k(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==m||e.tokenize==y)return t.Pass;if(e.tokenize!=v)return 0;var i,s=r&&r.charAt(0),c=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==F)c=c.prev;else if(u!=Et&&u!=N)break}for(;("stat"==c.type||"form"==c.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==G||i==K)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;a&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var f=c.type,h=s==f;return"vardef"==f?c.indented+("operator"==e.lastType||","==e.lastType?c.info.length+1:0):"form"==f&&"{"==s?c.indented:"form"==f?c.indented+o:"stat"==f?c.indented+(function(t,e){return"operator"==t.lastType||","==t.lastType||d.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}(e,r)?a||o:0):"switch"!=c.info||h||0==n.doubleIndentSwitch?c.align?c.column+(h?0:1):c.indented+(h?0:o):c.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:c?null:"/*",blockCommentEnd:c?null:"*/",blockCommentContinue:c?null:" * ",lineComment:c?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:c?"json":"javascript",jsonldMode:s,jsonMode:c,expressionAllowed:Qt,skipExpression:function(e){k(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(27))},function(t,e,n){1&&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,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&e.test(i.context.tagName)),!o&&("tag"==t&&/>$/.test(n)&&i.context||/^</.test(r))}}),t.defineExtension("commentRange",(function(e,n,r){var i=this,o=t.innerMode(i.getMode(),i.getTokenAt(n).state).mode;i.operation((function(){if(e)i.replaceRange(o.commentEnd,r),i.replaceRange(o.commentStart,n),n.line==r.line&&n.ch==r.ch&&i.setCursor(n.line,n.ch+o.commentStart.length);else{var t=i.getRange(n,r),a=t.indexOf(o.commentStart),s=t.lastIndexOf(o.commentEnd);a>-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+o.commentStart.length,s)+t.substr(s+o.commentEnd.length)),i.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,i=r.getMode(),o=r.getRange(e,n).split("\n"),a=t.copyState(i,r.getTokenAt(e).state),s=r.getOption("tabSize"),c="",l=0,u=0===e.ch;function f(){c+="\n",u=!0,++l}for(var h=0;h<o.length;++h){for(var d=new t.StringStream(o[h],s);!d.eol();){var p=t.innerMode(i,a),g=i.token(d,a),v=d.current();d.start=d.pos,u&&!/\S/.test(v)||(c+=v,u=!1),!u&&p.mode.newlineAfterToken&&p.mode.newlineAfterToken(g,v,d.string.slice(d.pos)||o[h+1]||"",p.state)&&f()}!d.pos&&i.blankLine&&i.blankLine(a),!u&&h<o.length-1&&f()}r.operation((function(){r.replaceRange(c,e,n);for(var t=e.line+1,i=e.line+l;t<=i;++t)r.indentLine(t,"smart");r.setSelection(e,r.getCursor(!1))}))}))}(n(27))},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new _(r||[]);return o._invoke=function(t,e,n){var r=f;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;1;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?p:h,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",g={};function v(){}function m(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,O=w&&w(w(T([])));O&&O!==n&&r.call(O,o)&&(b=O);var x=y.prototype=v.prototype=Object.create(b);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=u(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function T(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:E}}function E(){return{value:e,done:!0}}return m.prototype=x.constructor=y,y.constructor=m,m.displayName=c(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},C(k.prototype),k.prototype[a]=function(){return this},t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(l(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},C(x),c(x,s,"Generator"),x[o]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(1?t.exports:void 0);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n(10);e["default"]=r["View"].extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.items=[],this.opt=t;var e=t.config||{};this.level=t.level,this.config=e,this.preview=t.preview,this.ppfx=e.pStylePrefix||'',this.pfx=e.stylePrefix||'',this.parent=t.parent,this.parentView=t.parentView;var n=this.pfx,r=this.ppfx,o=this.parent,a=this.collection;this.listenTo(a,'add',this.addTo),this.listenTo(a,'reset resetNavigator',this.render),this.listenTo(a,'remove',this.removeChildren),this.className="".concat(n,"layers");var s=e.em;if(e.sortable&&!this.opt.sorter){var c=s.get('Utils');this.opt.sorter=new c.Sorter({container:e.sortContainer||this.el,containerSel:".".concat(this.className),itemSel:".".concat(n,"layer"),ignoreViewChildren:1,onEndMove:function(t,e,n){var r=e.getSourceModel();s.setSelected(r,{forceChange:1}),s.trigger("".concat(i["b"],":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:r,pfx:n})}this.sorter=this.opt.sorter||'',this.$el.data('collection',a),o&&this.$el.data('model',o)},removeChildren:function(t){var e=t.viewLayer;e&&(e.remove(),t.viewLayer=0)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=this.level,i=this.parentView,o=this.opt.ItemView,a=e||null,s=new o({ItemView:o,level:r,model:t,parentView:i,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}),c=s.render().el;if(a)a.appendChild(c);else if(void 0!==n){var l='before';this.$el.children().length==n&&(n--,l='after'),n<0?this.$el.append(c):this.$el.children().eq(n)[l](c)}else this.$el.append(c);return this.items.push(s),c},remove:function(){r["View"].prototype.remove.apply(this,arguments),this.items.map((function(t){return t.remove()}))},isCountable:function(t,e){var n=t.get('type'),r=t.get('tagName');return!(('textnode'==n||'br'==r)&&e||!t.get('layerable'))},render:function(){var t=this,e=document.createDocumentFragment(),n=this.el;return n.innerHTML='',this.collection.each((function(n){return t.addToCollection(n,e)})),n.appendChild(e),n.className=this.className,this}})},function(t,e,n){var r={"./CanvasClear":50,"./CanvasClear.js":50,"./CanvasMove":51,"./CanvasMove.js":51,"./CommandAbstract":31,"./CommandAbstract.js":31,"./ComponentDelete":52,"./ComponentDelete.js":52,"./ComponentDrag":53,"./ComponentDrag.js":53,"./ComponentEnter":54,"./ComponentEnter.js":54,"./ComponentExit":55,"./ComponentExit.js":55,"./ComponentNext":56,"./ComponentNext.js":56,"./ComponentPrev":57,"./ComponentPrev.js":57,"./ComponentStyleClear":58,"./ComponentStyleClear.js":58,"./CopyComponent":59,"./CopyComponent.js":59,"./DeleteComponent":60,"./DeleteComponent.js":60,"./ExportTemplate":61,"./ExportTemplate.js":61,"./Fullscreen":62,"./Fullscreen.js":62,"./MoveComponent":63,"./MoveComponent.js":63,"./OpenAssets":64,"./OpenAssets.js":64,"./OpenBlocks":65,"./OpenBlocks.js":65,"./OpenLayers":66,"./OpenLayers.js":66,"./OpenStyleManager":67,"./OpenStyleManager.js":67,"./OpenTraitManager":68,"./OpenTraitManager.js":68,"./PasteComponent":69,"./PasteComponent.js":69,"./Preview":70,"./Preview.js":70,"./Resize":71,"./Resize.js":71,"./SelectComponent":23,"./SelectComponent.js":23,"./SelectPosition":35,"./SelectPosition.js":35,"./ShowOffset":72,"./ShowOffset.js":72,"./SwitchVisibility":73,"./SwitchVisibility.js":73};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id=96},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(14),a=n.n(o),s=(n(3),n(0)),c={stylePrefix:'comp-',components:[],draggableComponents:1,storeWrapper:0,processor:0,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']},l=n(10),u=n(30),f=n(12),h=n(40),d=n(1);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var v=l["a"].extend({defaults:g(g({},l["a"].prototype.defaults),{},{type:'cell',tagName:'td',draggable:['tr']})},{isComponent:function(t){return['td','th'].indexOf(Object(d["toLowerCase"])(t.tagName))>=0}}),m=f["default"].extend({});function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var w='tr',O=l["a"].extend({defaults:b(b({},l["a"].prototype.defaults),{},{tagName:w,draggable:['thead','tbody','tfoot'],droppable:['th','td']})},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===w}}),x=f["default"].extend({});function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S='table',j=l["a"].extend({defaults:k(k({},l["a"].prototype.defaults),{},{type:S,tagName:S,droppable:['tbody','thead','tfoot']}),initialize:function(t,e){l["a"].prototype.initialize.apply(this,arguments);var n=this.get('components');!n.length&&n.add({type:'tbody'})}},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===S}}),P=f["default"].extend({events:{}});function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var E='tbody',D=l["a"].extend({defaults:T(T({},l["a"].prototype.defaults),{},{type:E,tagName:E,draggable:['table'],droppable:['tr'],columns:1,rows:1}),initialize:function(t,e){l["a"].prototype.initialize.apply(this,arguments);var n=this.get('components'),r=this.get('columns'),i=this.get('rows');if(!n.length){for(var o=[];i--;){for(var a=[],s=r;s--;)a.push({type:'cell',classes:['cell']});o.push({type:'row',classes:['row'],components:a})}n.add(o)}}},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===E}});function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L='thead',R=D.extend({defaults:A(A({},D.prototype.defaults),{},{type:L,tagName:L})},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===L}}),N=f["default"].extend({}),I=f["default"].extend({});function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function V(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var B='tfoot',z=D.extend({defaults:V(V({},D.prototype.defaults),{},{type:B,tagName:B})},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===B}}),H=f["default"].extend({});function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $='xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"',q=l["a"].extend({defaults:W(W({},l["a"].prototype.defaults),{},{type:'image',tagName:'img',void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:['alt'],src:"<svg ".concat($,">\n        <path d=\"M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z\"></path>\n      </svg>"),fallback:"<svg ".concat($,">\n        <path d=\"M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z\"></path>\n      </svg>"),file:''}),initialize:function(t,e){l["a"].prototype.initialize.apply(this,arguments);var n=this.get('attributes'),r=n.src;r&&this.set('src',r,{silent:1})},initToolbar:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];l["a"].prototype.initToolbar.apply(this,e);var r=this.em;if(r){var i=r.get('Commands'),o='image-editor';if(i.has(o)){for(var a=!1,s=this.get('toolbar'),c=0;c<s.length;c++)if('image-editor'===s[c].command){a=!0;break}a||(s.push({attributes:{class:'fa fa-pencil'},command:o}),this.set('toolbar',s))}}},getAttrToHTML:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=l["a"].prototype.getAttrToHTML.apply(this,e),i=this.getSrcResult();return i&&(r.src=i),r},getSrcResult:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get(t.fallback?'fallback':'src')||'',n=e;return e&&'<svg'===e.substr(0,4)&&(n="data:image/svg+xml;base64,".concat(window.btoa(e))),n},isDefaultSrc:function(){return this.get('src')===Object(s["result"])(this,'defaults').src},toJSON:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=l["a"].prototype.toJSON.apply(this,e);return r.attributes&&r.src===r.attributes.src&&delete r.src,r},parseUri:function(t){var e=document.createElement('a');e.href=t;for(var n={},r=e.search.substring(1).split('&'),i=0;i<r.length;i++){var o=r[i].split('='),a=decodeURIComponent(o[0]);a&&(n[a]=decodeURIComponent(o[1]))}return{hostname:e.hostname,pathname:e.pathname,protocol:e.protocol,search:e.search,hash:e.hash,port:e.port,query:n}}},{isComponent:function(t){return'img'===Object(d["toLowerCase"])(t.tagName)}});function G(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?G(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Y=q.extend({defaults:K(K({},q.prototype.defaults),{},{type:'map',src:'',void:0,mapUrl:'https://maps.google.com/maps',tagName:'iframe',mapType:'q',address:'',zoom:'1',attributes:{frameborder:0},toolbar:l["a"].prototype.defaults.toolbar,traits:[{label:'Address',name:'address',placeholder:'eg. London, UK',changeProp:1},{type:'select',label:'Map type',name:'mapType',changeProp:1,options:[{value:'q',name:'Roadmap'},{value:'w',name:'Satellite'}]},{label:'Zoom',name:'zoom',type:'range',min:'1',max:'20',changeProp:1}]}),initialize:function(t,e){this.get('src')?this.parseFromSrc():this.updateSrc(),q.prototype.initialize.apply(this,arguments),this.listenTo(this,'change:address change:zoom change:mapType',this.updateSrc)},updateSrc:function(){this.set('src',this.getMapUrl())},getMapUrl:function(){var t=this.get('address'),e=this.get('zoom'),n=this.get('mapType');t=t?'&q='+t:'',e=e?'&z='+e:'',n=n?'&t='+n:'';var r=this.get('mapUrl')+'?'+t+e+n;return r+='&output=embed'},parseFromSrc:function(){var t=this.parseUri(this.get('src')).query;t.q&&this.set('address',t.q),t.z&&this.set('zoom',t.z),t.t&&this.set('mapType',t.t)}},{isComponent:function(t){var e='';return'iframe'==Object(d["toLowerCase"])(t.tagName)&&/maps\.google\.com/.test(t.src)&&(e={type:'map',src:t.src}),e}}),X=f["default"].extend({tagName:'img',events:{dblclick:'onActive',click:'initResize',error:'onError',load:'onLoad',dragstart:'noDrag'},initialize:function(t){f["default"].prototype.initialize.apply(this,arguments),this.listenTo(this.model,'change:src',this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()},fetchFile:function(){if(!this.modelOpt.temporary){var t=this.model,e=t.get('file');if(e)this.em.get('AssetManager').FileUploader().uploadFile({dataTransfer:{files:[e]}},(function(e){var n=e&&e.data&&e.data[0],r=n&&(Object(s["isString"])(n)?n:n.src);r&&t.set({src:r})})),t.set('file','')}},updateSrc:function(){var t=this.model,e=this.classEmpty,n=this.$el,r=t.getSrcResult(),i=r&&!t.isDefaultSrc();t.addAttributes({src:r}),n[i?'removeClass':'addClass'](e)},onActive:function(t){t&&t.stopPropagation();var e=this.em,n=this.model,r=e&&e.get('AssetManager');r&&n.get('editable')&&r.open({select:function(t,e){n.set({src:t.getSrc()}),e&&r.close()},target:n,types:['image'],accept:'image/*'})},onError:function(){var t=this.model.getSrcResult({fallback:1});t&&(this.el.src=t)},onLoad:function(){this.em.trigger('change:canvasOffset')},noDrag:function(t){return t.preventDefault(),!1},render:function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var t=this.$el,e=this.model,n=t.attr('class')||'';return!e.get('src')&&t.attr('class',"".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this}}),J=X.extend({tagName:'div',events:{},initialize:function(t){X.prototype.initialize.apply(this,arguments),this.classEmpty=this.ppfx+'plh-map'},updateSrc:function(){this.getIframe().src=this.model.get('src')},getIframe:function(){if(!this.iframe){var t=document.createElement('iframe');t.src=this.model.get('src'),t.frameBorder=0,t.style.height='100%',t.style.width='100%',t.className=this.ppfx+'no-pointer',this.iframe=t}return this.iframe},render:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return X.prototype.render.apply(this,e),this.updateClasses(),this.el.appendChild(this.getIframe()),this}});function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tt=l["a"].extend({defaults:Q(Q({},l["a"].prototype.defaults),{},{type:'text',droppable:!1,editable:!0}),toHTML:function(){return l["a"].prototype.toHTML.apply(this,arguments)}});function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var rt=tt.extend({defaults:nt(nt({},tt.prototype.defaults),{},{type:'link',tagName:'a',traits:['title','href','target']}),getAttrToHTML:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=tt.prototype.getAttrToHTML.apply(this,e);return delete r.onmousedown,r}},{isComponent:function(t){var e;if('a'===Object(d["toLowerCase"])(t.tagName)){e={type:'link',editable:0};var n=t.childNodes,r=n.length;r||delete e.editable;for(var i=0;i<r;i++){var o=n[i];if(3==o.nodeType&&''!=o.textContent.trim()){delete e.editable;break}}}return e}}),it=n(34),ot=n.n(it),at=n(26),st=n.n(at);function ct(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ut=f["default"].prototype,ft=f["default"].extend({events:{dblclick:'onActive',input:'onInput'},initialize:function(t){ut.initialize.apply(this,arguments),this.disableEditing=this.disableEditing.bind(this);var e=this.model,n=this.em;this.listenTo(e,'focus',this.onActive),this.listenTo(e,'change:content',this.updateContentText),this.listenTo(e,'sync:content',this.syncContent),this.rte=n&&n.get('RichTextEditor')},updateContentText:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()},onActive:function(t){var e=this;return ot()(st.a.mark((function n(){var r,i;return st.a.wrap((function(n){for(;1;)switch(n.prev=n.next){case 0:if(r=e.rte,i=e.em,!(e.rteEnabled||!e.model.get('editable')||i&&i.isEditing())){n.next=3;break}return n.abrupt("return");case 3:if(t&&t.stopPropagation&&t.stopPropagation(),!r){n.next=14;break}return n.prev=5,n.next=8,r.enable(e,e.activeRte);case 8:e.activeRte=n.sent,n.next=14;break;case 11:n.prev=11,n.t0=n["catch"](5),i.logError(n.t0);case 14:e.toggleEvents(1);case 15:case"end":return n.stop()}}),n,null,[[5,11]])})))()},onDisable:function(){this.disableEditing()},disableEditing:function(){var t=this;return ot()(st.a.mark((function e(){var n,r,i,o,a;return st.a.wrap((function(e){for(;1;)switch(e.prev=e.next){case 0:if(n=t.model,r=t.rte,i=t.activeRte,o=t.em,a=n&&n.get('editable'),!r){e.next=12;break}return e.prev=3,e.next=6,r.disable(t,i);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](3),o.logError(e.t0);case 11:a&&t.syncContent();case 12:t.toggleEvents();case 13:case"end":return e.stop()}}),e,null,[[3,8]])})))()},getContent:function(){var t=this.activeRte;return t&&'function'==typeof t.getContent?t.getContent():this.getChildrenContainer().innerHTML},syncContent:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.rte,r=this.rteEnabled;if(r||t.force){var i=this.getContent(),o=e.components(),a=lt({fromDisable:1},t);if(e.set('content','',a),n.customRte)o.length&&o.reset(null,t),e.set('content',i,a);else{var s=function e(n){var r=!!n.get('textable'),i=!['text','default',''].some((function(t){return n.is(t)}))||r;n.set(lt({_innertext:!i,editable:i&&n.get('editable'),selectable:i,hoverable:i,removable:r,draggable:r,highlightable:0,copyable:r},!r&&{toolbar:''}),t),n.get('components').each((function(t){return e(t)}))};o.reset(i,t),o.each((function(t){return s(t)})),o.trigger('resetNavigator')}}},onInput:function(){var t=this.em,e='component',n=["".concat(e,":update"),"".concat(e,":input")].join(' ');t&&t.trigger(n,this.model)},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=this.em,n=this.model,r=this.$el,i={on:d["on"],off:d["off"]},o=t?'on':'off';e.setEditing(t?this:0),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(i.off(a,'mousedown',this.disableEditing),i[o](a,'mousedown',this.disableEditing),e[o]('toolbar:run:before',this.disableEditing),n&&(n[o]('removed',this.disableEditing),n.trigger("rte:".concat(t?'enable':'disable'))),r&&r.off('mousedown',this.disablePropagation),r&&r[o]('mousedown',this.disablePropagation),this.config.draggableComponents)for(var s=this.el;s;)s.draggable=!t,(s=s.parentNode)&&'BODY'==s.tagName&&(s=0)}}),ht=ft.extend({render:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ft.prototype.render.apply(this,e),this.el.addEventListener('click',this.prevDef,!0),this}});function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var gt='label',vt=tt.extend({defaults:pt(pt({},tt.prototype.defaults),{},{type:gt,tagName:gt,traits:['id','title','for']})},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===gt}}),mt=ht.extend({tagName:'span'});function yt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var wt='video',Ot='yt',xt='vi',Ct='ytnc',kt=q.extend({defaults:bt(bt({},q.prototype.defaults),{},{type:wt,tagName:wt,videoId:'',void:0,provider:'so',ytUrl:'https://www.youtube.com/embed/',ytncUrl:'https://www.youtube-nocookie.com/embed/',viUrl:'https://player.vimeo.com/video/',loop:0,poster:'',muted:0,autoplay:0,controls:1,color:'',list:'',rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:'allowfullscreen'}}),initialize:function(t,e){this.em=e.em,this.get('src')&&this.parseFromSrc(),this.updateTraits(),this.listenTo(this,'change:provider',this.updateTraits),this.listenTo(this,'change:videoId change:provider',this.updateSrc),q.prototype.initialize.apply(this,arguments)},updateTraits:function(){var t,e='iframe';switch(this.get('provider')){case Ot:case Ct:t=this.getYoutubeTraits();break;case xt:t=this.getVimeoTraits();break;default:e='video',t=this.getSourceTraits()}this.set({tagName:e},{silent:1}),this.set({traits:t}),this.em.trigger('component:toggled')},parseFromSrc:function(){var t=this.get('provider'),e=this.parseUri(this.get('src')),n=e.query;switch(t){case Ot:case Ct:case xt:var r=e.pathname.split('/').pop();this.set('videoId',r),n.list&&this.set('list',n.list),n.autoplay&&this.set('autoplay',1),n.loop&&this.set('loop',1),0===parseInt(n.controls)&&this.set('controls',0),n.color&&this.set('color',n.color),'0'===n.rel&&this.set('rel',0),'1'===n.modestbranding&&this.set('modestbranding',1)}},updateSrc:function(){var t='';switch(this.get('provider')){case Ot:t=this.getYoutubeSrc();break;case Ct:t=this.getYoutubeNoCookieSrc();break;case xt:t=this.getVimeoSrc()}this.set({src:t})},getAttrToHTML:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=q.prototype.getAttrToHTML.apply(this,e),i=this.get('provider');switch(i){case Ot:case Ct:case xt:break;default:this.get('loop')&&(r.loop='loop'),this.get('autoplay')&&(r.autoplay='autoplay'),this.get('controls')&&(r.controls='controls')}return r},getProviderTrait:function(){return{type:'select',label:'Provider',name:'provider',changeProp:1,options:[{value:'so',name:'HTML5 Source'},{value:Ot,name:'Youtube'},{value:Ct,name:'Youtube (no cookie)'},{value:xt,name:'Vimeo'}]}},getSourceTraits:function(){return[this.getProviderTrait(),{label:'Source',name:'src',placeholder:'eg. ./media/video.mp4',changeProp:1},{label:'Poster',name:'poster',placeholder:'eg. ./media/image.jpg'},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},getYoutubeTraits:function(){return[this.getProviderTrait(),{label:'Video ID',name:'videoId',placeholder:'eg. jNQXAC9IVRw',changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:'checkbox',label:'Related',name:'rel',changeProp:1},{type:'checkbox',label:'Modest',name:'modestbranding',changeProp:1}]},getVimeoTraits:function(){return[this.getProviderTrait(),{label:'Video ID',name:'videoId',placeholder:'eg. 123456789',changeProp:1},{label:'Color',name:'color',placeholder:'eg. FF0000',changeProp:1},this.getAutoplayTrait(),this.getLoopTrait()]},getAutoplayTrait:function(){return{type:'checkbox',label:'Autoplay',name:'autoplay',changeProp:1}},getLoopTrait:function(){return{type:'checkbox',label:'Loop',name:'loop',changeProp:1}},getControlsTrait:function(){return{type:'checkbox',label:'Controls',name:'controls',changeProp:1}},getYoutubeSrc:function(){var t=this.get('videoId'),e=this.get('ytUrl'),n=this.get('list');return e+=t+(t.indexOf('?')<0?'?':''),e+=n?"&list=".concat(n):'',e+=this.get('autoplay')?'&autoplay=1':'',e+=this.get('controls')?'':'&controls=0&showinfo=0',e+=this.get('loop')?"&loop=1&playlist=".concat(t):'',e+=this.get('rel')?'':'&rel=0',e+=this.get('modestbranding')?'&modestbranding=1':''},getYoutubeNoCookieSrc:function(){var t=this.getYoutubeSrc();return t=t.replace(this.get('ytUrl'),this.get('ytncUrl'))},getVimeoSrc:function(){var t=this.get('viUrl');return t+=this.get('videoId')+'?',t+=this.get('autoplay')?'&autoplay=1':'',t+=this.get('loop')?'&loop=1':'',t+=this.get('controls')?'':'&title=0&portrait=0&badge=0',t+=this.get('color')?'&color='+this.get('color'):''}},{isComponent:function(t){var e='',n=t.tagName,r=t.src,i=/youtube\.com\/embed/.test(r),o=/youtube-nocookie\.com\/embed/.test(r),a=/player\.vimeo\.com\/video/.test(r),s=i||o||a;return(Object(d["toLowerCase"])(n)==wt||'iframe'==Object(d["toLowerCase"])(n)&&s)&&(e={type:'video'},r&&(e.src=r),s&&(i?e.provider=Ot:o?e.provider=Ct:a&&(e.provider=xt))),e}}),St=X.extend({tagName:'div',events:{},initialize:function(t){f["default"].prototype.initialize.apply(this,arguments);var e=this.model,n=['loop','autoplay','controls','color','rel','modestbranding','poster'],r=n.map((function(t){return"change:".concat(t)})).join(' ');this.listenTo(e,'change:provider',this.updateProvider),this.listenTo(e,'change:src',this.updateSrc),this.listenTo(e,r,this.updateVideo)},updateProvider:function(){var t=this.model.get('provider');this.el.innerHTML='',this.el.appendChild(this.renderByProvider(t))},updateSrc:function(){var t=this.model,e=this.videoEl;if(e){var n=t.get('provider'),r=t.get('src');switch(n){case'yt':r=t.getYoutubeSrc();break;case'ytnc':r=t.getYoutubeNoCookieSrc();break;case'vi':r=t.getVimeoSrc()}e.src=r}},updateVideo:function(){var t=this.model.get('provider'),e=this.videoEl,n=this.model;switch(t){case'yt':case'ytnc':case'vi':this.model.trigger('change:videoId');break;default:e.loop=n.get('loop'),e.autoplay=n.get('autoplay'),e.controls=n.get('controls'),e.poster=n.get('poster')}},renderByProvider:function(t){var e;switch(t){case'yt':e=this.renderYoutube();break;case'ytnc':e=this.renderYoutubeNoCookie();break;case'vi':e=this.renderVimeo();break;default:e=this.renderSource()}return this.videoEl=e,e},renderSource:function(){var t=document.createElement('video');return t.src=this.model.get('src'),this.initVideoEl(t),t},renderYoutube:function(){var t=document.createElement('iframe');return t.src=this.model.getYoutubeSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t},renderYoutubeNoCookie:function(){var t=document.createElement('iframe');return t.src=this.model.getYoutubeNoCookieSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t},renderVimeo:function(){var t=document.createElement('iframe');return t.src=this.model.getVimeoSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t},initVideoEl:function(t){t.className=this.ppfx+'no-pointer',t.style.height='100%',t.style.width='100%'},render:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];X.prototype.render.apply(this,e),this.updateClasses();var r=this.model.get('provider');return this.el.appendChild(this.renderByProvider(r)),this.updateVideo(),this}});function jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _t='script',Tt=l["a"].extend({defaults:Pt(Pt({},l["a"].prototype.defaults),{},{type:_t,tagName:_t,droppable:!1,draggable:!1,layerable:!1})},{isComponent:function(t){if(Object(d["toLowerCase"])(t.tagName)==_t){var e={type:_t};return t.src&&(e.src=t.src,e.onload=t.onload),e}}}),Et=X.extend({tagName:'script',events:{},render:function(){var t=this.model,e=this.em,n=t.get('src'),r=e&&e.get('scriptCount'),i=r||0,o='';if(n){var a=t.get('onload'),s="script".concat(i),c="script".concat(i+1),l="".concat(s,"Start"),u="".concat(c,"Start");o="\n        var ".concat(s," = document.createElement('script');\n        ").concat(s,".onload = function() {\n          ").concat(a?"".concat(a,"();\n"):'',"\n          typeof ").concat(u," == 'function' && ").concat(u,"();\n        };\n        ").concat(s,".src = '").concat(n,"';\n        function ").concat(l,"() { document.body.appendChild(").concat(s,"); };\n        ").concat(i?'':"".concat(l,"();"),"\n      "),e&&e.set('scriptCount',i+1)}else o=t.__innerHTML();return this.el.innerHTML=o,this.postRender(),this}});function Dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var At='svg',Lt=l["a"].extend({defaults:Mt(Mt({},l["a"].prototype.defaults),{},{type:At,tagName:At,highlightable:0,resizable:{ratioDefault:1}}),getName:function(){var t=this.get('tagName'),e=this.get('custom-name');return t=t.charAt(0).toUpperCase()+t.slice(1),e||t}},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===At}});function Rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var It=Lt.extend({defaults:Nt(Nt({},Lt.prototype.defaults),{},{selectable:!1,hoverable:!1,layerable:!1})},{isComponent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e.inSvg}}),Ft=f["default"].extend({_createElement:function(t){return document.createElementNS('http://www.w3.org/2000/svg',t)}});function Vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zt=l["a"].extend({defaults:Bt(Bt({},l["a"].prototype.defaults),{},{tagName:'',droppable:!1,layerable:!1,selectable:!1,editable:!0}),toHTML:function(){var t=this.parent(),e=this.get('content');return t&&t.is('script')?e:Object(d["escape"])(e)}},{isComponent:function(t){var e='';return 3===t.nodeType&&(e={type:'textnode',content:t.textContent}),e}});function Ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Ut=zt.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ht(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},zt.prototype.defaults),toHTML:function(){return"\x3c!--".concat(this.get('content'),"--\x3e")}},{isComponent:function(t){if(8==t.nodeType)return{tagName:'NULL',type:'comment',content:t.textContent}}}),Wt=f["default"].extend({initialize:function(){f["default"].prototype.initialize.apply(this,arguments)},_setAttributes:function(){},renderAttributes:function(){},updateStatus:function(){},updateClasses:function(){},setAttribute:function(){},updateAttributes:function(){},initClasses:function(){},initComponents:function(){},delegateEvents:function(){},_createElement:function(){return document.createTextNode('')},render:function(){var t=this.model,e=this.el;return t.opt.temporary||(e.textContent=t.get('content')),this}}),$t=Wt.extend({_createElement:function(){return document.createComment(this.model.get('content'))}});function qt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Kt=l["a"].extend({defaults:Gt(Gt({},l["a"].prototype.defaults),{},{__wrapper:1,removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:['background','background-color','background-image','background-repeat','background-attachment','background-position','background-size']}),__postAdd:function(){var t=this.em&&this.em.get('UndoManager');return t&&!this.__hasUm&&t.add(this),l["a"].prototype.__postAdd.call(this,arguments)},__postRemove:function(){var t=this.em&&this.em.get('UndoManager');return t&&t.remove(this),l["a"].prototype.__postRemove.call(this,arguments)}},{isComponent:function(){return!1}});function Yt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Jt='iframe',Zt=l["a"].extend({defaults:function(){return Xt(Xt({},l["a"].prototype.defaults),{},{type:Jt,tagName:Jt,droppable:!1,resizable:!0,traits:['id','title','src'],attributes:{frameborder:'0'}})}},{isComponent:function(t){return Object(d["toLowerCase"])(t.tagName)===Jt}}),Qt=n(13),te=f["default"].extend({tagName:'div',initialize:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];f["default"].prototype.initialize.apply(this,e),this.listenTo(this.model,'change:attributes:src',this.updateSrc)},updateSrc:function(){var t=Object(Qt["h"])(this.el,'iframe')[0];t&&Object(Qt["d"])(t,{src:this.__getSrc()})},render:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];f["default"].prototype.render.apply(this,e);var r=Object(Qt["f"])('iframe',{class:"".concat(this.ppfx,"no-pointer"),style:'width: 100%; height: 100%; border: none',src:this.__getSrc()});return this.el.appendChild(r),this},__getSrc:function(){return this.model.getAttributes().src||''}});function ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ee(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n,r={},i={},o=[{id:'cell',model:v,view:m},{id:'row',model:O,view:x},{id:'table',model:j,view:P},{id:'thead',model:R,view:N},{id:'tbody',model:D,view:I},{id:'tfoot',model:z,view:H},{id:'map',model:Y,view:J},{id:'link',model:rt,view:ht},{id:'label',model:vt,view:mt},{id:'video',model:kt,view:St},{id:'image',model:q,view:X},{id:'script',model:Tt,view:Et},{id:'svg-in',model:It,view:Ft},{id:'svg',model:Lt,view:Ft},{id:'iframe',model:Zt,view:te},{id:'comment',model:Ut,view:$t},{id:'textnode',model:zt,view:Wt},{id:'text',model:tt,view:ft},{id:'wrapper',model:Kt,view:f["default"]},{id:'default',model:l["a"],view:f["default"]}];return{Component:l["a"],Components:u["a"],ComponentsView:h["a"],componentTypes:o,componentsById:i,name:'DomComponents',getConfig:function(){return r},storageKey:function(){var t=[],e=r.stm&&r.stm.getConfig()||{};return e.storeHtml&&t.push('html'),e.storeComponents&&t.push('components'),t},init:function(e){var n=this;for(var i in t=(r=e||{}).em,this.em=t,t&&(r.components=t.config.components||r.components),c)i in r||(r[i]=c[i]);var a=r.pStylePrefix;if(a&&(r.stylePrefix=a+r.stylePrefix),t){r.modal=t.get('Modal')||'',r.am=t.get('AssetManager')||'',t.get('Parser').compTypes=o,t.on('change:componentHovered',this.componentHovered,this);var s=t.get('selected');t.listenTo(s,'add',(function(t,e,r){return n.selectAdd(s.getComponent(t),r)})),t.listenTo(s,'remove',(function(t,e,r){return n.selectRemove(s.getComponent(t),r)}))}return t.get('hasPages')&&(r.components=''),this},onLoad:function(){r.components&&this.setComponents(r.components,{silent:1})},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.em,n='';!t&&r.stm&&(t=r.em.getCacheLoad());var i=t,o=i.components,a=i.html;if(o)if(Object(s["isObject"])(o)||Object(s["isArray"])(o))n=o;else try{n=JSON.parse(o)}catch(t){e&&e.logError(t)}else a&&(n=a);var c=n&&n.constructor===Object;return(n&&n.length||c)&&(this.clear(),c?this.getWrapper().set(n):this.getComponents().add(n)),n},store:function(t){if(!r.stm||this.em.get('hasPages'))return{};var e={},n=this.storageKey();if(n.indexOf('html')>=0&&(e.html=r.em.getHtml()),n.indexOf('components')>=0){var i=r.storeWrapper?this.getWrapper():this.getComponents();e.components=JSON.stringify(i)}return t||r.stm.store(e),e},getComponent:function(){var t=this.em.get('PageManager').getSelected(),e=t&&t.getMainFrame();return e&&e.getComponent()},getWrapper:function(){return this.getComponent()},getComponents:function(){var t=this.getWrapper();return t&&t.get('components')},addComponent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getComponents().add(t,e)},render:function(){return n.render().el},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getComponents().map((function(t){return t})).forEach((function(e){return e.remove(t)})),this},setComponents:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.clear(e).addComponent(t,e)},addType:function(t,e){var n=this.em,r=e.model,i=void 0===r?{}:r,c=e.view,l=void 0===c?{}:c,u=e.isComponent,f=e.extend,h=e.extendView,d=e.extendFn,p=void 0===d?[]:d,g=e.extendFnView,v=void 0===g?[]:g,m=this.getType(t),y=this.getType(f),b=this.getType(h),w=y||(m||this.getType('default')),O=w.model,x=b?b.view:w.view,C=function(t,e,n){return t.reduce((function(t,r){var i=e[r],o=n.prototype[r];return i&&o&&(t[r]=function(){o.bind(this).apply(void 0,arguments),i.bind(this).apply(void 0,arguments)}),t}),{})};'object'===a()(i)&&(e.model=O.extend(ne(ne(ne({},i),C(p,i,O)),{},{defaults:ne(ne({},Object(s["result"])(O.prototype,'defaults')||{}),Object(s["result"])(i,'defaults')||{})}),{isComponent:!m||y||u?u||function(){return 0}:O.isComponent})),'object'===a()(l)&&(e.view=x.extend(ne(ne({},l),C(v,l,x)))),m?(m.model=e.model,m.view=e.view):(e.id=t,o.unshift(e));var k="component:type:".concat(m?'update':'add');return n&&n.trigger(k,m||e),this},getType:function(t){for(var e=o,n=0;n<e.length;n++){if(e[n].id==t)return e[n]}},removeType:function(t){var e=o,n=this.getType(t);if(n){var r=e.indexOf(n);return e.splice(r,1),n}},getTypes:function(){return o},selectAdd:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(t.set({status:'selected'}),['component:selected','component:toggled'].forEach((function(r){return e.em.trigger(r,t,n)})))},selectRemove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){this.em;t.set({status:'',state:''}),['component:deselected','component:toggled'].forEach((function(r){return e.em.trigger(r,t,n)}))}},componentHovered:function(){var t=r.em,e=t.get('componentHovered'),n=t.previous('componentHovered'),i='hovered';n&&n.get('status')==i&&n.set({status:'',state:''}),e&&Object(s["isEmpty"])(e.get('status'))&&e.set('status',i)},allById:function(){return i},getById:function(t){return i[t]||null},destroy:function(){var o=this.allById();Object.keys(o).forEach((function(t){return o[t]&&o[t].remove()})),n&&n.remove(),[r,t,i,e,n].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return Ce})),n.d(e,"evPfx",(function(){return ke})),n.d(e,"evSector",(function(){return Se})),n.d(e,"evSectorAdd",(function(){return je})),n.d(e,"evSectorRemove",(function(){return Pe})),n.d(e,"evSectorUpdate",(function(){return _e})),n.d(e,"evProp",(function(){return Te})),n.d(e,"evPropAdd",(function(){return Ee})),n.d(e,"evPropRemove",(function(){return De})),n.d(e,"evPropUp",(function(){return Me})),n.d(e,"evLayerSelect",(function(){return Ae})),n.d(e,"evTarget",(function(){return Le})),n.d(e,"evCustom",(function(){return Re}));var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1),l=n(22),u=n(3),f=n.n(u),h={sectors:[{name:'General',open:!1,properties:['display','float','position','top','right','left','bottom']},{name:'Flex',open:!1,properties:['flex-direction','flex-wrap','justify-content','align-items','align-content','order','flex-basis','flex-grow','flex-shrink','align-self']},{name:'Dimension',open:!1,properties:['width','height','max-width','min-height','margin','padding']},{name:'Typography',open:!1,properties:['font-family','font-size','font-weight','letter-spacing','color','line-height','text-align','text-shadow']},{name:'Decorations',open:!1,properties:['background-color','border-radius','border','box-shadow','background']},{name:'Extra',open:!1,properties:['opacity','transition']}],appendTo:'',stylePrefix:'sm-',custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:['width','height']},d=n(16),p=n.n(d),g=n(5),v=n.n(g),m=n(6),y=n.n(m),b=n(7),w=n.n(b),O=n(8),x=n.n(O),C=n(4),k=n.n(C),S=n(37),j=["partial"];function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var E=function(t){w()(n,t);var e=T(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em;var r=this.get('id')||'',i=this.get('name')||this.get('label')||'';!this.get('property')&&this.set('property',(i||r).replace(/ /g,'-'));var o=this.get('property');!this.get('id')&&this.set('id',o),!i&&this.set('name',Object(c["capitalize"])(o).replace(/-/g,' ')),this.on('change',this.__upTargets),n.callInit(this,t,e)}},{key:"__getParentProp",value:function(){var t,e;return null===(t=this.collection)||void 0===t||null===(e=t.opts)||void 0===e?void 0:e.parentProp}},{key:"__upTargets",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=r.get('StyleManager'),c=this.getName(),l=n.__clear,u=l?'':this.__getFullValue(n),f=this.__getParentProp(),h=this.changedAttributes(),d=Object(s["keys"])(h).reduce((function(t,n){return t[n]=e.previous(n),t}),{}),p=[].concat(i()(Object(s["keys"])(this.__getClearProps())),['__p']),g=Object(s["keys"])(h),v=!n.__up&&!f&&(l||p.some((function(t){return g.indexOf(t)>=0}))),m=this.get('onChange'),y={property:this,from:d,to:h,value:u,opts:n};o.__trgEv(o.events.propertyUpdate,y),m&&m(y),v&&this.__upTargetsStyle(a()({},c,u),n)}},{key:"__upTargetsStyle",value:function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==r||r.addStyleTargets(_(_({},t),{},{__p:!!e.avoidStore}),e)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.noTarget&&(e.__up=!0);var n=e.partial,r=p()(e,j);return t.__p=!(!r.avoidStore&&!n),this.set(t,_(_({},r),{},{avoidStore:t.__p}))}},{key:"up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.set(t,_(_({},e),{},{__up:!0}))}},{key:"init",value:function(){}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('property')}},{key:"getLabel",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,i=this.getId(),o=this.get('name')||this.get('label');return r&&(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.properties.".concat(i)))||o}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget(),r=this.get('value');return!Object(s["isUndefined"])(r)&&''!==r&&!n}},{key:"hasValueParent",value:function(){return this.hasValue()&&!this.hasValue({noParent:!0})}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=t.camelCase?Object(c["camelCase"])(e):e;return a()({},n,this.__getFullValue(t))}},{key:"getDefaultValue",value:function(){var t=this.get('default');return"".concat(Object(s["isUndefined"])(t)?this.get('defaults'):t)}},{key:"upValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._up(this.__getClearProps(),_(_({},t),{},{__clear:!0}))}},{key:"canClear",value:function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})}},{key:"getParent",value:function(){return this.__getParentProp()||null}},{key:"isFull",value:function(){return!!this.get('full')}},{key:"__parseValue",value:function(t,e){return this.parseValue(t,e)}},{key:"__getClearProps",value:function(){return{value:''}}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t),i=!e;!i&&this.set({value:void 0},{avoidStore:i,silent:!0}),this.set(r,_({avoidStore:i},n))}},{key:"setValueFromInput",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,_(_({},n),{},{fromInput:1}))}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r='!important';if(Object(s["isString"])(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,'').trim(),n.important=1),!this.get('functionName')&&!e.complete)return n;var i=[],o="".concat(n.value),a=o.indexOf('(')+1,c=o.lastIndexOf(')'),l=o.substring(0,a-1);if(l&&(n.functionName=l),i.push(a),c>=0&&i.push(c),n.value=String.prototype.substring.apply(o,i),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,''),n.value=u}return n}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()}},{key:"getFullValue",value:function(t){var e=this.get('functionName'),n=this.getDefaultValue(),r=Object(s["isUndefined"])(t)?this.get('value'):t,i=!Object(s["isUndefined"])(r)&&''!==r;if(r&&n&&r===n)return n;if(e&&i){var o='url'===e?"'".concat(r.replace(/'/g,''),"'"):r;r="".concat(e,"(").concat(o,")")}return i&&this.get('important')&&(r="".concat(r," !important")),r||''}},{key:"__setParentTarget",value:function(t){this.__parentTarget=t}},{key:"getParentTarget",value:function(){return this.__parentTarget||null}},{key:"__parseFn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',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()}}},{key:"__checkVisibility",value:function(t){var e=t.target,n=t.component,r=t.sectors,i=n||e;if(!i)return!1;var o=this.getId(),a=this.getName(),l=this.get('toRequire'),u=this.get('requires'),f=this.get('requiresParent'),h=i.get('unstylable'),d=i.get('stylable-require'),p=i.get('stylable');if(Object(s["isArray"])(p)&&(p=p.indexOf(a)>=0),Object(s["isArray"])(h)&&(p=h.indexOf(a)<0),l&&(p=!e||d&&(d.indexOf(o)>=0||d.indexOf(a)>=0)),r&&u){var g=Object(s["keys"])(u);r.forEach((function(t){t.getProperties().forEach((function(t){if(Object(s["includes"])(g,t.id)){var e=u[t.id];p=p&&Object(s["includes"])(e,t.get('value'))}}))}))}if(f){var v=n&&n.parent(),m=v&&v.getEl();if(m){var y=Object(c["hasWin"])()?window.getComputedStyle(m):{};Object(s["each"])(f,(function(t,e){p=p&&y[e]&&Object(s["includes"])(t,y[e])}))}else p=!1}return!!p}}]),n}(u["Model"]);function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}E.callParentInit=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,_(_({},r),{},{skipInit:1})])},E.callInit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)},E.getDefaults=function(){return Object(s["result"])(this.prototype,'defaults')},E.prototype.defaults={name:'',property:'',type:'',defaults:'',info:'',value:'',icon:'',functionName:'',status:'',visible:!0,fixedValues:['initial','inherit'],onChange:null,full:0,important:0,toRequire:0,requires:null,requiresParent:null};var L=function(t){return'integer'===t||'number'===t},R=function(t){w()(n,t);var e=A(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return M(M({},E.getDefaults()),{},{detached:!1,properties:[],separator:' ',join:null,fromStyle:null,toStyle:null,full:!0})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};E.callParentInit(E,this,t,e);var n=this.em,r=new Xt(this.get('properties')||[],{em:n,parentProp:this});this.set('properties',r,{silent:1}),this.listenTo(r,'change',this.__upProperties),E.callInit(this,t,e)}},{key:"getProperties",value:function(){return i()(this.get('properties').models)}},{key:"getProperty",value:function(t){return this.get('properties').filter((function(e){return e.getId()===t||e.getName()===t}))[0]||null}},{key:"getPropertyAt",value:function(t){return this.get('properties').at(t)}},{key:"isDetached",value:function(){return!!this.get('detached')}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.byName;return this.getProperties().reduce((function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t}),{})}},{key:"getSeparator",value:function(){return this.getSplitSeparator()}},{key:"getJoin",value:function(){return this.__getJoin()}},{key:"getStyleFromProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.__getJoin(),r=this.get('toStyle'),i=this.getValues(),o={};if(r)o=r(i,{join:n,name:e,property:this});else if(i=this.getValues({byName:!0}),this.isDetached())o=i;else{var s=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(n);o=a()({},e,s)}return this.isDetached()?o[e]='':(o[e]=o[e]||'',o=M(M({},o),this.getProperties().reduce((function(t,e){return t[e.getName()]='',t}),{}))),t.camelCase?Object.keys(o).reduce((function(t,e){return t[camelCase(e)]=o[e],t}),{}):o}},{key:"getSplitSeparator",value:function(){return new RegExp("".concat(this.get('separator'),"(?![^\\(]*\\))"))}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=this.getStyleFromProps();if(this.isDetached()&&e){var r=e.getName();n=a()({},r,n[r])}this.__upTargetsStyle(n,t)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__setProperties(this.__getSplitValue(t.value),e),E.prototype._up.call(this,t,e)}},{key:"getStyle",value:function(t){return this.getStyleFromProps(t)}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isDetached()||t.__clear?'':this.getStyleFromProps()[this.getName()]||''}},{key:"__getJoin",value:function(){var t=this.get('join');return Object(s["isString"])(t)?t:this.get('separator')}},{key:"__styleHasProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.getProperties(),r=n.map((function(t){return t.getName()})),o=[e].concat(i()(r));return o.some((function(e){return!Object(s["isUndefined"])(t[e])&&''!==t[e]}))}},{key:"__splitValue",value:function(t,e){return t.split(e).map((function(t){return t.trim()})).filter(Boolean)}},{key:"__splitStyleName",value:function(t,e,n){return this.__splitValue(t[e]||'',n)}},{key:"__getSplitValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.byName,r=this.getProperties(),i=4===r.length&&r.every((function(t){return L(t.getType())})),o=this.__splitValue(t,this.getSplitSeparator()),a={};return r.forEach((function(t,e){var r=o[e],c=Object(s["isUndefined"])(r)?'':r;if(i){var l=o.length;c=o[e]||o[e%l+(1!=l&&l%2?1:0)]||c}var u=n?t.getName():t.getId();a[u]=c||''})),a}},{key:"__getPropsFromStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.__styleHasProps(t))return null;var n=e.byName,r=this.getProperties(),i=this.getSplitSeparator(),o=this.get('fromStyle'),a=o?o(t,{property:this,separator:i}):{};return o||(a=this.__getSplitValue(t[this.getName()]||'',{byName:n}),r.forEach((function(e){var r=t[e.getName()],i=n?e.getName():e.getId();Object(s["isUndefined"])(r)||''===r||(a[i]=r)}))),a}},{key:"__setProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.getProperties().forEach((function(n){var r=t[n.getId()];n.__getFullValue()!==r&&n.upValue(r,e)}));var n=Object(s["keys"])(t).map((function(e){return t[e]})).join(' ');this.set('value',n,{silent:!0})}},{key:"clear",value:function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),E.prototype.clear.call(this)}},{key:"hasValue",value:function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))}},{key:"getFullValue",value:function(){return this.__getFullValue()}},{key:"__canClearProp",value:function(t){return this.isDetached()&&t.hasValue({noParent:!0})}}]),n}(E);function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function F(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var V=function(t){w()(n,t);var e=F(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return{values:{}}}},{key:"initialize",value:function(){var t=this.collection;this.prop=null==t?void 0:t.prop}},{key:"getId",value:function(){return this.cid}},{key:"getIndex",value:function(){var t=this.collection;return t?t.indexOf(this):-1}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('values');return t.camelCase?Object.keys(e).reduce((function(t,n){return t[Object(c["camelCase"])(n)]=e[n],t}),{}):e}},{key:"getLabel",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)}},{key:"isSelected",value:function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this}},{key:"select",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)}},{key:"remove",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)}},{key:"move",value:function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)}},{key:"getStylePreview",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null===(t=this.prop)||void 0===t?void 0:t.getStylePreview(this,e)}},{key:"hasPreview",value:function(){var t;return!(null===(t=this.prop)||void 0===t||!t.get('preview'))}},{key:"upValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set('values',I(I({},this.getValues()),t))}}]),n}(u["Model"]);function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var z=function(t){w()(n,t);var e=B(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prop=e.prop}}]),n}(u["Collection"]);z.prototype.model=V;var H=["__layers"];function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var q=/,(?![^\(]*\))/,G=/\s(?![^(]*\))/,K=function(t){w()(n,t);var e=$(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return W(W({},R.getDefaults()),{},{layers:[],layerSeparator:', ',layerJoin:'',prepend:0,preview:!1,layerLabel:null,selectedLayer:null})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R.callParentInit(R,this,t,e);var n=this.get('layers'),r=new z(n,{prop:this});r.property=this,r.properties=this.get('properties'),this.set('layers',r,{silent:!0}),this.on('change:selectedLayer',this.__upSelected),this.listenTo(r,'add remove',this.__upLayers),R.callInit(this,t,e)}},{key:"getLayers",value:function(){return this.__getLayers().models}},{key:"__getLayers",value:function(){return this.get('layers')}},{key:"getLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.__getLayers().at(t)||null}},{key:"getSelectedLayer",value:function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:null}},{key:"selectLayer",value:function(t){return this.set('selectedLayer',t,{__select:!0})}},{key:"selectLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e&&this.selectLayer(e)}},{key:"moveLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?t.getIndex():-1;n>=0&&Object(s["isNumber"])(e)&&e>=0&&e<this.getLayers().length&&n!==e&&(this.removeLayer(t),this.__getLayers().add(t,{at:e}))}},{key:"addLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};this.getProperties().forEach((function(e){var r=e.getId(),i=t[r];n[r]=Object(s["isUndefined"])(i)?e.getDefaultValue():i}));var r=this.get('layers').push({values:n},e);return r}},{key:"removeLayer",value:function(t){return this.get('layers').remove(t)}},{key:"removeLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e?this.removeLayer(e):null}},{key:"getLayerLabel",value:function(t){var e='';if(t){var n=this.get('layerLabel'),r=t.getValues(),i=t.getIndex();if(n)e=n(t,{index:i,values:r,property:this});else{var o=[];this.getProperties().map((function(t){o.push(r[t.getId()])})),e=o.filter(Boolean).join(' ')}}return e}},{key:"getStyleFromLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.__getJoin(),i=this.__getJoinLayers(),o=this.get('toStyle'),l=this.getName(),u=t.getValues();if(o)e=o(u,{join:r,joinLayers:i,name:l,layer:t,property:this});else{var f=this.getProperties().map((function(t){var e=t.getName(),r=u[t.getId()],i=Object(s["isUndefined"])(r)?t.getDefaultValue():r;if(n.number&&L(t.getType())){var o=t.parseValue(r,n.number);i="".concat(o.value).concat(o.unit)}return{name:e,value:i}}));e=this.isDetached()?f.reduce((function(t,e){return t[e.name]=e.value,t}),{}):a()({},this.getName(),f.map((function(t){return t.value})).join(r))}return n.camelCase?Object.keys(e).reduce((function(t,n){return t[Object(c["camelCase"])(n)]=e[n],t}),{}):e}},{key:"getStylePreview",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=this.get('preview');return r&&(n=this.getStyleFromLayer(t,e)),n}},{key:"getLayerSeparator",value:function(){var t=this.get('layerSeparator');return Object(s["isString"])(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getSelectedLayer();n&&(n.upValues(a()({},t.getId(),t.__getFullValue())),e.__up||this.__upTargetsStyleProps(e))}},{key:"__upLayers",value:function(t,e,n){this.__upTargetsStyleProps(n||e)}},{key:"__upTargets",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__select)return E.prototype.__upTargets.call(this,t,e)}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__upTargetsStyle(this.getStyleFromLayers(),t)}},{key:"__upTargetsStyle",value:function(t,e){return E.prototype.__upTargetsStyle.call(this,t,e)}},{key:"__upSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noEvent,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em.get('StyleManager'),i=this.getSelectedLayer(),o=null==i?void 0:i.getValues();o&&this.getProperties().forEach((function(t){var e=o[t.getId()];t.__getFullValue()!==e&&t.upValue(e,W(W({},n),{},{__up:!0}))})),!e&&r.__trgEv(r.events.layerSelect,{property:this})}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.__layers,r=void 0===n?[]:n,i=p()(t,H);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),E.prototype._up.call(this,i,e)}},{key:"__setLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.__getLayers(),n=t.map((function(t){return{values:t}}));e.length===n.length?n.map((function(t,n){var r;return null===(r=e.at(n))||void 0===r?void 0:r.upValues(t.values)})):this.__getLayers().reset(n),this.__upSelected({noEvent:!0})}},{key:"__parseValue",value:function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(q).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n}},{key:"__parseLayer",value:function(t){var e=this.get('parseLayer'),n=t.split(G),r=this.getProperties();return e?e({value:t,values:n}):r.reduce((function(t,e,r){var i=n[r];return t[e.getId()]=Object(s["isUndefined"])(i)?e.getDefaultValue():i,t}),{})}},{key:"__getLayersFromStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.__styleHasProps(e))return null;var n=this.getName(),r=this.getProperties(),i=this.getLayerSeparator(),o=this.get('fromStyle'),c=o?o(e,{property:this,separatorLayers:i}):[];if(!o){var l=this.__splitStyleName(e,n,i).map((function(e){return e.split(t.getSplitSeparator())})).map((function(t){var e={};return r.forEach((function(n,r){var i=t[r];e[n.getId()]=Object(s["isUndefined"])(i)?n.getDefaultValue():i})),e}));r.forEach((function(n){var r=n.getId();t.__splitStyleName(e,n.getName(),i).map((function(t){return a()({},r,t||n.getDefaultValue())})).forEach((function(t,e){l[e]=l[e]?W(W({},l[e]),t):t}))})),c=l}return Object(s["isArray"])(c)?c:[c]}},{key:"getStyle",value:function(t){return this.getStyleFromLayers(t)}},{key:"getStyleFromLayers",value:function(t){var e=this,n={},r=this.getName(),i=this.getLayers(),o=this.getProperties();if(i.map((function(n){return e.getStyleFromLayer(n,t)})).forEach((function(t){Object(s["keys"])(t).map((function(e){n[e]||(n[e]=[]),n[e].push(t[e])}))})),Object(s["keys"])(n).map((function(t){n[t]=n[t].join(e.__getJoinLayers())})),this.isDetached())n[r]='',!i.length&&o.map((function(t){n[t.getName()]=''}));else{var a=o.reduce((function(t,e){return t[e.getName()]='',t}),{});n[r]=n[r]||'',n=W(W({},n),a)}return n}},{key:"__getJoinLayers",value:function(){var t=this.get('layerJoin'),e=this.get('layerSeparator');return t||(Object(s["isString"])(e)?e:t)}},{key:"__getFullValue",value:function(){return this.get('detached')?'':this.getStyleFromLayers()[this.getName()]}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget();return this.getLayers().length>0&&!n}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.__getLayers().reset(),this.__upTargetsStyleProps(t),E.prototype.clear.call(this)}},{key:"__canClearProp",value:function(){return!1}}]),n}(R),Y=["complete","partial"];function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Q='data-clear-style',tt=function(t){w()(n,t);var e=Z(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"template",value:function(){var t=this.pfx,e=this.ppfx;return"\n      <div class=\"".concat(t,"label\" data-sm-label></div>\n      <div class=\"").concat(e,"fields\" data-sm-fields></div>\n    ")}},{key:"templateLabel",value:function(t){var e=this.pfx,n=this.em,r=t.parent,i=t.attributes,o=i.icon,a=void 0===o?'':o,s=i.info,c=void 0===s?'':s,l=null==n?void 0:n.getConfig('icons'),u=(null==l?void 0:l.close)||'';return"\n      <span class=\"".concat(e,"icon ").concat(a,"\" title=\"").concat(c,"\">\n        ").concat(t.getLabel(),"\n      </span>\n      ").concat(r?'':"<div class=\"".concat(e,"clear\" style=\"display: none\" ").concat(Q,">").concat(u,"</div>"),"\n    ")}},{key:"templateInput",value:function(t){return"\n      <div class=\"".concat(this.ppfx,"field\">\n        <input placeholder=\"").concat(t.getDefaultValue(),"\"/>\n      </div>\n    ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s["bindAll"])(this,'__change','__updateStyle');var e=t.config||{},n=e.em;this.config=e,this.em=n,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.__destroyFn=this.destroy?this.destroy.bind(this):function(){};var r=this.model;r.view=this,this.onValueChange=Object(s["debounce"])(this.onValueChange.bind(this),10),this.updateStatus=Object(s["debounce"])(this.updateStatus.bind(this)),this.listenTo(r,'destroy remove',this.remove),this.listenTo(r,'change:visible',this.updateVisibility),this.listenTo(r,'change:name change:className change:full',this.render),this.listenTo(r,'change:value',this.onValueChange),this.listenTo(n,'change:device',this.onValueChange);var i=this.init&&this.init.bind(this);i&&i()}},{key:"remove",value:function(){var t=this;u["View"].prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts())}},{key:"updateStatus",value:function(){var t,e=this.model,n=this.pfx,r=this.ppfx,i=this.config,o="".concat(r,"four-color"),a="".concat(r,"color-warn"),s=this.$el.children(".".concat(n,"label")),c=this.getClearEl(),l=c?c.style:{};s.removeClass("".concat(o," ").concat(a)),l.display='none',e.hasValue({noParent:!0})&&i.highlightChanged?(s.addClass(o),i.clearProperties&&(l.display='')):e.hasValue()&&i.highlightComputed&&s.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()}},{key:"clear",value:function(t){t&&t.stopPropagation(),this.model.clear()}},{key:"getClearEl",value:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(Q,"]"))),this.clearEl}},{key:"inputValueChanged",value:function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)}},{key:"onValueChange",value:function(t,e){this.setValue(this.model.getFullValue()),this.updateStatus()}},{key:"setValue",value:function(t){var e=this.model,n=Object(s["isUndefined"])(t)||''===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)}},{key:"__setValueInput",value:function(t){var e=this.getInputEl();e&&(e.value=t)}},{key:"getInputEl",value:function(){return this.input||(this.input=this.el.querySelector('input')),this.input}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"clearCached",value:function(){this.clearEl=null,this.input=null,this.$input=null}},{key:"__unset",value:function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())}},{key:"__update",value:function(t){var e=this.update&&this.update.bind(this);e&&e(J(J({},this._getClbOpts()),{},{value:t}))}},{key:"__change",value:function(){for(var t=this.emit&&this.emit.bind(this),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t&&t.apply(void 0,[this._getClbOpts()].concat(n))}},{key:"__updateStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.complete,r=e.partial,i=(p()(e,Y),this.model),o=!1!==n&&!0!==r;Object(c["isObject"])(t)?i.__upTargetsStyle(t,{avoidStore:!o}):i.upValue(t,{partial:!o})}},{key:"_getClbOpts",value:function(){var t=this.model;return{el:this.el,createdEl:this.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}}},{key:"render",value:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=this.$el,i=e.getName(),o=e.getType(),a=e.get('className')||'',s="".concat(t,"property"),c='number'===o?"".concat(t).concat(o," ").concat(t,"integer"):"".concat(t).concat(o);this.createdEl&&this.__destroyFn(this._getClbOpts()),r.empty().append(this.template(e)),r.find('[data-sm-label]').append(this.templateLabel(e));var l=this.create&&this.create.bind(this);this.createdEl=l&&l(this._getClbOpts()),r.find('[data-sm-fields]').append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(c," ").concat(s,"__").concat(i," ").concat(a).trim(),n.className+=e.isFull()?" ".concat(s,"--full"):'';var u=this.onRender&&this.onRender.bind(this);u&&u(),this.setValue(e.getValue())}}]),n}(u["View"]);tt.prototype.events=a()({change:'inputValueChanged'},"click [".concat(Q,"]"),'clear');var et=n(13);function nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var rt=function(t){w()(n,t);var e=nt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||'',this.properties=[],this.parent=t.parent;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render)}},{key:"addTo",value:function(t,e,n){this.add(t,null,n)}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parent,i=this.config,o=e||this.el,a=new t.typeView({model:t,config:i});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),Object(et["b"])(o,s,n.at)}},{key:"remove",value:function(){u["View"].prototype.remove.apply(this,arguments),this.clearItems()}},{key:"clearItems",value:function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr('class',"".concat(n,"properties")),this}}]),n}(u["View"]);function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var st=function(t){w()(n,t);var e=at(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"templateInput",value:function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"field ").concat(t,"composite\">\n        <span id=\"").concat(t,"input-holder\"></span>\n      </div>\n    ")}},{key:"remove",value:function(){var t;null===(t=this.props)||void 0===t||t.remove(),tt.prototype.remove.apply(this,arguments)}},{key:"onValueChange",value:function(){}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.get('properties');if(n.length&&!this.props){var r=t.isDetached(),i=new rt({config:ot(ot({},this.config),{},{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});i.render(),this.$el.find("#".concat(e,"input-holder")).append(i.el),this.props=i}}},{key:"clearCached",value:function(){tt.prototype.clearCached.apply(this,arguments),this.props=null}}]),n}(tt);function ct(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var lt=function(t){w()(n,t);var e=ct(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"events",value:function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}}},{key:"template",value:function(){var t=this.pfx,e=this.ppfx,n=this.em,r=null==n?void 0:n.getConfig('icons'),i=(null==r?void 0:r.close)||'',o=(null==r?void 0:r.move)||'';return"\n      <div class=\"".concat(t,"label-wrp\">\n        <div id=\"").concat(t,"move\" class=\"").concat(e,"no-touch-actions\" data-move-layer>\n          ").concat(o,"\n        </div>\n        <div id=\"").concat(t,"label\" data-label></div>\n        <div id=\"").concat(t,"preview-box\" class=\"").concat(t,"layer-preview\" style=\"display: none\" data-preview-box>\n          <div id=\"").concat(t,"preview\" class=\"").concat(t,"layer-preview-cnt\" data-preview></div>\n        </div>\n        <div id=\"").concat(t,"close-layer\" class=\"").concat(t,"btn-close\" data-close-layer>\n          ").concat(i,"\n        </div>\n      </div>\n      <div id=\"").concat(t,"inputs\" data-properties></div>\n    ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},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)}},{key:"initSorter",value:function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)}},{key:"removeItem",value:function(t){t&&t.stopPropagation(),this.model.remove()}},{key:"select",value:function(){this.model.select()}},{key:"getPropertiesWrapper",value:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl}},{key:"getPreviewEl",value:function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl}},{key:"getLabelEl",value:function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl}},{key:"updateLabel",value:function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),r=t.getStylePreview({number:{min:-3,max:3}}),i=Object(s["keys"])(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');n.setAttribute('style',i)}}},{key:"updateVisibility",value:function(){var t=this.pfx,e=this.model,n=this.propertyView,r=this.getPropertiesWrapper(),i=e.isSelected();r.style.display=i?'':'none',this.$el[i?'addClass':'removeClass']("".concat(t,"active")),i&&r.appendChild(n.props.el)}},{key:"render",value:function(){var t=this.el,e=this.pfx,n=this.model;return t.innerHTML=this.template(),t.className="".concat(e,"layer"),n.hasPreview()&&(t.querySelector("[data-preview-box]").style.display=''),this.updateLabel(),this.updateVisibility(),this}}]),n}(u["View"]);function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var ft=function(t){w()(n,t);var e=ut(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(t){var e=this.collection,n=t.config||{},r=n.em,i=n.stylePrefix||'',o=n.pStylePrefix||'';this.config=n,this.pfx=i,this.ppfx=o,this.propertyView=t.propertyView,this.className="".concat(i,"layers ").concat(o,"field"),this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.reset),this.items=[];var a=r?r.get('Utils'):'';this.sorter=a?new a.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(i,"layers"),itemSel:".".concat(i,"layer"),pfx:n.pStylePrefix}):'',e.view=this,this.$el.data('model',e),this.$el.data('collection',e)}},{key:"addTo",value:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)}},{key:"addToCollection",value:function(t,e,n){var r=e||null,i=this.propertyView,o=this.config,a=this.sorter,s=this.$el,c=new lt({model:t,config:o,sorter:a,propertyView:i}),l=c.render().el;if(this.items.push(c),r)r.appendChild(l);else if(void 0!==n){var u='before';s.children().length===n&&(n--,u='after'),n<0?s.append(l):s.children().eq(n)[u](l)}else s.append(l);return l}},{key:"reset",value:function(t,e){this.clearItems(e),this.render()}},{key:"remove",value:function(){this.clearItems(),u["View"].prototype.remove.apply(this,arguments)}},{key:"clearItems",value:function(){this.items.forEach((function(t){return t.remove()})),this.items=[]}},{key:"render",value: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}}]),n}(u["View"]);function ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var gt=function(t){w()(n,t);var e=pt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"events",value:function(){return dt(dt({},st.prototype.events),{},{'click [data-add-layer]':'addLayer',change:''})}},{key:"templateInput",value:function(){var t=this.pfx,e=this.em,n=null==e?void 0:e.getConfig('icons'),r=(null==n?void 0:n.plus)||'+';return"\n      <div class=\"".concat(t,"field ").concat(t,"stack\">\n        <button type=\"button\" id=\"").concat(t,"add\" data-add-layer>\n          ").concat(r,"\n        </button>\n        <div data-layers-wrapper></div>\n      </div>\n    ")}},{key:"init",value:function(){var t=this.model;this.listenTo(t.__getLayers(),'change reset',this.updateStatus)}},{key:"addLayer",value:function(){this.model.addLayer({},{at:0})}},{key:"setValue",value:function(){}},{key:"remove",value:function(){var t;null===(t=this.layersView)||void 0===t||t.remove(),st.prototype.remove.apply(this,arguments)}},{key:"clearCached",value:function(){st.prototype.clearCached.apply(this,arguments),this.layersView=null}},{key:"onRender",value:function(){var t=this.model,e=this.el,n=this.config,r=t.get('properties');if(r.length&&!this.props){var i=new rt({config:dt(dt({},n),{},{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var o=new ft({collection:t.__getLayers(),config:n,propertyView:this});o.render(),e.querySelector('[data-layers-wrapper]').appendChild(o.el),this.props=i,this.layersView=o}}}]),n}(st);function vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var bt=function(t){w()(n,t);var e=yt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"events",value:function(){return mt(mt({},tt.prototype.events),{},{'click [data-clear-asset]':'clear','click [data-open-assets]':'openAssetManager'})}},{key:"templateInput",value:function(){var t,e=this.pfx,n=this.em,r=null===(t=this.em)||void 0===t?void 0:t.getConfig('icons'),i=null==r?void 0:r.close;return"\n      <div class=\"".concat(e,"field ").concat(e,"file\">\n        <div id='").concat(e,"input-holder'>\n          <div class=\"").concat(e,"btn-c\">\n            <button class=\"").concat(e,"btn\" id=\"").concat(e,"images\" type=\"button\" data-open-assets>\n              ").concat(n.t('styleManager.fileButton'),"\n            </button>\n          </div>\n          <div style=\"clear:both;\"></div>\n        </div>\n        <div id=\"").concat(e,"preview-box\" class=\"").concat(e,"preview-file\" data-preview-box>\n          <div id=\"").concat(e,"preview-file\" class=\"").concat(e,"preview-file-cnt\" data-preview></div>\n          <div id=\"").concat(e,"close\" class=\"").concat(e,"preview-file-close\" data-clear-asset>").concat(i,"</div>\n        </div>\n      </div>\n    ")}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),i=n.querySelector('[data-preview-box]'),o=n.querySelector('[data-preview]');i.style.display=t&&t!==r?'':'none',o.style.backgroundImage=t||e.getDefaultValue()}},{key:"openAssetManager",value:function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.get('AssetManager');null==n||n.open({select:function(t,r){var i=Object(s["isString"])(t)?t:t.get('src');e.model.upValue(i,{partial:!r}),r&&n.close()},types:['image'],accept:'image/*'})}}]),n}(tt);function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Ot=function(t){w()(n,t);var e=wt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"templateInput",value:function(){return''}},{key:"init",value:function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)}},{key:"setValue",value:function(t){var e,n=this.model.parseValue(t);t="".concat(n.value).concat(n.unit),null===(e=this.inputInst)||void 0===e||e.setValue(t,{silent:1})}},{key:"onRender",value:function(){var t=this.ppfx,e=this.model,n=this.el;if(!this.inputInst){var r=e.input;r.ppfx=t,r.render(),n.querySelector(".".concat(t,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}}},{key:"clearCached",value:function(){tt.prototype.clearCached.apply(this,arguments),this.inputInst=null}}]),n}(tt),xt=n(43);function Ct(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var kt=function(t){w()(n,t);var e=Ct(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"setValue",value:function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})}},{key:"remove",value:function(){var t=this;Ot.prototype.remove.apply(this,arguments);var e=this.inputInst;e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null}))}},{key:"__handleChange",value:function(t,e){this.model.upValue(t,{partial:e})}},{key:"onRender",value:function(){if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var t=this.ppfx,e=this.model,n=this.em,r=this.el,i=new xt["a"]({target:n,model:e,ppfx:t,onChange:this.__handleChange}).render();r.querySelector(".".concat(t,"fields")).appendChild(i.el),this.input=i.inputEl.get(0),this.inputInst=i}}}]),n}(Ot);function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var _t=function(t){w()(n,t);var e=Pt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return jt(jt({},E.getDefaults()),{},{options:[],full:0})}},{key:"getOptions",value:function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]}},{key:"getOption",value:function(t){var e=this,n=t||this.getValue();return this.getOptions().filter((function(t){return e.getOptionId(t)===n}))[0]||null}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.set('options',t),this}},{key:"addOption",value:function(t){if(t){var e=this.getOptions();this.setOptions([].concat(i()(e),[t]))}return this}},{key:"getOptionId",value:function(t){return Object(c["isDef"])(t.id)?t.id:t.value}},{key:"getOptionLabel",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.locale,i=void 0===r||r,o=(Object(s["isString"])(t)?this.getOption(t):t)||{},a=this.getOptionId(o),c=o.label||o.name||a,l=this.getId();return i&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.options.".concat(l,".").concat(a)))||c}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];E.prototype.initialize.apply(this,e),this.listenTo(this,'change:options',this.__onOptionChange)}},{key:"__onOptionChange",value:function(){this.set('list',this.get('options'))}}]),n}(E);function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Et=function(t){w()(n,t);var e=Tt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"templateInput",value:function(){var t=this.pfx,e=this.ppfx;return"\n      <div class=\"".concat(e,"field ").concat(e,"select\">\n        <span id=\"").concat(t,"input-holder\"></span>\n        <div class=\"").concat(e,"sel-arrow\">\n          <div class=\"").concat(e,"d-s-arrow\"></div>\n        </div>\n      </div>\n    ")}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];tt.prototype.initialize.apply(this,e),this.listenTo(this.model,'change:options',this.updateOptions)}},{key:"updateOptions",value:function(){this.input=null,this.onRender()}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.getOptions();if(!this.input){var r=[];n.forEach((function(e){var n=t.getOptionId(e),i=t.getOptionLabel(n),o=e.style?e.style.replace(/"/g,'&quot;'):'',a=o?"style=\"".concat(o,"\""):'',s=n.replace(/"/g,'&quot;');r.push("<option value=\"".concat(s,"\" ").concat(a,">").concat(i,"</option>"))}));var i=this.el.querySelector("#".concat(e,"input-holder"));i.innerHTML="<select>".concat(r.join(''),"</select>"),this.input=i.firstChild}}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],i=r?e.getOptionId(r):'';n&&(n.value=t||i)}}]),n}(tt);function Dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Lt=function(t){w()(n,t);var e=At(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return Mt(Mt({},_t.getDefaults()),{},{full:1})}}]),n}(_t);function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Nt=function(t){w()(n,t);var e=Rt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"templateInput",value:function(){var t=this.ppfx;return"<div class=\"".concat(t,"field ").concat(t,"field-radio\"></div>")}},{key:"onRender",value:function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),i=n.getName(),o=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(i),s=n.cid;if(!this.input){var c=[];o.forEach((function(o){var l=o.className?"".concat(o.className," ").concat(t,"icon ").concat(r):'',u=n.getOptionId(o),f="".concat(i,"-").concat(u,"-").concat(s),h=l?'':n.getOptionLabel(u),d=o.title?"title=\"".concat(o.title,"\""):'',p=n.getValue()===u?'checked':'';c.push("\n          <div class=\"".concat(e,"radio-item\">\n            <input type=\"radio\" class=\"").concat(a,"\" id=\"").concat(f,"\" name=\"").concat(i,"-").concat(s,"\" value=\"").concat(u,"\" ").concat(p,"/>\n            <label class=\"").concat(l||r,"\" ").concat(d," for=\"").concat(f,"\">").concat(h,"</label>\n          </div>\n        "))}));var l=this.el.querySelector(".".concat(e,"field"));l.innerHTML="<div class=\"".concat(e,"radio-items\">").concat(c.join(''),"</div>"),this.input=l.firstChild}}},{key:"__setValueInput",value:function(t){var e,n=this.model,r=t||n.getDefaultValue(),i=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(r,"\"]"));i&&(i.checked=!0)}}]),n}(Et),It=n(38);function Ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var zt=function(t){w()(n,t);var e=Bt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return Vt(Vt({},E.getDefaults()),{},{units:[],unit:'',min:'',max:'',step:1})}},{key:"getUnits",value:function(){return this.get('units')||[]}},{key:"getUnit",value:function(){return this.get('unit')}},{key:"getMin",value:function(){return this.get('min')}},{key:"getMax",value:function(){return this.get('max')}},{key:"getStep",value:function(){return this.get('step')}},{key:"upUnit",value:function(t,e){return this._up({unit:t},e)}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};E.callParentInit(E,this,t,e);var n=this.get('unit'),r=this.get('units');this.input=Object(c["hasWin"])()&&new It["a"]({model:this}),r.length&&!n&&this.set('unit',r[0],{silent:1}),E.callInit(this,t,e)}},{key:"__getClearProps",value:function(){return Vt(Vt({},E.prototype.__getClearProps()),{},{unit:''})}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=E.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,Vt({deepCheck:1},e)),i=r.value,o=r.unit;return n.value=i,n.unit=o,n}},{key:"getFullValue",value:function(){var t=this.get('value'),e=this.get('unit');return t=Object(s["isUndefined"])(t)?'':t,e=!Object(s["isUndefined"])(e)&&t?e:'',t="".concat(t).concat(e),E.prototype.getFullValue.apply(this,[t])}}]),n}(E);function Ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ut(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ht(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var $t=function(t){w()(n,t);var e=Wt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return Ut(Ut({},zt.getDefaults()),{},{showInput:1})}}]),n}(zt);function qt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var Yt=function(t){w()(n,t);var e=Kt(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"events",value:function(){return Gt(Gt({},Ot.prototype.events),{},{'change [type=range]':'inputValueChanged','input [type=range]':'inputValueChangedSoft',change:''})}},{key:"templateInput",value:function(t){var e=this.ppfx;return"\n      <div class=\"".concat(e,"field ").concat(e,"field-range\">\n        <input type=\"range\" min=\"").concat(t.get('min'),"\" max=\"").concat(t.get('max'),"\" step=\"").concat(t.get('step'),"\"/>\n      </div>\n    ")}},{key:"getSliderEl",value:function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider}},{key:"inputValueChanged",value:function(){this.model.upValue(this.getSliderEl().value)}},{key:"inputValueChangedSoft",value:function(){this.model.upValue(this.getSliderEl().value,{partial:!0})}},{key:"setValue",value:function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),Ot.prototype.setValue.apply(this,arguments)}},{key:"onRender",value:function(){Ot.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')}},{key:"clearCached",value:function(){Ot.prototype.clearCached.apply(this,arguments),this.slider=null}}]),n}(Ot),Xt=f.a.Collection.extend(S["a"]).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:K,view:gt,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:R,view:st,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:E,view:bt,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:E,view:kt,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:_t,view:Et,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:Lt,view:Nt,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:$t,view:Yt,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:zt,view:Ot,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:zt,view:Ot,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:E,view:tt,isType:function(t){return t.type='base',t}}]}),Jt=["extend"];function Zt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function te(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var ee=function(t){w()(n,t);var e=te(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return{id:'',name:'',open:!0,visible:!0,buildProps:'',extendBuilded:1,properties:[]}}},{key:"initialize",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r;var i=t||{},o=this.buildProperties(i.buildProps),a=this.get('name')||'',c=[];!this.get('id')&&this.set('id',a.replace(/ /g,'_').toLowerCase()),c=(c=o?this.extendProperties(o):this.get('properties').map((function(t){return Object(s["isString"])(t)?e.buildProperties(t)[0]:t})).filter(Boolean)).map((function(t){return e.checkExtend(t)}));var l=new Xt(c,{em:r});l.sector=this,this.set('properties',l)}},{key:"getId",value:function(){return this.get('id')}},{key:"getName",value:function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get('name')}},{key:"setName",value:function(t){return this.set('name',t)}},{key:"isOpen",value:function(){return!!this.get('open')}},{key:"setOpen",value:function(t){return this.set('open',t)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"getProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('properties'),n=e.models?i()(e.models):e;return n.filter((function(e){var n=!0;(t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue)&&(n=!e.hasValue({noParent:!0})&&e.hasValue());return n}))}},{key:"getProperty",value:function(t){return this.getProperties().filter((function(e){return e.get('id')===t}))[0]||null}},{key:"extendProperties",value:function(t,e,n){for(var r=t.length,i=e||this.get('properties'),o=this.get('extendBuilded'),a=[],c=0,l=i.length;c<l;c++){for(var u=i[c],f=0,h=0;h<r;h++){var d=t[h];if(u.property!=d.property&&u.id!=d.property);else{var p=u.properties;p&&p.length&&(u.properties=this.extendProperties(d.properties||[],p,1)),t[h]=o?Object(s["extend"])(d,u):u,a[h]=t[h],f=1}}f||(t.push(u),a.push(u))}return n?a.filter((function(t){return t})):t}},{key:"checkExtend",value:function(t){var e=(Object(s["isString"])(t)?{extend:t}:t)||{},n=e.extend,r=p()(e,Jt);return n?Qt(Qt({},this.buildProperties([n])[0]||{}),r):t}},{key:"buildProperties",value:function(t){var e,n=t||[];if(!n.length)return[];var r=null===(e=this.em)||void 0===e?void 0:e.get('StyleManager').builtIn;return null==r?void 0:r.build(n)}}]),n}(u["Model"]);function ne(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function re(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ne(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ie(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var oe=function(t){w()(n,t);var e=ie(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.module,r=e.em;this.em=r,this.module=n,this.listenTo(this,'reset',this.onReset)}},{key:"model",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.collection.em;return new ee(t,re(re({},e),{},{em:n}))}},{key:"onReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels||[];n.forEach((function(t){return t.get('properties').reset()}))}}]),n}(u["Collection"]),ae=n(28),se=n.n(ae),ce=["extend"];function le(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?le(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fe,he=function(t){return t.map((function(t){return{id:t}}))},de=function(){function t(){v()(this,t),this.typeNumber='number',this.typeColor='color',this.typeRadio='radio',this.typeSelect='select',this.typeFile='file',this.typeSlider='slider',this.typeComposite='composite',this.typeStack='stack',this.unitsSize=['px','%','em','rem','vh','vw'],this.unitsSizeNoPerc=['px','em','rem','vh','vw'],this.unitsTime=['s','ms'],this.unitsAngle=['deg','rad','grad'],this.fixedValues=['initial','inherit','auto'];var e=', sans-serif',n=['flex-start','flex-end','center'],r=[].concat(n,['baseline','stretch']);this.optsBgSize=he(['auto','cover','contain']),this.optsBgAttach=he(['scroll','fixed','local']),this.optsBgRepeat=he(['repeat','repeat-x','repeat-y','no-repeat']),this.optsWrap=he(['nowrap','wrap','wrap-reverse']),this.optsOverflow=he(['visible','hidden','scroll','auto']),this.optsDir=he(['row','row-reverse','column','column-reverse']),this.opstDisplay=he(['block','inline','inline-block','flex','none']),this.optsTransitFn=he(['linear','ease','ease-in','ease-out','ease-in-out']),this.optsCursor=he(['auto','pointer','copy','crosshair','grab','grabbing','help','move','text']),this.optsFloat=he(['none','left','right']),this.optsPos=he(['static','relative','absolute','fixed']),this.optsTextAlign=he(['left','center','right','justify']),this.optsFlexAlign=he(r),this.optsJustCont=he([].concat(n,['space-between','space-around','space-evenly'])),this.optsAlignCont=he([].concat(n,['space-between','space-around','stretch'])),this.optsAlignSelf=he(['auto'].concat(i()(r))),this.optsTransitProp=he(['all','width','height','background-color','transform','box-shadow','opacity']),this.optsBorderStyle=he(['none','solid','dotted','dashed','double','groove','ridge','inset','outset']),this.optsBgPos=he(['left top','left center','left bottom','right top','right center','right bottom','center top','center center','center bottom']),this.optsWeight=[{id:'100',label:'Thin'},{id:'200',label:'Extra-Light'},{id:'300',label:'Light'},{id:'400',label:'Normal'},{id:'500',label:'Medium'},{id:'600',label:'Semi-Bold'},{id:'700',label:'Bold'},{id:'800',label:'Extra-Bold'},{id:'900',label:'Ultra-Bold'}],this.optsShadowType=[{id:'',label:'Outside'},{id:'inset',label:'Inside'}],this.optsFonts=['Arial, Helvetica'+e,'Arial Black, Gadget'+e,'Brush Script MT'+e,'Comic Sans MS, cursive'+e,'Courier New, Courier, monospace','Georgia, serif','Helvetica'+e,'Impact, Charcoal'+e,'Lucida Sans Unicode, Lucida Grande'+e,'Tahoma, Geneva'+e,'Times New Roman, Times, serif','Trebuchet MS, Helvetica'+e,'Verdana, Geneva'+e].map((function(t){return{id:t,label:t.split(',')[0]}})),this.fixedFontSizes=['medium','xx-small','x-small','small','large','x-large','xx-large','smaller','larger','length','initial','inherit'],this.fixedLetSpace=['normal','initial','inherit'],this.requireFlex={display:['flex']},this.init()}return y()(t,[{key:"__sub",value:function(t){var e=this;return function(){return t.map((function(t){if(Object(s["isString"])(t))return e.get(t);var n=t.extend,r=p()(t,ce);return ue(ue({},e.get(n)),r)}))}}},{key:"init",value:function(){var t=this,e=this.fixedValues,n=this.requireFlex,r=this.typeNumber;return this.props={},[['text-shadow-h',{type:r,default:'0',units:this.unitsSizeNoPerc}],['top',{default:'auto',units:this.unitsSize,fixedValues:e},'text-shadow-h'],['right',{},'top'],['bottom',{},'top'],['left',{},'top'],['margin-top',{default:'0'},'top'],['margin-right',{},'margin-top'],['margin-bottom',{},'margin-top'],['margin-left',{},'margin-top'],['padding-top',{min:0},'margin-top'],['padding-right',{},'padding-top'],['padding-bottom',{},'padding-top'],['padding-left',{},'padding-top'],['width',{min:0},'top'],['min-width',{},'width'],['max-width',{},'width'],['height',{},'width'],['min-height',{},'width'],['max-height',{},'width'],['flex-basis',{requiresParent:n},'width'],['font-size',{default:'medium',fixedValues:this.fixedFontSizes},'width'],['letter-spacing',{default:'normal',fixedValues:this.fixedLetSpace},'top'],['line-height',{},'letter-spacing'],['text-shadow-v',{},'text-shadow-h'],['text-shadow-blur',{min:0},'text-shadow-h'],['border-radius-c',{property:'border-radius',fixedValues:void 0},'padding-top'],['border-top-left-radius',{},'border-radius-c'],['border-top-right-radius',{},'border-radius-c'],['border-bottom-left-radius',{},'border-radius-c'],['border-bottom-right-radius',{},'border-radius-c'],['border-width',{units:this.unitsSizeNoPerc},'border-radius-c'],['box-shadow-h',{},'text-shadow-h'],['box-shadow-v',{},'text-shadow-h'],['box-shadow-blur',{default:'5px'},'text-shadow-blur'],['box-shadow-spread',{},'text-shadow-h'],['transition-duration',{default:'2s',units:this.unitsTime},'border-radius-c'],['perspective',{},'border-radius-c'],['transform-rotate-x',{functionName:'rotateX',units:this.unitsAngle,default:'0',type:r}],['transform-rotate-y',{functionName:'rotateY'},'transform-rotate-x'],['transform-rotate-z',{functionName:'rotateZ'},'transform-rotate-x'],['transform-scale-x',{default:'1',functionName:'scaleX',units:void 0},'transform-rotate-x'],['transform-scale-y',{functionName:'scaleY'},'transform-scale-x'],['transform-scale-z',{functionName:'scaleZ'},'transform-scale-x'],['order',{type:r,default:'0',requiresParent:n}],['flex-grow',{},'order'],['flex-shrink',{default:'1'},'order'],['float',{type:this.typeRadio,default:'none',options:this.optsFloat}],['position',{default:'static',options:this.optsPos},'float'],['text-align',{default:'left',options:this.optsTextAlign},'float'],['color',{type:this.typeColor,default:'black'}],['text-shadow-color',{},'color'],['border-color',{},'color'],['box-shadow-color',{},'color'],['background-color',{default:'none'},'color'],['background-image',{type:this.typeFile,functionName:'url',default:'none',full:!0}],['opacity',{type:this.typeSlider,default:'1',min:0,max:1,step:.01}],['display',{type:this.typeSelect,default:'block',options:this.opstDisplay}],['flex-direction',{default:'row',options:this.optsDir,requires:n},'display'],['flex-wrap',{default:'nowrap',options:this.optsWrap},'flex-direction'],['justify-content',{default:'flex-start',options:this.optsJustCont},'flex-wrap'],['align-items',{default:'stretch',options:this.optsFlexAlign},'flex-wrap'],['align-content',{options:this.optsAlignCont},'align-items'],['align-self',{default:'auto',options:this.optsAlignSelf,requiresParent:n},'display'],['font-family',{default:'Arial, Helvetica, sans-serif',options:this.optsFonts},'display'],['font-weight',{default:'400',options:this.optsWeight},'display'],['border-style',{default:'solid',options:this.optsBorderStyle},'display'],['box-shadow-type',{default:'',options:this.optsShadowType},'display'],['background-repeat',{default:'repeat',options:this.optsBgRepeat},'display'],['background-position',{default:'left top',options:this.optsBgPos},'display'],['background-attachment',{default:'scroll',options:this.optsBgAttach},'display'],['background-size',{default:'auto',options:this.optsBgSize},'display'],['transition-property',{default:'width',options:this.optsTransitProp},'display'],['transition-timing-function',{default:'ease',options:this.optsTransitFn},'display'],['cursor',{default:'auto',options:this.optsCursor},'display'],['overflow',{default:'visible',options:this.optsOverflow},'display'],['overflow-x',{},'overflow'],['overflow-y',{},'overflow'],['margin',{type:this.typeComposite,properties:this.__sub([{extend:'margin-top',id:'margin-top-sub'},{extend:'margin-right',id:'margin-right-sub'},{extend:'margin-bottom',id:'margin-bottom-sub'},{extend:'margin-left',id:'margin-left-sub'}])}],['padding',{properties:this.__sub([{extend:'padding-top',id:'padding-top-sub'},{extend:'padding-right',id:'padding-right-sub'},{extend:'padding-bottom',id:'padding-bottom-sub'},{extend:'padding-left',id:'padding-left-sub'}])},'margin'],['border',{properties:this.__sub([{extend:'border-width',id:'border-width-sub'},{extend:'border-style',id:'border-style-sub'},{extend:'border-color',id:'border-color-sub'}])},'margin'],['border-radius',{properties:this.__sub([{extend:'border-top-left-radius',id:'border-top-left-radius-sub'},{extend:'border-top-right-radius',id:'border-top-right-radius-sub'},{extend:'border-bottom-right-radius',id:'border-bottom-right-radius-sub'},{extend:'border-bottom-left-radius',id:'border-bottom-left-radius-sub'}])},'margin'],['transform',{properties:this.__sub(['transform-rotate-x','transform-rotate-y','transform-rotate-z','transform-scale-x','transform-scale-y','transform-scale-z'])},'margin'],['transition',{type:this.typeStack,properties:this.__sub([{extend:'transition-property',id:'transition-property-sub'},{extend:'transition-duration',id:'transition-duration-sub'},{extend:'transition-timing-function',id:'transition-timing-function-sub'}])}],['box-shadow',{preview:!0,layerLabel:function(t,e){var n=e.values,r=n['box-shadow-h'],i=n['box-shadow-v'],o=n['box-shadow-blur'],a=n['box-shadow-spread'];return"".concat(r," ").concat(i," ").concat(o," ").concat(a)},properties:this.__sub(['box-shadow-h','box-shadow-v','box-shadow-blur','box-shadow-spread','box-shadow-color','box-shadow-type'])},'transition'],['text-shadow',{default:'none',layerLabel:function(t,e){var n=e.values,r=n['text-shadow-h'],i=n['text-shadow-v'],o=n['text-shadow-blur'];return"".concat(r," ").concat(i," ").concat(o)},properties:this.__sub(['text-shadow-h','text-shadow-v','text-shadow-blur','text-shadow-color'])},'box-shadow'],['background',{detached:!0,layerLabel:function(t,e){var n=e.values,r=n['background-repeat-sub'],i=n['background-position-sub'],o=n['background-attachment-sub'],a=n['background-size-sub'];return"".concat(r," ").concat(i," ").concat(o," ").concat(a)},properties:this.__sub([{extend:'background-image',id:'background-image-sub'},{extend:'background-repeat',id:'background-repeat-sub'},{extend:'background-position',id:'background-position-sub'},{extend:'background-attachment',id:'background-attachment-sub'},{extend:'background-size',id:'background-size-sub'}])},'box-shadow']].forEach((function(e){var n=se()(e,3),r=n[0],i=n[1],o=n[2];t.add(r,i||{},{from:o})})),this}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.from||'',i=this.props[r||t]||{},o=ue(ue({},i),{},{property:t},e);return o.properties&&Object(s["isFunction"])(o.properties)&&(o.properties=o.properties()),this.props[t]=o,o}},{key:"get",value:function(t){return this.props[t]||null}},{key:"build",value:function(t){var e=this,n=[];return(Object(s["isString"])(t)?[t]:t).forEach((function(t){n.push(e.get(t)||{property:t})})),n}}]),t}(),pe=n(20),ge=n.n(pe),ve=n(18);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var ye=function(t){w()(n,t);var e=me(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"template",value:function(t){var e,n=t.pfx,r=t.label,i=null===(e=this.em)||void 0===e?void 0:e.getConfig('icons'),o=(null==i?void 0:i.caret)||'',a="".concat(n,"sector-");return Object(ve["a"])(fe||(fe=ge()(["\n      <div class=\"","title\" data-sector-title>\n        <div class=\"","caret\">$","</div>\n        <div class=\"","label\">","</div>\n      </div>\n    "])),a,a,o,a,r)}},{key:"events",value:function(){return{'click [data-sector-title]':'toggle'}}},{key:"initialize",value:function(t){var e=t.config||{},n=this.model,r=e.em;this.config=e,this.em=r,this.pfx=e.stylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change:open',this.updateOpen),this.listenTo(n,'change:visible',this.updateVisibility)}},{key:"updateOpen",value:function(){var t=this.$el,e=this.model,n=this.pfx,r=e.isOpen();t[r?'addClass':'removeClass']("".concat(n,"open")),this.getPropertiesEl().style.display=r?'':'none'}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"getPropertiesEl",value:function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)}},{key:"toggle",value:function(){var t=this.model;t.setOpen(!t.get('open'))}},{key:"renderProperties",value:function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var r=new rt({collection:n,config:e});this.$el.append(r.render().el)}}},{key:"render",value:function(){var t=this.pfx,e=this.model,n=this.$el,r=e.getId(),i=e.getName();return n.html(this.template({pfx:t,label:i})),this.renderProperties(),n.attr('class',"".concat(t,"sector ").concat(t,"sector__").concat(r," no-select")),this.updateOpen(),this}}]),n}(u["View"]);function be(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var we=function(t){w()(n,t);var e=be(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.module,n=t.config,r=void 0===n?{}:n,i=this.collection;this.pfx=r.stylePrefix||'',this.ppfx=r.pStylePrefix||'',this.config=r,this.module=e,this.listenTo(i,'add',this.addTo),this.listenTo(i,'reset',this.render)}},{key:"remove",value:function(){var t=this;u["View"].prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}}))}},{key:"addTo",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(t,null,n)}},{key:"addToCollection",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config,i=this.el,o=e||i,a=new ye({model:t,config:r}).render().el;return Object(et["b"])(o,a,n.at),a}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx,r=this.ppfx;e.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),e.append(i),e.addClass("".concat(n,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this}}]),n}(u["View"]);function Oe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Oe(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ce='style',ke="".concat(Ce,":"),Se="".concat(ke,"sector"),je="".concat(Se,":add"),Pe="".concat(Se,":remove"),_e="".concat(Se,":update"),Te="".concat(ke,"property"),Ee="".concat(Te,":add"),De="".concat(Te,":remove"),Me="".concat(Te,":update"),Ae="".concat(ke,"layer:select"),Le="".concat(ke,"target"),Re="".concat(ke,"custom"),Ne=function(t){return t||0===t};e["default"]=function(){var t,e,n;return xe(xe({},l["a"]),{},{Sector:ee,events:{all:Ce,sectorAdd:je,sectorRemove:Pe,sectorUpdate:_e,propertyAdd:Ee,propertyRemove:De,propertyUpdate:Me,layerSelect:Ae,target:Le,custom:Re},name:'StyleManager',init:function(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(h,r);var i=this.config,o=i.em,a=i.pStylePrefix;a&&(i.stylePrefix=a+i.stylePrefix),this.builtIn=new de,t=new Xt([],{em:o,module:this}),e=new oe([],xe(xe({},i),{},{module:this}));var c=new u["Model"]({targets:[]});this.model=c,this.__listenAdd(e,je),this.__listenRemove(e,Pe),this.__listenUpdate(e,_e);var l='component:toggled component:update:classes change:state change:device frame:resized selector:type',f=Object(s["debounce"])((function(){return n.__upSel()}));c.listenTo(o,l,f);var d=Object(s["debounce"])((function(){n.__upProps(),n.__trgCustom()}));c.listenTo(o,'styleable:change undo redo',d);var p=Object(s["debounce"])((function(){return n.__trgCustom()}));return c.listenTo(o,"".concat(Ae," ").concat(Le),p),c.on('change:lastTarget',(function(){return o.trigger(Le,n.getSelected())})),this},__upSel:function(){this.select(this.em.getSelectedAll())},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},__trgEv:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.em).trigger.apply(e,[t].concat(r))},onLoad:function(){e.add(this.config.sectors,{silent:!0})},postRender:function(){this.__appendTo()},addSector:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getSector(t);return i||(n.id=t,i=e.add(n,r)),i},getSector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.where({id:t})[0];return!r&&n.warn&&this._logNoSector(t),r||null},getSectors:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e&&e.models?t.array?i()(e.models):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},removeSector:function(t){return this.getSectors().remove(this.getSector(t,{warn:1}))},addProperty:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(t,{warn:1}),i=null;return r&&(i=r.get('properties').add(e,n)),i},getProperty:function(t,e){var n,r=this.getSector(t,{warn:1});return r&&(n=r.get('properties').filter((function(t){return t.get('property')===e||t.get('id')===e}))[0]),n||null},getProperties:function(t){var e=null,n=this.getSector(t,{warn:1});return n&&(e=n.get('properties')),e},removeProperty:function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},select:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=Object(s["isArray"])(t)?t:[t],a=r.stylable,l=i.get('CssComposer'),u=[];o.filter(Boolean).forEach((function(t){var e=t;if(Object(s["isString"])(t)){var n=l.getRule(t)||l.setRule(t);!Object(s["isUndefined"])(a)&&n.set({stylable:a}),e=n}u.push(e)}));var f=r.component||u.filter((function(t){return Object(c["isComponent"])(t)})).reverse()[0];u=u.map((function(t){return n.getModelToStyle(t)}));var h=i.getState(),d=u.slice().reverse()[0],p=this.getParentRules(d,{state:h,component:f}),g=this.__getStateTarget();return e.forEach((function(t){var n=t.getProperties();n.forEach((function(t){var n=t.__checkVisibility({target:d,component:f,sectors:e});t.set('visible',n)}));var r=n.some((function(t){return t.isVisible()}));t.set('visible',r)})),i.skip((function(){var t;if(h&&null!=d&&null!==(t=d.getState)&&void 0!==t&&t.call(d)){var e=d.getStyle();g?g.setStyle(e):g=l.getAll().add({selectors:'gjs-selected',style:e,important:!0})}else g&&(l.remove(g),g=null)})),this.model.set({targets:u,lastTarget:d,lastTargetParents:p,stateTarget:g}),this.__upProps(r),u},getSelected:function(){return this.model.get('lastTarget')||null},getSelectedAll:function(){return this.model.get('targets')},getSelectedParents:function(){return this.model.get('lastTargetParents')||[]},__getStateTarget:function(){return this.model.get('stateTarget')||null},addStyleTargets:function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected(),r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},getBuiltIn:function(t){return this.builtIn.get(t)},getBuiltInAll:function(){return this.builtIn.props},addBuiltIn:function(t,e){return this.builtIn.add(t,e)},getModelToStyle:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=n.skipAdd;if(r&&null!==(e=t)&&void 0!==e&&e.toHTML){var o,a=r.getConfig(),s=r.get('UndoManager'),c=r.get('CssComposer'),l=r.get('SelectorManager'),u=l?l.getConfig():{},f=a.devicePreviewMode?'':r.get('state'),h=t.get('classes'),d=h.getStyleable(),p=d.length,g=!u.componentFirst||n.useClasses,v={noCount:1},m={state:f,addOpts:v};if(s.stop(),p&&g){var y=r.getCurrentMedia();(o=c.get(d,f,y))||i||(o=c.add(d,f,y,{},v))}else if(a.avoidInlineStyle){var b=t.getId();!(o=c.getIdRule(b,m))&&!i&&(o=c.setIdRule(b,{},m)),t.is('wrapper')&&o.set('wrapper',1,v)}o&&(t=o),s.start()}return t},getParentRules:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.component,i=this.em,o=[];if(i&&t){var a=r,c=i.get('CssComposer'),l=i.get('CodeManager').getGenerator('css'),u=t.toHTML?t:t.getComponent(),f={combination:!0,array:!0},h=[],d=[],p=[];u?(h=c.getRules("#".concat(u.getId())),p=(d=a?c.getRules(a.getSelectors().getFullName(f)):[]).concat(h)):(h=a?c.getRules("#".concat(a.getId())):[],d=c.getRules(t.getSelectors().getFullName(f)),p=h.concat(d));var g=p.filter((function(t){return Object(s["isUndefined"])(n)?1:t.get('state')===n})).sort(l.sortRules).reverse();o=g.slice(g.indexOf(t)+1)}return o},addType:function(e,n){t.addType(e,n)},getType:function(e){return t.getType(e)},getTypes:function(){return t.getTypes()},createType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,i=e.view,o=void 0===i?{}:i,a=this.config,s=this.getType(t);if(s)return new s.view(xe({model:new s.model(r),config:a},o))},render:function(){var t=this.config,r=this.em,i=n&&n.el;return(n=new we({el:i,em:r,config:t,collection:e,module:this})).render().el},_logNoSector:function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},__upProps:function(t){var n=this,r=this.getSelected();if(r){var i=this.getSelectedParents(),o=r.getStyle(),a=i.map((function(t){return{target:t,style:t.getStyle()}}));e.map((function(e){e.getProperties().map((function(e){n.__upProp(e,o,a,t)}))}))}},__upProp:function(t,e,n,r){var i=this,o=t.getName(),a=e[o],s=Ne(a),c='stack'===t.getType(),l='composite'===t.getType(),u=xe(xe({},r),{},{__up:!0}),f=!l&&!c,h=c?t.__getLayersFromStyle(e):[],d=l?t.__getPropsFromStyle(e):{},p=s?a:null,g=null;if(c&&null===h||l&&null===d){var v=c?'__getLayersFromStyle':'__getPropsFromStyle',m=n.filter((function(e){return null!==t[v](e.style)}))[0];if(m){p=m.style[o],g=m.target;var y=t[v](m.style);c?h=y:d=y}}else if(!s){p=null;var b=n.filter((function(t){return Ne(t.style[o])}))[0];b&&(p=b.style[o],g=b.target)}if(t.__setParentTarget(g),f&&t.__getFullValue()!==p&&t.upValue(p,u),c&&t.__setLayers(h||[]),l){var w=t.getProperties();if(t.isDetached()){var O=t.__getPropsFromStyle(e,{byName:!0})||{},x=n.map((function(e){return xe(xe({},e),{},{style:t.__getPropsFromStyle(e.style,{byName:!0})||{}})}));w.map((function(t){return i.__upProp(t,O,x,r)}))}else t.__setProperties(d||{},u),t.getProperties().map((function(t){return t.__setParentTarget(g)}))}},destroy:function(){[t,e].forEach((function(t){t.reset(),t.stopListening()})),n&&n.remove(),[t,e,n].forEach((function(t){return{}})),this.em={},this.config={}}})}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a=n(19),s={stylePrefix:'gjs-',components:'',style:'',fromElement:0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:'900px',width:'100%',log:['warning','error'],baseCss:"\n    * {\n      box-sizing: border-box;\n    }\n    html, body, [data-gjs-type=wrapper] {\n      min-height: 100%;\n    }\n    body {\n      margin: 0;\n      height: 100%;\n      background-color: #fff\n    }\n    [data-gjs-type=wrapper] {\n      overflow: auto;\n      overflow-x: hidden;\n    }\n\n    * ::-webkit-scrollbar-track {\n      background: rgba(0, 0, 0, 0.1)\n    }\n\n    * ::-webkit-scrollbar-thumb {\n      background: rgba(255, 255, 255, 0.2)\n    }\n\n    * ::-webkit-scrollbar {\n      width: 10px\n    }\n  ",protectedCss:'* { box-sizing: border-box; } body {margin: 0;}',canvasCss:'',defaultCommand:'select-comp',showToolbar:1,allowScripts:0,showDevices:1,devicePreviewMode:0,mediaCondition:'max-width',tagVarStart:'{[ ',tagVarEnd:' ]}',keepEmptyTextNodes:0,jsInHtml:!0,nativeDnD:1,multipleSelection:1,exportWrapper:0,wrapperIsBody:1,optsHtml:{},optsCss:{},avoidInlineStyle:1,avoidDefaults:1,clearStyles:0,dragMode:0,listenToEl:[],cssIcons:'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',icons:{close:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',move:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',plus:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',caret:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>'},el:'',i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:0,multiFrames:0,customUI:!1},c=n(16),l=n.n(c),u=n(3),f=n.n(u),h=n(1),d=n(6),p=n.n(d),g=n(5),v=n.n(g),m=n(7),y=n.n(m),b=n(8),w=n.n(b),O=n(4),x=n.n(O);function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=x()(t);if(e){var i=x()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w()(this,n)}}var k=function(t){y()(n,t);var e=C(n);function n(){return v()(this,n),e.apply(this,arguments)}return n}(u["Model"]),S=function(t){y()(n,t);var e=C(n);function n(){return v()(this,n),e.apply(this,arguments)}return p()(n,[{key:"getByComponent",value:function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]}},{key:"addComponent",value:function(t,e){var n=this,r=(Object(o["isArray"])(t)?t:[t]).filter((function(t){return!n.hasComponent(t)})).map((function(t){return{component:t}}));return this.push(r,e)}},{key:"getComponent",value:function(t){return t.get('component')}},{key:"hasComponent",value:function(t){var e=this.getByComponent(t);return e&&this.contains(e)}},{key:"lastComponent",value:function(){var t=this.last();return t&&this.getComponent(t)}},{key:"allComponents",value:function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))}},{key:"removeComponent",value:function(t,e){var n=this,r=(Object(o["isArray"])(t)?t:[t]).map((function(t){return n.getByComponent(t)}));return this.remove(r,e)}}]),n}(u["Collection"]);S.prototype.model=k;var j=["unset"];function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}f.a.$=a["default"];var T,E,D=[n(112),n(113),n(116),n(81),n(108),n(106),n(109),n(98),n(107),n(110),n(105),n(103),n(114),n(100),n(111),n(45),n(101),n(97),n(115),n(104),n(117),n(102)];!function(t){var e=t.$;if(e&&e.prototype&&'jQuery'!==e.prototype.constructor.name){var n=e.fn;n.hide=function(){return this.css('display','none')},n.show=function(){return this.css('display','block')},n.focus=function(){var t=this.get(0);return t&&t.focus(),this},n.bind=function(t,e){return this.on(t,e)},n.unbind=function(t,e){if(Object(o["isObject"])(t)){for(var n in t)t.hasOwnProperty(n)&&this.off(n,t[n]);return this}return this.off(t,e)},n.click=function(t){return t?this.on('click',t):this.trigger('click')},n.change=function(t){return t?this.on('change',t):this.trigger('change')},n.keydown=function(t){return t?this.on('keydown',t):this.trigger('keydown')},n.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,(function(t){t.data=n,r(t)}))},n.scrollLeft=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageXOffset:t.scrollLeft||0},n.scrollTop=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageYOffset:t.scrollTop||0};var r=e.prototype.offset;n.offset=function(t){var e,n;return t&&(e=t.top,n=t.left),void 0!==e&&this.css('top',"".concat(e,"px")),void 0!==n&&this.css('left',"".concat(n,"px")),r.call(this)},e.map=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n};var i=Array.prototype.indexOf;e.inArray=function(t,e,n){return null==e?-1:i.call(e,t,n)},e.Event=function(t,n){if(!(this instanceof e.Event))return new e.Event(t,n);this.type=t,this.isDefaultPrevented=function(){return!1}}}}({Backbone:f.a,$:f.a.$});var M={debug:console.log,info:console.info,warning:console.warn,error:console.error},A=f.a.Model.extend({defaults:function(){return{editing:0,selected:0,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:''}},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e,this.set('Config',e),this.set('modules',[]),this.set('toLoad',[]),this.set('storables',[]),this.set('selected',new S),this.set('dmode',e.dragMode),this.set('hasPages',!!e.pageManager);var n=e.el,r=e.log,i=!0===r?Object(o["keys"])(M):Object(o["isArray"])(r)?r:[];Object(o["bindAll"])(this,'initBaseColorPicker'),n&&e.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?Object(o["toArray"])(n.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):'',D.forEach((function(e){return t.loadModule(e)})),this.on('change:componentHovered',this.componentHovered,this),this.on('change:changesCount',this.updateChanges,this),this.on('change:readyLoad change:readyCanvas',this._checkReady,this),i.forEach((function(e){return t.listenLog(e)})),[{from:'change:selectedComponent',to:'component:toggled'}].forEach((function(e){var n=e.from,r=e.to;t.listenTo(t,n,(function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];t.trigger.apply(t,[r].concat(i)),t.logWarning("The event '".concat(n,"' is deprecated, replace it with '").concat(r,"'"))}))}))},_checkReady:function(){this.get('readyLoad')&&this.get('readyCanvas')&&!this.get('ready')&&this.set('ready',!0)},getContainer:function(){return this.config.el},listenLog:function(t){this.listenTo(this,"log:".concat(t),M[t])},getConfig:function(t){var e=this.config;return Object(o["isUndefined"])(t)?e:e[t]},loadOnStart:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this.get('StorageManager');this.get('toLoad').forEach((function(t){t.onLoad()}));var r=function(){t.get('modules').forEach((function(e){return e.postLoad&&e.postLoad(t)})),t.set('readyLoad',1),e&&e()};n&&n.canAutoload()?this.load(r):setTimeout(r)},updateChanges:function(){var t=this,e=this.get('StorageManager'),n=this.get('changesCount');E&&clearTimeout(E),E=setTimeout((function(){return t.trigger('update')})),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(t){return 1}:null),e.isAutosave()&&n>=e.getStepsBeforeSave()&&this.store()},loadModule:function(t){var e=this.config,n=new(t.default||t),r=n.name.charAt(0).toLowerCase()+n.name.slice(1),i=Object(o["isUndefined"])(e[r])?e[n.name]:e[r],a=!0===i?{}:i||{},s=this.get('StorageManager');if(a.pStylePrefix=e.pStylePrefix||'',Object(o["isUndefined"])(i)||i||(a._disable=1),n.storageKey&&n.store&&n.load&&s){a.stm=s;var c='domComponents'==r?'unshift':'push';this.get('storables')[c](n)}return a.em=this,n.init(_({},a)),!n.private&&this.set(n.name,n),n.onLoad&&this.get('toLoad').push(n),this.get('modules').push(n),this},init:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.destroyed&&(this.initialize(e),this.destroyed=0),this.set('Editor',t)},getEditor:function(){return this.get('Editor')},handleUpdates:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.__skip||r.temporary||r.noCount||r.avoidStore||!this.get('ready')||(T&&clearTimeout(T),T=setTimeout((function(){var t=n.get('changesCount')||0,e=(r.unset,l()(r,j));n.set('changesCount',t+1,e)}),0))},changesUp:function(t){this.handleUpdates(0,0,t)},componentHovered:function(t,e,n){var r=this.previous('componentHovered');r&&this.trigger('component:unhovered',r,n),e&&this.trigger('component:hovered',e,n)},getSelected:function(){return this.get('selected').lastComponent()},getSelectedAll:function(){return this.get('selected').allComponents()},setSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.event,i=r&&(r.ctrlKey||r.metaKey),s=r||{},c=s.shiftKey,l=Object(o["isArray"])(t),u=(l?t:[t]).map((function(t){return Object(h["getModel"])(t,a["default"])})),f=this.getSelectedAll(),d=this.getConfig('multipleSelection');l&&this.removeSelected(f.filter((function(t){return!Object(o["contains"])(u,t)}))),u.forEach((function(t){var r=Object(h["getModel"])(t,a["default"]);if(!r||r.get('selectable')){if(i&&d)return e.toggleSelected(r);if(c&&d){e.clearSelection(e.get('Canvas').getWindow());var s,u,p=r.collection,g=r.index();if(e.getSelectedAll().forEach((function(t){var e=t.collection,n=t.index();e===p&&(n<g?s=Object(o["isUndefined"])(s)?n:Math.max(s,n):n>g&&(u=Object(o["isUndefined"])(u)?n:Math.min(u,n)))})),!Object(o["isUndefined"])(s))for(;s!==g;)e.addSelected(p.at(s)),s++;if(!Object(o["isUndefined"])(u))for(;u!==g;)e.addSelected(p.at(u)),u--;return e.addSelected(r)}!l&&e.removeSelected(f.filter((function(t){return t!==r}))),e.addSelected(r,n),r}}))},addSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h["getModel"])(t,a["default"]),i=Object(o["isArray"])(r)?r:[r];i.forEach((function(t){if(!t||t.get('selectable')){var r=e.get('selected');n.forceChange&&e.removeSelected(t,n),r.addComponent(t,n)}}))},removeSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get('selected').removeComponent(Object(h["getModel"])(t,a["default"]),e)},toggleSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h["getModel"])(t,a["default"]),i=Object(o["isArray"])(r)?r:[r];i.forEach((function(t){e.get('selected').hasComponent(t)?e.removeSelected(t,n):e.addSelected(t,n)}))},setHovered:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(h["getModel"])(t,a["default"]);n&&!n.get('hoverable')||(e.forceChange&&this.set('componentHovered',''),this.set('componentHovered',n,e))},getHovered:function(){return this.get('componentHovered')},setComponents:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.get('DomComponents').setComponents(t,e)},getComponents:function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},setStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStyle().add(t,e);return Object(o["isArray"])(n)?n:[n]},getStyle:function(){return this.get('CssComposer').getAll()},setState:function(t){return this.set('state',t),this},getState:function(){return this.get('state')||''},getHtml:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.optsHtml,r=e.exportWrapper,i=e.wrapperIsBody,o=e.jsInHtml?this.getJs(t):'',a=t.component||this.get('DomComponents').getComponent(),s=a?this.get('CodeManager').getCode(a,'html',_(_({exportWrapper:r,wrapperIsBody:i},n),t)):'';return s+=o?"<script>".concat(o,"<\/script>"):''},getCss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.optsCss,r=e.wrapperIsBody,i=t.avoidProtected,a=Object(o["isUndefined"])(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,s=this.get('CssComposer'),c=t.component||this.get('DomComponents').getComponent(),l=i?'':e.protectedCss,u=c&&this.get('CodeManager').getCode(c,'css',_(_({cssc:s,wrapperIsBody:r,keepUnusedStyles:a},n),t));return c?t.json?u:l+u:''},getJs:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.component||this.get('DomComponents').getWrapper();return e?this.get('CodeManager').getCode(e,'js').trim():''},store:function(t){var e=this,n=this.get('StorageManager');if(n){var r=this.storeData();return n.store(r,(function(n){t&&t(n,r),e.set('changesCount',0),e.trigger('storage:store',r)})),r}},storeData:function(){var t={},e=this.getEditing();return e&&e.trigger('sync:content',{noCount:!0}),this.get('storables').forEach((function(e){t=_(_({},t),e.store(1))})),t},load:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,(function(n){t.loadData(n),e&&e(n)}))},loadData:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.get('StorageManager'),r=n.__clearKeys(e);return this.get('storables').forEach((function(e){e.load(r),e.postLoad&&e.postLoad(t)})),r},getCacheLoad:function(t,e){var n=this;if(this.cacheLoad&&!t)return this.cacheLoad;var r=this.get('StorageManager'),i=[];if(!r)return{};this.get('storables').forEach((function(t){var e=t.storageKey;e=Object(o["isFunction"])(e)?e():e,(Object(o["isArray"])(e)?e:[e]).forEach((function(t){return i.push(t)}))})),r.load(i,(function(t){n.cacheLoad=t,e&&e(t),setTimeout((function(){return n.trigger('storage:load',t)}))}))},getDeviceModel:function(){var t=this.get('device');return this.get('DeviceManager').get(t)},runDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('Commands').get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=1)},stopDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('Commands'),n=e.get(this.config.defaultCommand);n&&this.defaultRunning&&(n.stop(this,this,t),this.defaultRunning=0)},refreshCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set('canvasOffset',null),this.set('canvasOffset',this.get('Canvas').getOffset()),t.tools&&this.trigger('canvas:updateTools')},clearSelection:function(t){(t||window).getSelection().removeAllRanges()},getCurrentMedia:function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,r=t.devicePreviewMode,i=e&&e.get('widthMedia');return e&&i&&!r?"(".concat(n,": ").concat(i,")"):''},getWrapper:function(){return this.get('DomComponents').getWrapper()},setCurrentFrame:function(t){return this.set('currentFrame',t)},getCurrentFrame:function(){return this.get('currentFrame')},getCurrentFrameModel:function(){return(this.getCurrentFrame()||{}).model},getDirtyCount:function(){return this.get('changesCount')},getZoomDecimal:function(){return this.get('Canvas').getZoomDecimal()},getZoomMultiplier:function(){return this.get('Canvas').getZoomMultiplier()},setDragMode:function(t){return this.set('dmode',t)},t:function(){for(var t=this.get('I18n'),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t?void 0:t.t.apply(t,n)},inAbsoluteMode:function(){return'absolute'===this.get('dmode')},destroyAll:function(){var t=this,e=this.config,n=this.view,r=this.getEditor(),i=(e.grapesjs||{}).editors,o=void 0===i?[]:i;this.stopListening(),this.stopDefault(),this.get('modules').slice().reverse().forEach((function(t){return t.destroy()})),n&&n.remove(),this.clear({silent:!0}),this.destroyed=1,['config','view','_previousAttributes','_events','_listeners'].forEach((function(e){return t[e]={}})),o.splice(o.indexOf(r),1),Object(h["hasWin"])()&&Object(a["default"])(e.el).empty().attr(this.attrsOrig)},getEditing:function(){var t=this.get('editing');return t&&t.model||null},setEditing:function(t){return this.set('editing',t),this},isEditing:function(){return!!this.get('editing')},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.ns,r=e.level,i=void 0===r?'debug':r;if(this.trigger('log',t,e),i&&this.trigger("log:".concat(i),t,e),n){var o="log-".concat(n);this.trigger(o,t,e),i&&this.trigger("".concat(o,":").concat(i),t,e)}},logInfo:function(t,e){this.log(t,_(_({},e),{},{level:'info'}))},logWarning:function(t,e){this.log(t,_(_({},e),{},{level:'warning'}))},logError:function(t,e){this.log(t,_(_({},e),{},{level:'error'}))},initBaseColorPicker:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getConfig(),r=n.colorPicker,i=void 0===r?{}:r,o=n.el,s=n.stylePrefix;return Object(a["default"])(t).spectrum(_(_({containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:o||'body',maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:'Ok',cancelText:'⨯'},e),i))},skip:function(t){this.__skip=!0;var e=this.get('UndoManager');e?e.skip(t):t(),this.__skip=!1},data:function(t,e,n){var r='_gjs-data';if(t[r]||(t[r]={}),Object(o["isUndefined"])(n))return t[r][e];t[r][e]=n}}),L=f.a.$,R=f.a.View.extend({initialize:function(){var t=this,e=this.model;e.view=this,this.conf=e.config,this.pn=e.get('Panels'),this.cv=e.get('Canvas'),e.once('change:ready',(function(){t.pn.active(),t.pn.disableButtons(),setTimeout((function(){e.trigger('load',e.get('Editor')),e.set('changesCount',0)}))}))},render:function(){this.model;var t=this.$el,e=this.conf,n=e.stylePrefix,r=L(e.el||"body ".concat(e.container));return Object(h["appendStyles"])(e.cssIcons,{unique:1,prepand:1}),t.empty(),e.width&&r.css('width',e.width),e.height&&r.css('height',e.height),t.append(this.cv.render()),t.append(this.pn.render()),t.attr('class',"".concat(n,"editor ").concat(n,"one-bg ").concat(n,"two-color")),r.addClass("".concat(n,"editor-cont")).empty().append(t),this}}),N=n(18);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.$,r=F(F({},s),t);r.pStylePrefix=r.stylePrefix;var i,o=new A(r);return{$:n,editor:o,init:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o.init(this,F(F({},r),e)),['I18n','Utils','Config','Commands','Keymaps','Modal','Panels','Canvas','Parser','CodeManager','UndoManager','RichTextEditor',['Pages','PageManager'],'DomComponents',['Components','DomComponents'],'LayerManager',['Layers','LayerManager'],'CssComposer',['Css','CssComposer'],'StorageManager',['Storage','StorageManager'],'AssetManager',['Assets','AssetManager'],'BlockManager',['Blocks','BlockManager'],'TraitManager',['Traits','TraitManager'],'SelectorManager',['Selectors','SelectorManager'],'StyleManager',['Styles','StyleManager'],'DeviceManager',['Devices','DeviceManager']].forEach((function(e){Array.isArray(e)?t[e[0]]=o.get(e[1]):t[e]=o.get(e)})),o.once('change:ready',(function(){t.UndoManager.clear(),o.get('modules').forEach((function(t){t.postRender&&t.postRender(i)}))})),this},getConfig:function(t){return o.getConfig(t)},getHtml:function(t){return o.getHtml(t)},getCss:function(t){return o.getCss(t)},getJs:function(t){return o.getJs(t)},getComponents:function(){return o.get('DomComponents').getComponents()},getWrapper:function(){return o.get('DomComponents').getWrapper()},setComponents:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.setComponents(t,e),this},addComponents:function(t,e){return this.getWrapper().append(t,e)},getStyle:function(){return o.get('CssComposer').getAll()},setStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.setStyle(t,e),this},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.addStyle(t,e)},getSelected:function(){return o.getSelected()},getSelectedAll:function(){return o.getSelectedAll()},getSelectedToStyle:function(){var t=o.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},select:function(t,e){return o.setSelected(t,e),this},selectAdd:function(t){return o.addSelected(t),this},selectRemove:function(t){return o.removeSelected(t),this},selectToggle:function(t){return o.toggleSelected(t),this},getEditing:function(){return o.getEditing()},setDevice:function(t){return o.set('device',t),this},getDevice:function(){return o.get('device')},runCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.get('Commands').run(t,e)},stopCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.get('Commands').stop(t,e)},store:function(t){return o.store(t)},storeData:function(){return o.storeData()},load:function(t){return o.load(t)},loadData:function(t){return o.loadData(t)},getContainer:function(){return r.el},getDirtyCount:function(){return o.getDirtyCount()},refresh:function(t){o.refreshCanvas(t)},setCustomRte:function(t){this.RichTextEditor.customRte=t},setCustomParserCss:function(t){return this.Parser.getConfig().parserCss=t,this},setDragMode:function(t){return o.setDragMode(t),this},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.log(t,e),this},t:function(){return o.t.apply(o,arguments)},on:function(t,e){return o.on(t,e),this},once:function(t,e){return o.once(t,e),this},off:function(t,e){return o.off(t,e),this},trigger:function(t){return o.trigger.apply(o,arguments),this},destroy:function(){return o.destroyAll()},getEl:function(){return i&&i.el},getModel:function(){return o},render:function(){return i&&i.remove(),(i=new R({model:o,config:r})).render().el},onReady:function(t){o.get('ready')?t(this):o.on('load',t)},html:N["a"]}},B={plugins:[]};function z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function H(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}!function(){if(Object(h["hasWin"])()&&function(){for(var t,e=window.navigator.userAgent,n=[['edge',/Edge\/([0-9\._]+)/],['ie',/MSIE\s(7\.0)/],['ie',/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],['ie',/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r<n.length;r++){if(t=n[r][1].exec(e))break}return!!t}()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=''),t.apply(document.implementation,[e])}}}();var U=new function(t){var e=t||{};for(var n in B)n in e||(e[n]=B[n]);var r={};return{add:function(t,e){return r[t]?r[t]:(r[t]=e,e)},get:function(t){return r[t]},getAll:function(){return r}}},W=[],$={autorender:1,plugins:[],pluginsOpts:{}};e["default"]={$:a["default"],editors:W,plugins:U,version:'0.18.1',init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t,n=e.headless,r=t.container;if(!r&&!n)throw new Error("'container' is required");(t=H(H(H({},$),t),{},{grapesjs:this})).el=!n&&(Object(o["isElement"])(r)?r:document.querySelector(r));var i=new V(t,{$:a["default"]}).init(),s=i.getModel();return t.plugins.forEach((function(e){var n=Object(o["isFunction"])(e)?e:U.get(e),r=t.pluginsOpts[e]||{};if(!n){var a=Object(h["getGlobal"])()[e];n=(null==a?void 0:a.default)||a}n?n(i,r):Object(o["isFunction"])(e)?e(i,r):s.logWarning("Plugin ".concat(e," not found"),{context:'plugins',plugin:e})})),s.loadOnStart(),t.autorender&&!n&&i.render(),W.push(i),i}}},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return q})),n.d(e,"evPfx",(function(){return G})),n.d(e,"evSelect",(function(){return K})),n.d(e,"evUpdate",(function(){return Y})),n.d(e,"evAdd",(function(){return X})),n.d(e,"evRemove",(function(){return J})),n.d(e,"evRemoveBefore",(function(){return Z})),n.d(e,"evCustom",(function(){return Q})),n.d(e,"evOpen",(function(){return tt})),n.d(e,"evClose",(function(){return et})),n.d(e,"evUpload",(function(){return nt})),n.d(e,"evUploadStart",(function(){return rt})),n.d(e,"evUploadEnd",(function(){return it})),n.d(e,"evUploadError",(function(){return ot})),n.d(e,"evUploadRes",(function(){return at}));var r=n(2),i=n.n(r),o=n(0),a=n(22),s={assets:[],noAssets:'',stylePrefix:'am-',upload:0,uploadName:'files',headers:{},params:{},credentials:'include',multiUpload:!0,autoAdd:!0,customFetch:null,uploadFile:null,embedAsBase64:!0,handleAdd:null,beforeUpload:null,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:1,dropzoneContent:''},c=n(3),l=n.n(c),u=n(5),f=n.n(u),h=n(6),d=n.n(h),p=n(7),g=n.n(p),v=n(8),m=n.n(v),y=n(4),b=n.n(y);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var O=function(t){g()(n,t);var e=w(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return{type:'',src:''}}},{key:"getType",value:function(){return this.get('type')}},{key:"getSrc",value:function(){return this.get('src')}},{key:"getFilename",value:function(){return this.get('src').split('/').pop().split('?').shift()}},{key:"getExtension",value:function(){return this.getFilename().split('.').pop()}}]),n}(c["Model"]);function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}O.prototype.idAttribute='src',O.getDefaults=function(){return Object(o["result"])(this.prototype,'defaults')};var S,j,P,_=function(t){g()(n,t);var e=k(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return C(C({},O.getDefaults()),{},{type:'image',unitDim:'px',height:0,width:0})}}]),n}(O),T=n(20),E=n.n(T),D=l.a.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,this.collection=t.collection;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.em=e.em,this.className=this.pfx+'asset',this.listenTo(this.model,'destroy remove',this.remove),this.model.view=this;var n=this.init&&this.init.bind(this);n&&n(t)},__getBhv:function(){var t=this.em,e=t&&t.get('AssetManager');return e&&e.__getBehaviour()||{}},template:function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"preview-cont\">\n        ").concat(this.getPreview(),"\n      </div>\n      <div class=\"").concat(t,"meta\">\n        ").concat(this.getInfo(),"\n      </div>\n      <div class=\"").concat(t,"close\" data-toggle=\"asset-remove\">\n        &Cross;\n      </div>\n    ")},updateTarget:function(t){t&&t.set&&(t.set('attributes',Object(o["clone"])(t.get('attributes'))),t.set('src',this.model.get('src')))},getPreview:function(){return''},getInfo:function(){return''},render:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}}),M=n(18),A=D.extend({events:{'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'},getPreview:function(){var t=this.pfx,e=this.ppfx,n=this.model.get('src');return Object(M["a"])(S||(S=E()(["\n      <div class=\"","preview\" style=\"background-image: url('","');\"></div>\n      <div class=\"","preview-bg ","checker-bg\"></div>\n    "])),t,n,t,e)},getInfo:function(){var t=this.pfx,e=this.model,n=e.get('name'),r=e.get('width'),i=e.get('height'),o=e.get('unitDim'),a=r&&i?"".concat(r,"x").concat(i).concat(o):'';return n=n||e.getFilename(),Object(M["a"])(j||(j=E()(["\n      <div class=\"","name\">","</div>\n      <div class=\"","dimensions\">","</div>\n    "])),t,n,t,a)},init:function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},onClick:function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,r=this.config.onClick,i=this.collection;i.trigger('deselectAll'),this.$el.addClass(e+'highlight'),Object(o["isFunction"])(n)?n(t,!1):Object(o["isFunction"])(r)?r(t):this.updateTarget(i.target)},onDblClick:function(){var t=this.em,e=this.model,n=this.__getBhv().select,r=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;Object(o["isFunction"])(n)?n(e,!0):Object(o["isFunction"])(r)?r(e):(this.updateTarget(a),t&&t.get('Modal').close()),Object(o["isFunction"])(s)&&s(e)},onRemove:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}}),L=n(37),R=l.a.Collection.extend(L["a"]).extend({types:[{id:'image',model:_,view:A,isType:function(t){return'string'==typeof t?{type:'image',src:t}:t}}]}),N=n(16),I=n.n(N),F=["pfx","ppfx","em"],V=l.a.View.extend({events:{submit:'handleSubmit'},template:function(t){var e=t.pfx,n=t.ppfx,r=t.em,i=(I()(t,F),'');return this.config.showUrlInput&&(i="\n          <form class=\"".concat(e,"add-asset\">\n            <div class=\"").concat(n,"field ").concat(e,"add-field\">\n              <input placeholder=\"").concat(r&&r.t('assetManager.inputPlh'),"\"/>\n            </div>\n            <button class=\"").concat(n,"btn-prim\">").concat(r&&r.t('assetManager.addButton'),"</button>\n            <div style=\"clear:both\"></div>\n          </form>\n      ")),"\n    <div class=\"".concat(e,"assets-cont\">\n      <div class=\"").concat(e,"assets-header\">\n        ").concat(i,"\n      </div>\n      <div class=\"").concat(e,"assets\" data-el=\"assets\"></div>\n      <div style=\"clear:both\"></div>\n    </div>\n    ")},initialize:function(t){this.options=t,this.config=t.config,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.em=this.config.em;var e=this.collection;this.listenTo(e,'reset',this.renderAssets),this.listenTo(e,'add',this.addToAsset),this.listenTo(e,'remove',this.removedAsset),this.listenTo(e,'deselectAll',this.deselectAll)},handleSubmit:function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;n&&(e.value='',this.getAssetsEl().scrollTop=0,r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0}))},getAssetsEl:function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},getAddInput:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},removedAsset:function(t){this.collection.length||this.toggleNoAssets()},addToAsset:function(t){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(t)},addAsset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.collection,i=this.config,o=new t.typeView({model:t,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var a=this.getAssetsEl();a&&a.insertBefore(o,a.firstChild)}return o},toggleNoAssets:function(t){var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},deselectAll:function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},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)},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}}),B=n(36);function z(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var U=l.a.View.extend({template:function(t){var e=t.pfx,n=t.title,r=t.uploadId,i=t.disabled,o=t.multiUpload;return Object(M["a"])(P||(P=E()(["\n        <form>\n          <div id=\"","title\">","</div>\n          <input\n            type=\"file\"\n            id=\"","\"\n            name=\"file\"\n            accept=\"*/*\"\n            ","\n            ","\n          />\n          <div style=\"clear:both;\"></div>\n        </form>\n      "])),e,n,r,i?'disabled':'',o?'multiple':'')},events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.module=t.module,this.config=e,this.em=this.config.em,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.target=this.options.globalCollection||{},this.uploadId=this.pfx+'uploadFile',this.disabled=void 0!==e.disableUpload?e.disableUpload:!e.upload&&!e.embedAsBase64,this.multiUpload=void 0===e.multiUpload||e.multiUpload,this.events['change #'+this.uploadId]='uploadFile';var n=e.uploadFile;n?this.uploadFile=n.bind(this):!e.upload&&e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var t=this.module;t&&t.__propEv('asset:upload:start')},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('')},onUploadError:function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv('asset:upload:error',t)},onUploadResponse:function(t,e){var n,r=this.module,i=this.config,o=this.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}r&&r.__propEv('asset:upload:response',n),i.autoAdd&&o&&o.add(n.data,{at:0}),this.onUploadEnd(t),e&&e(n)},uploadFile:function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i=this.config,o=i.beforeUpload;if(!1!==(o&&o(r))){var a=new FormData,s=i.params,c=i.customFetch;for(var l in s)a.append(l,s[l]);if(this.multiUpload)for(var u=0;u<r.length;u++)a.append("".concat(i.uploadName,"[]"),r[u]);else r.length&&a.append(i.uploadName,r[0]);this.target;var f=i.upload,h=i.headers,d='X-Requested-With';if(void 0===h[d]&&(h[d]='XMLHttpRequest'),f){this.onUploadStart();var p={method:'post',credentials:i.credentials||'include',headers:h,body:a};return(c?c(f,p):Object(B["a"])(f,p).then((function(t){return 1==(t.status/200|0)?t.text():t.text().then((function(t){return Promise.reject(t)}))}))).then((function(t){return n.onUploadResponse(t,e)})).catch((function(t){return n.onUploadError(t)}))}}},initDrop:function(){var t=this;if(!this.uploadForm&&(this.uploadForm=this.$el.find('form').get(0),'draggable'in this.uploadForm)){this.uploadFile;this.uploadForm.ondragover=function(){return this.className=t.pfx+'hover',!1},this.uploadForm.ondragleave=function(){return this.className='',!1},this.uploadForm.ondrop=function(e){this.className='',e.preventDefault(),t.uploadFile(e)}}},initDropzone:function(t){var e=this,n=0,r=this.config,i=t.model,o=t.el,a=i.get('Editor'),s=(i.get('Config').el,i.get('Canvas').getBody()),c=this.ppfx,l="".concat(c,"dropzone-active"),u="".concat(c,"dropzone"),f=function(){o.className=o.className.replace(l,'').trim(),n=0},h=function(){return n||(o.className+=" ".concat(l),n=1),!1},d=function(){return f(),!1},p=function(t){if(f(),t.preventDefault(),t.stopPropagation(),e.uploadFile(t),r.openAssetsOnDrop&&a){var n=a.getSelected();a.runCommand('open-assets',{target:n,onSelect:function(){a.Modal.close(),a.AssetManager.setTarget(null)}})}return!1};t.$el.append("<div class=\"".concat(u,"\">").concat(r.dropzoneContent,"</div>")),f(),'draggable'in o&&[o,s].forEach((function(t){t.ondragover=h,t.ondragleave=d,t.ondrop=p}))},render:function(){var t=this.$el,e=this.pfx,n=this.em;return t.html(this.template({title:n&&n.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:e})),this.initDrop(),t.attr('class',e+'file-uploader'),this}},{embedAsBase64:function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i={data:[]};if(FileReader){var o,a=[],s=/^(.+)\/(.+)$/,c=z(r);try{var l=function(){var t=o.value,e=new Promise((function(e,n){var r=new FileReader;r.addEventListener('load',(function(i){var o,a=t.name,c=s.exec(t.type);if('image'===(o=c?c[1]:t.type)){var l={src:r.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener('error',(function(t){n(t)})),u.addEventListener('load',(function(){l.height=u.height,l.width=u.width,e(l)})),u.src=l.src}else e(o?{src:r.result,name:a,type:o}:r.result)})),r.addEventListener('error',(function(t){n(t)})),r.addEventListener('abort',(function(t){n('Aborted')})),r.readAsDataURL(t)}));a.push(e)};for(c.s();!(o=c.n()).done;)l()}catch(t){c.e(t)}finally{c.f()}Promise.all(a).then((function(t){i.data=t,n.onUploadResponse(i,e)}),(function(t){n.onUploadError(t)}))}else this.onUploadError(new Error('Unsupported platform, FileReader is not defined'))}});function W(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?W(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var q='asset',G="".concat(q,":"),K="".concat(G,"select"),Y="".concat(G,"update"),X="".concat(G,"add"),J="".concat(G,"remove"),Z="".concat(J,":before"),Q="".concat(G,"custom"),tt="".concat(G,"open"),et="".concat(G,"close"),nt="".concat(G,"upload"),rt="".concat(nt,":start"),it="".concat(nt,":end"),ot="".concat(nt,":error"),at="".concat(nt,":response");e["default"]=function(){var t,e,n,r,i={},c='open-assets';return $($({},a["a"]),{},{name:'AssetManager',storageKey:'assets',Asset:R,Assets:R,events:{all:q,select:K,update:Y,add:X,remove:J,removeBefore:Z,custom:Q,open:tt,close:et,uploadStart:rt,uploadEnd:it,uploadError:ot,uploadResponse:at},init:function(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(i=$($({},s),r)).pStylePrefix,a=i,c=a.em;return this.config=i,this.em=c,o&&(i.stylePrefix=o+i.stylePrefix),t=new R([]),e=new R([]),this.all=t,this.__initListen(),t.on('add',(function(t){return n.getAllVisible().add(t)})),t.on('remove',(function(t){return n.getAllVisible().remove(t)})),this},__propEv:function(t){for(var e,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e=this.em).trigger.apply(e,[t].concat(i)),(n=this.getAll()).trigger.apply(n,[t].concat(i))},__onAllEvent:Object(o["debounce"])((function(){this.__trgCustom()})),__trgCustom:function(){(this.__getBehaviour().container||this.getConfig('custom').open)&&this.em.trigger(this.events.custom,this.__customData())},__customData:function(){var t=this,e=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:e.types||[],container:e.container,close:function(){return t.close()},remove:function(){return t.remove.apply(t,arguments)},select:function(n,r){var i=t.add(n);Object(o["isFunction"])(e.select)&&e.select(i,r)},options:e.options||{}}},open:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em.get('Commands');e.run(c,$({types:['image'],select:function(){}},t))},close:function(){this.em.get('Commands').stop(c)},isOpen:function(){var t=this.em.get('Commands');return!(!t||!t.isActive(c))},add:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===n.at&&(n.at=0),t.add(e,n)},get:function(e){return t.where({src:e})[0]||null},getAll:function(){return t},getAllVisible:function(){return e},remove:function(t,e){return this.__remove(t,e)},store:function(t){var e={},n=JSON.stringify(this.getAll().toJSON());return e[this.storageKey]=n,!t&&i.stm&&i.stm.store(e),e},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.storageKey,n=t[e]||[];if('string'==typeof n)try{n=JSON.parse(t[e])}catch(t){}return n&&n.length&&this.getAll().reset(n),n},getContainer:function(){return this.__getBehaviour().container||n&&n.el},getAssetsEl:function(){return n.el.querySelector('[data-el=assets]')},render:function(o){if(!this.getConfig('custom')){var a=o||this.getAll().models;if(!n){var s={collection:e,globalCollection:t,config:i,module:this};r=new U(s),s.fu=r;var c=n&&n.el;(n=new V($({el:c},s))).render()}return e.reset(a),this.getContainer()}},addType:function(t,e){this.getAll().addType(t,e)},getType:function(t){return this.getAll().getType(t)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return n},FileUploader:function(){return r},onLoad:function(){var t=this;this.getAll().reset(i.assets);var e=this.em,n=this.events;e.on("run:".concat(c),(function(){return t.__propEv(n.open)})),e.on("stop:".concat(c),(function(){return t.__propEv(n.close)}))},postRender:function(t){i.dropzone&&r&&r.initDropzone(t)},setTarget:function(t){e.target=t},onSelect:function(t){e.onSelect=t},onClick:function(t){i.onClick=t},onDblClick:function(t){i.onDblClick=t},__behaviour:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=$($({},this._bhv||{}),t)},__getBehaviour:function(){return this._bhv||{}},destroy:function(){t.stopListening(),e.stopListening(),t.reset(),e.reset(),r&&r.remove(),n&&n.remove(),[t,n,r].forEach((function(t){return null})),this._bhv={},i={}}})}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a={stylePrefix:'trt-',appendTo:'',optionsTarget:[{value:!1},{value:'_blank'}]},s=n(29),c=n(28),l=n.n(c),u=n(3),f=n.n(u),h=n(1);function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=f.a.$,v=f.a.View.extend({events:{},eventCapture:['change'],appendInput:1,attributes:function(){return this.model.get('attributes')},templateLabel:function(){var t=this.ppfx,e=this.getLabel();return"<div class=\"".concat(t,"label\" title=\"").concat(e,"\">").concat(e,"</div>")},templateInput:function(){var t=this.clsField;return"<div class=\"".concat(t,"\" data-input></div>")},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.config,r=void 0===n?{}:n,i=this.model,o=this.eventCapture,a=i.target,s=i.attributes.type;this.config=r,this.em=r.em,this.pfx=r.stylePrefix||'',this.ppfx=r.pStylePrefix||'',this.target=a;var c=this.ppfx;this.clsField="".concat(c,"field ").concat(c,"field-").concat(s),[['change:value',this.onValueChange],['remove',this.removeView]].forEach((function(e){var n=l()(e,2),r=n[0],o=n[1];i.off(r,o),t.listenTo(i,r,o)})),i.view=this,this.listenTo(i,'change:label',this.render),this.listenTo(i,'change:placeholder',this.rerender),this.events={},o.forEach((function(e){return t.events[e]='onChange'})),this.delegateEvents(),this.init()},getClbOpts:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},removeView:function(){this.remove(),this.removed()},init:function(){},removed:function(){},onRender:function(){},onUpdate:function(){},onEvent:function(){},onChange:function(t){var e=this.getInputElem();e&&!Object(o["isUndefined"])(e.value)&&this.model.set('value',e.value),this.onEvent(p(p({},this.getClbOpts()),{},{event:t}))},getValueForTarget:function(){return this.model.get('value')},setInputValue:function(t){var e=this.getInputElem();e&&(e.value=t)},onValueChange:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}},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)},getLabel:function(){var t=this.em,e=this.model.attributes,n=e.label,r=e.name;return t.t("traitManager.traits.labels.".concat(r))||Object(h["capitalize"])(n||r).replace(/-/g,' ')},getComponent:function(){return this.target},getInputEl:function(){if(!this.$input){var t=this.em,e=this.model,n=e,r=e.attributes.name,i=n.get('placeholder')||n.get('default')||'',a=n.get('type')||'text',s=n.get('min'),c=n.get('max'),l=this.getModelValue(),u=g("<input type=\"".concat(a,"\" placeholder=\"").concat(i,"\">")),f=t.t("traitManager.traits.attributes.".concat(r))||{};u.attr(f),Object(o["isUndefined"])(l)||(n.set({value:l},{silent:!0}),u.prop('value',l)),s&&u.prop('min',s),c&&u.prop('max',c),this.$input=u}return this.$input.get(0)},getInputElem:function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},getModelValue:function(){var t,e=this.model,n=this.target,r=e.get('name');if(e.get('changeProp'))t=n.get(r);else{var i=n.get('attributes');t=e.get('value')||i[r]}return Object(o["isUndefined"])(t)?'':t},getElInput:function(){return this.elInput},renderField:function(){var t=this.$el,e=this.appendInput,n=this.model,r=t.find('[data-input]'),i=r[r.length-1],a=n.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),Object(o["isString"])(a)?(i.innerHTML=a,this.elInput=i.firstChild):(e?i.appendChild(a):i.insertBefore(a,i.firstChild),this.elInput=a),n.el=this.elInput},hasLabel:function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},rerender:function(){this.model.el=null,this.render()},postUpdate:function(){this.onUpdate(this.getClbOpts())},render:function(){var t=this.$el,e=this.pfx,n=this.ppfx,r=this.model.attributes,i=r.type,a=r.id,s=this.hasLabel&&this.hasLabel(),c="".concat(e,"trait");this.$input=null;var l="<div class=\"".concat(c," ").concat(c,"--").concat(i,"\">\n      ").concat(s?"<div class=\"".concat(n,"label-wrp\" data-label></div>"):'',"\n      <div class=\"").concat(n,"field-wrp ").concat(n,"field-wrp--").concat(i,"\" data-input>\n        ").concat(this.templateInput?Object(o["isFunction"])(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n      </div>\n    </div>");return t.empty().append(l),s&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this}}),m=s["a"].extend({ns:'Traits',itemView:v,reuseView:1,initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config||{},n=e.stylePrefix||'',r=t.editor;this.config=e,this.em=r,this.pfx=n,this.ppfx=e.pStylePrefix||'',this.className="".concat(n,"traits"),this.listenTo(r,'component:toggled',this.updatedCollection)},updatedCollection:function(){var t=this.ppfx,e=this.className,n=this.em.getSelected();this.el.className="".concat(e," ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=n?n.get('traits'):[],this.render()}}),y=f.a.$,b=v.extend({init:function(){this.listenTo(this.model,'change:options',this.rerender)},templateInput:function(){var t=this.ppfx,e=this.clsField;return"<div class=\"".concat(e,"\">\n      <div data-input></div>\n      <div class=\"").concat(t,"sel-arrow\">\n        <div class=\"").concat(t,"d-s-arrow\"></div>\n      </div>\n    </div>")},getInputEl:function(){if(!this.$input){var t=this.model,e=this.em,n=t.get('name'),r=t.get('options')||[],i=[],a='<select>';r.forEach((function(t){var r,s,c,l='';Object(o["isString"])(t)?(r=t,s=t):(r=t.name||t.label||t.value,s="".concat(Object(o["isUndefined"])(t.value)?t.id:t.value).replace(/"/g,'&quot;'),l+=(c=t.style?t.style.replace(/"/g,'&quot;'):'')?" style=\"".concat(c,"\""):'');var u=e.t("traitManager.traits.options.".concat(n,".").concat(s))||r;a+="<option value=\"".concat(s,"\"").concat(l,">").concat(u,"</option>"),i.push(s)})),a+='</select>',this.$input=y(a);var s=t.getTargetValue(),c=i.indexOf(s)>=0?s:t.get('default');!Object(o["isUndefined"])(c)&&this.$input.val(c)}return this.$input.get(0)}}),w=v.extend({appendInput:0,templateInput:function(){var t=this.ppfx,e=this.clsField;return"<label class=\"".concat(e,"\" data-input>\n    <i class=\"").concat(t,"chk-icon\"></i>\n  </label>")},onChange:function(){var t=this.getInputElem().checked;this.model.set('value',this.getCheckedValue(t))},getCheckedValue:function(t){var e=t,n=this.model.attributes,r=n.valueTrue,i=n.valueFalse;return e&&!Object(o["isUndefined"])(r)&&(e=r),e||Object(o["isUndefined"])(i)||(e=i),e},getInputEl:function(){for(var t=!this.$input,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=v.prototype.getInputEl.apply(this,n);if(t){var a,s,c=this.model,l=this.target,u=c.attributes,f=(u.valueTrue,u.valueFalse),h=c.get('name');c.get('changeProp')?s=a=l.get(h):a=!(!(s=l.get('attributes')[h])&&''!==s),Object(o["isUndefined"])(f)||s!==f||(a=!1),i.checked=a}return i}}),O=n(38),x=v.extend({getValueForTarget:function(){var t=this.model,e=t.attributes,n=e.value,r=e.unit;return Object(o["isUndefined"])(n)||''===n?t.get('default'):n+r},getInputEl:function(){if(!this.input){var t=this.ppfx,e=this.model,n=this.getModelValue(),r=new O["a"]({contClass:"".concat(t,"field-int"),type:'number',model:e,ppfx:t});this.input=r.render(),this.$input=this.input.inputEl,this.$unit=this.input.unitEl,e.set('value',n,{fromTarget:1}),this.$input.val(n),this.input=r.el}return this.input}}),C=n(43),k=v.extend({templateInput:'',getInputEl:function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new C["a"]({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}}),S=v.extend({eventCapture:['click button'],templateInput:'',onChange:function(){this.handleClick()},handleClick:function(){var t=this.model,e=this.em,n=t.get('command');n&&(Object(o["isString"])(n)?e.get('Commands').run(n):n(e.get('Editor'),t))},renderLabel:function(){this.model.get('label')&&v.prototype.renderLabel.apply(this,arguments)},getInputEl:function(){var t=this.model,e=this.ppfx,n=t.props(),r=n.labelButton,i=n.text,o=n.full,a=r||i,s="".concat(e,"btn");return"<button type=\"button\" class=\"".concat(s,"-prim").concat(o?" ".concat(s,"--full"):'',"\">").concat(a,"</button>")}});function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e={},n={text:v,number:x,select:b,checkbox:w,color:k,button:S};return{TraitsView:m,name:'TraitManager',getConfig:function(){return e},init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=t,Object(o["defaults"])(e,a);var r=e.pStylePrefix;return this.types=P({},n),r&&(e.stylePrefix="".concat(r).concat(e.stylePrefix)),this},postRender:function(){var t=this.getConfig().appendTo;t&&(Object(o["isElement"])(t)?t:document.querySelector(t)).appendChild(this.render())},getTraitsViewer:function(){return t},addType:function(t,e){var n=this.getType('text');this.types[t]=n.extend(e)},getType:function(t){return this.getTypes()[t]},getTypes:function(){return this.types},render:function(){var n=t&&t.el;return(t=new m({el:n,collection:[],editor:e.em,config:e})).itemsView=this.getTypes(),t.updatedCollection(),t.el},destroy:function(){t&&t.remove(),[e,t].forEach((function(t){return{}}))}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return z})),n.d(e,"evPfx",(function(){return H})),n.d(e,"evAdd",(function(){return U})),n.d(e,"evUpdate",(function(){return W})),n.d(e,"evRemove",(function(){return $})),n.d(e,"evRemoveBefore",(function(){return q})),n.d(e,"evDrag",(function(){return G})),n.d(e,"evDragStart",(function(){return K})),n.d(e,"evDragStop",(function(){return Y})),n.d(e,"evCustom",(function(){return X}));var r=n(2),i=n.n(r),o=n(0),a=n(22),s={appendTo:'',appendOnClick:!1,blocks:[],custom:!1},c=n(5),l=n.n(c),u=n(6),f=n.n(u),h=n(7),d=n.n(h),p=n(8),g=n.n(p),v=n(4),m=n.n(v),y=n(3),b=n.n(y);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var O=function(t){d()(n,t);var e=w(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"defaults",value:function(){return{label:'',content:'',media:'',category:'',activate:!1,select:null,resetId:!1,disable:!1,onClick:null,attributes:{}}}},{key:"getId",value:function(){return this.id}},{key:"getLabel",value:function(){return this.get('label')}},{key:"getMedia",value:function(){return this.get('media')}},{key:"getContent",value:function(){return this.get('content')}},{key:"getCategoryLabel",value:function(){var t=this.get('category');return Object(o["isFunction"])(t.get)?t.get('label'):t.label?t.label:t}}]),n}(y["Model"]);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var C=function(t){d()(n,t);var e=x(n);function n(){return l()(this,n),e.apply(this,arguments)}return n}(y["Collection"]);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}C.prototype.model=O;var S=function(t){d()(n,t);var e=k(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"defaults",value:function(){return{id:'',label:'',open:!0,attributes:{}}}}]),n}(y["Model"]);function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var P=function(t){d()(n,t);var e=j(n);function n(){return l()(this,n),e.apply(this,arguments)}return n}(y["Collection"]);P.prototype.model=S;var _,T=n(1),E=b.a.View.extend({events:{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model;this.em=e.em,this.config=e,this.endDrag=this.endDrag.bind(this),this.ppfx=e.pStylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change',this.render)},__getModule:function(){return this.em.get('BlockManager')},handleClick:function(t){var e=this.config,n=this.model,r=this.em,i=n.get('onClick')||e.appendOnClick;if(r.trigger('block:click',n,t),i){if(Object(o["isFunction"])(i))return i(n,r.getEditor(),{event:t});var a,s=e.getSorter(),c=n.get('content'),l=r.getSelected();if(s.setDropContent(c),l)if(s.validTarget(l.getEl(),c).valid)a=l;else{var u=l.parent();s.validTarget(u.getEl(),c).valid&&(a=u)}if(!a){var f=r.getWrapper();s.validTarget(f.getEl(),c).valid&&(a=f)}var h=a&&a.append(c)[0];h&&r.setSelected(h,{scroll:1})}},startDrag:function(t){var e=this.config,n=this.em,r=this.model.get('disable');if(0===t.button&&e.getSorter&&!this.el.draggable&&!r){n.refreshCanvas();var i=e.getSorter();i.setDragHelper(this.el,t),i.setDropContent(this.model.get('content')),i.startSort(this.el),Object(T["on"])(document,'mouseup',this.endDrag)}},handleDragStart:function(t){this.__getModule().__startDrag(this.model,t)},handleDrag:function(t){this.__getModule().__drag(t)},handleDragEnd:function(){this.__getModule().__endDrag()},endDrag:function(t){Object(T["off"])(document,'mouseup',this.endDrag);var e=this.config.getSorter();e.moved=0,e.endMove()},render:function(){var t=this.em,e=this.el,n=this.$el,r=this.ppfx,i=this.model,o=i.get('disable'),a=i.get('attributes')||{},s=a.class||'',c="".concat(r,"block"),l=t&&t.t("blockManager.labels.".concat(i.id))||i.get('label'),u=i.get('render'),f=i.get('media'),h=o?"".concat(c,"--disable"):"".concat(r,"four-color-h");n.attr(a),e.className="".concat(s," ").concat(c," ").concat(r,"one-bg ").concat(h).trim(),e.innerHTML="\n      ".concat(f?"<div class=\"".concat(c,"__media\">").concat(f,"</div>"):'',"\n      <div class=\"").concat(c,"-label\">").concat(l,"</div>\n    "),e.title=a.title||e.textContent.trim(),e.setAttribute('draggable',!(!Object(T["hasDnd"])(t)||o));var d=u&&u({el:e,model:i,className:c,prefix:r});return d&&(e.innerHTML=d),this}}),D=n(20),M=n.n(D),A=n(18);function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var R=function(t){d()(n,t);var e=L(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"template",value:function(t){var e=t.pfx,n=t.label;return Object(A["a"])(_||(_=M()(["\n      <div class=\"","title\">\n        <i class=\"","caret-icon\"></i>\n        ","\n      </div>\n      <div class=\"","blocks-c\"></div>\n    "])),e,e,n,e)}},{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"initialize",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t;var e=t.pStylePrefix||'';this.em=t.em,this.pfx=e,this.caretR='fa fa-caret-right',this.caretD='fa fa-caret-down',this.iconClass="".concat(e,"caret-icon"),this.activeClass="".concat(e,"open"),this.className="".concat(e,"block-category"),this.events={},this.events["click .".concat(e,"title")]='toggle',this.listenTo(this.model,'change:open',this.updateVisibility),this.delegateEvents(),this.model.view=this}},{key:"updateVisibility",value:function(){this.model.get('open')?this.open():this.close()}},{key:"open",value:function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=''}},{key:"close",value:function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display='none'}},{key:"toggle",value:function(){var t=this.model;t.set('open',!t.get('open'))}},{key:"getIconEl",value:function(){return this.iconEl||(this.iconEl=this.el.querySelector('.'+this.iconClass)),this.iconEl}},{key:"getBlocksEl",value:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector('.'+this.pfx+'blocks-c')),this.blocksEl}},{key:"append",value:function(t){this.getBlocksEl().appendChild(t)}},{key:"render",value:function(){var t=this.em,e=this.el,n=this.$el,r=this.model,i=this.pfx,o=t.t("blockManager.categories.".concat(r.id))||r.get('label');return e.innerHTML=this.template({pfx:i,label:o}),n.addClass(this.className),n.css({order:r.get('order')}),this.updateVisibility(),this}}]),n}(y["View"]);function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var F=b.a.View.extend({initialize:function(t,e){Object(o["bindAll"])(this,'getSorter','onDrag','onDrop','onMove'),this.config=e||{},this.categories=t.categories||'',this.renderedCategories=[];var n=this.config.pStylePrefix||'';this.ppfx=n,this.noCatClass="".concat(n,"blocks-no-cat"),this.blockContClass="".concat(n,"blocks-c"),this.catsClass="".concat(n,"block-categories");var r=this.collection;this.listenTo(r,'add',this.addTo),this.listenTo(r,'reset',this.render),this.em=this.config.em,this.tac='test-tac',this.grabbingCls=this.ppfx+'grabbing',this.em&&(this.config.getSorter=this.getSorter,this.canvas=this.em.get('Canvas'))},updateConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=I(I({},this.config),t)},getSorter:function(){if(this.em){if(!this.sorter){var t=this.em.get('Utils'),e=this.canvas;this.sorter=new t.Sorter({container:e.getBody(),placer:e.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:e.getFrameEl().contentDocument,direction:'a',wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}},onDrag:function(t){this.em.stopDefault(),this.em.trigger('block:drag:start',t)},onMove:function(t){this.em.trigger('block:drag:move',t)},onDrop:function(t){var e=this.em;if(e.runDefault(),t&&t.get){var n='activeOnRender';t.get(n)&&(t.trigger('active'),t.unset(n)),e.trigger('block:drag:stop',t)}},addTo:function(t){this.add(t)},add:function(t,e){var n=this.config,r=e||null,i=new E({model:t,attributes:t.get('attributes')},n).render().el,a=t.get('category');if(a&&this.categories&&!n.ignoreCategories){Object(o["isString"])(a)?a={id:a,label:a}:Object(o["isObject"])(a)&&!a.id&&(a.id=a.label);var s=this.categories.add(a),c=s.get('id'),l=this.renderedCategories[c],u=this.getCategoriesEl();return t.set('category',s,{silent:!0}),!l&&u&&(l=new R({model:s},this.config).render(),this.renderedCategories[c]=l,u.appendChild(l.el)),void(l&&l.append(i))}r?r.appendChild(i):this.append(i)},getCategoriesEl:function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},append:function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},render:function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML="\n      <div class=\"".concat(this.catsClass,"\"></div>\n      <div class=\"").concat(this.noCatClass,"\">\n        <div class=\"").concat(this.blockContClass,"\"></div>\n      </div>\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}});function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var z='block',H="".concat(z,":"),U="".concat(H,"add"),W="".concat(H,"update"),$="".concat(H,"remove"),q="".concat($,":before"),G="".concat(H,"drag"),K="".concat(G,":start"),Y="".concat(G,":stop"),X="".concat(H,"custom");e["default"]=function(){var t,e,n,r={},i=[];return B(B({},a["a"]),{},{name:'BlockManager',Block:O,Blocks:C,Category:S,Categories:P,events:{all:z,update:W,add:U,remove:$,removeBefore:q,drag:G,dragStart:K,dragEnd:Y,custom:X},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r=B(B({},s),n),a=o.em;return this.em=a,t=new C(r.blocks),e=new C(t.models),i=new P,this.all=t,this.__initListen(),t.on('add',(function(t){return e.add(t)})),t.on('remove',(function(t){return e.remove(t)})),t.on('reset',(function(t){return e.reset(t.models)})),this},__trgCustom:function(){this.em.trigger(this.events.custom,this.__customData())},__customData:function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(e,n){return t.startDrag(e,n)},drag:function(e){return t.__drag(e)},dragStop:function(e){return t.endDrag(e)}}},__startDrag:function(e,n){var r=this.em,i=this.events,o=e.getContent?e.getContent():e;this._dragBlock=e,r.set({dragResult:null,dragContent:o}),[r,t].map((function(t){return t.trigger(i.dragStart,e,n)}))},__drag:function(e){var n=this.em,r=this.events,i=this._dragBlock;[n,t].map((function(t){return t.trigger(r.drag,i,e)}))},__endDrag:function(){var e=this.em,n=this.events,r=this._dragBlock,i=e.get('dragResult');if(this._dragBlock=null,i){var a='activeOnRender',s=i.get&&i.get(a),c=r.get('activate')||s,l=r.get('select'),u=Object(o["isArray"])(i)?i[0]:i;(l||c&&!1!==l)&&e.setSelected(u),c&&(u.trigger('active'),s&&u.unset(a)),r.get('resetId')&&u.onAll((function(t){return t.resetId()}))}e.set({dragResult:null,dragContent:null}),[e,t].map((function(t){return t.trigger(n.dragEnd,i,r)}))},__getFrameViews:function(){return this.em.get('Canvas').getFrames().map((function(t){return t.view}))},__behaviour:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=B(B({},this._bhv||{}),t)},__getBehaviour:function(){return this._bhv||{}},startDrag:function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach((function(t){return t.droppable.startCustom()}))},endDrag:function(t){this.__getFrameViews().forEach((function(e){return e.droppable.endCustom(t)})),this.__endDrag()},getConfig:function(){return r},postRender:function(){n=new F({collection:e,categories:i},r);var t=this.getConfig().appendTo;if(t){var a=Object(o["isElement"])(t)?t:document.querySelector(t);if(!a)return this.__logWarn('"appendTo" element not found');a.appendChild(this.render(e.models))}this.__trgCustom()},add:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n||{};return i.id=e,t.add(i,r)},get:function(e){return t.get(e)},getAll:function(){return t},getAllVisible:function(){return e},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)},getCategories:function(){return i},getContainer:function(){return n.el},render:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t||this.getAll().models;if(e.external){var a=new C(o);return new F({collection:a,categories:i},B(B({},r),e)).render().el}return n&&(n.updateConfig(e),n.collection.reset(o),n.rendered||(n.render(),n.rendered=1)),this.getContainer()},destroy:function(){var o=[t,e,i];o.map((function(t){return t.stopListening()})),o.map((function(t){return t.reset()})),n&&n.remove(),r={}}})}},function(t,e,n){"use strict";n.r(e);var r='sw-visibility',i='export-template',o='open-sm',a='open-tm',s='open-layers',c='open-blocks',l='fullscreen',u='preview',f={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:r,className:'fa fa-square-o',command:r,context:r,attributes:{title:'View components'}},{id:u,className:'fa fa-eye',command:u,context:u,attributes:{title:'Preview'}},{id:l,className:'fa fa-arrows-alt',command:l,context:l,attributes:{title:'Fullscreen'}},{id:i,className:'fa fa-code',command:i,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:o,className:'fa fa-paint-brush',command:o,active:!0,togglable:0,attributes:{title:'Open Style Manager'}},{id:a,className:'fa fa-cog',command:a,togglable:0,attributes:{title:'Settings'}},{id:s,className:'fa fa-bars',command:s,togglable:0,attributes:{title:'Open Layer Manager'}},{id:c,className:'fa fa-th-large',command:c,togglable:0,attributes:{title:'Open Blocks'}}]}],em:null,delayBtnsShow:300},h=n(3),d=n.n(h),p=n(46),g=d.a.Model.extend({defaults:{id:'',content:'',visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get('buttons')||[],this.buttons=new p["default"](this.btn),this.set('buttons',this.buttons)}}),v=d.a.Collection.extend({model:g}),m=n(2),y=n.n(m),b=n(0);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}d.a.$;var x=d.a.View.extend({tagName:function(){return this.model.get('tagName')},events:{click:'clicked'},initialize:function(t){var e=this.model,n=e.get('className'),r=e.attributes,i=r.command,o=r.listen,a=t.config||{},s=a.em;this.config=a,this.em=s;var c=this.config.stylePrefix||'',l=this.config.pStylePrefix||'';if(this.pfx=c,this.ppfx=this.config.pStylePrefix||'',this.id=c+e.get('id'),this.activeCls="".concat(c,"active ").concat(l,"four-color"),this.disableCls="".concat(l,"disabled"),this.btnsVisCls="".concat(c,"visible"),this.className=c+'btn'+(n?' '+n:''),this.listenTo(e,'change',this.render),this.listenTo(e,'change:active updateActive',this.updateActive),this.listenTo(e,'checkActive',this.checkActive),this.listenTo(e,'change:bntsVis',this.updateBtnsVis),this.listenTo(e,'change:attributes',this.updateAttributes),this.listenTo(e,'change:className',this.updateClassName),this.listenTo(e,'change:disable',this.updateDisable),s&&Object(b["isString"])(i)&&o){var u={fromListen:1};this.listenTo(s,"run:".concat(i),(function(){return e.set('active',!0,u)})),this.listenTo(s,"stop:".concat(i),(function(){return e.set('active',!1,u)}))}s&&s.get&&(this.commands=s.get('Commands'))},updateClassName:function(){var t=this.model,e=this.pfx,n=t.get('className'),r=t.get('attributes').class,i="".concat(r||''," ").concat(e,"btn ").concat(n||'');this.$el.attr('class',i.trim())},updateAttributes:function(){var t=this.em,e=this.model,n=this.$el,r=e.get('attributes')||{},i=t&&t.t&&t.t("panels.buttons.titles.".concat(e.id));n.attr(r),i&&n.attr({title:i}),this.updateClassName()},updateBtnsVis:function(){this.$buttons&&(this.model.get('bntsVis')?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},updateActive:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,i=this.commands,o=this.$el,a=this.activeCls,s=n.fromCollection,c=n.fromListen,l=r.get('context'),u=r.get('options'),f=r.get('command'),h={};f&&(i&&Object(b["isString"])(f)?h=i.get(f)||{}:Object(b["isFunction"])(f)?h=i.create({run:f}):null!==f&&Object(b["isObject"])(f)&&(h=i.create(f)),r.get('active')?(!s&&r.collection.deactivateAll(l,r),r.set('active',!0,{silent:!0}).trigger('checkActive'),!c&&i.runCommand(h,O(O({},u),{},{sender:r})),h.noStop&&r.set('active',!1)):(o.removeClass(a),!c&&i.stopCommand(h,O(O({},u),{},{sender:r,force:1}))))},updateDisable:function(){var t=this.disableCls,e=this.model.get('disable');this.$el[e?'addClass':'removeClass'](t)},checkActive:function(){var t=this.model,e=this.$el,n=this.activeCls;t.get('active')?e.addClass(n):e.removeClass(n)},clicked:function(t){var e=this.model;e.get('bntsVis')||e.get('disable')||!e.get('command')||this.toggleActive()},toggleActive:function(){var t=this.model,e=this.em,n=t.attributes,r=n.active,i=n.togglable;r&&!i||(t.set('active',!r),r?t.get('runDefaultCommand')&&e.runDefault():t.get('stopDefaultCommand')&&e.stopDefault())},render:function(){var t=this.model,e=t.get('label'),n=this.$el;return!t.get('el')&&n.empty(),this.updateAttributes(),e&&n.append(e),this.checkActive(),this.updateDisable(),this}}),C=d.a.View.extend({initialize:function(t){this.opt=t||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||'',this.parentM=this.opt.parentM||null,this.listenTo(this.collection,'add',this.addTo),this.listenTo(this.collection,'reset remove',this.render),this.className=this.pfx+'buttons'},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){var n=e||null,r=new x({el:t.get('el'),model:t,config:this.config,parentM:this.parentM}).render().el;return n?n.appendChild(r):this.$el.append(r),r},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(e){this.addToCollection(e,t)}),this),this.$el.append(t),this.$el.attr('class',Object(b["result"])(this,'className')),this}});function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var S=d.a.View.extend({initialize:function(t){var e=t.config||{},n=this.model;this.config=e,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.buttons=n.get('buttons'),this.className=this.pfx+'panel',this.id=this.pfx+n.get('id'),this.listenTo(n,'change:appendContent',this.appendContent),this.listenTo(n,'change:content',this.updateContent),this.listenTo(n,'change:visible',this.toggleVisible),n.view=this},appendContent:function(){this.$el.append(this.model.get('appendContent'))},updateContent:function(){this.$el.html(this.model.get('content'))},toggleVisible:function(){this.model.get('visible')?this.$el.removeClass("".concat(this.ppfx,"hidden")):this.$el.addClass("".concat(this.ppfx,"hidden"))},attributes:function(){return this.model.get('attributes')},initResize:function(){var t=this.config.em,e=t?t.get('Editor'):'',n=this.model.get('resizable');if(e&&n){var r,i,o,a=!0===n?[1,1,1,1]:n,s=a.length,c=0;2==s?(r=a[0],o=a[0],i=a[1],c=a[1]):4==s&&(r=a[0],i=a[1],o=a[2],c=a[3]);var l=e.Utils.Resizer.init(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({tc:r,cr:i,bc:o,cl:c,tl:0,tr:0,bl:0,br:0,appendTo:this.el,silentFrames:1,avoidContainerUpdate:1,prefix:e.getConfig().stylePrefix,onEnd:function(){t&&t.trigger('change:canvasOffset')},posFetcher:function(t,e){var n=e.target,r=t.style,i=l.getConfig(),o=i.keyWidth,a=i.keyHeight,s=t.getBoundingClientRect(),c='container'==n,u=r[o],f=r[a];return{left:0,top:0,width:u&&!c?parseFloat(u):s.width,height:f&&!c?parseFloat(f):s.height}}},n));l.blur=function(){},l.focus(this.el)}},render:function(){var t=this.$el,e=this.ppfx,n="".concat(this.className," ").concat(this.id," ").concat(e,"one-bg ").concat(e,"two-color");if(t.addClass(n),this.toggleVisible(),this.buttons.length){var r=new C({collection:this.buttons,config:this.config});t.append(r.render().el)}return t.append(this.model.get('content')),this}}),j=d.a.View.extend({initialize:function(t){this.opt=t||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||'';var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render),this.listenTo(e,'remove',this.onRemove),this.className=this.pfx+'panels'},onRemove:function(t){var e=t.view;e&&e.remove()},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){var n=e||null,r=this.config,i=t.get('el'),o=new S({el:i,model:t,config:r}),a=o.render().el,s=t.get('appendTo');if(i);else if(s){document.querySelector(s).appendChild(a)}else n?n.appendChild(a):this.$el.append(a);return o.initResize(),a},render:function(){var t=this,e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.each((function(e){return t.addToCollection(e,n)})),e.append(n),e.attr('class',this.className),this}});e["default"]=function(){var t,e,n={};return{name:'Panels',init:function(e){for(var r in n=e||{},f)r in n||(n[r]=f[r]);var i=n.pStylePrefix;return i&&(n.stylePrefix=i+n.stylePrefix),t=new v(n.defaults),this},getPanels:function(){return t},getPanelsEl:function(){return e&&e.el},addPanel:function(e){return t.add(e)},removePanel:function(e){return t.remove(e)},getPanel:function(e){var n=t.where({id:e});return n.length?n[0]:null},addButton:function(t,e){var n=this.getPanel(t);return n?n.get('buttons').add(e):null},removeButton:function(t,e){var n=this.getPanel(t);return n&&n.get('buttons').remove(e)},getButton:function(t,e){var n=this.getPanel(t);if(n){var r=n.get('buttons').where({id:e});return r.length?r[0]:null}return null},render:function(){return e&&e.remove(),(e=new j({collection:t,config:n})).render().el},active:function(){this.getPanels().each((function(t){t.get('buttons').each((function(t){t.get('active')&&t.trigger('updateActive')}))}))},disableButtons:function(){this.getPanels().each((function(t){t.get('buttons').each((function(t){t.get('disable')&&t.trigger('change:disable')}))}))},destroy:function(){t.reset(),t.stopListening(),e&&e.remove(),[n,t,e].forEach((function(t){return{}}))},Panel:g}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1),l={stylePrefix:'cv-',scripts:[],styles:[],customBadgeLabel:'',autoscrollLimit:50,extHl:0,notTextable:['button','a','input[type=checkbox]','input[type=radio]']},u=n(5),f=n.n(u),h=n(6),d=n.n(h),p=n(7),g=n.n(p),v=n(8),m=n.n(v),y=n(4),b=n.n(y),w=n(3),O=n.n(w),x=n(45);function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var k=function(t){g()(n,t);var e=C(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return{frame:'',frames:'',rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[]}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.em;this.config=e,this.em=n,this.listenTo(this,'change:zoom',this.onZoomChange),this.listenTo(n,'change:device',this.updateDevice),this.listenTo(n,x["evPageSelect"],this._pageUpdated)}},{key:"init",value:function(){var t=this.em.get('PageManager').getMain(),e=t.getMainFrame();this.set('frames',t.getFrames()),this.updateDevice({frame:e})}},{key:"_pageUpdated",value:function(t,e){var n=this.em;n.setSelected(),n.get('readyCanvas')&&n.stopDefault(),e&&e.getFrames().map((function(t){return t.disable()})),this.set('frames',t.getFrames())}},{key:"updateDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e.getDeviceModel(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var i=n.attributes,o=i.width,a=i.height;r.set({width:o,height:a},{noUndo:1})}}},{key:"onZoomChange",value:function(){this.get('zoom')<1&&this.set('zoom',1)}}]),n}(w["Model"]),S=n(29),j=n(41),P=n(12);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var T=function(){function t(e,n){var r=this;f()(this,t),this.em=e;var i=n||e.get('Canvas').getFrames().map((function(t){return t.getComponent().getEl()})),o=Array.isArray(i)?i:[i];return this.el=i,this.counter=0,Object(s["bindAll"])(this,'handleDragEnter','handleDragOver','handleDrop','handleDragLeave'),o.forEach((function(t){return r.toggleEffects(t,1)})),this}return d()(t,[{key:"toggleEffects",value:function(t,e){var n={on:c["on"],off:c["off"]},r=e?'on':'off';n[r](t,'dragenter',this.handleDragEnter),n[r](t,'dragover',this.handleDragOver),n[r](t,'drop',this.handleDrop),n[r](t,'dragleave',this.handleDragLeave)}},{key:"__customTglEff",value:function(t){var e=t?c["on"]:c["off"],n=this.el.ownerDocument,r=n.defaultView.frameElement;this.sortOpts=t?{onStart:function(t){var e=t.sorter;Object(c["on"])(r,'pointermove',e.onMove)},onEnd:function(t){var e=t.sorter;Object(c["off"])(r,'pointermove',e.onMove)},customTarget:function(t){var e=t.event;return n.elementFromPoint(e.clientX,e.clientY)}}:null,e(r,'pointerenter',this.handleDragEnter),e(r,'pointermove',this.handleDragOver),e(document,'pointerup',this.handleDrop),e(r,'pointerout',this.handleDragLeave)}},{key:"startCustom",value:function(){this.__customTglEff(!0)}},{key:"endCustom",value:function(t){this.over?this.endDrop(t):this.__customTglEff(!1)}},{key:"endDrop",value:function(t,e){var n=this.em,r=this.dragStop;this.counter=0,r&&r(t),this.__customTglEff(!1),n.trigger('canvas:dragend',e)}},{key:"handleDragLeave",value:function(t){this.updateCounter(-1,t)}},{key:"updateCounter",value:function(t,e){this.counter+=t,0===this.counter&&this.endDrop(1,e)}},{key:"handleDragEnter",value:function(t){var e=this,n=this.em,r=t.dataTransfer;if(this.updateCounter(1,t),!this.over){this.over=1;var i,o,s=n.get('Utils'),c=n.get('Canvas'),l=n.get('dragContent')||'<br>';if(n.stopDefault(),n.inAbsoluteMode()){var u=n.get('DomComponents').getWrapper(),f=u.append({})[0],h=n.get('Commands').run('core:component-drag',{event:t,guidesInfo:1,center:1,target:f,onEnd:function(t,n,i){var o;if(!i.cancelled){o=u.append(l)[0];var a=f.getStyle(),s=a.left,c=a.top,h=a.position;o.addStyle({left:s,top:c,position:h})}e.handleDragEnd(o,r),f.remove()}});i=function(e){return h.stop(t,{cancel:e})},o=function(t){return l=t}}else{var d=new s.Sorter(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({em:n,wmargin:1,nested:1,canvasRelative:1,direction:'a',container:this.el,placer:c.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:'gjs-',onEndMove:function(t){return e.handleDragEnd(t,r)},document:this.el.ownerDocument},this.sortOpts||{}));d.setDropContent(l),d.startSort(),this.sorter=d,i=function(t){t&&(d.moved=0),d.endMove()},o=function(t){return d.setDropContent(t)}}this.dragStop=i,this.dragContent=o,n.trigger('canvas:dragenter',r,l)}}},{key:"handleDragEnd",value:function(t,e){var n=this.em;this.over=0,t&&(n.set('dragResult',t),n.trigger('canvas:drop',e,t)),n.runDefault({preserveSelected:1})}},{key:"handleDragOver",value:function(t){t.preventDefault(),this.em.trigger('canvas:dragover',t)}},{key:"handleDrop",value: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)}},{key:"getContentByData",value:function(t){var e=this.em,n=t&&t.types,r=t&&t.files||[],i=e.get('dragContent'),o=t&&t.getData('text');if(r.length){o=[];for(var a=0;a<r.length;a++){var c=r[a],l=c.type.split('/')[0];'image'==l&&o.push({type:l,file:c,attributes:{alt:c.name}})}}else if(i)o=i;else if(Object(s["indexOf"])(n,'text/html')>=0)o=t&&t.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if(Object(s["indexOf"])(n,'text/uri-list')>=0)o={type:'link',attributes:{href:o},content:o};else if(Object(s["indexOf"])(n,'text/json')>=0){var u=t&&t.getData('text/json');u&&(o=JSON.parse(u))}else 1===n.length&&'text/plain'===n[0]&&(o="<div>".concat(o,"</div>"));var f={content:o};return e.trigger('canvas:dragdata',t,f),f}}]),t}(),E=n(13);function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var A=O.a.View.extend({tagName:'iframe',attributes:{allowfullscreen:'allowfullscreen','data-frame-el':!0},initialize:function(t){Object(s["bindAll"])(this,'updateClientY','stopAutoscroll','autoscroll','_emitUpdate');var e=this.model,n=this.el;this.tools={},this.config=M(M({},t.config||{}),{},{frameView:this}),this.ppfx=this.config.pStylePrefix||'',this.em=this.config.em;var r=this.getCanvasModel();this.listenTo(e,'change:head',this.updateHead),this.listenTo(r,'change:styles',this.renderStyles),e.view=this,Object(c["setViewEl"])(n,this)},updateHead:function(){var t=this.model,e=this.getHead(),n=[],r=[],i=t.get('head'),o=t.previous('head'),a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).sort().map((function(e){return"[".concat(e,"=\"").concat(t[e],"\"]")})).join('')},s=function(t,e,n){t.forEach((function(t){var r=t.tag,i=t.attributes;!e.some((function(t){return t.tag===r&&a(t.attributes)===a(i)}))&&n.push(t)}))};s(i,o,r),s(o,i,n),n.forEach((function(t){var n=e.querySelector("".concat(t.tag).concat(a(t.attributes)));n&&n.parentNode.removeChild(n)})),Object(E["c"])(e,r)},getEl:function(){return this.el},getCanvasModel:function(){return this.em.get('Canvas').getModel()},getWindow:function(){return this.getEl().contentWindow},getDoc:function(){return this.getEl().contentDocument},getHead:function(){return this.getDoc().querySelector('head')},getBody:function(){return this.getDoc().querySelector('body')},getWrapper:function(){return this.getBody().querySelector('[data-gjs-type=wrapper]')},getJsContainer:function(){return this.jsContainer||(this.jsContainer=Object(E["f"])('div',{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},getToolsEl:function(){var t=this.config.frameWrapView;return t&&t.elTools},getGlobalToolsEl:function(){return this.em.get('Canvas').getGlobalToolsEl()},getHighlighter:function(){return this._getTool('[data-hl]')},getBadgeEl:function(){return this._getTool('[data-badge]')},getOffsetViewerEl:function(){return this._getTool('[data-offset]')},getRect:function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},getOffsetRect:function(){var t=this.el,e=this.getBody(),n=e.scrollTop,r=e.scrollLeft,i=t.offsetHeight,o=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:i,width:o,scrollTop:n,scrollLeft:r,scrollBottom:n+i,scrollRight:r+o}},_getTool:function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},remove:function(){var t=this.wrapper;this._toggleEffects(),this.tools={},t&&t.remove(),O.a.View.prototype.remove.apply(this,arguments)},startAutoscroll:function(){var t=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout((function(){t._toggleAutoscrollFx(1),requestAnimationFrame(t.autoscroll)}),0)},autoscroll:function(){if(this.dragging){var t=this.lastClientY,e=this.em.get('Canvas'),n=this.getWindow(),r=this.getBody().scrollTop,i=t||0,o=e.getConfig().autoscrollLimit,a=this.getRect().height-o,c=r;if(i<o&&(c-=o-i),i>a&&(c+=i-a),!Object(s["isUndefined"])(t)&&c!==r&&c>0&&c<this.lastMaxHeight)this.getGlobalToolsEl().style.opacity=0,this.showGlobalTools(),n.scrollTo(0,c);requestAnimationFrame(this.autoscroll)}},updateClientY:function(t){t.preventDefault(),this.lastClientY=Object(c["getPointerEvent"])(t).clientY*this.em.getZoomDecimal()},showGlobalTools:Object(s["debounce"])((function(){this.getGlobalToolsEl().style.opacity=''}),50),stopAutoscroll:function(){this.dragging&&this._toggleAutoscrollFx()},_toggleAutoscrollFx:function(t){this.dragging=t;var e=this.getWindow(),n=t?'on':'off',r={on:c["on"],off:c["off"]};r[n](e,'mousemove dragover',this.updateClientY),r[n](e,'mouseup',this.stopAutoscroll)},render:function(){var t=this.$el,e=this.ppfx;return t.attr({class:"".concat(e,"frame")}),this.renderScripts(),this},renderScripts:function(){var t=this,e=this.el,n=this.model,r=this.em,o='frame:load',a={el:e,model:n,view:this},c=this.getCanvasModel();e.onload=function(){r&&r.trigger("".concat(o,":before"),a),function n(i){if(i.length>0){var c=i.shift(),l=Object(E["f"])('script',M({type:'text/javascript'},Object(s["isString"])(c)?{src:c}:c));l.onerror=l.onload=n.bind(null,i),e.contentDocument.head.appendChild(l)}else t.renderBody(),r&&r.trigger(o,a)}(i()(c.get('scripts')))}},renderStyles:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getHead(),n=this.getCanvasModel(),r=function(t){return t.map((function(t){return{tag:'link',attributes:M({rel:'stylesheet'},Object(s["isString"])(t)?{href:t}:t)}}))},i=r(t.prev||n.previous('styles')),o=r(n.get('styles')),a=[],c=[],l=function(t,e,n){t.forEach((function(t){var r=t.attributes.href;!e.some((function(t){return t.attributes.href===r}))&&n.push(t)}))};l(o,i,c),l(i,o,a),a.forEach((function(t){var n=e.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));n&&n.parentNode.removeChild(n)})),Object(E["c"])(e,c)},renderBody:function(){var t=this,e=this.config,n=this.model,r=this.ppfx,i=e.em,o=this.getDoc(),a=this.getBody(),s=this.getWindow(),l=i.get('Config');s._isEditor=!0,this.renderStyles({prev:[]});Object(E["a"])(a,"<style>\n      ".concat(l.baseCss||'',"\n\n      .").concat(r,"dashed *[data-highlightable] {\n        outline: 1px dashed rgba(170,170,170,0.7);\n        outline-offset: -2px;\n      }\n\n      .").concat(r,"selected {\n        outline: 3px solid #3b97e3 !important;\n        outline-offset: -3px;\n      }\n\n      .").concat(r,"selected-parent {\n        outline: 2px solid ").concat('#ffca6f'," !important\n      }\n\n      .").concat(r,"no-select {\n        user-select: none;\n        -webkit-user-select:none;\n        -moz-user-select: none;\n      }\n\n      .").concat(r,"freezed {\n        opacity: 0.5;\n        pointer-events: none;\n      }\n\n      .").concat(r,"no-pointer {\n        pointer-events: none;\n      }\n\n      .").concat(r,"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(r,"grabbing {\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n      }\n\n      .").concat(r,"is__grabbing {\n        overflow-x: hidden;\n      }\n\n      .").concat(r,"is__grabbing,\n      .").concat(r,"is__grabbing * {\n        cursor: grabbing !important;\n      }\n\n      ").concat(l.canvasCss||'',"\n      ").concat(l.protectedCss||'',"\n    </style>"));var u=n.getComponent();this.wrapper=new P["default"]({model:u,config:M(M({},u.config),{},{frameView:this})}).render(),Object(E["a"])(a,this.wrapper.el),Object(E["a"])(a,new j["a"]({collection:n.getStyles(),config:M(M({},i.get('CssComposer').getConfig()),{},{frameView:this})}).render().el),Object(E["a"])(a,this.getJsContainer()),Object(c["on"])(a,'click',(function(t){return t&&'A'==t.target.tagName&&t.preventDefault()})),Object(c["on"])(a,'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(e){return e.event.split(' ').forEach((function(n){o.addEventListener(n,(function(n){return t.el.dispatchEvent(Object(E["e"])(n,e.class))}))}))})),this._toggleEffects(1),this.droppable=Object(c["hasDnd"])(i)&&new T(i,this.wrapper.el),n.trigger('loaded')},_toggleEffects:function(t){var e=t?c["on"]:c["off"],n=this.getWindow();n&&e(n,"".concat(E["k"]," resize"),this._emitUpdate)},_emitUpdate:function(){this.model._emitUpdated()}}),L=n(24);function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function N(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var I=O.a.View.extend({events:{'click [data-action-remove]':'remove','mousedown [data-action-move]':'startDrag'},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(s["bindAll"])(this,'onScroll','frameLoaded','updateOffset','remove','startDrag');var n=this.model,r=N(N({},t.config||e),{},{frameWrapView:this}),i=r.canvasView,o=r.em;this.cv=i,this.config=r,this.em=o,this.canvas=o&&o.get('Canvas'),this.ppfx=r.pStylePrefix||'',this.frame=new A({model:n,config:r}),this.classAnim="".concat(this.ppfx,"frame-wrapper--anim"),this.updateOffset=Object(s["debounce"])(this.updateOffset.bind(this)),this.updateSize=Object(s["debounce"])(this.updateSize.bind(this)),this.listenTo(n,'loaded',this.frameLoaded),this.listenTo(n,'change:x change:y',this.updatePos),this.listenTo(n,'change:width change:height',this.updateSize),this.listenTo(n,'destroy remove',this.remove),this.updatePos(),this.setupDragger()},setupDragger:function(){var t,e,n,r=this,i=this.canvas,o=this.model,a=function(t){i.toggleFramesEvents(t)};this.dragger=new L["a"]({onStart:function(){var i=o.attributes,s=i.x,c=i.y;n=r.em.getZoomMultiplier(),t=s,e=c,a()},onEnd:function(){return a(1)},setPosition:function(r){o.set({x:t+r.x*n,y:e+r.y*n})}})},startDrag:function(t){t&&this.dragger.start(t)},__clear:function(t){var e=this.frame;e&&e.remove(t),Object(E["l"])(this.elTools)},remove:function(t){var e=this;return this.__clear(t),O.a.View.prototype.remove.apply(this,arguments),['frame','dragger','cv','em','canvas','elTools'].forEach((function(t){return e[t]=0})),this},updateOffset:function(){var t=this.em,e=this.$el,n=this.frame;t&&(t.runDefault({preserveSelected:1}),e.removeClass(this.classAnim),n.model._emitUpdated())},updatePos:function(t){var e=this.model,n=this.el,r=e.attributes,i=r.x,o=r.y,a=n.style;this.frame.rect=0,a.left=isNaN(i)?i:"".concat(i,"px"),a.top=isNaN(o)?o:"".concat(o,"px"),t&&this.updateOffset()},updateSize:function(){this.updateDim()},updateDim:function(){var t=this.em,e=this.el,n=this.$el,r=this.model,i=this.classAnim,o=this.frame;if(o){o.rect=0,n.addClass(i);var a=this.__handleSize(),c=a.noChanges,l=a.width,u=a.height;(Object(s["isNull"])(l)||Object(s["isNull"])(u))&&r.set(N(N({},l?{}:{width:e.offsetWidth}),u?{}:{height:e.offsetHeight}),{silent:1}),t.stopDefault({preserveSelected:1}),c?this.updateOffset():setTimeout(this.updateOffset,350)}},onScroll:function(){var t=this.frame;this.em.trigger('frame:scroll',{frame:t,body:t.getBody(),target:t.getWindow()})},frameLoaded:function(){this.frame.getWindow().onscroll=this.onScroll,this.updateDim()},__handleSize:function(){var t='px',e=this.model,n=this.el.style,r=e.attributes,i=r.width,o=r.height,a=n.width||'',c=n.height||'',l=i||'',u=o||'',f=a==l&&c==u;return n.width=Object(s["isNumber"])(l)?"".concat(l).concat(t):l,n.height=Object(s["isNumber"])(u)?"".concat(u).concat(t):u,{noChanges:f,width:i,height:o,newW:l,newH:u}},render:function(){var t=this.frame,e=this.$el,n=this.ppfx,r=this.cv,i=this.model,o=this.el,a=i.attributes.onRender;this.__clear(),this.__handleSize(),t.render(),e.empty().attr({class:"".concat(n,"frame-wrapper")}).append("\n      <div class=\"".concat(n,"frame-wrapper__top gjs-two-color\" data-frame-top>\n        <div class=\"").concat(n,"frame-wrapper__name\" data-action-move>\n          ").concat(i.get('name')||'',"\n        </div>\n        <div class=\"").concat(n,"frame-wrapper__top-r\">\n          <div class=\"").concat(n,"frame-wrapper__icon\" data-action-remove style=\"display: none\">\n            <svg viewBox=\"0 0 24 24\"><path d=\"M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z\"></path></svg>\n          </div>\n        </div>\n      </div>\n      <div class=\"").concat(n,"frame-wrapper__right\" data-frame-right></div>\n      <div class=\"").concat(n,"frame-wrapper__left\" data-frame-left></div>\n      <div class=\"").concat(n,"frame-wrapper__bottom\" data-frame-bottom></div>\n      ")).append(t.el);var s=Object(E["f"])('div',{class:"".concat(n,"tools"),style:'pointer-events:none; display: none'},"\n      <div class=\"".concat(n,"highlighter\" data-hl></div>\n      <div class=\"").concat(n,"badge\" data-badge></div>\n      <div class=\"").concat(n,"placeholder\">\n        <div class=\"").concat(n,"placeholder-int\"></div>\n      </div>\n      <div class=\"").concat(n,"ghost\"></div>\n      <div class=\"").concat(n,"toolbar\" style=\"pointer-events:all\"></div>\n      <div class=\"").concat(n,"resizer\"></div>\n      <div class=\"").concat(n,"offset-v\" data-offset>\n        <div class=\"gjs-marginName\" data-offset-m>\n          <div class=\"gjs-margin-v-el gjs-margin-v-top\" data-offset-m-t></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-bottom\" data-offset-m-b></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-left\" data-offset-m-l></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-right\" data-offset-m-r></div>\n        </div>\n        <div class=\"gjs-paddingName\" data-offset-m>\n          <div class=\"gjs-padding-v-el gjs-padding-v-top\" data-offset-p-t></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-bottom\" data-offset-p-b></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-left\" data-offset-p-l></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-right\" data-offset-p-r></div>\n        </div>\n      </div>\n      <div class=\"").concat(n,"offset-fixed-v\"></div>\n    "));this.elTools=s;var c=r.toolsWrapper;return c&&c.appendChild(s),a&&a({el:o,elTop:o.querySelector('[data-frame-top]'),elRight:o.querySelector('[data-frame-right]'),elBottom:o.querySelector('[data-frame-bottom]'),elLeft:o.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this}}),F=S["a"].extend({itemView:I,autoAdd:1,init:function(){this.listenTo(this.collection,'reset',this.render)},onRemoveBefore:function(t,e){t.forEach((function(t){return t.remove(e)}))},onRender:function(){var t=this.config,e=this.$el,n=t.em;n&&e.attr({class:"".concat(n.getConfig('stylePrefix'),"frames")})}});function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var z,H=O.a.$,U=O.a.View.extend({events:{wheel:'onWheel'},template:function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"canvas__frames\" data-frames></div>\n      <div id=\"").concat(t,"tools\" class=\"").concat(t,"canvas__tools\" data-tools></div>\n    ")},initialize:function(t){Object(s["bindAll"])(this,'clearOff','onKeyPress','onCanvasMove');var e=this.model;this.config=t.config||{},this.em=this.config.em||{},this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.className=this.config.stylePrefix+'canvas';var n=this.em;this._initFrames(),this.listenTo(n,'change:canvasOffset',this.clearOff),this.listenTo(n,'component:selected',this.checkSelected),this.listenTo(e,'change:zoom change:x change:y',this.updateFrames),this.listenTo(e,'change:frames',this._onFramesUpdate),this.toggleListeners(1)},_onFramesUpdate:function(){this._initFrames(),this._renderFrames()},_initFrames:function(){var t=this.frames,e=this.model,n=this.config,r=this.em,i=e.get('frames');r.set('readyCanvas',0),i.once('loaded:all',(function(){return r.set('readyCanvas',1)})),t&&t.remove(),this.frames=new F({collection:i,config:B(B({},n),{},{canvasView:this})})},checkSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.scroll,r=this.em.get('currentFrame');n&&t.views.forEach((function(t){t._getFrame()===r&&t.scrollIntoView(n)}))},remove:function(){this.frames.remove(),this.frames={},O.a.View.prototype.remove.apply(this,arguments),this.toggleListeners()},preventDefault:function(t){t&&(t.preventDefault(),t._parentEvent&&t._parentEvent.preventDefault())},onCanvasMove:function(t){},toggleListeners:function(t){this.el;var e=t?c["on"]:c["off"];e(document,'keypress',this.onKeyPress),e(window,'scroll resize',this.clearOff)},onKeyPress:function(t){var e=this.em;' '!==Object(c["getKeyChar"])(t)||1===e.getZoomDecimal()||e.get('Canvas').isInputFocused()||(this.preventDefault(t),e.get('Editor').runCommand('core:canvas-move'))},onWheel:function(t){if((t.ctrlKey||t.metaKey)&&this.em.getConfig('multiFrames')){this.preventDefault(t);var e=this.model,n=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)),r=e.get('zoom');e.set('zoom',r+2*n)}},updateFrames:function(t){var e=this.em,n=this.model.attributes,r=n.x,i=n.y,o=this.getZoom(),a={preserveSelected:1},s=o?1/o:1;this.framesArea.style.transform="scale(".concat(o,") translate(").concat(r*s,"px, ").concat(i*s,"px)"),this.clearOff(),e.stopDefault(a),e.trigger('canvas:update',t),z&&clearTimeout(z),z=setTimeout((function(){return e.runDefault(a)}),300)},getZoom:function(){return this.em.getZoomDecimal()},isElInViewport:function(t){var e=Object(c["getElement"])(t),n=Object(c["getElRect"])(e),r=this.getFrameOffset(e),i=n.top,o=n.left;return i>=0&&o>=0&&i<=r.height&&o<=r.width},offset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(c["getElRect"])(t),r=t.ownerDocument.body,i=e.noScroll;return{top:n.top+(i?0:r.scrollTop),left:n.left+(i?0:r.scrollLeft),width:n.width,height:n.height}},clearOff:function(){this.frmOff=null,this.cvsOff=null},getFrameOffset:function(t){if(!this.frmOff||t){var e=this.frame.el,n=t&&t.ownerDocument.defaultView,r=n?n.frameElement:e;this.frmOff=this.offset(r||e)}return this.frmOff},getCanvasOffset:function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},getElementPos:function(t,e){var n=this.getZoom(),r=e||{},i=this.getFrameOffset(t),o=this.getCanvasOffset(),a=this.offset(t,e),s=r.avoidFrameOffset?0:i.top,c=r.avoidFrameOffset?0:i.left;return{top:a.top*n+s-o.top,left:a.left*n+c-o.left,height:a.height*n,width:a.width*n,zoom:n,rect:a}},getElementOffsets:function(t){var e=this;if(!t||Object(c["isTextNode"])(t))return{};var n={},r=window.getComputedStyle(t);return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft'].forEach((function(t){n[t]=parseFloat(r[t])*e.getZoom()})),n},getPosition:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.frame.el.contentDocument;if(e){var n=e.body,r=this.getZoom(),i=this.getFrameOffset(),o=this.getCanvasOffset(),a=t.noScroll;return{top:i.top+(a?0:n.scrollTop)*r-o.top,left:i.left+(a?0:n.scrollLeft)*r-o.left,width:o.width,height:o.height}}},updateScript:function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=H("<div data-id=\"".concat(n,"\">")),this.getJsContainer().appendChild(t.scriptContainer.get(0))),t.el.id=n,t.scriptContainer.html('');var r=document.createElement('script'),i=e.getScriptString(),o=e.get('script-props')?i:"function(){\n".concat(i,"\n;}"),a=JSON.stringify(e.__getScriptProps());r.innerHTML="\n      setTimeout(function() {\n        var item = document.getElementById('".concat(n,"');\n        if (!item) return;\n        (").concat(o,".bind(item))(").concat(a,")\n      }, 1);"),setTimeout((function(){var e=t.scriptContainer;e&&e.get(0).appendChild(r)}),0)},getJsContainer:function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},getFrameView:function(t){return t&&t._getFrame()||this.em.get('currentFrame')},_renderFrames:function(){if(this.ready){var t=this.model,e=this.frames,n=this.em,r=this.framesArea,i=t.get('frames');i.listenToLoad(),e.render();var o=i.at(0),a=o&&o.view;n.setCurrentFrame(a),r&&r.appendChild(e.el),this.frame=a}},render:function(){var t=this.el,e=this.$el,n=this.ppfx,r=this.config,i=this.em;e.html(this.template());var o=e.find('[data-frames]');this.framesArea=o.get(0);var a=e.find('[data-tools]');this.toolsWrapper=a.get(0),a.append("\n      <div class=\"".concat(n,"tools ").concat(n,"tools-gl\" style=\"pointer-events:none\">\n        <div class=\"").concat(n,"placeholder\">\n          <div class=\"").concat(n,"placeholder-int\"></div>\n        </div>\n      </div>\n      <div id=\"").concat(n,"tools\" style=\"pointer-events:none\">\n        ").concat(r.extHl?"<div class=\"".concat(n,"highlighter-sel\"></div>"):'',"\n        <div class=\"").concat(n,"badge\"></div>\n        <div class=\"").concat(n,"ghost\"></div>\n        <div class=\"").concat(n,"toolbar\" style=\"pointer-events:all\"></div>\n        <div class=\"").concat(n,"resizer\"></div>\n        <div class=\"").concat(n,"offset-v\"></div>\n        <div class=\"").concat(n,"offset-fixed-v\"></div>\n      </div>\n    "));var s=t.querySelector("#".concat(n,"tools"));return this.hlEl=t.querySelector(".".concat(n,"highlighter")),this.badgeEl=t.querySelector(".".concat(n,"badge")),this.placerEl=t.querySelector(".".concat(n,"placeholder")),this.ghostEl=t.querySelector(".".concat(n,"ghost")),this.toolbarEl=t.querySelector(".".concat(n,"toolbar")),this.resizerEl=t.querySelector(".".concat(n,"resizer")),this.offsetEl=t.querySelector(".".concat(n,"offset-v")),this.fixedOffsetEl=t.querySelector(".".concat(n,"offset-fixed-v")),this.toolsGlobEl=t.querySelector(".".concat(n,"tools-gl")),this.toolsEl=s,this.el.className=Object(c["getUiClass"])(i,this.className),this.ready=1,this._renderFrames(),this}});function W(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?W(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n={};return{getCanvasView:function(){return e},name:'Canvas',init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=$($($({},l),e),{},{module:this}),this.em=n.em;var r=n,i=r.scripts,o=r.styles,a=n.pStylePrefix;return a&&(n.stylePrefix=a+n.stylePrefix),t=new k({scripts:i,styles:o},e),this.model=t,this.startAutoscroll=this.startAutoscroll.bind(this),this.stopAutoscroll=this.stopAutoscroll.bind(this),this},onLoad:function(){this.model.init()},getModel:function(){return t},getConfig:function(){return n},getElement:function(){return e.el},getFrame:function(t){return this.getFrames()[t||0]},getFrameEl:function(){var t=(e||{}).frame;return t&&t.el},getFramesEl:function(){return e.framesArea},getWindow:function(){return this.getFrameEl().contentWindow},getDocument:function(){var t=this.getFrameEl();return t&&t.contentDocument},getBody:function(){var t=this.getDocument();return t&&t.body},_getCompFrame:function(t){return t&&t._getFrame()},_getLocalEl:function(t,e,n){var r=t,i=this._getCompFrame(e);return r=i?i[n]():r},getGlobalToolsEl:function(){return e.toolsGlobEl},getToolsEl:function(t){return this._getLocalEl(e.toolsEl,t,'getToolsEl')},getHighlighter:function(t){return this._getLocalEl(e.hlEl,t,'getHighlighter')},getBadgeEl:function(t){return this._getLocalEl(e.badgeEl,t,'getBadgeEl')},getPlacerEl:function(){return e.placerEl},getGhostEl:function(){return e.ghostEl},getToolbarEl:function(){return e.toolbarEl},getResizerEl:function(){return e.resizerEl},getOffsetViewerEl:function(t){return this._getLocalEl(e.offsetEl,t,'getOffsetViewerEl')},getFixedOffsetViewerEl:function(){return e.fixedOffsetEl},render:function(){return e&&e.remove(),(e=new U({model:t,config:n})).render().el},getOffset:function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());return{top:t.top-e.top,left:t.left-e.left}},offset:function(t){return e.offset(t)},setCustomBadgeLabel:function(t){n.customBadgeLabel=t},getElementPos:function(t,n){return e.getElementPos(t,n)},getElementOffsets:function(t){return e.getElementOffsets(t)},getRect:function(){var t=e.getPosition(),n=t.top,r=t.left;return $($({},e.getCanvasOffset()),{},{topScroll:n,leftScroll:r})},getTargetToElementDim:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},a=e.getPosition();if(a){var s=o.elPos||e.getElementPos(r),c=i.toRight||0,l=o.targetHeight||t.offsetHeight,u=o.targetWidth||t.offsetWidth,f=o.event||null,h=s.top-l,d=s.left;d+=c?s.width:0;var p=(d=c?d-u:d)<a.left?a.left:d,g=h<a.top?a.top:h,v={top:g=g>s.top+s.height?s.top+s.height:g,left:p,elementTop:s.top,elementLeft:s.left,elementWidth:s.width,elementHeight:s.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:a.top,canvasLeft:a.left,canvasWidth:a.width,canvasHeight:a.height};return f&&n.em&&n.em.trigger(f,v),v}},canvasRectOffset:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(t){var e=t.defaultView;return e&&e.frameElement},o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0,a=n.em.getZoomDecimal(),s=e?'top':'left',c=t.ownerDocument,l=r.offset?i(c):{},u=l.offsetTop,f=void 0===u?0:u,h=l.offsetLeft,d=void 0===h?0:h,p=c.body||{},g=p.scrollTop,v=void 0===g?0:g,m=p.scrollLeft,y=void 0===m?0:m,b=e?v:y,w=e?f:d;return o[s]-(b-w)*a};return{top:o(t,1,e),left:o(t,0,e)}},getTargetToElementFixed:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.pos||this.getElementPos(t),i=n.canvasOff||this.canvasRectOffset(t,r),o=e.offsetHeight||0,a=e.offsetWidth||0,c=r.left+r.width,l=this.getCanvasView(),u=l.getPosition(),f=l.getFrameOffset(t),h=n.event,d=-o,p=Object(s["isUndefined"])(n.left)?r.width-a:n.left;p=r.left<-p?-r.left:p,p=c>u.width?p-(c-u.width):p;var g=r.height+o,v=g<f.height;i.top<o&&(v?d+=g:d=-i.top<r.height?-i.top:r.height);var m={top:d,left:p,canvasOffsetTop:i.top,canvasOffsetLeft:i.left};return h&&this.em.trigger(h,m),m},getMouseRelativePos:function(t,e){var n=0,r=0,i=(e||{}).subWinOffset,o=t.target.ownerDocument,a=o.defaultView||o.parentWindow,s=a.frameElement,c=i?a.pageYOffset:0,l=i?a.pageXOffset:0;if(s){var u=s.getBoundingClientRect();n=u.top||0,r=u.left||0}return{y:t.clientY+n-c,x:t.clientX+r-l}},getMouseRelativeCanvas:function(t,n){var r=this.getZoomDecimal(),i=e.getPosition(n),o=i.top,a=i.left;return{y:t.clientY*r+o,x:t.clientX*r+a}},hasFocus:function(){return this.getDocument().hasFocus()},isInputFocused:function(){var t=this.getDocument(),e=this.getFrameEl(),n=['body'].concat(i()(this.getConfig().notTextable)),r=e&&document.activeElement===e?t&&t.activeElement:document.activeElement;return r&&!n.some((function(t){return r.matches(t)}))},scrollTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(c["getElement"])(t),r=n&&Object(c["getViewEl"])(n);r&&r.scrollIntoView(e)},startAutoscroll:function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.startAutoscroll()},stopAutoscroll:function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll()},setZoom:function(e){return t.set('zoom',parseFloat(e)),this},getZoom:function(){return parseFloat(t.get('zoom'))},setCoords:function(e,n){return t.set({x:parseFloat(e),y:parseFloat(n)}),this},getCoords:function(){var e=t.attributes;return{x:e.x,y:e.y}},getZoomDecimal:function(){return this.getZoom()/100},getZoomMultiplier:function(){var t=this.getZoomDecimal();return t?1/t:1},toggleFramesEvents:function(t){this.getFramesEl().style.pointerEvents=t?'':'none'},getFrames:function(){return t.get('frames').map((function(t){return t}))},addFrame:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.get('frames').add($({},e),$($({},n),{},{em:this.em}))},destroy:function(){var r=this;t.stopListening(),e&&e.remove(),[n,t,e].forEach((function(t){return{}})),['em','model','droppable'].forEach((function(t){return r[t]={}}))}}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i={stylePrefix:'cm-',inlineCss:!1},o=n(2),a=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),f=n(7),h=n.n(f),d=n(8),p=n.n(d),g=n(4),v=n.n(g),m=n(3),y=n.n(m);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=v()(t);if(e){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var x,C=function(t){h()(n,t);var e=O(n);function n(){return c()(this,n),e.apply(this,arguments)}return u()(n,[{key:"build",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.components(),r={},i=e.em;if(e.cleanId&&i){var o=i.get('CssComposer').getAll(),a=o.toJSON().map((function(t){var e=t.selectors,n=e&&1===e.length&&e.models[0];return n&&n.isId()&&n.get('name')})).filter((function(t){return t}));r.attributes=function(t,e){var n=e.id;return n&&'i'===n[0]&&!t.get('script')&&!t.get('attributes').id&&a.indexOf(n)<0&&delete e.id,e}}return e.exportWrapper?t.toHTML(w(w({},r),e.wrapperIsBody&&t.is('wrapper')&&{tag:'body'})):this.buildModels(n,r)}},{key:"buildModels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n='';return t.forEach((function(t){return n+=t.toHTML(e)})),n}}]),n}(m["Model"]),k=n(39),S=y.a.Model.extend({build:function(t){var e=t.toJSON();return this.beforeEach(e),Object(r["each"])(e,(function(t,n){var r=e[n];if(r instanceof y.a.Model)e[n]=this.build(r);else if(r instanceof y.a.Collection){var i=r;e[n]=[],i.length&&i.each((function(t,r){e[n][r]=this.build(t)}),this)}}),this),e},beforeEach:function(t){delete t.status}}),j=y.a.Model.extend({mapModel:function(t){var e='',n=t.get('script-export')||t.get('script'),i=t.get('type'),o=t.get('components'),s=t.getId();if(n){var c=t.get('attributes');c=Object(r["extend"])({},c,{id:s}),t.set('attributes',c,{silent:1});var l=t.getScriptString(n),u=t.get('script-props');if(t.get('scriptUpdated')&&!u)this.mapJs[i+'-'+s]={ids:[s],code:l};else{var f,h=this.mapJs[i];if(u&&(f=t.__getScriptProps()),h)h.ids.push(s),f&&(h.props[s]=f);else{var d={ids:[s],code:l};f&&(d.props=a()({},s,f)),this.mapJs[i]=d}}}return o.each((function(t){e+=this.mapModel(t)}),this),e},build:function(t){this.mapJs={},this.mapModel(t);var e='';for(var n in this.mapJs){var r=this.mapJs[n];if(r.props)e+="\n          var props = ".concat(JSON.stringify(r.props),";\n          var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n          var els = document.querySelectorAll(ids);\n          for (var i = 0, len = els.length; i < len; i++) {\n            var el = els[i];\n            (").concat(r.code,".bind(el))(props[el.id]);\n          }");else{var i='#'+r.ids.join(', #');e+="\n          var items = document.querySelectorAll('".concat(i,"');\n          for (var i = 0, len = items.length; i < len; i++) {\n            (function(){\n").concat(r.code,"\n}.bind(items[i]))();\n          }")}}return e}}),P=n(1);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}Object(P["hasWin"])()&&(x=n(27),n(90),n(49),n(93));var T,E=y.a.Model.extend({CodeMirror:x,defaults:{input:'',label:'',codeName:'',theme:'hopscotch',readOnly:!0,lineNumbers:!0},init:function(t){return Object(r["bindAll"])(this,'onChange'),this.editor=x.fromTextArea(t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({dragDrop:!1,lineWrapping:!0,mode:this.get('codeName')},this.attributes)),this.element=t,this.editor.on('change',this.onChange),this},onChange:function(){this.trigger('update',this)},getEditor:function(){return this.editor},getElement:function(){return this.element},setElement:function(t){return this.element=t,this},refresh:function(){return this.getEditor().refresh(),this},focus:function(){return this.getEditor().focus(),this},getContent:function(){var t=this.getEditor();return t&&t.getValue()},setContent:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor;r&&(r.setValue(t),r.autoFormatRange&&(x.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),x.commands.goDocStart(r)),!n.noRefresh&&setTimeout((function(){return e.refresh()})))}}),D=n(20),M=n.n(D),A=n(18);function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=v()(t);if(e){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var R=function(t){h()(n,t);var e=L(n);function n(){return c()(this,n),e.apply(this,arguments)}return u()(n,[{key:"template",value:function(t){var e=t.pfx,n=t.codeName,r=t.label;return Object(A["a"])(T||(T=M()(["\n      <div class=\"","editor\" id=\"","","\">\n        <div id=\"","title\">","</div>\n        <div id=\"","code\"></div>\n      </div>\n    "])),e,e,n,e,r,e)}},{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix}},{key:"render",value:function(){var t=this.model,e=this.pfx,n=this.$el,r=t.toJSON();return r.pfx=e,n.html(this.template(r)),n.attr('class',"".concat(e,"editor-c")),n.find("#".concat(e,"code")).append(t.get('input')),this}}]),n}(m["View"]);e["default"]=function(){var t={},e={},n={},o={},a={},s='CodeMirror';return{getConfig:function(){return t},config:t,EditorView:R,name:'CodeManager',init:function(e){for(var r in t=e||{},i)r in t||(t[r]=i[r]);var o=t.pStylePrefix;return o&&(t.stylePrefix=o+t.stylePrefix),n.html=new C,n.css=new k["a"],n.json=new S,n.js=new j,a.CodeMirror=new E,this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(t,n){return e[t]=n,this},getGenerator:function(t){return e[t]||null},getGenerators:function(){return e},addViewer:function(t,e){return o[t]=e,this},getViewer:function(t){return o[t]||null},getViewers:function(){return o},createViewer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(r["isUndefined"])(t.type)?s:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),i=document.createElement('div'),o=document.createElement('textarea');return i.appendChild(o),n.set(t),n.init(o),n.setElement(i),n},updateViewer:function(t,e){t.setContent(e)},getCode:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=t.em;var i=this.getGenerator(n);return i?i.build(e,r):''},loadDefaultGenerators:function(){for(var t in n)this.addGenerator(t,n[t]);return this},loadDefaultViewers:function(){for(var t in a)this.addViewer(t,a[t]);return this},destroy:function(){[t,e,n,o,a].forEach((function(t){return{}}))}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return D})),n.d(e,"evPfx",(function(){return M})),n.d(e,"evSelect",(function(){return A})),n.d(e,"evSelectBefore",(function(){return L})),n.d(e,"evUpdate",(function(){return R})),n.d(e,"evAdd",(function(){return N})),n.d(e,"evAddBefore",(function(){return I})),n.d(e,"evRemove",(function(){return F})),n.d(e,"evRemoveBefore",(function(){return V}));var r=n(2),i=n.n(r),o=n(0),a=n(22),s={default:null,devices:[{id:'desktop',name:'Desktop',width:''},{id:'tablet',name:'Tablet',width:'770px',widthMedia:'992px'},{id:'mobileLandscape',name:'Mobile landscape',width:'568px',widthMedia:'768px'},{id:'mobilePortrait',name:'Mobile portrait',width:'320px',widthMedia:'480px'}]},c=n(5),l=n.n(c),u=n(6),f=n.n(u),h=n(7),d=n.n(h),p=n(8),g=n.n(p),v=n(4),m=n.n(v),y=n(3);function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var w=function(t){d()(n,t);var e=b(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"defaults",value:function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}}},{key:"initialize",value:function(){var t=this;null===this.get('widthMedia')&&this.set('widthMedia',this.get('width')),null===this.get('width')&&this.set('width',this.get('widthMedia')),!this.get('priority')&&this.set('priority',parseFloat(this.get('widthMedia'))||0);['width','height','widthMedia'].forEach((function(e){return t.checkUnit(e)}))}},{key:"checkUnit",value:function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))}},{key:"getName",value:function(){return this.get('name')||this.get('id')}},{key:"getWidthMedia",value:function(){return this.get('widthMedia')||''}}]),n}(y["Model"]);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var x=function(t){d()(n,t);var e=O(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"comparator",value:function(t,e){var n=Number.MAX_VALUE;return(e.get('priority')||n)-(t.get('priority')||n)}},{key:"getSorted",value:function(){return this.sort()}}]),n}(y["Collection"]);x.prototype.model=w;var C,k=n(20),S=n.n(k),j=n(18);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var _=function(t){d()(n,t);var e=P(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"template",value:function(t){var e=t.ppfx,n=t.label;return Object(j["a"])(C||(C=S()(["\n      <div class=\"","device-label\">","</div>\n      <div class=\"","field ","select\">\n        <span id=\"","input-holder\">\n          <select class=\"","devices\"></select>\n        </span>\n        <div class=\"","sel-arrow\">\n          <div class=\"","d-s-arrow\"></div>\n        </div>\n      </div>\n      <button style=\"display:none\" class=\"","add-trasp\">+</button>\n    "])),e,n,e,e,e,e,e,e,e)}},{key:"events",value:function(){return{change:'updateDevice'}}},{key:"initialize",value:function(t){this.config=t.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||'',this.events['click .'+this.ppfx+'add-trasp']=this.startAdd,this.listenTo(this.em,'change:device',this.updateSelect),this.delegateEvents()}},{key:"startAdd",value:function(){}},{key:"updateDevice",value:function(){var t=this.em;if(t){var e=this.devicesEl,n=e?e.val():'';t.set('device',n)}}},{key:"updateSelect",value:function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel(),r=n?n.get('id'):'';e.val(r)}}},{key:"getOptions",value:function(){var t=this.collection,e=this.em,n='';return t.each((function(t){var r=t.attributes,i=r.name,o=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(o))||i;n+="<option value=\"".concat(o||i,"\">").concat(a,"</option>")})),n}},{key:"render",value:function(){var t=this.em,e=this.ppfx,n=this.$el,r=this.el,i=t&&t.t&&t.t('deviceManager.device');return n.html(this.template({ppfx:e,label:i})),this.devicesEl=n.find(".".concat(e,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(t.get('device')),r.className="".concat(e,"devices-c"),this}}]),n}(y["View"]);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var D='device',M="".concat(D,":"),A="".concat(M,"select"),L="".concat(A,":before"),R="".concat(M,"update"),N="".concat(M,"add"),I="".concat(N,":before"),F="".concat(M,"remove"),V="".concat(F,":before"),B='change:device';e["default"]=function(){var t,e,n={};return E(E({},a["a"]),{},{name:'DeviceManager',Device:w,Devices:x,events:{all:D,select:A,update:R,add:N,remove:F,removeBefore:V},init:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n=E(E({},s),r),o=i.em;return t=new x,n.devices.forEach((function(t){return e.add(t)})),this.em=o,this.all=t,this.select(n.default||t.at(0)),this.__initListen(),o.on(B,this._onSelect,this),this},_onSelect:function(t,e,n){var r=this.em,i=this.events,o=t.previous('device'),a=this.get(e),s=i.select;r.trigger(s,a,this.get(o)),this.__catchAllEvent(s,a,n)},add:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;if(Object(o["isString"])(e)){var a=r;n=E(E({},i=arguments[2]||{}),{},{id:e,name:i.name||e,width:a})}else n=e;return n.id||(n.id=n.name||this._createId()),t.add(n,i)},get:function(e){return this.getAll().filter((function(t){return t.get('name')===e}))[0]||t.get(e)||null},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)},getDevices:function(){return t.models},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(o["isString"])(t)?this.get(t):t;return n&&this.em.set('device',n.get('id'),e),this},getSelected:function(){return this.get(this.em.get('device'))},getAll:function(){return t},render:function(){return e&&e.remove(),(e=new _({collection:t,config:n})).render().el},destroy:function(){t.stopListening(),t.reset(),e&&e.remove(),[t,e].forEach((function(t){return null})),n={}}})}},function(t,e,n){"use strict";n.r(e),n.d(e,"evAll",(function(){return L})),n.d(e,"evPfx",(function(){return R})),n.d(e,"evAdd",(function(){return N})),n.d(e,"evUpdate",(function(){return I})),n.d(e,"evRemove",(function(){return F})),n.d(e,"evRemoveBefore",(function(){return V})),n.d(e,"evCustom",(function(){return B})),n.d(e,"evState",(function(){return z}));var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1),l=n(3),u=n.n(l),f=n(22),h={stylePrefix:'clm-',appendTo:'',selectors:[],states:[{name:'hover'},{name:'active'},{name:'nth-of-type(2n)'}],escapeName:0,selectedName:0,iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',render:0,componentFirst:0,custom:!1},d=n(17),p=n(21),g=n(5),v=n.n(g),m=n(6),y=n.n(m),b=n(7),w=n.n(b),O=n(8),x=n.n(O),C=n(4),k=n.n(C);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=k()(t);if(e){var i=k()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x()(this,n)}}var j=function(t){w()(n,t);var e=S(n);function n(){return v()(this,n),e.apply(this,arguments)}return y()(n,[{key:"defaults",value:function(){return{name:'',label:''}}},{key:"getName",value:function(){return this.get('name')}},{key:"getLabel",value:function(){return this.get('label')||this.getName()}}]),n}(l["Model"]);j.prototype.idAttribute='name';var P='contentEditable',_=u.a.View.extend({template:function(){var t=this.pfx,e=this.model,n=this.config,r=e.get('label')||'';return"\n      <span id=\"".concat(t,"checkbox\" class=\"").concat(t,"tag-status\" data-tag-status></span>\n      <span id=\"").concat(t,"tag-label\" data-tag-name>").concat(r,"</span>\n      <span id=\"").concat(t,"close\" class=\"").concat(t,"tag-close\" data-tag-remove>\n        ").concat(n.iconTagRemove,"\n      </span>\n    ")},events:{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config||{};this.config=e,this.module=t.module,this.coll=t.coll||null,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.em=e.em,this.listenTo(this.model,'change:active',this.updateStatus)},getInputEl:function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},startEditTag:function(){var t=this.em,e=this.getInputEl();e[P]=!0,e.focus(),t&&t.setEditing(1)},endEditTag:function(){var t=this.model,e=this.getInputEl(),n=e.textContent,r=this.em,i=r&&r.get('SelectorManager');if(e[P]=!1,r&&r.setEditing(0),i){var o=i.escapeName(n);i.get(o)?e.innerText=t.get('label'):t.set({name:o,label:n})}},changeStatus:function(){var t=this.model;t.set('active',!t.get('active'))},removeTag:function(){this.module.removeSelected(this.model)},updateStatus:function(){var t=this.model,e=this.$el,n=this.config,r=n.iconTagOn,i=n.iconTagOff,o=e.find('[data-tag-status]');t.get('active')?(o.html(r),e.removeClass('opac50')):(o.html(i),e.addClass('opac50'))},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}}),T=u.a.View.extend({template:function(t){var e=t.labelInfo,n=t.labelHead,r=t.iconSync,i=t.iconAdd,o=t.pfx,a=t.ppfx;return"\n    <div id=\"".concat(o,"up\" class=\"").concat(o,"header\">\n      <div id=\"").concat(o,"label\" class=\"").concat(o,"header-label\">").concat(n,"</div>\n      <div id=\"").concat(o,"status-c\" class=\"").concat(o,"header-status\">\n        <span id=\"").concat(o,"input-c\" data-states-c>\n          <div class=\"").concat(a,"field ").concat(a,"select\">\n            <span id=\"").concat(a,"input-holder\">\n              <select id=\"").concat(o,"states\" data-states></select>\n            </span>\n            <div class=\"").concat(a,"sel-arrow\">\n              <div class=\"").concat(a,"d-s-arrow\"></div>\n            </div>\n          </div>\n        </span>\n      </div>\n    </div>\n    <div id=\"").concat(o,"tags-field\" class=\"").concat(a,"field\">\n      <div id=\"").concat(o,"tags-c\" data-selectors></div>\n      <input id=\"").concat(o,"new\" data-input/>\n      <span id=\"").concat(o,"add-tag\" class=\"").concat(o,"tags-btn ").concat(o,"tags-btn__add\" data-add>\n        ").concat(i,"\n      </span>\n      <span class=\"").concat(o,"tags-btn ").concat(o,"tags-btn__sync\" style=\"display: none\" data-sync-style>\n        ").concat(r,"\n      </span>\n    </div>\n    <div class=\"").concat(o,"sels-info\">\n      <div class=\"").concat(o,"label-sel\">").concat(e,":</div>\n      <div class=\"").concat(o,"sels\" data-selected></div>\n    </div>")},events:{'change [data-states]':'stateChanged','click [data-add]':'startNewTag','focusout [data-input]':'endNewTag','keyup [data-input]':'onInputKeyUp','click [data-sync-style]':'syncStyle'},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e.config||{},this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.className=this.pfx+'tags',this.stateInputId=this.pfx+'states',this.stateInputC=this.pfx+'input-c',this.states=this.config.states||[];var n=this.config.em,r=this.collection;this.target=this.config.em;var i=e.module;this.module=i,this.em=n;var o='component:toggled component:update:classes',a='component:update:classes change:state';this.listenTo(n,o,this.componentChanged),this.listenTo(n,'styleManager:update',this.componentChanged),this.listenTo(n,a,this.__handleStateChange),this.listenTo(n,'styleable:change change:device',this.checkSync),this.listenTo(r,'add',this.addNew),this.listenTo(r,'reset',this.renderClasses),this.listenTo(r,'remove',this.tagRemoved),this.listenTo(i.getAll(),i.events.state,Object(s["debounce"])((function(){return t.renderStates()}))),this.delegateEvents()},syncStyle:function(){var t,e=this.em,n=this.getTarget(),r=e.get('CssComposer'),i=this.getCommonSelectors({opts:{noDisabled:1}}),o=e.get('state'),a=e.getCurrentMedia(),s=[],c=r.get(i,o,a)||r.add(i,o,a);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:o,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&c.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:i,mediaText:a,rule:c,ruleComponents:s,state:o})},tagRemoved:function(t){this.updateStateVis()},addNew:function(t){this.addToClasses(t)},startNewTag:function(){this.$addBtn.css({display:'none'}),this.$input.show().focus()},endNewTag:function(){this.$addBtn.css({display:''}),this.$input.hide().val('')},onInputKeyUp:function(t){13===t.keyCode?this.addNewTag(this.$input.val()):27===t.keyCode&&this.endNewTag()},checkStates:function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},componentChanged:Object(s["debounce"])((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.targets;this.updateSelection(e)})),updateSelection:function(t){var e=t||this.getTargets(),n=[];return(e=Object(s["isArray"])(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},getCommonSelectors:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.targets,n=t.opts,r=void 0===n?{}:n,i=e||this.getTargets();return this.module.__getCommonSelectors(i,r)},_commonSelectors:function(){var t;return(t=this.module).__common.apply(t,arguments)},checkSync:Object(s["debounce"])((function(){var t,e=this.$btnSyncEl,n=this.config,r=this.collection,i=this.getTarget();if(i&&n.componentFirst&&r.length){var o=i.getStyle();t=!Object(s["isEmpty"])(o)}e&&e[t?'show':'hide']()})),getTarget:function(){return this.target.getSelected()},getTargets:function(){return this.target.getSelectedAll()},updateStateVis:function(t){var e=this.em,n=e&&e.getConfig('avoidInlineStyle'),r=this.collection.length||n?'':'none';this.getStatesC().css('display',r),this.updateSelector(t)},__handleStateChange:function(){this.updateSelector(this.getTargets())},updateSelector:function(t){var e=this,n=this.el.querySelector('[data-selected]'),r=[],i=t||this.getTargets();(i=Object(s["isArray"])(i)?i:[i]).forEach((function(t){return r.push(e.__getName(t))})),n&&(n.innerHTML=r.join(', ')),this.checkStates()},__getName:function(t){var e,n=this.pfx,r=this.config,i=this.em,o=r.selectedName,a=r.componentFirst;if(Object(s["isString"])(t))e="<span class=\"".concat(n,"sel-gen\">").concat(t,"</span>");else{var c=t&&t.get&&t.getSelectors();if(!c)return;var l=c.getStyleable(),u=i.get('state'),f=t.getId?"<span class=\"".concat(n,"sel-cmp\">").concat(t.getName(),"</span><span class=\"").concat(n,"sel-id\">#").concat(t.getId(),"</span>"):'';e=(e=this.collection.getFullString(l))?"<span class=\"".concat(n,"sel-rule\">").concat(e,"</span>"):t.get('selectorsAdd')||f,e=a&&f?f:e,e+=u?"<span class=\"".concat(n,"sel-state\">:").concat(u,"</span>"):'',e=o?o({result:e,state:u,target:t}):e}return e&&"<span class=\"".concat(n,"sel\">").concat(e,"</span>")},stateChanged:function(t){var e=this.em,n=t.target.value;e.set('state',n)},addNewTag:function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},addToClasses:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.getClasses(),i=new _({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(i):r.append(i),i},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)},getClasses:function(){return this.$el.find('[data-selectors]')},getStates:function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},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"<option value=\"".concat(t.id,"\">").concat(n,"</option>")})).join(''),i=this.getStates();i&&i.html("<option value=\"\">".concat(n,"</option>").concat(r)),this.checkStates()},render:function(){var t=this.em,e=this.pfx,n=this.ppfx,r=this.config,i=this.$el,o=this.el,a=r.render,s={iconSync:r.iconSync,iconAdd:r.iconAdd,labelHead:t.t('selectorManager.label'),labelInfo:t.t('selectorManager.selected'),ppfx:n,pfx:e,el:o};i.html(this.template(s));var c=a&&a(s);return c&&c!==o&&i.empty().append(c),this.$input=i.find('[data-input]'),this.$addBtn=i.find('[data-add]'),this.$classes=i.find('#'+e+'tags-c'),this.$btnSyncEl=i.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr('class',"".concat(this.className," ").concat(n,"one-bg ").concat(n,"two-color")),this}});function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var M=function(t){return Object(s["isString"])(t)&&'#'==t[0]},A=function(t){return Object(s["isString"])(t)&&'.'==t[0]},L='selector',R="".concat(L,":"),N="".concat(R,"add"),I="".concat(R,"update"),F="".concat(R,"remove"),V="".concat(F,":before"),B="".concat(R,"custom"),z="".concat(R,"state");e["default"]=function(){return D(D({},f["a"]),{},{name:'SelectorManager',Selector:d["a"],Selectors:p["a"],events:{all:L,update:I,add:N,remove:F,removeBefore:V,state:z,custom:B},init:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(h,e);var n=this.getConfig(),r=n.em,i=n.pStylePrefix;i&&(n.stylePrefix=i+n.stylePrefix),this.all=new p["a"](n.selectors),this.selected=new p["a"]([],{em:r,config:n}),this.states=new l["Collection"](n.states,{model:j}),this.model=new l["Model"]({cFirst:n.componentFirst,_undo:!0}),this.__initListen({collections:[this.states,this.selected],propagate:[{entity:this.states,event:this.events.state}]}),r.on('change:state',(function(t,e){return r.trigger(z,e)})),this.model.on('change:cFirst',(function(t,e){return r.trigger('selector:type',e)}));var o='component:toggled component:update:classes change:device styleManager:update selector:state selector:type';return this.model.listenTo(r,o,(function(){return t.__update()})),this},__update:Object(s["debounce"])((function(){this.__trgCustom()})),__trgCustom:function(t){this.em.trigger(this.events.custom,this.__customData(t))},__customData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.container;return{states:this.getStates(),selected:this.getSelected(),container:e}},postRender:function(){this.__appendTo(),this.__trgCustom()},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.em.get('StyleManager').select(n,e),i=this.selectorTags,o=r.filter((function(t){return t})).map((function(t){return Object(c["isComponent"])(t)||Object(c["isRule"])(t)&&!t.get('selectorsAdd')?t:t.getSelectorsString()}));return i&&i.componentChanged({targets:o}),this},addSelector:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=D({},e);Object(s["isObject"])(t)?r=t:r.name=t,M(r.name)?(r.name=r.name.substr(1),r.type=d["a"].TYPE_ID):A(r.name)&&(r.name=r.name.substr(1)),r.label&&!r.name&&(r.name=this.escapeName(r.label));var i=r.name,o=this.getConfig(),a=this.getAll(),c=i?this.get(i,r.type):a.where(r)[0];return c||a.add(r,D(D({},n),{},{config:o}))},getSelector:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d["a"].TYPE_CLASS;return M(t)?(t=t.substr(1),e=d["a"].TYPE_ID):A(t)&&(t=t.substr(1)),this.getAll().where({name:t,type:e})[0]},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(s["isString"])(t)?{}:n;return Object(s["isArray"])(t)?t.map((function(t){return e.addSelector(t,n,r)})):this.addSelector(t,n,r)},addClass:function(t){var e=this,n=[];return Object(s["isString"])(t)&&(t=t.trim().split(' ')),t.forEach((function(t){return n.push(e.addSelector(t))})),n},get:function(t,e){var n=this;if(Object(s["isArray"])(t)){var r=[];return t.map((function(t){return n.getSelector(t)})).filter((function(t){return t})).forEach((function(t){return r.indexOf(t)<0&&r.push(t)})),r}return this.getSelector(t,e)||null},remove:function(t,e){return this.__remove(t,e)},setState:function(t){return this.em.setState(t),this},getState:function(){return this.em.getState()},getStates:function(){return i()(this.states.models)},setStates:function(t,e){return this.states.reset(t,e)},getSelected:function(){return this.__getCommon()},addSelected:function(t){var e=this.add(t);this.em.getSelectedAll().forEach((function(t){t.getSelectors().add(e)}))},removeSelected:function(t){this.em.getSelectedAll().forEach((function(e){!t.get('protected')&&e&&e.getSelectors().remove(t)}))},getSelectedTargets:function(){return this.em.get('StyleManager').getSelected()},setComponentFirst:function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},getComponentFirst:function(){return this.getConfig().componentFirst},escapeName:function(t){var e=this.getConfig().escapeName;return e?e(t):d["a"].escapeName(t)},render:function(t){this.em;var e=this.selectorTags,n=this.getConfig(),r=e&&e.el;return this.selected.reset(t),this.selectorTags=new T({el:r,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},destroy:function(){var t=this.selectorTags;this.model.stopListening(),this.__destroy(),t&&t.remove(),this.selectorTags={}},__getCommon:function(){return this.__getCommonSelectors(this.em.getSelectedAll())},__getCommonSelectors:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.map((function(t){return t.getSelectors&&t.getSelectors().getValid(e)})).filter(Boolean);return this.__common.apply(this,i()(n))},__common:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.length?1===n.length?n[0]:2===n.length?n[0].filter((function(t){return n[1].indexOf(t)>=0})):n.slice(1).reduce((function(e,n){return t.__common(e,n)}),n[0]):[]}})}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o={id:'gjs-',autosave:1,autoload:1,type:'local',stepsBeforeSave:1,storeComponents:1,storeStyles:1,storeHtml:1,storeCss:1,checkLocal:1,params:{},headers:{},urlStore:'',urlLoad:'',beforeSend:function(t,e){},onComplete:function(t,e){},contentTypeJson:!0,credentials:'include',fetchOptions:''},a=n(3),s=n.n(a),c=n(1),l=a["Model"].extend({defaults:{checkLocal:!0},store:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(this.hasLocal())for(var n in t)localStorage.setItem(n,t[n]);e&&e()},load:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n={};if(this.hasLocal())for(var r=0,i=t.length;r<i;r++){var o=localStorage.getItem(t[r]);o&&(n[t[r]]=o)}return e&&e(n),n},remove:function(t){if(this.hasLocal())for(var e=0,n=t.length;e<n;e++)localStorage.removeItem(t[e])},hasLocal:function(){var t=Object(c["hasWin"])();return!!(!this.get('checkLocal')||t&&localStorage)||(t&&console.warn("Your browser doesn't support localStorage"),!1)}}),u=n(36),f=n(0);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p=s.a.Model.extend({fetch:u["a"],defaults:{urlStore:'',urlLoad:'',params:{},beforeSend:function(){},onComplete:function(){},contentTypeJson:!1,credentials:'include',fetchOptions:''},onStart:function(){this.get('em');var t=this.get('beforeSend');t&&t()},onError:function(t,e){if(e)e(t);else{var n=this.get('em');console.error(t),n&&n.trigger('storage:error',t)}},onResponse:function(t,e){var n=this.get('em'),r=this.get('onComplete'),i=this.get('contentTypeJson')&&(t&&'string'==typeof t)?JSON.parse(t):t;r&&r(i),e&&e(i),n&&n.trigger('storage:response',i)},store:function(t,e,n){var r={};for(var i in t)r[i]=t[i];this.request(this.get('urlStore'),{body:r},e,n)},load:function(t,e,n){this.request(this.get('urlLoad'),{method:'get'},e,n)},request:function(t){var e,n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=this.get('contentTypeJson'),c=this.get('headers')||{},l=this.get('params'),u='X-Requested-With',h='Content-Type',p=i.body||{};for(var g in l)p[g]=l[g];if(Object(f["isUndefined"])(c[u])&&(c[u]='XMLHttpRequest'),Object(f["isUndefined"])(c[h])&&s&&(c[h]='application/json; charset=utf-8'),s)n=JSON.stringify(p);else for(var v in n=new FormData,p)n.append(v,p[v]);'post'===(e={method:i.method||'post',credentials:this.get('credentials'),headers:c}).method&&(e.body=n);var m=this.get('fetchOptions')||{},y=Object(f["isFunction"])(m)?m(e):e;this.onStart(),this.fetch(t,d(d({},e),y||{})).then((function(t){return 1==(t.status/200|0)?t.text():t.text().then((function(t){return Promise.reject(t)}))})).then((function(t){return r.onResponse(t,o)})).catch((function(t){return r.onError(t,a)}))}});function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var m='storage:start',y='storage:after',b='storage:end',w='storage:error';e["default"]=function(){var t,e={},n={},r={};return{name:'StorageManager',init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=v(v({},o),n),t=e.em,e._disable&&(e.type=0),r.remote=new p(e),r.local=new l(e),e.currentStorage=e.type,this.loadDefaultProviders().setCurrent(e.type),this},getConfig:function(){return e},isAutosave:function(){return!!e.autosave},setAutosave:function(t){return e.autosave=!!t,this},getStepsBeforeSave:function(){return e.stepsBeforeSave},setStepsBeforeSave:function(t){return e.stepsBeforeSave=t,this},add:function(t,e){return n[t]=e,this},get:function(t){return n[t]||null},getStorages:function(){return n},getCurrent:function(){return e.currentStorage},setCurrent:function(t){return e.currentStorage=t,this},store:function(t,n){var r=this,i=this.get(this.getCurrent()),o={};for(var a in this.onStart('store',t),t)o[e.id+a]=t[a];return i?i.store(o,(function(t){r.onAfter('store',t),n&&n(t),r.onEnd('store',t)}),(function(t){r.onError('store',t)})):null},load:function(t,n){var r=this,i=this.get(this.getCurrent()),o=[],a={};'string'==typeof t&&(t=[t]),this.onStart('load',t);for(var s=0,c=t.length;s<c;s++)o.push(e.id+t[s]);i?i.load(o,(function(t){a=r.__clearKeys(t),r.onAfter('load',a),n&&n(a),r.onEnd('load',a)}),(function(t){n&&n(a),r.onError('load',t)})):n&&n(a)},__clearKeys:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},r=new RegExp('^'+e.id);for(var i in t){var o=i.replace(r,'');n[o]=t[i]}return n},loadDefaultProviders:function(){for(var t in r)this.add(t,r[t]);return this},getCurrentStorage:function(){return this.get(this.getCurrent())},onStart:function(e,n){t&&(t.trigger(m),e&&t.trigger("".concat(m,":").concat(e),n))},onAfter:function(e,n){t&&(t.trigger(y),e&&t.trigger("".concat(y,":").concat(e),n))},onEnd:function(e,n){t&&(t.trigger(b),e&&t.trigger("".concat(b,":").concat(e),n))},onError:function(e,n){t&&(t.trigger(w,n),e&&t.trigger("".concat(w,":").concat(e),n),this.onEnd(e,n))},canAutoload:function(){return this.getCurrentStorage()&&this.getConfig().autoload},destroy:function(){[e,t,n,r].forEach((function(t){return{}}))}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o={textTags:['br','b','i','u','a','ul','ol'],parserCss:null,parserHtml:null,htmlType:null},a=n(0),s={4:'media',5:'font-face',6:'page',7:'keyframes',11:'counter-style',12:'supports',13:'document',14:'font-feature-values',15:'viewport'},c=Object(a["keys"])(s),l=['5','6','11','15'],u=['font-face','page','counter-style','viewport'],f=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=[],n=[],r=t.split(','),i=0,o=r.length;i<o;i++){var a=r[i].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(a)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(a)){var s=a.split('.').filter(Boolean);n.push(s)}else e.push(a)}return{result:n,add:e}},h=function(t){for(var e=t.style,n={},r=0,i=e.length;r<i;r++){var o=e[r],a=e.getPropertyValue(o),s=e.getPropertyPriority(o);n[o]="".concat(a).concat(s?" !".concat(s):'')}return n},d=function(t){return(t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||'').trim()},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=t.length,o=t[i-1],a=o?o.split(/:(.+)/):[],s=a[1],c=n.atRule,l=n.selectorsAdd,f=n.mediaText,h=u.indexOf(c)>=0;return h&&(r.singleAtRule=1),c&&(r.atRuleType=c),l&&(r.selectorsAdd=l),f&&(r.mediaText=f),s&&(t[i-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},g=function(t){var e=document.createElement('style');e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;return document.head.removeChild(e),function t(e){for(var n=[],r=e.cssRules||[],i=0,o=r.length;i<o;i++){var a=r[i],u=a.type.toString(),g=0,v='',m='',y=a.selectorText||a.keyText,b=l.indexOf(u)>=0;if(b)g=1,v=s[u],m=d(a);else if(c.indexOf(u)>=0){var w=t(a);m=d(a);for(var O=0,x=w.length;O<x;O++){var C=w[O];m&&(C.mediaText=m),C.atRuleType=s[u]}n=n.concat(w)}if(y||b){for(var k=h(a),S=f(y),j=S.add,P=void 0,_=0,T=(y=S.result).length;_<T;_++){var E=p(y[_],k,{atRule:s[u]});n.push(E),P=E}if(j.length){var D=j.join(', ');if(P)P.selectorsAdd=D;else{var M={selectors:[],selectorsAdd:D,style:k};g&&(M.singleAtRule=g),v&&(M.atRuleType=v),m&&(M.mediaText=m),n.push(M)}}}}return n}(n)},v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{parse:function(e){var n=this,r=[],i=t.parserCss,o=t.em,a=o&&o.get&&o.get('Editor');return(i?i(e,a):g(e)).forEach((function(t){return r=r.concat(n.checkNode(t))})),o&&o.trigger('parse:css',{input:e,output:r}),r},checkNode:function(t){var e=t,n=e.selectors,r=e.style;if(Object(a["isString"])(n)){var i=[],o=f(n),s=o.result,c=o.add.join(', '),l={atRule:t.atRule,mediaText:t.params};if(s.length?s.forEach((function(t){i.push(p(t,r,l))})):i.push(p([],r,l)),c)i[i.length-1].selectorsAdd=c;t=i}return t}}},m=n(42);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n={};return{compTypes:'',parserCss:null,parserHtml:null,name:'Parser',init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(n=b(b({},o),r)).Parser=this,t=new m["a"](n),e=new v(n),this.em=n.em,this.parserCss=e,this.parserHtml=t,this},getConfig:function(){return n},parseHtml:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=this.compTypes;return t.compTypes=i?i.get('DomComponents').getTypes():o,t.parse(n,e,r)},parseCss:function(t){return e.parse(t)},destroy:function(){var r=this;[n,t,e].forEach((function(t){return{}})),['em','parserCss','parserHtml'].forEach((function(t){return r[t]={}}))}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a=n(13),s={stylePrefix:'mdl-',title:'',content:'',backdrop:!0,custom:!1,extend:{}},c=n(5),l=n.n(c),u=n(6),f=n.n(u),h=n(7),d=n.n(h),p=n(8),g=n.n(p),v=n(4),m=n.n(v),y=n(3);function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var w=function(t){d()(n,t);var e=b(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"defaults",value:function(){return{title:'',content:'',attributes:{},open:!1}}},{key:"open",value:function(){this.set('open',!0)}},{key:"close",value:function(){this.set('open',!1)}}]),n}(y["Model"]);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var k=function(t){d()(n,t);var e=C(n);function n(){return l()(this,n),e.apply(this,arguments)}return f()(n,[{key:"template",value:function(t){var e=t.pfx,n=t.ppfx,r=t.content,i=t.title;return"<div class=\"".concat(e,"dialog ").concat(n,"one-bg ").concat(n,"two-color\">\n      <div class=\"").concat(e,"header\">\n        <div class=\"").concat(e,"title\">").concat(i,"</div>\n        <div class=\"").concat(e,"btn-close\" data-close-modal>&Cross;</div>\n      </div>\n      <div class=\"").concat(e,"content\">\n        <div id=\"").concat(e,"c\">").concat(r,"</div>\n        <div style=\"clear:both\"></div>\n      </div>\n    </div>\n    <div class=\"").concat(e,"collector\" style=\"display: none\"></div>")}},{key:"events",value:function(){return{click:'onClick','click [data-close-modal]':'hide'}}},{key:"initialize",value:function(t){var e=this.model,n=t.config||{},r=n.stylePrefix||'';this.config=n,this.pfx=r,this.ppfx=n.pStylePrefix||'',this.listenTo(e,'change:open',this.updateOpen),this.listenTo(e,'change:title',this.updateTitle),this.listenTo(e,'change:content',this.updateContent)}},{key:"onClick",value:function(t){this.config.backdrop&&t.target===this.el&&this.hide()}},{key:"getCollector",value:function(){return this.$collector||(this.$collector=this.$el.find('.'+this.pfx+'collector')),this.$collector}},{key:"getContent",value:function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content}},{key:"getTitle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.$title||(this.$title=this.$el.find('.'+this.pfx+'title')),t.$?this.$title:this.$title.get(0)}},{key:"updateContent",value: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)}},{key:"updateTitle",value:function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get('title'))}},{key:"updateOpen",value:function(){this.el.style.display=this.model.get('open')?'':'none'}},{key:"hide",value:function(){this.model.close()}},{key:"show",value:function(){this.model.open()}},{key:"updateAttr",value:function(t){var e=this.pfx,n=this.$el,r=this.el,i=[].slice.call(r.attributes).map((function(t){return t.name}));n.removeAttr(i.join(' ')),n.attr(x(x({},t||{}),{},{class:"".concat(e,"container ").concat(t&&t.class||'').trim()}))}},{key:"render",value: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}}]),n}(y["View"]);function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n={},r=function(t,e){e&&e.trigger("modal:".concat(t?'open':'close'))};return{name:'Modal',getConfig:function(){return n},init:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(n=j(j({},s),i)).em;this.em=a;var c=n.pStylePrefix;return c&&(n.stylePrefix=c+n.stylePrefix),(t=new w(n)).on('change:open',(function(t,e){return r(e,a)})),t.on('change',Object(o["debounce"])((function(){var t=e._evData(),n=e.getConfig().custom;Object(o["isFunction"])(n)&&n(t),a.trigger('modal',t)}))),this},_evData:function(){var e=this,n=this.getTitle(),r=this.getContent(),i=t.attributes;return{open:i.open,attributes:i.attributes,title:Object(o["isString"])(n)?Object(a["g"])(n):n,content:Object(o["isString"])(r)?Object(a["g"])(r):r.get?r.get(0):r,close:function(){return e.close()}}},postRender:function(t){var e=t.model.getConfig().el||t.el,n=this.render();n&&n.appendTo(e)},open:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.attributes||{};return n.title&&this.setTitle(n.title),n.content&&this.setContent(n.content),t.set('attributes',r),t.open(),e&&e.updateAttr(r),this},close:function(){return t.close(),this},onceClose:function(t){return this.em.once('modal:close',t),this},onceOpen:function(t){return this.em.once('modal:open',t),this},isOpen:function(){return!!t.get('open')},setTitle:function(e){return t.set('title',e),this},getTitle:function(){return t.get('title')},setContent:function(e){return t.set('content',' '),t.set('content',e),this},getContent:function(){return t.get('content')},getContentEl:function(){return e.getContent().get(0)},getModel:function(){return t},render:function(){if(!this.getConfig().custom){var r=k.extend(n.extend),i=e&&e.el;return(e=new r({el:i,model:t,config:n})).render().$el}},destroy:function(){e&&e.remove(),[n,t,e].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(1),l={stylePrefix:'css-',rules:[],onBeforeStyle:null},u=n(5),f=n.n(u),h=n(6),d=n.n(h),p=n(7),g=n.n(p),v=n(8),m=n.n(v),y=n(4),b=n.n(y),w=n(3),O=n.n(w),x=n(32),C=n(21),k=n(39);function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=b()(t);if(e){var i=b()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var _=(Object(c["hasWin"])()?window:{}).CSS,T=function(t){g()(n,t);var e=P(n);function n(){return f()(this,n),e.apply(this,arguments)}return d()(n,[{key:"defaults",value:function(){return{selectors:[],selectorsAdd:'',style:{},mediaText:'',state:'',stylable:!0,atRuleType:'',singleAtRule:!1,important:!1,group:'',_undo:!0}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{},this.opt=e,this.em=e.em,this.ensureSelectors(),this.on('change',this.__onChange)}},{key:"__onChange",value:function(t,e){var n=this.em,r=this.changedAttributes();!Object(c["isEmptyObj"])(r)&&n&&n.changesUp(e)}},{key:"clone",value:function(){var t=j({},this.opt),e=j({},this.attributes);return e.selectors=this.get('selectors').map((function(t){return t.clone()})),new this.constructor(e,t)}},{key:"ensureSelectors",value:function(t,e,n){var r=this.em,o=r&&r.get('SelectorManager'),a=[this,'change:selectors',this.ensureSelectors],c=this.getSelectors();if(this.stopListening.apply(this,a),c.models&&(c=i()(c.models)),c=Object(s["isString"])(c)?[c]:c,Array.isArray(c)){var l=c.filter((function(t){return t})).map((function(t){return o?o.add(t):t}));c=new C["a"](l)}this.set('selectors',c,n),this.listenTo.apply(this,a)}},{key:"getAtRule",value:function(){var t=this.get('atRuleType'),e=this.get('mediaText'),n=t?"@".concat(t):e?'@media':'';return n+(e&&n?" ".concat(e):'')}},{key:"selectorsToString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.get('state'),r=this.get('wrapper'),i=this.get('selectorsAdd'),o=r&&t.body,a={escape:function(t){return _&&_.escape?_.escape(t):t}},s=o?'body':this.get('selectors').getFullString(0,a),c=n&&!t.skipState?":".concat(n):'';return s&&e.push("".concat(s).concat(c)),i&&!t.skipAdd&&e.push(i),e.join(', ')}},{key:"getDeclaration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.selectorsToString(t),r=this.styleToString(t),i=this.get('singleAtRule');return(n||i)&&(r||t.allowEmpty)&&(e=i?r:"".concat(n,"{").concat(r,"}")),e}},{key:"getDevice",value:function(){var t=this.em,e=this.attributes,n=e.atRuleType,r=e.mediaText,i=(null==t?void 0:t.get('DeviceManager').getDevices())||[],o=i.filter((function(t){return''===t.getWidthMedia()}))[0];return'media'===n&&r?i.filter((function(t){return t.getWidthMedia()===Object(k["b"])(r)}))[0]||null:o||null}},{key:"getState",value:function(){var t=this.em,e=this.get('state');return(t.get('SelectorManager').getStates()||[]).filter((function(t){return t.getName()===e}))[0]||null}},{key:"getComponent",value:function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),r=n&&n.isId()&&n.get('name');return r&&(null===(t=this.em)||void 0===t?void 0:t.get('DomComponents').getById(r))||null}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.getAtRule(),r=this.getDeclaration(t);return(r||t.allowEmpty)&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e}},{key:"toJSON",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=w["Model"].prototype.toJSON.apply(this,e);if(this.em.getConfig('avoidDefaults')){var i=this.defaults();Object(s["forEach"])(i,(function(t,e){r[e]===t&&delete r[e]})),Object(s["isEmpty"])(r.selectors)&&delete r.selectors,Object(s["isEmpty"])(r.style)&&delete r.style}return r}},{key:"compare",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e||'',o=n||'',a=r.selectorsAdd||'',c=r.atRuleType||'',l=Object(s["isArray"])(t)||t.models?t.models||t:[t];o&&!c&&(c='media');var u=l.map((function(t){return t.getFullName()})),f=this.get('selectors').map((function(t){return t.getFullName()})),h=u.slice().sort(),d=f.slice().sort();return!(u.length!==f.length||!h.every((function(t,e){return t===d[e]})))&&(this.get('state')===i&&this.get('mediaText')===o&&this.get('selectorsAdd')===a&&this.get('atRuleType')===c)}}]),n}(w["Model"].extend(x["a"])),E=O.a.Collection,D=E.extend({model:T,initialize:function(t,e){var n=this;e&&e.em&&(this.editor=e.em),setTimeout((function(){n.on('remove',n.onRemove),n.on('add',n.onAdd)}))},toJSON:function(t){return E.prototype.toJSON.call(this,t).filter((function(t){return t.style}))},onAdd:function(t,e,n){t.ensureSelectors(t,e,n)},onRemove:function(t){var e=this.editor;e.stopListening(t),e.get('UndoManager').remove(t)},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return'string'==typeof t&&(t=this.editor.get('Parser').parseCss(t)),e.em=this.editor,E.prototype.add.apply(this,[t,e])}}),M=n(41),A=n(17);function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n,r={};return{Selectors:C["a"],name:'CssComposer',getConfig:function(){return r},storageKey:function(){var t=[],e=r.stm&&r.stm.getConfig()||{};return e.storeCss&&t.push('css'),e.storeStyles&&t.push('styles'),t},init:function(n){for(var i in r=n||{},l)i in r||(r[i]=l[i]);var o=r.pStylePrefix;o&&(r.stylePrefix=o+r.stylePrefix);var a=r.em&&r.em.config.style||'';return r.rules=a||r.rules,t=r.em,e=new D([],r),this},onLoad:function(){e.add(r.rules,{silent:1})},postLoad:function(){var e=t&&t.get('UndoManager');e&&e.add(this.getAll())},load:function(t){var n=t||'';!n&&r.stm&&(n=r.em.getCacheLoad());var i=n.styles||'';if(n.styles)try{i=JSON.parse(n.styles)}catch(t){}else n.css&&(i=r.em.get('Parser').parseCss(n.css));return Object(s["isArray"])(i)?i.length&&e.reset(i):i&&e.reset(i),i},store:function(n){if(r.stm){var i={},o=this.storageKey(),a=t&&t.get('hasPages');return o.indexOf('css')>=0&&!a&&(i.css=r.em.getCss()),o.indexOf('styles')>=0&&(i.styles=JSON.stringify(e)),n||r.stm.store(i),i}},add:function(t,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=n||'',c=i||'',l=R({},o),u=this.get(t,s,c,l);return u&&u.config&&!u.config.singleAtRule||(l.state=s,l.mediaText=c,l.selectors=[],c&&(l.atRuleType='media'),(u=new T(l,r)).get('selectors').add(t,a),e.add(u,a)),u},get:function(n,r,i,o){var a=n;if(Object(s["isString"])(n)){var c=t.get('SelectorManager'),l=n.split(',')[0].trim(),u=t.get('Parser').parserCss.checkNode({selectors:l})[0];a=c.get(u.selectors)}return e.find((function(t){return t.compare(a,r,i,o)}))||null},getAll:function(){return e},addCollection:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[];Object(s["isString"])(e)&&(e=t.get('Parser').parseCss(e));for(var a=e instanceof Array?e:[e],l=0,u=a.length;l<u;l++){var f=a[l]||{};if(f.selectors){var h=r.em&&r.em.get('SelectorManager');h||console.warn('Selector Manager not found');for(var d=f.selectors,p=d instanceof Array?d:[d],g=[],v=0,m=p.length;v<m;v++){var y=h.add(p[v]);g.push(y)}var b=this.get(g,f.state,f.mediaText,f),w=this.add(g,f.state,f.mediaText,f,n),O=!b||!n.avoidUpdateStyle,x=f.style||{};if(Object(c["isObject"])(i)&&w.set(i,n),O){var C=n.extend?R(R({},w.get('style')),x):x;w.set('style',C,n)}o.push(w)}}return o},addRules:function(t){return this.addCollection(t)},setRule:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.atRuleType,o=r.atRuleParams,a=t.get('Parser').parserCss.checkNode({selectors:e,style:n})[0],s=a.state,c=a.selectorsAdd,l=t.get('SelectorManager'),u=l.add(a.selectors),f=this.add(u,s,o,{selectorsAdd:c,atRule:i});return f.setStyle(n,r),f},getRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.get('SelectorManager'),i=t.get('Parser').parserCss.checkNode({selectors:e})[0],o=r.get(i.selectors),a=i.state,s=i.selectorsAdd,c=n.atRuleType,l=n.atRuleParams;return o&&this.get(o,a,l,{selectorsAdd:s,atRule:c})},getRules:function(t){var e=this.getAll();if(!t)return i()(e.models);var n=Object(s["isString"])(t)?t.split(',').map((function(t){return t.trim()})):t;return e.filter((function(t){return n.indexOf(t.getSelectors().getFullString())>=0}))},setIdRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.addOpts,o=void 0===i?{}:i,a=r.mediaText,c=r.state||'',l=Object(s["isUndefined"])(a)?t.getCurrentMedia():a,u=t.get('SelectorManager'),f=u.add({name:e,type:A["a"].TYPE_ID},o),h=this.add(f,c,l,{},o);return h.setStyle(n,R(R({},r),o)),h},getIdRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.mediaText,i=n.state||'',o=Object(s["isUndefined"])(r)?t.getCurrentMedia():r,a=t.get('SelectorManager').get(e,A["a"].TYPE_ID);return a&&this.get(a,i,o)},setClassRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.state||'',o=r.mediaText||t.getCurrentMedia(),a=t.get('SelectorManager'),s=a.add({name:e,type:A["a"].TYPE_CLASS}),c=this.add(s,i,o);return c.setStyle(n,r),c},getClassRule:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state||'',i=n.mediaText||t.getCurrentMedia(),o=t.get('SelectorManager').get(e,A["a"].TYPE_CLASS);return o&&this.get(o,r,i)},remove:function(t,e){var n=Object(s["isString"])(t)?this.getRules(t):t,r=this.getAll().remove(n,e);return Object(s["isArray"])(r)?r:[r]},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().reset(null,t),this},getComponentRules:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state,i=n.mediaText,o=n.current;o&&(r=t.get('state')||'',i=t.getCurrentMedia());var a=e.getId(),c=this.getAll().filter((function(t){if((Object(s["isUndefined"])(r)||t.get('state')===r)&&(Object(s["isUndefined"])(i)||t.get('mediaText')===i))return t.getSelectorsString()==="#".concat(a)}));return c},render:function(){return n&&n.remove(),(n=new M["a"]({collection:e,config:r})).render().el},destroy:function(){e.reset(),e.stopListening(),n&&n.remove(),[t,e,n].forEach((function(t){return null})),r={}}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(24),a=n(3),s=n.n(a),c=n(0),l=n(1);function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=s.a.$,d=s.a.View.extend({initialize:function(t){this.opt=t||{},Object(c["bindAll"])(this,'startSort','onMove','endMove','rollback','updateOffset','moveDragHelper');var e=t||{};this.elT=0,this.elL=0,this.borderOffset=e.borderOffset||10;var n=e.container;this.el='string'==typeof n?document.querySelector(n):n,this.$el=h(this.el),this.containerSel=e.containerSel||'div',this.itemSel=e.itemSel||'div',this.draggable=e.draggable||!0,this.nested=e.nested||0,this.pfx=e.pfx||'',this.ppfx=e.ppfx||'',this.freezeClass=e.freezeClass||this.pfx+'freezed',this.onStart=e.onStart||'',this.onEndMove=e.onEndMove||'',this.customTarget=e.customTarget,this.onEnd=e.onEnd,this.direction=e.direction||'v',this.onMoveClb=e.onMove||'',this.relative=e.relative||0,this.ignoreViewChildren=e.ignoreViewChildren||0,this.ignoreModels=e.ignoreModels||0,this.plh=e.placer||'',this.wmargin=e.wmargin||0,this.offTop=e.offsetTop||0,this.offLeft=e.offsetLeft||0,this.document=e.document||document,this.$document=h(this.document),this.dropContent=null,this.em=e.em||'',this.dragHelper=null,this.canvasRelative=e.canvasRelative||0,this.selectOnEnd=!e.avoidSelectOnEnd,this.scale=e.scale,this.activeTextModel=null,this.em&&this.em.on&&(this.em.on('change:canvasOffset',this.updateOffset),this.updateOffset())},getScale:function(){return Object(c["result"])(this,scale)||1},getContainerEl:function(t){if(t&&(this.el=t),!this.el){var e=this.opt.container;this.el='string'==typeof e?document.querySelector(e):e,this.$el=h(this.el)}return this.el},getDocuments:function(t){var e=this.em,n=t?t.ownerDocument:e&&e.get('Canvas').getBody().ownerDocument,r=[document];return n&&r.push(n),r},updateOffset:function(){var t=this.em.get('canvasOffset')||{};this.offTop=t.top,this.offLeft=t.left},setDropContent:function(t){this.dropModel=null,this.dropContent=t},updateTextViewCursorPosition:function(t){var e=this.em.get('Canvas'),n=e.getDocument(),r=null;if(n.caretRangeFromPoint){var i=Object(l["getPointerEvent"])(t);r=n.caretRangeFromPoint(i.clientX,i.clientY)}else t.rangeParent&&(r=n.createRange()).setStart(t.rangeParent,t.rangeOffset);var o=e.getWindow().getSelection();e.getFrameEl().focus(),o.removeAllRanges(),r&&o.addRange(r)},setContentEditable:function(t,e){if(t){var n=t.getEl();n.contentEditable!=e&&(n.contentEditable=e)}},toggleSortCursor:function(t){var e=this.em,n=e&&e.get('Canvas');n&&(t?n.startAutoscroll():n.stopAutoscroll())},setDragHelper:function(t,e){for(var n=e||'',r=t.cloneNode(1),i=t.getBoundingClientRect(),o=getComputedStyle(t),a='',s=0;s<o.length;s++){var c=o[s];a+="".concat(c,":").concat(o.getPropertyValue(c),";")}document.body.appendChild(r),r.className+=" ".concat(this.pfx,"bdrag"),r.setAttribute('style',a),this.dragHelper=r,r.style.width="".concat(i.width,"px"),r.style.height="".concat(i.height,"px"),n&&this.moveDragHelper(n),this.em&&h(this.em.get('Canvas').getBody().ownerDocument).off('mousemove',this.moveDragHelper).on('mousemove',this.moveDragHelper),h(document).off('mousemove',this.moveDragHelper).on('mousemove',this.moveDragHelper)},moveDragHelper:function(t){var e=t.target.ownerDocument;if(this.dragHelper&&e){var n=t.pageY,r=t.pageX,i=0,o=0,a=(e.defaultView||e.parentWindow).frameElement,s=this.dragHelper.style;if(a){var c=a.getBoundingClientRect();i=c.top+document.documentElement.scrollTop,o=c.left+document.documentElement.scrollLeft,n=t.clientY,r=t.clientX}s.top=n+i+'px',s.left=r+o+'px'}},matches:function(t,e,n){return l["matches"].call(t,e)},closest:function(t,e){if(t){for(var n=t.parentNode;n&&1===n.nodeType;){if(this.matches(n,e))return n;n=n.parentNode}return null}},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},createPlaceholder:function(){var t=this.pfx,e=document.createElement('div'),n=document.createElement('div');return e.className=t+'placeholder',e.style.display='none',e.style['pointer-events']='none',n.className=t+'placeholder-int',e.appendChild(n),e},startSort:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.itemSel,o=this.containerSel,a=this.getContainerEl(n.container),s=this.getDocuments(t),c=this.onStart,u=this.plh;this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,t&&!this.matches(t,"".concat(i,", ").concat(o))&&(t=this.closest(t,i)),this.eV=t,u||(u=this.createPlaceholder(),a.appendChild(u),this.plh=u),t&&((e=this.getSourceModel(t))&&e.set&&e.set('status','freezed'),this.srcModel=e),Object(l["on"])(a,'mousemove dragover',this.onMove),Object(l["on"])(s,'mouseup dragend touchend',this.endMove),Object(l["on"])(s,'keydown',this.rollback),c&&c({sorter:this,target:e,parent:e&&e.parent(),index:e&&e.index()}),r&&r.clearSelection(),this.toggleSortCursor(1),r&&r.trigger('sorter:drag:start',t,e)},getTargetModel:function(t){var e=t||this.target;return h(e).data('model')},getSourceModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,i=n.avoidChildren,o=void 0===i?1:i,a=this.em,s=this.eV,c=t||s,l=this.dropModel,u=this.dropContent,d=function(t){return t&&r&&t.opt&&t.opt.avoidChildren&&e.isTextableActive(t,r)};if(u&&a){if(d(l)&&(l=null),!l){var p=a.get('DomComponents').getComponents(),g={avoidChildren:o,avoidStore:1,avoidUpdateStyle:1},v=p.add(u,f(f({},g),{},{temporary:1}));if(l=(l=p.remove(v,g))instanceof Array?l[0]:l,this.dropModel=l,d(l))return this.getSourceModel(c,{target:r,avoidChildren:0})}return l}return c&&h(c).data('model')},selectTargetModel:function(t,e){if(!(t instanceof s.a.Collection||e&&e===t)){var n=this.targetModel;n&&n!==this.srcModel&&n.set('status',''),t&&t.set&&(t.set('status','selected-parent'),this.targetModel=t)}},onMove:function(t){var e=t,n=this.em,r=this.onMoveClb,i=this.plh,o=this.customTarget;this.moved=1;var a=i.style.display;a&&'none'!==a||(i.style.display='block');var s=this.offset(this.el);this.elT=this.wmargin?Math.abs(s.top):s.top,this.elL=this.wmargin?Math.abs(s.left):s.left;var l=t.pageY-this.elT+this.el.scrollTop,u=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var f=n.get('Canvas').getMouseRelativeCanvas(t,{noScroll:1});u=f.x,l=f.y}this.rX=u,this.rY=l,this.eventMove=t;var d=this.getSourceModel(),p=o?o({sorter:this,event:t}):t.target,g=this.dimsFromTarget(p,u,l),v=this.target,m=v&&this.getTargetModel(v);if(this.selectTargetModel(m,d),m||(i.style.display='none'),v){this.lastDims=g;var y=this.findPosition(g,u,l);this.isTextableActive(d,m)?(this.activeTextModel=m,this.setContentEditable(m,!0),i.style.display='none',this.lastPos=y,this.updateTextViewCursorPosition(e)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==y.index&&this.lastPos.method==y.method||(this.movePlaceholder(this.plh,g,y,this.prevTargetDim),this.$plh||(this.$plh=h(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css('top','+='+this.offTop+'px'),this.offLeft&&this.$plh.css('left','+='+this.offLeft+'px')),this.lastPos=y)),Object(c["isFunction"])(r)&&r({event:t,target:d,parent:m,index:y.index+('after'==y.method?1:0)}),n&&n.trigger('sorter:drag',{target:v,targetModel:m,sourceModel:d,dims:g,pos:y,x:u,y:l})}},isTextableActive:function(t,e){return t&&t.get&&t.get('textable')&&e&&e.is('text')},disableTextable:function(){var t=this.activeTextModel;t&&t.getView().disableEditing()},isInFlow:function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},styleInFlow:function(t,e){if(!Object(l["isTextNode"])(t)){var n=t.style||{},r=h(t),i=e&&h(e);if(!n.overflow||'visible'===n.overflow){var o=r.css('float');if(!(o&&'none'!==o||i&&'flex'==i.css('display')&&'column'!==i.css('flex-direction'))){switch(n.position){case'static':case'relative':case'':break;default:return}switch(t.tagName){case'TR':case'TBODY':case'THEAD':case'TFOOT':return!0}switch(r.css('display')){case'block':case'list-item':case'table':case'flex':return!0}}}}},validTarget:function(t,e){var n=this.getTargetModel(t),r=this.getSourceModel(e,{target:n}),i={valid:!0,src:e=r&&r.view&&r.view.el,srcModel:r,trg:t=n&&n.view&&n.view.el,trgModel:n};if(!e||!t)return i.valid=!1,i;var o=r.get('draggable');if(Object(c["isFunction"])(o)){var a=o(r,n);i.dragInfo=a,i.draggable=a,o=a}else o=o instanceof Array?o.join(', '):o,i.dragInfo=o,o=Object(c["isString"])(o)?this.matches(t,o):o,i.draggable=o;var l=n.get('droppable');if(Object(c["isFunction"])(l)){var u=l(r,n);i.droppable=u,i.dropInfo=u,l=u}else l=(l=l instanceof s.a.Collection?1:l)instanceof Array?l.join(', '):l,i.dropInfo=l,l=Object(c["isString"])(l)?this.matches(e,l):l,l=o&&this.isTextableActive(r,n)?1:l,i.droppable=l;return l&&o||(i.valid=!1),i},dimsFromTarget:function(t,e,n){var r=this.em,i=[];if(!t)return i;if(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(','))),!t)return i;if(this.prevTarget&&this.prevTarget!=t&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var o=this.validTarget(t);if(r&&r.trigger('sorter:drag:validation',o),!o.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(i=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var a=this.targetP;a&&this.validTarget(a).valid&&(i=this.cacheDimsP,this.target=a)}return this.lastPos=null,i},getTargetFromEl:function(t){var e,n=t,r=this.targetPrev,i=this.em,o=this.containerSel,a=this.itemSel;if(this.matches(n,"".concat(a,", ").concat(o))||(n=this.closest(n,a)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(','))),r&&r!=n&&(this.targetPrev=''),!this.targetPrev){e=this.closest(n,o);var s=this.validTarget(n);if(i&&i.trigger('sorter:drag:validation',s),!s.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,o))&&this.validTarget(e).valid&&(n=e),n},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),r=t.ownerDocument.body,i=this.getCurrentPos(),o=i.x,a=i.y,s=n.top+r.scrollTop,c=n.left+r.scrollLeft,l=n.width,u=n.height;if(a<s+e||a>s+u-e||o<c+e||o>c+l-e)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,r,i,o=this.em,a=this.canvasRelative,s=o&&o.get('Canvas'),c=s?s.getElementOffsets(t):{};if(a&&o){var l=s.getElementPos(t,{noScroll:1});e=l.top,n=l.left,r=l.height,i=l.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,i=t.offsetWidth}return{top:e,left:n,height:r,width:i,offsets:c}},getChildrenDim:function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);if(r&&r.view&&!this.ignoreViewChildren){var i=r.getCurrentView?r.getCurrentView():r.view;t=i.getChildrenContainer()}return Object(c["each"])(t.children,(function(r,i){var o=Object(l["getModel"])(r,h),a=o&&o.index?o.index():i;if(Object(l["isTextNode"])(r)||e.matches(r,e.itemSel)){var s=e.getDim(r),c=e.direction;c='v'==c||'h'!=c&&e.isInFlow(r,t),s.dir=c,s.el=r,s.indexEl=a,n.push(s)}})),n},nearBorders:function(t,e,n){var r=0,i=this.borderOffset,o=e||0,a=n||0,s=t.top,c=t.left,l=t.height,u=t.width;return(s+i>a||a>s+l-i||c+i>o||o>c+u-i)&&(r=1),!!r},findPosition:function(t,e,n){for(var r={index:0,indexEl:0,method:'before'},i=0,o=0,a=0,s=0,c=0,l=0,u=0,f=0,h=t.length;f<h;f++){var d=u=t[f],p=d.top,g=d.left,v=d.height,m=d.width;if(l=p+v,s=g+m/2,c=p+v/2,!(o&&g>o||a&&c>=a||i&&g+m<i))if(r.index=f,r.indexEl=u.indexEl,u.dir){if(n<c){r.method='before';break}r.method='after'}else n<l&&(a=l),e<s?(o=s,r.method='before'):(i=s,r.method='after')}return r},movePlaceholder:function(t,e,n,r){var i=0,o=0,a=0,s=0,c=0,l='px',u=5,f=n.method,h=e[n.index];if(t.classList.remove('vertical'),t.classList.add('horizontal'),h){var d=h.top,p=h.left,g=h.height,v=h.width;h.dir?(s=v+l,c='auto',o='before'==f?d-i:d+g-i,a=p):(s='auto',c=g-2*i+l,o=d+i,a='before'==f?p-i:p+v-i,t.classList.remove('horizontal'),t.classList.add('vertical'))}else{if(!this.nested)return void(t.style.display='none');if(r){var m=r.offsets||{},y=m.paddingTop||u,b=m.paddingLeft||u;o=r.top+y,a=r.left+b,s=parseInt(r.width)-2*b+l,c='auto'}}t.style.top=o+l,t.style.left=a+l,s&&(t.style.width=s),c&&(t.style.height=c)},endMove:function(t){var e,n=this,r=this.eV,i=[],o=this.getDocuments(),a=this.getContainerEl(),s=this.onEndMove,u=this.onEnd,h=this.target,d=this.lastPos;if(Object(l["off"])(a,'mousemove dragover',this.onMove),Object(l["off"])(o,'mouseup dragend touchend',this.endMove),Object(l["off"])(o,'keydown',this.rollback),this.plh.style.display='none',r&&(e=this.getSourceModel(),this.selectOnEnd&&e&&e.set&&(e.set('status',''),e.set('status','selected'))),this.moved&&h){var p=this.toMove;(Object(c["isArray"])(p)?p:p?[p]:[r]).forEach((function(t){i.push(n.move(h,t,d))}))}this.plh&&(this.plh.style.display='none');var g=this.dragHelper;if(g&&(g.parentNode.removeChild(g),this.dragHelper=null),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),this.toMove=null,this.eventMove=0,this.dropModel=null,Object(c["isFunction"])(s)){var v={target:e,parent:e&&e.parent(),index:e&&e.index()};i.length?i.forEach((function(t){return s(t,n,v)})):s(null,this,f(f({},v),{},{cancelled:1}))}Object(c["isFunction"])(u)&&u({sorter:this})},move:function(t,e,n){var r=this.em,i=this.activeTextModel,o=this.dropContent,a=Object(l["getElement"])(e);r&&r.trigger('component:dragEnd:before',t,a,n);var u,d,p,g=n.indexEl,v=[],m=this.validTarget(t,a),y=h(t).data('collection'),b=m.srcModel,w=m.droppable,O=m.trgModel,x=m.draggable,C=m.dropInfo||O&&O.get('droppable'),k=m.dragInfo||b&&b.get('draggable');w=O instanceof s.a.Collection?1:w;var S=this.isTextableActive(b,O);if(y&&w&&x){var j={at:g='after'===n.method?g+1:g,noIncrement:1};if(o?(u=Object(c["isFunction"])(o)?o():o,j.silent=!1,j.avoidUpdateStyle=1):(j.temporary=1,d=y.add({},f({},j)),b.collection&&(u=b.collection.remove(b,{temporary:1}))),S){var P=i.getView();i.trigger('active');var _=P.activeRte,T=b.getEl();delete b.opt.temporary,b.getView().render(),T.setAttribute('data-gjs-textable','true');var E=T.outerHTML;_.insertHTML&&_.insertHTML(E)}else p=y.add(u,j);o?this.dropContent=null:y.remove(d),this.prevTarget=null}else r&&(!y&&v.push('Target collection not found'),!w&&C&&v.push("Target is not droppable, accepts [".concat(C,"]")),!x&&k&&v.push("Component not draggable, acceptable by [".concat(k,"]")),r.logWarning('Invalid target position',{errors:v,model:b,context:'sorter',target:O}));return r&&(r.trigger('component:dragEnd',y,u,v),r.trigger('sorter:drag:end',{targetCollection:y,modelToDrop:u,warns:v,validResult:m,dst:t,srcEl:a})),p},rollback:function(t){Object(l["off"])(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=0,this.endMove())}}),p=n(5),g=n.n(p),v=n(6),m=n.n(v);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var w={mousePosFetcher:null,updateTarget:null,ratioDefault:0,posFetcher:null,onStart:null,onMove:null,onEnd:null,onUpdateContainer:function(){},step:1,minDim:10,maxDim:'',unitHeight:'px',unitWidth:'px',keyHeight:'height',keyWidth:'width',currentUnit:1,silentFrames:0,avoidContainerUpdate:0,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:1,tc:1,tr:1,cl:1,cr:1,bl:1,bc:1,br:1},O=function(t,e){var n=e||window,r=t.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}},x=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g()(this,t),this.setOptions(e),Object(c["bindAll"])(this,'handleKeyDown','handleMouseDown','move','stop'),this}return m()(t,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Object(c["defaults"])(t,w),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||'',n=t.appendTo||document.body,r=this.container;for(r||((r=document.createElement('div')).className="".concat(e,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};for(var o in['tl','tc','tr','cl','cr','bl','bc','br'].forEach((function(e){return i[e]=t[e]?function(t,e){var n=e.prefix||'',r=document.createElement('i');return r.className=n+'resizer-h '+n+'resizer-h-'+t,r.setAttribute('data-'+n+'handler',t),r}(e,t):''})),i){var a=i[o];a&&r.appendChild(a)}this.handlers=i,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd,this.onUpdateContainer=t.onUpdateContainer}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll('iframe');Object(c["each"])(e,(function(e){return e.style.pointerEvents=t?'none':''}))}}},{key:"isHandler",value:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getParentEl",value:function(){return this.el.parentElement}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||'';return n?n(t,e):O(t)}},{key:"focus",value:function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:1}),Object(l["on"])(this.getDocumentEl(),'mousedown',this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display='none',this.el&&(Object(l["off"])(this.getDocumentEl(),'mousedown',this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.getParentEl(),r=this.opts||{},i='data-'+r.prefix+'handler',o=this.getElementPos(e,{target:'el'}),a=this.getElementPos(n);this.handlerAttr=t.target.getAttribute(i),this.clickedHandler=t.target,this.startDim={t:o.top,l:o.left,w:o.width,h:o.height},this.rectDim={t:o.top,l:o.left,w:o.width,h:o.height},this.startPos={x:t.clientX,y:t.clientY},this.parentDim={t:a.top,l:a.left,w:a.width,h:a.height};var s=this.getDocumentEl();Object(l["on"])(s,'mousemove',this.move),Object(l["on"])(s,'keydown',this.handleKeyDown),Object(l["on"])(s,'mouseup',this.stop),Object(c["isFunction"])(this.onStart)&&this.onStart(t,{docs:s,config:r,el:e,resizer:this}),this.toggleFrames(1),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,r=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(0),e&&e(t),0===t.which&&this.stop(t)}},{key:"stop",value:function(t){var e=this.opts,n=this.getDocumentEl();Object(l["off"])(n,'mousemove',this.move),Object(l["off"])(n,'keydown',this.handleKeyDown),Object(l["off"])(n,'mouseup',this.stop),this.updateRect(1),this.toggleFrames(),Object(c["isFunction"])(this.onEnd)&&this.onEnd(t,{docs:n,config:e})}},{key:"updateRect",value:function(t){var e=this.el,n=this.opts,r=this.rectDim,i=this.updateTarget,o=this.getSelectedHandler(),a=n.unitHeight,s=n.unitWidth,l=n.keyWidth,u=n.keyHeight;if(Object(c["isFunction"])(i))i(e,r,{store:t,selectedHandler:o,resizer:this,config:n});else{var f=e.style;f[l]=r.w+s,f[u]=r.h+a}this.updateContainer()}},{key:"updateContainer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.opts,n=this.container,r=this.el,i=n.style;!e.avoidContainerUpdate&&r&&t.forceShow&&(i.display='block'),this.onUpdateContainer({el:n,resizer:this,opts:b(b({},e),t)})}},{key:"getSelectedHandler",value:function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e}},{key:"handleKeyDown",value:function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))}},{key:"handleMouseDown",value:function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(this.selectedHandler='',this.blur())}},{key:"calc",value:function(t){var e,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,a=n.maxDim,s=t.delta.x,c=t.delta.y,u=this.parentDim.w,f=this.parentDim.h,h=this.opts.unitWidth,d=this.opts.unitHeight,p='%'===h?i.w/100*u:i.w,g='%'===d?i.h/100*f:i.h,v={t:0,l:0,w:p,h:g};if(t){var m=t.handlerAttr;~m.indexOf('r')&&(e='%'===h?Object(l["normalizeFloat"])((p+s*r)/u*100,.01):Object(l["normalizeFloat"])(p+s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('b')&&(e='%'===d?Object(l["normalizeFloat"])((g+c*r)/f*100,.01):Object(l["normalizeFloat"])(g+c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e),~m.indexOf('l')&&(e='%'===h?Object(l["normalizeFloat"])((p-s*r)/u*100,.01):Object(l["normalizeFloat"])(p-s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('t')&&(e='%'===d?Object(l["normalizeFloat"])((g-c*r)/f*100,.01):Object(l["normalizeFloat"])(g-c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e);var y=n.ratioDefault?!t.keys.shift:t.keys.shift;if(m.indexOf('c')<0&&y){var b=i.w/i.h;v.w/v.h>b?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}return~m.indexOf('l')&&(v.l=i.w-v.w),~m.indexOf('t')&&(v.t=i.h-v.h),v}}}]),t}(),C={init:function(t){return new x(t)}};function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){return{name:'Utils',init:function(){return this},destroy:function(){},Sorter:d,Resizer:C,Dragger:o["a"],helpers:S({},l)}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(14),a=n.n(o),s=n(0),c=n(1),l={placeholder:'eg. Text here'},u={locale:'en',localeFallback:'en',detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:'Add image',inputPlh:'http://path/to/the/image.jpg',modalTitle:'Select Image',uploadTitle:'Drop files here or click to upload'},blockManager:{labels:{},categories:{}},domComponents:{names:{'':'Box',wrapper:'Body',text:'Text',comment:'Comment',image:'Image',video:'Video',label:'Label',link:'Link',map:'Map',tfoot:'Table foot',tbody:'Table body',thead:'Table head',table:'Table',row:'Table row',cell:'Table cell'}},deviceManager:{device:'Device',devices:{desktop:'Desktop',tablet:'Tablet',mobileLandscape:'Mobile Landscape',mobilePortrait:'Mobile Portrait'}},panels:{buttons:{titles:{preview:'Preview',fullscreen:'Fullscreen','sw-visibility':'View components','export-template':'View code','open-sm':'Open Style Manager','open-tm':'Settings','open-layers':'Open Layer Manager','open-blocks':'Open Blocks'}}},selectorManager:{label:'Classes',selected:'Selected',emptyState:'- State -',states:{hover:'Hover',active:'Click','nth-of-type(2n)':'Even/Odd'}},styleManager:{empty:'Select an element before using Style Manager',layer:'Layer',fileButton:'Images',sectors:{general:'General',layout:'Layout',typography:'Typography',decorations:'Decorations',extra:'Extra',flex:'Flex',dimension:'Dimension'},properties:{'text-shadow-h':'X','text-shadow-v':'Y','text-shadow-blur':'Blur','text-shadow-color':'Color','box-shadow-h':'X','box-shadow-v':'Y','box-shadow-blur':'Blur','box-shadow-spread':'Spread','box-shadow-color':'Color','box-shadow-type':'Type','margin-top-sub':'Top','margin-right-sub':'Right','margin-bottom-sub':'Bottom','margin-left-sub':'Left','padding-top-sub':'Top','padding-right-sub':'Right','padding-bottom-sub':'Bottom','padding-left-sub':'Left','border-width-sub':'Width','border-style-sub':'Style','border-color-sub':'Color','border-top-left-radius-sub':'Top Left','border-top-right-radius-sub':'Top Right','border-bottom-right-radius-sub':'Bottom Right','border-bottom-left-radius-sub':'Bottom Left','transform-rotate-x':'Rotate X','transform-rotate-y':'Rotate Y','transform-rotate-z':'Rotate Z','transform-scale-x':'Scale X','transform-scale-y':'Scale Y','transform-scale-z':'Scale Z','transition-property-sub':'Property','transition-duration-sub':'Duration','transition-timing-function-sub':'Timing','background-image-sub':'Image','background-repeat-sub':'Repeat','background-position-sub':'Position','background-attachment-sub':'Attachment','background-size-sub':'Size'}},traitManager:{empty:'Select an element before using Trait Manager',label:'Component settings',traits:{labels:{},attributes:{id:l,alt:l,title:l,href:{placeholder:'eg. https://google.com'}},options:{target:{false:'This window',_blank:'New window'}}}}}},messagesAdd:null};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=function(t){return!Array.isArray(t)&&null!==t&&'object'===a()(t)};e["default"]=function(){return{name:'I18n',config:u,init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=h(h(h({},u),t),{},{messages:h(h({},u.messages),t.messages||{})});var e=this.config.messagesAdd;return e&&this.addMessages(e),this.config.detectLocale&&(this.config.locale=this._localLang()),this.em=t.em,this},getConfig:function(){return this.config},setLocale:function(t){var e=this.em,n=this.config,r={value:t,valuePrev:n.locale};return e&&e.trigger('i18n:locale',r),n.locale=t,this},getLocale:function(){return this.config.locale},getMessages:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n},setMessages:function(t){var e=this.em;return this.config.messages=t,e&&e.trigger('i18n:update',t),this},addMessages:function(t){var e=this.em,n=this.config.messages;return e&&e.trigger('i18n:add',t),this.setMessages(function t(){for(var e=h({},arguments.length<=0?void 0:arguments[0]),n=1;n<arguments.length;n++){var r=h({},n<0||arguments.length<=n?void 0:arguments[n]);for(var i in r){var o=e[i],a=r[i];d(o)&&d(a)?e[i]=t(o,a):e[i]=a}}return e}(n,t)),this},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config,r=e.params||{},i=e.l||this.getLocale(),o=e.lFlb||n.localeFallback,a=this._getMsg(t,i,e);return a||(a=this._getMsg(t,o,e)),!a&&this._debug("'".concat(t,"' i18n key not found in '").concat(i,"' lang"),e),a=a&&Object(s["isString"])(a)?this._addParams(a,r):a},_localLang:function(){var t=Object(c["hasWin"])()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split('-')[0]:'en'},_addParams:function(t,e){var n=new RegExp("{([\\w\\d-]*)}",'g');return t.replace(n,(function(t,n){return e[n]||''})).trim()},_getMsg:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getMessages(e,n);if(r){var i=r[t];return!i&&t.indexOf('.')>0&&(i=t.split('.').reduce((function(t,e){if(!Object(s["isUndefined"])(t))return t[e]}),r)),i}},_debug:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)},destroy:function(){this.config=u,this.em={}}}}},function(t,e,n){"use strict";n.r(e);var r=n(34),i=n.n(r),o=n(11),a=n.n(o),s=n(2),c=n.n(s),l=n(26),u=n.n(l),f=n(5),h=n.n(f),d=n(6),p=n.n(d),g=n(1);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var y='_rte',b=1,w=0,O=-1,x=function(t){var e=t.selection().anchorNode,n=e&&e.parentNode,r=e&&e.nextSibling;return n&&'A'==n.nodeName||r&&'A'==r.nodeName},C={bold:{name:'bold',icon:'<b>B</b>',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'<i>I</i>',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'<u>U</u>',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'<s>S</s>',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"<span style=\"transform:rotate(45deg)\">&supdsub;</span>",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t,e){return t&&t.selection()&&x(t)?b:w},result:function(t){x(t)?t.exec('unlink'):t.insertHTML("<a class=\"link\" href=\"\">".concat(t.selection(),"</a>"))}}},k=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,t);var r=n.el;if(r[y])return r[y];r[y]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this);var i=(n.actions||[]).map((function(t){var e=t;return'string'==typeof t?e=m({},C[t]):C[t.name]&&(e=m(m({},C[t.name]),t)),e})),o=i.length?i:Object.keys(C).map((function(t){return C[t]}));n.classes=m(m({},{actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'}),n.classes);var a=n.classes,s=n.actionbar;if(this.actionbar=s,this.settings=n,this.classes=a,this.actions=o,!s){var c=n.actionbarContainer;(s=document.createElement('div')).className=a.actionbar,c.appendChild(s),this.actionbar=s,o.forEach((function(t){return e.addAction(t)}))}return n.styleWithCSS&&this.exec('styleWithCSS'),this.syncActions(),this}return p()(t,[{key:"destroy",value:function(){this.el=0,this.doc=0,this.actionbar=0,this.settings={},this.classes={},this.actions=[]}},{key:"setEl",value:function(t){this.el=t,this.doc=t.ownerDocument}},{key:"updateActiveActions",value:function(){var t=this;this.getActions().forEach((function(e){var n=e.btn,r=e.update,i=m({},t.classes),o=i.active,a=i.inactive,s=i.disabled,c=e.state,l=e.name,u=t.doc;if(n.className=n.className.replace(o,'').trim(),n.className=n.className.replace(a,'').trim(),n.className=n.className.replace(s,'').trim(),c)switch(c(t,u)){case b:n.className+=" ".concat(o);break;case w:n.className+=" ".concat(a);break;case O:n.className+=" ".concat(s)}else u.queryCommandSupported(l)&&u.queryCommandState(l)&&(n.className+=" ".concat(o));r&&r(t,e)}))}},{key:"enable",value:function(){return this.enabled||(this.actionbarEl().style.display='',this.el.contentEditable=!0,Object(g["on"])(this.el,'mouseup keyup',this.updateActiveActions),this.syncActions(),this.updateActiveActions(),this.el.focus(),this.enabled=1),this}},{key:"disable",value:function(){return this.actionbarEl().style.display='none',this.el.contentEditable=!1,Object(g["off"])(this.el,'mouseup keyup',this.updateActiveActions),this.enabled=0,this}},{key:"syncActions",value:function(){var t=this;this.getActions().forEach((function(e){if(t.settings.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||'click';e.btn["on".concat(n)]=function(n){e.result(t,e),t.updateActiveActions()}}}))}},{key:"addAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sync,r=document.createElement('span'),i=t.icon,o=t.attributes||{};for(var a in r.className=this.classes.button,t.btn=r,o)r.setAttribute(a,o[a]);'string'==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(t),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(t,!1,e)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(t){var e=this.doc,n=e.getSelection();if(n&&n.rangeCount){var r=e.createElement('div'),i=n.getRangeAt(0);i.deleteContents(),r.innerHTML=t,Array.prototype.slice.call(r.childNodes).forEach((function(t){i.insertNode(t),t})),n.removeAllRanges(),n.addRange(i),this.el.focus()}}}]),t}(),S={stylePrefix:'rte-',adjustToolbar:1,actions:['bold','italic','underline','strikethrough','link']};function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n,r,o,s={},c='change:canvasOffset frame:scroll component:update',l=function(){var e=t.style,n='-1000px';e.top=n,e.left=n,e.display='none'};return{customRte:null,name:'RichTextEditor',getConfig:function(){return s},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(s=P(P({},S),n)).pStylePrefix;return r&&(s.stylePrefix=r+s.stylePrefix),this.pfx=s.stylePrefix,e=s.actions||[],Object(g["hasWin"])()?((t=document.createElement('div')).className="".concat(r,"rte-toolbar ").concat(r,"one-bg"),o=this.initRte(document.createElement('div')),Object(g["on"])(t,'mousedown',(function(t){return t.stopPropagation()})),this):this},destroy:function(){var i=this.customRte;o&&o.destroy(),i&&i.destroy&&i.destroy(),this.actionbar=0,this.actions=0,[s,t,e,n,r,o].forEach((function(t){return{}}))},postRender:function(e){var n=e.model.get('Canvas');t.style.pointerEvents='all',l(),n.getToolsEl().appendChild(t)},initRte:function(e){var n=this.pfx,r=t,i=this.actionbar,c=this.actions||a()(s.actions),l={actionbar:"".concat(n,"actionbar"),button:"".concat(n,"action"),active:"".concat(n,"active"),inactive:"".concat(n,"inactive"),disabled:"".concat(n,"disabled")},u=new k({el:e,classes:l,actions:c,actionbar:i,actionbarContainer:r});return o&&o.setEl(e),u.actionbar&&(this.actionbar=u.actionbar),u.actions&&(this.actions=u.actions),u},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=t,o.addAction(e,{sync:1})},get:function(t){var e;return o.getActions().forEach((function(n){n.name==t&&(e=n)})),e},getAll:function(){return o.getActions()},remove:function(t){var e=this.getAll(),n=this.get(t);if(n){var r=n.btn,i=e.indexOf(n);r.parentNode.removeChild(r),e.splice(i,1)}return n},getToolbarEl:function(){return t},updatePosition:function(){var e='px',r=s.em.get('Canvas'),i=t.style,o=r.getTargetToElementFixed(n,t,{event:'rteToolbarPosUpdate',left:0});i.top=(o.top||0)+e,i.left=(o.left||0)+e},enable:function(e,o){var a=this;return i()(u.a.mark((function i(){var l,f,h,d,p;return u.a.wrap((function(i){for(;1;)switch(i.prev=i.next){case 0:return n=e.el,l=a.customRte,f=s.em.get('Canvas'),h=s.em,d=e.getChildrenContainer(),r=f.getElementPos(n),t.style.display='',i.next=9,l?l.enable(d,o):a.initRte(d).enable();case 9:return p=i.sent,h&&(setTimeout(a.updatePosition.bind(a),0),h.off(c,a.updatePosition,a),h.on(c,a.updatePosition,a),h.trigger('rte:enable',e,p)),i.abrupt("return",p);case 12:case"end":return i.stop()}}),i)})))()},disable:function(t,e){var n=s.em,r=this.customRte,i=t.getChildrenContainer();r?r.disable(i,e):e&&e.disable(),l(),n&&(n.off(c,this.updatePosition,this),n.trigger('rte:disable',t,e))}}}},function(t,e,n){"use strict";n.r(e);var r,i=n(2),o=n.n(i),a={stylePrefix:'',appendTo:'',sortable:1,hidable:1,hideTextnode:1,root:'',showWrapper:1,showHover:1,scrollCanvas:{behavior:'smooth',block:'nearest'},scrollLayers:{behavior:'auto',block:'nearest'},highlightHover:1,onInit:function(){},onRender:function(){},extend:{}},s=n(0),c=n(1),l=n(3),u=n.n(l),f=n(12),h=n(10),d='contentEditable',p={mediaText:''},g=u.a.$,v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===(t.display||'').trim().indexOf('none')},m=u.a.View.extend({events:{'mousedown [data-toggle-move]':'startSort','touchstart [data-toggle-move]':'startSort','click [data-toggle-visible]':'toggleVisibility','click [data-toggle-open]':'toggleOpening','click [data-toggle-select]':'handleSelect','mouseover [data-toggle-select]':'handleHover','mouseout [data-toggle-select]':'handleHoverOut','dblclick [data-name]':'handleEdit','keydown [data-name]':'handleEditKey','focusout [data-name]':'handleEditEnd'},template:function(t){var e=this.pfx,n=this.ppfx,r=this.config,i=this.clsNoEdit,o=r.hidable,a=this.countChildren(t),s=a?'':this.clsNoChild,c="".concat(this.clsTitle," ").concat(s),l="".concat(this.clsTitleC," ").concat(n,"one-bg"),u="".concat(this.clsCaret," fa fa-chevron-right"),f="".concat(this.inputNameCls," ").concat(i," ").concat(n,"no-app"),h=this.level+1,d="".concat(30+10*h,"px"),p=t.getName(),g=t.getIcon(),v="".concat(e,"layer");return"\n      ".concat(o?"<i class=\"".concat(e,"layer-vis fa fa-eye ").concat(this.isVisible()?'':'fa-eye-slash',"\" data-toggle-visible></i>"):'',"\n      <div class=\"").concat(l,"\">\n        <div class=\"").concat(c,"\" style=\"padding-left: ").concat(d,"\" data-toggle-select>\n          <div class=\"").concat(e,"layer-title-inn\" title=\"").concat(p,"\">\n            <i class=\"").concat(u,"\" data-toggle-open></i>\n            ").concat(g?"<span class=\"".concat(v,"__icon\">").concat(g,"</span>"):'',"\n            <span class=\"").concat(f,"\" data-name>").concat(p,"</span>\n          </div>\n        </div>\n      </div>\n      <div class=\"").concat(this.clsCount,"\" data-count>").concat(a||'',"</div>\n      <div class=\"").concat(this.clsMove,"\" data-toggle-move>\n        <i class=\"fa fa-arrows\"></i>\n      </div>\n      <div class=\"").concat(this.clsChildren,"\"></div>")},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s["bindAll"])(this,'__render'),this.opt=e,this.level=e.level;var n=e.config||{},r=n.onInit;this.config=n,this.em=e.config.em,this.ppfx=this.em.get('Config').stylePrefix,this.sorter=e.sorter||'',this.pfx=this.config.stylePrefix,this.parentView=e.parentView;var i=this.pfx,o=this.ppfx,a=this.model,c=a.get('components'),l=a.get('type')||'default';a.set('open',!1),this.listenTo(c,'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(e){return t.listenTo(a,e[0],e[1])})),this.className="".concat(i,"layer ").concat(i,"layer__t-").concat(l," no-select ").concat(o,"two-color"),this.inputNameCls="".concat(o,"layer-name"),this.clsTitleC="".concat(i,"layer-title-c"),this.clsTitle="".concat(i,"layer-title"),this.clsCaret="".concat(i,"layer-caret"),this.clsCount="".concat(i,"layer-count"),this.clsMove="".concat(i,"layer-move"),this.clsChildren="".concat(i,"layer-children"),this.clsNoChild="".concat(i,"layer-no-chld"),this.clsEdit="".concat(this.inputNameCls,"--edit"),this.clsNoEdit="".concat(this.inputNameCls,"--no-edit"),this.$el.data('model',a),this.$el.data('collection',c),a.viewLayer=this,r.bind(this)({component:a,render:this.__render,listenTo:this.listenTo})},updateName:function(){this.getInputName().innerText=this.model.getName()},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},updateVisibility:function(){var t=this.pfx,e=this.model,n="".concat(t,"layer-hidden"),r=v(e.getStyle(p))?'addClass':'removeClass';this.$el[r](n),this.getVisibilityEl()[r]('fa-eye-slash')},toggleVisibility:function(t){t&&t.stopPropagation();var e=this.model,n=this.em,r='__prev-display',i=e.get(r),o=e.getStyle(p),a=o.display;v(o)?(delete o.display,i&&(o.display=i,e.unset(r))):(a&&e.set(r,a),o.display='none'),e.setStyle(o,p),n&&n.trigger('component:toggled')},handleEdit:function(t){t&&t.stopPropagation();var e=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName();o[d]=!0,o.focus(),document.execCommand('selectAll',!1,null),e&&e.setEditing(1),n.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},handleEditKey:function(t){t.stopPropagation(),(Object(c["isEscKey"])(t)||Object(c["isEnterKey"])(t))&&this.handleEditEnd(t)},handleEditEnd:function(t){t&&t.stopPropagation();var e=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName(),a=o.textContent;o.scrollLeft=0,o[d]=!1,this.setName(a,{component:this.model,propName:'custom-name'}),e&&e.setEditing(0),n.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i)},setName:function(t,e){var n=e.propName;this.model.set(n,t)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},updateOpening:function(){var t=this.opt.opened||{},e=this.model,n='fa-chevron-down';e.get('open')?(this.$el.addClass('open'),this.getCaret().addClass(n),t[e.cid]=e):(this.$el.removeClass('open'),this.getCaret().removeClass(n),delete t[e.cid])},toggleOpening:function(t){var e=this.model;t.stopImmediatePropagation(),e.get('components').length&&e.set('open',!e.get('open'))},handleSelect:function(t){t.stopPropagation();var e=this.em,n=this.config,r=this.model;if(e){e.setSelected(r,{fromLayers:1,event:t});var i=n.scrollCanvas;i&&r.views.forEach((function(t){return t.scrollIntoView(i)}))}},handleHover:function(t){t.stopPropagation();var e=this.em,n=this.config,r=this.model;e&&n.showHover&&e.setHovered(r,{fromLayers:1})},handleHoverOut:function(t){t.stopPropagation();var e=this.em,n=this.config;e&&n.showHover&&e.setHovered(0,{fromLayers:1})},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(h["b"],":start"),t)},n.onMoveClb=function(t){return e.trigger(h["b"],t)},n.startSort(t.target))},freeze:function(){this.$el.addClass(this.pfx+'opac50'),this.model.set('open',0)},unfreeze:function(){this.$el.removeClass(this.pfx+'opac50')},updateStatus:function(t){f["default"].prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:1}])},isVisible:function(){return!v(this.model.getStyle())},checkChildren:function(){var t=this.model,e=this.clsNoChild,n=this.countChildren(t),r=this.$el.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),i=this.cnt;i||(i=this.$el.children('[data-count]').get(0),this.cnt=i),r[n?'removeClass':'addClass'](e),i&&(i.innerHTML=n||''),!n&&t.set('open',0)},countChildren:function(t){var e=0;return t.get('components').each((function(t){var n=this.opt.isCountable,r=this.config.hideTextnode;n&&!n(t,r)||e++}),this),e},getCaret:function(){if(!this.caret||!this.caret.length){this.pfx;this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))}return this.caret},setRoot:function(t){t=Object(s["isString"])(t)?this.em.getWrapper().find(t)[0]:t;var e=Object(c["getModel"])(t,g);e&&(this.stopListening(),this.model=e,this.initialize(this.opt),this._rendered&&this.render())},updateLayerable:function(){(this.parentView||this).render()},__clearItems:function(){var t=this.items;t&&t.remove()},remove:function(){u.a.View.prototype.remove.apply(this,arguments),this.__clearItems()},render:function(){var t=this.model,e=this.config,i=this.pfx,o=this.ppfx,a=this.opt;this.__clearItems();var c=a.isCountable,l=c&&!c(t,e.hideTextnode),u=this.isVisible(),f=this.$el.empty(),h=this.level+1;this.inputName=0,Object(s["isUndefined"])(r)&&(r=n(95).default),this.items=new r({ItemView:a.ItemView,collection:t.get('components'),config:this.config,sorter:this.sorter,opened:this.opt.opened,parentView:this,parent:t,level:h});var d=this.items.render().$el;return this.config.showWrapper||1!==h?(f.html(this.template(t)),f.find(".".concat(this.clsChildren)).append(d)):f.append(d),t.get('draggable')&&this.config.sortable||f.children(".".concat(this.clsMove)).remove(),!u&&(this.className+=" ".concat(i,"hide")),l&&(this.className+=" ".concat(o,"hidden")),f.attr('class',this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this.__render(),this._rendered=1,this},__render:function(){var t=this.model,e=this.config,n={component:t,el:this.el};e.onRender.bind(this)(n),this.em.trigger('layer:render',n)}});function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){o()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]=function(){var t,e,n={};return{name:'LayerManager',init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(n=b(b({},a),e)).stylePrefix=e.pStylePrefix,t=n.em,this},getConfig:function(){return n},onLoad:function(){t&&t.on('component:selected',this.componentChanged),this.componentChanged()},postRender:function(){var t=n.appendTo,e=n.root;(e&&this.setRoot(e),t)&&(Object(s["isElement"])(t)?t:document.querySelector(t)).appendChild(this.render())},setRoot:function(t){return e&&e.setRoot(t),this},getRoot:function(){return e&&e.model},getAll:function(){return e},componentChanged:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.fromLayers){var i=t.get('opened'),o=t.getSelected(),a=n.scrollLayers,s=o&&o.collection?o.collection.parent:null;for(var c in i)i[c].set('open',0);for(;s;)s.set('open',1),i[s.cid]=s,s=s.collection?s.collection.parent:null;if(o&&a){var l=o.viewLayer&&o.viewLayer.el;l&&l.scrollIntoView(a)}}},render:function(){var r=m.extend(n.extend);return e&&e.remove(),(e=new r({ItemView:r,level:0,config:n,opened:n.opened||{},model:t.get('DomComponents').getWrapper()})).render().el},destroy:function(){e&&e.remove(),[t,e,n].forEach((function(t){return{}}))}}}},function(t,e,n){"use strict";n.r(e);var r,i=n(14),o=n.n(i),a=n(2),s=n.n(a),c=n(0),l=n(1),u={},f={16:!1,18:!1,17:!1,91:!1},h='all',d={'⇧':16,shift:16,'⌥':18,alt:18,option:18,'⌃':17,ctrl:17,control:17,'⌘':91,command:91},p={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,',':188,'.':190,'/':191,'`':192,'-':189,'=':187,';':186,"'":222,'[':219,']':221,'\\':220},g=function(t){return p[t]||t.toUpperCase().charCodeAt(0)},v=[];for(r=1;r<20;r++)p['f'+r]=111+r;function m(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function y(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var b={16:'shiftKey',18:'altKey',17:'ctrlKey',91:'metaKey'};function w(t){var e,n,i,o,a,s;if(e=t.keyCode,-1==m(v,e)&&v.push(e),93!=e&&224!=e||(e=91),e in f)for(i in f[e]=!0,d)d[i]==e&&(C[i]=!0);else if(function(t){for(r in f)f[r]=t[b[r]]}(t),C.filter.call(this,t)&&e in u)for(s=k(),o=0;o<u[e].length;o++)if((n=u[e][o]).scope==s||'all'==n.scope){for(i in a=n.mods.length>0,f)(!f[i]&&m(n.mods,+i)>-1||f[i]&&-1==m(n.mods,+i))&&(a=!1);(0!=n.mods.length||f[16]||f[18]||f[17]||f[91])&&!a||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function O(t){var e,n=t.keyCode,r=m(v,n);if(r>=0&&v.splice(r,1),93!=n&&224!=n||(n=91),n in f)for(e in f[n]=!1,d)d[e]==n&&(C[e]=!1)}function x(){for(r in f)f[r]=!1;for(r in d)C[r]=!1}function C(t,e,n){var r,i;r=S(t),void 0===n&&(n=e,e='all');for(var o=0;o<r.length;o++)i=[],(t=r[o].split('+')).length>1&&(i=j(t),t=[t[t.length-1]]),t=t[0],(t=g(t))in u||(u[t]=[]),u[t].push({shortcut:r[o],scope:e,method:n,key:r[o],mods:i})}for(r in d)C[r]=!1;function k(){return h||'all'}function S(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function j(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=d[e[n]];return e}function P(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent('on'+e,(function(){n(window.event)}))}C.setScope=function(t){h=t||'all'},C.getScope=k,C.deleteScope=function(t){var e,n,r;for(e in u)for(n=u[e],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++},C.filter=function(t){var e=(t.target||t.srcElement).tagName;return!('INPUT'==e||'SELECT'==e||'TEXTAREA'==e)},C.isPressed=function(t){return'string'==typeof t&&(t=g(t)),-1!=m(v,t)},C.getPressedKeyCodes=function(){return v.slice(0)},C.unbind=function(t,e){var n,r,i,o,a,s=[];for(n=S(t),o=0;o<n.length;o++){if((r=n[o].split('+')).length>1&&(s=j(r)),t=r[r.length-1],t=g(t),void 0===e&&(e=k()),!u[t])return;for(i=0;i<u[t].length;i++)(a=u[t][i]).scope===e&&y(a.mods,s)&&(u[t][i]={})}},C.init=function(t){P(t.document,'keydown',(function(t){w(t)})),P(t.document,'keyup',O),P(t,'focus',x)};var _=C;function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}Object(l["hasWin"])()&&_.init(window);e["default"]=function(){var t,e,n={},r={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:1}}}};return{keymaster:_,name:'Keymaps',getConfig:function(){return e},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=E(E({},r),n),t=e.em,this.em=t,this},onLoad:function(){var t=e.defaults;for(var n in t){var r=t[n];this.add(n,r.keys,r.handler,r.opts||{})}},add:function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=this.em,s=a.get('Commands'),l=a.getEditor(),u=a.get('Canvas'),f={id:t,keys:e,handler:r},h=n[t];return h&&this.remove(t),n[t]=f,_(e,(function(e,n){var f={event:e,h:n};if(r=Object(c["isString"])(r)?s.get(r):r,!a.isEditing()&&!l.Canvas.isInputFocused()||i.force){i.prevent&&u.getCanvasView().preventDefault(e),'object'==o()(r)?s.runCommand(r,f):r(l,0,f);var h=[t,n.shortcut,e];a.trigger.apply(a,['keymap:emit'].concat(h)),a.trigger.apply(a,["keymap:emit:".concat(t)].concat(h))}})),a.trigger('keymap:add',f),f},get:function(t){return n[t]},getAll:function(){return n},remove:function(t){var e=this.em,r=this.get(t);if(r)return delete n[t],r.keys.split(', ').forEach((function(t){return _.unbind(t.trim())})),e&&e.trigger('keymap:remove',r),r},removeAll:function(){var t=this;return Object.keys(n).forEach((function(e){return t.remove(e)})),this},destroy:function(){this.removeAll(),[t,e,n].forEach((function(t){return{}})),this.em={}}}}},function(t,e,n){"use strict";n.r(e);var r=n(11),i=n.n(r),o=n(2),a=n.n(o),s=n(0),c=n(31),l={stylePrefix:'com-',defaults:[],strict:1},u=n(10);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=[['preview','Preview','preview'],['resize','Resize','resize'],['fullscreen','Fullscreen','fullscreen'],['copy','CopyComponent'],['paste','PasteComponent'],['canvas-move','CanvasMove'],['canvas-clear','CanvasClear'],['open-code','ExportTemplate','export-template'],['open-layers','OpenLayers','open-layers'],['open-styles','OpenStyleManager','open-sm'],['open-traits','OpenTraitManager','open-tm'],['open-blocks','OpenBlocks','open-blocks'],['open-assets','OpenAssets','open-assets'],['component-select','SelectComponent','select-comp'],['component-outline','SwitchVisibility','sw-visibility'],['component-offset','ShowOffset','show-offset'],['component-move','MoveComponent','move-comp'],['component-next','ComponentNext'],['component-prev','ComponentPrev'],['component-enter','ComponentEnter'],['component-exit','ComponentExit','select-parent'],['component-delete','ComponentDelete'],['component-style-clear','ComponentStyleClear'],['component-drag','ComponentDrag']];e["default"]=function(){var t,e={},r={},o={},a={};return{CommandAbstract:c["default"],name:'Commands',init:function(){var r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=h(h({},l),a),t=e.em;var c=e.pStylePrefix;return c&&(e.stylePrefix=c+e.stylePrefix),Object.keys(e.defaults).forEach((function(t){var n=e.defaults[t];n.id&&r.add(n.id,n)})),o['tlb-delete']={run:function(t){return t.runCommand('core:component-delete')}},o['tlb-clone']={run:function(t){t.runCommand('core:copy'),t.runCommand('core:paste')}},o['tlb-move']={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.getModel(),o=n&&n.event,a=n.target,c=a||t.getSelected(),l=a?[a]:i()(t.getSelectedAll()),f=o&&'dragstart'==o.type,h={preserveSelected:1},d=['absolute','translate'];if(!c||!c.get('draggable'))return r.logWarning('The element is not draggable');var p=c.get('dmode')||r.get('dmode'),g=function(){return r.stopDefault(h)},v=Object(s["includes"])(d,p);l.forEach((function(t){return t.trigger('disable')})),f?setTimeout(g,0):g();var m=function(t){r.trigger("".concat(u["b"],":start"),t)},y=function(t){r.trigger(u["b"],t)},b=function(e,n,i){l.forEach((function(t){return t.set('status','selected')})),t.select(l),c.emitUpdate(),r.trigger("".concat(u["b"],":end"),i),setTimeout((function(){return r.runDefault(h)})),(v||i.cancelled)&&r.set('_cmpDrag',1)};if(v)t.runCommand('core:component-drag',{guidesInfo:1,mode:p,target:c,onStart:m,onDrag:y,onEnd:b,event:o});else{f&&o.dataTransfer.setDragImage(c.view.el,0,0);var w=t.Commands.get('move-comp');w.onStart=m,w.onDrag=y,w.onEndMoveFromModel=b,w.initSorterFromModels(l)}l.forEach((function(t){return t.set('status','freezed-selected')}))}},o['core:undo']=function(t){return t.UndoManager.undo()},o['core:redo']=function(t){return t.UndoManager.redo()},d.forEach((function(e){var r=e[2],i=n(96)("./".concat(e[1])).default,a="core:".concat(e[0]);o[a]=i,r&&(o[r]=i,['run','stop'].forEach((function(e){t.on("".concat(e,":").concat(r),(function(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(n=t).trigger.apply(n,["".concat(e,":").concat(a)].concat(i))}))})))})),e.em&&(e.model=e.em.get('Canvas')),this.loadDefaultCommands(),this},add:function(t,e){return Object(s["isFunction"])(e)&&(e={run:e}),e.stop||(e.noStop=1),delete e.initialize,e.id=t,r[t]=c["default"].extend(e),this},get:function(n){var i=r[n];return Object(s["isFunction"])(i)?(i=new i(e),r[n]=i):i||t.logWarning("'".concat(n,"' command not found")),i},extend:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get(t);if(n){var r=h(h({},n.constructor.prototype),e);this.add(t,r);var i=d.filter((function(e){return"core:".concat(e[0])===t&&e[2]}))[0];i&&this.add(i[2],r)}return this},has:function(t){return!!r[t]},getAll:function(){return r},run:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.runCommand(this.get(t),e)},stop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.stopCommand(this.get(t),e)},isActive:function(t){return this.getActive().hasOwnProperty(t)},getActive:function(){return a},loadDefaultCommands:function(){for(var t in o)this.add(t,o[t]);return this},runCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=t.get('Editor');this.isActive(o)&&!i.force&&e.strict||(r=s&&n.callRun(s,i),o&&n.stop&&!n.noStop&&!i.abort&&(a[o]=r))}return r},stopCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=t.get('Editor');(this.isActive(o)||i.force||!e.strict)&&(o&&delete a[o],r=n.callStop(s,i))}return r},create:function(t){return t.stop||(t.noStop=1),new(c["default"].extend(t))(e)},destroy:function(){[t,e,r,o,a].forEach((function(t){return{}}))}}}}])["default"]}));
  //# sourceMappingURL=grapes.min.js.map