mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
13 lines
674 KiB
JavaScript
13 lines
674 KiB
JavaScript
/*! grapesjs - 0.15.8 */
|
||
!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()}(window,(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=85)}([function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,h=s.toString,d=s.hasOwnProperty,f=Array.isArray,p=Object.keys,g=Object.create,v=function(){},m=function(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)};e.nodeType?i._=m:(!n.nodeType&&n.exports&&(e=n.exports=m),e._=m),m.VERSION="1.9.1";var y,b=function(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)}},w=function(t,e,n){return m.iteratee!==y?m.iteratee(t,e):null==t?m.identity:m.isFunction(t)?b(t,e,n):m.isObject(t)&&!m.isArray(t)?m.matcher(t):m.property(t)};m.iteratee=y=function(t,e){return w(t,e,1/0)};var x=function(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)}},C=function(t){if(!m.isObject(t))return{};if(g)return g(t);v.prototype=t;var e=new v;return v.prototype=null,e},O=function(t){return function(e){return null==e?void 0:e[t]}},S=function(t,e){return null!=t&&d.call(t,e)},k=function(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},T=Math.pow(2,53)-1,P=O("length"),j=function(t){var e=P(t);return"number"==typeof e&&e>=0&&e<=T};m.each=m.forEach=function(t,e,n){var r,i;if(e=b(e,n),j(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=m.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},m.map=m.collect=function(t,e,n){e=w(e,n);for(var r=!j(t)&&m.keys(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};var E=function(t){var e=function(e,n,r,i){var o=!j(e)&&m.keys(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 l=o?o[s]:s;r=n(r,e[l],l,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,b(n,i,4),r,o)}};m.reduce=m.foldl=m.inject=E(1),m.reduceRight=m.foldr=E(-1),m.find=m.detect=function(t,e,n){var r=(j(t)?m.findIndex:m.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},m.filter=m.select=function(t,e,n){var r=[];return e=w(e,n),m.each(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r},m.reject=function(t,e,n){return m.filter(t,m.negate(w(e)),n)},m.every=m.all=function(t,e,n){e=w(e,n);for(var r=!j(t)&&m.keys(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},m.some=m.any=function(t,e,n){e=w(e,n);for(var r=!j(t)&&m.keys(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},m.contains=m.includes=m.include=function(t,e,n,r){return j(t)||(t=m.values(t)),("number"!=typeof n||r)&&(n=0),m.indexOf(t,e,n)>=0},m.invoke=x((function(t,e,n){var r,i;return m.isFunction(e)?i=e:m.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),m.map(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=k(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))})),m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(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,l=(t=j(t)?t:m.values(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=w(e,n),m.each(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o},m.min=function(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,l=(t=j(t)?t:m.values(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=w(e,n),m.each(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o},m.shuffle=function(t){return m.sample(t,1/0)},m.sample=function(t,e,n){if(null==e||n)return j(t)||(t=m.values(t)),t[m.random(t.length-1)];var r=j(t)?m.clone(t):m.values(t),i=P(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=m.random(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)},m.sortBy=function(t,e,n){var r=0;return e=w(e,n),m.pluck(m.map(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")};var M=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=w(r,i),m.each(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}};m.groupBy=M((function(t,e,n){S(t,n)?t[n].push(e):t[n]=[e]})),m.indexBy=M((function(t,e,n){t[n]=e})),m.countBy=M((function(t,e,n){S(t,n)?t[n]++:t[n]=1}));var D=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;m.toArray=function(t){return t?m.isArray(t)?u.call(t):m.isString(t)?t.match(D):j(t)?m.map(t,m.identity):m.values(t):[]},m.size=function(t){return null==t?0:j(t)?t.length:m.keys(t).length},m.partition=M((function(t,e,n){t[n?0:1].push(e)}),!0),m.first=m.head=m.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:m.initial(t,t.length-e)},m.initial=function(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},m.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:m.rest(t,Math.max(0,t.length-e))},m.rest=m.tail=m.drop=function(t,e,n){return u.call(t,null==e||n?1:e)},m.compact=function(t){return m.filter(t,Boolean)};var A=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,a=P(t);o<a;o++){var s=t[o];if(j(s)&&(m.isArray(s)||m.isArguments(s)))if(e)for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else A(s,e,n,r),i=r.length;else n||(r[i++]=s)}return r};m.flatten=function(t,e){return A(t,e,!1)},m.without=x((function(t,e){return m.difference(t,e)})),m.uniq=m.unique=function(t,e,n,r){m.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=w(n,r));for(var i=[],o=[],a=0,s=P(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?m.contains(o,c)||(o.push(c),i.push(l)):m.contains(i,l)||i.push(l)}return i},m.union=x((function(t){return m.uniq(A(t,!0,!0))})),m.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=P(t);r<i;r++){var o=t[r];if(!m.contains(e,o)){var a;for(a=1;a<n&&m.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},m.difference=x((function(t,e){return e=A(e,!0,!0),m.filter(t,(function(t){return!m.contains(e,t)}))})),m.unzip=function(t){for(var e=t&&m.max(t,P).length||0,n=Array(e),r=0;r<e;r++)n[r]=m.pluck(t,r);return n},m.zip=x(m.unzip),m.object=function(t,e){for(var n={},r=0,i=P(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var L=function(t){return function(e,n,r){n=w(n,r);for(var i=P(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};m.findIndex=L(1),m.findLastIndex=L(-1),m.sortedIndex=function(t,e,n,r){for(var i=(n=w(n,r,1))(e),o=0,a=P(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o};var N=function(t,e,n){return function(r,i,o){var a=0,s=P(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),m.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}};m.indexOf=N(1,m.findIndex,m.sortedIndex),m.lastIndexOf=N(-1,m.findLastIndex),m.range=function(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},m.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(u.call(t,r,r+=e));return n};var I=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=C(t.prototype),a=t.apply(o,i);return m.isObject(a)?a:o};m.bind=x((function(t,e,n){if(!m.isFunction(t))throw new TypeError("Bind must be called on a function");var r=x((function(i){return I(t,r,e,this,n.concat(i))}));return r})),m.partial=x((function(t,e){var n=m.partial.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 I(t,r,this,this,a)};return r})),m.partial.placeholder=m,m.bindAll=x((function(t,e){var n=(e=A(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=m.bind(t[r],t)}})),m.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return S(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},m.delay=x((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),m.defer=m.partial(m.delay,m,1),m.throttle=function(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:m.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=m.now();s||!1!==n.leading||(s=c);var u=e-(c-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},m.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},a=x((function(a){if(r&&clearTimeout(r),n){var s=!r;r=setTimeout(o,e),s&&(i=t.apply(this,a))}else r=m.delay(o,e,this,a);return i}));return a.cancel=function(){clearTimeout(r),r=null},a},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){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}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},m.once=m.partial(m.before,2),m.restArguments=x;var F=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],_=function(t,e){var n=R.length,r=t.constructor,i=m.isFunction(r)&&r.prototype||s,o="constructor";for(S(t,o)&&!m.contains(e,o)&&e.push(o);n--;)(o=R[n])in t&&t[o]!==i[o]&&!m.contains(e,o)&&e.push(o)};m.keys=function(t){if(!m.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)S(t,n)&&e.push(n);return F&&_(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var n in t)e.push(n);return F&&_(t,e),e},m.values=function(t){for(var e=m.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},m.mapObject=function(t,e,n){e=w(e,n);for(var r=m.keys(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o},m.pairs=function(t){for(var e=m.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},m.invert=function(t){for(var e={},n=m.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},m.functions=m.methods=function(t){var e=[];for(var n in t)m.isFunction(t[n])&&e.push(n);return e.sort()};var V=function(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,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=o[c])}return n}};m.extend=V(m.allKeys),m.extendOwn=m.assign=V(m.keys),m.findKey=function(t,e,n){e=w(e,n);for(var r,i=m.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r};var z,H,$=function(t,e,n){return e in n};m.pick=x((function(t,e){var n={},r=e[0];if(null==t)return n;m.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=m.allKeys(t)):(r=$,e=A(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})),m.omit=x((function(t,e){var n,r=e[0];return m.isFunction(r)?(r=m.negate(r),e.length>1&&(n=e[1])):(e=m.map(A(e,!1,!1),String),r=function(t,n){return!m.contains(e,n)}),m.pick(t,r,n)})),m.defaults=V(m.allKeys,!0),m.create=function(t,e){var n=C(t);return e&&m.extendOwn(n,e),n},m.clone=function(t){return m.isObject(t)?m.isArray(t)?t.slice():m.extend({},t):t},m.tap=function(t,e){return e(t),t},m.isMatch=function(t,e){var n=m.keys(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},z=function(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 i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&H(t,e,n,r)},H=function(t,e,n,r){t instanceof m&&(t=t._wrapped),e instanceof m&&(e=e._wrapped);var i=h.call(t);if(i!==h.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return l.valueOf.call(t)===l.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(m.isFunction(a)&&a instanceof a&&m.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),o){if((c=t.length)!==e.length)return!1;for(;c--;)if(!z(t[c],e[c],n,r))return!1}else{var u,d=m.keys(t);if(c=d.length,m.keys(e).length!==c)return!1;for(;c--;)if(u=d[c],!S(e,u)||!z(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0},m.isEqual=function(t,e){return z(t,e)},m.isEmpty=function(t){return null==t||(j(t)&&(m.isArray(t)||m.isString(t)||m.isArguments(t))?0===t.length:0===m.keys(t).length)},m.isElement=function(t){return!(!t||1!==t.nodeType)},m.isArray=f||function(t){return"[object Array]"===h.call(t)},m.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},m.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],(function(t){m["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}})),m.isArguments(arguments)||(m.isArguments=function(t){return S(t,"callee")});var W=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof W&&(m.isFunction=function(t){return"function"==typeof t||!1}),m.isFinite=function(t){return!m.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},m.isNaN=function(t){return m.isNumber(t)&&isNaN(t)},m.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===h.call(t)},m.isNull=function(t){return null===t},m.isUndefined=function(t){return void 0===t},m.has=function(t,e){if(!m.isArray(e))return S(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!d.call(t,i))return!1;t=t[i]}return!!n},m.noConflict=function(){return i._=o,this},m.identity=function(t){return t},m.constant=function(t){return function(){return t}},m.noop=function(){},m.property=function(t){return m.isArray(t)?function(e){return k(e,t)}:O(t)},m.propertyOf=function(t){return null==t?function(){}:function(e){return m.isArray(e)?k(t,e):t[e]}},m.matcher=m.matches=function(t){return t=m.extendOwn({},t),function(e){return m.isMatch(e,t)}},m.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},m.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},U=m.invert(B),q=function(t){var e=function(e){return t[e]},n="(?:"+m.keys(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}};m.escape=q(B),m.unescape=q(U),m.result=function(t,e,n){m.isArray(e)||(e=[e]);var r=e.length;if(!r)return m.isFunction(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=m.isFunction(o)?o.call(t):o}return t};var G=0;m.uniqueId=function(t){var e=++G+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},X=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+Y[t]};m.template=function(t,e,n){!e&&n&&(e=n),e=m.defaults({},e,m.templateSettings);var r,i=RegExp([(e.escape||K).source,(e.interpolate||K).source,(e.evaluate||K).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,(function(e,n,r,i,s){return a+=t.slice(o,s).replace(X,J),o=s+e.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e})),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return r.call(this,t,m)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},m.chain=function(t){var e=m(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){return m.each(m.functions(t),(function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),Z(this,n.apply(m,t))}})),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=a[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Z(this,n)}})),m.each(["concat","join","slice"],(function(t){var e=a[t];m.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}})),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return m}.apply(e,[]))||(n.exports=r)}()}).call(this,n(23),n(66)(t))},function(t,e,n){(function(r){var i,o,a;a="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r,i=[n(0),n(21),e],void 0===(o=function(t,e,n){a.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)?l(t):n.isString(t)?function(e){return e.get(t)}:t},l=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},c=e.Events={},u=/\s+/,h=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=h(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};c.on=function(t,e,n){return d(this,t,e,n)};var d=function(t,e,n,r,i){return t._events=h(f,t._events||{},e,n,{context:r,ctx:t,listening:i}),i&&((t._listeners||(t._listeners={}))[i.id]=i),t};c.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 d(t,e,r,this,a),this};var f=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};c.off=function(t,e,n){return this._events?(this._events=h(p,this._events,t,e,{context:n,listeners:this._listeners}),this):this},c.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,l=i.listeners;if(e||r||s){for(var c=e?[e]:n.keys(t);a<c.length;a++){var u=t[e=c[a]];if(!u)break;for(var h=[],d=0;d<u.length;d++){var f=u[d];r&&r!==f.callback&&r!==f.callback._callback||s&&s!==f.context?h.push(f):(o=f.listening)&&0==--o.count&&(delete l[o.id],delete o.listeningTo[o.objId])}h.length?t[e]=h:delete t[e]}return t}for(var p=n.keys(l);a<p.length;a++)delete l[(o=l[p[a]]).id],delete o.listeningTo[o.objId]}};c.once=function(t,e,r){var i=h(g,{},t,e,n.bind(this.off,this));return"string"==typeof t&&null==r&&(e=void 0),this.on(i,e,r)},c.listenToOnce=function(t,e,r){var i=h(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};c.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 h(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}};c.bind=c.on,c.unbind=c.off,n.extend(e,c);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,c,{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=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,h=this._previousAttributes;for(var d in i)e=i[d],n.isEqual(c[d],e)||s.push(d),n.isEqual(h[d],e)?delete u[d]:u[d]=e,o?delete c[d]:c[d]=e;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!a){s.length&&(this._pending=r);for(var f=0;f<s.length;f++)this.trigger("change:"+s[f],this,c[s[f]],r)}if(l)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)},R(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,l=this.attributes;r.success=function(t){a.attributes=l;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)},R(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,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):(R(this,t),a=this.sync("delete",this,t)),i||o(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();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},x={add:!0,remove:!1},C=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,c,{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,x))},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=[],l=[],c=[],u=[],h={},d=e.add,f=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(f&&o!==y){var b=this._isModel(o)?o.attributes:o;e.parse&&(b=y.parse(b,e)),y.set(b,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}h[y.cid]||(h[y.cid]=!0,s.push(y)),t[a]=y}else d&&(o=t[a]=this._prepareModel(o,e))&&(l.push(o),this._addReference(o,e),h[o.cid]=!0,s.push(o))}if(p){for(a=0;a<this.length;a++)h[(o=this.models[a]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var x=!1,O=!v&&d&&p;if(s.length&&O?(x=this.length!==s.length||n.some(this.models,(function(t,e){return t!==s[e]})),this.models.length=0,C(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),C(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=i&&(e.index=i+a),(o=l[a]).trigger("add",o,this,e);(g||x)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},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)},R(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 O=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,k)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,k=["model","collection","el","id","attributes","className","tagName","events"];n.extend(O.prototype,c,{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(S);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=T[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")||F()),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 l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(a,i));return r.trigger("request",r,c,i),c};var T={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)},j=/\((.*?)\)/g,E=/(\(\?)?:\w+/g,M=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(P.prototype,c,{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(j,"(?:$1)?").replace(E,(function(t,e){return e?t:"([^/?]+)"})).replace(M,"([^?]*?)"),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 A=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},L=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,I=/#.*$/;A.started=!1,n.extend(A.prototype,c,{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(L,"")},start:function(t){if(A.started)throw new Error("Backbone.history has already been started");if(A.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(N,"/"),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),A.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(!A.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(I,"")),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 A,y.extend=b.extend=P.extend=O.extend=A.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 F=function(){throw new Error('A "url" property or function must be specified')},R=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}(a,n,t,e)}.apply(e,i))||(t.exports=o)}).call(this,n(23))},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}},function(t,e,n){"use strict";n.d(e,"k",(function(){return v})),n.d(e,"p",(function(){return s})),n.d(e,"o",(function(){return l})),n.d(e,"i",(function(){return f})),n.d(e,"m",(function(){return o})),n.d(e,"f",(function(){return m})),n.d(e,"c",(function(){return y})),n.d(e,"a",(function(){return h})),n.d(e,"l",(function(){return g})),n.d(e,"e",(function(){return x})),n.d(e,"j",(function(){return C})),n.d(e,"d",(function(){return p})),n.d(e,"q",(function(){return a})),n.d(e,"n",(function(){return d})),n.d(e,"g",(function(){return b})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return O}));var r=n(0),i=window.Element.prototype,o=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector,a=function(t,e){var n={},i=Object(r.keys)(e);for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],s=e[o];i.indexOf(o)>=0?a!==s&&(n[o]=s):n[o]=null}for(var l in e)e.hasOwnProperty(l)&&Object(r.isUndefined)(t[l])&&(n[l]=e[l]);return n},s=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach((function(t){return t.addEventListener(e[r],n)}))},i=0;i<e.length;++i)r(i)},l=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach((function(t){return t.removeEventListener(e[r],n)}))},i=0;i<e.length;++i)r(i)},c=function(t){return t.replace(parseFloat(t),"")},u=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},h=function(t){var e=t.split("-").filter(String);return e[0].toLowerCase()+e.slice(1).map(u)},d=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},f=function(t){return"draggable"in document.createElement("i")&&(t?t.get("Config").nativeDnD:1)},p=function(t){return Object(r.isElement)(t)||g(t)?t:t&&t.getEl?t.getEl():void 0},g=function(t){return t&&3===t.nodeType},v=function(t){return t&&!g(t)&&!function(t){return t&&8===t.nodeType}(t)},m=function(t,e){var n=t;return Object(r.isElement)(t)&&(n=e(t).data("model")),n},y=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(g(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},b=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},w=function(t){return t.which||t.keyCode},x=function(t){return String.fromCharCode(w(t))},C=function(t){return 27===w(t)},O=function(t){return t.charAt(0).toUpperCase()+t.substring(1)}},function(t,e,n){"use strict";n.r(e);var r=n(6),i=n.n(r),o=n(2),a=n.n(o),s=n(0),l=n(3),c=n(20),u=n(1),h=n.n(u),d=n(18),f=n(7),p=n(9);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(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var m=h.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(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})},getTargetValue:function(){var t,e=this.get("name"),n=this.target;return t=this.get("changeProp")?n.get(e):n.getAttributes()[e],Object(s.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(s.isUndefined)(t))if(this.get("changeProp"))n.set(r,t,e);else{var i=v({},n.get("attributes"));i[r]=t,n.set("attributes",i,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,v({},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")}}),y=h.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(s.isString)(t)||Object(s.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"}switch(o){case"title":case"alt":case"id":i.placeholder=t.labelPlhText;break;case"href":i.placeholder=t.labelPlhHref}switch(o){case"target":i.options=t.optionsTarget}n.push(i)}return n}}}(r&&r.getConfig());Object(s.isString)(t)&&(t=[t]);for(var o=0,a=t.length;o<a;o++){var l=t[o],c=Object(s.isString)(l)?i.build(l)[0]:l;c.target=this.target,t[o]=c}}return h.a.Collection.prototype.add.apply(this,[t,e])}});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(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var x=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},C=h.a.Model.extend(c.a).extend({defaults:{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:"",classes:"",script:"","script-export":"",attributes:"",traits:["id","title"],propagate:"",dmode:"",toolbar:null},init:function(){},updated:function(t,e,n){},removed:function(){},initialize: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=n.em,i=this.parent(),o=i&&i.attributes;if(o&&o.propagate){var a={},l=o.propagate;l.forEach((function(t){return a[t]=i.get(t)})),a.propagate=l,a=w({},a,{},e),this.set(a)}var c=this.get("propagate");c&&this.set("propagate",Object(s.isArray)(c)?c:[c]),n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=r,this.opt=n,this.em=r,this.config=n.config||{},this.set("attributes",w({},this.defaults.attributes||{},{},this.get("attributes")||{})),this.ccid=C.createId(this),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),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.set("status",""),["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))}))})),n.temporary||(this.init(),r&&r.trigger("component:create",this))},is:function(t){return!(this.get("type")!=t)},props:function(){return this.attributes},index:function(){var t=this.collection;return t&&t.indexOf(this)},setDragMode:function(t){return this.set("dmode",t)},find:function(t){var e=[];return this.view.$el.find(t).each((function(t,n,r){var i=r.eq(n).data("model");i&&e.push(i)})),e},findType: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},closest:function(t){var e=this.view.$el.closest(t);return e.length&&e.data("model")},tagUpdated:function(){var t=this.collection,e=t.indexOf(this);t.remove(this),t.add(this,{at:e})},replaceWith:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})},attrUpdated: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 c=w({},this.previous("attributes")),u=Object(l.q)(c,this.get("attributes"));Object(s.keys)(u).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,u[t],r)}))},setAttributes:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set("attributes",w({},t),e),this},addAttributes:function(t){var e=w({},this.getAttributes(),{},t);return this.setAttributes(e),this},getStyle:function(){var t=this.em;if(t&&t.getConfig("avoidInlineStyle")){var e=this.get("state"),n=t.get("CssComposer").getIdRule(this.getId(),{state:e});if(this.rule=n,n)return n.getStyle()}return c.a.getStyle.call(this)},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]:{},r=this.em,i=this.opt;if(r&&r.getConfig("avoidInlineStyle")&&!i.temporary){var o=this.get("style")||{};e=w({},e=Object(s.isString)(e)?this.parseStyle(e):e,{},o);var a=this.get("state"),u=r.get("CssComposer"),h=this.getStyle();this.rule=u.setIdRule(this.getId(),e,w({},n,{state:a}));var d=Object(l.q)(h,e);this.set("style",{},{silent:1}),Object(s.keys)(d).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=c.a.setStyle.apply(this,arguments);return e},getAttributes:function(){var t,e=this.em,n=[],r=w({},this.get("attributes")),i=e&&e.get("SelectorManager"),o=this.getId();(this.get("classes").forEach((function(t){return n.push(Object(s.isString)(t)?t:t.get("name"))})),n.length&&(r.class=n.join(" ")),Object(s.has)(r,"id"))||(!function(t){return t&&t.getConfig("avoidInlineStyle")}(e)?Object(s.isEmpty)(this.getStyle())||(t=1):t=i&&i.get(o,i.Selector.TYPE_ID),t&&(r.id=this.getId()));return r},addClass:function(t){var e=this.em.get("SelectorManager").addClass(t);return this.get("classes").add(e)},setClass:function(t){return this.get("classes").reset(),this.addClass(t)},removeClass:function(t){var e=[];t=Object(s.isArray)(t)?t:[t];var n=this.get("classes"),r=f.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},getClasses:function(){var t=this.getAttributes().class;return t?t.split(" "):[]},initClasses:function(){var t=[this,"change:classes",this.initClasses],e=this.get("classes")||[],n=Object(s.isString)(e)?e.split(" "):e;this.stopListening.apply(this,t);var r=this.normalizeClasses(n),i=new p.a([]);return this.set("classes",i),i.add(r),this.listenTo.apply(this,t),this},initComponents:function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var e=new d.a(null,this.opt);e.parent=this;var n=this.get("components"),r=!this.opt.avoidChildren;return this.set("components",e),r&&e.add(Object(s.isFunction)(n)?n(this):n),this.listenTo.apply(this,t),this},initTraits:function(t){var e=this.em,n=[this,"change:traits",this.initTraits];this.stopListening.apply(this,n),this.loadTraits();var r=w({},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.listenTo.apply(this,n),t&&e&&e.trigger("component:toggled"),this},append:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.components().add(t,e);return Object(s.isArray)(n)?n:[n]},components:function(t){var e=this.get("components");return Object(s.isUndefined)(t)?e:(e.reset(),t&&this.append(t))},parent:function(){var t=this.collection;return t&&t.parent},scriptUpdated:function(){this.set("scriptUpdated",1)},initToolbar: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)}},loadTraits:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=t||this.get("traits"),!((t=Object(s.isFunction)(t)?t(this):t)instanceof y)){var n=new y([],this.opt);n.setTarget(this),t.length&&(t.forEach((function(t){return t.attributes&&delete t.attributes.value})),n.add(t)),this.set("traits",n,e)}return this},getTrait:function(t){return this.get("traits").filter((function(e){return e.get("id")===t||e.get("name")===t}))[0]},updateTrait:function(t,e){var n=this.em,r=this.getTrait(t);return r&&r.set(e),n&&n.trigger("component:toggled"),this},getTraitIndex:function(t){var e=this.getTrait(t);return e?this.get("traits").indexOf(e):e},removeTrait:function(t){var e=this,n=this.em,r=(Object(s.isArray)(t)?t:[t]).map((function(t){return e.getTrait(t)})),i=this.get("traits").remove(r);return n&&n.trigger("component:toggled"),i},addTrait:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.get("traits").add(t,e);return n&&n.trigger("component:toggled"),r},normalizeClasses:function(t){var e=[],n=this.em;if(n){var r=n.get("SelectorManager");if(r)return t.forEach((function(t){var n="";n="string"==typeof t?t:t.name;var i=r.add(n);e.push(i)})),e}},clone:function(){var t=this.em,e=this.getStyle(),n=w({},this.attributes),r=w({},this.opt);n.attributes=w({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.get("components").each((function(t,e){n.components[e]=t.clone()})),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="",n.view="",r.collection=null,t&&t.getConfig("avoidInlineStyle")&&!Object(s.isEmpty)(e)&&(n.style=e);var i=new this.constructor(n,r);return t&&t.trigger("component:clone",i),this.trigger("component:clone",i),i},getName:function(){var t=this.get("name")||this.get("custom-name"),e=this.get("tagName");e="div"==e?"box":e;var n=this.get("type")||e;return n=n.charAt(0).toUpperCase()+n.slice(1),t||n},getIcon:function(){var t=this.get("icon");return t?t+" ":""},toHTML:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=e.get("tagName"),i=e.get("void"),o=t.attributes,a=this.getAttrToHTML();for(var l in o&&(Object(s.isFunction)(o)?a=o(e,a)||{}:Object(s.isObject)(o)&&(a=o)),a){var c=a[l],u=Object(s.isString)(c)?c.replace(/"/g,"""):c;Object(s.isUndefined)(u)||(Object(s.isBoolean)(u)?u&&n.push(l):n.push("".concat(l,'="').concat(u,'"')))}var h=n.length?" ".concat(n.join(" ")):"",d="<".concat(r).concat(h).concat(i?"/":"",">").concat(e.get("content"));return e.get("components").each((function(e){return d+=e.toHTML(t)})),!i&&(d+="</".concat(r,">")),d},getAttrToHTML:function(){var t=this.getAttributes();return delete t.style,t},toJSON:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=h.a.Model.prototype.toJSON.apply(this,e);if(r.attributes=this.getAttributes(),delete r.attributes.class,delete r.toolbar,delete r.traits,this.em.getConfig("avoidDefaults")){var i=Object(s.result)(this,"defaults");Object(s.forEach)(i,(function(t,e){-1===["type","content"].indexOf(e)&&r[e]===t&&delete r[e]})),Object(s.isEmpty)(r.type)&&delete r.type,Object(s.forEach)(["attributes","style"],(function(t){Object(s.isEmpty)(i[t])&&Object(s.isEmpty)(r[t])&&delete r[t]})),Object(s.forEach)(["classes","components"],(function(t){Object(s.isEmpty)(i[t])&&!r[t].length&&delete r[t]}))}return r},getId:function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},setId:function(t,e){var n=w({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},getEl:function(){return this.view&&this.view.el},getView:function(){return this.view},getScriptString:function(t){var e=this,n=t||this.get("script");if(!n)return n;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=x(o.tagVarStart||"{[ "),l=x(o.tagVarEnd||" ]}"),c=new RegExp("".concat(a,"([\\w\\d-]*)").concat(l),"g");return n=n.replace(c,(function(t,n){e.scriptUpdated();var r=e.attributes[n]||"";return Object(s.isArray)(r)||"object"==i()(r)?JSON.stringify(r):r}))},emitUpdate:function(t){for(var e=this.em,n="component:update"+(t?":".concat(t):""),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];t&&this.updated.apply(this,[t,t&&this.get(t),t&&this.previous(t)].concat(i)),this.trigger.apply(this,[n].concat(i)),e&&e.trigger.apply(e,[n,this].concat(i))},onAll:function(t){return Object(s.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this},remove:function(){var t=this.collection;return t&&t.remove(this)},resetId:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t=this.em,e=this.getId();if(e){var n=C.createId(this);this.setId(n);var r=t&&t.get("CssComposer").getIdRule(e),i=r&&r.get("selectors").at(0);return i&&i.set("name",n),this}},_getStyleRule: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)},_getStyleSelector:function(t){var e=this._getStyleRule(t);return e&&e.get("selectors").at(0)},_idUpdated:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.idUpdate){var r=this.ccid,i=this.get("attributes")||{},o=i.id,a=(this.previous("attributes")||{}).id||r,s=C.getList(this);if(s[o])return this.setId(a,{idUpdate:1});delete s[a],s[o]=this,this.ccid=o;var l=this._getStyleSelector({id:a});l&&l.set({name:o,label:o})}}},{isComponent:function(t){return{tagName:t.tagName?t.tagName.toLowerCase():""}},createId:function(t){var e,n=C.getList(t),r=t.get("attributes").id;return r?(e=C.getIncrementId(r,n),t.setId(e)):e=C.getNewId(n),n[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=C.getNewId(t);return r},getIncrementId:function(t,e){for(var n=1,r=t;e[r];)n++,r="".concat(t,"-").concat(n);return r},getList:function(t){var e=t.opt&&t.opt.domc;return e?e.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=Object(s.isArray)(t)?t:[t];r.forEach((function(t){var r=t.attributes,i=void 0===r?{}:r,o=t.components,a=i.id;if(a&&n[a]){var l=C.getIncrementId(a,n);i.id=l,Object(s.isArray)(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(a)&&(e[n]="#".concat(l))}))}))}o&&C.checkId(o,e,n)}))}});e.default=C},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(1),a=n.n(o),s=n(0),l=n(18),c=n(30),u=n(9),h=n(11);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 f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(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=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",this.renderAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status",this.updateStatus),this.listenTo(e,"change:state",this.updateState),this.listenTo(e,"change:script",this.reset),this.listenTo(e,"change:content",this.updateContent),this.listenTo(e,"change",this.handleChange),this.listenTo(e,"active",this.onActive),o.data("model",e),e.view=this,this.initClasses(),this.initComponents({avoidRender:1}),this.events=f({},this.events,{},a&&{dragstart:"handleDragStart"}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())},_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(){},remove:function(){return a.a.View.prototype.remove.apply(this,arguments),this.removed(this._clbObj()),this},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=t.get("classes");e instanceof u.a&&(this.stopListening(t,"change:classes",this.initClasses),this.listenTo(t,"change:classes",this.initClasses),this.listenTo(e,"add remove change",this.updateClasses),e.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 l.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;for(var e in t.emitUpdate(),t.changed)t.emitUpdate(e)},importClasses:function(){var t=this.config.em.get("SelectorManager");t&&this.model.get("classes").each((function(e){t.add(e.get("name"))}))},updateState:function(t){var e="hc-state";this.model.get("state")?this.$el.addClass(e):this.$el.removeClass(e)},updateStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(this.em,this.el),n=this.model.get("status"),r=this.pfx,i=this.ppfx,o="".concat(r,"selected"),a="".concat(o,"-parent"),s="".concat(i,"freezed"),l="".concat(i,"hovered"),c=[o,a,s,l];this.$el.removeClass(c.join(" "));var u=e.getAttribute("class")||"",h="";switch(n){case"selected":h="".concat(u," ").concat(o);break;case"selected-parent":h="".concat(u," ").concat(a);break;case"freezed":h="".concat(u," ").concat(s);break;case"freezed-selected":h="".concat(u," ").concat(s," ").concat(o);break;case"hovered":h=t.avoidHover?"":"".concat(u," ").concat(l)}(h=h.trim())&&e.setAttribute("class",h)},updateHighlight:function(){var t=this.model.get("highlightable");this.setAttribute("data-highlightable",t?1:"")},updateStyle:function(){var t=this.em,e=this.model;if(t&&t.get("avoidInlineStyle")){this.el.id=e.getId();var n=e.getStyle();!Object(s.isEmpty)(n)&&e.setStyle(n)}else this.setAttribute("style",e.styleToString())},updateClasses:function(){var t=this.model.get("classes").pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus()},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=this.config,o=e.attributes,a=o.highlightable,l=o.textable,c=f({"data-gjs-type":o.type||"default"},i.draggableComponents?{draggable:!0}:{},{},a?{"data-highlightable":1}:{},{},l?{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)}));var u=f({},c,{},e.getAttributes());Object(s.keys)(u).forEach((function(t){return!1===u[t]&&delete u[t]})),n.attr(u),this.updateStyle()},updateContent:function(){this.getChildrenContainer().innerHTML=this.model.get("content")},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},reset:function(){var t=this.el,e=this.model,n=e.components();this.el="",this._ensureElement(),this.$el.data({model:e,collection:n}),Object(h.d)(t,this.el),this.render()},renderChildren:function(){this.updateContent();var t=this.getChildrenContainer(),e=new c.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()},render:function(){return this.renderAttributes(),this.modelOpt.temporary?this:(this.renderChildren(),this.updateScript(),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){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e,n){"use strict";var r=n(1),i=n.n(r).a.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:1,active:!0,private:!1,protected:!1},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.config,r=void 0===n?{}:n,o=this.get("name"),a=this.get("label");o?a||this.set("label",o):this.set("name",a);var s=this.get("name"),l=r.escapeName,c=l?l(s):i.escapeName(s);this.set("name",c)},getFullName:function(){var t="";switch(this.get("type")){case 1:t=".";break;case 2:t="#"}return t+this.get("name")}},{TYPE_CLASS:1,TYPE_ID:2,escapeName:function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,"-")}});e.a=i},function(t,e,n){var r=n(72),i=n(73),o=n(74);t.exports=function(t){return r(t)||i(t)||o()}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n.n(i),a=n(7);e.a=o.a.Collection.extend({model:a.a,modelId:function(t){return"".concat(t.name,"_").concat(t.type||a.a.TYPE_CLASS)},getStyleable:function(){return Object(r.filter)(this.models,(function(t){return t.get("active")&&!t.get("private")}))},getValid:function(){return Object(r.filter)(this.models,(function(t){return!t.get("private")}))},getFullString:function(t){var e=[];return(t||this).forEach((function(t){return e.push(t.getFullName())})),e.join("").trim()}})},function(t,e,n){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]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),h=/Opera\//.test(t),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),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),x=h&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==x||x<12.11)),O=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var k,T=function(t,e){var n=t.className,r=S(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 j(t,e){return P(t).appendChild(e)}function E(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 M(t,e,n,r){var i=E(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 A(){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 L(t,e){var n=t.className;S(e).test(n)||(t.className+=(n?" ":"")+e)}function N(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(e)&&(e+=" "+n[r]);return e}k=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 I=function(t){t.select()};function F(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function R(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 _(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?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var V=function(){this.id=null};function z(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}V.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var H=30,$={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},B={origin:"*mouse"},U={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&&R(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 lt(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 ct=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(l,c){var u="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var h,d=l.length,f=[],p=0;p<d;++p)f.push((h=l.charCodeAt(p))<=247?t.charAt(h):1424<=h&&h<=1524?"R":1536<=h&&h<=1785?e.charAt(h-1536):1774<=h&&h<=2220?"r":8192<=h&&h<=8203?"w":8204==h?"b":"L");for(var g=0,v=u;g<d;++g){var m=f[g];"m"==m?f[g]=v:v=m}for(var y=0,b=u;y<d;++y){var w=f[y];"1"==w&&"r"==b?f[y]="n":i.test(w)&&(b=w,"r"==w&&(f[y]="R"))}for(var x=1,C=f[0];x<d-1;++x){var O=f[x];"+"==O&&"1"==C&&"1"==f[x+1]?f[x]="1":","!=O||C!=f[x+1]||"1"!=C&&"n"!=C||(f[x]=C),C=O}for(var S=0;S<d;++S){var k=f[S];if(","==k)f[S]="N";else if("%"==k){var T=void 0;for(T=S+1;T<d&&"%"==f[T];++T);for(var P=S&&"!"==f[S-1]||T<d&&"1"==f[T]?"1":"N",j=S;j<T;++j)f[j]=P;S=T-1}}for(var E=0,M=u;E<d;++E){var D=f[E];"L"==M&&"1"==D?f[E]="L":i.test(D)&&(M=D)}for(var A=0;A<d;++A)if(r.test(f[A])){var L=void 0;for(L=A+1;L<d&&r.test(f[L]);++L);for(var N="L"==(A?f[A-1]:u),I=N==("L"==(L<d?f[L]:u))?N?"L":"R":u,F=A;F<L;++F)f[F]=I;A=L-1}for(var R,_=[],V=0;V<d;)if(o.test(f[V])){var z=V;for(++V;V<d&&o.test(f[V]);++V);_.push(new s(0,z,V))}else{var H=V,$=_.length;for(++V;V<d&&"L"!=f[V];++V);for(var W=H;W<V;)if(a.test(f[W])){H<W&&_.splice($,0,new s(1,H,W));var B=W;for(++W;W<V&&a.test(f[W]);++W);_.splice($,0,new s(2,B,W)),H=W}else++W;H<V&&_.splice($,0,new s(1,H,V))}return"ltr"==c&&(1==_[0].level&&(R=l.match(/^\s+/))&&(_[0].from=R[0].length,_.unshift(new s(0,0,R[0].length))),1==Y(_).level&&(R=l.match(/\s+$/))&&(Y(_).to-=R[0].length,_.push(new s(0,d-R[0].length,d)))),"rtl"==c?_.reverse():_}}();function ut(t,e){var n=t.order;return null==n&&(n=t.order=ct(t.text,e)),n}var ht=[],dt=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]||ht).concat(n)}};function ft(t,e){return t._handlers&&t._handlers[e]||ht}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=z(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function gt(t,e){var n=ft(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),Ct(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==z(n,e[r])&&n.push(e[r])}function yt(t,e){return ft(t,e).length>0}function bt(t){t.prototype.on=function(t,e){dt(this,t,e)},t.prototype.off=function(t,e){pt(this,t,e)}}function wt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function xt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ct(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Ot(t){wt(t),xt(t)}function St(t){return t.target||t.srcElement}function kt(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 Tt,Pt,jt=function(){if(a&&s<9)return!1;var t=E("div");return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==Tt){var e=E("span","");j(t,E("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Tt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Tt?E("span",""):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Mt(t){if(null!=Pt)return Pt;var e=j(t,document.createTextNode("AخA")),n=k(e,0,1).getBoundingClientRect(),r=k(e,1,2).getBoundingClientRect();return P(t),!(!n||n.left==n.right)&&(Pt=r.right-n.right<3)}var Dt,At=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/)},Lt=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)},Nt="oncopy"in(Dt=E("div"))||(Dt.setAttribute("oncopy","return;"),"function"==typeof Dt.oncopy),It=null,Ft={},Rt={};function _t(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ft[t]=e}function Vt(t){if("string"==typeof t&&Rt.hasOwnProperty(t))t=Rt[t];else if(t&&"string"==typeof t.name&&Rt.hasOwnProperty(t.name)){var e=Rt[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 zt(t,e){e=Vt(e);var n=Ft[e.name];if(!n)return zt(t,"text/plain");var r=n(t,e);if(Ht.hasOwnProperty(e.name)){var i=Ht[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 Ht={};function $t(t,e){R(e,Ht.hasOwnProperty(t)?Ht[t]:Ht[t]={})}function Wt(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 Bt(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 Ut(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=z(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 le(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 ce(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=le(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=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},qt.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(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},he=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 de(t,e,n,r){var i=[t.state.modeGen],o={};xe(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],l=1,c=0;n.state=!0,xe(t,e.text,s.mode,n,(function(t,e){for(var n=l;c<t;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function fe(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&&Wt(t.doc.mode,r.state),o=de(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 he(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 l=Gt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ue?c.lookAhead:0)<=o.modeFrontier))return s;var u=_(l.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?he.fromSaved(r,a,o):new he(r,Ut(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=Bt(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]=Bt(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.")}he.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},he.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}},he.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},he.fromSaved=function(t,e,n){return e instanceof ue?new he(t,Wt(t.mode,e.state),n,e.lookAhead):new he(t,Wt(t.mode,e),n)},he.prototype.save=function(t){var e=!1!==t?Wt(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,l=Gt(a,(e=le(a,e)).line),c=pe(t,e.line,n),u=new qt(l.text,t.options.tabSize,c);for(r&&(o=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,i=me(s,u,c.state),r&&o.push(new ye(u,i,Wt(a.mode,c.state)));return r?o:new ye(u,i,c.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 xe(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,h=new qt(e,t.options.tabSize,r),d=t.options.addModeClass&&[null];for(""==e&&we(ve(n,r.state),o);!h.eol();){if(h.pos>t.options.maxHighlightLength?(s=!1,a&&ge(t,e,r,h.pos),h.pos=e.length,l=null):l=we(me(n,h,r.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;c<h.start;)i(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var p=Math.min(h.pos,c+5e3);i(p,u),c=p}}var Ce=!1,Oe=!1;function Se(t,e,n){this.marker=t,this.from=e,this.to=n}function ke(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Te(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 Se(a,o.from,s?null:o.to))}}return r}(n,i,a),l=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 Se(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return r}(r,o,a),c=1==e.text.length,u=Y(e.text).length+(c?i:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var f=ke(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=i}}if(l)for(var p=0;p<l.length;++p){var g=l[p];null!=g.to&&(g.to+=u),null==g.from?ke(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=je(s)),l&&l!=s&&(l=je(l));var v=[s];if(!c){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 Se(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(l)}return v}function je(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 Ee(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Me(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 Ae(t){return t.inclusiveRight?1:0}function Le(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)||Ae(t)-Ae(e);return a||e.id-t.id}function Ne(t,e){var n,r=Oe&&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||Le(n,i.marker)<0)&&(n=i.marker);return n}function Ie(t){return Ne(t,!0)}function Fe(t){return Ne(t,!1)}function Re(t,e){var n,r=Oe&&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||Le(n,o.marker)<0)&&(n=o.marker)}return n}function _e(t,e,n,r,i){var o=Gt(t,e),a=Oe&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ne(c.from,n)||De(l.marker)-De(i),h=ne(c.to,r)||Ae(l.marker)-Ae(i);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ne(c.to,n)>=0:ne(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ne(c.from,r)<=0:ne(c.from,r)<0)))return!0}}}function Ve(t){for(var e;e=Ie(t);)t=e.find(-1,!0).line;return t}function ze(t,e){var n=Gt(t,e),r=Ve(n);return n==r?e:Jt(r)}function He(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!$e(t,r))return e;for(;n=Fe(r);)r=n.find(1,!0).line;return Jt(r)+1}function $e(t,e){var n=Oe&&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&&We(t,e,r))return!0}}function We(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return We(t,r.line,ke(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)&&We(t,e,i))return!0}function Be(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 Ue(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Ie(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=Fe(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=Ue(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=Ue(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ge=function(t,e,n){this.text=t,Me(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ee(t)}Ge.prototype.lineNo=function(){return Jt(this)},bt(Ge);var Ye={},Xe={};function Je(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){var n=M("span",null,null,l?"padding-right: .1px":null),r={pre:M("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,Mt(t.display.measure)&&(a=ut(o,t.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],rn(o,r,fe(t,o,e!=t.display.externalMeasured&&Jt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=N(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=N(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Et(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(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return gt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||"")),r}function Qe(t){var e=E("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,l){if(e){var c,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,h=t.cm.state.specialChars,d=!1;if(h.test(e)){c=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(e),g=p?p.index-f:e.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(E("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!p)break;f+=g+1;var m=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=c.appendChild(E("span",K(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=c.appendChild(E("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?c.appendChild(E("span",[m])):c.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||d||o){var w=n||"";r&&(w+=r),i&&(w+=i);var x=E("span",[c],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return t.content.appendChild(x)}t.content.appendChild(c)}}function en(t,e){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var h=void 0,d=0;d<e.length&&!((h=e[d]).to>c&&h.from<=c);d++);if(h.to>=u)return t(n,r,i,o,a,s,l);t(n,r.slice(0,h.to-c),i,o,null,s,l),o=null,r=r.slice(h.to-c),c=h.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,l,c,u,h,d,f=i.length,p=0,g=1,v="",m=0;;){if(m==p){l=c=u=s="",d=null,h=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var O in C.attributes)(d||(d={}))[O]=C.attributes[O];C.collapsed&&(!h||Le(h.marker,C)<0)&&(h=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(c+=" "+b[S]);if(!h||h.from==p)for(var k=0;k<y.length;++k)nn(e,0,y[k]);if(h&&(h.from||0)==p){if(nn(e,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var T=Math.min(f,m);;){if(v){var P=p+v.length;if(!h){var j=P>T?v.slice(0,T-p):v;e.addToken(e,j,a?a+l:l,u,p+j.length==m?c:"",s,d)}if(P>=T){v=v.slice(T-p),p=T;break}p=P,u=""}v=i.slice(o,o=n[g++]),a=Je(n[g++],e.cm.options)}}else for(var E=1;E<n.length;E+=2)e.addToken(e,i.slice(o,o=n[E]),Je(n[E+1],e.cm.options))}function on(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=Fe(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=$e(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,ln=null;function cn(t,e){var n=ft(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:ln?r=ln:(r=ln=[],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=ln;ln=null;for(var e=0;e<t.length;++e)t[e]()}function hn(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 dn(t){return t.node==t.text&&(t.node=E("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 fn(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=fn(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=dn(e);e.background=r.insertBefore(E("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?dn(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=dn(e);e.gutterBackground=E("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=dn(e),s=e.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(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(E("div",te(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(E("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function mn(t,e,n){e.alignable&&(e.alignable=null);for(var r=e.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&e.node.removeChild(r);bn(t,e,n)}function yn(t,e,n,r){var i=fn(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=dn(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=E("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(l,c,n,r),t.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),cn(l,"redraw")}}function xn(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 Cn(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;"),j(e.display.measure,E("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function On(t,e){for(var n=St(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 Sn(t){return t.lineSpace.offsetTop}function kn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Tn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=j(t.measure,E("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 H-t.display.nativeBarWidth}function jn(t){return t.display.scroller.clientWidth-Pn(t)-t.display.barWidth}function En(t){return t.display.scroller.clientHeight-Pn(t)-t.display.barHeight}function Mn(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 Nn(t,Ln(t,e),n,r)}function An(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[hr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Ln(t,e){var n=Jt(e),r=An(t,n);r&&!r.text?r=null:r&&r.changes&&(hn(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,j(t.display.lineMeasure,i.pre),r}(t,e));var i=Mn(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Nn(t,e,n,r,i){e.before&&(n=-1);var o,l=n+(r||"");return e.cache.hasOwnProperty(l)?o=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var r=t.options.lineWrapping,i=r&&jn(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 l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.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=Rn(e.map,n,r),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&it(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&it(e.line.text.charAt(o.coverStart+u));)++u;if((i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():_n(k(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,h="right"}a&&s<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=It)return It;var e=j(t,E("span","x")),n=e.getBoundingClientRect(),r=k(e,0,1).getBoundingClientRect();return It=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 f;c>0&&(h=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+or(t.display),top:p.top,bottom:p.bottom}:Fn}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,x=y[b],C={left:("right"==h?i.right:i.left)-e.rect.left,right:("left"==h?i.left:i.right)-e.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v),C}(t,e,n,r)).bogus||(e.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var In,Fn={left:0,right:0,top:0,bottom:0};function Rn(t,e,n){for(var r,i,o,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(i=0,o=1,a="left"):e<l?o=1+(i=e-s):(c==t.length-3||e==l&&t[c+3]>e)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)r=t[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function _n(t,e){var n=Fn;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 zn(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 Hn(t){zn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function $n(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wn(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bn(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=Cn(t.widgets[n]));return e}function Un(t,e,n,r,i){if(!i){var o=Bn(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Be(e);if("local"==r?a+=Sn(t.display):a-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Wn());var l=s.left+("window"==r?0:$n());n.left+=l,n.right+=l}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-=$n(),i-=Wn();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)),Un(t,r,Dn(t,r,e.ch,i),n)}function Kn(t,e,n,r,i,o){function a(e,a){var s=Nn(t,i,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Un(t,r,s,n)}r=r||Gt(t.doc,e.line),i||(i=Ln(t,r));var s=ut(r,t.doc.direction),l=e.ch,c=e.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var h=lt(s,l,c),d=st,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Yn(t,e){var n=0;e=le(t.doc,e),t.options.lineWrapping||(n=or(t.display)*e.ch);var r=Gt(t.doc,e.line),i=Be(r)+Sn(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),l=Re(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Gt(r,i=c.line)}}function Zn(t,e,n,r){r-=Bn(e);var i=e.text.length,o=at((function(e){return Nn(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=at((function(e){return Nn(t,n,e).top>r}),o,i)}}function Qn(t,e,n,r){return n||(n=Ln(t,e)),Zn(t,e,n,Un(t,e,Nn(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-=Be(e);var o=Ln(t,e),a=Bn(e),s=0,l=e.text.length,c=!0,u=ut(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?rr:nr)(t,e,n,o,u,r,i);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,f,p=null,g=null,v=at((function(e){var n=Nn(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,l),m=!1;if(g){var y=r-g.left<g.right-r,b=y==c;v=p+(b?0:1),f=b?"after":"before",d=y?g.left:g.right}else{c||v!=l&&v!=s||v++,f=0==v?"after":v==e.text.length?"before":Nn(t,o,v-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Kn(t,ee(n,v,f),"line",e,o);d=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return Xn(n,v=ot(e.text,v,1),f,m,r-d)}function nr(t,e,n,r,i,o,a){var s=at((function(s){var l=i[s],c=1!=l.level;return tr(Kn(t,ee(n,c?l.to:l.from,c?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Kn(t,ee(n,c?l.from:l.to,c?"after":"before"),"line",e,r);tr(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function rr(t,e,n,r,i,o,a){var s=Zn(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<i.length;d++){var f=i[d];if(!(f.from>=c||f.to<=l)){var p=Nn(t,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=p<o?o-p+1e9:p-o;(!u||h>g)&&(u=f,h=g)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ir(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==In){In=E("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)In.appendChild(document.createTextNode("x")),In.appendChild(E("br"));In.appendChild(document.createTextNode("x"))}j(t.measure,In);var n=In.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=E("span","xxxxxxxxxx"),n=E("pre",[e],"CodeMirror-line-like");j(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 lr(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($e(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 cr(t){var e=t.doc,n=lr(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"==St(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(e){return null}var l,c=Jn(t,o,a);if(r&&1==c.xRel&&(l=Gt(t.doc,c.line).text).length==c.ch){var u=_(l,l.length,t.options.tabSize)-l.length;c=ee(c.line,Math.max(0,Math.round((o-Tn(t.display).left)/or(t.display))-u))}return c}function hr(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 dr(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)Oe&&ze(t.doc,e)<i.viewTo&&pr(t);else if(n<=i.viewFrom)Oe&&He(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),l=gr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(an(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):pr(t)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(i.externalMeasured=null))}function fr(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[hr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==z(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=hr(t,e),a=t.display.view;if(!Oe||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l<o;l++)s+=a[l].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(;ze(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 l=s.empty();(l||t.options.showCursorWhenSelecting)&&br(t,s.head,i),l||xr(t,s,o)}}return r}function br(t,e,n){var r=Kn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(E("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",r.other){var o=n.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(t,e){return t.top-e.top||t.left-e.left}function xr(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=Tn(t.display),s=a.left,l=Math.max(r.sizerWidth,jn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function h(e,n,r){var o,a,h=Gt(i,e),d=h.text.length;function f(n,r){return Gn(t,ee(e,n),"div",h,r)}function p(e,n,r){var i=Qn(t,h,null,e),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=ut(h,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?d:r,(function(t,e,i,h){var v="ltr"==i,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==d,x=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var O=(c?w:b)&&C,S=(c?b:w)&&x?s:(v?m:y).left,k=O?l:(v?y:m).right;u(S,m.top,k-S,m.bottom)}else{var T,P,j,E;v?(T=c&&b&&x?s:m.left,P=c?l:p(t,i,"before"),j=c?s:p(e,i,"after"),E=c&&w&&C?l:y.right):(T=c?p(t,i,"before"):s,P=!c&&b&&x?l:m.right,j=!c&&w&&C?s:y.left,E=c?p(e,i,"after"):l),u(T,m.top,P-T,m.bottom),m.bottom<y.top&&u(s,m.bottom,null,y.top),u(j,y.top,E-j,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 d=e.from(),f=e.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Gt(i,d.line),g=Gt(i,f.line),v=Ve(p)==Ve(g),m=h(d.line,d.ch,v?p.text.length+1:null).end,y=h(f.line,v?0:null,f.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 Cr(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(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Or(t){t.state.focused||(t.display.input.focus(),kr(t))}function Sr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Tr(t))}),100)}function kr(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(gt(t,"focus",t,e),t.state.focused=!0,L(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Cr(t))}function Tr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(gt(t,"blur",t,e),t.state.focused=!1,T(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=0;r<e.view.length;r++){var i=e.view[r],o=t.options.lineWrapping,l=void 0,c=0;if(!i.hidden){if(a&&s<8){var u=i.node.offsetTop+i.node.offsetHeight;l=u-n,n=u}else{var h=i.node.getBoundingClientRect();l=h.bottom-h.top,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=i.line.height-l;if((d>.005||d<-.005)&&(Xt(i.line,l),jr(i.line),i.rest))for(var f=0;f<i.rest.length;f++)jr(i.rest[f]);if(c>t.display.sizerWidth){var p=Math.ceil(c/or(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function jr(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 Er(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Sn(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,l=n.ensure.to.line;s<o?(o=s,a=Zt(e,Be(Gt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(o=Zt(e,Be(Gt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Mr(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=En(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+kn(n),l=e.top<r,c=e.bottom>s-r;if(e.top<i)a.scrollTop=l?0:e.top;else if(e.bottom>i+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,d=jn(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>d;return f&&(e.right=e.left+d),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left-(f?0:10)):e.right>d+h-3&&(a.scrollLeft=e.right+(f?0:10)-d),a}function Dr(t,e){null!=e&&(Nr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Ar(t){Nr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Lr(t,e,n){null==e&&null==n||Nr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Nr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Ir(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Ir(t,e,n,r){var i=Mr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Lr(t,i.scrollLeft,i.scrollTop)}function Fr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Rr(t,e,!0),n&&li(t),ri(t,100))}function Rr(t,e,n){e=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 _r(t,e,n,r){e=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+kn(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 zr=function(t,e,n){this.cm=n;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),dt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),dt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.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}},zr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var t=y&&!f?"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},zr.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)}))},zr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Hr=function(){};function $r(t,e){e||(e=Vr(t));var n=t.display.barWidth,r=t.display.barHeight;Wr(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),Wr(t,Vr(t)),n=t.display.barWidth,r=t.display.barHeight}function Wr(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=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Br={native:zr,null:Hr};function Ur(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Br[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),dt(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?_r(t,e):Fr(t,e)}),t),t.display.scrollbars.addClass&&L(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},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++)(i=e[r]).updatedDisplay=i.mustUpdate&&ai(i.cm,i.update);for(var i,o=0;o<e.length;o++)Xr(e[o]);for(var a=0;a<e.length;a++)Jr(e[a]);for(var s=0;s<e.length;s++)Zr(e[s])}(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 oi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(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-jn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Jr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&_r(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==A();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&$r(e,t.barMeasure),t.updatedDisplay&&ui(e,t.barMeasure),t.selectionChanged&&Cr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Or(t.cm)}function Zr(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&si(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Rr(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&_r(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=E("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Sn(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=e.ch?ee(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?ee(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=Kn(t,e),l=n&&n!=e?Kn(t,n):s,c=Mr(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(Fr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(_r(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}(e,le(r,t.scrollToPos.from),le(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&>(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&>(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Qr(t,e){if(t.curOp)return e();Gr(t);try{return e()}finally{Kr(t)}}function ti(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Gr(t);try{return e.apply(t,arguments)}finally{Kr(t)}}}function ei(t){return function(){if(this.curOp)return t.apply(this,arguments);Gr(this);try{return t.apply(this,arguments)}finally{Kr(this)}}}function ni(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 ri(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,F(ii,t))}function ii(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?Wt(e.mode,r.state):null,l=de(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&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 ri(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Qr(t,(function(){for(var e=0;e<i.length;e++)fr(t,i[e],"text")}))}}var oi=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Er(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=jn(t),this.force=n,this.dims=ar(t),this.events=[]};function ai(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)),Oe&&(o=ze(t.doc,o),a=He(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(hr(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,hr(t,n)))),r.viewTo=n}(t,o,a),n.viewOffset=Be(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=vr(t);if(!s&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=A();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 c>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 l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=s(a);var f=i&&null!=e&&e<=u&&d.lineNumber;d.changes&&(z(d.changes,"gutter")>-1&&(f=!1),hn(t,d,u,n)),f&&(P(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(te(t.options,u)))),a=d.node.nextSibling}else{var p=yn(t,d,u,n);o.insertBefore(p,a)}u+=d.size}for(;a;)a=s(a)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=A()&&(t.activeElt.focus(),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,ri(t,400)),n.updateLineNumbers=null,!0}function si(t,e){for(var n=e.viewport,r=!0;(r&&t.options.lineWrapping&&e.oldDisplayWidth!=jn(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+kn(t.display)-En(t),n.top)}),e.visible=Er(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&ai(t,e);r=!1){Pr(t);var i=Vr(t);mr(t),$r(t,i),ui(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 oi(t,e);if(ai(t,n)){Pr(t),si(t,n);var r=Vr(t);mr(t),$r(t,r),ui(t,r),n.finish()}}function ci(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ui(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 l=0;l<s.length;l++)s[l].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(E("div",[E("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",ci(t.display),!0}return!1}function fi(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 pi(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(E("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",ci(t)}function gi(t){pi(t.display),dr(t),hi(t)}function vi(t,e,r,i){var o=this;this.input=r,o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=M("div",null,"CodeMirror-code"),o.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=E("div",null,"CodeMirror-cursors"),o.measure=E("div",null,"CodeMirror-measure"),o.lineMeasure=E("div",null,"CodeMirror-measure"),o.lineSpace=M("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=M("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[c],null,"position: relative"),o.sizer=E("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=E("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),o.gutters=E("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||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=fi(i.gutters,i.lineNumbers),pi(o),r.init(o)}oi.prototype.signal=function(t,e){yt(t,e)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var t=0;t<this.events.length;t++)gt.apply(null,this.events[t])};var mi=0,yi=null;function bi(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 wi(t){var e=bi(t);return e.x*=yi,e.y*=yi,e}function xi(t,e){var r=bi(e),i=r.x,o=r.y,a=t.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)t:for(var d=e.target,f=a.view;d!=s;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){t.display.currentWheelTarget=d;break t}if(i&&!n&&!h&&null!=yi)return o&&u&&Fr(t,Math.max(0,s.scrollTop+o*yi)),_r(t,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&u)&&wt(e),void(a.wheelStartX=null);if(o&&null!=yi){var g=o*yi,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})}mi<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&&(yi=(yi*mi+n)/(mi+1),++mi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:n?yi=15:u?yi=-.7:d&&(yi=-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 Oi(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 Oi=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=z(e,i);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=ne(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=ae(s.from(),a.from()),u=oe(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new Oi(h?u:c,h?c:u))}}return new Ci(e,n)}function ki(t,e){return new Ci([new Oi(t,e||t)],0)}function Ti(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 Pi(t,e){if(ne(t,e.from)<0)return t;if(ne(t,e.to)<=0)return Ti(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+=Ti(e).ch-e.to.ch),ee(n,r)}function ji(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new Oi(Pi(i.anchor,e),Pi(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 Mi(t){t.doc.mode=zt(t.options,t.doc.modeOption),Di(t)}function Di(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,ri(t,100),t.state.modeGen++,t.curOp&&dr(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),Ee(t),Me(t,n);var i=r?r(t):1;i!=t.height&&Xt(t,i)}(t,n,i,r),cn(t,"change",t,e)}function a(t,e){for(var n=[],o=t;o<e;++o)n.push(new Ge(c[o],i(o),r));return n}var s=e.from,l=e.to,c=e.text,u=Gt(t,s.line),h=Gt(t,l.line),d=Y(c),f=i(c.length-1),p=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(Ai(t,e)){var g=a(0,c.length-1);o(h,h.text,f),p&&t.remove(s.line,p),g.length&&t.insert(s.line,g)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),f);else{var v=a(1,c.length-1);v.push(new Ge(d+u.text.slice(l.ch),f,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),t.insert(s.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),i(0)),t.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(h,d+h.text.slice(l.ch),f);var m=a(1,c.length-1);p>1&&t.remove(s.line+1,p-1),t.insert(s.line+1,m)}cn(t,"change",t,e)}function Ni(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 l=o&&s.sharedHist;n&&!l||(e(s.doc,l),t(s.doc,r,l))}}}(t,null,!0)}function Ii(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,cr(t),Mi(t),Fi(t),t.options.lineWrapping||qe(t),t.options.mode=e.modeOption,dr(t)}function Fi(t){("rtl"==t.doc.direction?L:T)(t.display.lineDiv,"CodeMirror-rtl")}function Ri(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function _i(t,e){var n={from:ie(e.from),to:Ti(e),text:Kt(t,e.from,e.to)};return Wi(t,n,e.from.line,e.to.line+1),Ni(t,(function(t){return Wi(t,n,e.from.line,e.to.line+1)}),!0),n}function Vi(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?(Vi(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=Ti(e):o.changes.push(_i(t,e));else{var l=Y(i.done);for(l&&l.ranges||$i(t.sel,i.done),o={changes:[_i(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:$i(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Vi(i.undone)}function $i(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 Bi(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 Ui(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(Bi(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 l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function qi(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 l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&z(e,Number(u[1]))>-1&&(Y(s)[h]=c[h],delete c[h])}}}return r}function Gi(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 Oi(i,e)}return new Oi(n||e,e)}function Ki(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ci([Gi(t.sel.primary(),e,n,i)],0),r)}function Yi(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]=Gi(t.sel.ranges[o],e[o],null,i);Qi(t,Si(t.cm,r,t.sel.primIndex),n)}function Xi(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,Qi(t,Si(t.cm,i,t.sel.primIndex),r)}function Ji(t,e,n,r){Qi(t,ki(e,n),r)}function Zi(t,e,n){var r=t.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=e,to(t,e,n)):Qi(t,e,n)}function Qi(t,e,n){to(t,e,n),Hi(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function to(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 Oi(le(t,e[n].anchor),le(t,e[n].head))},origin:n&&n.origin};return gt(t,"beforeSelectionChange",t,r),t.cm&>(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);eo(t,ro(t,e,r,!0)),n&&!1===n.scroll||!t.cm||Ar(t.cm)}function eo(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,mt(t.cm)),cn(t,"cursorActivity",t))}function no(t){eo(t,ro(t,t.sel,null,!1))}function ro(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],l=oo(t,a.anchor,s&&s.anchor,n,r),c=oo(t,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new Oi(l,c))}return i?Si(t.cm,i,e.primIndex):e}function io(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],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(i&&(gt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(h=ao(t,h,-r,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(d=ne(h,n))&&(r<0?d<0:d>0))return io(t,h,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=ao(t,f,r,f.line==e.line?o:null)),f?io(t,f,e,r,i):null}}return e}function oo(t,e,n,r,i){var o=r||1,a=io(t,e,n,o,i)||!i&&io(t,e,n,o,!0)||io(t,e,n,-o,i)||!i&&io(t,e,n,-o,!0);return a||(t.cantEdit=!0,ee(t.first,0))}function ao(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?le(t,ee(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line<t.first+t.size-1?ee(e.line+1,0):null:new ee(e.line,e.ch+n)}function so(t){t.setSelection(ee(t.firstLine(),0),ee(t.lastLine()),W)}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=le(t,e)),n&&(r.to=le(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),gt(t,"beforeChange",t,r),t.cm&>(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 co(t,e,n){if(t.cm){if(!t.cm.curOp)return ti(t.cm,co)(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=Ce&&!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!=z(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),l=0;l<i.length;++l){var c=i[l];if(!(ne(c.to,s.from)<0||ne(c.from,s.to)>0)){var u=[l,1],h=ne(c.from,s.from),d=ne(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)uo(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else uo(t,e)}}function uo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ne(e.from,e.to)){var n=ji(t,e);zi(t,e,n,t.cm?t.cm.curOp.id:NaN),po(t,e,n,Pe(t,e));var r=[];Ni(t,(function(t,n){n||-1!=z(r,t.history)||(yo(t.history,e),r.push(t.history)),po(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,l="undo"==e?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(t.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if($i(i,l),n&&!i.equals(t.sel))return void Qi(t,i,{clearRedo:!1});a=i}var u=[];$i(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=yt(t,"beforeChange")||t.cm&&yt(t.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=e,h&&!lo(t,r,!1))return s.length=0,{};u.push(_i(t,r));var o=n?ji(t,r):Y(s);po(t,r,o,Ui(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Ti(r)});var a=[];Ni(t,(function(t,e){e||-1!=z(a,t.history)||(yo(t.history,r),a.push(t.history)),po(t,r,null,Ui(t,r))}))},f=i.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function fo(t,e){if(0!=e&&(t.first+=e,t.sel=new Ci(X(t.sel.ranges,(function(t){return new Oi(ee(t.anchor.line+e,t.anchor.ch),ee(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){dr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)fr(t.cm,r,"gutter")}}function po(t,e,n,r){if(t.cm&&!t.cm.curOp)return ti(t.cm,po)(t,e,n,r);if(e.to.line<t.first)fo(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);fo(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=ji(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=Jt(Ve(Gt(r,o.line))),r.iter(l,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,lr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=Ue(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),ri(t,400);var c=e.text.length-(a.line-o.line)-1;e.full?dr(t):o.line!=a.line||1!=e.text.length||Ai(t.doc,e)?dr(t,o.line,a.line+1,c):fr(t,o.line,"text");var u=yt(t,"changes"),h=yt(t,"change");if(h||u){var d={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};h&&cn(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}(t.cm,e,r):Li(t,e,r),to(t,n,W),t.cantEdit&&oo(t,ee(t.firstLine(),0))&&(t.cantEdit=!1)}}function go(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)),co(t,{from:n,to:r,text:e,origin:i})}function vo(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function mo(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++)vo(o.ranges[s].anchor,e,n,r),vo(o.ranges[s].head,e,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ee(c.from.line+r,c.from.ch),c.to=ee(c.to.line+r,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,i+1),i=0)}}}function yo(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;mo(t.done,n,r,i),mo(t.undone,n,r,i)}function bo(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&&fr(t.cm,i,n),o)}function wo(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}Oi.prototype.from=function(){return ae(this.anchor,this.head)},Oi.prototype.to=function(){return oe(this.anchor,this.head)},Oi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.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),cn(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 wo))){var s=[];this.collapse(s),this.children=[new wo(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 l=new wo(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.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=z(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 Oo(t,e,n){Be(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=Cn(this);Xt(n,Math.max(0,n.height-o)),t&&(Qr(t,(function(){Oo(t,n,-o),fr(t,r,"widget")})),cn(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=Cn(this)-e;i&&($e(this.doc,r)||Xt(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,Oo(n,r,i),cn(n,"lineWidgetChanged",n,t,Jt(r))})))},bt(Co);var So=0,ko=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++So};function To(t,e,n,r,i){if(r&&r.shared)return function(t,e,n,r,i){(r=R(r)).shared=!1;var o=[To(t,e,n,r,i)],a=o[0],s=r.widgetNode;return Ni(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),o.push(To(t,le(t,e),le(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=Y(o)})),new Po(o,a)}(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return ti(t.cm,To)(t,e,n,r,i);var o=new ko(t,i),a=ne(e,n);if(r&&R(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=M("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(_e(t,e.line,e,n,o)||e.line!=n.line&&_e(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oe=!0}o.addToHistory&&zi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(t){c&&o.collapsed&&!c.options.lineWrapping&&Ve(t)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Se(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){$e(t,e)&&Xt(e,0)})),o.clearOnEnter&&dt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ce=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)dr(c,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++)fr(c,u,"text");o.atomic&&no(c.doc),cn(c,"markerAdded",c,o)}return o}ko.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&&cn(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=ke(a.markedSpans,this);t&&!this.collapsed?fr(t,Jt(a),"text"):t&&(null!=s.to&&(i=Jt(a)),null!=s.from&&(r=Jt(a))),a.markedSpans=Te(a.markedSpans,s),null==s.from&&this.collapsed&&!$e(this.doc,a)&&t&&Xt(a,ir(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Ve(this.lines[l]),u=Ue(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&dr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&no(t.doc)),t&&cn(t,"markerCleared",t,this,r,i),e&&Kr(t),this.parent&&this.parent.clear()}},ko.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=ke(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}},ko.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Qr(r,(function(){var i=e.line,o=Jt(e.line),a=An(r,o);if(a&&(Vn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!$e(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Cn(n)-s;l&&Xt(i,i.height+l)}cn(r,"markerChanged",r,t)}))},ko.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=z(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},ko.prototype.detachLine=function(t){if(this.lines.splice(z(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},bt(ko);var Po=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function jo(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];Ni(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==z(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}Po.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();cn(this,"clear")}},Po.prototype.find=function(t,e){return this.primary.find(t,e)},bt(Po);var Mo=0,Do=function(t,e,n,r,i){if(!(this instanceof Do))return new Do(t,e,n,r,i);null==n&&(n=0),xo.call(this,[new wo([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=ki(o),this.history=new Ri(null),this.id=++Mo,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}),Qi(this,ki(o),W)};Do.prototype=Z(xo.prototype,{constructor:Do,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:ni((function(t){var e=ee(this.first,0),n=this.first+this.size-1;co(this,{from:e,to:ee(n,Gt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Lr(this.cm,0,0),Qi(this,ki(e),W)})),replaceRange:function(t,e,n,r){go(this,t,e=le(this,e),n=n?le(this,n):e,r)},getRange:function(t,e,n){var r=Kt(this,le(this,t),le(this,e));return!1===n?r: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 le(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:ni((function(t,e,n){Ji(this,le(this,"number"==typeof t?ee(t,e||0):t),null,n)})),setSelection:ni((function(t,e,n){Ji(this,le(this,t),le(this,e||t),n)})),extendSelection:ni((function(t,e,n){Ki(this,le(this,t),e&&le(this,e),n)})),extendSelections:ni((function(t,e){Yi(this,ce(this,t),e)})),extendSelectionsBy:ni((function(t,e){Yi(this,ce(this,X(this.sel.ranges,t)),e)})),setSelections:ni((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new Oi(le(this,t[i].anchor),le(this,t[i].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Qi(this,Si(this.cm,r,e),n)}})),addSelection:ni((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new Oi(le(this,t),le(this,e||t))),Qi(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:ni((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],l=Ei(s.from,i,o),c=Ei(Ti(s),i,o);if(i=s.to,o=c,"around"==n){var u=t.sel.ranges[a],h=ne(u.head,u.anchor)<0;r[a]=new Oi(h?c:l,h?l:c)}else r[a]=new Oi(l,l)}return new Ci(r,t.sel.primIndex)}(this,r,e),l=r.length-1;l>=0;l--)co(this,r[l]);s?Zi(this,s):this.cm&&Ar(this.cm)})),undo:ni((function(){ho(this,"undo")})),redo:ni((function(){ho(this,"redo")})),undoSelection:ni((function(){ho(this,"undo",!0)})),redoSelection:ni((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(){this.history=new Ri(this.history.maxGeneration)},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:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(t){var e=this.history=new Ri(this.history.maxGeneration);e.done=qi(t.done.slice(0),null,!0),e.undone=qi(t.undone.slice(0),null,!0)},setGutterMarker:ni((function(t,e,n){return bo(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&nt(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:ni((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&bo(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:ni((function(t,e,n){return bo(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(S(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:ni((function(t,e,n){return bo(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(S(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:ni((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),bo(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!$e(t,e)){var r=Be(e)<t.scrollTop;Xt(e,e.height+Cn(i)),r&&Dr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&cn(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 To(this,le(this,t),le(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 To(this,t=le(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Gt(this,(t=le(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=le(this,t),e=le(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 l=a[s];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.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})),le(this,ee(n,e))},indexFromPos:function(t){var e=(t=le(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 Do(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 Do(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=To(t,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,jo(this)),r},unlinkDoc:function(t){if(t instanceof Pa&&(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(jo(this));break}if(t.history==this.history){var n=[t.id];Ni(t,(function(t){return n.push(t.id)}),!0),t.history=new Ri(null),t.history.done=qi(this.history.done,n),t.history.undone=qi(this.history.undone,n)}},iterLinkedDocs:function(t){Ni(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):At(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Qr(e=this.cm,(function(){Fi(e),dr(e)})))}))}),Do.prototype.eachLine=Do.prototype.iter;var Ao=0;function Lo(t){var e=this;if(No(e),!vt(e,t)&&!On(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,l=function(t,r){if(!e.options.allowDropFileTypes||-1!=z(e.options.allowDropFileTypes,t.type)){var a=new FileReader;a.onload=ti(e,(function(){var t=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),o[r]=t,++s==i){var l={from:n=le(e.doc,n),to:n,text:e.doc.splitLines(o.join(e.doc.lineSeparator())),origin:"paste"};co(e.doc,l),Zi(e.doc,ki(n,Ti(l)))}})),a.readAsText(t)}},c=0;c<i;++c)l(r[c],c);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 u=t.dataTransfer.getData("Text");if(u){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),to(e.doc,ki(n,n)),h)for(var d=0;d<h.length;++d)go(e.doc,"",h[d].anchor,h[d].head,"drag");e.replaceSelection(u,"around","paste"),e.display.input.focus()}}catch(t){}}}}function No(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Io(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 Fo=!1;function Ro(){var t;Fo||(dt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Io(_o)}),100))})),dt(window,"blur",(function(){return Io(Tr)})),Fo=!0)}function _o(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Vo={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:"'",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++)Vo[zo+48]=Vo[zo+96]=String(zo);for(var Ho=65;Ho<=90;Ho++)Vo[Ho]=String.fromCharCode(Ho);for(var $o=1;$o<=12;$o++)Vo[$o+111]=Vo[$o+63235]="F"+$o;var Wo={};function Bo(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 Uo(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(" "),Bo),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 l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var c in e)t[c]=e[c];return t}function qo(t,e,n,r){var i=(e=Xo(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 qo(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=qo(t,e.fallthrough[o],n,r);if(a)return a}}}function Go(t){var e="string"==typeof t?t:Vo[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Ko(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(C?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(C?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Yo(t,e){if(h&&34==t.keyCode&&t.char)return!1;var n=Vo[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Ko(n,t,e))}function Xo(t){return"string"==typeof t?Wo[t]:t}function Jo(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)}Qr(t,(function(){for(var e=r.length-1;e>=0;e--)go(t.doc,"",r[e].from,r[e].to,"+delete");Ar(t)}))}function Zo(t,e,n){var r=ot(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Qo(t,e,n){var r=Zo(t,e.ch,n);return null==r?null:new ee(e.line,r,n<0?"after":"before")}function ta(t,e,n,r,i){if(t){var o=ut(n,e.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=Ln(e,n);a=i<0?n.text.length-1:0;var u=Nn(e,c,a).top;a=at((function(t){return Nn(e,c,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Zo(n,a,1))}else a=i<0?s.to:s.from;return new ee(r,a,l)}}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","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","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 ea={selectAll:so,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),W)},killLine:function(t){return Jo(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 Jo(t,(function(e){return{from:ee(e.from().line,0),to:le(t.doc,ee(e.to().line+1,0))}}))},delLineLeft:function(t){return Jo(t,(function(t){return{from:ee(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Jo(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 Jo(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 na(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ra(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=Fe(t);)t=e.find(1,!0).line;return t}(n);return r!=n&&(e=Jt(r)),ta(!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")}),U)},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")}),U)},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/)?ra(t,e.head):r}),U)},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,"char")},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=_(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 Qr(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 Oi(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Qr(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);Ar(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function na(t,e){var n=Gt(t.doc,e),r=Ve(n);return r!=n&&(e=Jt(r)),ta(!0,t,r,e,1)}function ra(t,e){var n=na(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(0,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 ia(t,e,n){if("string"==typeof e&&!(e=ea[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)!=$}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}var oa=new V;function aa(t,e,n,r){var i=t.state.keySeq;if(i){if(Go(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:oa.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),sa(t,i+" "+e,n,r))return!0}return sa(t,e,n,r)}function sa(t,e,n,r){var i=function(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=qo(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&qo(e,t.options.extraKeys,n,t)||qo(e,t.options.keyMap,n,t)}(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&cn(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(wt(n),Cr(t)),!!i}function la(t,e){var n=Yo(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?aa(t,"Shift-"+n,e,(function(e){return ia(t,e,!0)}))||aa(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return ia(t,e)})):aa(t,n,e,(function(e){return ia(t,e)})))}var ca=null;function ua(t){var e=this;if(e.curOp.focus=A(),!vt(e,t)){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=la(e,t);h&&(ca=r?n:null,!r&&88==n&&!Nt&&(y?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(T(e,"CodeMirror-crosshair"),pt(document,"keyup",n),pt(document,"mouseover",n))}L(e,"CodeMirror-crosshair"),dt(document,"keyup",n),dt(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(!(On(e.display,t)||vt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(h&&n==ca)return ca=null,void wt(t);if(!h||t.which&&!(t.which<10)||!la(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(t,e,n){return aa(t,"'"+n+"'",e,(function(e){return ia(t,e,!0)}))}(e,t,i)||e.display.input.onKeyPress(t))}}}var fa,pa,ga=function(t,e,n){this.time=t,this.pos=e,this.button=n};function va(t){var e=this,n=e.display;if(!(vt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,On(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(e,t)){var r=ur(e,t),i=kt(t),o=r?function(t,e){var n=+new Date;return pa&&pa.compare(n,t,e)?(fa=pa=null,"triple"):fa&&fa.compare(n,t,e)?(pa=new ga(n,t,e),fa=null,"double"):(fa=new ga(n,t,e),pa=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),aa(t,Ko(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,(function(e){if("string"==typeof e&&(e=ea[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=$}finally{t.state.suppressEdits=!1}return r}))}(e,i,r,o,t)||(1==i?r?function(t,e,n,r){a?setTimeout(F(Or,t),0):t.curOp.focus=A();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),c=t.doc.sel;t.options.dragDrop&&jt&&!t.isReadOnly()&&"single"==n&&(i=c.contains(e))>-1&&(ne((i=c.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,c=ti(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,pt(i.wrapper.ownerDocument,"mouseup",c),pt(i.wrapper.ownerDocument,"mousemove",u),pt(i.scroller,"dragstart",h),pt(i.scroller,"drop",c),o||(wt(e),r.addNew||Ki(t.doc,n,null,null,r.extend),l||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),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},h=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),dt(i.wrapper.ownerDocument,"mouseup",c),dt(i.wrapper.ownerDocument,"mousemove",u),dt(i.scroller,"dragstart",h),dt(i.scroller,"drop",c),Sr(t),setTimeout((function(){return i.input.focus()}),20)}(t,r,e,o):function(t,e,n,r){var i=t.display,o=t.doc;wt(e);var a,s,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new Oi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Oi(n,n)),n=ur(t,e,!0,!0),s=-1;else{var u=ma(t,n,r.unit);a=r.extend?Gi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Qi(o,Si(t,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Qi(o,Si(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xi(o,s,a,B):(s=0,Qi(o,new Ci([a],0),B),l=o.sel);var h=n;function d(e){if(0!=ne(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],c=t.options.tabSize,u=_(Gt(o,n.line).text,n.ch,c),d=_(Gt(o,e.line).text,e.ch,c),f=Math.min(u,d),p=Math.max(u,d),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,f,c);f==p?i.push(new Oi(ee(g,y),ee(g,y))):m.length>y&&i.push(new Oi(ee(g,y),ee(g,q(m,p,c))))}i.length||i.push(new Oi(n,n)),Qi(o,Si(t,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=a,x=ma(t,e,r.unit),C=w.anchor;ne(x.anchor,C)>0?(b=x.head,C=ae(w.from(),x.anchor)):(b=x.anchor,C=oe(w.to(),x.head));var O=l.ranges.slice(0);O[s]=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=lt(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=lt(o,r.ch,r.sticky),h=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new Oi(new ee(n.line,p,g),r)}(t,new Oi(le(o,C),b)),Qi(o,Si(t,O,s),B)}}var f=i.wrapper.getBoundingClientRect(),p=0;function g(e){t.state.selectingText=!1,p=1/0,e&&(wt(e),i.input.focus()),pt(i.wrapper.ownerDocument,"mousemove",v),pt(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ti(t,(function(e){0!==e.buttons&&kt(e)?function e(n){var a=++p,s=ur(t,n,!0,"rectangle"==r.unit);if(s)if(0!=ne(s,h)){t.curOp.focus=A(),d(s);var l=Er(i,o);(s.line>=l.to||s.line<l.from)&&setTimeout(ti(t,(function(){p==a&&e(n)})),150)}else{var c=n.clientY<f.top?-20:n.clientY>f.bottom?20:0;c&&setTimeout(ti(t,(function(){p==a&&(i.scroller.scrollTop+=c,e(n))})),50)}}(e):g(e)})),m=ti(t,g);t.state.selectingText=m,dt(i.wrapper.ownerDocument,"mousemove",v),dt(i.wrapper.ownerDocument,"mouseup",m)}(t,r,e,o)}(e,r,o,t):St(t)==n.scroller&&wt(t):2==i?(r&&Ki(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(O?e.display.input.onContextMenu(t):Sr(e)))}}function ma(t,e,n){if("char"==n)return new Oi(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Oi(ee(e.line,0),le(t.doc,ee(e.line+1,0)));var r=n(t,e);return new Oi(r.from,r.to)}function ya(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(e){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 Ct(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return gt(t,n,t,Zt(t.doc,o),t.display.gutterSpecs[l].className,e),Ct(e)}}function ba(t,e){return ya(t,e,"gutterClick",!0)}function wa(t,e){On(t.display,e)||function(t,e){return!!yt(t,"gutterContextMenu")&&ya(t,e,"gutterContextMenu",!1)}(t,e)||vt(t,e,"contextmenu")||O||t.display.input.onContextMenu(e)}function xa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(t)}ga.prototype.compare=function(t,e,n){return this.time+400>t&&0==ne(e,this.pos)&&n==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},Oa={},Sa={};function ka(t,e,n){if(!e!=!(n&&n!=Ca)){var r=t.display.dragFunctions,i=e?dt: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 Ta(t){t.options.lineWrapping?(L(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),qe(t)),cr(t),dr(t),Hn(t),setTimeout((function(){return $r(t)}),100)}function Pa(t,e){var n=this;if(!(this instanceof Pa))return new Pa(t,e);this.options=e=e?R(e):{},R(Oa,e,!1);var r=e.value;"string"==typeof r?r=new Do(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Pa.inputStyles[e.inputStyle](this),o=this.display=new vi(t,r,i,e);for(var c in o.wrapper.CodeMirror=this,xa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ur(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;dt(e.scroller,"mousedown",ti(t,va)),dt(e.scroller,"dblclick",a&&s<11?ti(t,(function(e){if(!vt(t,e)){var n=ur(t,e);if(n&&!ba(t,e)&&!On(t.display,e)){wt(e);var r=t.findWordAt(n);Ki(t.doc,r.anchor,r.head)}}})):function(e){return vt(t,e)||wt(e)}),dt(e.scroller,"contextmenu",(function(e){return wa(t,e)}));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>400}dt(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)&&!ba(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)}})),dt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),dt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!On(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 Oi(s,s):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(s):new Oi(ee(s.line,0),le(t.doc,ee(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),wt(n)}i()})),dt(e.scroller,"touchcancel",i),dt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Fr(t,e.scroller.scrollTop),_r(t,e.scroller.scrollLeft,!0),gt(t,"scroll",t))})),dt(e.scroller,"mousewheel",(function(e){return xi(t,e)})),dt(e.scroller,"DOMMouseScroll",(function(e){return xi(t,e)})),dt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){vt(t,e)||Ot(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=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),j(t.display.dragCursor,r)}}(t,e),Ot(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Ao<100))Ot(e);else if(!vt(t,e)&&!On(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=E("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:ti(t,Lo),leave:function(e){vt(t,e)||No(t)}};var l=e.input.getField();dt(l,"keyup",(function(e){return ha.call(t,e)})),dt(l,"keydown",ti(t,ua)),dt(l,"keypress",ti(t,da)),dt(l,"focus",(function(e){return kr(t,e)})),dt(l,"blur",(function(e){return Tr(t,e)}))}(this),Ro(),Gr(this),this.curOp.forceUpdate=!0,Ii(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout(F(kr,this),20):Tr(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](n,e[c],Ca);di(this),e.finishInit&&e.finishInit(this);for(var u=0;u<ja.length;++u)ja[u](n);Kr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Pa.defaults=Oa,Pa.optionHandlers=Sa;var ja=[];function Ea(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),l=_(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==$||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?_(Gt(o,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)d+=a,h+="\t";if(d<c&&(h+=K(c-d)),h!=u)return go(o,h,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);Xi(o,p,new Oi(v,v));break}}}Pa.defineInitHook=function(t){return ja.push(t)};var Ma=null;function Da(t){Ma=t}function Aa(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,l=At(e),c=null;if(s&&r.ranges.length>1)if(Ma&&Ma.text.join("\n")==e){if(r.ranges.length%Ma.text.length==0){c=[];for(var u=0;u<Ma.text.length;u++)c.push(o.splitLines(Ma.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=X(l,(function(t){return[t]})));for(var h=t.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],p=f.from(),g=f.to();f.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(l).length)):s&&Ma&&Ma.lineWise&&Ma.text.join("\n")==e&&(p=g=ee(p.line,0)));var v={from:p,to:g,text:c?c[d%c.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};co(t.doc,v),cn(t,"inputRead",t,v)}e&&!s&&Na(t,e),Ar(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function La(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qr(e,(function(){return Aa(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=Ea(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=Ea(t,i.head.line,"smart"));a&&cn(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 Ra(){var t=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=E("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),g&&(t.style.border="1px solid black"),Fa(t),e}function _a(t,e,n,r,i){var o=e,a=n,s=Gt(t,e.line);function l(r){var o,a;if(null==(o=i?function(t,e,n,r){var i=ut(e,t.doc.direction);if(!i)return Qo(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=lt(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 Qo(e,n,r);var s,l=function(t,n){return Zo(e,t instanceof ee?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||Ln(t,e),Qn(t,e,s,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==a.level){var h=1==a.level==r<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var f=h?"before":"after";return new ee(n.line,d,f)}}var p=function(t,e,r){for(var o=function(t,e){return e?new ee(n.line,l(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),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},g=p(o+r,r,u);if(g)return g;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=p(r>0?0:i.length-1,r,c(v)))?null:g}(t.cm,s,e,n):Qo(s,e,n))){if(r||(a=e.line+n)<t.first||a>=t.first+t.size||(e=new ee(a,e.ch,e.sticky),!(s=Gt(t,a))))return!1;e=ta(i,t.cm,s,e.line,n)}else e=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,h=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var f=s.text.charAt(e.ch)||"\n",p=et(f,h)?"w":u&&"\n"==f?"n":!u||/\s/.test(f)?null:"p";if(!u||d||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),e.sticky="after");break}if(p&&(c=p),n>0&&!l(!d))break}var g=oo(t,e,o,a,!0);return re(o,g)&&(g.hitSide=!0),g}function Va(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ir(t.display),3);i=(n>0?e.bottom:e.top)+n*c}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 za=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 Ha(t,e){var n=An(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=Mn(n,r,e.line),o=ut(r,t.doc.direction),a="left";o&&(a=lt(o,e.ch)%2?"right":"left");var s=Rn(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $a(t,e){return e&&(t.bad=!0),t}function Wa(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return $a(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 Ba(o,e,n)}}function Ba(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!D(r,e))return $a(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 $a(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 l=t.measure,c=l.maps;function u(e,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[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]),h=o[a]+r;return(r<0||s!=e)&&(h=o[a+(r?1:0)]),ee(u,h)}}}var h=u(a,s,n);if(h)return $a(h,i);for(var d=s.nextSibling,f=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return $a(ee(h.line,h.ch-f),i);f+=d.textContent.length}for(var p=s.previousSibling,g=n;p;p=p.previousSibling){if(h=u(p,p.firstChild,-1))return $a(ee(h.line,h.ch+g),i);g+=p.textContent.length}}za.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function o(t){if(!vt(r,t)){if(r.somethingSelected())Da({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Da({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,W),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var o=Ma.text.join("\n");if(t.clipboardData.setData("Text",o),t.clipboardData.getData("Text")==o)return void t.preventDefault()}var a=Ra(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Ma.text.join("\n");var l=document.activeElement;I(s),setTimeout((function(){r.display.lineSpace.removeChild(a),l.focus(),l==i&&n.showPrimarySelection()}),50)}}Fa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),dt(i,"paste",(function(t){vt(r,t)||La(t,r)||s<=11&&setTimeout(ti(r,(function(){return e.updateFromDOM()})),20)})),dt(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),dt(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),dt(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),dt(i,"touchstart",(function(){return n.forceCompositionEnd()})),dt(i,"input",(function(){e.composing||e.readFromDOMSoon()})),dt(i,"copy",o),dt(i,"cut",o)},za.prototype.prepareSelection=function(){var t=yr(this.cm,!1);return t.focus=this.cm.state.focused,t},za.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},za.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=Wa(e,t.anchorNode,t.anchorOffset),s=Wa(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 l=e.display.view,c=i.line>=e.display.viewFrom&&Ha(e,i)||{node:l[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&Ha(e,o);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var f,p=t.rangeCount&&t.getRangeAt(0);try{f=k(c.node,c.offset,u.offset,u.node)}catch(t){}f&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),f.collapsed||(t.removeAllRanges(),t.addRange(f))):(t.removeAllRanges(),t.addRange(f)),p&&null==t.anchorNode?t.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},za.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)},za.prototype.showMultipleSelections=function(t){j(this.cm.display.cursorDiv,t.cursors),j(this.cm.display.selectionDiv,t.selection)},za.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},za.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return D(this.div,e)},za.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},za.prototype.blur=function(){this.div.blur()},za.prototype.getField=function(){return this.div},za.prototype.supportsTouch=function(){return!0},za.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},za.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},za.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=Wa(e,t.anchorNode,t.anchorOffset),r=Wa(e,t.focusNode,t.focusOffset);n&&r&&Qr(e,(function(){Qi(e.doc,ki(n,r),W),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},za.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=hr(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 l,c,u=hr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=Jt(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var o,d=e.getAttribute("cm-marker");if(d){var f=t.findMarks(ee(r,0),ee(i+1,0),(v=+d,function(t){return t.id==v}));return void(f.length&&(o=f[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&&c();for(var g=0;g<e.childNodes.length;g++)h(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),p&&(a=!0)}else 3==e.nodeType&&u(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(e),e!=n;)e=e.nextSibling,l=!1;return o}(r,n,c,e,l)),d=Kt(r.doc,ee(e,0),ee(l,Gt(r.doc,l).text.length));h.length>1&&d.length>1;)if(Y(h)==Y(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var f=0,p=0,g=h[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=Y(h),b=Y(d),w=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&e==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var x=ee(e,f),C=ee(l,d.length?Y(d).length-p:0);return h.length>1||h[0]||ne(x,C)?(go(r.doc,h,x,C,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},za.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return dr(t.cm)}))},za.prototype.setUneditable=function(t){t.contentEditable="false"},za.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Aa)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},za.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var Ua=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};Ua.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())Da({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ia(r);Da({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,W):(n.prevInput="",i.value=e.text.join("\n"),I(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),dt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),dt(i,"paste",(function(t){vt(r,t)||La(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),dt(i,"cut",o),dt(i,"copy",o),dt(t.scroller,"paste",(function(e){if(!On(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)}})),dt(t.lineSpace,"selectstart",(function(e){On(t,e)||wt(e)})),dt(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"})}})),dt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ua.prototype.createField=function(t){this.wrapper=Ra(),this.textarea=this.wrapper.firstChild},Ua.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},Ua.prototype.showSelection=function(t){var e=this.cm.display;j(e.cursorDiv,t.cursors),j(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ua.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ua.prototype.getField=function(){return this.textarea},Ua.prototype.supportsTouch=function(){return!1},Ua.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||A()!=this.textarea))try{this.textarea.focus()}catch(t){}},Ua.prototype.blur=function(){this.textarea.blur()},Ua.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ua.prototype.receivedFocus=function(){this.slowPoll()},Ua.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Ua.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))}))},Ua.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Lt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var 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 l=0,c=Math.min(r.length,i.length);l<c&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Qr(e,(function(){Aa(e,i.slice(l),r.length-l,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},Ua.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ua.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ua.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),c=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ti(n,Qi)(n.doc,ki(o),W);var u,d=i.style.cssText,f=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);",l&&(u=window.scrollY),r.input.focus(),l&&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(),O){Ot(t);var g=function(){pt(window,"mouseup",g),setTimeout(m,20)};dt(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=f,i.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),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?ti(n,so)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Ua.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},Ua.prototype.setUneditable=function(){},Ua.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!=Ca&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Ca,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Mi(t)}),!0),n("indentUnit",2,Mi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){Di(t),Hn(t),dr(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--)go(t.doc,e,n[i],ee(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ca&&t.refresh()})),n("specialCharPlaceholder",Qe,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){xa(t),gi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Xo(e),i=n!=Ca&&Xo(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ta,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=fi(e,t.options.lineNumbers),gi(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 $r(t)}),!0),n("scrollbarStyle","native",(function(t){Ur(t),$r(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=fi(t.options.gutters,e),gi(t)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(t){return t}),gi,!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&&(Tr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,ka),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,Di,!0),n("addModeClass",!1,Di,!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,Di,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Pa),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)&&ti(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"](Xo(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:ei((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++,dr(this)})),removeOverlay:ei((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 dr(this)}})),indentLine:ei((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)&&Ea(this,t,e,n)})),indentSelection:ei((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&&(Ea(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&Ar(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 l=s;l<n;++l)Ea(this,l,t);var c=this.doc.sel.ranges;0==o.ch&&e.length==c.length&&c[r].from().ch>0&&Xi(this.doc,r,new Oi(o,c[r].to()),W)}}})),getTokenAt:function(t,e){return be(this,t,e)},getLineTokens:function(t,e){return be(this,ee(t),e,!0)},getTokenTypeAt:function(t){t=le(this.doc,t);var e,n=fe(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 l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==z(r,c.val)&&r.push(c.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?le(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Gn(this,le(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 Un(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-Be(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,l=this.display,c=(t=Kn(this,le(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==r)c=t.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(c=t.bottom),u+e.offsetWidth>d&&(u=d-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==i?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(s=Mr(o,a)).scrollTop&&Fr(o,s.scrollTop),null!=s.scrollLeft&&_r(o,s.scrollLeft))},triggerOnKeyDown:ei(ua),triggerOnKeyPress:ei(da),triggerOnKeyUp:ha,triggerOnMouseDown:ei(va),execCommand:function(t){if(ea.hasOwnProperty(t))return ea[t].call(null,this)},triggerElectric:ei((function(t){Na(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=le(this.doc,t),a=0;a<e&&!(o=_a(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ei((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?_a(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),U)})),deleteH:ei((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Jo(this,(function(n){var i=_a(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=le(this.doc,t),s=0;s<e;++s){var l=Kn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Va(this,l,i,n)).hitSide)break}return a},moveV:ei((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 l=Va(n,s,t,e);return"page"==e&&a==r.sel.primary()&&Dr(n,Gn(n,l,"div").top-s.top),l}),U),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 Oi(ee(t.line,n),ee(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?L(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),gt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ei((function(t,e){Lr(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:En(this),clientWidth:jn(this)}},scrollIntoView:ei((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){Nr(t),t.curOp.scrollToPos=e}(this,t):Ir(this,t.from,t.to,t.margin)})),setSize:ei((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&&zn(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){fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,gt(this,"refresh",this)})),operation:function(t){return Qr(this,t)},startOperation:function(){return Gr(this)},endOperation:function(){return Kr(this)},refresh:ei((function(){var t=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Hn(this),Lr(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==t||Math.abs(t-ir(this.display))>.5)&&cr(this),gt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ii(this,t),Hn(this),this.display.input.reset(),Lr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},bt(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})}}(Pa);var qa="iter insert remove copy getEditor constructor".split(" ");for(var Ga in Do.prototype)Do.prototype.hasOwnProperty(Ga)&&z(qa,Ga)<0&&(Pa.prototype[Ga]=function(t){return function(){return t.apply(this.doc,arguments)}}(Do.prototype[Ga]));return bt(Do),Pa.inputStyles={textarea:Ua,contenteditable:za},Pa.defineMode=function(t){Pa.defaults.mode||"null"==t||(Pa.defaults.mode=t),_t.apply(this,arguments)},Pa.defineMIME=function(t,e){Rt[t]=e},Pa.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Pa.defineMIME("text/plain","null"),Pa.defineExtension=function(t,e){Pa.prototype[t]=e},Pa.defineDocExtension=function(t,e){Do.prototype[t]=e},Pa.fromTextArea=function(t,e){if((e=e?R(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=A();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(dt(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(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(pt(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var s=Pa((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=pt,t.on=dt,t.wheelEventPixels=wi,t.Doc=Do,t.splitLines=At,t.countColumn=_,t.findColumn=q,t.isWordChar=tt,t.Pass=$,t.signal=gt,t.Line=Ge,t.changeEnd=Ti,t.scrollbarModel=Br,t.Pos=ee,t.cmpPos=ne,t.modes=Ft,t.mimeModes=Rt,t.resolveMode=Vt,t.getMode=zt,t.modeExtensions=Ht,t.extendMode=$t,t.copyState=Wt,t.startState=Ut,t.innerMode=Bt,t.commands=ea,t.keyMap=Wo,t.keyName=Yo,t.isModifierKey=Go,t.lookupKey=qo,t.normalizeKeyMap=Uo,t.StringStream=qt,t.SharedTextMarker=Po,t.TextMarker=ko,t.LineWidget=Co,t.e_preventDefault=wt,t.e_stopPropagation=xt,t.e_stop=Ot,t.addClass=L,t.contains=D,t.rmClass=T,t.keyNames=Vo}(Pa),Pa.version="5.48.4",Pa}()},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(0),i=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},o=function(t,e){t.parentNode.replaceChild(e,t)},a=function(t,e,n){var i=t.childNodes,o=i.length,a=Object(r.isUndefined)(n)?o:n;a>=o?t.appendChild(e):t.insertBefore(e,i[a])},s=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.tag||"div",i=e.attributes||{},o=document.createElement(n);Object(r.each)(i,(function(t,e){o.setAttribute(e,t)})),t.appendChild(o)}))}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(6),a=n.n(o),s=n(1),l=n.n(s),c=n(0),u=n(3),h=n(29),d=l.a.View.extend({events:function(){return this.model.get("events")||{mousedown:"handleClick"}},attributes:function(){return this.model.get("attributes")},initialize:function(t){this.editor=t.config.editor},handleClick:function(t){t.preventDefault(),t.stopPropagation(),this.execCommand(t)},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}}),f=h.a.extend({itemView:d,initialize:function(t){this.config={editor:t.editor||""},this.listenTo(this.collection,"reset",this.render)}}),p=l.a.Model.extend({defaults:{command:"",attributes:{}}}),g=l.a.Collection.extend({model:p});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}var m,y=l.a.$;e.default={init:function(t){Object(c.bindAll)(this,"onHover","onOut","onClick","onFrameScroll")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent();var t=this.config.em;m=1,t.on("component:update",this.updateAttached,this),t.on("change:canvasOffset",this.updateAttached,this)},startSelectComponent:function(){this.toggleSelectComponent(1)},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this.em,n=t?"on":"off",r={on:u.p,off:u.o},i=this.getCanvasBody(),o=this.getContentWindow();r[n](i,"mouseover",this.onHover),r[n](i,"mouseout",this.onOut),r[n](i,"click touchend",this.onClick),r[n](o,"scroll resize",this.onFrameScroll),e[n]("component:toggled",this.onSelect,this),e[n]("change:componentHovered",this.onHovered,this)},onHover:function(t){t.stopPropagation();var e=t.target,n=y(e),r=n.data("model");if(!r)for(var i=n.parent();!r&&i.length>0;)r=i.data("model"),i=i.parent();if(this.adjScroll||(this.adjScroll=1,this.updateAttached()),r&&!r.get("hoverable")){for(var o=r&&r.parent();o&&!o.get("hoverable");)o=o.parent();r=o}this.em.setHovered(r,{forceChange:1})},onHovered:function(t,e){var n=e&&e.getEl();if(n){var r=this.getElementPos(n);this.updateBadge(n,r),this.updateHighlighter(n,r),this.showElementOffset(n,r)}},onOut:function(t){t&&t.stopPropagation(),this.hideBadge(),this.hideHighlighter(),this.hideElementOffset()},showElementOffset:function(t,e){var n=y(t).data("model");n&&"selected"==n.get("status")||!m||this.editor.runCommand("show-offset",{el:t,elPos:e,force:1})},hideElementOffset:function(t,e){var n=this.editor;n&&n.stopCommand("show-offset")},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(){this.canvas.getHighlighter().style.display="none"},onClick:function(t){var e=this.em;if(t.stopPropagation(),t.preventDefault(),e.get("_cmpDrag"))return e.set("_cmpDrag");var n=y(t.target),r=n.data("model");if(!r)for(var i=n.parent();!r&&i.length>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]:{};if(t){var n=e.ctrlKey||e.metaKey,r=e.shiftKey,i=this.editor,o=i.getConfig("multipleSelection"),a=this.em;if(n&&o)i.selectToggle(t);else if(r&&o){a.clearSelection(i.Canvas.getWindow());var s,l,u=t.collection,h=u.indexOf(t);i.getSelectedAll();if(i.getSelectedAll().forEach((function(t){var e=t.collection,n=e.indexOf(t);e===u&&(n<h?s=Object(c.isUndefined)(s)?n:Math.max(s,n):n>h&&(l=Object(c.isUndefined)(l)?n:Math.min(l,n)))})),!Object(c.isUndefined)(s))for(;s!==h;)i.selectAdd(u.at(s)),s++;if(!Object(c.isUndefined)(l))for(;l!==h;)i.selectAdd(u.at(l)),l--;i.selectAdd(t)}else i.select(t);this.initResize(t)}},updateBadge:function(t,e){var n=y(t),r=this.canvas.getConfig(),i=r.pStylePrefix||"",o=r.customBadgeLabel;this.cacheEl=t;var a=n.data("model");if(a&&a.get("badgable")){var s=this.getBadge(),l=a.getIcon(),c="".concat(i,"badge"),u="".concat(l?'<div class="'.concat(c,'__icon">').concat(l,"</div>"):"",'\n <div class="').concat(c,'__name">').concat(a.getName(),"</div>");u=o?o(a):u,s.innerHTML=u;var h=s.style;h.display="block";var d=this.getCanvasPosition();if(d){var f=d.top,p=d.left,g=e.top-(s?s.offsetHeight:0),v=s?s.offsetWidth:0,m=g<f?f:g,b=e.left+v<p?p:e.left;h.top=m+"px",h.left=b+"px"}}},updateHighlighter:function(t,e){var n=y(t).data("model");if(n&&n.get("hoverable")&&"selected"!=n.get("status")){var r=this.canvas.getHighlighter().style;r.left=e.left+"px",r.top=e.top+"px",r.height=e.height+"px",r.width=e.width+"px",r.display="block"}},onSelect:function(){var t=this.em.getSelected(),e=t&&t.view;if(this.updateToolbar(t),e){var n=e.el;this.showFixedElementOffset(n),this.hideElementOffset(),this.hideHighlighter(),this.initResize(n)}else this.editor.stopCommand("resize")},initResize:function(t){var e,n=this.em,r=this.canvas,o=n?n.get("Editor"):"",s=(n?n.get("Config"):"").stylePrefix||"",l="".concat(s,"resizing"),h=!Object(c.isElement)(t)&&Object(u.k)(t)?t:n.getSelected(),d=h.get("resizable"),f=Object(c.isElement)(t)?t:h.getEl(),p={},g=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(l):r.replace(l,"")).trim()}))};o&&d?(p={onStart:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.el,o=r.config,a=r.resizer,s=o.keyHeight,l=o.keyWidth,c=o.currentUnit,d=o.keepAutoHeight,f=o.keepAutoWidth;g("add",0,r),e=n.get("StyleManager").getModelToStyle(h);var p=getComputedStyle(i),v=e.getStyle(),y=v[l];o.autoWidth=f&&"auto"===y,isNaN(parseFloat(y))&&(y=p[l]);var b=v[s];o.autoHeight=d&&"auto"===b,isNaN(parseFloat(b))&&(b=p[s]),a.startDim.w=parseFloat(y),a.startDim.h=parseFloat(b),m=0,c&&(o.unitHeight=Object(u.h)(b),o.unitWidth=Object(u.h)(y))},onMove:function(){o.trigger("change:canvasOffset")},onEnd:function(t,e){g("remove",0,e),o.trigger("change:canvasOffset"),m=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,l=o.config,c=l.keyHeight,u=l.keyWidth,h=l.autoHeight,d=l.autoWidth,f=l.unitWidth,p=l.unitHeight,g=["tc","bc"].indexOf(s)>=0,v=["cl","cr"].indexOf(s)>=0,m=e.getStyle();if(!g){var y=r.getBody().offsetWidth,b=i.w<y?i.w:y;m[u]=d?"auto":"".concat(b).concat(f)}v||(m[c]=h?"auto":"".concat(i.h).concat(p)),e.setStyle(m,{avoidStore:1});var w="update:component:style";n&&n.trigger("".concat(w,":").concat(c," ").concat(w,":").concat(u)),a&&e.trigger("change:style",e,m,{})}}},"object"==a()(d)&&(p=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},p,{},d)),this.resizer=o.runCommand("resize",{el:f,options:p,force:1})):(o.stopCommand("resize"),this.resizer=null)},updateToolbar:function(t){var e=this,n=this.config.em,r=t==n?n.getSelected():t,i=this.canvas.getToolbarEl(),o=i.style;if(r){var a=r.get("toolbar");this.ppfx;if(n.get("Config").showToolbar&&a&&a.length){if(o.opacity="",o.display="",!this.toolbar){i.innerHTML="",this.toolbar=new g(a);var s=new f({collection:this.toolbar,editor:this.editor});i.appendChild(s.render().el)}this.toolbar.reset(a);var l=r.view;o.top="-100px",o.left=0,setTimeout((function(){return l&&e.updateToolbarPos(l.el)}),0)}else o.display="none"}else o.opacity=0},updateToolbarPos:function(t,e){var n=this.canvas,r=n.getToolbarEl(),i=r.style;i.opacity=0;var o=n.getTargetToElementDim(r,t,{elPos:e,event:"toolbarPosUpdate"});if(o){var a=n.getCanvasView().getFrameOffset();o.top<=o.canvasTop&&!(o.elementHeight+o.targetHeight>=a.height)&&(o.top=o.elementTop+o.elementHeight);var s=o.elementLeft+o.elementWidth,l=s-o.targetWidth;s>o.canvasWidth&&(l-=s-o.canvasWidth),l=l<0?0:l,i.top="".concat(o.top).concat("px"),i.left="".concat(l).concat("px"),i.opacity=""}},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},clean:function(){this.selEl&&this.selEl.removeClass(this.hoverClass)},getBadge:function(){return this.canvas.getBadgeEl()},onFrameScroll:function(){var t=this.cacheEl;if(t){var e=this.getElementPos(t);this.updateBadge(t,e);var n=this.em.getSelected(),r=n&&n.getEl();r&&this.updateToolbarPos(r)}},updateAttached:function(){var t=this.resizer,e=this.em.getSelected(),n=e&&e.view;if(n){var r=n.el;this.updateToolbarPos(r),this.showFixedElementOffset(r),t&&t.updateContainer()}},getElementPos:function(t,e){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.frameEl.contentWindow},run:function(t){this.editor=t&&t.get("Editor"),this.enable(),this.onSelect()},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=this.editor;this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.clean(),this.onOut(),this.hideFixedElementOffset(),this.canvas.getToolbarEl().style.display="none",i&&i.stopCommand("resize"),r.off("component:update",this.updateAttached,this),r.off("change:canvasOffset",this.updateAttached,this)}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},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}},function(t,e,n){"use strict";var r=n(1),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||{},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.model.set({value:e},{fromInput:1}),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var t=this.model,e=t.get("placeholder")||t.get("defaults")||"";this.inputEl=o('<input type="text" placeholder="'.concat(e,'">'))}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){"use strict";n.r(e);var r=n(1),i=n.n(r),o=n(11);e.default=i.a.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{},this.properties=[];var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.render)},addTo:function(t,e,n){this.add(t,null,n)},add:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||this.el,i=new t.typeView({model:t,name:t.get("name"),id:this.pfx+t.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=t.get("type")&&(i.customValue=this.customValue),i.render();var a=i.el;this.properties.push(i),Object(o.a)(r,a,n.at)},render:function(){var t=this;this.properties=[];var e=document.createDocumentFragment();return this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.$el.attr("class","".concat(this.pfx,"properties")),this}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(2),i=n.n(r),o=n(13),a=n.n(o),s=n(14),l=n.n(s),c=n(0),u=n(3);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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=function(){return{x:0,y:0}},p=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(c.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(e),this.delta=f(),this}return l()(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=d({},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.p,off:u.o};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(c.result)(e,"guidesStatic")||[],this.guidesTarget=Object(c.result)(e,"guidesTarget")||[],Object(c.isFunction)(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff=f(),this.globScrollDiff=f(),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),l={x:i.x+r.x,y:i.y+r.y};this.globScrollDiff=l;var u={x:s.x-a.x+l.x,y:s.y-a.y+l.y};this.lastScrollDiff=f();var h=this.lockedAxis;"x"===(h=t.shiftKey?!h&&this.detectAxisLock(u.x,u.y):null)?u.x=a.x:"y"===h&&(u.y=a.y);var p=function(r){["x","y"].forEach((function(t){return r[t]=r[t]*Object(c.result)(n,"scale")})),e.delta=r,e.move(r.x,r.y),Object(c.isFunction)(o)&&o(t,e)},g=d({},u);if(this.currentPointer=s,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),p(u),this.guidesTarget.length){var v=this.snapGuides(g),m=v.newDelta,y=v.trgX,b=v.trgY;(y||b)&&p(m)}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",l=n[s],u=o[s],h=t[s],d=a?i:r;if(e.isPointIn(l,u)&&Object(c.isUndefined)(d)){var f=h-(l-u);e.setGuideLock(n,f)}}})))})),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(c.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(c.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(c.isFunction)(a)&&a(t,this,{cancelled:r})}},{key:"keyHandle",value:function(t){Object(u.j)(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,l=o.y+e;this.position={x:s,y:l,end:n},Object(c.isFunction)(a)&&a(this.position),r&&(r.style.left="".concat(s,"px"),r.style.top="".concat(l,"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.g)(t);return e?e(t):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var t=this.el,e=this.opts.getPosition,n=f();return Object(c.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,i=n(6),o=n.n(i),a=n(2),s=n.n(a),l=n(1),c=n.n(l),u=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(n,!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.a=c.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.config=e.config,this.em=e.em;var n=this.em;this.model=function(t,r){var i,o=e.componentTypes;r.em=e.em,r.config=e.config,r.componentTypes=o,r.domc=e.domc;for(var a=0;a<o.length;a++){if(o[a].id==t.type){i=o[a].model;break}}return i||(i=o[o.length-1].model,n&&t.type&&n.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:r})),new i(t,r)}},parseString:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=i.get("CssComposer"),a=i.get("Parser").parseHtml(t);return r||(r=n(4).default),r.checkId(a.html,a.css,this.opt.domc.componentsById),a.css&&o&&!e.temporary&&o.addCollection(a.css,d({},e,{extend:1})),a.html},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(u.isString)(t)?t=this.parseString(t,n):Object(u.isArray)(t)&&t.forEach((function(r,i){Object(u.isString)(r)&&(t[i]=e.parseString(r,n))}));var r=Object(u.isArray)(t);return t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?t:t[0],c.a.Collection.prototype.add.apply(this,[t,n])},processDef:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,r=(void 0===n?{}:n).processor,i=t;if(r){var a=r(i=d({},i));a&&(Object(u.each)(i,(function(t,e){return delete i[e]})),Object(u.extend)(i,a))}if(i.$$typeof&&"object"==o()(i.props)){(i=d({},i)).props=d({},i.props);var s=e.get("DomComponents"),l=e.get("Parser").parserHtml;Object(u.each)(i,(function(t,e){Object(u.includes)(["props","type"],e)||delete i[e]}));var c=i.props,h=c.children;delete c.children,delete i.props;var f=l.splitPropsFromAttr(c);i.attributes=f.attrs,h&&(i.components=h),i.type?s.getType(i.type)||(i.tagName=i.type,delete i.type):i.type="textnode",Object(u.extend)(i,f.props)}return i},onAdd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=t.getStyle(),o=r&&r.getConfig("avoidInlineStyle");if(!Object(u.isEmpty)(i)&&!o&&r&&r.get&&r.getConfig("forceClass")&&!n.temporary){var a=t.cid;r.get("CssComposer").setClassRule(a,i);t.setStyle({}),t.addClass(a)}}})},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=i.a.$;e.default=i.a.View.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.em.get&&this.setElement(this.getCanvas()),this.canvas&&(this.$canvas=this.$el,this.$wrapper=o(this.getCanvasWrapper()),this.frameEl=this.canvas.getFrameEl(),this.canvasTool=this.getCanvasTools(),this.bodyEl=this.getCanvasBody()),this.init(this.config)},onFrameScroll:function(t){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasWrapper:function(){return this.canvas.getWrapperEl()},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(3),s=n(26);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 c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(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 c({},this.getStyle(),{},t)},getStyle:function(){return c({},this.get("style")||{})},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(),i=c({},e);this.set("style",i,n);var s=Object(a.q)(r,i);return Object(o.keys)(s).forEach((function(e){var n=t.em;t.trigger("change:style:".concat(e)),n&&(n.trigger("styleable:change",t,e),n.trigger("styleable:change:".concat(e),t,e))})),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();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":"");s&&e.push("".concat(r,":").concat(s,";"))}return e.join("")},getSelectors:function(){return this.get("selectors")||this.get("classes")}}},function(t,e,n){"use strict";var r,i;
|
||
/*! cash-dom 1.3.7, https://github.com/kenwheeler/cash @license MIT */void 0===(i="function"==typeof(r=function(){var t,e=document,n=window,r=Array.prototype,i=r.slice,o=r.filter,a=r.push,s=function(){},l=function(t){return"function"==typeof t&&t.call},c=function(t){return"string"==typeof t},u=/^#[\w-]*$/,h=/^\.[\w-]*$/,d=/<.+>/,f=/^\w+$/;function p(t,n){return n=n||e,h.test(t)?n.getElementsByClassName(t.slice(1)):f.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t)}function g(n){if(!t){var r=(t=e.implementation.createHTMLDocument(null)).createElement("base");r.href=e.location.href,t.head.appendChild(r)}return t.body.innerHTML=n,t.body.childNodes}function v(t){"loading"!==e.readyState?setTimeout(t):e.addEventListener("DOMContentLoaded",t)}function m(t,r){if(!t)return this;if(t.cash&&t!==n)return t;var i,o=t,a=0;if(c(t))o=u.test(t)?e.getElementById(t.slice(1)):d.test(t)?g(t):p(t,r);else if(l(t))return v(t),this;if(!o)return this;if(o.nodeType||o===n)this[0]=o,this.length=1;else for(i=this.length=o.length;a<i;a++)this[a]=o[a];return this}function y(t,e){return new m(t,e)}var b=y.fn=y.prototype=m.prototype={cash:!0,length:0,push:a,splice:r.splice,map:r.map,init:m};function w(t,e){for(var n=t.length,r=0;r<n&&!1!==e.call(t[r],t[r],r,t);r++);}function x(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function C(t){return c(t)?x:t.cash?function(e){return t.is(e)}:function(t,e){return t===e}}function O(t){return y(i.call(t).filter((function(t,e,n){return n.indexOf(t)===e})))}Object.defineProperty(b,"constructor",{value:y}),y.parseHTML=g,y.noop=s,y.isFunction=l,y.isString=c,y.extend=b.extend=function(t){t=t||{};var e=i.call(arguments),n=e.length,r=1;for(1===e.length&&(t=this,r=0);r<n;r++)if(e[r])for(var o in e[r])e[r].hasOwnProperty(o)&&(t[o]=e[r][o]);return t},y.extend({merge:function(t,e){for(var n=+e.length,r=t.length,i=0;i<n;r++,i++)t[r]=e[i];return t.length=r,t},each:w,matches:x,unique:O,isArray:Array.isArray,isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}});var S=y.uid="_cash"+Date.now();function k(t){return t[S]=t[S]||{}}function T(t,e,n){return k(t)[e]=n}function P(t,e){var n=k(t);return void 0===n[e]&&(n[e]=t.dataset?t.dataset[e]:y(t).attr("data-"+e)),n[e]}b.extend({data:function(t,e){if(c(t))return void 0===e?P(this[0],t):this.each((function(n){return T(n,t,e)}));for(var n in t)this.data(n,t[n]);return this},removeData:function(t){return this.each((function(e){return function(t,e){var n=k(t);n?delete n[e]:t.dataset?delete t.dataset[e]:y(t).removeAttr("data-"+name)}(e,t)}))}});var j=/\S+/g;function E(t){return c(t)&&t.match(j)}function M(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function D(t,e){t.classList?t.classList.add(e):M(t,e)||(t.className+=" "+e)}function A(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(e,"")}b.extend({addClass:function(t){var e=E(t);return e?this.each((function(t){w(e,(function(e){D(t,e)}))})):this},attr:function(t,e){if(t){if(c(t))return void 0===e?this[0]?this[0].getAttribute?this[0].getAttribute(t):this[0][t]:void 0:this.each((function(n){n.setAttribute?n.setAttribute(t,e):n[t]=e}));for(var n in t)this.attr(n,t[n]);return this}},hasClass:function(t){var e=!1,n=E(t);return n&&n.length&&this.each((function(t){return!(e=M(t,n[0]))})),e},prop:function(t,e){if(c(t))return void 0===e?this[0][t]:this.each((function(n){n[t]=e}));for(var n in t)this.prop(n,t[n]);return this},removeAttr:function(t){return this.each((function(e){e.removeAttribute?e.removeAttribute(t):delete e[t]}))},removeClass:function(t){if(!arguments.length)return this.attr("class","");var e=E(t);return e?this.each((function(t){w(e,(function(e){A(t,e)}))})):this},removeProp:function(t){return this.each((function(e){delete e[t]}))},toggleClass:function(t,e){if(void 0!==e)return this[e?"addClass":"removeClass"](t);var n=E(t);return n?this.each((function(t){w(n,(function(e){M(t,e)?A(t,e):D(t,e)}))})):this}}),b.extend({add:function(t,e){return O(y.merge(this,y(t,e)))},each:function(t){return w(this,t),this},eq:function(t){return y(this.get(t))},filter:function(t){if(!t)return this;var e=l(t)?t:C(t);return y(o.call(this,(function(n){return e(n,t)})))},first:function(){return this.eq(0)},get:function(t){return void 0===t?i.call(this):t<0?this[t+this.length]:this[t]},index:function(t){var e=t?y(t)[0]:this[0],n=t?this:y(e).parent().children();return i.call(n).indexOf(e)},last:function(){return this.eq(-1)}});var L,N,I,F,R=(I=/(?:^\w|[A-Z]|\b\w)/g,F=/[\s-_]+/g,function(t){return t.replace(I,(function(t,e){return t[0===e?"toLowerCase":"toUpperCase"]()})).replace(F,"")}),_=(L={},N=document.createElement("div").style,function(t){if(t=R(t),L[t])return L[t];var e=t.charAt(0).toUpperCase()+t.slice(1);return w((t+" "+["webkit","moz","ms","o"].join(e+" ")+e).split(" "),(function(e){if(e in N)return L[e]=t=L[t]=e,!1})),L[t]});function V(t,e){return parseInt(n.getComputedStyle(t[0],null)[e],10)||0}function z(t,e,n){var r,i=P(t,"_cashEvents"),o=i&&i[e];o&&(n?(t.removeEventListener(e,n),(r=o.indexOf(n))>=0&&o.splice(r,1)):(w(o,(function(n){t.removeEventListener(e,n)})),o=[]))}function H(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(/%20/g,"+")}function $(t){var e=t.type;if(!e)return null;switch(e.toLowerCase()){case"select-one":return function(t){var e=t.selectedIndex;return e>=0?t.options[e].value:null}(t);case"select-multiple":return function(t){var e=[];return w(t.options,(function(t){t.selected&&e.push(t.value)})),e.length?e:null}(t);case"radio":case"checkbox":return t.checked?t.value:null;default:return t.value?t.value:null}}function W(t,e,n){var r=c(e);r||!e.length?w(t,r?function(t){return t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,r){return function(t,e,n){if(n){var r=t.childNodes[0];t.insertBefore(e,r)}else t.appendChild(e)}(t,0===r?e:e.cloneNode(!0),n)}):w(e,(function(e){return W(t,e,n)}))}y.prefixedProp=_,y.camelCase=R,b.extend({css:function(t,e){if(c(t))return t=_(t),arguments.length>1?this.each((function(n){return n.style[t]=e})):n.getComputedStyle(this[0])[t];for(var r in t)this.css(r,t[r]);return this}}),w(["Width","Height"],(function(t){var e=t.toLowerCase();b[e]=function(){return this[0].getBoundingClientRect()[e]},b["inner"+t]=function(){return this[0]["client"+t]},b["outer"+t]=function(e){return this[0]["offset"+t]+(e?V(this,"margin"+("Width"===t?"Left":"Top"))+V(this,"margin"+("Width"===t?"Right":"Bottom")):0)}})),b.extend({off:function(t,e){return this.each((function(n){return z(n,t,e)}))},on:function(t,e,n,r){var i;if(!c(t)){for(var o in t)this.on(o,e,t[o]);return this}return l(e)&&(n=e,e=null),"ready"===t?(v(n),this):(e&&(i=n,n=function(t){for(var n=t.target;!x(n,e);){if(n===this)return!1;n=n.parentNode}n&&i.call(n,t)}),this.each((function(e){var i=n;r&&(i=function(){n.apply(this,arguments),z(e,t,i)}),function(t,e,n){var r=P(t,"_cashEvents")||T(t,"_cashEvents",{});r[e]=r[e]||[],r[e].push(n),t.addEventListener(e,n)}(e,t,i)})))},one:function(t,e,n){return this.on(t,e,n,!0)},ready:v,trigger:function(t,n){var r=e.createEvent("HTMLEvents");return r.data=n,r.initEvent(t,!0,!1),this.each((function(t){return t.dispatchEvent(r)}))}}),b.extend({serialize:function(){var t="";return w(this[0].elements||this,(function(e){if(!e.disabled&&"FIELDSET"!==e.tagName){var n=e.name;switch(e.type.toLowerCase()){case"file":case"reset":case"submit":case"button":break;case"select-multiple":var r=$(e);null!==r&&w(r,(function(e){t+=H(n,e)}));break;default:var i=$(e);null!==i&&(t+=H(n,i))}}})),t.substr(1)},val:function(t){return void 0===t?$(this[0]):this.each((function(e){return e.value=t}))}}),b.extend({after:function(t){return y(t).insertAfter(this),this},append:function(t){return W(this,t),this},appendTo:function(t){return W(y(t),this),this},before:function(t){return y(t).insertBefore(this),this},clone:function(){return y(this.map((function(t){return t.cloneNode(!0)})))},empty:function(){return this.html(""),this},html:function(t){if(void 0===t)return this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t){return t.innerHTML=e}))},insertAfter:function(t){var e=this;return y(t).each((function(t,n){var r=t.parentNode,i=t.nextSibling;e.each((function(t){r.insertBefore(0===n?t:t.cloneNode(!0),i)}))})),this},insertBefore:function(t){var e=this;return y(t).each((function(t,n){var r=t.parentNode;e.each((function(e){r.insertBefore(0===n?e:e.cloneNode(!0),t)}))})),this},prepend:function(t){return W(this,t,!0),this},prependTo:function(t){return W(y(t),this,!0),this},remove:function(){return this.each((function(t){return t.parentNode.removeChild(t)}))},text:function(t){return void 0===t?this[0].textContent:this.each((function(e){return e.textContent=t}))}});var B=e.documentElement;return b.extend({position:function(){var t=this[0];return{left:t.offsetLeft,top:t.offsetTop}},offset:function(){var t=this[0].getBoundingClientRect();return{top:t.top+n.pageYOffset-B.clientTop,left:t.left+n.pageXOffset-B.clientLeft}},offsetParent:function(){return y(this[0].offsetParent)}}),b.extend({children:function(t){var e=[];return this.each((function(t){a.apply(e,t.children)})),e=O(e),t?e.filter((function(e){return x(e,t)})):e},closest:function(t){return!t||this.length<1?y():this.is(t)?this.filter(t):this.parent().closest(t)},is:function(t){if(!t)return!1;var e=!1,n=C(t);return this.each((function(r){return!(e=n(r,t))})),e},find:function(t){if(!t||t.nodeType)return y(t&&this.has(t).length?t:null);var e=[];return this.each((function(n){a.apply(e,p(t,n))})),O(e)},has:function(t){var e=c(t)?function(e){return 0!==p(t,e).length}:function(e){return e.contains(t)};return this.filter(e)},next:function(){return y(this[0].nextElementSibling)},not:function(t){if(!t)return this;var e=C(t);return this.filter((function(n){return!e(n,t)}))},parent:function(){var t=[];return this.each((function(e){e&&e.parentNode&&t.push(e.parentNode)})),O(t)},parents:function(t){var n,r=[];return this.each((function(i){for(n=i;n&&n.parentNode&&n!==e.body.parentNode;)n=n.parentNode,(!t||t&&x(n,t))&&r.push(n)})),O(r)},prev:function(){return y(this[0].previousElementSibling)},siblings:function(){var t=this.parent().children(),e=this[0];return t.filter((function(t){return t!==e}))}}),y})?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(1),a=n.n(o),s=n(27),l=n(0),c=n(3);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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=a.a.Model.extend({defaults:{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],full:0,important:0,toRequire:0,requires:null,requiresParent:null},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get("id")||"",r=this.get("name")||"";!this.get("property")&&this.set("property",(r||n).replace(/ /g,"-"));var i=this.get("property");!this.get("id")&&this.set("id",i),!r&&this.set("name",Object(c.b)(i).replace(/-/g," ")),d.callInit(this,t,e)},init:function(){},clearValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0},t),this},setValue: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);this.set(r,h({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},setValueFromInput:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,h({},n,{fromInput:1}))},parseValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r="!important";if(Object(l.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,s=o.lastIndexOf(")"),c=o.substring(0,a-1);if(c&&(n.functionName=c),i.push(a),s>=0&&i.push(s),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},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(t){var e=this.get("functionName"),n=Object(l.isUndefined)(t)?this.get("value"):t,r=!Object(l.isUndefined)(n);return e&&r&&(n="".concat(e,"(").concat(n,")")),r&&this.get("important")&&(n="".concat(n," !important")),n||""}},{callParentInit:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,h({},r,{skipInit:1})])},callInit:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)}}),f=d;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}var g=f.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},f.prototype.defaults,{detached:0,properties:[],separator:" "}),initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f.callParentInit(f,this,t,e);var r=this.get("properties")||[],i=n(22).default;this.set("properties",new i(r)),this.listenTo(this,"change:value",this.updateValues),f.callInit(this,t,e)},clearValue:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.get("properties").each((function(t){return t.clearValue()})),f.prototype.clearValue.apply(this,arguments)},updateValues:function(){var t=this.getFullValue().split(this.getSplitSeparator());this.get("properties").each((function(e,n){var r=t.length;t[n]||t[n%r+(1!=r&&r%2?1:0)]}))},getSplitSeparator:function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},getDefaultValue:function(t){var e=this.get("defaults");return e&&!t?e:(e="",this.get("properties").each((function(t,n){return e+="".concat(t.getDefaultValue()," ")})),e.trim())},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()},getPropertyAt:function(t){return this.get("properties").at(t)}}),v=a.a.Model.extend({defaults:{index:"",value:"",values:{},active:!1,preview:!1,properties:[]},initialize:function(){var t=this,e=this.get("properties"),n=this.get("value");if(this.set("properties",e instanceof Q?e:new Q(e)),this.get("properties").forEach((function(e){var n=t.collection;e.parent=n&&n.property})),!n){var r="",i=this.get("values");for(var o in i)r+=" "+i[o];this.set("value",r.trim())}},getPropertyAt:function(t){return this.get("properties").at(t)},getPropertyValue:function(t){var e="";return this.get("properties").each((function(n){n.get("property")==t&&(e=n.getFullValue())})),e},getFullValue:function(){var t=[];return this.get("properties").each((function(e){return t.push(e.getFullValue())})),t.join(" ")}});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 y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var b=a.a.Collection.extend({model:v,initialize:function(){this.idx=1,this.on("add",this.onAdd),this.on("reset",this.onReset)},onAdd:function(t,e,n){n.noIncrement||t.set("index",this.idx++)},onReset:function(){this.idx=1},getSeparator:function(){var t=this.property;return t?t.get("layerSeparator"):", "},getLayersFromValue:function(t){var e=this,n=[];return t.replace(/\(([\w\s,.]*)\)/g,(function(e){var n=e.replace(/,\s*/g,",");t=t.replace(e,n)})),(t?t.split(this.getSeparator()):[]).forEach((function(t){n.push({properties:e.properties.parseValue(t)})})),n},getLayersFromStyle:function(t){var e=[],n=this.properties;n.pluck("property");return n.each((function(n){var r=t[n.get("property")];(r?r.split(", "):[]).forEach((function(t,r){t=n.parseValue(t.trim()).value;var i=e[r],o=y({},n.attributes,{},{value:t});i?i.properties.push(o):e[r]={properties:[o]}}))})),e.forEach((function(t){var e=t.properties.map((function(t){return t.property}));n.each((function(n){var r=n.get("property");e.indexOf(r)<0&&t.properties.push(y({},n.attributes))}))})),e},active:function(t){this.each((function(t){return t.set("active",0)}));var e=this.at(t);e&&e.set("active",1)},getFullValue:function(){var t=[];return this.each((function(e){return t.push(e.getFullValue())})),t.join(this.getSeparator())},getPropertyValues:function(t){var e=[];return this.each((function(n){var r=n.getPropertyValue(t);r&&e.push(r)})),e.join(", ")}});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}var x=g.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},g.prototype.defaults,{layers:[],layerSeparator:", ",preview:0}),initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g.callParentInit(g,this,t,e);var n=this.get("layers"),r=new b(n);r.property=this,r.properties=this.get("properties"),this.set("layers",r),g.callInit(this,t,e)},getLayers:function(){return this.get("layers")},getCurrentLayer:function(){return this.getLayers().filter((function(t){return t.get("active")}))[0]},getFullValue:function(){return this.get("detached")?"":this.get("layers").getFullValue()},getLayersFromTarget:function(t){}}),C=a.a.View.extend({template:function(t){var e=this.pfx;return'\n <div class="'.concat(e,'label">\n ').concat(this.templateLabel(t),'\n </div>\n <div class="').concat(this.ppfx,'fields">\n ').concat(this.templateInput(t),"\n </div>\n ")},templateLabel:function(t){var e=this.pfx,n=t.get("icon")||"",r=t.get("info")||"",i=t.parent;return'\n <span class="'.concat(e,"icon ").concat(n,'" title="').concat(r,'">\n ').concat(t.get("name"),"\n </span>\n ").concat(i?"":'<b class="'.concat(e,'clear" ').concat("data-clear-style",">⨯</b>"),"\n ")},templateInput:function(t){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(t.getDefaultValue(),'"/>\n </div>\n ')},events:i()({change:"inputValueChanged"},"click [".concat("data-clear-style","]"),"clear"),initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(l.bindAll)(this,"targetUpdated"),this.config=e.config||{};var n=this.config.em;this.em=n,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=e.target||{},this.propTarget=e.propTarget||{},this.onChange=e.onChange,this.onInputRender=e.onInputRender||{},this.customValue=e.customValue||{};var r=this.model;this.property=r.get("property"),this.input=null;var i=this.pfx;this.inputHolderId="#"+i+"input-holder",this.sector=r.collection&&r.collection.sector,r.view=this,r.get("value")||r.set("value",r.getDefaultValue()),n&&n.on("update:component:style:".concat(this.property),this.targetUpdated);var o=r.get("requires");o&&Object.keys(o).forEach((function(e){n&&n.on("component:styleUpdate:".concat(e),t.targetUpdated)})),this.listenTo(this.propTarget,"update styleManager:update",this.targetUpdated),this.listenTo(r,"destroy remove",this.remove),this.listenTo(r,"change:value",this.modelValueChanged),this.listenTo(r,"targetUpdated",this.targetUpdated),this.listenTo(r,"change:visible",this.updateVisibility),this.listenTo(r,"change:status",this.updateStatus);var a=this.init&&this.init.bind(this);a&&a()},updateStatus:function(){var t=this.model,e=t.get("status"),n=t.parent,r=this.pfx,i=this.ppfx,o=this.config,a="".concat(i,"four-color"),s="".concat(i,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};switch(l.removeClass("".concat(a," ").concat(s)),u.display="none",e){case"updated":!n&&l.addClass(a),o.clearProperties&&(u.display="inline");break;case"computed":l.addClass(s)}},clear:function(t){var e=this;t&&t.stopPropagation(),this.model.clearValue(),setTimeout((function(){return e.targetUpdated()}))},getClearEl:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat("data-clear-style","]"))),this.clearEl},getTarget:function(){return this.getTargetModel()},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(t){t&&t.stopPropagation(),this.model.setValue(this.getInputValue(),1,{fromInput:1}),this.elementUpdated()},elementUpdated:function(){this.setStatus("updated")},setStatus:function(t){this.model.set("status",t);var e=this.model.parent;e&&t&&e.set("status",t)},emitUpdateTarget:Object(l.debounce)((function(){var t=this.config.em;t&&t.trigger("styleManager:update:target",this.getTarget())})),targetUpdated:function(){if(this.emitUpdateTarget(),this.checkVisibility()){var t=this.config,e=t.em,n=this.model,r=n.get("property"),i="",o="",a=this.getTargetValue({ignoreDefault:1}),s=n.getDefaultValue(),l=this.getComputedValue();a?(i=a,t.highlightChanged&&(o="updated")):l&&t.showComputed&&l!=s?(i=l,t.highlightComputed&&(o="computed")):(i=s,o=""),n.setValue(i,0,{fromTarget:1}),this.setStatus(o),e&&(e.trigger("styleManager:change",this,r,i),e.trigger("styleManager:change:".concat(r),this,i))}},checkVisibility:function(){var t=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),t=0),this.sector&&this.sector.trigger("updateVisibility")),t},getTargetValue:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,r=this.getTargetModel(),i=this.customValue;if(!r)return t;if((t=r.getStyle()[n.get("property")])||e.ignoreDefault||(t=n.getDefaultValue()),"function"==typeof i&&!e.ignoreCustomValue){var o=n.collection.indexOf(n),a=i(this,o);a&&(t=a)}return t},getComputedValue:function(){var t=this.propTarget,e=t.computed||{},n=t.computedDefault||{},r=this.config.avoidComputed||[],i=this.model.get("property"),o=r.indexOf(i)<0,a=e[i],s=n[Object(c.a)(i)];return e&&o&&s!==a&&a},getInputValue:function(){var t=this.getInputEl();return t?t.value:""},modelValueChanged:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config.em,i=this.model,o=i.getFullValue(),a=this.getTarget(),s=i.get("property"),l=this.onChange;if(n.fromInput||this.setValue(o),a&&this.isTargetStylable()&&this.isComponentStylable()){n.fromTarget||(l&&!n.fromParent?l(a,this,n):this.updateTargetStyle(o,null,n));var c=r&&r.getSelected();r&&c&&(r.trigger("component:update",c),r.trigger("component:styleUpdate",c,s),r.trigger("component:styleUpdate:".concat(s),c))}},updateTargetStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||this.model.get("property"),i=this.getTarget(),o=i.getStyle();t?o[r]=t:delete o[r],i.setStyle(o,n);var a=this.getHelperModel();a&&a.setStyle(o,n)},isTargetStylable:function(t){var e=t||this.getTarget(),n=this.model,r=n.get("id"),i=n.get("property"),o=n.get("toRequire"),a=e.get("unstylable"),s=e.get("stylable-require"),c=n.get("requires"),u=n.get("requiresParent"),h=this.sector?this.sector.collection:null,d=this.em?this.em.getSelected():null,f=e.get("stylable");if(Object(l.isArray)(f)&&(f=f.indexOf(i)>=0),Object(l.isArray)(a)&&(f=a.indexOf(i)<0),o&&(f=!t||s&&(s.indexOf(r)>=0||s.indexOf(i)>=0)),h&&c){var p=Object.keys(c);h.each((function(t){t.get("properties").each((function(t){if(Object(l.includes)(p,t.id)){var e=c[t.id];f=f&&Object(l.includes)(e,t.get("value"))}}))}))}if(u){var g=d&&d.parent(),v=g&&g.getEl();if(v){var m=window.getComputedStyle(v);Object(l.each)(u,(function(t,e){f=f&&m[e]&&Object(l.includes)(t,m[e])}))}else f=!1}return f},isComponentStylable:function(){var t=this.em,e=t&&t.getSelected();return!e||this.isTargetStylable(e)},setRawValue:function(t){this.setValue(this.model.parseValue(t))},setValue:function(t){var e=this.model,n=Object(l.isUndefined)(t)?e.getDefaultValue():t,r=this.getInputEl();r&&(r.value=n)},getInputEl:function(){return this.input||(this.input=this.el.querySelector("input")),this.input},updateVisibility:function(){this.el.style.display=this.model.get("visible")?"block":"none"},show:function(){this.model.set("visible",1)},hide:function(){this.model.set("visible",0)},cleanValue:function(){this.setValue("")},clearCached:function(){this.clearEl=null,this.input=null,this.$input=null},render:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=e.get("property"),i=e.get("full"),o="".concat(t,"property");n.innerHTML=this.template(e),n.className="".concat(o," ").concat(t).concat(e.get("type")," ").concat(o,"__").concat(r),n.className+=i?" ".concat(o,"--full"):"",this.updateStatus();var a=this.onRender&&this.onRender.bind(this);a&&a(),this.setValue(e.get("value"),{targetUpdate:1})}}),O=a.a.$,S=C.extend({templateInput: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 ')},inputValueChanged:function(){if(!this.model.get("detached")){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];C.prototype.inputValueChanged.apply(this,e)}},clear:function(t){var e=this.properties;e&&e.forEach((function(t){return t.clear()})),C.prototype.clear.apply(this,arguments)},onRender:function(){var t=this.model,e=t.get("properties")||[];if(this.properties=[],e.length&&(this.$input||(this.$input=O('<input type="hidden" value="0">'),this.input=this.$input.get(0)),this.props||(this.props=t.get("properties")),!this.$props)){this.props.each((function(e,n){e&&"composite"==e.get("type")&&(this.props.remove(e),console.warn("Nested composite types not yet allowed.")),e.parent=t}),this);var r=new(0,n(16).default)(this.getPropsConfig());this.$props=r.render().$el,this.properties=r.properties,this.$el.find("#".concat(this.pfx,"input-holder")).append(this.$props)}},getPropsConfig:function(t){var e=this,n=this.model,r={config:this.config,collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(t,e,r){n.set("value",n.getFullValue(),r)},customValue:function(t,n){return e.valueOnIndex(n,t)}};return n.get("detached")&&delete r.onChange,r},valueOnIndex:function(t,e){var n,r=this.getTargetValue({ignoreDefault:1});r?n=r.split(this.model.getSplitSeparator())[t]:n=e&&e.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return n},clearCached:function(){C.prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}}),k=n(16),T=a.a.View.extend({events:{click:"active","click [data-close-layer]":"remove","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"},template:function(t){var e=this.pfx,n=this.ppfx,r=this.config,i="".concat(r.textLayer," ").concat(t.get("index"));return'\n <div id="'.concat(e,'move" class="').concat(n,'no-touch-actions" data-move-layer>\n <i class="fa fa-arrows"></i>\n </div>\n <div id="').concat(e,'label">').concat(i,'</div>\n <div id="').concat(e,'preview-box">\n \t<div id="').concat(e,'preview" data-preview></div>\n </div>\n <div id="').concat(e,'close-layer" class="').concat(e,'btn-close" data-close-layer>\n ⨯\n </div>\n <div id="').concat(e,'inputs" data-properties></div>\n <div style="clear:both"></div>\n ')},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model;this.stackModel=t.stackModel||{},this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.sorter=t.sorter||null,this.propsConfig=t.propsConfig||{},this.customPreview=t.onPreview,this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:active",this.updateVisibility),this.listenTo(e.get("properties"),"change",this.updatePreview),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},initSorter:function(t){this.sorter&&this.sorter.startSort(this.el)},remove:function(t){t&&t.stopPropagation&&t.stopPropagation();var e=this.model,n=e.collection,r=this.stackModel;a.a.View.prototype.remove.apply(this,arguments),n.contains(e)&&n.remove(e),r&&r.set&&(r.set({stackIndex:null},{silent:!0}),r.trigger("updateValue"))},onPreview:function(t){var e=t.split(" "),n=[];return this.model.get("properties").each((function(t,r){var i=e[r]||"";if(i&&"integer"==t.get("type")){var o=parseInt(i,10),a=i.replace(o,"");i=(o=(o=(o=isNaN(o)?0:o)>3?3:o)<-3?-3:o)+a}n.push(i)})),n.join(" ")},updatePreview:function(){var t=this.stackModel,e=this.customPreview,n=this.getPreviewEl(),r=this.model.getFullValue(),i=e?e(r):this.onPreview(r);i&&t&&n&&(n.style[t.get("property")]=i)},getPropertiesWrapper:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},getPreviewEl:function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},active:function(){var t=this.model,e=t.collection;e.active(e.indexOf(t))},updateVisibility:function(){var t=this.pfx,e=this.getPropertiesWrapper(),n=this.model.get("active");e.style.display=n?"":"none",this.$el[n?"addClass":"removeClass"]("".concat(t,"active"))},render:function(){var t=this.propsConfig,e=this.model,n=this.el,r=this.pfx,i=e.get("preview"),o=new k.default({collection:e.get("properties"),config:this.config,target:t.target,customValue:t.customValue,propTarget:t.propTarget,onChange:t.onChange}).render().el;return n.innerHTML=this.template(e),n.className="".concat(r,"layer").concat(i?"":" ".concat(r,"no-preview")),this.getPropertiesWrapper().appendChild(o),this.updateVisibility(),this.updatePreview(),this}}),P=a.a.View.extend({initialize:function(t){this.config=t.config||{},this.stackModel=t.stackModel,this.preview=t.preview,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.propsConfig=t.propsConfig;var e=this.pfx,n=this.ppfx,r=this.collection;this.className="".concat(e,"layers ").concat(n,"field"),this.listenTo(r,"add",this.addTo),this.listenTo(r,"deselectAll",this.deselectAll),this.listenTo(r,"reset",this.render);var i=this.config.em||"",o=i?i.get("Utils"):"";this.sorter=o?new o.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(e,"layers"),itemSel:".".concat(e,"layer"),pfx:this.config.pStylePrefix}):"",r.view=this,this.$el.data("model",r),this.$el.data("collection",r)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=e||null,i=this.stackModel,o=this.config,a=this.sorter,s=this.propsConfig;void 0!==this.preview&&t.set("preview",this.preview);var l=new T({model:t,config:o,sorter:a,stackModel:i,propsConfig:s}).render().el;if(r)r.appendChild(l);else if(void 0!==n){var c="before";this.$el.children().length==n&&(n--,c="after"),n<0?this.$el.append(l):this.$el.children().eq(n)[c](l)}else this.$el.append(l);return l},deselectAll:function(){this.$el.find("."+this.pfx+"layer").removeClass(this.pfx+"active")},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",this.className),this.sorter&&(this.sorter.plh=null),this}}),j=S.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'stack">\n <button type="button" id="').concat(t,'add" data-add-layer>+</button>\n <div data-layers-wrapper></div>\n </div>\n ')},init:function(){var t=this.model;this.pfx;t.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(t,"change:stackIndex",this.indexChanged),this.listenTo(t,"updateValue",this.inputValueChanged),this.delegateEvents()},clear:function(t){t&&t.stopPropagation(),this.model.get("layers").reset(),this.model.clearValue(),this.targetUpdated()},targetUpdated:function(){if(this.model.get("detached"))this.checkVisibility();else{for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];S.prototype.targetUpdated.apply(this,e)}this.refreshLayers()},getLayers:function(){return this.model.get("layers")},indexChanged:function(t){var e=this.model;this.getLayers().active(e.get("stackIndex"))},addLayer:function(){var t=this.model,e=this.getLayers(),n=t.get("properties").deepClone();n.each((function(t){return t.set("value","")}));var r=e.add({properties:n});this.inputValueChanged(),t.set("stackIndex",e.indexOf(r))},inputValueChanged:function(){var t=this.model;this.elementUpdated(),t.get("detached")?t.get("properties").each((function(t){return t.trigger("change:value")})):t.set("value",this.getLayerValues())},setValue:function(){},getLayerValues:function(){return this.getLayers().getFullValue()},refreshLayers:function(){var t=[],e=this.model,n=this.getLayers(),r=e.get("detached"),i=this.getTarget();if(r){var o=i?i.getStyle():{};t=n.getLayersFromStyle(o)}else{var a=this.getTargetValue();a=a==e.getDefaultValue()?"":a,t=n.getLayersFromValue(a)}var s=e.getLayersFromTarget(i)||t;n.reset(),n.add(s),e.set({stackIndex:null},{silent:!0})},onRender:function(){var t=this,e=this.model,r=this.el.querySelector("[data-layers-wrapper]"),i=n(16).default,o={target:this.target,propTarget:this.propTarget,onChange:function(n,r,i){var o=r.model;if(e.get("detached")){var a=o.get("property"),s=t.getLayers().getPropertyValues(a);r.updateTargetStyle(s,null,i)}else e.set("value",e.getFullValue(),i)}},a=new P({collection:this.getLayers(),stackModel:e,preview:e.get("preview"),config:this.config,propsConfig:o}).render().el;new i({target:this.target,collection:this.model.get("properties"),stackModel:e,config:this.config,onChange:o.onChange,propTarget:o.propTarget,customValue:o.customValue}).render(),r.appendChild(a)}}),E=a.a.$,M=C.extend({templateInput:function(){var t=this.pfx,e=(this.ppfx,this.config.assetsLabel||"Images");return'\n <div class="'.concat(t,"field ").concat(t,"file\">\n <div id='").concat(t,"input-holder'>\n <div class=\"").concat(t,'btn-c">\n <button class="').concat(t,'btn" id="').concat(t,'images" type="button">\n ').concat(e,'\n </button>\n </div>\n <div style="clear:both;"></div>\n </div>\n <div id="').concat(t,'preview-box">\n <div id="').concat(t,'preview-file"></div>\n <div id="').concat(t,'close">⨯</div>\n </div>\n </div>\n ')},init:function(){var t=this.em;this.modal=t.get("Modal"),this.am=t.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var t=this.model.getDefaultValue();this.$input=E('<input placeholder="'.concat(t,'">'))}this.$preview||(this.$preview=this.$el.find("#"+this.pfx+"preview-file")),this.$previewBox||(this.$previewBox=this.$el.find("#"+this.pfx+"preview-box")),this.setValue(this.componentValue,0)},clearCached:function(){C.prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(t,e){C.prototype.setValue.apply(this,arguments),this.setPreviewView(t&&t!=this.model.getDefaultValue()),this.setPreview(t)},setPreviewView:function(t){var e=this.$previewBox;e&&e[t?"addClass":"removeClass"]("".concat(this.pfx,"show"))},spreadUrl:function(t){this.model.set("value",t),this.setPreviewView(1)},setPreview:function(t){var e=this.$preview;t=t&&t.indexOf("url(")<0?"url(".concat(t,")"):t,e&&e.css("background-image",t)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];C.prototype.cleanValue.apply(this,e),this.setPreviewView(0)},openAssetManager:function(t){var e=this,n=this.em,r=this.modal,i=n?n.get("Editor"):"";i&&i.runCommand("open-assets",{types:["image"],accept:"image/*",target:this.getTargetModel(),onClick:function(){},onDblClick:function(){},onSelect:function(t){r.close();var n=Object(l.isString)(t)?t:t.get("src");e.spreadUrl(n)}})}}),D=a.a.$,A=C.extend({templateInput:function(){return""},init:function(){var t=this.model;this.listenTo(t,"change:unit",this.modelValueChanged),this.listenTo(t,"el:change",this.elementUpdated),this.listenTo(t,"change:units",this.render)},setValue:function(t){var e=this.model.parseValue(t);t="".concat(e.value).concat(e.unit),this.inputInst.setValue(t,{silent:1})},onRender:function(){var t=this.ppfx;if(!this.input){var e=this.model.input;e.ppfx=t,e.render(),this.el.querySelector(".".concat(t,"fields")).appendChild(e.el),this.$input=e.inputEl,this.unit=e.unitEl,this.$unit=D(this.unit),this.input=this.$input.get(0),this.inputInst=e}},clearCached:function(){C.prototype.clearCached.apply(this,arguments),this.unit=null,this.$unit=null}}),L=n(32);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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var F=A.extend({setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=I({},e,{silent:1}),this.inputInst.setValue(t,e)},onRender:function(){if(!this.input){var t=this.ppfx,e=new L.a({target:this.target,model:this.model,ppfx:t}).render();this.el.querySelector(".".concat(t,"fields")).appendChild(e.el),this.$input=e.inputEl,this.$color=e.colorEl,this.input=this.$input.get(0),this.inputInst=e}}}),R=n(8),_=n.n(R);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}var z=f.extend({defaults:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},f.prototype.defaults,{options:[],full:1})},initialize:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];f.prototype.initialize.apply(this,e),this.listenTo(this,"change:options",this.onOptionChange)},onOptionChange:function(){this.set("list",this.get("options"))},getOptions:function(){var t=this.attributes,e=t.options,n=t.list;return e&&e.length?e:n},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.set("options",t),this},addOption:function(t){if(t){var e=this.getOptions();this.setOptions([].concat(_()(e),[t]))}return this}});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}var $=z.extend({defaults:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},z.prototype.defaults,{full:0})}}),W=(a.a.$,C.extend({templateInput: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 ')},initialize:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];C.prototype.initialize.apply(this,e),this.listenTo(this.model,"change:options",this.updateOptions)},updateOptions:function(){this.input=null,this.onRender()},onRender:function(){var t=this.pfx,e=this.model.getOptions();if(!this.input){var n="";e.forEach((function(t){var e=t.name||t.value,r=t.style?t.style.replace(/"/g,"""):"",i=r?'style="'.concat(r,'"'):"",o=t.value.replace(/"/g,""");n+='<option value="'.concat(o,'" ').concat(i,">").concat(e,"</option>")}));var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML="<select>".concat(n,"</select>"),this.input=r.firstChild}}})),B=C.extend({templateInput:function(){this.pfx;var t=this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'field-radio">\n </div>\n ')},onRender:function(){var t=this.pfx,e=this.ppfx,n="".concat(e,"radio-item-label"),r=this.model,i=r.get("property"),o=r.get("list")||r.get("options")||[];if(!this.input&&o&&o.length){var a="";o.forEach((function(r){var o=r.className?"".concat(r.className," ").concat(t,"icon ").concat(n):"",s="".concat(i,"-").concat(r.value),l=r.name||r.value,c=r.title?'title="'.concat(r.title,'"'):"";a+='\n <div class="'.concat(e,'radio-item">\n <input type="radio" class="').concat(t,'radio" id="').concat(s,'" name="').concat(i,'" value="').concat(r.value,'"/>\n <label class="').concat(o||n,'" ').concat(c,' for="').concat(s,'">').concat(o?"":l,"</label>\n </div>\n ")}));var s=this.el.querySelector(".".concat(e,"field"));s.innerHTML='<div class="'.concat(e,'radio-items">').concat(a,"</div>"),this.input=s.firstChild}},getInputValue:function(){var t=this.getCheckedEl();return t?t.value:""},getCheckedEl:function(){var t=this.getInputEl();return t?t.querySelector("input:checked"):""},setValue:function(t){var e=this.model,n=t||e.get("value")||e.getDefaultValue(),r=this.getInputEl(),i=r?r.querySelector('[value="'.concat(n,'"]')):"";if(i)i.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}}),U=n(28);function q(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 G=f.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?q(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},f.prototype.defaults,{units:[],unit:"",step:1,min:"",max:""}),init:function(){var t=this.get("unit"),e=this.get("units");this.input=new U.a({model:this}),e.length&&!t&&this.set("unit",e[0])},clearValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},t),this},parseValue:function(t){var e=f.prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(e.value,{deepCheck:1}),r=n.value,i=n.unit;return e.value=r,e.unit=i,e},getFullValue:function(){var t=this.get("value"),e=this.get("unit");return t=Object(l.isUndefined)(t)?"":t,e=!Object(l.isUndefined)(e)&&t?e:"",t="".concat(t).concat(e),f.prototype.getFullValue.apply(this,[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}var Y=G.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?K(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},G.prototype.defaults,{showInput:1})});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}var J=A.extend({events:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},A.prototype.events,{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},templateInput:function(t){var e=this.ppfx;return'\n <div class="'.concat(e,"field ").concat(e,'field-range">\n <input type="range"\n min="').concat(t.get("min"),'"\n max="').concat(t.get("max"),'"\n step="').concat(t.get("step"),'"/>\n </div>\n ')},getSliderEl:function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},inputValueChanged:function(){var t=this.model,e=t.get("step");this.getInputEl().value=this.getSliderEl().value;var n=this.getInputValue()-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()},inputValueChangedSoft:function(){this.getInputEl().value=this.getSliderEl().value,this.model.set("value",this.getInputValue(),{avoidStore:1}),this.elementUpdated()},setValue:function(t){var e=this.model.parseValue(t);this.getSliderEl().value=parseFloat(e.value),A.prototype.setValue.apply(this,arguments)},onRender:function(){A.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},clearCached:function(){A.prototype.clearCached.apply(this,arguments),this.slider=null}});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}var Q=e.default=a.a.Collection.extend(s.a).extend({types:[{id:"stack",model:x,view:j,isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:g,view:S,isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:f,view:M,isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:f,view:F,isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:$,view:W,isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:z,view:B,isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:Y,view:J,isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:G,view:A,isType:function(t){if(t&&"integer"==t.type)return t}},{id:"base",model:f,view:C,isType:function(t){return t.type="base",t}}],deepClone:function(){var t=this.clone();return t.reset(t.map((function(t){var e=t.clone();return e.typeView=t.typeView,e}))),t},parseValue:function(t){var e=this,n=[];return t.split(" ").forEach((function(t,r){var o=e.at(r);o&&n.push(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Z(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},o.attributes,{},{value:t}))})),n},getFullValue:function(){var t="";return this.each((function(e){return t+="".concat(e.getFullValue()," ")})),t.trim()}})},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,n){"use strict";n.r(e);var r=n(1),i=n.n(r).a.$;e.default={startSelectPosition:function(t,e){var n=this;this.isPointed=!1;var r=this.editorModel.get("Utils");r&&!this.sorter&&(this.sorter=new r.Sorter({container:this.getCanvasBody(),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()}})),t&&this.sorter.startSort(t)},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(34);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(6),i=n.n(r),o=n(0);e.a=function(t){var e=t;return{compTypes:"",modelAttrStart:"data-gjs-",splitPropsFromAttr:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},r={};return Object(o.each)(e,(function(e,i){if(0===i.indexOf(t.modelAttrStart)){var a=i.replace("data-gjs-",""),s=e.length,l=e&&Object(o.isString)(e),c=l&&e.substr(0,1),u=l&&e.substr(s-1);e="false"!==(e="true"===e||e)&&e;try{e="{"==c&&"}"==u||"["==c&&"]"==u?JSON.parse(e):e}catch(t){}n[a]=e}else r[i]=e})),{props:n,attrs:r}},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(n){for(var r=[],o=n.childNodes,a=0,s=o.length;a<s;a++){var l=o[a],c=l.attributes||[],u=c.length,h=r[r.length-1],d=l.childNodes.length,f=this.compTypes,p={};if(f){var g="",v=l.getAttribute&&l.getAttribute("".concat("data-gjs-","type"));if(v)p={type:v};else{for(var m=0;m<f.length;m++){var y=f[m];if(g=y.model.isComponent(l)){"object"!==i()(g)&&(g={type:y.id});break}}p=g}}p.tagName||(p.tagName=l.tagName?l.tagName.toLowerCase():""),u&&(p.attributes={});for(var b=0;b<u;b++){var w=c[b].nodeName,x=c[b].nodeValue;if("style"==w)p.style=this.parseStyle(x);else if("class"==w)p.classes=this.parseClass(x);else{if("contenteditable"==w)continue;if(0===w.indexOf("data-gjs-")){var C=w.replace("data-gjs-",""),O=x.length,S=x&&x.substr(0,1),k=x&&x.substr(O-1);x="false"!==(x="true"===x||x)&&x;try{x="{"==S&&"}"==k||"["==S&&"]"==k?JSON.parse(x):x}catch(t){}p[C]=x}else p.attributes[w]=x}}if(d&&!p.components){var T=l.childNodes[0];1===d&&3===T.nodeType?(!p.type&&(p.type="text"),p.content=T.nodeValue):p.components=this.parseNode(l)}if("textnode"==p.type){if(h&&"textnode"==h.type){h.content+=p.content;continue}if(!t.keepEmptyTextNodes){var P=l.nodeValue;if(" "!=P&&!P.trim())continue}}var j=p.components;if(!p.type&&j){for(var E=1,M=0,D=0;D<j.length;D++){var A=j[D],L=A.type;if(["text","textnode"].indexOf(L)<0&&e.textTags.indexOf(A.tagName)<0){E=0;break}"textnode"==L&&(M=1)}E&&M&&(p.type="text")}(p.tagName||"textnode"==p.type)&&r.push(p)}return r},parse:function(t,n){var r=e.em&&e.em.get("Config")||{},i={html:"",css:""},o=document.createElement("div");o.innerHTML=t;var a=o.querySelectorAll("script"),s=a.length;if(!r.allowScripts)for(;s--;)a[s].parentNode.removeChild(a[s]);if(n){for(var l="",c=o.querySelectorAll("style"),u=c.length;u--;)l=c[u].innerHTML+l,c[u].parentNode.removeChild(c[u]);l&&(i.css=n.parse(l))}var h=this.parseNode(o);return 1==h.length&&(h=h[0]),i.html=h,i}}}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n.n(i),a=o.a.Model,s=o.a.View;e.a={types:[],initialize:function(t,e){var n=this;this.model=function(){var t,e,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&i.type){var a=n.getBaseType();t=(r=n.getType(i.type))?r.model:a.model,e=r?r.view:a.view}else{var s=n.recognizeType(i);t=(r=s.type).model,e=r.view,i=s.attributes}var l=new t(i,o);return l.typeView=e,l};var r=this.init&&this.init.bind(this);r&&r()},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),i=this.getBaseType(),o=n?n.model:i.model,l=n?n.view:i.view,c=e.model,u=e.view,h=e.isType;c=c instanceof a||Object(r.isFunction)(c)?c:o.extend(c||{}),u=u instanceof s||Object(r.isFunction)(u)?u:l.extend(u||{}),n?(n.model=c,n.view=u,n.isType=h||n.isType):(e.id=t,e.model=c,e.view=u,e.isType=h||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}}},function(t,e,n){"use strict";var r=n(1),i=n.n(r),o=n(0),a=n(3),s=n(15);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"},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(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];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()},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=[];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=parseInt(t.get("value"),10);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=parseInt(t.get("value"),10),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");e=this.normalizeValue(e),this.current={y:t.pageY,val:e},Object(a.p)(this.doc,"mousemove",this.moveIncrement),Object(a.p)(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.o)(this.doc,"mouseup",this.upIncrement),Object(a.o)(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,e){var n=0,r=e||{},i=this.model,a=Object(o.isUndefined)(t)?"":t,s=i.get("units")||[],l=i.get("unit")||s.length&&s[0]||"",c=i.get("max"),u=i.get("min");if(r.deepCheck){var h=i.get("fixedValues")||[];if(a){var d=new RegExp("^"+h.join("|"),"g");if(h.length&&d.test(a))a=a.match(d)[0],l="",n=1;else{var f=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?"":a;var p=f.replace(a,"");Object(o.indexOf)(s,p)>=0&&(l=p)}}}return Object(o.isUndefined)(c)||""===c||(a=a>c?c:a),Object(o.isUndefined)(u)||""===u||(a=a<u?u:a),{force:n,value:a,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";var r=n(1),i=n.n(r);e.a=i.a.View.extend({itemView:"",itemsView:"",itemType:"type",initialize:function(t,e){this.config=e||{}},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=this.config,r=this.reuseView,i=this.itemsView,o=void 0===i?{}:i,a=e||null,s=this.itemView,l=t.get(this.itemType);o[l]?s=o[l]:l&&!o[l]&&this.itemViewNotFound(l);var c=(t.view&&r?t.view:new s({model:t,config:n},n)).render().el;a?a.appendChild(c):this.$el.append(c)},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this}})},function(t,e,n){"use strict";var r=n(1),i=n.n(r),o=n(0);e.a=i.a.View.extend({initialize:function(t){this.opts=t||{},this.config=t.config||{};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]:{},i=this.config.em,o=t.view,a=t.opt.temporary,s=r.temporary;if(o){o.remove.apply(o);var l=o.childrenView,c=o.scriptContainer;if(l&&l.stopListening(),c&&c.remove(),t.components().forEach((function(t){return n.removeChildren(t,e,r)})),i&&!s){var u=t.getId(),h=i.get("DomComponents");delete h.componentsById[u];var d=i.get("CssComposer").getAll();if(d.remove(d.filter((function(t){return t.getSelectors().getFullString()==="#".concat(u)}))),!a){var f=i.get("Commands"),p=t.get("style-signature"),g={target:t};p&&f.run("core:component-style-clear",g),t.removed(),i.trigger("component:remove",t)}}}},addTo:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];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(5).default);for(var i=this.config,a=e||null,s=this.opts.componentTypes,l=t.get("type"),c=this.compView,u=0;u<s.length;u++)if(s[u].id==l){c=s[u].view;break}var h=new c({model:t,config:i,componentTypes:s}).render().el;if(a)a.appendChild(h);else{var d=this.parentEl,f=d.childNodes;if(Object(o.isUndefined)(r))d.appendChild(h);else{var p=f.length==r;p&&r--,p||!f.length?d.appendChild(h):d.insertBefore(h,f[r])}}return h},resetChildren:function(){var t=this;this.parentEl.innerHTML="",this.collection.each((function(e){return t.addToCollection(e)}))},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,i=n(0),o=n(3),a=n(1),s=n.n(a),l=n(5),c=s.a.$;e.a=s.a.View.extend({events:{"mousedown [data-toggle-move]":"startSort","touchstart [data-toggle-move]":"startSort","click [data-toggle-visible]":"toggleVisibility","click [data-toggle-select]":"handleSelect","mouseover [data-toggle-select]":"handleHover","click [data-toggle-open]":"toggleOpening","dblclick [data-name]":"handleEdit","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,l="".concat(this.clsTitle," ").concat(s),c="".concat(this.clsTitleC," ").concat(n,"one-bg"),u="".concat(this.clsCaret," fa fa-chevron-right"),h="".concat(this.inputNameCls," ").concat(i," ").concat(n,"no-app"),d=this.level+1,f="".concat(30+10*d,"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(c,'">\n <div class="').concat(l,'" style="padding-left: ').concat(f,'" data-toggle-select>\n <div class="').concat(e,'layer-title-inn">\n <i class="').concat(u,'" data-toggle-open></i>\n ').concat(g?'<span class="'.concat(v,'__icon">').concat(g,"</span>"):"",'\n <span class="').concat(h,'" data-name>').concat(p,'</span>\n </div>\n </div>\n </div>\n <div class="').concat(this.clsCount,'">').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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=t,this.level=t.level,this.config=t.config,this.em=t.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=t.sorter||"",this.pfx=this.config.stylePrefix;var e=this.pfx,n=this.ppfx,r=this.model,i=r.get("components"),o=r.get("type")||"default";r.set("open",!1),this.listenTo(i,"remove add reset",this.checkChildren),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:open",this.updateOpening),this.listenTo(r,"change:style:display",this.updateVisibility),this.className="".concat(e,"layer ").concat(e,"layer__t-").concat(o," no-select ").concat(n,"two-color"),this.inputNameCls="".concat(n,"layer-name"),this.clsTitleC="".concat(e,"layer-title-c"),this.clsTitle="".concat(e,"layer-title"),this.clsCaret="".concat(e,"layer-caret"),this.clsCount="".concat(e,"layer-count"),this.clsMove="".concat(e,"layer-move"),this.clsChildren="".concat(e,"layer-children"),this.clsNoChild="".concat(e,"layer-no-chld"),this.clsEdit="".concat(this.inputNameCls,"--edit"),this.clsNoEdit="".concat(this.inputNameCls,"--no-edit"),this.$el.data("model",r),this.$el.data("collection",i),r.viewLayer=this},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="none"==e.getStyle().display?"addClass":"removeClass";this.$el[r](n),this.getVisibilityEl()[r]("fa-eye-slash")},toggleVisibility:function(t){t&&t.stopPropagation();var e=this.model,n=e.getStyle();"none"==n.display?delete n.display:n.display="none",e.setStyle(n)},handleEdit:function(t){t&&t.stopPropagation();var e=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName();o.contentEditable=!0,o.focus(),e&&e.setEditing(1),n.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},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.contentEditable=!1,this.model.set({name:a}),e&&e.setEditing(0),n.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i)},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;e.get("open")?(this.$el.addClass("open"),this.getCaret().addClass("fa-chevron-down"),t[e.cid]=e):(this.$el.removeClass("open"),this.getCaret().removeClass("fa-chevron-down"),delete t[e.cid])},toggleOpening:function(t){t.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(t){t.stopPropagation();var e=this.em,n=this.config;if(e){var r=this.model;e.setSelected(r,{fromLayers:1});var i=n.scrollCanvas;i&&e.get("Canvas").scrollTo(r,i)}},handleHover:function(t){t.stopPropagation();var e=this.em,n=this.config,r=this.model;e&&n.showHover&&e.setHovered(r,{fromLayers:1})},startSort:function(t){t.stopPropagation();var e=this.sorter;t.button&&0!==t.button||e&&e.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){l.default.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover}])},isVisible:function(){var t=this.model.get("style").display;if(!t||"none"!=t)return 1},checkChildren:function(){var t=this.model,e=this.countChildren(t),n=(this.pfx,this.clsNoChild),r=this.$el.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle));this.cnt||(this.cnt=this.$el.children(".".concat(this.clsCount))),e?(r.removeClass(n),this.cnt.html(e)):(r.addClass(n),this.cnt.empty(),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(i.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=Object(o.f)(t,c);e&&(this.stopListening(),this.model=e,this.initialize(this.opt),this.render())},render:function(){var t=this.model,e=this.config,o=this.pfx,a=this.ppfx,s=this.opt.isCountable,l=s&&!s(t,e.hideTextnode),c=this.isVisible(),u=this.$el.empty(),h=this.level+1;Object(i.isUndefined)(r)&&(r=n(82).default);var d=new r({collection:t.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parent:t,level:h}).render().$el;return this.config.showWrapper||1!==h?(u.html(this.template(t)),u.find(".".concat(this.clsChildren)).append(d)):u.append(d),t.get("draggable")&&this.config.sortable||u.children(".".concat(this.clsMove)).remove(),!c&&(this.className+=" ".concat(o,"hide")),l&&(this.className+=" ".concat(a,"hidden")),u.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},function(t,e,n){"use strict";var r=n(2),i=n.n(r),o=n(1),a=n.n(o),s=n(0),l=n(6),c=n.n(l),u=n(15);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}var d=a.a.$;!function(t,e){var n={beforeShow:h,move:h,change:h,show:h,hide:h,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'>▼</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("")}();function l(e,n,r,i){for(var a=[],s=0;s<e.length;s++){var l=e[s];if(l){var c=k(l),u=c.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";u+=k.equals(n,l)?" sp-thumb-active":"";var h=c.toString(i.preferredFormat||"rgb"),d=o?"background-color:"+c.toRgbString():"filter:"+c.toFilter();a.push('<span title="'+h+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+d+';"></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 u(c,u){var h,v,m,y,b=function(e,r){var i=t.extend({},n,e);return i.callbacks={move:f(i.move,r),change:f(i.change,r),show:f(i.show,r),hide:f(i.hide,r),beforeShow:f(i.beforeShow,r)},i}(u,c),w=b.flat,x=b.showSelectionPalette,C=b.localStorageKey,O=b.theme,S=b.callbacks,T=(h=Bt,v=10,function(){var t=this,e=arguments,n=function(){y=null,h.apply(t,e)};m&&clearTimeout(y),!m&&y||(y=setTimeout(n,v))}),P=!1,j=!1,E=0,M=0,D=0,A=0,L=0,N=0,I=0,F=0,R=0,_=0,V=1,z=[],H=[],$={},W=b.selectionPalette.slice(0),B=b.maxSelectionSize,U="sp-dragging",q=null,G=c.ownerDocument,K=(G.body,t(c)),Y=!1,X=t(s,G).addClass(O),J=X.find(".sp-picker-container"),Z=X.find(".sp-color"),Q=X.find(".sp-dragger"),tt=X.find(".sp-hue"),et=X.find(".sp-slider"),nt=X.find(".sp-alpha-inner"),rt=X.find(".sp-alpha"),it=X.find(".sp-alpha-handle"),ot=X.find(".sp-input"),at=X.find(".sp-palette"),st=X.find(".sp-initial"),lt=X.find(".sp-cancel"),ct=X.find(".sp-clear"),ut=X.find(".sp-choose"),ht=X.find(".sp-palette-toggle"),dt=K.is("input"),ft=dt&&"color"===K.attr("type")&&g(),pt=dt&&!w,gt=pt?t(a).addClass(O).addClass(b.className).addClass(b.replacerClassName):t([]),vt=pt?gt:K,mt=gt.find(".sp-preview-inner"),yt=b.color||dt&&K.val(),bt=!1,wt=b.preferredFormat,xt=!b.showButtons||b.clickoutFiresChange,Ct=!yt,Ot=b.allowEmpty&&!ft;function St(){if(b.showPaletteOnly&&(b.showPalette=!0),ht.text(b.showPaletteOnly?b.togglePaletteMoreText:b.togglePaletteLessText),b.palette){z=b.palette.slice(0),H=t.isArray(z[0])?z:[z],$={};for(var e=0;e<H.length;e++)for(var n=0;n<H[e].length;n++){var r=k(H[e][n]).toRgbString();$[r]=!0}}X.toggleClass("sp-flat",w),X.toggleClass("sp-input-disabled",!b.showInput),X.toggleClass("sp-alpha-enabled",b.showAlpha),X.toggleClass("sp-clear-enabled",Ot),X.toggleClass("sp-buttons-disabled",!b.showButtons),X.toggleClass("sp-palette-buttons-disabled",!b.togglePaletteOnly),X.toggleClass("sp-palette-disabled",!b.showPalette),X.toggleClass("sp-palette-only",b.showPaletteOnly),X.toggleClass("sp-initial-disabled",!b.showInitial),X.addClass(b.className).addClass(b.containerClassName),Bt()}function kt(){if(C&&window.localStorage){try{var e=window.localStorage[C].split(",#");e.length>1&&(delete window.localStorage[C],t.each(e,(function(t,e){Tt(e)})))}catch(t){}try{W=window.localStorage[C].split(";")}catch(t){}}}function Tt(e){if(x){var n=k(e).toRgbString();if(!$[n]&&-1===t.inArray(n,W))for(W.push(n);W.length>B;)W.shift();if(C&&window.localStorage)try{window.localStorage[C]=W.join(";")}catch(t){}}}function Pt(){var e=Vt(),n=t.map(H,(function(t,n){return l(t,e,"sp-palette-row sp-palette-row-"+n,b)}));kt(),W&&n.push(l(function(){var t=[];if(b.showPalette)for(var e=0;e<W.length;e++){var n=k(W[e]).toRgbString();$[n]||t.push(W[e])}return t.reverse().slice(0,b.maxSelectionSize)}(),e,"sp-palette-row sp-palette-row-selection",b)),at.html(n.join(""))}function jt(){if(b.showInitial){var t=bt,e=Vt();st.html(l([t,e],e,"sp-palette-row-initial",b))}}function Et(){(M<=0||E<=0||A<=0)&&Bt(),j=!0,X.addClass(U),q=null,K.trigger("dragstart.spectrum",[Vt()])}function Mt(){j=!1,X.removeClass(U),K.trigger("dragstop.spectrum",[Vt()])}function Dt(){var t=ot.val();if(null!==t&&""!==t||!Ot){var e=k(t);e.isValid()?(_t(e),Wt(!0)):ot.addClass("sp-validation-error")}else _t(null),Wt(!0)}function At(){P?Ft():Lt()}function Lt(){var e=t.Event("beforeShow.spectrum");if(P)Bt();else if(K.trigger(e,[Vt()]),!1!==S.beforeShow(Vt())&&!e.isDefaultPrevented()){!function(){for(var t=0;t<r.length;t++)r[t]&&r[t].hide()}(),P=!0;var n=t(G);n.bind("keydown.spectrum",Nt),n.bind("click.spectrum",It),t(window).bind("resize.spectrum",T),gt.addClass("sp-active"),X.removeClass("sp-hidden"),Bt(),Ht(),bt=Vt(),jt(),S.show(bt),K.trigger("show.spectrum",[bt])}}function Nt(t){27===t.keyCode&&Ft()}function It(t){2!=t.button&&(j||(xt?Wt(!0):Rt(),Ft()))}function Ft(){P&&!w&&(P=!1,t(G).unbind("keydown.spectrum",Nt),t(G).unbind("click.spectrum",It),t(window).unbind("resize.spectrum",T),gt.removeClass("sp-active"),X.addClass("sp-hidden"),S.hide(Vt()),K.trigger("hide.spectrum",[Vt()]))}function Rt(){_t(bt,!0)}function _t(t,e){var n,r;k.equals(t,Vt())?Ht():(!t&&Ot?Ct=!0:(Ct=!1,r=(n=k(t)).toHsv(),F=r.h%360/360,R=r.s,_=r.v,V=r.a),Ht(),n&&n.isValid()&&!e&&(wt=b.preferredFormat||n.getFormat()))}function Vt(t){return t=t||{},Ot&&Ct?null:k.fromRatio({h:F,s:R,v:_,a:Math.round(100*V)/100},{format:t.format||wt})}function zt(){Ht(),S.move(Vt()),K.trigger("move.spectrum",[Vt()])}function Ht(){ot.removeClass("sp-validation-error"),$t();var t=k.fromRatio({h:F,s:1,v:1});Z.css("background-color",t.toHexString());var e=wt;V<1&&(0!==V||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var n=Vt({format:e}),r="";if(mt.removeClass("sp-clear-display"),mt.css("background-color","transparent"),!n&&Ot)mt.addClass("sp-clear-display");else{var a=n.toHexString(),s=n.toRgbString();if(o||1===n.alpha?mt.css("background-color",s):(mt.css("background-color","transparent"),mt.css("filter",n.toFilter())),b.showAlpha){var l=n.toRgb();l.a=0;var c=k(l).toRgbString(),u="linear-gradient(left, "+c+", "+a+")";i?nt.css("filter",k(c).toFilter({gradientType:1},a)):(nt.css("background","-webkit-"+u),nt.css("background","-moz-"+u),nt.css("background","-ms-"+u),nt.css("background","linear-gradient(to right, "+c+", "+a+")"))}r=n.toString(e)}b.showInput&&ot.val(r),b.showPalette&&Pt(),jt()}function $t(){var t=R,e=_;if(Ot&&Ct)it.hide(),et.hide(),Q.hide();else{it.show(),et.show(),Q.show();var n=t*E,r=M-e*M;n=Math.max(-D,Math.min(E-D,n-D)),r=Math.max(-D,Math.min(M-D,r-D)),Q.css({top:r+"px",left:n+"px"});var i=V*L;it.css({left:i-N/2+"px"});var o=F*A;et.css({top:o-I+"px"})}}function Wt(t){var e=Vt(),n="",r=!k.equals(e,bt);e&&(n=e.toString(wt),Tt(e)),dt&&K.val(n),t&&r&&(S.change(e),K.trigger("change",[e]))}function Bt(){P&&(E=Z.width(),M=Z.height(),D=Q.height(),tt.width(),A=tt.height(),I=et.height(),L=rt.width(),N=it.width(),w||(X.css("position","absolute"),b.offset?X.offset(b.offset):X.offset(function(e,n){var r=e.outerWidth(),i=e.outerHeight(),o=n.outerHeight(),a=e[0].ownerDocument,s=a.documentElement,l=s.clientWidth,c=s.clientHeight,u=t(a).scrollLeft(),h=t(a).scrollTop(),d=l+u,f=c+h,p=n.offset();return p.top+=o,p.left-=Math.min(p.left,p.left+r>d&&d>r?Math.abs(p.left+r-d):0),p.top-=Math.min(p.top,p.top+i>f&&f>i?Math.abs(i+o-0):0),p}(X,vt))),$t(),b.showPalette&&Pt(),K.trigger("reflow.spectrum"))}function Ut(){Ft(),Y=!0,K.attr("disabled",!0),vt.addClass("sp-disabled")}!function(){if(i&&X.find("*:not(input)").attr("unselectable","on"),St(),pt&&K.after(gt).hide(),Ot||ct.hide(),w)K.after(X).hide();else{var e="parent"===b.appendTo?K.parent():t(b.appendTo);1!==e.length&&(e=t("body")),e.append(X)}function n(e){return e.data&&e.data.ignore?(_t(t(e.target).closest(".sp-thumb-el").data("color")),zt()):(_t(t(e.target).closest(".sp-thumb-el").data("color")),zt(),Wt(!0),b.hideAfterPaletteSelect&&Ft()),!1}kt(),vt.bind("click.spectrum touchstart.spectrum",(function(e){Y||At(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()})),(K.is(":disabled")||!0===b.disabled)&&Ut(),X.click(d),ot.change(Dt),ot.bind("paste",(function(){setTimeout(Dt,1)})),ot.keydown((function(t){13==t.keyCode&&Dt()})),lt.text(b.cancelText),lt.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),Rt(),Ft()})),ct.attr("title",b.clearText),ct.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),Ct=!0,zt(),w&&Wt(!0)})),ut.text(b.chooseText),ut.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),i&&ot.is(":focus")&&ot.trigger("change"),ot.hasClass("sp-validation-error")||(Wt(!0),Ft())})),ht.text(b.showPaletteOnly?b.togglePaletteMoreText:b.togglePaletteLessText),ht.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),b.showPaletteOnly=!b.showPaletteOnly,b.showPaletteOnly||w||X.css("left","-="+(J.outerWidth(!0)+5)),St()})),p(rt,(function(t,e,n){V=t/L,Ct=!1,n.shiftKey&&(V=Math.round(10*V)/10),zt()}),Et,Mt),p(tt,(function(t,e){F=parseFloat(e/A),Ct=!1,b.showAlpha||(V=1),zt()}),Et,Mt),p(Z,(function(t,e,n){if(n.shiftKey){if(!q){var r=R*E,i=M-_*M,o=Math.abs(t-r)>Math.abs(e-i);q=o?"x":"y"}}else q=null;var a=!q||"y"===q;(!q||"x"===q)&&(R=parseFloat(t/E)),a&&(_=parseFloat((M-e)/M)),Ct=!1,b.showAlpha||(V=1),zt()}),Et,Mt),yt?(_t(yt),Ht(),wt=b.preferredFormat||k(yt).format,Tt(yt)):Ht(),w&&Lt();var r=i?"mousedown.spectrum":"click.spectrum touchstart.spectrum";at.delegate(".sp-thumb-el",r,n),st.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},n)}();var qt={show:Lt,hide:Ft,toggle:At,reflow:Bt,option:function(n,r){return n===e?t.extend({},b):r===e?b[n]:(b[n]=r,"preferredFormat"===n&&(wt=b.preferredFormat),void St())},enable:function(){Y=!1,K.attr("disabled",!1),vt.removeClass("sp-disabled")},disable:Ut,offset:function(t){b.offset=t,Bt()},set:function(t){_t(t),Wt()},get:Vt,destroy:function(){K.show(),vt.unbind("click.spectrum touchstart.spectrum"),X.remove(),gt.remove(),r[qt.id]=null},container:X};return qt.id=r.push(qt)-1,qt}function h(){}function d(t){t.stopPropagation()}function f(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function p(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,l={},c=0,u=0,h="ontouchstart"in window,d={};function f(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,d=r&&r.pageY||t.pageY,p=Math.max(0,Math.min(o-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));h&&f(t),n.apply(e,[p,v,t])}}function g(){s&&(t(a).unbind(d),t(a.body).removeClass("sp-dragging"),setTimeout((function(){o.apply(e,arguments)}),0)),s=!1}d.selectstart=f,d.dragstart=f,d["touchmove mousemove"]=p,d["touchend mouseup"]=g,t(e).bind("touchstart mousedown",(function(n){(n.which?3==n.which:2==n.button)||s||!1!==r.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(d),t(a.body).addClass("sp-dragging"),p(n),f(n))}))}function g(){return t.fn.spectrum.inputTypeColorSupport()}var v="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(v)];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(v)):a.apply(n,o)}})),i}return this.spectrum("destroy").each((function(){var n=u(this,t.extend({},e,t(this).data()));t(this).data(v,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=p,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&&!g()&&e.spectrum({preferredFormat:"hex6"})};var m=/^[\s,#]+/,y=/\s+$/,b=0,w=Math,x=w.round,C=w.min,O=w.max,S=w.random,k=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(m,"").replace(y,"").toLowerCase();var e,n=!1;if(W[t])t=W[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=tt.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=tt.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=tt.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=tt.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=tt.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=tt.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=tt.hex8.exec(t))return{a:(r=e[1],K(r)/255),r:K(e[2]),g:K(e[3]),b:K(e[4]),format:n?"name":"hex8"};var r;if(e=tt.hex6.exec(t))return{r:K(e[1]),g:K(e[2]),b:K(e[3]),format:n?"name":"hex"};if(e=tt.hex3.exec(t))return{r:K(e[1]+""+e[1]),g:K(e[2]+""+e[2]),b:K(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==c()(t)&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(o=t.r,a=t.g,s=t.b,e={r:255*q(o,255),g:255*q(a,255),b:255*q(s,255)},r=!0,i="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=X(t.s),t.v=X(t.v),e=function(t,e,n){t=6*q(t,360),e=q(e,100),n=q(n,100);var r=w.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6;return{r:255*[n,a,o,o,s,n][l],g:255*[s,n,n,a,o,o][l],b:255*[o,o,s,n,n,a][l]}}(t.h,t.s,t.v),r=!0,i="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=X(t.s),t.l=X(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<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=q(t,360),e=q(e,100),n=q(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,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=U(n),{ok:r,format:t.format||i,r:C(255,O(e.r,0)),g:C(255,O(e.g,0)),b:C(255,O(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=x(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=x(this._r)),this._g<1&&(this._g=x(this._g)),this._b<1&&(this._b=x(this._b)),this._ok=r.ok,this._tc_id=b++};function T(t,e,n){t=q(t,255),e=q(e,255),n=q(n,255);var r,i,o=O(t,e,n),a=C(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:s}}function P(t,e,n){t=q(t,255),e=q(e,255),n=q(n,255);var r,i,o=O(t,e,n),a=C(t,e,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:s}}function j(t,e,n,r){var i=[Y(x(t).toString(16)),Y(x(e).toString(16)),Y(x(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 E(t,e,n,r){var i;return[Y((i=r,Math.round(255*parseFloat(i)).toString(16))),Y(x(t).toString(16)),Y(x(e).toString(16)),Y(x(n).toString(16))].join("")}function M(t,e){e=0===e?0:e||10;var n=k(t).toHsl();return n.s-=e/100,n.s=G(n.s),k(n)}function D(t,e){e=0===e?0:e||10;var n=k(t).toHsl();return n.s+=e/100,n.s=G(n.s),k(n)}function A(t){return k(t).desaturate(100)}function L(t,e){e=0===e?0:e||10;var n=k(t).toHsl();return n.l+=e/100,n.l=G(n.l),k(n)}function N(t,e){e=0===e?0:e||10;var n=k(t).toRgb();return n.r=O(0,C(255,n.r-x(-e/100*255))),n.g=O(0,C(255,n.g-x(-e/100*255))),n.b=O(0,C(255,n.b-x(-e/100*255))),k(n)}function I(t,e){e=0===e?0:e||10;var n=k(t).toHsl();return n.l-=e/100,n.l=G(n.l),k(n)}function F(t,e){var n=k(t).toHsl(),r=(x(n.h)+e)%360;return n.h=r<0?360+r:r,k(n)}function R(t){var e=k(t).toHsl();return e.h=(e.h+180)%360,k(e)}function _(t){var e=k(t).toHsl(),n=e.h;return[k(t),k({h:(n+120)%360,s:e.s,l:e.l}),k({h:(n+240)%360,s:e.s,l:e.l})]}function V(t){var e=k(t).toHsl(),n=e.h;return[k(t),k({h:(n+90)%360,s:e.s,l:e.l}),k({h:(n+180)%360,s:e.s,l:e.l}),k({h:(n+270)%360,s:e.s,l:e.l})]}function z(t){var e=k(t).toHsl(),n=e.h;return[k(t),k({h:(n+72)%360,s:e.s,l:e.l}),k({h:(n+216)%360,s:e.s,l:e.l})]}function H(t,e,n){e=e||6,n=n||30;var r=k(t).toHsl(),i=360/n,o=[k(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(k(r));return o}function $(t,e){e=e||6;for(var n=k(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(k({h:r,s:i,v:o})),o=(o+s)%1;return a}k.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=U(t),this._roundA=x(100*this._a)/100,this},toHsv:function(){var t=P(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=P(this._r,this._g,this._b),e=x(360*t.h),n=x(100*t.s),r=x(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=T(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=T(this._r,this._g,this._b),e=x(360*t.h),n=x(100*t.s),r=x(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return j(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return E(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:x(this._r),g:x(this._g),b:x(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+x(this._r)+", "+x(this._g)+", "+x(this._b)+")":"rgba("+x(this._r)+", "+x(this._g)+", "+x(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:x(100*q(this._r,255))+"%",g:x(100*q(this._g,255))+"%",b:x(100*q(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+x(100*q(this._r,255))+"%, "+x(100*q(this._g,255))+"%, "+x(100*q(this._b,255))+"%)":"rgba("+x(100*q(this._r,255))+"%, "+x(100*q(this._g,255))+"%, "+x(100*q(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(B[j(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+E(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";t&&(n=k(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(L,arguments)},brighten:function(){return this._applyModification(N,arguments)},darken:function(){return this._applyModification(I,arguments)},desaturate:function(){return this._applyModification(M,arguments)},saturate:function(){return this._applyModification(D,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(F,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(H,arguments)},complement:function(){return this._applyCombination(R,arguments)},monochromatic:function(){return this._applyCombination($,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(V,arguments)}},k.fromRatio=function(t,e){if("object"==c()(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:X(t[r]));t=n}return k(t,e)},k.equals=function(t,e){return!(!t||!e)&&k(t).toRgbString()==k(e).toRgbString()},k.random=function(){return k.fromRatio({r:S(),g:S(),b:S()})},k.mix=function(t,e,n){n=0===n?0:n||50;var r,i=k(t).toRgb(),o=k(e).toRgb(),a=n/100,s=2*a-1,l=o.a-i.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*a+i.a*(1-a)};return k(u)},k.readability=function(t,e){var n=k(t),r=k(e),i=n.toRgb(),o=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=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:l}},k.isReadable=function(t,e){var n=k.readability(t,e);return n.brightness>125&&n.color>500},k.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o<e.length;o++){var a=k.readability(t,e[o]),s=a.brightness>125&&a.color>500,l=a.brightness/125*3+a.color/500;(s&&!i||s&&i&&l>r||!s&&!i&&l>r)&&(i=s,r=l,n=k(e[o]))}return n};var W=k.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"},B=k.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(W);function U(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function q(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=C(e,O(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),w.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function G(t){return C(1,O(0,t))}function K(t){return parseInt(t,16)}function Y(t){return 1==t.length?"0"+t:""+t}function X(t){return t<=1&&(t=100*t+"%"),t}var J,Z,Q,tt=(Z="[\\s|\\(]+("+(J="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",Q="[\\s|\\(]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",{rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+Q),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=k,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}(d);e.a=u.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")},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=n.get("defaults"),i=Object(s.isUndefined)(t)?Object(s.isUndefined)(r)?"":r:t,o=this.getInputEl(),a=this.getColorEl(),l="none"!=i?i:"";o.value=i,a.get(0).style.backgroundColor=l,e.fromTarget&&(a.spectrum("set",l),this.noneColor="none"==i)},getColorEl:function(){if(!this.colorEl){var t,e=this,n=this.ppfx,r=this.model,o=d('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),a=o.get(0).style,s=this.em&&this.em.config?this.em.config.el:"",l=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},c=function(t){return(1==t.getAlpha()?t.toHexString():t.toRgbString()).replace(/ /g,"")},u=0;this.$el.find("[data-colorp-c]").append(o),o.spectrum(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({containerClassName:"".concat(n,"one-bg ").concat(n,"two-color"),appendTo:s||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},l,{move:function(t){var e=c(t);a.backgroundColor=e,r.setValueFromInput(e,0)},change:function(t){u=1;var n=c(t);a.backgroundColor=n,r.setValueFromInput(n),e.noneColor=0},show:function(e){u=0,t=c(e)},hide:function(n){!u&&t&&(e.noneColor&&(t=""),a.backgroundColor=t,o.spectrum("set",t),r.setValueFromInput(t,0))}})),this.colorEl=o}return this.colorEl},render:function(){return u.a.prototype.render.call(this),this.getColorEl(),this}})},function(t,e,n){!function(e){var n,r={},i={16:!1,18:!1,17:!1,91:!1},o="all",a={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},s={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},l=function(t){return s[t]||t.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)s["f"+n]=111+n;function u(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function h(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 d={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function f(t){for(n in i)i[n]=t[d[n]]}function p(t,e,n){var i,o;i=v(t),void 0===n&&(n=e,e="all");for(var a=0;a<i.length;a++)o=[],(t=i[a].split("+")).length>1&&(o=m(t),t=[t[t.length-1]]),t=t[0],(t=l(t))in r||(r[t]=[]),r[t].push({shortcut:i[a],scope:e,method:n,key:i[a],mods:o})}for(n in a)p[n]=!1;function g(){return o||"all"}function v(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function m(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=a[e[n]];return e}function y(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,(function(){n(window.event)}))}y(document,"keydown",(function(t){!function(t){var e,n,o,s,l,h;if(e=t.keyCode,-1==u(c,e)&&c.push(e),93!=e&&224!=e||(e=91),e in i)for(o in i[e]=!0,a)a[o]==e&&(p[o]=!0);else if(f(t),p.filter.call(this,t)&&e in r)for(h=g(),s=0;s<r[e].length;s++)if((n=r[e][s]).scope==h||"all"==n.scope){for(o in l=n.mods.length>0,i)(!i[o]&&u(n.mods,+o)>-1||i[o]&&-1==u(n.mods,+o))&&(l=!1);(0!=n.mods.length||i[16]||i[18]||i[17]||i[91])&&!l||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),y(document,"keyup",(function(t){var e,n=t.keyCode,r=u(c,n);if(r>=0&&c.splice(r,1),93!=n&&224!=n||(n=91),n in i)for(e in i[n]=!1,a)a[e]==n&&(p[e]=!1)})),y(window,"focus",(function(){for(n in i)i[n]=!1;for(n in a)p[n]=!1}));var b=e.key;e.key=p,e.key.setScope=function(t){o=t||"all"},e.key.getScope=g,e.key.deleteScope=function(t){var e,n,i;for(e in r)for(n=r[e],i=0;i<n.length;)n[i].scope===t?n.splice(i,1):i++},e.key.filter=function(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)},e.key.isPressed=function(t){return"string"==typeof t&&(t=l(t)),-1!=u(c,t)},e.key.getPressedKeyCodes=function(){return c.slice(0)},e.key.noConflict=function(){var t=e.key;return e.key=b,t},e.key.unbind=function(t,e){var n,i,o,a,s,c=[];for(n=v(t),a=0;a<n.length;a++){if((i=n[a].split("+")).length>1&&(c=m(i),t=i[i.length-1]),t=l(t),void 0===e&&(e=g()),!r[t])return;for(o=0;o<r[t].length;o++)(s=r[t][o]).scope===e&&h(s.mods,c)&&(r[t][o]={})}},t.exports=p}(this)},function(t,e,n){"use strict";(function(t){var r=n(64),i=setTimeout;function o(t){return Boolean(t&&void 0!==t.length)}function a(){}function s(t){if(!(this instanceof s))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=[],f(t,this)}function l(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,s._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 u(e.promise,t)}c(e.promise,r)}else(1===t._state?c:u)(e.promise,t._value)}))):t._deferreds.push(e)}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof s)return t._state=3,t._value=e,void h(t);if("function"==typeof n)return void f((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,h(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,h(t)}function h(t){2===t._state&&0===t._deferreds.length&&s._immediateFn((function(){t._handled||s._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)l(t,t._deferreds[e]);t._deferreds=null}function d(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,c(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}s.prototype.catch=function(t){return this.then(null,t)},s.prototype.then=function(t,e){var n=new this.constructor(a);return l(this,new d(t,e,n)),n},s.prototype.finally=r.a,s.all=function(t){return new s((function(e,n){if(!o(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var i=r.length;function a(t,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var s=o.then;if("function"==typeof s)return void s.call(o,(function(e){a(t,e)}),n)}r[t]=o,0==--i&&e(r)}catch(t){n(t)}}for(var s=0;s<r.length;s++)a(s,r[s])}))},s.resolve=function(t){return t&&"object"==typeof t&&t.constructor===s?t:new s((function(e){e(t)}))},s.reject=function(t){return new s((function(e,n){n(t)}))},s.race=function(t){return new s((function(e,n){if(!o(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,i=t.length;r<i;r++)s.resolve(t[r]).then(e,n)}))},s._immediateFn="function"==typeof t&&function(e){t(e)}||function(t){i(t,0)},s._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},e.a=s}).call(this,n(69).setImmediate)},function(t,e,n){"use strict";n.r(e);var r=n(1),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(35).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,{silent:1}),t.trigger("updateActive",{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,n){!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,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},h=n.mediaValueKeywords||{},d=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},p=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},m=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent;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=O(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)$/.test(t.current().toLowerCase())&&(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 O(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=O(")"),x(null,"(")}function k(t,e,n){this.type=t,this.indent=e,this.prev=n}function T(t,e,n,r){return t.context=new k(n,e.indentation()+(!1===r?0:a),t.context),n}function P(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function j(t,e,n){return D[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 j(t,e,n)}function M(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var D={top:function(t,e,n){if("{"==t)return T(n,e,"block");if("}"==t&&n.context.prev)return P(n);if(w&&/@component/i.test(t))return T(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return T(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return T(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 T(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 T(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return T(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return d.hasOwnProperty(r)?(o="property","maybeprop"):f.hasOwnProperty(r)?(o="string-2","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?D.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?T(n,e,"prop"):j(t,e,n)},prop:function(t,e,n){if(";"==t)return P(n);if("{"==t&&y)return T(n,e,"propBlock");if("}"==t||"{"==t)return E(t,e,n);if("("==t)return T(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)M(e);else if("interpolation"==t)return T(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?P(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?E(t,e,n):")"==t?P(n):"("==t?T(n,e,"parens"):"interpolation"==t?T(n,e,"interpolation"):("word"==t&&M(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):j(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):D.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return T(n,e,"atBlock_parens");if("}"==t||";"==t)return E(t,e,n);if("{"==t)return P(n)&&T(n,e,y?"block":"top");if("interpolation"==t)return T(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":h.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"string-2":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?P(n)&&T(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?P(n):"{"==t||"}"==t?E(t,e,n,2):D.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?T(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):j(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,P(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?T(n,e,"top"):j(t,e,n)},at:function(t,e,n){return";"==t?P(n):"{"==t||"}"==t?E(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?P(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 k(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=D[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"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","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","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","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-weight","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","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","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","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","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","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","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"],h=e(u),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=e(d),p=e(["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","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","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","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","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","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","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","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","copy","counter","counters","cover","crop","cross","crosshair","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","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","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","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","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","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","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","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","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","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","sub","subpixel-antialiased","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","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","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(l).concat(u).concat(d).concat(v).concat(y);function x(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:c,propertyKeywords:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=x,x(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=x,x(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:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=x,x(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:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=x,x(t,e))}},name:"css",helperType:"gss"})}(n(10))},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(3),o=n(17);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.e)(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.p,off:i.o},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(8),i=n.n(r),o=n(0);e.default={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.component||t.getSelectedAll();return r=Object(o.isArray)(r)?i()(r):[r],t.select(null),r.forEach((function(t){if(t&&t.get("removable")){if(t){var e=t.collection;t.trigger("component:destroy"),e&&e.remove(t)}}else console.warn("The element is not removable",t)})),r}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a=n(17);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 l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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,c=r.mode,u=r.dragger,h=void 0===u?{}:u,d=i.getEl(),f=l({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"==c,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic(),window.guidesTarget=this.guidesTarget;var p=this.dragger;return p?p.setOptions(f):(p=new a.a(f),this.dragger=p),s&&p.start(s),this.toggleDrag(1),p},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,o=n.getConfig("stylePrefix"),a=document.createElement("div"),s=document.createElement("div"),l='<div class="'.concat(o,"guide-info__line ").concat(o,'danger-bg">\n <div class="').concat(o,"guide-info__content ").concat(o,'danger-color"></div>\n </div>');(e=document.createElement("div")).className="".concat(o,"guides"),a.className="".concat(o,"guide-info ").concat(o,"guide-info__x"),s.className="".concat(o,"guide-info ").concat(o,"guide-info__y"),a.innerHTML=l,s.innerHTML=l,e.appendChild(a),e.appendChild(s),n.Canvas.getToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=a,this.elGuideInfoY=s,this.elGuideInfoContentX=a.querySelector(".".concat(o,"guide-info__content")),this.elGuideInfoContentY=s.querySelector(".".concat(o,"guide-info__content")),r.on("canvas:update",(function(){t.updateGuides(),i.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}))}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){(t||this.guides).forEach((function(t){var e=t.origin,n=editor.Canvas.getElementPos(e),r=n.top,i=n.height,o=n.left,a=n.width;switch(t.type){case"t":return t.y=r;case"b":return t.y=r+i;case"l":return t.x=o;case"r":return t.x=o+a;case"x":return t.x=o+a/2;case"y":return t.y=r+i/2}}))},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=this.editor.Canvas,r=n.getRect(),i=r.topScroll,o=r.top,a=n.getCanvasView().getFrameOffset().top,s="px",l=t.active?2:1,c=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?"green":"red",";"),e.children.length||((c=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",e.appendChild(c)),t.y?(e.style.width="100%",e.style.height="".concat(l).concat(s),e.style.top="".concat(t.y).concat(s),e.style.left=0):(e.style.width="".concat(l).concat(s),e.style.height="100%",e.style.left="".concat(t.x).concat(s),e.style.top="".concat(i-a+o).concat(s)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementGuides:function(t){var e=this,n=this.editor,r=this.opts,i=n.Canvas.getElementPos(t),o=i.top,a=i.height,s=i.left,c=i.width,u=[{type:"t",y:o},{type:"b",y:o+a},{type:"l",x:s},{type:"r",x:s+c},{type:"x",x:s+c/2},{type:"y",y:o+a/2}].map((function(i){return l({},i,{origin:t,originRect:n.Canvas.getElementPos(t),guide:r.debug&&e.renderGuide(i)})}));return u.forEach((function(t){return e.guides.push(t)})),u},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),s=parseFloat(i)),{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,l=this.target,c=this.isTran,u=r?"":1,h="".concat(e).concat("px"),d="".concat(n).concat("px");if(c){var f=l.getStyle().transform||"";return f=this.setTranslate(f,"x",h),f=this.setTranslate(f,"y",d),l.addStyle({transform:f,en:u},{avoidStore:!r})}var p={position:i,width:a,height:s},g={left:h,top:d,en:u};Object(o.keys)(p).forEach((function(t){var e=p[t];e&&(g[t]=e)})),l.addStyle(g,{avoidStore:!r})},onStart:function(){var t=this.target,e=this.editor,n=this.isTran,r=this.opts.center,i=e.Canvas,o=t.getStyle();if(!n&&"absolute"!==o.position){var a=i.offset(t.getEl()),s=a.left,l=a.top,c=a.width,u=a.height;if(r){var h=i.getMouseRelativeCanvas(event);s=h.x,l=h.y}this.setPosition({x:s,y:l,width:"".concat(c,"px"),height:"".concat(u,"px"),position:"absolute"})}},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.apply(void 0,arguments)},onEnd:function(){var t=this.editor,e=this.opts,n=this.id,r=e.onEnd;r&&r.apply(void 0,arguments),t.stopCommand(n),this.hideGuidesInfo()},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,r=this.editor;this.hideGuidesInfo(),e.forEach((function(e){var i=e.origin,a=e.x,s=r.Canvas.getElementPos(i),l=Object(o.isUndefined)(a)?"y":"x",c="y"===l,u=s[c?"left":"top"],h=s.rect[c?"left":"top"],d=c?u+s.width:u+s.height,f=c?h+s.rect.width:h+s.rect.height,p=t["elGuideInfo".concat(l.toUpperCase())],g=t["elGuideInfoContent".concat(l.toUpperCase())],v=p.style,m=n.filter((function(t){return t[l]===e[l]})).map((function(t){var e=t.originRect,n=e.left,r=e.width,i=e.top,o=e.height,a=c?n+r:i+o;return{gap:a<u?u-a:(c?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(m){var y=m.originRect,b=y.left,w=y.width,x=y.top,C=y.height,O=y.rect,S=c?b<s.left:x<s.top,k=c?b:x,T=c?O.left:O.top,P=c?b+w:x+C,j=c?O.left+O.width:O.top+O.height,E="".concat(c?e.y:e.x,"px"),M=S?u-P:k-d,D=S?h-j:T-f;v.display="",v[c?"top":"left"]=E,v[c?"left":"top"]="".concat(S?P:d,"px"),v[c?"width":"height"]="".concat(M,"px"),g.innerHTML="".concat(Math.round(D),"px")}}))},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.at(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.collection,r=n.indexOf(t),i=n.at(r+1);e.push(i||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.collection,r=n.indexOf(t),i=n.at(r-1);e.push(i&&r-1>=0?i: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=t.DomComponents,a=i.get("type"),s=o.getWrapper().find('[data-gjs-type="'.concat(a,'"]')).length,l=[];if(!s){var c=t.CssComposer.getAll(),u=i.get("style-signature");u=Object(r.isArray)(u)?u:[u],c.forEach((function(t){var e=t.selectorsToString();u.forEach((function(n){n&&e.indexOf(n)>=0&&l.push(t)}))})),c.remove(l)}return l}}},function(t,e,n){"use strict";n.r(e);var r=n(8),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(1),o=n.n(i),a=n(12),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(1),i=n.n(r).a.$;e.default={run:function(t,e){var n=this;arguments.length>2&&void 0!==arguments[2]&&arguments[2];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"),l=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=s.el,this.cssEditor=l.el;var c=i('<div class="'.concat(a,'export-dl"></div>'));c.append(s.$el).append(l.$el),this.$editors=c}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){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(1),o=n.n(i),a=n(3),s=n(12),l=n(24),c=o.a.$;e.default=Object(r.extend)({},l.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=c(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.p)(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.p)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(t){this.cacheEl=null;var e=t[t.length-1],n=this.frameEl.contentDocument;this.startSelectPosition(e.view.el,n),this.sorter.draggable=e.get("draggable"),this.sorter.toMove=t,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),Object(a.p)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){Object(a.o)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),Object(a.o)(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=c(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=c(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),e.default={run:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.Modal,o=t.AssetManager,a=o.getConfig(),s=o.getContainer(),l=r.modalTitle||a.modalTitle||"",c=r.types,u=r.accept;if(o.setTarget(r.target),o.onClick(r.onClick),o.onDblClick(r.onDblClick),o.onSelect(r.onSelect),!this.rendered||c){var h=o.getAll().filter((function(t){return 1}));c&&c.length&&(h=h.filter((function(t){return-1!==c.indexOf(t.get("type"))}))),o.render(h),this.rendered=1}if(u){var d=s.querySelector("input#".concat(a.stylePrefix,"uploadFile"));d&&d.setAttribute("accept",u)}return i.open({title:l,content:s}).getModel().once("change:open",(function(){return t.stopCommand(n.id)})),this},stop:function(t){return t.Modal.close(),this}}},function(t,e,n){"use strict";n.r(e),e.default={run:function(t,e){var n=t.BlockManager,r=t.Panels;if(!this.blocks){n.render();var i="views-container",o=document.createElement("div"),a=r.getPanel(i)||r.addPanel({id:i});o.appendChild(n.getContainer()),a.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var t=this.blocks;t&&(t.style.display="none")}}},function(t,e,n){"use strict";n.r(e);var r=n(1);n.n(r).a.$;e.default={run:function(t){var e=t.LayerManager,n=t.Panels;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(1),i=n.n(r).a.$;e.default={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels;this.$cn=i("<div></div>"),this.$cn2=i("<div></div>"),this.$cn.append(this.$cn2);var o=t.DeviceManager;if(o&&n.showDevices)r.addPanel({id:"devices-c"}).set("appendContent",o.render()).trigger("change:appendContent");var a=t.SelectorManager;a&&this.$cn2.append(a.render([])),this.$cn2.append(t.StyleManager.render());var s=t.StyleManager.getConfig(),l=s.stylePrefix;this.$header=i('<div class="'.concat(l,'header">').concat(s.textNoElement,"</div>")),this.$cn.append(this.$header),r.getPanel("views-container")?this.panel=r.getPanel("views-container"):this.panel=r.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=t.editor,this.listenTo(this.target,"component:toggled",this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.target,e=this.sender;e&&e.get&&!e.get("active")||(1===t.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(1),i=n.n(r).a.$;e.default={run:function(t,e){this.sender=e;var n=t.Config.stylePrefix,r=t.TraitManager;if(!this.$cn){var o=r.getTraitsViewer(),a=r.getConfig();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(a.textNoElement,"</div>")),this.$cn.append(this.$header),this.$cn2.append('<div class="'.concat(n,'traits-label">').concat(a.labelContainer,"</div>")),this.$cn2.append(o.render().el);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,o=n.collection,a=o.indexOf(n)+1,s=e.filter((function(t){return t.get("copyable")}));i=Object(r.contains)(e,n)&&n.get("copyable")?o.add(n.clone(),{at:a}):o.add(s.map((function(t){return t.clone()})),{at:a}),(i=Object(r.isArray)(i)?i:[i]).forEach((function(e){return t.trigger("component:paste",e)}))}})),n.emitUpdate())}}},function(t,e,n){"use strict";n.r(e);var r=n(0);e.default={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanelsEl()),this.panels},tglPointers:function(t,e){var n=t.Canvas.getBody().querySelectorAll(".".concat(this.ppfx,"no-pointer"));Object(r.each)(n,(function(t){return t.style.pointerEvents=e?"":"all"}))},run:function(t,e){var n=this;this.sender=e,t.stopCommand("sw-visibility"),t.getModel().stopDefault();var r=this.getPanels(t),i=t.Canvas.getElement(),o=t.getEl(),a=t.Config.stylePrefix;if(!this.helper){var s=document.createElement("span");s.className="".concat(a,"off-prv fa fa-eye-slash"),o.appendChild(s),s.onclick=function(){return n.stopCommand()},this.helper=s}this.helper.style.display="inline-block",this.tglPointers(t),r.style.display="none";var l=i.style;l.width="100%",l.height="100%",l.top="0",l.left="0",l.padding="0",l.margin="0",t.refresh()},stop:function(t){var e=this.sender,n=void 0===e?{}:e;n.set&&n.set("active",0);var r=this.getPanels(t);t.runCommand("sw-visibility"),t.getModel().runDefault(),r.style.display="",t.Canvas.getElement().setAttribute("style",""),this.helper&&(this.helper.style.display="none"),t.refresh(),this.tglPointers(t,1)}}},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||{},l=o.getCanvasView();return s.appendTo=o.getResizerEl(),s.prefix=t.getConfig().stylePrefix,s.posFetcher=l.getElementPos.bind(l),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(1),i=n.n(r),o=n(3),a=i.a.$;e.default={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var r=n||{},i=r.state||"",s=t.getConfig(),l=this.em.getZoomDecimal(),c=r.el||"";if(!s.showOffsets||Object(o.l)(c)||!s.showOffsetsSelected&&"Fixed"==i)t.stopCommand(this.id,n);else{var u=t.Canvas,h=r.elPos||u.getElementPos(c),d=window.getComputedStyle(c),f=this.ppfx,p=i+"State",g=u[this.getOffsetMethod(i)]();g.style.display="block";var v=this["marginT"+i],m=this["marginB"+i],y=this["marginL"+i],b=this["marginR"+i],w=this["padT"+i],x=this["padB"+i],C=this["padL"+i],O=this["padR"+i];if(!this[p]){var S=i.toLowerCase(),k=S+"margin-v",T=S+"padding-v",P=a('<div class="'.concat(f,'marginName">')).get(0),j=a('<div class="'.concat(f,'paddingName">')).get(0),E=f+T+"-el",M="".concat(f+k+"-el"," ").concat(f+k),D="".concat(E," ").concat(f+T);v=a('<div class="'.concat(M,'-top"></div>')).get(0),m=a('<div class="'.concat(M,'-bottom"></div>')).get(0),y=a('<div class="'.concat(M,'-left"></div>')).get(0),b=a('<div class="'.concat(M,'-right"></div>')).get(0),w=a('<div class="'.concat(D,'-top"></div>')).get(0),x=a('<div class="'.concat(D,'-bottom"></div>')).get(0),C=a('<div class="'.concat(D,'-left"></div>')).get(0),O=a('<div class="'.concat(D,'-right"></div>')).get(0),this["marginT"+i]=v,this["marginB"+i]=m,this["marginL"+i]=y,this["marginR"+i]=b,this["padT"+i]=w,this["padB"+i]=x,this["padL"+i]=C,this["padR"+i]=O,P.appendChild(v),P.appendChild(m),P.appendChild(y),P.appendChild(b),j.appendChild(w),j.appendChild(x),j.appendChild(C),j.appendChild(O),g.appendChild(P),g.appendChild(j),this[p]="1"}var A=parseFloat(d.marginLeft.replace("px",""))*l,L=parseFloat(d.marginRight.replace("px",""))*l,N=parseFloat(d.marginTop.replace("px",""))*l,I=parseFloat(d.marginBottom.replace("px",""))*l,F=v.style,R=m.style,_=y.style,V=b.style,z=w.style,H=x.style,$=C.style,W=O.style,B=parseFloat(h.left),U=parseFloat(d.width)*l+"px";F.height=N+"px",F.width=U,F.top=h.top-N+"px",F.left=B+"px",R.height=I+"px",R.width=U,R.top=h.top+h.height+"px",R.left=B+"px";var q=h.height+N+I+"px",G=h.top-N+"px";_.height=q,_.width=A+"px",_.top=G,_.left=B-A+"px",V.height=q,V.width=L+"px",V.top=G,V.left=B+h.width+"px";var K=parseFloat(d.paddingTop)*l;z.height=K+"px",z.width=U,z.top=h.top+"px",z.left=B+"px";var Y=parseFloat(d.paddingBottom)*l;H.height=Y+"px",H.width=U,H.top=h.top+h.height-Y+"px",H.left=B+"px";var X=h.height-Y-K+"px",J=h.top+K+"px";$.height=X,$.width=parseFloat(d.paddingLeft)*l+"px",$.top=J,$.left=h.left+"px";var Z=parseFloat(d.paddingRight)*l;W.height=X,W.width=Z+"px",W.top=J,W.left=h.left+h.width-Z+"px"}},stop:function(t,e,n){var r=(n||{}).state||"",i=this.getOffsetMethod(r);t.Canvas[i]().style.display="none"}}},function(t,e,n){"use strict";n.r(e),e.default={run:function(t){t.Canvas.getBody().className=this.ppfx+"dashed"},stop:function(t){t.Canvas.getBody().className=""}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a={stylePrefix:"sm-",sectors:[],appendTo:"",textNoElement:"Select an element before using Style Manager",textLayer:"Layer",hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:0,avoidComputed:["width","height"]},s=n(1),l=n.n(s),c=n(22),u=function(){return{build:function(t){var e=[];"string"==typeof t&&(t=[t]);for(var n=0,r=t.length;n<r;n++){var i={},o=t[n];switch(i.property=o,o){case"border-radius-c":i.property="border-radius"}switch(o){case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"width":case"max-width":case"min-width":case"height":case"max-height":case"min-height":case"flex-basis":i.fixedValues=["initial","inherit","auto"];break;case"font-size":i.fixedValues=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"];break;case"letter-spacing":case"line-height":i.fixedValues=["normal","initial","inherit"]}switch(o){case"float":case"position":case"text-align":i.type="radio";break;case"display":case"flex-direction":case"flex-wrap":case"justify-content":case"align-items":case"align-content":case"align-self":case"font-family":case"font-weight":case"border-style":case"box-shadow-type":case"background-repeat":case"background-position":case"background-attachment":case"background-size":case"transition-property":case"transition-timing-function":case"cursor":case"overflow":case"overflow-x":case"overflow-y":i.type="select";break;case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"letter-spacing":case"line-height":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-h":case"box-shadow-v":case"box-shadow-blur":case"box-shadow-spread":case"transition-duration":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":case"order":case"flex-grow":case"flex-shrink":case"flex-basis":i.type="integer";break;case"margin":case"padding":case"border-radius":case"border":case"transform":i.type="composite";break;case"color":case"text-shadow-color":case"background-color":case"border-color":case"box-shadow-color":i.type="color";break;case"text-shadow":case"box-shadow":case"background":case"transition":i.type="stack";break;case"background-image":i.type="file"}switch(o){case"float":case"background-color":case"background-image":case"text-shadow":i.defaults="none";break;case"display":i.defaults="block";break;case"flex-direction":i.defaults="row";break;case"flex-wrap":i.defaults="nowrap";break;case"justify-content":i.defaults="flex-start";break;case"align-items":case"align-content":i.defaults="stretch";break;case"align-self":i.defaults="auto";break;case"position":i.defaults="static";break;case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"box-shadow-h":case"box-shadow-v":case"box-shadow-spread":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":case"order":case"flex-grow":i.defaults=0;break;case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":i.defaults="0px";break;case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":case"flex-shrink":i.defaults=1;break;case"box-shadow-blur":i.defaults="5px";break;case"top":case"right":case"bottom":case"left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"background-size":case"cursor":case"flex-basis":i.defaults="auto";break;case"font-family":i.defaults="Arial, Helvetica, sans-serif";break;case"font-size":case"border-width":i.defaults="medium";break;case"font-weight":i.defaults="400";break;case"letter-spacing":case"line-height":i.defaults="normal";break;case"color":case"text-shadow-color":case"border-color":case"box-shadow-color":i.defaults="black";break;case"text-align":i.defaults="left";break;case"border-style":i.defaults="solid";break;case"box-shadow-type":i.defaults="";break;case"background-repeat":i.defaults="repeat";break;case"background-position":i.defaults="left top";break;case"background-attachment":i.defaults="scroll";break;case"transition-property":i.defaults="width";break;case"transition-duration":i.defaults="2";break;case"transition-timing-function":i.defaults="ease";break;case"overflow":case"overflow-x":case"overflow-y":i.defaults="visible"}switch(o){case"flex-direction":case"flex-wrap":case"justify-content":case"align-items":case"align-content":i.requires={display:["flex"]};break;case"order":case"flex-basis":case"flex-grow":case"flex-shrink":case"align-self":i.requiresParent={display:["flex"]}}switch(o){case"top":case"bottom":case"margin-top":case"margin-bottom":case"padding-top":case"padding-bottom":case"min-height":case"max-height":case"height":i.units=["px","%","vh"];break;case"right":case"left":case"margin-right":case"margin-left":case"padding-right":case"padding-left":case"min-width":case"max-width":case"width":i.units=["px","%","vw"];break;case"flex-basis":i.units=["px","%","vw","vh"];break;case"text-shadow-v":case"text-shadow-h":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"box-shadow-h":case"box-shadow-v":i.units=["px","%"];break;case"font-size":case"letter-spacing":case"line-height":i.units=["px","em","rem","%"];break;case"border-width":i.units=["px","em"];break;case"box-shadow-blur":case"box-shadow-spread":case"perspective":i.units=["px"];break;case"transition-duration":i.units=["s"];break;case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":i.units=["deg"]}switch(o){case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-blur":case"transition-duration":case"perspective":case"flex-basis":i.min=0}switch(o){case"text-shadow":case"box-shadow":case"background":i.preview=!0}switch(o){case"background":i.detached=!0}switch(o){case"transform-rotate-x":i.functionName="rotateX";break;case"transform-rotate-y":i.functionName="rotateY";break;case"transform-rotate-z":i.functionName="rotateZ";break;case"transform-scale-x":i.functionName="scaleX";break;case"transform-scale-y":i.functionName="scaleY";break;case"transform-scale-z":i.functionName="scaleZ";break;case"background-image":i.functionName="url"}switch(o){case"float":i.list=[{value:"none"},{value:"left"},{value:"right"}];break;case"display":i.list=[{value:"block"},{value:"inline"},{value:"inline-block"},{value:"flex"},{value:"none"}];break;case"flex-direction":i.list=[{value:"row"},{value:"row-reverse"},{value:"column"},{value:"column-reverse"}];break;case"flex-wrap":i.list=[{value:"nowrap"},{value:"wrap"},{value:"wrap-reverse"}];break;case"justify-content":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"space-between"},{value:"space-around"},{value:"space-evenly"}];break;case"align-items":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"baseline"},{value:"stretch"}];break;case"align-content":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"space-between"},{value:"space-around"},{value:"stretch"}];break;case"align-self":i.list=[{value:"auto"},{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"baseline"},{value:"stretch"}];break;case"position":i.list=[{value:"static"},{value:"relative"},{value:"absolute"},{value:"fixed"}];break;case"font-family":var a=", sans-serif",s=["Arial, Helvetica"+a,"Arial Black, Gadget"+a,"Brush Script MT"+a,"Comic Sans MS, cursive"+a,"Courier New, Courier, monospace","Georgia, serif","Helvetica, serif","Impact, Charcoal"+a,"Lucida Sans Unicode, Lucida Grande"+a,"Tahoma, Geneva"+a,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+a,"Verdana, Geneva"+a];i.list=[];for(var l=0,c=s.length;l<c;l++){var u={};u.value=s[l],u.name=s[l].split(",")[0],i.list.push(u)}break;case"font-weight":i.list=[{value:"100",name:"Thin"},{value:"200",name:"Extra-Light"},{value:"300",name:"Light"},{value:"400",name:"Normal"},{value:"500",name:"Medium"},{value:"600",name:"Semi-Bold"},{value:"700",name:"Bold"},{value:"800",name:"Extra-Bold"},{value:"900",name:"Ultra-Bold"}];break;case"text-align":i.list=[{value:"left"},{value:"center"},{value:"right"},{value:"justify"}];break;case"border-style":i.list=[{value:"none"},{value:"solid"},{value:"dotted"},{value:"dashed"},{value:"double"},{value:"groove"},{value:"ridge"},{value:"inset"},{value:"outset"}];break;case"box-shadow-type":i.list=[{value:"",name:"Outside"},{value:"inset",name:"Inside"}];break;case"background-repeat":i.list=[{value:"repeat"},{value:"repeat-x"},{value:"repeat-y"},{value:"no-repeat"}];break;case"background-position":i.list=[{value:"left top"},{value:"left center"},{value:"left bottom"},{value:"right top"},{value:"right center"},{value:"right bottom"},{value:"center top"},{value:"center center"},{value:"center bottom"}];break;case"background-attachment":i.list=[{value:"scroll"},{value:"fixed"},{value:"local"}];break;case"background-size":i.list=[{value:"auto"},{value:"cover"},{value:"contain"}];break;case"transition-property":i.list=[{value:"all"},{value:"width"},{value:"height"},{value:"background-color"},{value:"transform"},{value:"box-shadow"},{value:"opacity"}];break;case"transition-timing-function":i.list=[{value:"linear"},{value:"ease"},{value:"ease-in"},{value:"ease-out"},{value:"ease-in-out"}];break;case"cursor":i.list=[{value:"auto"},{value:"pointer"},{value:"copy"},{value:"crosshair"},{value:"grab"},{value:"grabbing"},{value:"help"},{value:"move"},{value:"text"}];break;case"overflow":case"overflow-x":case"overflow-y":i.list=[{value:"visible"},{value:"hidden"},{value:"scroll"},{value:"auto"}]}switch(o){case"margin":i.properties=this.build(["margin-top","margin-right","margin-bottom","margin-left"]);break;case"padding":i.properties=this.build(["padding-top","padding-right","padding-bottom","padding-left"]);break;case"text-shadow":i.properties=this.build(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"]);break;case"border":i.properties=this.build(["border-width","border-style","border-color"]);break;case"border-radius":i.properties=this.build(["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"]);break;case"box-shadow":i.properties=this.build(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"]);break;case"background":i.properties=this.build(["background-image","background-repeat","background-position","background-attachment","background-size"]);break;case"transition":i.properties=this.build(["transition-property","transition-duration","transition-timing-function"]);break;case"transform":i.properties=this.build(["transform-rotate-x","transform-rotate-y","transform-rotate-z","transform-scale-x","transform-scale-y","transform-scale-z"])}e.push(i)}return e}}},h=l.a.Model.extend({defaults:{id:"",name:"",open:!0,buildProps:"",extendBuilded:1,properties:[]},initialize:function(t){var e=t||{},n=this.buildProperties(e.buildProps),r=this.get("name")||"",i=[];!this.get("id")&&this.set("id",r.replace(/ /g,"_").toLowerCase()),i=n?this.extendProperties(n):this.get("properties");var o=new c.default(i);o.sector=this,this.set("properties",o)},extendProperties:function(t,e,n){for(var r=t.length,i=e||this.get("properties"),a=this.get("extendBuilded"),s=[],l=0,c=i.length;l<c;l++){for(var u=i[l],h=0,d=0;d<r;d++){var f=t[d];if(u.property!=f.property&&u.id!=f.property);else{var p=u.properties;p&&p.length&&(u.properties=this.extendProperties(f.properties||[],p,1)),t[d]=a?Object(o.extend)(f,u):u,s[d]=t[d],h=1}}h||(t.push(u),s.push(u))}return n?s.filter((function(t){return t})):t},buildProperties:function(t){var e=t||[];if(e.length)return this.propFactory||(this.propFactory=new u),this.propFactory.build(e)}}),d=l.a.Collection.extend({model:h}),f=n(3),p=n(11),g=n(16),v=l.a.View.extend({template:Object(o.template)('\n <div class="<%= pfx %>title" data-sector-title>\n <i id="<%= pfx %>caret" class="fa"></i>\n <%= label %>\n </div>'),events:{"click [data-sector-title]":"toggle"},initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.caretR="fa-caret-right",this.caretD="fa-caret-down";var e=this.model;this.listenTo(e,"change:open",this.updateOpen),this.listenTo(e,"updateVisibility",this.updateVisibility),this.listenTo(e,"destroy remove",this.remove)},updateVisibility:function(){var t;this.model.get("properties").each((function(e){e.get("visible")&&(t=1)})),this.el.style.display=t?"block":"none"},updateOpen:function(){this.model.get("open")?this.show():this.hide()},show:function(){this.$el.addClass(this.pfx+"open"),this.getPropertiesEl().style.display="",this.$caret.removeClass(this.caretR).addClass(this.caretD)},hide:function(){this.$el.removeClass(this.pfx+"open"),this.getPropertiesEl().style.display="none",this.$caret.removeClass(this.caretD).addClass(this.caretR)},getPropertiesEl:function(){return this.$el.find(".".concat(this.pfx,"properties")).get(0)},toggle:function(t){var e=this.model.get("open")?0:1;this.model.set("open",e)},render:function(){var t=this.pfx,e=this.model,n=e.attributes.id;return this.$el.html(this.template({pfx:t,label:e.get("name")})),this.$caret=this.$el.find("#".concat(t,"caret")),this.renderProperties(),this.$el.attr("class","".concat(t,"sector ").concat(t,"sector__").concat(n," no-select")),this.updateOpen(),this},renderProperties:function(){var t=this.model.get("properties");if(t){var e=new g.default({collection:t,target:this.target,propTarget:this.propTarget,config:this.config});this.$el.append(e.render().el)}}});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 y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var b=l.a.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config||{};this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.target=t.target||{},this.config=e;var n={};Object(o.extend)(n,l.a.Events);var r=document.body,i=document.createElement("el-".concat((new Date).getTime()));r.appendChild(i),n.computedDefault=y({},window.getComputedStyle(i)),r.removeChild(i),this.propTarget=n;var a=this.collection,s="component:toggled component:update:classes component:update:state change:device";this.listenTo(a,"add",this.addTo),this.listenTo(a,"reset",this.render),this.listenTo(this.target,s,this.targetUpdated)},addTo:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(t,null,n)},targetUpdated:function(){var t=this.target,e=this.propTarget,n=t.getSelected();if(n){var r=t.get("Config").devicePreviewMode?"":n.get("state"),i=n.getEl();if(e.helper=null,i&&Object(f.k)(i)){var o=r?":".concat(r):null;e.computed=window.getComputedStyle(i,o)}n=t.get("StyleManager").getModelToStyle(n),r&&function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.get("CssComposer"),i="hc-state",o=r.getAll(),a=r.getClassRule(i);a?(o.remove(a),o.add(a)):a=r.setClassRule(i),a.set("important",1),a.setStyle(n),e.helper=a}(n.getStyle()),e.model=n,e.trigger("update")}},setTarget:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=n.get("Config"),i=e.targetIsClass,a=e.stylable,s=t;if(Object(o.isString)(t)){var l,c=n.get("CssComposer").getAll();i&&(l=c.filter((function(e){return e.get("selectors").getFullString()===t}))[0]),l||(l=c.filter((function(e){return e.get("selectorsAdd")===t}))[0]),l||(l=c.add({selectors:[],selectorsAdd:t})),a&&l.set({stylable:a}),s=l}r.devicePreviewMode||s.get("state");var u=this.propTarget;return u.model=s,u.trigger("styleManager:update",s),s},addToCollection:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.pfx,i=this.target,o=this.propTarget,a=this.config,s=this.el,l=e||s,c=new v({model:t,id:"".concat(r).concat(t.get("id")),name:t.get("name"),properties:t.get("properties"),target:i,propTarget:o,config:a}).render().el;return Object(p.a)(l,c,n.at),c},render:function(){var t=this,e=document.createDocumentFragment(),n=this.$el,r=this.pfx,i=this.ppfx;return n.empty(),this.collection.each((function(n){return t.addToCollection(n,e)})),n.append(e),n.addClass("".concat(r,"sectors ").concat(i,"one-bg ").concat(i,"two-color")),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 x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r={};return{name:"StyleManager",getConfig:function(){return r},init:function(i){var o=(r=x({},a,{},i)).pStylePrefix;return this.em=r.em,o&&(r.stylePrefix=o+r.stylePrefix),t=new c.default,e=new d([],r),n=new b({collection:e,target:r.em,config:r}),this},onLoad:function(){e.add(r.sectors)},postRender:function(){var t=this.getConfig().appendTo;t&&(Object(o.isElement)(t)?t:document.querySelector(t)).appendChild(this.render())},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},removeSector:function(t){return this.getSectors().remove(this.getSector(t,{warn:1}))},getSectors:function(){return e},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=this.getSector(t,{warn:1}),r=null;return n&&(r=1==(r=n.get("properties").where({property:e})).length?r[0]:r),r},removeProperty:function(t,e){var n=this.getProperties(t);return n&&n.remove(this.getProperty(t,e))},getProperties:function(t){var e=null,n=this.getSector(t,{warn:1});return n&&(e=n.get("properties")),e},getModelToStyle:function(t){var e=r.em,n=t.get("classes"),i=t.getId();if(e){var o,a=e.getConfig(),s=e.get("UndoManager"),l=e.get("CssComposer"),c=a.devicePreviewMode?"":t.get("state"),u=n.getStyleable(),h=u.length,d={state:c};if(s.stop(),h){var f=e.getCurrentMedia();(o=l.get(u,c,f))||(o=l.add(u,c,f))}else a.avoidInlineStyle&&(!(o=l.getIdRule(i,d))&&(o=l.setIdRule(i,{},d)),t.is("wrapper")&&o.set("wrapper",1));o&&(t=o),s.start()}return t},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,i=void 0===n?{}:n,o=e.view,a=void 0===o?{}:o,s=this.getType(t);if(s)return new s.view(x({model:new s.model(i),config:r},a))},setTarget:function(t,e){return n.setTarget(t,e)},getEmitter:function(){return n.propTarget},render:function(){return n.render().el},_logNoSector:function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o={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},a=n(31),s=n(0);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 c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(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=c({},o,{},e)).stylePrefix=e.pStylePrefix,t=n.em,this},getConfig:function(){return n},onLoad:function(){e=new a.a({level:0,config:n,opened:n.opened||{},model:t.get("DomComponents").getWrapper()}),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.setRoot(t),this},getRoot:function(){return 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 l in i)i[l].set("open",0);for(;s;)s.set("open",1),i[s.cid]=s,s=s.collection?s.collection.parent:null;if(o&&a){var c=o.viewLayer&&o.viewLayer.el;c&&c.scrollIntoView(a)}}},render:function(){return e.render().el}}}},function(t,e,n){var r,i,o;
|
||
/*!
|
||
* Backbone.Undo.js v0.2
|
||
*
|
||
* Copyright (c)2013 Oliver Sartun
|
||
* Released under the MIT License
|
||
*
|
||
* Documentation and full license available at
|
||
* https://github.com/osartun/Backbone.Undo.js
|
||
*/i=[n(0),n(1)],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,l=(a=!1,s=-1,function(){return a||(s++,a=!0,t.defer((function(){a=!1}))),s});function c(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,r,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 h(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 d(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,l,c="undo"===e;for(a?l=c&&i.pointer===i.length-1||!c&&-1===i.pointer?t.clone(i.models):n.apply(i.models,c?[0,i.pointer]:[i.pointer,i.length-1]):(s=i.at(c?i.pointer:i.pointer+1),l=o?i.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),i.pointer+=(c?-1:1)*l.length;s=c?l.pop():l.shift();)s[e]();i.isCurrentlyUndoRedoing=!1,r.trigger(e,r)}}function f(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=l(),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--)}}}c.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var 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){h("undo",this.attributes)},redo:function(t){h("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 c,this.undoTypes=new g,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){f(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){d("undo",this,this.stack,t)},undoAll:function(){d("undo",this,this.stack,!1,!0)},redo:function(t){d("redo",this,this.stack,t)},redoAll:function(){d("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){var r=n(79),i=n(80),o=n(81);t.exports=function(t,e){return r(t)||i(t,e)||o()}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";n.r(e);var r=n(6),i=n.n(r),o=n(2),a=n.n(o),s=n(0),l=n(33),c=n.n(l);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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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"}}};return{keymaster:c.a,name:"Keymaps",getConfig:function(){return e},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=h({},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)}},add:function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=this.em,l=a.get("Commands"),u=a.getEditor(),h=a.get("Canvas"),d={id:t,keys:e,handler:r},f=n[t];return f&&this.remove(t),n[t]=d,c()(e,(function(e,n){var c={event:e,h:n};if(r=Object(s.isString)(r)?l.get(r):r,o.prevent&&h.getCanvasView().preventDefault(e),!a.isEditing()&&!u.Canvas.isInputFocused()||o.force){"object"==i()(r)?r.run(u,0,c):r(u,0,c);var d=[t,n.shortcut,e];a.trigger.apply(a,["keymap:emit"].concat(d)),a.trigger.apply(a,["keymap:emit:".concat(t)].concat(d))}})),a.trigger("keymap:add",d),d},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],c.a.unbind(r.keys),e&&e.trigger("keymap:remove",r),r},removeAll:function(){var t=this;return Object.keys(n).forEach((function(e){return t.remove(e)})),this}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(63),a=n.n(o);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 l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r,i={};return{name:"UndoManager",init:function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=l({},o,{},i),t=n.em,this.em=t,(e=new a.a({track:!0,register:[]})).changeUndoType("change",{condition:!1}),e.changeUndoType("add",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:void 0,after:t,options:l({},n)}}}),e.changeUndoType("remove",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:t,after:void 0,options:l({},n)}}});var s={on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r&&(r=t.previousAttributes()),!n.avoidStore){var i={object:t,before:r,after:t.toJSON()};return r=null,i}},undo:function(t,e,n,r){t.set(e)},redo:function(t,e,n,r){t.set(n)}},c=["style","attributes","content","src"];return c.forEach((function(t){return e.addUndoType("change:".concat(t),s)})),e.on("undo redo",(function(){return t.trigger("component:toggled change:canvasOffset")})),["undo","redo"].forEach((function(n){return e.on(n,(function(){return t.trigger(n)}))})),this},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(){return!t.isEditing()&&e.undo(1),this},undoAll:function(){return e.undoAll(),this},redo:function(){return!t.isEditing()&&e.redo(1),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable("undo")},hasRedo:function(){return e.isAvailable("redo")},getStack:function(){return e.stack},clear:function(){return e.clear(),this},getInstance:function(){return e}}}},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(70),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(23))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,l=1,c={},u=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d: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)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.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,"*")}),d.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 c[l]=i,r(l),l++},d.clearImmediate=f}function f(t){delete c[t]}function p(t){if(u)setTimeout(p,0,t);else{var e=c[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{f(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(23),n(71))},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 l,c=[],u=!1,h=-1;function d(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&f())}function f(){if(!u){var t=s(d);u=!0;for(var e=c.length;e;){for(l=c,c=[];++h<e;)l&&l[h].run();h=-1,e=c.length}l=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];c.push(new p(t,e)),1!==c.length||u||s(f)},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){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,n){!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}),l={},c=a&&a.tags,u=a&&a.scriptTypes;if(o(e,l),c&&o(c,l),u)for(var h=u.length-1;h>=0;h--)l.script.unshift(["type",u[h].matches,u[h].mode]);function d(e,o){var a,c=s.token(e,o.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(e.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&u&&/>$/.test(e.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var f=">"==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]}}(l[h[1]],h[2]),p=t.getMode(n,f),g=i(h[1],!0),v=i(h[1],!1);o.token=function(t,e){return t.match(g,!1)?(e.token=d,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 c}return{startState:function(){return{token:d,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(10),n(76),n(77),n(36))},function(t,e,n){!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,l={},c=i.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function h(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(f("atom","]]>")):null:t.match("--")?n(f("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=h;break}return r.tokenize=t(e-1),r.tokenize(n,r)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"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 d(t,e){var n,r,i=t.next();if(">"==i||"/"==i&&t.eat(">"))return e.tokenize=h,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){e.tokenize=h,e.state=m,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=d;break}return"string"}).isInAttribute=!0,r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=h;break}n.next()}return t}}function p(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function g(t){t.context&&(t.context=t.context.prev)}function v(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;g(t)}}function m(t,e,n){return"openTag"==t?(n.tagStart=e.column(),y):"closeTag"==t?b:m}function y(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",C):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,0,n)):(a="error",y)}function b(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",w):(a="tag error",x)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",w(t,0,n)):(a="error",x)}function w(t,e,n){return"endTag"!=t?(a="error",w):(g(n),m)}function x(t,e,n){return a="error",w(t,0,n)}function C(t,e,n){if("word"==t)return a="attribute",O;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(r)?v(n,r):(v(n,r),n.context=new p(n,r,i==n.indented)),m}return a="error",C}function O(t,e,n){return"equals"==t?S:(l.allowMissing||(a="error"),C(t,0,n))}function S(t,e,n){return"string"==t?k:"word"==t&&l.allowUnquoted?(a="string",C):(a="error",C(t,0,n))}function k(t,e,n){return"string"==t?k:C(t,0,n)}return h.isInText=!0,{startState:function(t){var e={tokenize:h,state:m,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!=d&&e.tokenize!=h)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.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(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(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:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==S&&(t.state=C)}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(10))},function(t,e,n){!function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=n.typescript,u=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=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(t,e,n){return r=t,i=n,e}function g(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(f))return e.tokenize=g,p("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(e.tokenize=g),p("string","string")}),e.tokenize(t,e);if("."==r&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return p("number","number");if("."==r&&t.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return p(r);if("="==r&&t.eat(">"))return p("=>","operator");if("0"==r&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return p("number","number");if(/\d/.test(r))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),p("number","number");if("/"==r)return t.eat("*")?(e.tokenize=v,v(t,e)):t.eat("/")?(t.skipToEnd(),p("comment","comment")):Kt(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/),p("regexp","string-2")):(t.eat("="),p("operator","operator",t.current()));if("`"==r)return e.tokenize=m,m(t,e);if("#"==r)return t.skipToEnd(),p("error","error");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))),p("operator","operator",t.current());if(u.test(r)){t.eatWhile(u);var i=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(i)){var o=h[i];return p(o.type,o.style,i)}if("async"==i&&t.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",i)}return p("variable","variable",i)}}function v(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=g;break}r="*"==n}return p("comment","comment")}function m(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=g;break}r=!r&&"\\"==n}return p("quasi","string-2",t.current())}var y="([{}])";function b(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(c){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),l=y.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(u.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 w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!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){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}var O={state:null,column:null,marked:null,cc:null};function S(){for(var t=arguments.length-1;t>=0;t--)O.cc.push(arguments[t])}function k(){return S.apply(null,arguments),!0}function T(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function P(t){var e=O.state;if(O.marked="def",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 E(r,n.vars,!0):null}return T(e,n.vars)?n:new E(n.prev,new M(e,n.vars),!1)}return null}(t,e.context);if(null!=r)return void(e.context=r)}else if(!T(t,e.localVars))return void(e.localVars=new M(t,e.localVars));n.globalVars&&!T(t,e.globalVars)&&(e.globalVars=new M(t,e.globalVars))}function j(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function E(t,e,n){this.prev=t,this.vars=e,this.block=n}function M(t,e){this.name=t,this.next=e}var D=new M("this",new M("arguments",null));function A(){O.state.context=new E(O.state.context,O.state.localVars,!1),O.state.localVars=D}function L(){O.state.context=new E(O.state.context,O.state.localVars,!0),O.state.localVars=null}function N(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function I(t,e){var n=function(){var n=O.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,O.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function F(){var t=O.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function R(t){return function e(n){return n==t?k():";"==t||"}"==n||")"==n||"]"==n?S():k(e)}}function _(t,e){return"var"==t?k(I("vardef",e),bt,R(";"),F):"keyword a"==t?k(I("form"),$,_,F):"keyword b"==t?k(I("form"),_,F):"keyword d"==t?O.stream.match(/^\s*$/,!1)?k():k(I("stat"),B,R(";"),F):"debugger"==t?k(R(";")):"{"==t?k(I("}"),L,at,F,N):";"==t?k():"if"==t?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==F&&O.state.cc.pop()(),k(I("form"),$,_,F,kt)):"function"==t?k(Et):"for"==t?k(I("form"),Tt,_,F):"class"==t||c&&"interface"==e?(O.marked="keyword",k(I("form","class"==t?t:e),Nt,F)):"variable"==t?c&&"declare"==e?(O.marked="keyword",k(_)):c&&("module"==e||"enum"==e||"type"==e)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==e?k(qt):"type"==e?k(Dt,R("operator"),ht,R(";")):k(I("form"),wt,R("{"),I("}"),at,F,F)):c&&"namespace"==e?(O.marked="keyword",k(I("form"),z,_,F)):c&&"abstract"==e?(O.marked="keyword",k(_)):k(I("stat"),Q):"switch"==t?k(I("form"),$,R("{"),I("}","switch"),L,at,F,F,N):"case"==t?k(z,R(":")):"default"==t?k(R(":")):"catch"==t?k(I("form"),A,V,_,F,N):"export"==t?k(I("stat"),_t,F):"import"==t?k(I("stat"),zt,F):"async"==t?k(_):"@"==e?k(z,_):S(I("stat"),z,R(";"),F)}function V(t){if("("==t)return k(At,R(")"))}function z(t,e){return W(t,e,!1)}function H(t,e){return W(t,e,!0)}function $(t){return"("!=t?S():k(I(")"),z,R(")"),F)}function W(t,e,n){if(O.state.fatArrowAt==O.stream.start){var r=n?X:Y;if("("==t)return k(A,I(")"),it(At,")"),F,R("=>"),r,N);if("variable"==t)return S(A,wt,R("=>"),r,N)}var i=n?q:U;return w.hasOwnProperty(t)?k(i):"function"==t?k(Et,i):"class"==t||c&&"interface"==e?(O.marked="keyword",k(I("form"),Lt,F)):"keyword c"==t||"async"==t?k(n?H:z):"("==t?k(I(")"),B,R(")"),F,i):"operator"==t||"spread"==t?k(n?H:z):"["==t?k(I("]"),Ut,F,i):"{"==t?ot(et,"}",null,i):"quasi"==t?S(G,i):"new"==t?k(function(t){return function(e){return"."==e?k(t?Z:J):"variable"==e&&c?k(vt,t?q:U):S(t?H:z)}}(n)):"import"==t?k(z):k()}function B(t){return t.match(/[;\}\)\],]/)?S():S(z)}function U(t,e){return","==t?k(z):q(t,e,!1)}function q(t,e,n){var r=0==n?U:q,i=0==n?z:H;return"=>"==t?k(A,n?X:Y,N):"operator"==t?/\+\+|--/.test(e)||c&&"!"==e?k(r):c&&"<"==e&&O.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?k(I(">"),it(ht,">"),F,r):"?"==e?k(z,R(":"),i):k(i):"quasi"==t?S(G,r):";"!=t?"("==t?ot(H,")","call",r):"."==t?k(tt,r):"["==t?k(I("]"),B,R("]"),F,r):c&&"as"==e?(O.marked="keyword",k(ht,r)):"regexp"==t?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),k(i)):void 0:void 0}function G(t,e){return"quasi"!=t?S():"${"!=e.slice(e.length-2)?k(G):k(z,K)}function K(t){if("}"==t)return O.marked="string-2",O.state.tokenize=m,k(G)}function Y(t){return b(O.stream,O.state),S("{"==t?_:z)}function X(t){return b(O.stream,O.state),S("{"==t?_:H)}function J(t,e){if("target"==e)return O.marked="keyword",k(U)}function Z(t,e){if("target"==e)return O.marked="keyword",k(q)}function Q(t){return":"==t?k(F,_):S(U,R(";"),F)}function tt(t){if("variable"==t)return O.marked="property",k()}function et(t,e){return"async"==t?(O.marked="property",k(et)):"variable"==t||"keyword"==O.style?(O.marked="property","get"==e||"set"==e?k(nt):(c&&O.state.fatArrowAt==O.stream.start&&(n=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+n[0].length),k(rt))):"number"==t||"string"==t?(O.marked=s?"property":O.style+" property",k(rt)):"jsonld-keyword"==t?k(rt):c&&j(e)?(O.marked="keyword",k(et)):"["==t?k(z,st,R("]"),rt):"spread"==t?k(H,rt):"*"==e?(O.marked="keyword",k(et)):":"==t?S(rt):void 0;var n}function nt(t){return"variable"!=t?S(rt):(O.marked="property",k(Et))}function rt(t){return":"==t?k(H):"("==t?S(Et):void 0}function it(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=O.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),k((function(n,r){return n==e||r==e?S():S(t)}),r)}return i==e||o==e?k():n&&n.indexOf(";")>-1?S(t):k(R(e))}return function(n,i){return n==e||i==e?k():S(t,r)}}function ot(t,e,n){for(var r=3;r<arguments.length;r++)O.cc.push(arguments[r]);return k(I(e,n),it(t,e),F)}function at(t){return"}"==t?k():S(_,at)}function st(t,e){if(c){if(":"==t)return k(ht);if("?"==e)return k(st)}}function lt(t,e){if(c&&(":"==t||"in"==e))return k(ht)}function ct(t){if(c&&":"==t)return O.stream.match(/^\s*\w+\s+is\b/,!1)?k(z,ut,ht):k(ht)}function ut(t,e){if("is"==e)return O.marked="keyword",k()}function ht(t,e){return"keyof"==e||"typeof"==e||"infer"==e?(O.marked="keyword",k("typeof"==e?H:ht)):"variable"==t||"void"==e?(O.marked="type",k(gt)):"|"==e||"&"==e?k(ht):"string"==t||"number"==t||"atom"==t?k(gt):"["==t?k(I("]"),it(ht,"]",","),F,gt):"{"==t?k(I("}"),it(ft,"}",",;"),F,gt):"("==t?k(it(pt,")"),dt,gt):"<"==t?k(it(ht,">"),ht):void 0}function dt(t){if("=>"==t)return k(ht)}function ft(t,e){return"variable"==t||"keyword"==O.style?(O.marked="property",k(ft)):"?"==e||"number"==t||"string"==t?k(ft):":"==t?k(ht):"["==t?k(R("variable"),lt,R("]"),ft):"("==t?S(Mt,ft):void 0}function pt(t,e){return"variable"==t&&O.stream.match(/^\s*[?:]/,!1)||"?"==e?k(pt):":"==t?k(ht):"spread"==t?k(pt):S(ht)}function gt(t,e){return"<"==e?k(I(">"),it(ht,">"),F,gt):"|"==e||"."==t||"&"==e?k(ht):"["==t?k(ht,R("]"),gt):"extends"==e||"implements"==e?(O.marked="keyword",k(ht)):"?"==e?k(ht,R(":"),ht):void 0}function vt(t,e){if("<"==e)return k(I(">"),it(ht,">"),F,gt)}function mt(){return S(ht,yt)}function yt(t,e){if("="==e)return k(ht)}function bt(t,e){return"enum"==e?(O.marked="keyword",k(qt)):S(wt,st,Ot,St)}function wt(t,e){return c&&j(e)?(O.marked="keyword",k(wt)):"variable"==t?(P(e),k()):"spread"==t?k(wt):"["==t?ot(Ct,"]"):"{"==t?ot(xt,"}"):void 0}function xt(t,e){return"variable"!=t||O.stream.match(/^\s*:/,!1)?("variable"==t&&(O.marked="property"),"spread"==t?k(wt):"}"==t?S():"["==t?k(z,R("]"),R(":"),xt):k(R(":"),wt,Ot)):(P(e),k(Ot))}function Ct(){return S(wt,Ot)}function Ot(t,e){if("="==e)return k(H)}function St(t){if(","==t)return k(bt)}function kt(t,e){if("keyword b"==t&&"else"==e)return k(I("form","else"),_,F)}function Tt(t,e){return"await"==e?k(Tt):"("==t?k(I(")"),Pt,F):void 0}function Pt(t){return"var"==t?k(bt,jt):"variable"==t?k(jt):S(jt)}function jt(t,e){return")"==t?k():";"==t?k(jt):"in"==e||"of"==e?(O.marked="keyword",k(z,jt)):S(z,jt)}function Et(t,e){return"*"==e?(O.marked="keyword",k(Et)):"variable"==t?(P(e),k(Et)):"("==t?k(A,I(")"),it(At,")"),F,ct,_,N):c&&"<"==e?k(I(">"),it(mt,">"),F,Et):void 0}function Mt(t,e){return"*"==e?(O.marked="keyword",k(Mt)):"variable"==t?(P(e),k(Mt)):"("==t?k(A,I(")"),it(At,")"),F,ct,N):c&&"<"==e?k(I(">"),it(mt,">"),F,Mt):void 0}function Dt(t,e){return"keyword"==t||"variable"==t?(O.marked="type",k(Dt)):"<"==e?k(I(">"),it(mt,">"),F):void 0}function At(t,e){return"@"==e&&k(z,At),"spread"==t?k(At):c&&j(e)?(O.marked="keyword",k(At)):c&&"this"==t?k(st,Ot):S(wt,st,Ot)}function Lt(t,e){return"variable"==t?Nt(t,e):It(t,e)}function Nt(t,e){if("variable"==t)return P(e),k(It)}function It(t,e){return"<"==e?k(I(">"),it(mt,">"),F,It):"extends"==e||"implements"==e||c&&","==t?("implements"==e&&(O.marked="keyword"),k(c?ht:z,It)):"{"==t?k(I("}"),Ft,F):void 0}function Ft(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||c&&j(e))&&O.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",k(Ft)):"variable"==t||"keyword"==O.style?(O.marked="property",k(c?Rt:Et,Ft)):"number"==t||"string"==t?k(c?Rt:Et,Ft):"["==t?k(z,st,R("]"),c?Rt:Et,Ft):"*"==e?(O.marked="keyword",k(Ft)):c&&"("==t?S(Mt,Ft):";"==t||","==t?k(Ft):"}"==t?k():"@"==e?k(z,Ft):void 0}function Rt(t,e){if("?"==e)return k(Rt);if(":"==t)return k(ht,Ot);if("="==e)return k(H);var n=O.state.lexical.prev;return S(n&&"interface"==n.info?Mt:Et)}function _t(t,e){return"*"==e?(O.marked="keyword",k(Bt,R(";"))):"default"==e?(O.marked="keyword",k(z,R(";"))):"{"==t?k(it(Vt,"}"),Bt,R(";")):S(_)}function Vt(t,e){return"as"==e?(O.marked="keyword",k(R("variable"))):"variable"==t?S(H,Vt):void 0}function zt(t){return"string"==t?k():"("==t?S(z):S(Ht,$t,Bt)}function Ht(t,e){return"{"==t?ot(Ht,"}"):("variable"==t&&P(e),"*"==e&&(O.marked="keyword"),k(Wt))}function $t(t){if(","==t)return k(Ht,$t)}function Wt(t,e){if("as"==e)return O.marked="keyword",k(Ht)}function Bt(t,e){if("from"==e)return O.marked="keyword",k(z)}function Ut(t){return"]"==t?k():S(it(H,"]"))}function qt(){return S(I("form"),wt,R("{"),I("}"),it(Gt,"}"),F,F)}function Gt(){return S(wt,Ot)}function Kt(t,e,n){return e.tokenize==g&&/^(?: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:g,lastType:"sof",cc:[],lexical:new x((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new E(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(),b(t,e)),e.tokenize!=v&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(t,e,n,r,i){var o=t.cc;for(O.state=t,O.stream=i,O.marked=null,O.cc=o,O.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((o.length?o.pop():l?z:_)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return O.marked?O.marked:"variable"==n&&C(t,r)?"variable-2":e}}(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==v)return t.Pass;if(e.tokenize!=g)return 0;var i,s=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==F)l=l.prev;else if(u!=kt)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==U||i==q)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var h=l.type,f=s==h;return"vardef"==h?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==h&&"{"==s?l.indented:"form"==h?l.indented+o:"stat"==h?l.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"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Kt,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=z&&e!=H||t.cc.pop()}}})),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/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(10))},function(t,e,n){!function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,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"),l="",c=0,u=0===e.ch;function h(){l+="\n",u=!0,++c}for(var d=0;d<o.length;++d){for(var f=new t.StringStream(o[d],s);!f.eol();){var p=t.innerMode(i,a),g=i.token(f,a),v=f.current();f.start=f.pos,u&&!/\S/.test(v)||(l+=v,u=!1),!u&&p.mode.newlineAfterToken&&p.mode.newlineAfterToken(g,v,f.string.slice(f.pos)||o[d+1]||"",p.state)&&h()}!f.pos&&i.blankLine&&i.blankLine(a),!u&&d<o.length-1&&h()}r.operation((function(){r.replaceRange(l,e,n);for(var t=e.line+1,i=e.line+c;t<=i;++t)r.indentLine(t,"smart");r.setSelection(e,r.getCursor(!1))}))}))}(n(10))},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=n(31);e.default=i.a.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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;var n=this.pfx,r=this.ppfx,i=this.parent,o=this.collection;this.listenTo(o,"add",this.addTo),this.listenTo(o,"reset resetNavigator",this.render),this.listenTo(o,"remove",this.removeChildren),this.className="".concat(n,"layers");var a=e.em;if(e.sortable&&!this.opt.sorter){var s=a.get("Utils");this.opt.sorter=new s.Sorter({container:e.sortContainer||this.el,containerSel:".".concat(this.className),itemSel:".".concat(n,"layer"),ignoreViewChildren:1,onEndMove:function(t,e){var n=e.getSourceModel();a.setSelected(n,{forceChange:1})},avoidSelectOnEnd:1,nested:1,ppfx:r,pfx:n})}this.sorter=this.opt.sorter||"",this.$el.data("collection",o),i&&this.$el.data("model",i)},removeChildren:function(t){var e=t.viewLayer;e&&e.remove.apply(e)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=this.level,i=e||null,a=new(0,o.a)({level:r,model:t,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}).render().el;if(i)i.appendChild(a);else if(void 0!==n){var s="before";this.$el.children().length==n&&(n--,s="after"),n<0?this.$el.append(a):this.$el.children().eq(n)[s](a)}else this.$el.append(a);return a},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":37,"./CanvasClear.js":37,"./CanvasMove":38,"./CanvasMove.js":38,"./CommandAbstract":19,"./CommandAbstract.js":19,"./ComponentDelete":39,"./ComponentDelete.js":39,"./ComponentDrag":40,"./ComponentDrag.js":40,"./ComponentEnter":41,"./ComponentEnter.js":41,"./ComponentExit":42,"./ComponentExit.js":42,"./ComponentNext":43,"./ComponentNext.js":43,"./ComponentPrev":44,"./ComponentPrev.js":44,"./ComponentStyleClear":45,"./ComponentStyleClear.js":45,"./CopyComponent":46,"./CopyComponent.js":46,"./DeleteComponent":47,"./DeleteComponent.js":47,"./ExportTemplate":48,"./ExportTemplate.js":48,"./Fullscreen":49,"./Fullscreen.js":49,"./MoveComponent":50,"./MoveComponent.js":50,"./OpenAssets":51,"./OpenAssets.js":51,"./OpenBlocks":52,"./OpenBlocks.js":52,"./OpenLayers":53,"./OpenLayers.js":53,"./OpenStyleManager":54,"./OpenStyleManager.js":54,"./OpenTraitManager":55,"./OpenTraitManager.js":55,"./PasteComponent":56,"./PasteComponent.js":56,"./Preview":57,"./Preview.js":57,"./Resize":58,"./Resize.js":58,"./SelectComponent":12,"./SelectComponent.js":12,"./SelectPosition":24,"./SelectPosition.js":24,"./ShowOffset":59,"./ShowOffset.js":59,"./SwitchVisibility":60,"./SwitchVisibility.js":60};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=83},function(t,e,n){"use strict";n.r(e);var r=n(6),i=n.n(r),o=n(2),a=n.n(o),s=n(1),l=n.n(s),c=n(0),u={stylePrefix:"comp-",wrapperId:"wrapper",wrapperName:"Body",wrapper:{removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]},components:[],draggableComponents:1,storeWrapper:0,processor:0,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]},h=n(4),d=n(18),f=n(5),p=n(30);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}var v=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"cell",tagName:"td",draggable:["tr"]})},{isComponent:function(t){var e="",n=t.tagName;return"TD"!=n&&"TH"!=n||(e={type:"cell",tagName:n.toLowerCase()}),e}}),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}var b=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"row",tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]}),initialize:function(t,e){h.default.prototype.initialize.apply(this,arguments);var n=[],r=this.get("components");r.each((function(t){return t.is("cell")&&n.push(t)})),r.reset(n)}},{isComponent:function(t){var e="";return"TR"==t.tagName&&(e={type:"row"}),e}}),w=f.default.extend({});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}var C=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"table",tagName:"table",droppable:["tbody","thead","tfoot"]}),initialize:function(t,e){h.default.prototype.initialize.apply(this,arguments);var n=this.get("components");!n.length&&n.add({type:"tbody"})}},{isComponent:function(t){var e="";return"TABLE"==t.tagName&&(e={type:"table"}),e}}),O=f.default.extend({events:{}});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}var k=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"tbody",tagName:"tbody",draggable:["table"],droppable:["tr"],columns:1,rows:1}),initialize:function(t,e){h.default.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){var e="";return"TBODY"==t.tagName&&(e={type:"tbody"}),e}});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}var P=k.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},k.prototype.defaults,{type:"thead",tagName:"thead"})},{isComponent:function(t){var e="";return"THEAD"==t.tagName&&(e={type:"thead"}),e}}),j=f.default.extend({}),E=f.default.extend({});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}var D=k.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},k.prototype.defaults,{type:"tfoot",tagName:"tfoot"})},{isComponent:function(t){var e="";return"TFOOT"==t.tagName&&(e={type:"tfoot"}),e}}),A=f.default.extend({});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 N='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)"',I=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"image",tagName:"img",void:1,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat(N,'>\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,'>\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){h.default.prototype.initialize.apply(this,arguments);var n=this.get("attributes");n.src&&this.set("src",n.src)},initToolbar:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];h.default.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"),l=0;l<s.length;l++)if("image-editor"===s[l].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=h.default.prototype.getAttrToHTML.apply(this,e),i=this.get("src");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(c.result)(this,"defaults").src},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){var e="";return"IMG"==t.tagName&&(e={type:"image"}),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}var R=I.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},I.prototype.defaults,{type:"map",src:"",void:0,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:h.default.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(),I.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"==t.tagName&&/maps\.google\.com/.test(t.src)&&(e={type:"map",src:t.src}),e}}),_=f.default.extend({tagName:"img",events:{dblclick:"onActive",click:"initResize",error:"onError",dragstart:"noDrag"},initialize:function(t){var e=this.model;f.default.prototype.initialize.apply(this,arguments),this.listenTo(e,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image");var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),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(c.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.opts.config.em,n=e?e.get("Editor"):"";n&&this.model.get("editable")&&n.runCommand("open-assets",{target:this.model,types:["image"],accept:"image/*",onSelect:function(){n.Modal.close(),n.AssetManager.setTarget(null)}})},onError:function(){var t=this.model.getSrcResult({fallback:1});t&&(this.el.src=t)},noDrag:function(t){return t.preventDefault(),!1},render:function(){this.renderAttributes(),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}}),V=_.extend({tagName:"div",events:{},initialize:function(t){_.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 _.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}var H=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"text",droppable:!1,editable:!0}),toHTML:function(){return this.trigger("sync:content",{silent:1}),h.default.prototype.toHTML.apply(this,arguments)}});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 W=H.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},H.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=H.prototype.getAttrToHTML.apply(this,e);return delete r.onmousedown,r}},{isComponent:function(t){var e;if("A"==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}}),B=n(3);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 q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var G=f.default.prototype,K=f.default.extend({events:{dblclick:"onActive",input:"onInput"},initialize:function(t){G.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){if(!this.rteEnabled&&this.model.get("editable")){t&&t.stopPropagation&&t.stopPropagation();var e=this.rte;if(e)try{this.activeRte=e.enable(this,this.activeRte)}catch(t){console.error(t)}this.rteEnabled=1,this.toggleEvents(1)}},disableEditing:function(){var t=this.model,e=this.rte,n=this.activeRte,r=t.get("editable");if(e&&r){try{e.disable(this,n)}catch(t){console.error(t)}this.syncContent()}this.rteEnabled=0,this.toggleEvents()},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.getChildrenContainer().innerHTML,o=e.components(),a=q({fromDisable:1},t);if(o.length&&o.reset(null,t),e.set("content","",a),n.customRte)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(q({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)}))};!t.silent&&e.trigger("change:content",e,"",a),o.add(i,t),o.each((function(t){return s(t)})),o.trigger("resetNavigator")}}},onInput:function(){var t=this.em;t&&t.trigger("change:canvasOffset")},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=t?"on":"off",n={on:B.p,off:B.o};this.em.setEditing(t);var r=[this.el.ownerDocument,document];if(n.off(r,"mousedown",this.disableEditing),n[e](r,"mousedown",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[e]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var i=this.el;i;)i.draggable=!t,"BODY"==(i=i.parentNode).tagName&&(i=0)}}),Y=K.extend({render:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return K.prototype.render.apply(this,e),this.el.addEventListener("click",this.prevDef,!0),this}});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}var J=H.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},H.prototype.defaults,{tagName:"label",traits:["id","title","for"]})},{isComponent:function(t){if("LABEL"==t.tagName)return{type:"label"}}}),Z=Y.extend({});function Q(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 tt="yt",et="vi",nt="ytnc",rt=I.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},I.prototype.defaults,{type:"video",tagName:"video",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:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"},toolbar:h.default.prototype.defaults.toolbar}),initialize:function(t,e){var n=[],r=this.get("provider");switch(r){case tt:case nt:n=this.getYoutubeTraits();break;case et:n=this.getVimeoTraits();break;default:n=this.getSourceTraits()}this.get("src")&&this.parseFromSrc(),this.set("traits",n),I.prototype.initialize.apply(this,arguments),this.listenTo(this,"change:provider",this.updateTraits),this.listenTo(this,"change:videoId change:provider",this.updateSrc)},initToolbar:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];h.default.prototype.initToolbar.apply(this,e)},parseFromSrc:function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case tt:case nt:case et:var r=e.pathname.split("/").pop();this.set("videoId",r),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(){switch(this.get("provider")){case tt:this.set("src",this.getYoutubeSrc());break;case nt:this.set("src",this.getYoutubeNoCookieSrc());break;case et:this.set("src",this.getVimeoSrc())}},getAttrToHTML:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=I.prototype.getAttrToHTML.apply(this,e),i=this.get("provider");switch(i){case tt:case nt:case et:break;default:this.get("loop")&&(r.loop="loop"),this.get("autoplay")&&(r.autoplay="autoplay"),this.get("controls")&&(r.controls="controls")}return r},updateTraits:function(){var t=this.get("provider"),e=this.getSourceTraits();switch(t){case tt:case nt:this.set("tagName","iframe"),e=this.getYoutubeTraits();break;case et:this.set("tagName","iframe"),e=this.getVimeoTraits();break;default:this.set("tagName","video")}this.loadTraits(e),this.em.trigger("component:toggled")},getProviderTrait:function(){return{type:"select",label:"Provider",name:"provider",changeProp:1,options:[{value:"so",name:"HTML5 Source"},{value:tt,name:"Youtube"},{value:nt,name:"Youtube (no cookie)"},{value:et,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",changeProp:1},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");return e+=t+"?",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=/youtube\.com\/embed/.test(t.src),r=/youtube-nocookie\.com\/embed/.test(t.src),i=/player\.vimeo\.com\/video/.test(t.src),o=n||r||i;return("VIDEO"==t.tagName||"IFRAME"==t.tagName&&o)&&(e={type:"video"},t.src&&(e.src=t.src),o&&(n?e.provider=tt:r?e.provider=nt:i&&(e.provider=et))),e}}),it=_.extend({tagName:"div",events:{},initialize:function(t){f.default.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:src",this.updateSrc),this.listenTo(this.model,"change:loop change:autoplay change:controls change:color change:rel change:modestbranding change:poster",this.updateVideo),this.listenTo(this.model,"change:provider",this.updateProvider)},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];_.prototype.render.apply(this,e),this.updateClasses();var r=this.model.get("provider");return this.el.appendChild(this.renderByProvider(r)),this}});function ot(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 at=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{type:"script",droppable:!1,draggable:!1,layerable:!1})},{isComponent:function(t){if("SCRIPT"==t.tagName){var e={type:"script"};return t.src&&(e.src=t.src,e.onload=t.onload),e}}}),st=_.extend({tagName:"script",events:{},render:function(){var t=this.model,e=t.get("src"),n=this.em,r=n&&n.get("scriptCount")?n.get("scriptCount"):0,i="";if(e){var o=t.get("onload"),a="script"+r,s="script"+(r+1);i="var "+a+" = document.createElement('script');\n"+a+".onload = function(){\n"+(o?o+"();\n":"")+"typeof "+s+"Start == 'function' && "+s+"Start();\n};\n"+a+".src = '"+e+"';\nfunction "+a+"Start() { document.body.appendChild("+a+"); };\n"+(r?"":a+"Start();"),n&&n.set("scriptCount",r+1)}else i=t.get("content");return this.el.innerHTML=i,this}});function lt(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 ct=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{highlightable:0}),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){if(SVGElement&&t instanceof SVGElement){var e=t.tagName;return{tagName:e,type:"svg",resizable:"svg"==e}}}}),ut=f.default.extend({_createElement:function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}});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 dt=h.default.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ht(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ht(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},h.default.prototype.defaults,{droppable:!1,layerable:!1,editable:!0}),toHTML:function(){return this.get("content")}},{isComponent:function(t){var e="";return 3===t.nodeType&&(e={type:"textnode",content:t.textContent}),e}});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}var pt=dt.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},dt.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}}}),gt=l.a.View.extend({initialize:function(){var t=this.$el,e=this.model;t.data("model",e),e.view=this},_createElement:function(){return document.createTextNode(this.model.get("content"))}}),vt=gt.extend({_createElement:function(){return document.createComment(this.model.get("content"))}}),mt=h.default.extend({},{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 bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r={},o=[{id:"cell",model:v,view:m},{id:"row",model:b,view:w},{id:"table",model:C,view:O},{id:"thead",model:P,view:j},{id:"tbody",model:k,view:E},{id:"tfoot",model:D,view:A},{id:"map",model:R,view:V},{id:"link",model:W,view:Y},{id:"label",model:J,view:Z},{id:"video",model:rt,view:it},{id:"image",model:I,view:_},{id:"script",model:at,view:st},{id:"svg",model:ct,view:ut},{id:"comment",model:pt,view:vt},{id:"textnode",model:dt,view:gt},{id:"text",model:H,view:K},{id:"wrapper",model:mt,view:f.default},{id:"default",model:h.default,view:f.default}];return{Component:h.default,Components:d.a,ComponentsView:p.a,componentTypes:o,componentsById:{},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(i){var a=this;for(var s in t=(r=i||{}).em,this.em=t,t&&(r.components=t.config.components||r.components),u)s in r||(r[s]=u[s]);var l=r.pStylePrefix;if(l&&(r.stylePrefix=l+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 c=t.get("selected");t.listenTo(c,"add",(function(t,e,n){return a.selectAdd(t,n)})),t.listenTo(c,"remove",(function(t,e,n){return a.selectRemove(t,n)}))}var d=r.components,p=bt({},r.wrapper);return p["custom-name"]=r.wrapperName,p.wrapper=1,p.type="wrapper",d&&d.constructor===Object&&d.wrapper&&(p=bt({},d),d=d.components||[],p.components=[],t&&(t.config.components=d,r.components=d)),(e=new h.default(p,{em:t,config:r,componentTypes:o,domc:this})).set({attributes:{id:"wrapper"}}),n=new f.default({model:e,config:r,componentTypes:o}),this},onLoad:function(){this.setComponents(r.components)},postLoad:function(t){this.handleChanges(this.getWrapper(),null,{avoidStore:1})},handleChanges:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.components(),a=t.get("UndoManager"),s=t.handleUpdates.bind(t),l=this.handleChanges.bind(this),c=this.handleChangesColl.bind(this),u=this.handleRemoves.bind(this);a&&a.add(e),a&&o&&a.add(o);var h="change:style change:content change:attributes change:src";[[e,h,s],[e,"change:components",c],[o,"add",l],[o,"remove",u],[e.get("classes"),"add remove",s]].forEach((function(e){t.stopListening(e[0],e[1],e[2]),t.listenTo(e[0],e[1],e[2])})),!i.avoidStore&&s("","",i),o.each((function(t){return r.handleChanges(t,n,i)}))},handleChangesColl:function(e,n){var r=t.get("UndoManager");if(r&&n instanceof l.a.Collection){var i=this.handleChanges.bind(this),o=this.handleRemoves.bind(this);r.add(n),[[n,"add",i],[n,"remove",o]].forEach((function(e){t.stopListening(e[0],e[1],e[2]),t.listenTo(e[0],e[1],e[2])}))}},handleRemoves:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!r.avoidStore&&t.handleUpdates(e,n,r)},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(c.isObject)(o)||Object(c.isArray)(o))n=o;else try{n=JSON.parse(o)}catch(t){e&&e.logError(t)}else a&&(n=a);var s=n&&n.constructor===Object;return(n&&n.length||s)&&(this.clear(),s?this.getWrapper().set(n):this.getComponents().add(n)),n},store:function(t){if(r.stm){var e={},n=this.storageKey();if(n.indexOf("html")>=0&&(e.html=r.em.getHtml()),n.indexOf("components")>=0){this.em;var i=r.storeWrapper?this.getWrapper():this.getComponents();e.components=JSON.stringify(i)}return t||r.stm.store(e),e}},getComponent:function(){return e},getWrapper:function(){return this.getComponent()},getComponents:function(){return this.getWrapper().get("components")},addComponent:function(t){return this.getComponents().add(t)},render:function(){return n.render().el},clear:function(){return this.getComponents().map((function(t){return t})).forEach((function(t){return t.remove()})),this},setComponents:function(t){this.clear().addComponent(t)},addType:function(t,e){var n=this.em,r=e.model,a=void 0===r?{}:r,s=e.view,l=void 0===s?{}:s,u=e.isComponent,h=e.extend,d=e.extendView,f=e.extendFn,p=void 0===f?[]:f,g=e.extendFnView,v=void 0===g?[]:g,m=this.getType(t),y=this.getType(h),b=this.getType(d),w=y||(m||this.getType("default")),x=w.model,C=b?b.view:w.view,O=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"===i()(a)&&(e.model=x.extend(bt({},a,{},O(p,a,x),{defaults:bt({},x.prototype.defaults,{},Object(c.result)(a,"defaults")||{})}),{isComponent:!m||y||u?u||function(){return 0}:x.isComponent})),"object"===i()(l)&&(e.view=C.extend(bt({},l,{},O(v,l,C)))),m?(m.model=e.model,m.view=e.view):(e.id=t,o.unshift(e));var S="component:type:".concat(m?"update":"add");return n&&n.trigger(S,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");n&&"hovered"==n.get("status")&&n.set({status:"",state:""}),e&&Object(c.isEmpty)(e.get("status"))&&e.set("status","hovered")}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(21),a=n.n(o),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, #wrapper {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n #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,avoidInlineStyle:1,avoidDefaults:1,clearStyles:0,dragMode:0,el:"",undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{name:"Desktop",width:""},{name:"Tablet",width:"768px",widthMedia:"992px"},{name:"Mobile landscape",width:"568px",widthMedia:"768px"},{name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{name:"Flex",open:!1,buildProps:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,buildProps:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,buildProps:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"],properties:[{property:"text-align",list:[{value:"left",className:"fa fa-align-left"},{value:"center",className:"fa fa-align-center"},{value:"right",className:"fa fa-align-right"},{value:"justify",className:"fa fa-align-justify"}]}]},{name:"Decorations",open:!1,buildProps:["border-radius-c","background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,buildProps:["transition","perspective","transform"]}]},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:0,multiFrames:0},l=n(0),c=n(1),u=n.n(c),h=n(3);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 f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p,g,v=[n(99),n(67),n(68),n(97),n(93),n(96),n(95),n(61),n(94),n(90),n(89),n(98),n(87),n(91),n(86),n(84),n(62),n(92),n(100),n(88)],m=u.a.Collection;!function(t){var e=t.$,n=t.Backbone;if(n){var r=n.View.prototype,i={};r.eventNsMap=i,r.delegate=function(t,e,n){var r=".delegateEvents"+this.cid;this.$el.on(t,e,n);var o=i[r];return o||(o=[],i[r]=o),o.push({eventName:t,selector:e,listener:n}),this},r.undelegateEvents=function(){var t=this,e=".delegateEvents"+this.cid;if(this.$el){var n=i[e];n&&n.forEach((function(e){var n=e.eventName;e.selector,e.listener;t.$el.off(n)}))}return this},r.undelegate=function(t,e,n){var r=this,o=".delegateEvents"+this.cid,a=i[o];return a&&a.forEach((function(n){var i=n.eventName,o=n.selector;n.listener;i==t&&o==e&&r.$el.off(i)})),this}}if(e&&"jQuery"!==e.prototype.constructor.name){var o=e.fn,a=e.prototype.on,s=e.prototype.off,c=e.prototype.trigger,u=e.prototype.offset,h=function(t){return t.split(/[,\s]+/g)},d=function(t){return t.split(".")};o.on=function(t,e,n,r){var i=this;if("string"==typeof t){var o=h(t);if(1==o.length){t=o[0];var s=d(t);if(0!==t.indexOf(".")&&(t=s[0]),(s=s.slice(1)).length){this.data("_cashNs");this.data("_cashNs",s)}return a.call(this,t,e,n,r)}return o.forEach((function(t){return i.on(t,e,n,r)})),this}return a.call(this,t,e,n,r)},o.off=function(t,e){var n=this;if("string"==typeof t){var r=h(t);if(1==r.length){t=r[0];var i=d(t);return 0!==t.indexOf(".")&&(t=i[0]),(i=i.slice(1)).length,s.call(this,t,e)}return r.forEach((function(t){return n.off(t,e)})),this}return s.call(this,t,e)},o.trigger=function(t,n){var r=this;if(t instanceof e.Event)return this.trigger(t.type,n);if("string"==typeof t){var i=h(t);if(1==i.length){t=i[0];var o=d(t);return 0!==t.indexOf(".")&&(t=o[0]),(o=o.slice(1)).length,c.call(this,t,n)}return i.forEach((function(t){return r.trigger(t,n)})),this}return c.call(this,t,n)},o.hide=function(){return this.css("display","none")},o.show=function(){return this.css("display","block")},o.focus=function(){var t=this.get(0);return t&&t.focus(),this},o.removeClass=function(t){if(!arguments.length)return this.attr("class","");var e=Object(l.isString)(t)&&t.match(/\S+/g);return e?this.each((function(t){Object(l.each)(e,(function(e){if(t.classList)t.classList.remove(e);else{var n=t.className,r=t.className.baseVal;Object(l.isUndefined)(r)?t.className=n.replace(e,""):n.baseVal=r.replace(e,"")}}))})):this},o.remove=function(){return this.each((function(t){return t.parentNode&&t.parentNode.removeChild(t)}))},o.bind=function(t,e){return this.on(t,e)},o.unbind=function(t,e){if(Object(l.isObject)(t)){for(var n in t)t.hasOwnProperty(n)&&this.off(n,t[n]);return this}return this.off(t,e)},o.click=function(t){return t?this.on("click",t):this.trigger("click")},o.change=function(t){return t?this.on("change",t):this.trigger("change")},o.keydown=function(t){return t?this.on("keydown",t):this.trigger("keydown")},o.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,(function(t){t.data=n,r(t)}))},o.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},o.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},o.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")),u.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 f=Array.prototype.indexOf;e.inArray=function(t,e,n){return null==e?-1:f.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:u.a,$:u.a.$});var y=u.a.$,b={debug:console.log,info:console.info,warning:console.warn,error:console.error},w=u.a.Model.extend({defaults:function(){return{editing:0,selected:new m,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("dmode",e.dragMode);var n=e.el,r=e.log,i=!0===r?Object(l.keys)(b):Object(l.isArray)(r)?r:[];n&&e.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?Object(l.toArray)(n.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):"",v.forEach((function(e){return t.loadModule(e)})),this.on("change:componentHovered",this.componentHovered,this),this.on("change:changesCount",this.updateChanges,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,"'"))}))}))},getContainer:function(){return this.config.el},listenLog:function(t){this.listenTo(this,"log:".concat(t),b[t])},getConfig:function(t){var e=this.config;return Object(l.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)})),e&&e()};n&&n.canAutoload()?this.load(r):r()},updateChanges:function(){var t=this,e=this.get("StorageManager"),n=this.get("changesCount");g&&clearTimeout(g),g=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(l.isUndefined)(e[r])?e[n.name]:e[r],o=i||{},a=this.get("StorageManager");if(o.pStylePrefix=e.pStylePrefix||"",Object(l.isUndefined)(i)||i||(o._disable=1),n.storageKey&&n.store&&n.load&&a){o.stm=a;var s=this.get("storables");s.push(n),this.set("storables",s)}return o.em=this,n.init(f({},o)),!n.private&&this.set(n.name,n),n.onLoad&&this.get("toLoad").push(n),this.get("modules").push(n),this},init:function(t){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]:{};r.temporary||(p&&clearInterval(p),p=setTimeout((function(){r.avoidStore||n.set("changesCount",n.get("changesCount")+1,r)}),0))},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").last()},getSelectedAll:function(){return this.get("selected").models},setSelected:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.scroll,o=Object(l.isArray)(t),a=o?t:[t],s=this.get("selected");o&&this.removeSelected(s.filter((function(t){return!Object(l.contains)(a,t)}))),a.forEach((function(t){var i=Object(h.f)(t,y);i&&!i.get("selectable")||(!o&&n.removeSelected(s.filter((function(t){return t!==i}))),n.addSelected(i,r),e=i)})),i&&e&&this.get("Canvas").scrollTo(e,i)},addSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.f)(t,y),i=Object(l.isArray)(r)?r:[r];i.forEach((function(t){if(!t||t.get("selectable")){var r=e.get("selected");n.forceChange&&r.remove(t,n),r.push(t,n)}}))},removeSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get("selected").remove(Object(h.f)(t,y),e)},toggleSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.f)(t,y),i=Object(l.isArray)(r)?r:[r];i.forEach((function(t){e.get("selected").contains(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.f)(t,y);n&&!n.get("hoverable")||(e.forceChange&&this.set("componentHovered",""),this.set("componentHovered",n,e))},setComponents:function(t){return this.get("DomComponents").setComponents(t)},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){for(var e=this.get("CssComposer").getAll(),n=0,r=e.length;n<r;n++)e.pop();return e.add(t),this},getStyle:function(){return this.get("CssComposer").getAll()},getHtml:function(){var t=this.config,e=t.exportWrapper,n=t.wrapperIsBody,r=t.jsInHtml?this.getJs():"",i=this.get("DomComponents").getComponent(),o=this.get("CodeManager").getCode(i,"html",{exportWrapper:e,wrapperIsBody:n});return o+=r?"<script>".concat(r,"<\/script>"):""},getCss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.wrapperIsBody,r=t.avoidProtected,i=Object(l.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,o=this.get("CssComposer"),a=this.get("DomComponents").getComponent(),s=r?"":e.protectedCss;return s+this.get("CodeManager").getCode(a,"css",{cssc:o,wrapperIsBody:n,keepUnusedStyles:i})},getJs:function(){var t=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(t,"js").trim()},store:function(t){var e=this,n=this.get("StorageManager"),r={};if(n)return this.get("storables").forEach((function(t){var e=t.store(1);for(var n in e)r[n]=e[n]})),n.store(r,(function(n){t&&t(n),e.set("changesCount",0),e.trigger("storage:store",r)})),r},load:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,(function(n){t.get("storables").forEach((function(t){return t.load(n)})),e&&e(n)}))},getCacheLoad:function(t,e){var n=this,r=t?1:0;if(this.cacheLoad&&!r)return this.cacheLoad;var i=this.get("StorageManager"),o=[];if(!i)return{};this.get("storables").forEach((function(t){var e=t.storageKey;((e="function"==typeof e?e():e)instanceof Array?e:[e]).forEach((function(t){o.push(t)}))})),i.load(o,(function(t){n.cacheLoad=t,e&&e(t),setTimeout((function(){return n.trigger("storage:load",t)}),0)}))},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").get(this.config.defaultCommand);e&&(e.stop(this,this,t),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",null),this.set("canvasOffset",this.get("Canvas").getOffset())},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()},getDirtyCount:function(){return this.get("changesCount")},getZoomDecimal:function(){return this.get("Canvas").getZoomDecimal()},setDragMode:function(t){return this.set("dmode",t)},inAbsoluteMode:function(){return"absolute"===this.get("dmode")},destroyAll:function(){var t=this.attributes,e=t.DomComponents,n=t.CssComposer,r=t.UndoManager,i=t.Panels,o=t.Canvas,a=t.Keymaps;e.clear(),n.clear(),r.clear().removeAll(),i.getPanels().reset(),o.getCanvasView().remove(),a.removeAll(),this.view.remove(),this.stopListening(),y(this.config.el).empty().attr(this.attrsOrig)},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,f({},e,{level:"info"}))},logWarning:function(t,e){this.log(t,f({},e,{level:"warning"}))},logError:function(t,e){this.log(t,f({},e,{level:"error"}))},data:function(t,e,n){if(t["_gjs-data"]||(t["_gjs-data"]={}),Object(l.isUndefined)(n))return t["_gjs-data"][e];t["_gjs-data"][e]=n}}),x=u.a.$,C=u.a.View.extend({initialize:function(){var t=this,e=this.model;e.view=this,this.conf=e.config,this.pn=e.get("Panels"),e.on("loaded",(function(){t.pn.active(),t.pn.disableButtons(),e.runDefault(),setTimeout((function(){return e.trigger("load",e.get("Editor"))}))}))},render:function(){var t=this.model,e=this.$el,n=this.conf,r=x(n.el||"body ".concat(n.container)),i=n.stylePrefix;return e.empty(),n.width&&r.css("width",n.width),n.height&&r.css("height",n.height),e.append(t.get("Canvas").render()),e.append(this.pn.render()),e.attr("class","".concat(i,"editor ").concat(i,"one-bg ").concat(i,"two-color")),r.addClass("".concat(i,"editor-cont")).empty().append(e),this}});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 S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=S({},s,{},t);e.pStylePrefix=e.stylePrefix;var n=new w(e),r=new C({model:n,config:e});return{$:a.a,editor:n,DomComponents:n.get("DomComponents"),LayerManager:n.get("LayerManager"),CssComposer:n.get("CssComposer"),StorageManager:n.get("StorageManager"),AssetManager:n.get("AssetManager"),BlockManager:n.get("BlockManager"),TraitManager:n.get("TraitManager"),SelectorManager:n.get("SelectorManager"),CodeManager:n.get("CodeManager"),Commands:n.get("Commands"),Keymaps:n.get("Keymaps"),Modal:n.get("Modal"),Panels:n.get("Panels"),StyleManager:n.get("StyleManager"),Canvas:n.get("Canvas"),UndoManager:n.get("UndoManager"),DeviceManager:n.get("DeviceManager"),RichTextEditor:n.get("RichTextEditor"),Parser:n.get("Parser"),Utils:n.get("Utils"),Config:n.get("Config"),init:function(){return n.init(this),this},getConfig:function(t){return n.getConfig(t)},getHtml:function(t){return n.getHtml(t)},getCss:function(t){return n.getCss(t)},getJs:function(){return n.getJs()},getComponents:function(){return n.get("DomComponents").getComponents()},getWrapper:function(){return n.get("DomComponents").getWrapper()},setComponents:function(t){return n.setComponents(t),this},addComponents:function(t,e){return this.getWrapper().append(t,e)},getStyle:function(){return n.get("CssComposer").getAll()},setStyle:function(t){return n.setStyle(t),this},getSelected:function(){return n.getSelected()},getSelectedAll:function(){return n.getSelectedAll()},getSelectedToStyle:function(){var t=n.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},select:function(t,e){return n.setSelected(t,e),this},selectAdd:function(t){return n.addSelected(t),this},selectRemove:function(t){return n.removeSelected(t),this},selectToggle:function(t){return n.toggleSelected(t),this},setDevice:function(t){return n.set("device",t),this},getDevice:function(){return n.get("device")},runCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").run(t,e)},stopCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").stop(t,e)},store:function(t){return n.store(t)},load:function(t){return n.load(t)},getContainer:function(){return e.el},getDirtyCount:function(){return n.getDirtyCount()},refresh:function(){n.refreshCanvas()},setCustomRte:function(t){this.RichTextEditor.customRte=t},setCustomParserCss:function(t){return this.Parser.getConfig().parserCss=t,this},setDragMode:function(t){return n.setDragMode(t),this},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.log(t,e),this},on:function(t,e){return n.on(t,e),this},once:function(t,e){return n.once(t,e),this},off:function(t,e){return n.off(t,e),this},trigger:function(t){return n.trigger.apply(n,arguments),this},destroy:function(){return n.destroyAll()},getEl:function(){return r.el},getModel:function(){return n},render:function(){var t=this;return n.on("loaded",(function(){t.UndoManager.clear(),n.get("modules").forEach((function(t){t.postRender&&t.postRender(r)}))})),r.render(),r.el}}},T={plugins:[]};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 j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}!function(){if(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 E=new function(t){var e=t||{};for(var n in T)n in e||(e[n]=T[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}}},M=[],D={autorender:1,plugins:[],pluginsOpts:{}};e.default={$:a.a,editors:M,plugins:E,version:"0.15.8",init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.container;if(!e)throw new Error("'container' is required");(t=j({},D,{},t)).el=Object(l.isElement)(e)?e:document.querySelector(e);var n=new k(t).init();return t.plugins.forEach((function(e){var r=E.get(e),i=t.pluginsOpts[e]||{};if(!r){var o=window[e];r=o&&o.default?o.default:o}r?r(n,i):Object(l.isFunction)(e)?e(n,i):console.warn("Plugin ".concat(e," not found"))})),n.getModel().loadOnStart(),t.autorender&&n.render(),M.push(n),n}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i={stylePrefix:"trt-",appendTo:"",labelContainer:"Component settings",labelPlhText:"eg. Text here",labelPlhHref:"eg. https://google.com",optionsTarget:[{value:"",name:"This window"},{value:"_blank",name:"New window"}],textNoElement:"Select an element before using Trait Manager"},o=n(29),a=n(2),s=n.n(a),l=n(65),c=n.n(l),u=n(1),h=n.n(u),d=n(3);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}var p=h.a.$,g=h.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 l=this.ppfx;this.clsField="".concat(l,"field ").concat(l,"field-").concat(s),[["change:value",this.onValueChange],["remove",this.removeView]].forEach((function(e){var n=c()(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),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(r.isUndefined)(e.value)&&this.model.set("value",e.value),this.onEvent(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},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.model.attributes,e=t.label,n=t.name;return Object(d.b)(e||n).replace(/-/g," ")},getComponent:function(){return this.target},getInputEl:function(){if(!this.$input){var t=this.model,e=t.get("placeholder")||t.get("default")||"",n=t.get("type")||"text",i=t.get("min"),o=t.get("max"),a=this.getModelValue(),s=p('<input type="'.concat(n,'" placeholder="').concat(e,'">'));Object(r.isUndefined)(a)||(t.set({value:a},{silent:!0}),s.prop("value",a)),i&&s.prop("min",i),o&&s.prop("max",o),this.$input=s}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,i=e.get("name");if(e.get("changeProp"))t=n.get(i);else{var o=n.get("attributes");t=e.get("value")||o[i]}return Object(r.isUndefined)(t)?"":t},getElInput:function(){return this.elInput},renderField:function(){var t=this.$el,e=this.appendInput,n=this.model,i=t.find("[data-input]"),o=i[i.length-1],a=n.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),Object(r.isString)(a)?(o.innerHTML=a,this.elInput=o.firstChild):(e?o.appendChild(a):o.insertBefore(a,o.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,i=this.model.attributes.type,o=this.hasLabel&&this.hasLabel(),a="".concat(e,"trait");this.$input=null;var s='<div class="'.concat(a,'">\n ').concat(o?'<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(r.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n </div>\n </div>");return t.empty().append(s),o&&this.renderLabel(),this.renderField(),this.el.className="".concat(a,"__wrp"),this.postUpdate(),this.onRender(this.getClbOpts()),this}}),v=h.a.$,m=g.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=t.get("options")||[],n="<select>";e.forEach((function(t){var e,i,o,a="";Object(r.isString)(t)?(e=t,i=t):(e=t.name||t.label||t.value,i="".concat(Object(r.isUndefined)(t.value)?t.id:t.value).replace(/"/g,"""),a+=(o=t.style?t.style.replace(/"/g,"""):"")?' style="'.concat(o,'"'):""),n+='<option value="'.concat(i,'"').concat(a,">").concat(e,"</option>")})),n+="</select>",this.$input=v(n);var i=t.getTargetValue()||t.get("value");!Object(r.isUndefined)(i)&&this.$input.val(i)}return this.$input.get(0)}}),y=g.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,i=n.valueTrue,o=n.valueFalse;return e&&!Object(r.isUndefined)(i)&&(e=i),e||Object(r.isUndefined)(o)||(e=o),e},getInputEl:function(){for(var t=!this.$input,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o=g.prototype.getInputEl.apply(this,n);if(t){var a,s,l=this.model,c=this.target,u=l.attributes,h=(u.valueTrue,u.valueFalse),d=l.get("name");l.get("changeProp")?s=a=c.get(d):a=!(!(s=c.get("attributes")[d])&&""!==s),Object(r.isUndefined)(h)||s!==h||(a=!1),o.checked=a}return o}}),b=n(28),w=g.extend({getValueForTarget:function(){var t=this.model.attributes,e=t.value,n=t.unit;return e?e+n:""},getInputEl:function(){if(!this.input){var t=this.getModelValue(),e=new b.a({contClass:this.ppfx+"field-int",model:this.model,ppfx:this.ppfx});this.input=e.render(),this.$input=this.input.inputEl,this.$unit=this.input.unitEl,this.model.set("value",t),this.$input.val(t),this.input=e.el}return this.input}}),x=n(32),C=g.extend({templateInput:"",getInputEl:function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new x.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}}),O=g.extend({events:{"click button":"handleClick"},templateInput:"",handleClick:function(){var t=this.model,e=this.em,n=t.get("command");n&&(Object(r.isString)(n)?e.get("Commands").run(n):n(e.get("Editor"),t))},renderLabel:function(){this.model.get("label")&&g.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>")}}),S=o.a.extend({ns:"Traits",itemView:g,reuseView:1,itemsView:{text:g,number:w,select:m,checkbox:y,color:C,button:O},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config||{};this.config=e,this.em=t.editor,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.className=this.pfx+"traits";var n="component:toggled";this.listenTo(this.em,n,this.updatedCollection),this.updatedCollection()},updatedCollection:function(){var t=this.ppfx,e=this.em.getSelected();this.el.className="".concat(this.className," ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=e?e.get("traits"):[],this.render()}});e.default=function(){var t,e={};return{TraitsView:S,name:"TraitManager",getConfig:function(){return e},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=n,Object(r.defaults)(e,i);var o=e.pStylePrefix;return o&&(e.stylePrefix="".concat(o).concat(e.stylePrefix)),t=new S({collection:[],editor:e.em,config:e}),this},postRender:function(){var t=this.getConfig().appendTo;t&&(Object(r.isElement)(t)?t:document.querySelector(t)).appendChild(this.render())},getTraitsViewer:function(){return t},addType:function(e,n){var r=t.itemView;t.itemsView[e]=r.extend(n)},getType:function(e){return t.itemsView[e]},render:function(){return t.render().el}}}},function(t,e,n){"use strict";n.r(e);var r={assets:[],noAssets:"",stylePrefix:"am-",upload:0,uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,autoAdd:1,uploadText:"Drop files here or click to upload",addBtnText:"Add image",customFetch:"",uploadFile:"",embedAsBase64:1,handleAdd:"",dropzone:0,openAssetsOnDrop:1,dropzoneContent:"",modalTitle:"Select Image",inputPlaceholder:"http://path/to/the/image.jpg",beforeUpload:null},i=n(1),o=n.n(i),a=n(2),s=n.n(a),l=o.a.Model.extend({idAttribute:"src",defaults:{type:"",src:""},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}});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}var u=l.extend({defaults:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(n,!0).forEach((function(e){s()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},l.prototype.defaults,{type:"image",unitDim:"px",height:0,width:0})}),h=n(0),d=o.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)},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 ⨯\n </div>\n ')},updateTarget:function(t){t&&t.set&&(t.set("attributes",Object(h.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}}).extend({events:{"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"},getPreview:function(){var t=this.pfx,e=this.model.get("src");return'\n <div class="'.concat(t,'preview" style="background-image: url(\'').concat(e,'\');"></div>\n <div class="').concat(t,"preview-bg ").concat(this.ppfx,'checker-bg"></div>\n ')},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(),'\n <div class="'.concat(t,'name">').concat(n,'</div>\n <div class="').concat(t,'dimensions">').concat(a,"</div>\n ")},init:function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},onClick:function(){var t=this.config.onClick,e=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),Object(h.isFunction)(t)?t(e):this.updateTarget(this.collection.target)},onDblClick:function(){var t=this.em,e=this.model,n=this.config.onDblClick;Object(h.isFunction)(n)?n(e):(this.updateTarget(this.collection.target),t&&t.get("Modal").close());var r=this.collection.onSelect;Object(h.isFunction)(r)&&r(e)},onRemove:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}}),f=n(27),p=o.a.Collection.extend(f.a).extend({types:[{id:"image",model:u,view:d,isType:function(t){return"string"==typeof t?{type:"image",src:t}:t}}]}),g=o.a.View.extend({events:{submit:"handleSubmit"},template:function(t){var e=t.pfx,n=t.ppfx;return'\n <div class="'.concat(e,'assets-cont">\n <div class="').concat(e,'assets-header">\n <form class="').concat(e,'add-asset">\n <div class="').concat(n,"field ").concat(e,'add-field">\n <input placeholder="').concat(t.config.inputPlaceholder,'"/>\n </div>\n <button class="').concat(n,'btn-prim">').concat(t.config.addBtnText,'</button>\n <div style="clear:both"></div>\n </form>\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||"";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.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.rendered=1,this}}),v=n(25),m=o.a.View.extend({template:Object(h.template)('\n <form>\n <div id="<%= pfx %>title"><%= title %></div>\n <input type="file" id="<%= uploadId %>" name="file" accept="*/*" <%= disabled ? \'disabled\' : \'\' %> <%= multiUpload ? \'multiple\' : \'\' %>/>\n <div style="clear:both;"></div>\n </form>\n '),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.config=e,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.config.em;t&&t.trigger("asset:upload:start")},onUploadEnd:function(t){var e=this.$el,n=this.config.em;n&&n.trigger("asset:upload:end",t);var r=e.find("input");r&&r.val("")},onUploadError:function(t){var e=this.config.em;console.error(t),this.onUploadEnd(t),e&&e.trigger("asset:upload:error",t)},onUploadResponse:function(t,e){var n,r=this.config.em,i=this.config,o=this.target;try{n="string"==typeof t?JSON.parse(t):t}catch(e){n=t}r&&r.trigger("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,l=i.customFetch;for(var c in s)a.append(c,s[c]);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 h=i.upload,d=i.headers;if(void 0===d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest"),h){this.onUploadStart();var f={method:"post",credentials:i.credentials||"include",headers:d,body:a};return(l?l(h,f):Object(v.a)(h,f).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()),l=this.ppfx,c="".concat(l,"dropzone-active"),u="".concat(l,"dropzone"),h=function(){o.className=o.className.replace(c,"").trim(),n=0},d=function(){return n||(o.className+=" ".concat(c),n=1),!1},f=function(){return h(),!1},p=function(t){if(h(),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>")),h(),"draggable"in o&&[o,s].forEach((function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=p}))},render:function(){return this.$el.html(this.template({title:this.config.uploadText,uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:this.pfx})),this.initDrop(),this.$el.attr("class",this.pfx+"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=!0,l=!1,c=void 0;try{for(var u,h=function(){var t=u.value,e=new Promise((function(e,n){var r=new FileReader;r.addEventListener("load",(function(i){var o,s=t.name,l=a.exec(t.type);if("image"===(o=l?l[1]:t.type)){var c={src:r.result,name:s,type:o,height:0,width:0},u=new Image;u.addEventListener("error",(function(t){n(t)})),u.addEventListener("load",(function(){c.height=u.height,c.width=u.width,e(c)})),u.src=c.src}else e(o?{src:r.result,name:s,type:o}:r.result)})),r.addEventListener("error",(function(t){n(t)})),r.addEventListener("abort",(function(t){n("Aborted")})),r.readAsDataURL(t)}));o.push(e)},d=r[Symbol.iterator]();!(s=(u=d.next()).done);s=!0)h()}catch(t){l=!0,c=t}finally{try{s||null==d.return||d.return()}finally{if(l)throw c}}Promise.all(o).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"))}});e.default=function(){var t,e,n,i={};return{name:"AssetManager",storageKey:"assets",getConfig:function(){return i},init:function(o){var a=this;for(var s in i=o||{},r)s in i||(i[s]=r[s]);var l=i.pStylePrefix,c=i.em;l&&(i.stylePrefix=l+i.stylePrefix),t=new p([]);var u={collection:new p([]),globalCollection:t,config:i};return n=new m(u),u.fu=n,e=new g(u),t.listenTo(t,"add",(function(t){a.getAllVisible().add(t),c&&c.trigger("asset:add",t)})),t.listenTo(t,"remove",(function(t){a.getAllVisible().remove(t),c&&c.trigger("asset:remove",t)})),this},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]},getAll:function(){return t},getAllVisible:function(){return e.collection},remove:function(t){var e=this.get(t);return this.getAll().remove(e),this},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 e.el},getAssetsEl:function(){return e.el.querySelector("[data-el=assets]")},render:function(t){var n=t||this.getAll().models;return e.rendered||e.render(),e.collection.reset(n),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 e},FileUploader:function(){return n},onLoad:function(){this.getAll().reset(i.assets)},postRender:function(t){i.dropzone&&n.initDropzone(t)},setTarget:function(t){e.collection.target=t},onSelect:function(t){e.collection.onSelect=t},onClick:function(t){i.onClick=t},onDblClick:function(t){i.onDblClick=t}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a={appendTo:"",appendOnClick:0,blocks:[]},s=n(1),l=n.n(s),c=l.a.Model.extend({defaults:{id:"",label:"",open:!0,attributes:{}}}),u=l.a.Model.extend({defaults:{activate:0,select:0,resetId:0,label:"",media:"",content:"",category:"",attributes:{}},initialize:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t=this.get("category");if(t&&"string"==typeof t)new c({id:t,label:t})}}),h=l.a.Collection.extend({model:u}),d=l.a.Collection.extend({model:c}),f=n(3),p=l.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)},handleClick:function(){var t=this.config,e=this.model,n=this.em;if(t.appendOnClick){var r,i=t.getSorter(),o=e.get("content"),a=n.getSelected();if(i.setDropContent(o),a)if(i.validTarget(a.getEl(),o).valid)r=a;else{var s=a.parent();i.validTarget(s.getEl(),o).valid&&(r=s)}if(!r){var l=n.getWrapper();i.validTarget(l.getEl(),o).valid&&(r=l)}var c=r&&r.append(o)[0];c&&n.setSelected(c,{scroll:1})}},startDrag:function(t){var e=this.config,n=this.em;if(0===t.button&&e.getSorter&&!this.el.draggable){n.refreshCanvas();var r=e.getSorter();r.setDragHelper(this.el,t),r.setDropContent(this.model.get("content")),r.startSort(this.el),Object(f.p)(document,"mouseup",this.endDrag)}},handleDragStart:function(t){var e=this.em,n=this.model,r=n.get("content"),i=Object(o.isObject)(r)?JSON.stringify(r):r;e.set("dragResult"),t.dataTransfer.setData("text",i),e.set("dragContent",r),e.trigger("block:drag:start",n,t)},handleDrag:function(t){this.em.trigger("block:drag",this.model,t)},handleDragEnd:function(){var t=this.em,e=this.model,n=t.get("dragResult");if(n){var r=n.get&&n.get("activeOnRender");(e.get("activate")||r)&&(n.trigger("active"),n.set("activeOnRender",0)),e.get("select")&&t.setSelected(n),e.get("resetId")&&n.onAll((function(t){return t.resetId()}))}t.set({dragResult:null,dragContent:null}),t.trigger("block:drag:stop",n,e)},endDrag:function(t){Object(f.o)(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.ppfx,r=this.model,i="".concat(n,"block"),o=r.get("label"),a=r.get("render"),s=r.get("media");e.className+=" ".concat(i," ").concat(n,"one-bg ").concat(n,"four-color-h"),e.innerHTML="\n ".concat(s?'<div class="'.concat(i,'__media">').concat(s,"</div>"):"",'\n <div class="').concat(i,'-label">').concat(o,"</div>\n "),e.title=e.textContent.trim(),Object(f.i)(t)&&e.setAttribute("draggable",!0);var l=a&&a({el:e,model:r,className:i,prefix:n});return l&&(e.innerHTML=l),this}}),g=l.a.View.extend({template:Object(o.template)('\n <div class="<%= pfx %>title">\n <i class="<%= pfx %>caret-icon"></i>\n <%= label %>\n </div>\n <div class="<%= pfx %>blocks-c"></div>\n '),events:{},initialize:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t;var e=this.config.pStylePrefix||"";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["click .".concat(e,"title")]="toggle",this.listenTo(this.model,"change:open",this.updateVisibility),this.delegateEvents()},updateVisibility:function(){this.model.get("open")?this.open():this.close()},open:function(){this.el.className="".concat(this.className," ").concat(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=""},close:function(){this.el.className=this.className,this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display="none"},toggle:function(){var t=this.model;t.set("open",!t.get("open"))},getIconEl:function(){return this.iconEl||(this.iconEl=this.el.querySelector("."+this.iconClass)),this.iconEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector("."+this.pfx+"blocks-c")),this.blocksEl},append:function(t){this.getBlocksEl().appendChild(t)},render:function(){return this.el.innerHTML=this.template({pfx:this.pfx,label:this.model.get("label")}),this.el.className=this.className,this.$el.css({order:this.model.get("order")}),this.updateVisibility(),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 m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var y=l.a.View.extend({initialize:function(t,e){Object(o.bindAll)(this,"getSorter","onDrag","onDrop"),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=m({},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;e.runDefault(),t&&t.get&&(t.get("activeOnRender")&&(t.trigger("active"),t.set("activeOnRender",0)),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 p({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),l=s.get("id"),c=this.renderedCategories[l],u=this.getCategoriesEl();return t.set("category",s),!c&&u&&(c=new g({model:s},this.config).render(),this.renderedCategories[l]=c,u.appendChild(c.el)),void(c&&c.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}});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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r={},i=[];return{name:"BlockManager",init:function(o){var s=(r=o||{}).em;for(var l in a)l in r||(r[l]=a[l]);return t=new h([]),e=new h([]),i=new d,n=new y({collection:e,categories:i},r),t.listenTo(t,"add",(function(t){e.add(t),s&&s.trigger("block:add",t)})),t.listenTo(t,"remove",(function(t){e.remove(t),s&&s.trigger("block:remove",t)})),t.listenTo(t,"reset",(function(t){e.reset(t.models)})),this},getConfig:function(){return r},onLoad:function(){var t=this.getAll();!t.length&&t.reset(r.blocks)},postRender:function(){var t=this.getConfig().appendTo;t&&(Object(o.isElement)(t)?t:document.querySelector(t)).appendChild(this.render())},add:function(e,n){var r=n||{};return r.id=e,t.add(r)},get:function(e){return t.get(e)},getAll:function(){return t},getAllVisible:function(){return e},remove:function(e){return t.remove(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;return e.external?new y({collection:new h(o),categories:i},w({},r,{},e)).render().el:(n.rendered||(n.render(),n.rendered=1),n.updateConfig(e),n.collection.reset(o),this.getContainer())}}}},function(t,e,n){"use strict";n.r(e);var r="sw-visibility",i="export-template",o="open-layers",a="open-blocks",s="fullscreen",l="preview",c={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:l,className:"fa fa-eye",command:l,context:l,attributes:{title:"Preview"}},{id:s,className:"fa fa-arrows-alt",command:s,context:s,attributes:{title:"Fullscreen"}},{id:i,className:"fa fa-code",command:i,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:"open-sm",className:"fa fa-paint-brush",command:"open-sm",active:!0,togglable:0,attributes:{title:"Open Style Manager"}},{id:"open-tm",className:"fa fa-cog",command:"open-tm",togglable:0,attributes:{title:"Settings"}},{id:o,className:"fa fa-bars",command:o,togglable:0,attributes:{title:"Open Layer Manager"}},{id:a,className:"fa fa-th-large",command:a,togglable:0,attributes:{title:"Open Blocks"}}]}],em:null,delayBtnsShow:300},u=n(1),h=n.n(u),d=n(35),f=h.a.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get("buttons")||[],this.buttons=new d.default(this.btn),this.set("buttons",this.buttons)}}),p=h.a.Collection.extend({model:f}),g=n(2),v=n.n(g),m=n(0);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(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}h.a.$;var w=h.a.View.extend({tagName:function(){return this.model.get("tagName")},events:{click:"clicked"},initialize:function(t){var e=this.model.get("className");this.config=t.config||{},this.em=this.config.em||{};var n=this.config.stylePrefix||"",r=this.config.pStylePrefix||"";this.pfx=n,this.ppfx=this.config.pStylePrefix||"",this.id=n+this.model.get("id"),this.activeCls="".concat(n,"active ").concat(r,"four-color"),this.disableCls="".concat(r,"disabled"),this.btnsVisCls="".concat(n,"visible"),this.className=n+"btn"+(e?" "+e:""),this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"change:active updateActive",this.updateActive),this.listenTo(this.model,"checkActive",this.checkActive),this.listenTo(this.model,"change:bntsVis",this.updateBtnsVis),this.listenTo(this.model,"change:attributes",this.updateAttributes),this.listenTo(this.model,"change:className",this.updateClassName),this.listenTo(this.model,"change:disable",this.updateDisable),this.em&&this.em.get&&(this.commands=this.em.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(){this.$el.attr(this.model.get("attributes")),this.updateClassName()},updateBtnsVis:function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},updateActive:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.commands,r=this.$el,i=this.activeCls,o=t.fromCollection,a=e.get("context"),s=e.get("options"),l=e.get("command"),c={};n&&Object(m.isString)(l)?c=n.get(l)||{}:Object(m.isFunction)(l)?c=n.create({run:l}):null!==l&&Object(m.isObject)(l)&&(c=n.create(l)),e.get("active")?(!o&&e.collection.deactivateAll(a,e),e.set("active",!0,{silent:!0}).trigger("checkActive"),n.runCommand(c,b({},s,{sender:e})),c.noStop&&e.set("active",!1)):(r.removeClass(i),n.stopCommand(c,b({},s,{sender:e,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){this.model.get("bntsVis")||this.model.get("disable")||this.toogleActive()},toogleActive:function(){var t=this.model,e=t.attributes,n=e.active,r=e.togglable;if(!n||r){t.set("active",!n);this.em.get("Commands").get("select-comp");n?t.get("runDefaultCommand")&&this.em.runDefault():t.get("stopDefaultCommand")&&this.em.stopDefault()}},render:function(){var t=this.model.get("label"),e=this.$el;return e.empty(),this.updateAttributes(),t&&e.append(t),this.checkActive(),this.updateDisable(),this}}),x=h.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 w({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(m.result)(this,"className")),this}});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}var O=h.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,l=0;2==s?(r=a[0],o=a[0],i=a[1],l=a[1]):4==s&&(r=a[0],i=a[1],o=a[2],l=a[3]);var c=e.Utils.Resizer.init(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(n,!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({tc:r,cr:i,bc:o,cl:l,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=c.getConfig(),o=i.keyWidth,a=i.keyHeight,s=t.getBoundingClientRect(),l="container"==n,u=r[o],h=r[a];return{left:0,top:0,width:u&&!l?parseFloat(u):s.width,height:h&&!l?parseFloat(h):s.height}}},n));c.blur=function(){},c.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.buttons.length){var r=new x({collection:this.buttons,config:this.config});t.append(r.render().el)}return t.append(this.model.get("content")),this}}),S=h.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 O({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(r){for(var i in n=r||{},c)i in n||(n[i]=c[i]);var o=n.pStylePrefix;return o&&(n.stylePrefix=o+n.stylePrefix),t=new p(n.defaults),e=new S({collection:t,config:n}),this},getPanels:function(){return t},getPanelsEl:function(){return 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.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")}))}))},Panel:f}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i={stylePrefix:"cm-",inlineCss:!1},o=n(1),a=n.n(o),s=a.a.Model.extend({build:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.get("components");return e.exportWrapper?e.wrapperIsBody?"<body>".concat(this.buildModels(n),"</body>"):t.toHTML():this.buildModels(n)},buildModels:function(t){var e="";return t.each((function(t){e+=t.toHTML()})),e}}),l=Number.MAX_VALUE,c=a.a.Model.extend({initialize:function(){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"),l=n.wrapperIsBody,c=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=l&&c?"body":u,"{").concat(a,"}")}var h=t.components();return h.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]:{},i=n.cssc,o=n.em||"";this.em=o,this.compCls=[],this.ids=[];var a=this.buildFromModel(t,n),s=Object(r.isUndefined)(n.clearStyles)&&o?o.getConfig("clearStyles"):n.clearStyles;if(i){var l=i.getAll(),c={},u=[];l.each((function(t){var r=t.getAtRule();if(r){var i=c[r];i?i.push(t):c[r]=[t]}else a+=e.buildFromRule(t,u,n)})),this.sortMediaObject(c).forEach((function(t){var r="",i=t.key;t.value.forEach((function(t){var o=e.buildFromRule(t,u,n);t.get("singleAtRule")?a+="".concat(i,"{").concat(o,"}"):r+=o})),r&&(a+="".concat(i,"{").concat(r,"}"))})),o&&s&&l.remove(u)}return a},buildFromRule:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o="",a=t.selectorsToString({skipAdd:1}),s=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)})),a&&n||s||l){var c=t.getDeclaration();c&&(o+=c)}else e.push(t);return o},getQueryLength:function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):l},sortMediaObject:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return Object(r.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)}))}}),u=a.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 a.a.Model)e[n]=this.build(r);else if(r instanceof a.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}}),h=a.a.Model.extend({mapModel:function(t){var e="",n=t.get("script-export")||t.get("script"),i=t.get("type"),o=t.get("components"),a=t.getId();if(n){var s=t.get("attributes");s=Object(r.extend)({},s,{id:a}),t.set("attributes",s,{silent:1});var l=t.getScriptString(n);if(t.get("scriptUpdated"))this.mapJs[i+"-"+a]={ids:[a],code:l};else{var c=this.mapJs[i];c?c.ids.push(a):this.mapJs[i]={ids:[a],code:l}}}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],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(){").concat(r.code,"}.bind(items[i]))();\n }")}return e}}),d=n(2),f=n.n(d),p=n(10),g=n.n(p);n(75),n(36),n(78);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}var m=a.a.Model.extend({defaults:{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0},init:function(t){return Object(r.bindAll)(this,"onChange"),this.editor=g.a.fromTextArea(t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(n,!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(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&&(g.a.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),g.a.commands.goDocStart(r)),!n.noRefresh&&setTimeout((function(){return e.refresh()})))}}),y=a.a.View.extend({template:Object(r.template)('\n <div class="<%= pfx %>editor" id="<%= pfx %><%= codeName %>">\n \t<div id="<%= pfx %>title"><%= label %></div>\n \t<div id="<%= pfx %>code"></div>\n </div>'),initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},render:function(){var t=this.model.toJSON();return t.pfx=this.pfx,this.$el.html(this.template(t)),this.$el.attr("class",this.pfx+"editor-c"),this.$el.find("#"+this.pfx+"code").append(this.model.get("input")),this}});e.default=function(){var t={},e={},n={},o={},a={};return{getConfig:function(){return t},config:t,EditorView:y,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 s,n.css=new c,n.json=new u,n.js=new h,a.CodeMirror=new m,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)?"CodeMirror":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}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a={stylePrefix:"css-",staticRules:"",rules:[]},s=n(1),l=n.n(s),c=n(20),u=n(9),h=l.a.Model.extend(c.a).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{};var n=e.em,r=this.config.selectors||[];if(this.em=n,n){var i=n.get("SelectorManager"),o=[];r.forEach((function(t){o.push(i.add(t))})),r=o}this.set("selectors",new u.a(r))},getAtRule:function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@".concat(t):e?"@media":"";return n+(e&&n?" ".concat(e):"")},selectorsToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.em,r=this.get("state"),i=this.get("wrapper"),o=this.get("selectorsAdd"),a=i&&n&&n.getConfig("wrapperIsBody"),s=a?"body":this.get("selectors").getFullString(),l=r?":".concat(r):"";return s&&e.push("".concat(s).concat(l)),o&&!t.skipAdd&&e.push(o),e.join(", ")},getDeclaration:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.selectorsToString(),r=this.styleToString(t),i=this.get("singleAtRule");return(n||i)&&r&&(e=i?r:"".concat(n,"{").concat(r,"}")),e},toCSS:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.getAtRule(),r=this.getDeclaration(t);return r&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e},toJSON:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=l.a.Model.prototype.toJSON.apply(this,e);if(this.em.getConfig("avoidDefaults")){var i=this.defaults;Object(o.forEach)(i,(function(t,e){r[e]===t&&delete r[e]})),Object(o.isEmpty)(r.selectors)&&delete r.selectors,Object(o.isEmpty)(r.style)&&delete r.style}return r},compare:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e||"",a=n||"",s=r.selectorsAdd||"",l=r.atRuleType||"";t instanceof Array||t.models||(t=[t]);var c=Object(o.map)(t.models||t,(function(t){return t.get("name")})),u=Object(o.map)(this.get("selectors").models,(function(t){return t.get("name")})),h=!1;if(c.length!==u.length)return h;for(var d=0;d<c.length;d++){for(var f=0,p=0;p<u.length;p++)c[d]===u[p]&&(f=1);if(0===f)return h}return this.get("state")===i&&this.get("mediaText")===a&&this.get("selectorsAdd")===s&&this.get("atRuleType")===l||h}}),d=l.a.Collection.extend({initialize:function(t,e){e&&e.em&&(this.editor=e.em),this.model=function(t,n){return!n.em&&e&&e.em&&(n.em=e.em),new h(t,n)}},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,l.a.Collection.prototype.add.apply(this,[t,e])}}),f=l.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,n="change:style change:state change:mediaText";this.listenTo(e,n,this.render),this.listenTo(e,"destroy remove",this.remove),this.listenTo(e.get("selectors"),"change",this.render)},render:function(){var t=this.model.get("important");return this.el.innerHTML=this.model.toCSS({important:t}),this}}),p=f.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}}),g=l.a.$,v=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):"")},m=l.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,o={model:t,config:this.config};if("keyframes"===t.get("atRuleType")){var a=t.getAtRule(),s=this.atRules[a];if(!s){var l=document.createElement("style");s=document.createTextNode(""),l.appendChild(document.createTextNode("".concat(a,"{"))),l.appendChild(s),l.appendChild(document.createTextNode("}")),this.atRules[a]=s,n=l}r=new p(o),s.appendData(r.render().el.textContent)}else n=(r=new f(o)).render().el;var c=this.className,u=t.get("mediaText"),h=v(c),d=h;if(u&&(d=v(c,this.getMediaWidth(u))),n){var g,m=i||this.el;try{g=m.querySelector("#".concat(d))}catch(t){}g||(g=m.querySelector("#".concat(h))),g.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 g('<div id="'.concat(v(r,t),'"></div>')).appendTo(o)})),i.each((function(e){return t.addToCollection(e,o)})),n.append(o),n.attr("class",r),this}}),y=n(7);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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r={};return{Selectors:u.a,name:"CssComposer",storageKey:function(){var t=[],e=r.stm&&r.stm.getConfig()||{};return e.storeCss&&t.push("css"),e.storeStyles&&t.push("styles"),t},init:function(i){for(var o in r=i||{},a)o in r||(r[o]=a[o]);var s=r.pStylePrefix;s&&(r.stylePrefix=s+r.stylePrefix);var l=r.em&&r.em.config.style||"";return r.rules=l||r.rules,t=r.em,e=new d([],r),n=new m({collection:e,config:r}),this},onLoad:function(){e.add(r.rules)},postLoad:function(t){var e=this,n="add remove",r=this.getAll(),i=t.get("UndoManager");i&&i.add(r),t.stopListening(r,n,this.handleChange),t.listenTo(r,n,this.handleChange),r.each((function(t){return e.handleChange(t,{avoidStore:1})}))},handleChange:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="change:style",i=t.get("UndoManager");i&&i.add(e);var o=t.handleUpdates.bind(t);t.stopListening(e,r,o),t.listenTo(e,r,o),!n.avoidStore&&o("","",n)},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(o.isArray)(i)?i.length&&e.reset(i):i&&e.reset(i),i},store:function(t){if(r.stm){var n={},i=this.storageKey();return i.indexOf("css")>=0&&(n.css=r.em.getCss()),i.indexOf("styles")>=0&&(n.styles=JSON.stringify(e)),t||r.stm.store(n),n}},add:function(t,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=n||"",s=i||"",l=w({},o),c=this.get(t,a,s,l);return c&&c.config&&!c.config.singleAtRule?c:(l.state=a,l.mediaText=s,l.selectors="",(c=new h(l,r)).get("selectors").add(t),e.add(c),c)},get:function(t,n,r,i){var o=null;return e.each((function(e){o||e.compare(t,n,r,i)&&(o=e)})),o},getAll:function(){return e},clear:function(){return this.getAll().reset(),this},addCollection:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],i=t instanceof Array?t:[t],o=0,a=i.length;o<a;o++){var s=i[o]||{};if(s.selectors){var l=r.em&&r.em.get("SelectorManager");l||console.warn("Selector Manager not found");for(var c=s.selectors,u=c instanceof Array?c:[c],h=[],d=0,f=u.length;d<f;d++){var p=l.add(u[d]);h.push(p)}var g=this.get(h,s.state,s.mediaText,s),v=this.add(h,s.state,s.mediaText,s),m=!g||!e.avoidUpdateStyle,y=s.style||{};if(m){var b=e.extend?w({},v.get("style"),{},y):y;v.set("style",b)}n.push(v)}}return n},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,l=a.selectorsAdd,c=t.get("SelectorManager"),u=c.add(a.selectors),h=this.add(u,s,o,{selectorsAdd:l,atRule:i});return h.setStyle(n,r),h},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,l=n.atRuleType,c=n.atRuleParams;return o&&this.get(o,a,c,{selectorsAdd:s,atRule:l})},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.state||"",o=r.mediaText||t.getCurrentMedia(),a=t.get("SelectorManager"),s=a.add({name:e,type:y.a.TYPE_ID}),l=this.add(s,i,o);return l.setStyle(n,r),l},getIdRule: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,y.a.TYPE_ID);return o&&this.get(o,r,i)},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:y.a.TYPE_CLASS}),l=this.add(s,i,o);return l.setStyle(n,r),l},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,y.a.TYPE_CLASS);return o&&this.get(o,r,i)},render:function(){return n.render().el}}}},function(t,e,n){"use strict";n.r(e);var r,i=n(6),o=n.n(i),a=n(8),s=n.n(a),l=n(2),c=n.n(l),u=n(3),h=n(13),d=n.n(h),f=n(14),p=n.n(f),g=n(0),v=function(){function t(e){d()(this,t),this.em=e;var n=e.get("DomComponents").getWrapper().getEl();return this.el=n,this.counter=0,Object(g.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),Object(u.p)(n,"dragenter",this.handleDragEnter),Object(u.p)(n,"dragover",this.handleDragOver),Object(u.p)(n,"drop",this.handleDrop),Object(u.p)(n,"dragleave",this.handleDragLeave),this}return p()(t,[{key:"endDrop",value:function(t,e){var n=this.em,r=this.dragStop;this.counter=0,this.over=0,r&&r(t),n.runDefault(),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,a=n.get("Utils"),s=n.get("Canvas"),l=s.getBody(),c=n.get("dragContent")||"<br>";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.get("DomComponents").getWrapper(),h=u.append({})[0],d=n.get("Commands").run("core:component-drag",{event:t,guidesInfo:1,center:1,target:h,onEnd:function(t,n,i){if(!i.cancelled){var o=u.append(c)[0],a=h.getStyle(),s=a.left,l=a.top,d=a.position;o.setStyle({left:s,top:l,position:d}),e.handleDragEnd(o,r)}h.remove()}});i=function(e){return d.stop(t,{cancel:e})},o=function(t){return c=t}}else{var f=new a.Sorter({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:l,placer:s.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(t){return e.handleDragEnd(t,r)},document:s.getFrameEl().contentDocument});f.setDropContent(c),f.startSort(),this.sorter=f,i=function(t){t&&(f.moved=0),f.endMove()},o=function(t){return f.setDropContent(t)}}this.dragStop=i,this.dragContent=o,n.trigger("canvas:dragenter",r,c)}}},{key:"handleDragEnd",value:function(t,e){if(t){var n=this.em;n.set("dragResult",t),n.trigger("canvas:drop",e,t)}}},{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.types,r=t.files||[],i=e.get("dragContent"),o=t.getData("text");if(r.length){o=[];for(var a=0;a<r.length;a++){var s=r[a],l=s.type.split("/")[0];"image"==l&&o.push({type:l,file:s,attributes:{alt:s.name}})}}else if(i)o=i;else if(Object(g.indexOf)(n,"text/html")>=0)o=t.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if(Object(g.indexOf)(n,"text/uri-list")>=0)o={type:"link",attributes:{href:o},content:o};else if(Object(g.indexOf)(n,"text/json")>=0){var c=t.getData("text/json");c&&(o=JSON.parse(c))}var u={content:o};return e.trigger("canvas:dragdata",t,u),u}}]),t}(),m={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:"",autoscrollLimit:50,notTextable:["button","a","input[type=checkbox]","input[type=radio]"]},y=n(1),b=n.n(y),w=b.a.Model.extend({defaults:{wrapper:"",width:"",height:"",head:"",attributes:{}},initialize:function(){this.set("head",[])},getHead:function(){return s()(this.get("head"))},setHead:function(t){return this.set("head",s()(t))},addHeadItem:function(t){var e=this.getHead();e.push(t),this.setHead(e)},getHeadByAttr:function(t,e,n){return this.getHead().filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]},removeHeadByAttr: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))},addLink:function(t){!this.getHeadByAttr("href",t,"link")&&this.addHeadItem({tag:"link",attributes:{href:t,rel:"stylesheet"}})},removeLink:function(t){this.removeHeadByAttr("href",t,"link")},addScript:function(t){!this.getHeadByAttr("src",t,"script")&&this.addHeadItem({tag:"script",attributes:{src:t}})},removeScript:function(t){this.removeHeadByAttr("src",t,"script")}}),x=b.a.Model.extend({defaults:{frame:"",wrapper:"",rulers:!1,zoom:100,x:0,y:0},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.styles,n=void 0===e?[]:e,r=t.scripts,i=void 0===r?[]:r,o=new w;n.forEach((function(t){return o.addLink(t)})),i.forEach((function(t){return o.addScript(t)})),this.set("frame",o),this.listenTo(this,"change:zoom",this.onZoomChange)},onZoomChange:function(){this.get("zoom")<1&&this.set("zoom",1)}}),C=n(11),O="transitionend oTransitionEnd transitionend webkitTransitionEnd",S=b.a.View.extend({tagName:"iframe",attributes:{allowfullscreen:"allowfullscreen"},initialize:function(t){Object(g.bindAll)(this,"updateOffset"),this.config=t.config||{},this.ppfx=this.config.pStylePrefix||"",this.em=this.config.em,this.listenTo(this.model,"change:head",this.updateHead),this.listenTo(this.em,"change:device",this.updateDim)},updateHead:function(){var t=this.getHead();Object(C.c)(t),Object(C.b)(t,this.model.getHead())},updateDim:function(){var t=this.em,e=this.el,n=this.$el,r=e.style,i=t.getDeviceModel(),o=r.width||"",a=r.height||"",s=i?i.get("width"):"",l=i?i.get("height"):"",c=o==s&&a==l;r.width=s,r.height=l,this.updateOffset(),t.stopDefault({preserveSelected:1}),c?this.updateOffset():n.on(O,this.updateOffset)},updateOffset:function(){var t=this.em,e=t.get("Canvas").getOffset();t.set("canvasOffset",e),t.runDefault({preserveSelected:1}),this.$el.off(O,this.updateOffset)},getDoc:function(){return this.$el.get(0).contentDocument},getHead:function(){return this.getDoc().querySelector("head")},getBody:function(){return this.getDoc().querySelector("body")},getWrapper:function(){return this.$el.contents().find("body > div")},render:function(){return this.$el.attr({class:this.ppfx+"frame"}),this}}),k=b.a.$,T=b.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(g.bindAll)(this,"renderBody","onFrameScroll","clearOff","onKeyPress"),Object(u.p)(window,"scroll resize",this.clearOff);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",this.listenTo(this.em,"change:canvasOffset",this.clearOff),this.listenTo(e,"change:zoom change:x change:y",this.updateFrames),this.toggleListeners(1),this.frame=new S({model:this.model.get("frame"),config:this.config})},remove:function(){b.a.View.prototype.remove.apply(this,arguments),this.toggleListeners()},preventDefault:function(t){t&&(t.preventDefault(),t._parentEvent&&t._parentEvent.preventDefault())},toggleListeners:function(t){var e=t?"on":"off";({on:u.p,off:u.o})[e](document,"keypress",this.onKeyPress)},onKeyPress:function(t){var e=this.em;" "===Object(u.e)(t)&&1!==e.getZoomDecimal()&&(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,i=n.x,o=n.y,a=this.getZoom(),s={preserveSelected:1},l=a?1/a:1;this.framesArea.style.transform="scale(".concat(a,") translate(").concat(i*l,"px, ").concat(o*l,"px)"),this.clearOff(),this.onFrameScroll(),e.stopDefault(s),e.trigger("canvas:update",t),r&&clearTimeout(r),r=setTimeout((function(){return e.runDefault(s)}))},getZoom:function(){return this.em.getZoomDecimal()},isElInViewport:function(t){var e=Object(u.c)(Object(u.d)(t)),n=this.getFrameOffset(),r=e.top,i=e.left;return r>=0&&i>=0&&r<=n.height&&i<=n.width},onFrameScroll:function(){var t=this.frame.el.contentDocument.body,e=this.getZoom();this.toolsEl.style.top="-"+t.scrollTop*e+"px",this.toolsEl.style.left="-"+t.scrollLeft*e+"px",this.em.trigger("canvasScroll")},renderScripts:function(){var t=this.frame,e=this;t.el.onload=function(){!function n(r){if(r.length>0){var i=document.createElement("script");i.type="text/javascript",i.src=r.shift(),i.onerror=i.onload=n.bind(null,r),t.el.contentDocument.head.appendChild(i)}else e.renderBody()}(e.config.scripts.slice(0))}},renderBody:function(){var t=this,e=this.config,n=(this.model,this.model.get("frame").get("wrapper")),r=e.em;if(n){var i=r.get("Canvas"),o=this.ppfx,a=k(i.getBody()),s=k(i.getDocument().head),l=r.get("CssComposer"),c=r.get("Config"),u="";e.styles.forEach((function(t){u+='<link rel="stylesheet" href="'.concat(t,'"/>')}));var h="\n ".concat(r.config.baseCss||"","\n\n .").concat(o,"dashed *[data-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(o,"comp-selected {\n outline: 3px solid #3b97e3 !important;\n outline-offset: -3px;\n }\n\n .").concat(o,"comp-selected-parent {\n outline: 2px solid ").concat("#ffca6f"," !important\n }\n\n .").concat(o,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(o,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(o,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(o,"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(o,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(o,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(o,"is__grabbing,\n .").concat(o,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(c.canvasCss||"","\n ").concat(c.protectedCss||"","\n ");u&&s.append(u),a.append("<style>"+h+"</style>"),a.append(n.render()).append(l.render()),a.append(this.getJsContainer()),r.trigger("loaded"),this.frame.el.contentWindow.onscroll=this.onFrameScroll,this.frame.updateOffset(),a.on("click",(function(t){return t&&"A"==t.target.tagName&&t.preventDefault()})),a.on("submit",(function(t){return t&&t.preventDefault()}));document;var d=this.frame.el.contentDocument;[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"wheel",class:"WheelEvent"}].forEach((function(e){return e.event.split(" ").forEach((function(n){d.addEventListener(n,(function(n){return t.el.dispatchEvent(function(t,e){var n;try{n=new window[e](t.type,t)}catch(t){(n=document.createEvent(e)).initEvent(t.type,!0,!0)}return n.keyCodeVal=t.keyCode,n._parentEvent=t,["keyCode","which"].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})})),n}(n,e.class))}))}))}))}},offset:function(t){var e=Object(u.c)(t),n=t.ownerDocument.body;return{top:e.top+n.scrollTop,left:e.left+n.scrollLeft,width:e.width,height:e.height}},clearOff:function(){this.frmOff=null,this.cvsOff=null},getFrameOffset:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.frmOff&&!t||(this.frmOff=this.offset(this.frame.el)),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(),o=this.getCanvasOffset(),a=this.offset(t),s=r.avoidFrameOffset?0:i.top,l=r.avoidFrameOffset?0:i.left;return{top:a.top*n+s-o.top,left:a.left*n+l-o.left,height:a.height*n,width:a.width*n,zoom:n,rect:a}},getElementOffsets:function(t){var e=this;if(!t||Object(u.l)(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=this.frame.el.contentDocument;if(t){var e=t.body,n=this.getZoom(),r=this.getFrameOffset(),i=this.getCanvasOffset();return{top:r.top+e.scrollTop*n-i.top,left:r.left+e.scrollLeft*n-i.left,width:i.width,height:i.height}}},updateScript:function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=k('<div id="'.concat(n,'">')),this.getJsContainer().appendChild(t.scriptContainer.get(0))),t.el.id=n,t.scriptContainer.html("");var r=document.createElement("script");r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (function(){\n ").concat(e.getScriptString(),";\n }.bind(item))()\n }, 1);"),setTimeout((function(){return t.scriptContainer.get(0).appendChild(r)}),0)},getJsContainer:function(){return this.jsContainer||(this.jsContainer=k('<div class="'.concat(this.ppfx,'js-cont">')).get(0)),this.jsContainer},render:function(){var t=this.el,e=this.$el,n=this.ppfx,r=this.model;this.wrapper=r.get("wrapper"),e.html(this.template());var i=e.find("[data-frames]");if(this.framesArea=i.get(0),this.wrapper&&"function"==typeof this.wrapper.render){r.get("frame").set("wrapper",this.wrapper),i.append(this.frame.render().el);var o=this.frame;0===this.config.scripts.length?o.el.onload=this.renderBody:this.renderScripts()}e.find("[data-tools]").append('\n <div id="'.concat(n,'tools" style="pointer-events:none">\n <div class="').concat(n,'highlighter"></div>\n <div class="').concat(n,'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"></div>\n <div class="').concat(n,'offset-fixed-v"></div>\n </div>\n '));var a=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.toolsEl=a,this.el.className=this.className,this}});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 j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(n,!0).forEach((function(e){c()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var E=window.requestAnimationFrame;e.default=function(){var t,e,n,r={};return{getCanvasView:function(){return n},name:"Canvas",init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r=j({},m,{},e),this.em=r.em;var i=r.pStylePrefix;i&&(r.stylePrefix=i+r.stylePrefix),t=new x(e),n=new T({model:t,config:r});var o=r.em.get("DomComponents");return o&&this.setWrapper(o),this.startAutoscroll=this.startAutoscroll.bind(this),this.stopAutoscroll=this.stopAutoscroll.bind(this),this.autoscroll=this.autoscroll.bind(this),this.updateClientY=this.updateClientY.bind(this),this},getConfig:function(){return r},setWrapper:function(e){t.set("wrapper",e)},getElement:function(){return n.el},getFrame:function(){return t.get("frame")},getFrameEl:function(){return n.frame.el},getWindow:function(){return this.getFrameEl().contentWindow},getDocument:function(){return this.getFrameEl().contentDocument},getBody:function(){var t=this.getDocument();return t&&t.body},getWrapperEl:function(){var t=this.getBody();return t&&t.querySelector("#wrapper")},getToolsEl:function(){return n.toolsEl},getHighlighter:function(){return n.hlEl},getBadgeEl:function(){return n.badgeEl},getPlacerEl:function(){return n.placerEl},getGhostEl:function(){return n.ghostEl},getToolbarEl:function(){return n.toolbarEl},getResizerEl:function(){return n.resizerEl},getOffsetViewerEl:function(){return n.offsetEl},getFixedOffsetViewerEl:function(){return n.fixedOffsetEl},render:function(){return 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 n.offset(t)},setCustomBadgeLabel:function(t){r.customBadgeLabel=t},getElementPos:function(t,e){return n.getElementPos(t,e)},getElementOffsets:function(t){return n.getElementOffsets(t)},getRect:function(){var t=n.getPosition(),e=t.top,r=t.left;return j({},n.getCanvasOffset(),{topScroll:e,leftScroll:r})},getTargetToElementDim:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},a=n.getPosition();if(a){var s=o.elPos||n.getElementPos(e),l=i.toRight||0,c=o.targetHeight||t.offsetHeight,u=o.targetWidth||t.offsetWidth,h=o.event||null,d=s.top-c,f=s.left;f+=l?s.width:0;var p=(f=l?f-u:f)<a.left?a.left:f,g=d<a.top?a.top:d,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 h&&r.em&&r.em.trigger(h,v),v}},getMouseRelativePos:function(t,e){var n=0,r=0,i=(e||{}).subWinOffset,o=t.target.ownerDocument,a=o.defaultView||o.parentWindow,s=a.frameElement,l=i?a.pageYOffset:0,c=i?a.pageXOffset:0;if(s){var u=s.getBoundingClientRect();n=u.top||0,r=u.left||0}return{y:t.clientY+n-l,x:t.clientX+r-c}},getMouseRelativeCanvas:function(t){var e=this.getZoomDecimal(),r=n.getPosition(),i=r.top,o=r.left;return{y:t.clientY*e+i,x:t.clientX*e+o}},hasFocus:function(){return this.getDocument().hasFocus()},isInputFocused:function(){var t=this.getDocument(),e=["body"].concat(s()(this.getConfig().notTextable)),n=t&&t.activeElement;return n&&!e.some((function(t){return n.matches(t)}))},scrollTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(u.d)(t),r=this.getCanvasView();if(n&&(!r.isElInViewport(n)||e.force)){var i="object"===o()(e)?e:{behavior:"smooth",block:"nearest"};n.scrollIntoView(i)}},startAutoscroll:function(){var t=this;this.dragging=1;var r=this.getScrollListeners();e=n.getFrameOffset(1),setTimeout((function(){Object(u.p)(r,"mousemove dragover",t.updateClientY),Object(u.p)(r,"mouseup",t.stopAutoscroll),E(t.autoscroll)}),0)},updateClientY:function(t){t.preventDefault(),this.lastClientY=Object(u.g)(t).clientY*this.getZoomDecimal()},autoscroll:function(){if(this.dragging){var t=this.getFrameEl().contentWindow,n=t.document.body.scrollTop,r=this.lastClientY,i=this.getConfig().autoscrollLimit,o=e.height-i;r<i&&(n-=i-r),r>o&&(n+=r-o),t.scrollTo(0,n),E(this.autoscroll)}},stopAutoscroll:function(){this.dragging=0;var t=this.getScrollListeners();Object(u.o)(t,"mousemove dragover",this.updateClientY),Object(u.o)(t,"mouseup",this.stopAutoscroll)},getScrollListeners:function(){return[this.getFrameEl().contentWindow]},postRender:function(){Object(u.i)(r.em)&&(this.droppable=new v(r.em))},setZoom:function(e){return t.set("zoom",parseFloat(e)),this},getZoom:function(){return parseFloat(t.get("zoom"))},getZoomDecimal:function(){return this.getZoom()/100},getZoomMultiplier:function(){var t=this.getZoomDecimal();return t?1/t:1},getFrameWrapperEl:function(){return n.frame.getWrapper()}}}},function(t,e,n){"use strict";n.r(e);var r={devices:[],deviceLabel:"Device"},i=n(1),o=n.n(i),a=o.a.Model.extend({idAttribute:"name",defaults:{name:"",width:null,height:"",widthMedia:null,priority:null},initialize: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)}))},checkUnit:function(t){var e=this.get(t)||"";(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))}}),s=o.a.Collection.extend({model:a,comparator:function(t,e){var n=Number.MAX_VALUE;return(e.get("priority")||n)-(t.get("priority")||n)},getSorted:function(){return this.sort()}}),l=n(0),c=o.a.View.extend({template:Object(l.template)('\n <div class="<%= ppfx %>device-label"><%= deviceLabel %></div>\n <div class="<%= ppfx %>field <%= ppfx %>select">\n <span id="<%= ppfx %>input-holder">\n <select class="<%= ppfx %>devices"></select>\n </span>\n <div class="<%= ppfx %>sel-arrow">\n <div class="<%= ppfx %>d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="<%= ppfx %>add-trasp">+</button>'),events:{change:"updateDevice"},initialize: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()},startAdd:function(){},updateDevice:function(){var t=this.em;if(t){var e=this.devicesEl,n=e?e.val():"";t.set("device",n)}},updateSelect:function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel(),r=n?n.get("name"):"";e.val(r)}},getOptions:function(){var t="";return this.collection.each((function(e){var n=e.get("name");t+='<option value="'+n+'">'+n+"</option>"})),t},render:function(){var t=this.ppfx;return this.$el.html(this.template({ppfx:t,deviceLabel:this.config.deviceLabel})),this.devicesEl=this.$el.find("."+t+"devices"),this.devicesEl.append(this.getOptions()),this.el.className=t+"devices-c",this}});e.default=function(){var t,e,n={};return{name:"DeviceManager",init:function(i){for(var o in n=i||{},r)o in n||(n[o]=r[o]);return t=new s(n.devices),e=new c({collection:t,config:n}),this},add:function(e,n,r){var i=r||{};return i.name=e,i.width=n,t.add(i)},get:function(e){return t.get(e)},getAll:function(){return t},render:function(){return e.render().el}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o={stylePrefix:"mdl-",title:"",content:"",backdrop:!0},a=n(1),s=n.n(a),l=s.a.Model.extend({defaults:{title:"",content:"",open:!1}}),c=s.a.View.extend({template: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>⨯</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>')},events:{click:"onClick","click [data-close-modal]":"hide"},initialize: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)},onClick:function(t){this.config.backdrop&&t.target===this.el&&this.hide()},getCollector:function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},getContent:function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},getTitle:function(){return this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.get(0)},updateContent:function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get("content");e.length&&n.append(e),t.empty().append(r)},updateTitle:function(){var t=this.getTitle();t&&(t.innerHTML=this.model.get("title"))},updateOpen:function(){this.el.style.display=this.model.get("open")?"":"none"},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},render:function(){var t=this.$el,e=this.pfx,n=(this.ppfx,this.model.toJSON());return n.pfx=this.pfx,n.ppfx=this.ppfx,t.html(this.template(n)),t.attr("class","".concat(e,"container")),this.updateOpen(),this}});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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(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 i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(n=h({},o,{},i)).em;this.em=a;var s=n.pStylePrefix;return s&&(n.stylePrefix=s+n.stylePrefix),(t=new l(n)).on("change:open",(function(t,e){return r(e,a)})),e=new c({model:t,config:n}),this},postRender:function(t){var e=t.model.getConfig().el||t.el;this.render().appendTo(e)},open:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),e.show(),this},close:function(){return e.hide(),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(){return e.render().$el}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a={stylePrefix:"clm-",appendTo:"",selectors:[],label:"Classes",statesLabel:"- State -",selectedLabel:"Selected",states:[{name:"hover",label:"Hover"},{name:"active",label:"Click"},{name:"nth-of-type(2n)",label:"Even/Odd"}],escapeName:0},s=n(7),l=n(9),c=n(1),u=n.n(c),h=u.a.View.extend({template:function(){var t=this.pfx,e=(this.ppfx,this.model.get("label")||"");return'\n <span id="'.concat(t,'checkbox" class="fa" data-tag-status></span>\n <span id="').concat(t,'tag-label" data-tag-name>').concat(e,'</span>\n <span id="').concat(t,'close" data-tag-remove>\n ⨯\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(t){var e=t.config||{};this.config=e,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.contentEditable=!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.contentEditable=!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(){var t=this.em,e=this.model,n=t&&t.getSelected();!e.get("protected")&&n&&n.getSelectors().remove(e)},updateStatus:function(){var t=this.model,e=this.$el,n="fa-check-square-o",r=e.find("[data-tag-status]");t.get("active")?(r.removeClass("fa-square-o").addClass(n),e.removeClass("opac50")):(r.removeClass(n).addClass("fa-square-o"),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}}),d=u.a.View.extend({template:Object(o.template)('\n <div id="<%= pfx %>up">\n <div id="<%= pfx %>label"><%= label %></div>\n <div id="<%= pfx %>status-c">\n <span id="<%= pfx %>input-c">\n <div class="<%= ppfx %>field <%= ppfx %>select">\n <span id="<%= ppfx %>input-holder">\n <select id="<%= pfx %>states">\n <option value=""><%= statesLabel %></option>\n </select>\n </span>\n <div class="<%= ppfx %>sel-arrow">\n <div class="<%= ppfx %>d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="<%= pfx %>tags-field" class="<%= ppfx %>field">\n <div id="<%= pfx %>tags-c"></div>\n <input id="<%= pfx %>new" />\n <span id="<%= pfx %>add-tag" class="fa fa-plus"></span>\n </div>\n <div id="<%= pfx %>sel-help">\n <div id="<%= pfx %>label"><%= selectedLabel %></div>\n <div id="<%= pfx %>sel"></div>\n <div style="clear:both"></div>\n </div>'),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.pfx+"tags",this.addBtnId=this.pfx+"add-tag",this.newInputId=this.pfx+"new",this.stateInputId=this.pfx+"states",this.stateInputC=this.pfx+"input-c",this.states=this.config.states||[],this.events["click #"+this.addBtnId]="startNewTag",this.events["blur #"+this.newInputId]="endNewTag",this.events["keyup #"+this.newInputId]="onInputKeyUp",this.events["change #"+this.stateInputId]="stateChanged";var e=this.config.em,n=this.getStyleEmitter();this.target=this.config.em,this.em=e,this.listenTo(n,"styleManager:update",this.componentChanged),this.listenTo(e,"component:toggled component:update:classes",this.componentChanged),this.listenTo(e,"component:update:classes",this.updateSelector),this.listenTo(this.collection,"add",this.addNew),this.listenTo(this.collection,"reset",this.renderClasses),this.listenTo(this.collection,"remove",this.tagRemoved),this.delegateEvents()},getStyleEmitter:function(){var t=this.em,e=t&&t.get("StyleManager");return e&&e.getEmitter()||{}},tagRemoved:function(t){this.updateStateVis()},getStateOptions:function(){for(var t="",e=0;e<this.states.length;e++)t+='<option value="'+this.states[e].name+'">'+this.states[e].label+"</option>";return t},addNew:function(t){this.addToClasses(t)},startNewTag:function(t){this.$addBtn.get(0).style.display="none",this.$input.show().focus()},endNewTag:function(t){this.$addBtn.get(0).style.display="",this.$input.hide().val("")},onInputKeyUp:function(t){13===t.keyCode?this.addNewTag(this.$input.val()):27===t.keyCode&&this.endNewTag()},componentChanged:Object(o.debounce)((function(t){t=t||this.getTarget(),this.compTarget=t;var e=[];if(t){var n=t.get("state");n&&this.getStates().val(n),e=t.getSelectors().getValid()}this.collection.reset(e),this.updateStateVis(t)})),getTarget:function(){return this.target.getSelected()},updateStateVis:function(t){var e=this.em,n=e&&e.getConfig("avoidInlineStyle"),r=this.collection.length||n?"block":"none";this.getStatesC().css("display",r),this.updateSelector(t)},updateSelector:function(t){var e=this.pfx,n=this.collection,r=this.el,i=t||this.getTarget();if(this.compTarget=i,i&&i.get){var o=i.get("state"),a=n.getFullString(i.getSelectors().getStyleable());a=a||i.get("selectorsAdd")||(i.getId?"#".concat(i.getId()):""),a+=o?":".concat(o):"";var s=r.querySelector("#".concat(e,"sel"));s&&(s.innerHTML=a)}},stateChanged:function(t){this.compTarget&&(this.compTarget.set("state",this.$states.val()),this.updateSelector())},addNewTag:function(t){var e=this.target,n=this.compTarget;if(t.trim()){if(e){var r=e.get("SelectorManager").add({label:t});if(n)n.getSelectors().add(r),this.collection.add(r),this.updateStateVis()}this.endNewTag()}},addToClasses:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.getClasses(),i=new h({model:t,config:this.config,coll:this.collection}).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("#".concat(this.pfx,"tags-c"))},getStates:function(){return this.$states||(this.$states=this.$el.find("#"+this.stateInputId)),this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},render:function(){var t=this.ppfx,e=this.config,n=this.$el;return n.html(this.template({selectedLabel:e.selectedLabel,statesLabel:e.statesLabel,label:e.label,pfx:this.pfx,ppfx:this.ppfx})),this.$input=n.find("input#"+this.newInputId),this.$addBtn=n.find("#"+this.addBtnId),this.$classes=n.find("#"+this.pfx+"tags-c"),this.$states=n.find("#"+this.stateInputId),this.$statesC=n.find("#"+this.stateInputC),this.$states.append(this.getStateOptions()),this.renderClasses(),n.attr("class","".concat(this.className," ").concat(t,"one-bg ").concat(t,"two-color")),this}});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 p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=function(t){return Object(o.isString)(t)&&"#"==t[0]},v=function(t){return Object(o.isString)(t)&&"."==t[0]};e.default=function(t){var e,n,r=t||{};return{Selector:s.a,Selectors:l.a,name:"SelectorManager",getConfig:function(){return r},init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(r=p({},a,{},t)).em,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),n=new d({collection:new l.a([],{em:i,config:r}),config:r}),(e=new l.a(r.selectors)).on("add",(function(t){return i.trigger("selector:add",t)})),this},postRender:function(){var t=this.getConfig().appendTo;t&&(Object(o.isElement)(t)?t:document.querySelector(t)).appendChild(this.render([]))},addSelector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=p({},n);Object(o.isObject)(t)?i=t:i.name=t,g(i.name)?(i.name=i.name.substr(1),i.type=s.a.TYPE_ID):v(i.name)&&(i.name=i.name.substr(1)),i.label&&!i.name&&(i.name=this.escapeName(i.label));var a=i.name,l=a?this.get(a,i.type):e.where(i)[0];return l||e.add(i,{config:r})},getSelector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.a.TYPE_CLASS;return g(t)?(t=t.substr(1),n=s.a.TYPE_ID):v(t)&&(t=t.substr(1)),e.where({name:t,type:n})[0]},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.isArray)(t)?t.map((function(t){return e.addSelector(t,n)})):this.addSelector(t,n)},addClass:function(t){var e=this,n=[];return Object(o.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(o.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)},getAll:function(){return e},escapeName:function(t){var e=r.escapeName;return e?e(t):s.a.escapeName(t)},render:function(t){return t?new d({collection:new l.a(t),config:r}).render().el:n.render().el}}}},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},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"},l=Object(a.keys)(s),c=["5","6","11","15"],u=["font-face","page","counter-style","viewport"],h=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}},d=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},f=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],l=n.atRule,c=n.selectorsAdd,h=n.mediaText,d=u.indexOf(l)>=0;return d&&(r.singleAtRule=1),l&&(r.atRuleType=l),c&&(r.selectorsAdd=c),h&&(r.mediaText=h),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=c.indexOf(u)>=0;if(b)g=1,v=s[u],m=f(a);else if(l.indexOf(u)>=0){var w=t(a);m=f(a);for(var x=0,C=w.length;x<C;x++){var O=w[x];m&&(O.mediaText=m),O.atRuleType=s[u]}n=n.concat(w)}if(y||b){for(var S=d(a),k=h(y),T=k.add,P=void 0,j=0,E=(y=k.result).length;j<E;j++){var M=p(y[j],S,{atRule:s[u]});n.push(M),P=M}if(T.length){var D=T.join(", ");if(P)P.selectorsAdd=D;else{var A={selectors:[],selectorsAdd:D,style:S};g&&(A.singleAtRule=g),v&&(A.atRuleType=v),m&&(A.mediaText=m),n.push(A)}}}}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=void 0===o?{}:o,s=a&&a.get&&a.get("Editor");return(i?i(e,s):g(e)).forEach((function(t){return r=r.concat(n.checkNode(t))})),r},checkNode:function(t){var e=t,n=e.selectors,r=e.style;if(Object(a.isString)(n)){var i=[],o=h(n),s=o.result,l=o.add.join(", "),c={atRule:t.atRule,mediaText:t.params};if(s.length?s.forEach((function(t){i.push(p(t,r,c))})):i.push(p([],r,c)),l)i[i.length-1].selectorsAdd=l;t=i}return t}}},m=n(26);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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(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",getConfig:function(){return n},init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(n=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},parseHtml:function(n){var r=this.em,i=this.compTypes;return t.compTypes=r?r.get("DomComponents").getTypes():i,t.parse(n,e)},parseCss:function(t){return e.parse(t)}}}},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(1),s=n.n(a),l=s.a.Model.extend({defaults:{checkLocal:!0},store:function(t,e){for(var n in this.checkStorageEnvironment(),t)localStorage.setItem(n,t[n]);"function"==typeof e&&e()},load:function(t,e){this.checkStorageEnvironment();for(var n={},r=0,i=t.length;r<i;r++){var o=localStorage.getItem(t[r]);o&&(n[t[r]]=o)}return"function"==typeof e&&e(n),n},remove:function(t){this.checkStorageEnvironment();for(var e=0,n=t.length;e<n;e++)localStorage.removeItem(t[e])},checkStorageEnvironment:function(){this.get("checkLocal")&&!localStorage&&console.warn("Your browser doesn't support localStorage")}}),c=n(25),u=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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=s.a.Model.extend({fetch:c.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"),l=this.get("headers")||{},c=this.get("params"),h="X-Requested-With",f="Content-Type",p=i.body||{};for(var g in c)p[g]=c[g];if(Object(u.isUndefined)(l[h])&&(l[h]="XMLHttpRequest"),Object(u.isUndefined)(l[f])&&s&&(l[f]="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:l}).method&&(e.body=n);var m=this.get("fetchOptions")||{},y=Object(u.isFunction)(m)?m(e):e;this.onStart(),this.fetch(t,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 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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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=g({},o,{},n),t=e.em,e._disable&&(e.type=0),r.remote=new f(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){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,l=t.length;s<l;s++)o.push(e.id+t[s]);i?i.load(o,(function(t){var i=new RegExp("^"+e.id);for(var o in t){var s=o.replace(i,"");a[s]=t[o]}n&&n(a),r.onEnd("load",a)}),(function(t){n&&n(a),r.onError("load",t)})):n&&n(a)},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("storage:start"),e&&t.trigger("".concat("storage:start",":").concat(e),n))},onEnd:function(e,n){t&&(t.trigger("storage:end"),e&&t.trigger("".concat("storage:end",":").concat(e),n))},onError:function(e,n){t&&(t.trigger("storage:error",n),e&&t.trigger("".concat("storage:error",":").concat(e),n),this.onEnd(e,n))},canAutoload:function(){return this.getCurrentStorage()&&this.getConfig().autoload}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(13),a=n.n(o),s=n(14),l=n.n(s),c=n(3);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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d="_rte",f={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:"<strike>S</strike>",attributes:{title:"Strike-through"},result:function(t){return t.exec("strikeThrough")}},link:{icon:'<span style="transform:rotate(45deg)">⫘</span>',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},result:function(t){var e=t.selection().anchorNode,n=e&&e.nextSibling;n&&"A"==n.nodeName?t.exec("unlink"):t.insertHTML('<a class="link" href="">'.concat(t.selection(),"</a>"))}}},p=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,t);var r=n.el;if(r[d])return r[d];r[d]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this);var i=n.actions||[];i.forEach((function(t,e){"string"==typeof t?t=f[t]:f[t.name]&&(t=h({},f[t.name],{},t)),i[e]=t}));var o=i.length?i:Object.keys(f).map((function(t){return f[t]}));n.classes=h({},{actionbar:"actionbar",button:"action",active:"active"},{},n.classes);var s=n.classes,l=n.actionbar;if(this.actionbar=l,this.settings=n,this.classes=s,this.actions=o,!l){var c=n.actionbarContainer;(l=document.createElement("div")).className=s.actionbar,c.appendChild(l),this.actionbar=l,o.forEach((function(t){return e.addAction(t)}))}return n.styleWithCSS&&this.exec("styleWithCSS"),this.syncActions(),this}return l()(t,[{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=t.classes.active,o=e.name,a=t.doc;n.className=n.className.replace(i,"").trim(),a.queryCommandSupported(o)&&a.queryCommandState(o)&&(n.className+=" ".concat(i)),r&&r(t,e)}))}},{key:"enable",value:function(){return this.enabled?this:(this.actionbarEl().style.display="",this.el.contentEditable=!0,Object(c.p)(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(c.o)(this.el,"mouseup keyup",this.updateActiveActions),this.enabled=0,this}},{key:"syncActions",value:function(){var t=this;this.getActions().forEach((function(e){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}(),g={stylePrefix:"rte-",adjustToolbar:1,actions:["bold","italic","underline","strikethrough","link"]};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(n,!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e,n,r={},i=function(){var e=t.style;e.top="-1000px",e.left="-1000px",e.display="none"};return{customRte:null,name:"RichTextEditor",getConfig:function(){return r},init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(r=m({},g,{},e)).pStylePrefix;return i&&(r.stylePrefix=i+r.stylePrefix),this.pfx=r.stylePrefix,r.actions||[],(t=document.createElement("div")).className="".concat(i,"rte-toolbar ").concat(i,"one-bg"),n=this.initRte(document.createElement("div")),Object(c.p)(t,"mousedown",(function(t){return t.stopPropagation()})),this},postRender:function(e){var n=e.model.get("Canvas");t.style.pointerEvents="all",i(),n.getToolsEl().appendChild(t)},initRte:function(e){var i=this.pfx,o=t,a=this.actionbar,s=this.actions||r.actions,l={actionbar:"".concat(i,"actionbar"),button:"".concat(i,"action"),active:"".concat(i,"active")},c=new p({el:e,classes:l,actions:s,actionbar:a,actionbarContainer:o});return n&&n.setEl(e),c.actionbar&&(this.actionbar=c.actionbar),c.actions&&(this.actions=c.actions),c},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=t,n.addAction(e,{sync:1})},get:function(t){var e;return n.getActions().forEach((function(n){n.name==t&&(e=n)})),e},getAll:function(){return n.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 n=r.em.get("Canvas"),i=n.getTargetToElementDim(t,e,{event:"rteToolbarPosUpdate"});if(i){if(r.adjustToolbar){var o=n.getCanvasView().getFrameOffset();i.top<=i.canvasTop&&!(i.elementHeight+i.targetHeight>=o.height)&&(i.top=i.elementTop+i.elementHeight)}var a=t.style;a.top=i.top+"px",a.left=i.left+"px"}},enable:function(n,i){e=n.el;var o=r.em,a=n.getChildrenContainer(),s=this.customRte;if(t.style.display="",i=s?s.enable(a,i):this.initRte(a).enable(),o){setTimeout(this.updatePosition.bind(this),0);var l="change:canvasOffset canvasScroll";o.off(l,this.updatePosition,this),o.on(l,this.updatePosition,this),o.trigger("rte:enable",n,i)}return i},disable:function(t,e){var n=r.em,o=this.customRte,a=t.getChildrenContainer();o?o.disable(a,e):e&&e.disable(),i(),n&&n.trigger("rte:disable",t,e)}}}},function(t,e,n){"use strict";n.r(e);var r=n(17),i=n(2),o=n.n(i),a=n(1),s=n.n(a),l=n(0),c=n(3);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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){o()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=s.a.$,f=s.a.View.extend({initialize:function(t){this.opt=t||{},Object(l.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=d(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.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=d(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(l.result)(this,scale)||1},getContainerEl:function(){if(!this.el){var t=this.opt.container;this.el="string"==typeof t?document.querySelector(t):t,this.$el=d(this.el)}return this.el},getDocuments:function(){var t=this.em,e=t&&t.get("Canvas").getBody().ownerDocument,n=[document];return e&&n.push(e),n},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(c.g)(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;document.body,this.ppfx||this.pfx,e&&e.get("Canvas").getBody();t?e&&e.get("Canvas").startAutoscroll():e&&e.get("Canvas").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 l=o[s];a+="".concat(l,":").concat(o.getPropertyValue(l),";")}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&&d(this.em.get("Canvas").getBody().ownerDocument).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper),d(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 l=a.getBoundingClientRect();i=l.top+document.documentElement.scrollTop,o=l.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 c.m.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=this.em,r=this.itemSel,i=this.containerSel,o=this.getContainerEl(),a=this.getDocuments(),s=this.onStart,l=this.plh;this.dropModel=null,this.moved=0,t&&!this.matches(t,"".concat(r,", ").concat(i))&&(t=this.closest(t,r)),this.eV=t,l||(l=this.createPlaceholder(),o.appendChild(l),this.plh=l),t&&(e=this.getSourceModel(t))&&e.set&&e.set("status","freezed"),Object(c.p)(o,"mousemove dragover",this.onMove),Object(c.p)(a,"mouseup dragend touchend",this.endMove),Object(c.p)(a,"keydown",this.rollback),s&&s(),n&&n.clearSelection(),this.toggleSortCursor(1),n&&n.trigger("sorter:drag:start",t,e)},getTargetModel:function(t){var e=t||this.target;return d(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,l=t||s,c=this.dropModel,u=this.dropContent,f=function(t){return t&&r&&t.opt&&t.opt.avoidChildren&&e.isTextableActive(t,r)};if(u&&a){if(f(c)&&(c=null),!c){var p=a.get("DomComponents").getComponents(),g={avoidChildren:o,avoidStore:1,avoidUpdateStyle:1},v=p.add(u,h({},g,{temporary:1}));if(c=(c=p.remove(v,g))instanceof Array?c[0]:c,this.dropModel=c,f(c))return this.getSourceModel(l,{target:r,avoidChildren:0})}return c}return l&&d(l).data("model")},selectTargetModel:function(t){if(!(t instanceof s.a.Collection)){var e=this.targetModel;e&&e.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;this.moved=1;var o=i.style.display;o&&"none"!==o||(i.style.display="block");var a=this.offset(this.el);this.elT=this.wmargin?Math.abs(a.top):a.top,this.elL=this.wmargin?Math.abs(a.left):a.left;var s=t.pageY-this.elT+this.el.scrollTop,c=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var u=n.get("Canvas").getMouseRelativeCanvas(t);c=u.x,s=u.y}this.rX=c,this.rY=s,this.eventMove=t;var h=this.getSourceModel(),f=this.dimsFromTarget(t.target,c,s),p=this.target,g=this.getTargetModel(p);this.selectTargetModel(g),g||(i.style.display="none"),this.lastDims=f;var v=this.findPosition(f,c,s);this.isTextableActive(h,g)?(this.activeTextModel=g,this.setContentEditable(g,!0),i.style.display="none",this.lastPos=v,this.updateTextViewCursorPosition(e)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==v.index&&this.lastPos.method==v.method||(this.movePlaceholder(this.plh,f,v,this.prevTargetDim),this.$plh||(this.$plh=d(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=v)),Object(l.isFunction)(r)&&r(t),n&&n.trigger("sorter:drag",{target:p,targetModel:g,sourceModel:h,dims:f,pos:v,x:c,y:s})},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(c.l)(t)){var n=t.style||{},r=d(t),i=e&&d(e);if(!(n.overflow&&"visible"!==n.overflow||"none"!==r.css("float")||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");o=o instanceof Array?o.join(", "):o,i.dragInfo=o,o=Object(l.isString)(o)?this.matches(t,o):o,i.draggable=o;var a=n.get("droppable");return a=(a=a instanceof s.a.Collection?1:a)instanceof Array?a.join(", "):a,i.dropInfo=a,a=Object(l.isString)(a)?this.matches(e,a):a,a=o&&this.isTextableActive(r,n)?1:a,i.droppable=a,a&&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=t.getBoundingClientRect(),n=t.ownerDocument.body,r=this.getCurrentPos(),i=r.x,o=r.y,a=e.top+n.scrollTop,s=e.left+n.scrollLeft,l=e.width,c=e.height;if(o<a+10||o>a+c-10||i<s+10||i>s+l-10)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;if(this.canvasRelative&&o){var a=o.get("Canvas"),s=a.getElementPos(t),l=a.getElementOffsets(t);e=s.top-l.marginTop,n=s.left-l.marginLeft,r=s.height+l.marginTop+l.marginBottom,i=s.width+l.marginLeft+l.marginRight}else{var c=this.offset(t);e=this.relative?t.offsetTop:c.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:c.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,i=t.offsetWidth}return[e,n,r,i]},getChildrenDim:function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);return r&&r.view&&!this.ignoreViewChildren&&(t=r.view.getChildrenContainer()),Object(l.each)(t.children,(function(r,i){var o=Object(c.f)(r,d),a=o&&o.index?o.index():i;if(Object(c.l)(r)||e.matches(r,e.itemSel)){var s=e.getDim(r),l=e.direction;l="v"==l||"h"!=l&&e.isInFlow(r,t),s.push(l,r,a),n.push(s)}})),n},nearBorders:function(t,e,n){var r=0,i=this.borderOffset,o=e||0,a=n||0,s=t[0],l=t[1],c=t[2],u=t[3];return(s+i>a||a>s+c-i||l+i>o||o>l+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,l=0,c=0,u=0,h=0,d=0,f=t.length;d<f;d++)if(a=(h=t[d])[1]+h[3],u=h[0]+h[2],l=h[1]+h[3]/2,c=h[0]+h[2]/2,!(o&&h[1]>o||s&&c>=s||i&&a<i))if(r.index=d,r.indexEl=h[6],h[4]){if(n<c){r.method="before";break}r.method="after"}else n<u&&(s=u),e<l?(o=l,r.method="before"):(i=l,r.method="after");return r},movePlaceholder:function(t,e,n,r){var i=0,o=0,a=0,s=0,l="px",c=n.method,u=e[n.index];if(t.style.borderColor="transparent #62c462",t.style.borderWidth="3px 5px",t.style.margin="-3px 0 0",u)u[4]?(a=u[3]+l,s="auto",i="before"==c?u[0]-0:u[0]+u[2]-0,o=u[1]):(a="auto",s=u[2]-0+l,i=u[0]+0,o="before"==c?u[1]-0:u[1]+u[3]-0,t.style.borderColor="#62c462 transparent",t.style.borderWidth="5px 3px",t.style.margin="0 0 0 -3px");else{if(!this.nested)return void(t.style.display="none");r&&(i=r[0]+5,o=r[1]+5,a=parseInt(r[3])-10+l,s="auto")}t.style.top=i+l,t.style.left=o+l,a&&(t.style.width=a),s&&(t.style.height=s)},endMove:function(t){var e=this,n=[null],r=this.getDocuments(),i=this.getContainerEl(),o=this.onEndMove,a=this.target,s=this.lastPos;Object(c.o)(i,"mousemove dragover",this.onMove),Object(c.o)(r,"mouseup dragend touchend",this.endMove),Object(c.o)(r,"keydown",this.rollback),this.plh.style.display="none";var u=this.eV;if(u&&this.selectOnEnd){var h=this.getSourceModel();h&&h.set&&(h.set("status",""),h.set("status","selected"))}if(this.moved){var d=this.toMove;(Object(l.isArray)(d)?d:d?[d]:[u]).forEach((function(t){n.push(e.move(a,t,s))}))}this.plh&&(this.plh.style.display="none");var f=this.dragHelper;f&&(f.parentNode.removeChild(f),this.dragHelper=null),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),this.toMove=null,Object(l.isFunction)(o)&&n.forEach((function(t){return o(t,e)}))},move:function(t,e,n){var r=this.em,i=this.activeTextModel,o=this.dropContent,a=Object(c.d)(e);r&&r.trigger("component:dragEnd:before",t,a,n);var l,u,f,p=[],g=n.indexEl,v=this.validTarget(t,a),m=d(t).data("collection"),y=v.srcModel,b=v.droppable,w=v.draggable,x=v.dropInfo,C=v.dragInfo,O=v.trgModel;b=O instanceof s.a.Collection?1:b;var S=this.isTextableActive(y,O);if(m&&b&&w){var k={at:g="after"===n.method?g+1:g,noIncrement:1};if(o?(l=o,k.silent=!1,k.avoidUpdateStyle=1):(k.temporary=1,u=m.add({},h({},k)),y.collection&&(l=y.collection.remove(y,{temporary:1}))),S){var T=i.getView();i.trigger("active");var P=T.activeRte,j=y.getEl();delete y.opt.temporary,y.getView().render(),j.setAttribute("data-gjs-textable","true");var E=j.outerHTML;P.insertHTML&&P.insertHTML(E)}else f=m.add(l,k);o?this.dropContent=null:m.remove(u),this.prevTarget=null}else m||p.push("Target collection not found"),b||p.push("Target is not droppable, accepts [".concat(x,"]")),w||p.push("Component not draggable, acceptable by [".concat(C,"]")),console.warn("Invalid target position: "+p.join(", "));return r&&r.trigger("component:dragEnd",m,l,p),r&&r.trigger("sorter:drag:end",{targetCollection:m,modelToDrop:l,warns:p,validResult:v,dst:t,srcEl:a}),f},rollback:function(t){Object(c.o)(this.getDocuments(),"keydown",this.rollback),27==(t.which||t.keyCode)&&(this.moved=0,this.endMove())}}),p=n(13),g=n.n(p),v=n(14),m=n.n(v),y={mousePosFetcher:null,updateTarget:null,ratioDefault:0,posFetcher:null,onStart:null,onMove:null,onEnd:null,step:1,minDim:32,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},b=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}},w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g()(this,t),this.setOptions(e),Object(l.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(l.defaults)(t,y),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}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll("iframe");Object(l.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:"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):b(t)}},{key:"focus",value:function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:1}),Object(c.p)(this.getDocumentEl(),"mousedown",this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display="none",this.el&&(Object(c.o)(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.opts||{},r="data-"+n.prefix+"handler",i=this.getElementPos(e,{target:"el"});this.handlerAttr=t.target.getAttribute(r),this.clickedHandler=t.target,this.startDim={t:i.top,l:i.left,w:i.width,h:i.height},this.rectDim={t:i.top,l:i.left,w:i.width,h:i.height},this.startPos={x:t.clientX,y:t.clientY};var o=this.getDocumentEl();Object(c.p)(o,"mousemove",this.move),Object(c.p)(o,"keydown",this.handleKeyDown),Object(c.p)(o,"mouseup",this.stop),Object(l.isFunction)(this.onStart)&&this.onStart(t,{docs:o,config:n,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(c.o)(n,"mousemove",this.move),Object(c.o)(n,"keydown",this.handleKeyDown),Object(c.o)(n,"mouseup",this.stop),this.updateRect(1),this.toggleFrames(),Object(l.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,c=n.keyWidth,u=n.keyHeight;if(Object(l.isFunction)(i))i(e,r,{store:t,selectedHandler:o,resizer:this,config:n});else{var h=e.style;h[c]=r.w+s,h[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;if(!e.avoidContainerUpdate&&r){var o=["left","top","width","height"],a=this.getElementPos(r,{target:"container"});o.forEach((function(t){return i[t]="".concat(a[t],"px")})),t.forceShow&&(i.display="block")}}},{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,l=t.delta.y,u=i.w,h=i.h,d={t:0,l:0,w:u,h:h};if(t){var f=t.handlerAttr;~f.indexOf("r")&&(e=Object(c.n)(u+s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("b")&&(e=Object(c.n)(h+l*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),d.h=e),~f.indexOf("l")&&(e=Object(c.n)(u-s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("t")&&(e=Object(c.n)(h-l*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),d.h=e);var p=n.ratioDefault?!t.keys.shift:t.keys.shift;if(f.indexOf("c")<0&&p){var g=i.w/i.h;d.w/d.h>g?d.h=Math.round(d.w/g):d.w=Math.round(d.h*g)}return~f.indexOf("l")&&(d.l=i.w-d.w),~f.indexOf("t")&&(d.t=i.h-d.h),d}}}]),t}(),x={init:function(t){return new w(t)}};e.default=function(){return{name:"Utils",init:function(){return this},Sorter:f,Resizer:x,Dragger:r.a}}},function(t,e,n){"use strict";n.r(e);var r=n(8),i=n.n(r),o=n(2),a=n.n(o),s=n(0),l=n(19),c={stylePrefix:"com-",defaults:[],strict: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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=function(){var t,e={},r={},o={},a={},u=[["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"]];return{CommandAbstract:l.default,name:"Commands",init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=h({},c,{},r),t=e.em;var a=e.pStylePrefix;for(var l in a&&(e.stylePrefix=a+e.stylePrefix),e.defaults){var d=e.defaults[l];d.id&&this.add(d.id,d)}return 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,l=a||t.getSelected(),c=a?[a]:i()(t.getSelectedAll()),u=o&&"dragstart"==o.type,h={preserveSelected:1},d=["absolute","translate"],f=function(){return r.stopDefault(h)};if(r.set("_cmpDrag",1),l&&l.get("draggable")){var p=l.get("dmode")||r.get("dmode");u?setTimeout(f,0):f();var g=function(e,n){r.runDefault(h),c.forEach((function(t){return t.set("status","selected")})),t.select(c),l.emitUpdate()};if(Object(s.includes)(d,p))t.runCommand("core:component-drag",{guidesInfo:1,mode:p,target:l,onEnd:g,event:o});else{u&&o.dataTransfer.setDragImage(l.view.el,0,0);var v=t.Commands.get("move-comp");v.onEndMoveFromModel=g,v.initSorterFromModels(c)}c.forEach((function(t){return t.set("status","freezed-selected")}))}else console.warn("The element is not draggable")}},o["core:undo"]=function(t){return t.UndoManager.undo()},o["core:redo"]=function(t){return t.UndoManager.redo()},u.forEach((function(e){var r=e[2],i=n(83)("./".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]=l.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({},n.constructor.prototype,{},e);this.add(t,r);var i=u.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=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(l.default.extend(t))(e)}}}}]).default}));
|
||
//# sourceMappingURL=grapes.min.js.map
|