everbee-landing-page-builder 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -9,7 +9,7 @@ import*as t from"react";import e,{useEffect as n,forwardRef as r,useContext as o
9
9
  * https://github.com/osartun/Backbone.Undo.js
10
10
  */o=[n(50),n(316)],r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function o(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=o(arguments,1)),t.all(n,(function(t){return t in e})))}var a=function(){var e=!1,n=-1;function r(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||r(),n}}();function s(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,r,o){for(var i,a=0,s=n.length;a<s;a++)if(i=n[a]){if("on"===e){if(!o.objectRegistry.register(i))continue}else if(!o.objectRegistry.unregister(i))continue;t.isFunction(i[e])&&i[e]("all",r,o)}}function c(e,n){var r=n.type,o=n.undoTypes,i=!o[r]||o[r][e];t.isFunction(i)&&i(n.object,n.before,n.after,n.options)}function u(e,r,o,i,a){if(!(o.isCurrentlyUndoRedoing||"undo"===e&&-1===o.pointer||"redo"===e&&o.pointer===o.length-1)){o.isCurrentlyUndoRedoing=!0;var s,l,c="undo"===e;for(a?l=c&&o.pointer===o.length-1||!c&&-1===o.pointer?t.clone(o.models):n.apply(o.models,c?[0,o.pointer]:[o.pointer,o.length-1]):(s=o.at(c?o.pointer:o.pointer+1),l=i?o.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),o.pointer+=(c?-1:1)*l.length;s=c?l.pop():l.shift();)s[e]();o.isCurrentlyUndoRedoing=!1,r.trigger(e,r)}}function p(t,e){var n=t.condition,o=typeof n;return"function"===o?!!r(n,t,e):"boolean"!==o||n}function d(t,e,n,o){if(t.track&&!t.isCurrentlyUndoRedoing&&e in o&&p(o[e],n)){var s=r(o[e].on,o[e],n);if(i(s,"object","before","after")){if(s.type=e,s.magicFusionIndex=a(),s.undoTypes=o,t.pointer<t.length-1)for(var l=t.length-t.pointer-1;l--;)t.pop();t.pointer=t.length,t.add(s),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}s.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 f={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,o){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),o&&o.unsetData&&o.unsetData.before&&o.unsetData.before.length&&t.each(o.unsetData.before,e.unset,e))},redo:function(e,n,r,o){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),o&&o.unsetData&&o.unsetData.after&&o.unsetData.after.length&&t.each(o.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),o=t.keys(r),i=t.pick(e.previousAttributes(),o),a=t.keys(i),s=(n||(n={})).unsetData={after:[],before:[]};return o.length!=a.length&&(o.length>a.length?t.each(o,(function(t){t in i||s.before.push(t)}),this):t.each(a,(function(t){t in r||s.after.push(t)}))),{object:e,before:i,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,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 h(){}function g(e,n,r,o){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,r,o):g(e,n,t,r)}));switch(e){case 0:i(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(o[n]=r);break;case 1:o[n]&&t.isObject(r)&&(o[n]=t.extend({},o[n],r));break;case 2:delete o[n]}return this}h.prototype=f;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){c("undo",this.attributes)},redo:function(t){c("redo",this.attributes)}}),m=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),y=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new m,this.objectRegistry=new s,this.undoTypes=new h,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){d(this.stack,t,o(arguments,1),this.undoTypes)},register:function(){l("on",arguments,this._addToStack,this)},unregister:function(){l("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){u("undo",this,this.stack,t)},undoAll:function(){u("undo",this,this.stack,!1,!0)},redo:function(t){u("redo",this,this.stack,t)},redoAll:function(){u("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:o(arguments);n=r.pop();)n instanceof y&&n.stack instanceof m&&(n.stack=this.stack)},addUndoType:function(t,e){g(0,t,e,this.undoTypes)},changeUndoType:function(t,e){g(1,t,e,this.undoTypes)},removeUndoType:function(t){g(2,t,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return t.extend(y,{defaults:function(e){t.extend(y.prototype.defaults,e)},addUndoType:function(t,e){g(0,t,e,f)},changeUndoType:function(t,e){g(1,t,e,f)},removeUndoType:function(t){g(2,t,void 0,f)}}),e.UndoManager=y},void 0===(i="function"==typeof r?r.apply(e,o):r)||(t.exports=i)},316:(t,e,n)=>{var r,o;!function(i){var a="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g;r=[n(50),n(895),e],o=function(t,e,n){a.Backbone=function(t,e,n,r){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.4.1",e.$=r,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,s=e.Events={},l=/\s+/,c=function(t,e,r,o,i){var a,s=0;if(r&&"object"==typeof r){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(a=n.keys(r);s<a.length;s++)e=c(t,e,a[s],r[a[s]],i)}else if(r&&l.test(r))for(a=r.split(l);s<a.length;s++)e=t(e,a[s],o,i);else e=t(e,r,o,i);return e};s.on=function(t,e,n){(this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:a}),a)&&((this._listeners||(this._listeners={}))[a.id]=a,a.interop=!1);return this},s.listenTo=function(t,e,r){if(!t)return this;var o=t._listenId||(t._listenId=n.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),s=a=i[o];s||(this._listenId||(this._listenId=n.uniqueId("l")),s=a=i[o]=new v(this,t));var l=p(t,e,r,this);if(a=void 0,l)throw l;return s.interop&&s.on(e,r),this};var u=function(t,e,n,r){if(n){var o=t[e]||(t[e]=[]),i=r.context,a=r.ctx,s=r.listening;s&&s.count++,o.push({callback:n,context:i,ctx:i||a,listening:s})}return t},p=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};s.off=function(t,e,n){return this._events?(this._events=c(d,this._events,t,e,{context:n,listeners:this._listeners}),this):this},s.stopListening=function(t,e,r){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:n.keys(o),a=0;a<i.length;a++){var s=o[i[a]];if(!s)break;s.obj.off(e,r,this),s.interop&&s.off(e,r)}return n.isEmpty(o)&&(this._listeningTo=void 0),this};var d=function(t,e,r,o){if(t){var i,a=o.context,s=o.listeners,l=0;if(e||a||r){for(i=e?[e]:n.keys(t);l<i.length;l++){var c=t[e=i[l]];if(!c)break;for(var u=[],p=0;p<c.length;p++){var d=c[p];if(r&&r!==d.callback&&r!==d.callback._callback||a&&a!==d.context)u.push(d);else{var f=d.listening;f&&f.off(e,r)}}u.length?t[e]=u:delete t[e]}return t}for(i=n.keys(s);l<i.length;l++)s[i[l]].cleanup()}};s.once=function(t,e,n){var r=c(f,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},s.listenToOnce=function(t,e,n){var r=c(f,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};var f=function(t,e,r,o){if(r){var i=t[e]=n.once((function(){o(e,i),r.apply(this,arguments)}));i._callback=r}return t};s.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 c(h,this._events,t,void 0,n),this};var h=function(t,e,n,r){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&g(o,r),i&&g(i,[e].concat(r))}return t},g=function(t,e){var n,r=-1,o=t.length,i=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a);return;case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=s.on,v.prototype.off=function(t,e){var n;this.interop?(this._events=c(d,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},s.bind=s.on,s.unbind=s.off,n.extend(e,s);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var o=n.result(this,"defaults");r=n.defaults(n.extend({},o,r),o),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,s,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},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 o;if("object"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={}),!this._validate(o,r))return!1;var i=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,p=this._previousAttributes;for(var d in o)e=o[d],n.isEqual(c[d],e)||s.push(d),n.isEqual(p[d],e)?delete u[d]:u[d]=e,i?delete c[d]:c[d]=e;if(this.idAttribute in o){var f=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,f,r)}if(!a){s.length&&(this._pending=r);for(var h=0;h<s.length;h++)this.trigger("change:"+s[h],this,c[s[h]],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,r=this._changing?this._previousAttributes:this.attributes,o={};for(var i in t){var a=t[i];n.isEqual(r[i],a)||(o[i]=a,e=!0)}return!!e&&o},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 o=t.parse?e.parse(n,t):n;if(!e.set(o,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},K(this,t),this.sync("read",this,t)},save:function(t,e,r){var o;null==t||"object"==typeof t?(o=t,r=e):(o={})[t]=e;var i=(r=n.extend({validate:!0,parse:!0},r)).wait;if(o&&!i){if(!this.set(o,r))return!1}else if(!this._validate(o,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(i&&(e=n.extend({},o,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger("sync",a,t,r)},K(this,r),o&&i&&(this.attributes=n.extend({},l,o));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=o);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,o=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){o&&i(),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):(K(this,t),a=this.sync("delete",this,t)),o||i(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||G();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)}});var y=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),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))},b={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},x=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,o=Array(t.length-n),i=e.length;for(r=0;r<o.length;r++)o[r]=t[r+n];for(r=0;r<i;r++)t[r+n]=e[r];for(r=0;r<o.length;r++)t[r+i+n]=o[r]};n.extend(y.prototype,s,{model:m,preinitialize:function(){},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,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var o=this._removeModels(t,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var o=e.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,a,s=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==o&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){i=t[a];var y=this.get(i);if(y){if(f&&i!==y){var w=this._isModel(i)?i.attributes:i;e.parse&&(w=y.parse(w,e)),y.set(w,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}p[y.cid]||(p[y.cid]=!0,s.push(y)),t[a]=y}else d&&(i=t[a]=this._prepareModel(i,e))&&(l.push(i),this._addReference(i,e),p[i.cid]=!0,s.push(i))}if(h){for(a=0;a<this.length;a++)p[(i=this.models[a]).cid]||u.push(i);u.length&&this._removeModels(u,e)}var _=!1,C=!v&&d&&h;if(s.length&&C?(_=this.length!==s.length||n.some(this.models,(function(t,e){return t!==s[e]})),this.models.length=0,x(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),x(this.models,l,null==o?this.length:o),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=o&&(e.index=o+a),(i=l[a]).trigger("add",i,this,e);(g||_)&&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 i.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||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=e.bind(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 o=t.reset?"reset":"set";r[o](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},K(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 o=this,i=e.success;return e.success=function(t,e,n){r&&o.add(t,n),i&&i.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,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new C(this,S)},keys:function(){return new C(this,O)},entries:function(){return new C(this,E)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){return this._isModel(t)?(t.collection||(t.collection=this),t):((e=e?n.clone(e):{}).collection=this,(r=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,r.validationError,e),!1):r);var r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var o=this.get(t[r]);if(o){var i=this.indexOf(o);this.models.splice(i,1),this.length--,delete this._byId[o.cid];var a=this.modelId(o.attributes,o.idAttribute);null!=a&&delete this._byId[a],e.silent||(e.index=i,o.trigger("remove",o,this,e)),n.push(o),this._removeReference(o,e)}}return n},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes,t.idAttribute);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,t.idAttribute);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),"changeId"===t){var o=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)}});var _="function"==typeof Symbol&&Symbol.iterator;_&&(y.prototype[_]=y.prototype.values);var C=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,O=2,E=3;_&&(C.prototype[_]=function(){return this});C.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===S)t=e;else{var n=this._collection.modelId(e.attributes,e.idAttribute);t=this._kind===O?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var k=e.View=function(t){this.cid=n.uniqueId("view"),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(t,A)),this._ensureElement(),this.initialize.apply(this,arguments)},T=/^(\S+)\s*(.*)$/,A=["model","collection","el","id","attributes","className","tagName","events"];n.extend(k.prototype,s,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},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 o=e.match(T);this.delegate(o[1],o[2],r.bind(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)}});var P=function(t,e,n,r){switch(e){case 1:return function(){return t[n](this[r])};case 2:return function(e){return t[n](this[r],e)};case 3:return function(e,o){return t[n](this[r],M(e,this),o)};case 4:return function(e,o,i){return t[n](this[r],M(e,this),o,i)};default:return function(){var e=i.call(arguments);return e.unshift(this[r]),t[n].apply(t,e)}}},j=function(t,e,r,o){n.each(r,(function(n,r){e[r]&&(t.prototype[r]=P(e,n,r,o))}))},M=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?N(t):n.isString(t)?function(e){return e.get(t)}:t},N=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},R={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},L={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};n.each([[y,R,"models"],[m,L,"attributes"]],(function(t){var e=t[0],r=t[1],o=t[2];e.mixin=function(t){var r=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});j(e,t,r,o)},j(e,n,r,o)})),e.sync=function(t,r,o){var i=I[t];n.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:i,dataType:"json"};if(o.url||(a.url=n.result(r,"url")||G()),null!=o.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(o.attrs||r.toJSON(o))),o.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),o.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){a.type="POST",o.emulateJSON&&(a.data._method=i);var s=o.beforeSend;o.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),s)return s.apply(this,arguments)}}"GET"===a.type||o.emulateJSON||(a.processData=!1);var l=o.error;o.error=function(t,e,n){o.textStatus=e,o.errorThrown=n,l&&l.call(o.context,t,e,n)};var c=o.xhr=e.ajax(n.extend(a,o));return r.trigger("request",r,c,o),c};var I={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var D=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},F=/\((.*?)\)/g,V=/(\(\?)?:\w+/g,B=/\*\w+/g,z=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(D.prototype,s,{preinitialize:function(){},initialize:function(){},route:function(t,r,o){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(o=r,r=""),o||(o=this[r]);var i=this;return e.history.route(t,(function(n){var a=i._extractParameters(t,n);!1!==i.execute(o,a,r)&&(i.trigger.apply(i,["route:"+r].concat(a)),i.trigger("route",r,a),e.history.trigger("route",i,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(z,"\\$&").replace(F,"(?:$1)?").replace(V,(function(t,e){return e?t:"([^/?]+)"})).replace(B,"([^?]*?)"),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 H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},$=/^[#\/]|\s+$/g,W=/^\/+|\/+$/g,U=/#.*$/;H.started=!1,n.extend(H.prototype,s,{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($,"")},start:function(t){if(H.started)throw new Error("Backbone.history has already been started");if(H.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(W,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),H.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(!H.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(U,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new H;var q=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};m.extend=y.extend=D.extend=k.extend=H.extend=q;var G=function(){throw new Error('A "url" property or function must be specified')},K=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,r),void 0===o||(t.exports=o)}()},210:(t,e,n)=>{!function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,o){var i=!1;return"html"==this.configuration&&(i=!!o.context&&e.test(o.context.tagName)),!i&&("tag"==t&&/>$/.test(n)&&o.context||/^</.test(r))}}),t.defineExtension("commentRange",(function(e,n,r){var o=this,i=t.innerMode(o.getMode(),o.getTokenAt(n).state).mode;o.operation((function(){if(e)o.replaceRange(i.commentEnd,r),o.replaceRange(i.commentStart,n),n.line==r.line&&n.ch==r.ch&&o.setCursor(n.line,n.ch+i.commentStart.length);else{var t=o.getRange(n,r),a=t.indexOf(i.commentStart),s=t.lastIndexOf(i.commentEnd);a>-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+i.commentStart.length,s)+t.substr(s+i.commentEnd.length)),o.replaceRange(t,n,r)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var r=this,o=r.getMode(),i=r.getRange(e,n).split("\n"),a=t.copyState(o,r.getTokenAt(e).state),s=r.getOption("tabSize"),l="",c=0,u=0===e.ch;function p(){l+="\n",u=!0,++c}for(var d=0;d<i.length;++d){for(var f=new t.StringStream(i[d],s);!f.eol();){var h=t.innerMode(o,a),g=o.token(f,a),v=f.current();f.start=f.pos,u&&!/\S/.test(v)||(l+=v,u=!1),!u&&h.mode.newlineAfterToken&&h.mode.newlineAfterToken(g,v,f.string.slice(f.pos)||i[d+1]||"",h.state)&&p()}!f.pos&&o.blankLine&&o.blankLine(a),!u&&d<i.length-1&&p()}r.operation((function(){r.replaceRange(l,e,n);for(var t=e.line+1,o=e.line+c;t<=o;++t)r.indentLine(t,"smart");r.setSelection(e,r.getCursor(!1))}))}))}(n(631))},631:function(t){t.exports=function(){var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),i=/Edge\/(\d+)/.exec(t),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!i&&/Chrome\/(\d+)/.exec(t),p=u&&+u[1],d=/Opera\//.test(t),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),g=/PhantomJS/.test(t),v=f&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),m=/Android/.test(t),y=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),w=/\bCrOS\b/.test(t),x=/win/i.test(e),_=d&&t.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(d=!1,l=!0);var C=b&&(c||d&&(null==_||_<12.11)),S=n||a&&s>=9;function O(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,k=function(t,e){var n=t.className,r=O(e).exec(n);if(r){var o=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function A(t,e){return T(t).appendChild(e)}function P(t,e,n,r){var o=document.createElement(t);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof e)o.appendChild(document.createTextNode(e));else if(e)for(var i=0;i<e.length;++i)o.appendChild(e[i]);return o}function j(t,e,n,r){var o=P(t,e,n,r);return o.setAttribute("role","presentation"),o}function M(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 N(t){var e;try{e=t.activeElement}catch(n){e=t.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function R(t,e){var n=t.className;O(e).test(n)||(t.className+=(n?" ":"")+e)}function L(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!O(n[r]).test(e)&&(e+=" "+n[r]);return e}E=document.createRange?function(t,e,n,r){var o=document.createRange();return o.setEnd(r||t,n),o.setStart(t,e),o}: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 D(t){return t.display.wrapper.ownerDocument}function F(t){return D(t).defaultView}function V(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function B(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 z(t,e,n,r,o){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=r||0,a=o||0;;){var s=t.indexOf("\t",i);if(s<0||s>=e)return a+(e-i);a+=s-i,a+=n-a%n,i=s+1}}v?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=V(this.onTimeout,this)};function $(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}H.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},H.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var W=50,U={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},G={origin:"*mouse"},K={origin:"+move"};function Y(t,e,n){for(var r=0,o=0;;){var i=t.indexOf("\t",r);-1==i&&(i=t.length);var a=i-r;if(i==t.length||o+a>=e)return r+Math.min(a,e-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=e)return r}}var X=[""];function Z(t){for(;X.length<=t;)X.push(J(X)+" ");return X[t]}function J(t){return t[t.length-1]}function Q(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function tt(t,e,n){for(var r=0,o=n(e);r<t.length&&n(t[r])<=o;)r++;t.splice(r,0,e)}function et(){}function nt(t,e){var n;return Object.create?n=Object.create(t):(et.prototype=t,n=new et),e&&B(e,n),n}var rt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ot(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||rt.test(t))}function it(t,e){return e?!!(e.source.indexOf("\\w")>-1&&ot(t))||e.test(t):ot(t)}function at(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var st=/[\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 lt(t){return t.charCodeAt(0)>=768&&st.test(t)}function ct(t,e,n){for(;(n<0?e>0:e<t.length)&&lt(t.charAt(e));)e+=n;return e}function ut(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var o=(e+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+r}}function pt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var o=!1,i=0;i<t.length;++i){var a=t[i];(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",i),o=!0)}o||r(e,n,"ltr")}var dt=null;function ft(t,e,n){var r;dt=null;for(var o=0;o<t.length;++o){var i=t[o];if(i.from<e&&i.to>e)return o;i.to==e&&(i.from!=i.to&&"before"==n?r=o:dt=o),i.from==e&&(i.from!=i.to&&"before"!=n?r=o:dt=o)}return null!=r?r:dt}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,i=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var u=t.length,p=[],d=0;d<u;++d)p.push(n(t.charCodeAt(d)));for(var f=0,h=c;f<u;++f){var g=p[f];"m"==g?p[f]=h:h=g}for(var v=0,m=c;v<u;++v){var y=p[v];"1"==y&&"r"==m?p[v]="n":i.test(y)&&(m=y,"r"==y&&(p[v]="R"))}for(var b=1,w=p[0];b<u-1;++b){var x=p[b];"+"==x&&"1"==w&&"1"==p[b+1]?p[b]="1":","!=x||w!=p[b+1]||"1"!=w&&"n"!=w||(p[b]=w),w=x}for(var _=0;_<u;++_){var C=p[_];if(","==C)p[_]="N";else if("%"==C){var S=void 0;for(S=_+1;S<u&&"%"==p[S];++S);for(var O=_&&"!"==p[_-1]||S<u&&"1"==p[S]?"1":"N",E=_;E<S;++E)p[E]=O;_=S-1}}for(var k=0,T=c;k<u;++k){var A=p[k];"L"==T&&"1"==A?p[k]="L":i.test(A)&&(T=A)}for(var P=0;P<u;++P)if(o.test(p[P])){var j=void 0;for(j=P+1;j<u&&o.test(p[j]);++j);for(var M="L"==(P?p[P-1]:c),N=M==("L"==(j<u?p[j]:c))?M?"L":"R":c,R=P;R<j;++R)p[R]=N;P=j-1}for(var L,I=[],D=0;D<u;)if(a.test(p[D])){var F=D;for(++D;D<u&&a.test(p[D]);++D);I.push(new l(0,F,D))}else{var V=D,B=I.length,z="rtl"==e?1:0;for(++D;D<u&&"L"!=p[D];++D);for(var H=V;H<D;)if(s.test(p[H])){V<H&&(I.splice(B,0,new l(1,V,H)),B+=z);var $=H;for(++H;H<D&&s.test(p[H]);++H);I.splice(B,0,new l(2,$,H)),B+=z,V=H}else++H;V<D&&I.splice(B,0,new l(1,V,D))}return"ltr"==e&&(1==I[0].level&&(L=t.match(/^\s+/))&&(I[0].from=L[0].length,I.unshift(new l(0,0,L[0].length))),1==J(I).level&&(L=t.match(/\s+$/))&&(J(I).to-=L[0].length,I.push(new l(0,u-L[0].length,u)))),"rtl"==e?I.reverse():I}}();function gt(t,e){var n=t.order;return null==n&&(n=t.order=ht(t.text,e)),n}var vt=[],mt=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]||vt).concat(n)}};function yt(t,e){return t._handlers&&t._handlers[e]||vt}function bt(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,o=r&&r[e];if(o){var i=$(o,n);i>-1&&(r[e]=o.slice(0,i).concat(o.slice(i+1)))}}}function wt(t,e){var n=yt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function xt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),wt(t,n||e.type,t,e),kt(e)||e.codemirrorIgnore}function _t(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==$(n,e[r])&&n.push(e[r])}function Ct(t,e){return yt(t,e).length>0}function St(t){t.prototype.on=function(t,e){mt(this,t,e)},t.prototype.off=function(t,e){bt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Et(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function kt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){Ot(t),Et(t)}function At(t){return t.target||t.srcElement}function Pt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),b&&t.ctrlKey&&1==e&&(e=3),e}var jt,Mt,Nt=function(){if(a&&s<9)return!1;var t=P("div");return"draggable"in t||"dragDrop"in t}();function Rt(t){if(null==jt){var e=P("span","​");A(t,P("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(jt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=jt?P("span","​"):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Lt(t){if(null!=Mt)return Mt;var e=A(t,document.createTextNode("AخA")),n=E(e,0,1).getBoundingClientRect(),r=E(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Mt=r.right-n.right<3)}var It,Dt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var o=t.indexOf("\n",e);-1==o&&(o=t.length);var i=t.slice(e,"\r"==t.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),e+=a+1):(n.push(i),e=o+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Ft=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)},Vt="oncopy"in(It=P("div"))||(It.setAttribute("oncopy","return;"),"function"==typeof It.oncopy),Bt=null;function zt(t){if(null!=Bt)return Bt;var e=A(t,P("span","x")),n=e.getBoundingClientRect(),r=E(e,0,1).getBoundingClientRect();return Bt=Math.abs(n.left-r.left)>1}var Ht={},$t={};function Wt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ht[t]=e}function Ut(t,e){$t[t]=e}function qt(t){if("string"==typeof t&&$t.hasOwnProperty(t))t=$t[t];else if(t&&"string"==typeof t.name&&$t.hasOwnProperty(t.name)){var e=$t[t.name];"string"==typeof e&&(e={name:e}),(t=nt(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return qt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return qt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Gt(t,e){e=qt(e);var n=Ht[e.name];if(!n)return Gt(t,"text/plain");var r=n(t,e);if(Kt.hasOwnProperty(e.name)){var o=Kt[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var Kt={};function Yt(t,e){B(e,Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={})}function Xt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Zt(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 Jt(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 te(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(e<i){n=o;break}e-=i}return n.lines[e]}function ee(t,e,n){var r=[],o=e.line;return t.iter(e.line,n.line+1,(function(t){var i=t.text;o==n.line&&(i=i.slice(0,n.ch)),o==e.line&&(i=i.slice(e.ch)),r.push(i),++o})),r}function ne(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function re(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function oe(t){if(null==t.parent)return null;for(var e=t.parent,n=$(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var o=0;r.children[o]!=e;++o)n+=r.children[o].chunkSize();return n+e.first}function ie(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var o=t.children[r],i=o.height;if(e<i){t=o;continue t}e-=i,n+=o.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 ae(t,e){return e>=t.first&&e<t.first+t.size}function se(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function le(t,e,n){if(void 0===n&&(n=null),!(this instanceof le))return new le(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ce(t,e){return t.line-e.line||t.ch-e.ch}function ue(t,e){return t.sticky==e.sticky&&0==ce(t,e)}function pe(t){return le(t.line,t.ch)}function de(t,e){return ce(t,e)<0?e:t}function fe(t,e){return ce(t,e)<0?t:e}function he(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ge(t,e){if(e.line<t.first)return le(t.first,0);var n=t.first+t.size-1;return e.line>n?le(n,te(t,n).text.length):ve(e,te(t,e.line).text.length)}function ve(t,e){var n=t.ch;return null==n||n>e?le(t.line,e):n<0?le(t.line,0):t}function me(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ge(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=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(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 o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ye=function(t,e){this.state=t,this.lookAhead=e},be=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 we(t,e,n,r){var o=[t.state.modeGen],i={};Ae(t,e.text,t.doc.mode,n,(function(t,e){return o.push(t,e)}),i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=t.state.overlays[r],l=1,c=0;n.state=!0,Ae(t,e.text,s.mode,n,(function(t,e){for(var n=l;c<t;){var r=o[l];r>t&&o.splice(l,1,t,o[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)o.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+e}}),i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function xe(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=_e(t,oe(e)),o=e.text.length>t.options.maxHighlightLength&&Xt(t.doc.mode,r.state),i=we(t,e,r);o&&(r.state=o),e.stateAfter=r.save(!o),e.styles=i.styles,i.classes?e.styleClasses=i.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function _e(t,e,n){var r=t.doc,o=t.display;if(!r.mode.startState)return new be(r,!0,e);var i=Pe(t,e,n),a=i>r.first&&te(r,i-1).stateAfter,s=a?be.fromSaved(r,a,i):new be(r,Jt(r.mode),i);return r.iter(i,e,(function(n){Ce(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function Ce(t,e,n,r){var o=t.doc.mode,i=new Qt(e,t.options.tabSize,n);for(i.start=i.pos=r||0,""==e&&Se(o,n.state);!i.eol();)Oe(o,i,n.state),i.start=i.pos}function Se(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Zt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Oe(t,e,n,r){for(var o=0;o<10;o++){r&&(r[0]=Zt(t,n).mode);var i=t.token(e,n);if(e.pos>e.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}be.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},be.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}},be.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},be.fromSaved=function(t,e,n){return e instanceof ye?new be(t,Xt(t.mode,e.state),n,e.lookAhead):new be(t,Xt(t.mode,e),n)},be.prototype.save=function(t){var e=!1!==t?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ye(e,this.maxLookAhead):e};var Ee=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,r){var o,i,a=t.doc,s=a.mode,l=te(a,(e=ge(a,e)).line),c=_e(t,e.line,n),u=new Qt(l.text,t.options.tabSize,c);for(r&&(i=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,o=Oe(s,u,c.state),r&&i.push(new Ee(u,o,Xt(a.mode,c.state)));return r?i:new Ee(u,o,c.state)}function Te(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 Ae(t,e,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,p=new Qt(e,t.options.tabSize,r),d=t.options.addModeClass&&[null];for(""==e&&Te(Se(n,r.state),i);!p.eol();){if(p.pos>t.options.maxHighlightLength?(s=!1,a&&Ce(t,e,r,p.pos),p.pos=e.length,l=null):l=Te(Oe(n,p,r.state,d),i),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;c<p.start;)o(c=Math.min(p.start,c+5e3),u);u=l}p.start=p.pos}for(;c<p.pos;){var h=Math.min(p.pos,c+5e3);o(h,u),c=h}}function Pe(t,e,n){for(var r,o,i=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=i.first)return i.first;var l=te(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ye?c.lookAhead:0)<=i.modeFrontier))return s;var u=z(l.text,null,t.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}function je(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 o=te(t,r).stateAfter;if(o&&(!(o instanceof ye)||r+o.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}var Me=!1,Ne=!1;function Re(){Me=!0}function Le(){Ne=!0}function Ie(t,e,n){this.marker=t,this.from=e,this.to=n}function De(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Fe(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Ve(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&t.markedSpans&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}function Be(t,e,n){var r;if(t)for(var o=0;o<t.length;++o){var i=t[o],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=e:i.from<e)||i.from==e&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=e:i.to>e);(r||(r=[])).push(new Ie(a,i.from,s?null:i.to))}}return r}function ze(t,e,n){var r;if(t)for(var o=0;o<t.length;++o){var i=t[o],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=e:i.to>e)||i.from==e&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=e:i.from<e);(r||(r=[])).push(new Ie(a,s?null:i.from-e,null==i.to?null:i.to-e))}}return r}function He(t,e){if(e.full)return null;var n=ae(t,e.from.line)&&te(t,e.from.line).markedSpans,r=ae(t,e.to.line)&&te(t,e.to.line).markedSpans;if(!n&&!r)return null;var o=e.from.ch,i=e.to.ch,a=0==ce(e.from,e.to),s=Be(n,o,a),l=ze(r,i,a),c=1==e.text.length,u=J(e.text).length+(c?o:0);if(s)for(var p=0;p<s.length;++p){var d=s[p];if(null==d.to){var f=De(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=o}}if(l)for(var h=0;h<l.length;++h){var g=l[h];null!=g.to&&(g.to+=u),null==g.from?De(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=$e(s)),l&&l!=s&&(l=$e(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 Ie(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(l)}return v}function $e(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function We(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!=$(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:e,to:n}],i=0;i<r.length;++i)for(var a=r[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(ce(c.to,s.from)<0||ce(c.from,s.to)>0)){var u=[l,1],p=ce(c.from,s.from),d=ce(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}function Ue(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function qe(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Ge(t){return t.inclusiveLeft?-1:0}function Ke(t){return t.inclusiveRight?1:0}function Ye(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),o=e.find(),i=ce(r.from,o.from)||Ge(t)-Ge(e);if(i)return-i;var a=ce(r.to,o.to)||Ke(t)-Ke(e);return a||e.id-t.id}function Xe(t,e){var n,r=Ne&&t.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(e?o.from:o.to)&&(!n||Ye(n,o.marker)<0)&&(n=o.marker);return n}function Ze(t){return Xe(t,!0)}function Je(t){return Xe(t,!1)}function Qe(t,e){var n,r=Ne&&t.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<e)&&(null==i.to||i.to>e)&&(!n||Ye(n,i.marker)<0)&&(n=i.marker)}return n}function tn(t,e,n,r,o){var i=te(t,e),a=Ne&&i.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=ce(c.from,n)||Ge(l.marker)-Ge(o),p=ce(c.to,r)||Ke(l.marker)-Ke(o);if(!(u>=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ce(c.to,n)>=0:ce(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ce(c.from,r)<=0:ce(c.from,r)<0)))return!0}}}function en(t){for(var e;e=Ze(t);)t=e.find(-1,!0).line;return t}function nn(t){for(var e;e=Je(t);)t=e.find(1,!0).line;return t}function rn(t){for(var e,n;e=Je(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function on(t,e){var n=te(t,e),r=en(n);return n==r?e:oe(r)}function an(t,e){if(e>t.lastLine())return e;var n,r=te(t,e);if(!sn(t,r))return e;for(;n=Je(r);)r=n.find(1,!0).line;return oe(r)+1}function sn(t,e){var n=Ne&&e.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if((r=n[o]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ln(t,e,r))return!0}}function ln(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return ln(t,r.line,De(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var o=void 0,i=0;i<e.markedSpans.length;++i)if((o=e.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&ln(t,e,o))return!0}function cn(t){for(var e=0,n=(t=en(t)).parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==t)break;e+=o.height}for(var i=n.parent;i;i=(n=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;e+=s.height}return e}function un(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Ze(r);){var o=e.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=t;e=Je(r);){var i=e.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function pn(t){var e=t.display,n=t.doc;e.maxLine=te(n,n.first),e.maxLineLength=un(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=un(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var dn=function(t,e,n){this.text=t,qe(this,e),this.height=n?n(this):1};function fn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ue(t),qe(t,n);var o=r?r(t):1;o!=t.height&&re(t,o)}function hn(t){t.parent=null,Ue(t)}dn.prototype.lineNo=function(){return oe(this)},St(dn);var gn={},vn={};function mn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?vn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function yn(t,e){var n=j("span",null,null,l?"padding-right: .1px":null),r={pre:j("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var o=0;o<=(e.rest?e.rest.length:0);o++){var i=o?e.rest[o-1]:e.line,a=void 0;r.pos=0,r.addToken=wn,Lt(t.display.measure)&&(a=gt(i,t.doc.direction))&&(r.addToken=_n(r.addToken,a)),r.map=[],Sn(i,r,xe(t,i,e!=t.display.externalMeasured&&oe(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=L(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=L(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Rt(t.display.measure))),0==o?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return wt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function bn(t){var e=P("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function wn(t,e,n,r,o,i,l){if(e){var c,u=t.splitSpaces?xn(e,t.trailingSpace):e,p=t.cm.state.specialChars,d=!1;if(p.test(e)){c=document.createDocumentFragment();for(var f=0;;){p.lastIndex=f;var h=p.exec(e),g=h?h.index-f:e.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(P("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!h)break;f+=g+1;var m=void 0;if("\t"==h[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=c.appendChild(P("span",Z(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==h[0]||"\n"==h[0]?((m=c.appendChild(P("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(P("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||o||d||i||l){var w=n||"";r&&(w+=r),o&&(w+=o);var x=P("span",[c],w,i);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&x.setAttribute(_,l[_]);return t.content.appendChild(x)}t.content.appendChild(c)}}function xn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",o=0;o<t.length;o++){var i=t.charAt(o);" "!=i||!n||o!=t.length-1&&32!=t.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}function _n(t,e){return function(n,r,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var p=void 0,d=0;d<e.length&&!((p=e[d]).to>c&&p.from<=c);d++);if(p.to>=u)return t(n,r,o,i,a,s,l);t(n,r.slice(0,p.to-c),o,i,null,s,l),i=null,r=r.slice(p.to-c),c=p.to}}}function Cn(t,e,n,r){var o=!r&&n.widgetNode;o&&t.map.push(t.pos,t.pos+e,o),!r&&t.cm.display.input.needsContentAttribute&&(o||(o=t.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(t.cm.display.input.setUneditable(o),t.content.appendChild(o)),t.pos+=e,t.trailingSpace=!1}function Sn(t,e,n){var r=t.markedSpans,o=t.text,i=0;if(r)for(var a,s,l,c,u,p,d,f=o.length,h=0,g=1,v="",m=0;;){if(m==h){l=c=u=s="",d=null,p=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],_=x.marker;if("bookmark"==_.type&&x.from==h&&_.widgetNode)y.push(_);else if(x.from<=h&&(null==x.to||x.to>h||_.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&m>x.to&&(m=x.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&x.from==h&&(u+=" "+_.startStyle),_.endStyle&&x.to==m&&(b||(b=[])).push(_.endStyle,x.to),_.title&&((d||(d={})).title=_.title),_.attributes)for(var C in _.attributes)(d||(d={}))[C]=_.attributes[C];_.collapsed&&(!p||Ye(p.marker,_)<0)&&(p=x)}else x.from>h&&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(!p||p.from==h)for(var O=0;O<y.length;++O)Cn(e,0,y[O]);if(p&&(p.from||0)==h){if(Cn(e,(null==p.to?f+1:p.to)-h,p.marker,null==p.from),null==p.to)return;p.to==h&&(p=!1)}}if(h>=f)break;for(var E=Math.min(f,m);;){if(v){var k=h+v.length;if(!p){var T=k>E?v.slice(0,E-h):v;e.addToken(e,T,a?a+l:l,u,h+T.length==m?c:"",s,d)}if(k>=E){v=v.slice(E-h),h=E;break}h=k,u=""}v=o.slice(i,i=n[g++]),a=mn(n[g++],e.cm.options)}}else for(var A=1;A<n.length;A+=2)e.addToken(e,o.slice(i,i=n[A]),mn(n[A+1],e.cm.options))}function On(t,e,n){this.line=e,this.rest=rn(e),this.size=this.rest?oe(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sn(t,e)}function En(t,e,n){for(var r,o=[],i=e;i<n;i=r){var a=new On(t.doc,te(t.doc,i),i);r=i+a.size,o.push(a)}return o}var kn=null;function Tn(t){kn?kn.ops.push(t):t.ownsGroup=kn={ops:[t],delayedCallbacks:[]}}function An(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 o=t.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<e.length)}function Pn(t,e){var n=t.ownsGroup;if(n)try{An(n)}finally{kn=null,e(n)}}var jn=null;function Mn(t,e){var n=yt(t,e);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);kn?r=kn.delayedCallbacks:jn?r=jn:(r=jn=[],setTimeout(Nn,0));for(var i=function(t){r.push((function(){return n[t].apply(null,o)}))},a=0;a<n.length;++a)i(a)}}function Nn(){var t=jn;jn=null;for(var e=0;e<t.length;++e)t[e]()}function Rn(t,e,n,r){for(var o=0;o<e.changes.length;o++){var i=e.changes[o];"text"==i?Fn(t,e):"gutter"==i?Bn(t,e,n,r):"class"==i?Vn(t,e):"widget"==i&&zn(t,e,r)}e.changes=null}function Ln(t){return t.node==t.text&&(t.node=P("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 In(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=Ln(e);e.background=r.insertBefore(P("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}function Dn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):yn(t,e)}function Fn(t,e){var n=e.text.className,r=Dn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,Vn(t,e)):n&&(e.text.className=n)}function Vn(t,e){In(t,e),e.line.wrapClass?Ln(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 Bn(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 o=Ln(e);e.gutterBackground=P("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),o.insertBefore(e.gutterBackground,e.text)}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var a=Ln(e),s=e.gutter=P("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(P("div",se(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(P("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function zn(t,e,n){e.alignable&&(e.alignable=null);for(var r=O("CodeMirror-linewidget"),o=e.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&e.node.removeChild(o);$n(t,e,n)}function Hn(t,e,n,r){var o=Dn(t,e);return e.text=e.node=o.pre,o.bgClass&&(e.bgClass=o.bgClass),o.textClass&&(e.textClass=o.textClass),Vn(t,e),Bn(t,e,n,r),$n(t,e,r),e.node}function $n(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,o){if(e.widgets)for(var i=Ln(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=P("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Un(l,c,n,r),t.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),Mn(l,"redraw")}}function Un(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var o=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(o-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=o+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function qn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!M(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;"),A(e.display.measure,P("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Gn(t,e){for(var n=At(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Kn(t){return t.lineSpace.offsetTop}function Yn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Xn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=A(t.measure,P("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 Zn(t){return W-t.display.nativeBarWidth}function Jn(t){return t.display.scroller.clientWidth-Zn(t)-t.display.barWidth}function Qn(t){return t.display.scroller.clientHeight-Zn(t)-t.display.barHeight}function tr(t,e,n){var r=t.options.lineWrapping,o=r&&Jn(t);if(!e.measure.heights||r&&e.measure.width!=o){var i=e.measure.heights=[];if(r){e.measure.width=o;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&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}function er(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){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 o=0;o<t.rest.length;o++)if(oe(t.rest[o])>n)return{map:t.measure.maps[o],cache:t.measure.caches[o],before:!0}}}function nr(t,e){var n=oe(e=en(e)),r=t.display.externalMeasured=new On(t.doc,e,n);r.lineN=n;var o=r.built=yn(t,r);return r.text=o.pre,A(t.display.lineMeasure,o.pre),r}function rr(t,e,n,r){return ar(t,ir(t,e),n,r)}function or(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Vr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function ir(t,e){var n=oe(e),r=or(t,n);r&&!r.text?r=null:r&&r.changes&&(Rn(t,r,n,Rr(t)),t.curOp.forceUpdate=!0),r||(r=nr(t,e));var o=er(r,e,n);return{line:e,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function ar(t,e,n,r,o){e.before&&(n=-1);var i,a=n+(r||"");return e.cache.hasOwnProperty(a)?i=e.cache[a]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(tr(t,e.view,e.rect),e.hasHeights=!0),(i=pr(t,e,n,r)).bogus||(e.cache[a]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var sr,lr={left:0,right:0,top:0,bottom:0};function cr(t,e,n){for(var r,o,i,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(o=0,i=1,a="left"):e<l?i=1+(o=e-s):(c==t.length-3||e==l&&t[c+3]>e)&&(o=(i=l-s)-1,e>=l&&(a="right")),null!=o){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c<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:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function ur(t,e){var n=lr;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var o=t.length-1;o>=0&&(n=t[o]).left==n.right;o--);return n}function pr(t,e,n,r){var o,i=cr(e.map,n,r),l=i.node,c=i.start,u=i.end,p=i.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&lt(e.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&lt(e.line.text.charAt(i.coverStart+u));)++u;if((o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():ur(E(l,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,p="right"}a&&s<11&&(o=dr(t.display.measure,o))}else{var f;c>0&&(p=r="right"),o=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+Nr(t.display),top:h.top,bottom:h.bottom}:lr}for(var g=o.top-e.rect.top,v=o.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],_={left:("right"==p?o.right:o.left)-e.rect.left,right:("left"==p?o.left:o.right)-e.rect.left,top:w,bottom:x};return o.left||o.right||(_.bogus=!0),t.options.singleCursorHeightPerLine||(_.rtop=g,_.rbottom=v),_}function dr(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!zt(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}}function fr(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 hr(t){t.display.externalMeasure=null,T(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)fr(t.display.view[e])}function gr(t){hr(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function vr(t){return u&&m?-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft)):t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function mr(t){return u&&m?-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop)):t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function yr(t){var e=en(t).widgets,n=0;if(e)for(var r=0;r<e.length;++r)e[r].above&&(n+=qn(e[r]));return n}function br(t,e,n,r,o){if(!o){var i=yr(e);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=cn(e);if("local"==r?a+=Kn(t.display):a-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:mr(D(t)));var l=s.left+("window"==r?0:vr(D(t)));n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function wr(t,e,n){if("div"==n)return e;var r=e.left,o=e.top;if("page"==n)r-=vr(D(t)),o-=mr(D(t));else if("local"==n||!n){var i=t.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function xr(t,e,n,r,o){return r||(r=te(t.doc,e.line)),br(t,r,rr(t,r,e.ch,o),n)}function _r(t,e,n,r,o,i){function a(e,a){var s=ar(t,o,e,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,br(t,r,s,n)}r=r||te(t.doc,e.line),o||(o=ir(t,r));var s=gt(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 p=ft(s,l,c),d=dt,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Cr(t,e){var n=0;e=ge(t.doc,e),t.options.lineWrapping||(n=Nr(t.display)*e.ch);var r=te(t.doc,e.line),o=cn(r)+Kn(t.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Sr(t,e,n,r,o){var i=le(t,e,n);return i.xRel=o,r&&(i.outside=r),i}function Or(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Sr(r.first,0,null,-1,-1);var o=ie(r,n),i=r.first+r.size-1;if(o>i)return Sr(r.first+r.size-1,te(r,i).text.length,null,1,1);e<0&&(e=0);for(var a=te(r,o);;){var s=Ar(t,a,o,e,n),l=Qe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=te(r,o=c.line)}}function Er(t,e,n,r){r-=yr(e);var o=e.text.length,i=ut((function(e){return ar(t,n,e-1).bottom<=r}),o,0);return{begin:i,end:o=ut((function(e){return ar(t,n,e).top>r}),i,o)}}function kr(t,e,n,r){return n||(n=ir(t,e)),Er(t,e,n,br(t,e,ar(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 Ar(t,e,n,r,o){o-=cn(e);var i=ir(t,e),a=yr(e),s=0,l=e.text.length,c=!0,u=gt(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?jr:Pr)(t,e,n,i,u,r,o);s=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var d,f,h=null,g=null,v=ut((function(e){var n=ar(t,i,e);return n.top+=a,n.bottom+=a,!!Tr(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=e,g=n),!0)}),s,l),m=!1;if(g){var y=r-g.left<g.right-r,b=y==c;v=h+(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":ar(t,i,v-(c?1:0)).bottom+a<=o==c?"after":"before";var w=_r(t,le(n,v,f),"line",e,i);d=w.left,m=o<w.top?-1:o>=w.bottom?1:0}return Sr(n,v=ct(e.text,v,1),f,m,r-d)}function Pr(t,e,n,r,o,i,a){var s=ut((function(s){var l=o[s],c=1!=l.level;return Tr(_r(t,le(n,c?l.to:l.from,c?"before":"after"),"line",e,r),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=_r(t,le(n,c?l.from:l.to,c?"after":"before"),"line",e,r);Tr(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function jr(t,e,n,r,o,i,a){var s=Er(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,d=0;d<o.length;d++){var f=o[d];if(!(f.from>=c||f.to<=l)){var h=ar(t,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=h<i?i-h+1e9:h-i;(!u||p>g)&&(u=f,p=g)}}return u||(u=o[o.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 Mr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==sr){sr=P("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)sr.appendChild(document.createTextNode("x")),sr.appendChild(P("br"));sr.appendChild(document.createTextNode("x"))}A(t.measure,sr);var n=sr.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Nr(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=P("span","xxxxxxxxxx"),n=P("pre",[e],"CodeMirror-line-like");A(t.measure,n);var r=e.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(t.cachedCharWidth=o),o||10}function Rr(t){for(var e=t.display,n={},r={},o=e.gutters.clientLeft,i=e.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:Lr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Lr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Ir(t){var e=Mr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Nr(t.display)-3);return function(o){if(sn(t.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return n?i+(Math.ceil(o.text.length/r)||1)*e:i+e}}function Dr(t){var e=t.doc,n=Ir(t);e.iter((function(t){var e=n(t);e!=t.height&&re(t,e)}))}function Fr(t,e,n,r){var o=t.display;if(!n&&"true"==At(e).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var l,c=Or(t,i,a);if(r&&c.xRel>0&&(l=te(t.doc,c.line).text).length==c.ch){var u=z(l,l.length,t.options.tabSize)-l.length;c=le(c.line,Math.max(0,Math.round((i-Xn(t.display).left)/Nr(t.display))-u))}return c}function Vr(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 Br(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var o=t.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>e)&&(o.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=o.viewTo)Ne&&on(t.doc,e)<o.viewTo&&Hr(t);else if(n<=o.viewFrom)Ne&&an(t.doc,n+r)>o.viewFrom?Hr(t):(o.viewFrom+=r,o.viewTo+=r);else if(e<=o.viewFrom&&n>=o.viewTo)Hr(t);else if(e<=o.viewFrom){var i=$r(t,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):Hr(t)}else if(n>=o.viewTo){var a=$r(t,e,e,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):Hr(t)}else{var s=$r(t,e,e,-1),l=$r(t,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(En(t,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):Hr(t)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(o.externalMeasured=null))}function zr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,o=t.display.externalMeasured;if(o&&e>=o.lineN&&e<o.lineN+o.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var i=r.view[Vr(t,e)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==$(a,n)&&a.push(n)}}}function Hr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function $r(t,e,n,r){var o,i=Vr(t,e),a=t.display.view;if(!Ne||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var s=t.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=e){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-e,i++}else o=s-e;e+=o,n+=o}for(;on(t.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Wr(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=En(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=En(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Vr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(En(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Vr(t,n)))),r.viewTo=n}function Ur(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var o=e[r];o.hidden||o.node&&!o.changes||++n}return n}function qr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Gr(t,e){void 0===e&&(e=!0);var n=t.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),a=t.options.$customCursor;a&&(e=!0);for(var s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=t.display.viewTo||l.to().line<t.display.viewFrom)){var c=l.empty();if(a){var u=a(t,l);u&&Kr(t,u,o)}else(c||t.options.showCursorWhenSelecting)&&Kr(t,l.head,o);c||Xr(t,l,i)}}return r}function Kr(t,e,n){var r=_r(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),o=n.appendChild(P("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var i=xr(t,e,"div",null,null),a=i.right-i.left;o.style.width=(a>0?a:t.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(P("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Yr(t,e){return t.top-e.top||t.left-e.left}function Xr(t,e,n){var r=t.display,o=t.doc,i=document.createDocumentFragment(),a=Xn(t.display),s=a.left,l=Math.max(r.sizerWidth,Jn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),i.appendChild(P("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function p(e,n,r){var i,a,p=te(o,e),d=p.text.length;function f(n,r){return xr(t,le(e,n),"div",p,r)}function h(e,n,r){var o=kr(t,p,null,e),i="ltr"==n==("after"==r)?"left":"right";return f("after"==r?o.begin:o.end-(/\s/.test(p.text.charAt(o.end-1))?2:1),i)[i]}var g=gt(p,o.direction);return pt(g,n||0,null==r?d:r,(function(t,e,o,p){var v="ltr"==o,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==p,_=!g||p==g.length-1;if(y.top-m.top<=3){var C=(c?w:b)&&_,S=(c?b:w)&&x?s:(v?m:y).left,O=C?l:(v?y:m).right;u(S,m.top,O-S,m.bottom)}else{var E,k,T,A;v?(E=c&&b&&x?s:m.left,k=c?l:h(t,o,"before"),T=c?s:h(e,o,"after"),A=c&&w&&_?l:y.right):(E=c?h(t,o,"before"):s,k=!c&&b&&x?l:m.right,T=!c&&w&&_?s:y.left,A=c?h(e,o,"after"):l),u(E,m.top,k-E,m.bottom),m.bottom<y.top&&u(s,m.bottom,null,y.top),u(T,y.top,A-T,y.bottom)}(!i||Yr(m,i)<0)&&(i=m),Yr(y,i)<0&&(i=y),(!a||Yr(m,a)<0)&&(a=m),Yr(y,a)<0&&(a=y)})),{start:i,end:a}}var d=e.from(),f=e.to();if(d.line==f.line)p(d.line,d.ch,f.ch);else{var h=te(o,d.line),g=te(o,f.line),v=en(h)==en(g),m=p(d.line,d.ch,v?h.text.length+1:null).end,y=p(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(i)}function Zr(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||eo(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Jr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||to(t))}function Qr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&eo(t))}),100)}function to(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(wt(t,"focus",t,e),t.state.focused=!0,R(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()),Zr(t))}function eo(t,e){t.state.delayingBlurEvent||(t.state.focused&&(wt(t,"blur",t,e),t.state.focused=!1,k(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function no(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),o=e.lineDiv.getBoundingClientRect().top,i=0,l=0;l<e.view.length;l++){var c=e.view[l],u=t.options.lineWrapping,p=void 0,d=0;if(!c.hidden){if(o+=c.line.height,a&&s<8){var f=c.node.offsetTop+c.node.offsetHeight;p=f-n,n=f}else{var h=c.node.getBoundingClientRect();p=h.bottom-h.top,!u&&c.text.firstChild&&(d=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var g=c.line.height-p;if((g>.005||g<-.005)&&(o<r&&(i-=g),re(c.line,p),ro(c.line),c.rest))for(var v=0;v<c.rest.length;v++)ro(c.rest[v]);if(d>t.display.sizerWidth){var m=Math.ceil(d/Nr(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function ro(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 oo(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Kn(t));var o=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,i=ie(e,r),a=ie(e,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=ie(e,cn(te(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(i=ie(e,cn(te(e,l))-t.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function io(t,e){if(!xt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),o=null,i=n.wrapper.ownerDocument;if(e.top+r.top<0?o=!0:e.bottom+r.top>(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(o=!1),null!=o&&!g){var a=P("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(e.bottom-e.top+Zn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(a),a.scrollIntoView(o),t.display.lineSpace.removeChild(a)}}}function ao(t,e,n,r){var o;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?le(e.line,e.ch+1,"before"):e,e=e.ch?le(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var a=!1,s=_r(t,e),l=n&&n!=e?_r(t,n):s,c=lo(t,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(vo(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(yo(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return o}function so(t,e){var n=lo(t,e);null!=n.scrollTop&&vo(t,n.scrollTop),null!=n.scrollLeft&&yo(t,n.scrollLeft)}function lo(t,e){var n=t.display,r=Mr(t.display);e.top<0&&(e.top=0);var o=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=Qn(t),a={};e.bottom-e.top>i&&(e.bottom=e.top+i);var s=t.doc.height+Yn(n),l=e.top<r,c=e.bottom>s-r;if(e.top<o)a.scrollTop=l?0:e.top;else if(e.bottom>o+i){var u=Math.min(e.top,(c?s:e.bottom)-i);u!=o&&(a.scrollTop=u)}var p=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-p,f=Jn(t)-n.gutters.offsetWidth,h=e.right-e.left>f;return h&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.left<d?a.scrollLeft=Math.max(0,e.left+p-(h?0:10)):e.right>f+d-3&&(a.scrollLeft=e.right+(h?0:10)-f),a}function co(t,e){null!=e&&(ho(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function uo(t){ho(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function po(t,e,n){null==e&&null==n||ho(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function fo(t,e){ho(t),t.curOp.scrollToPos=e}function ho(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,go(t,Cr(t,e.from),Cr(t,e.to),e.margin))}function go(t,e,n,r){var o=lo(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});po(t,o.scrollLeft,o.scrollTop)}function vo(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Go(t,{top:e}),mo(t,e,!0),n&&Go(t),Vo(t,100))}function mo(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function yo(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Zo(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function bo(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Yn(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+Zn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var wo=function(t,e,n){this.cm=n;var r=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,t(r),t(o),mt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),mt(o,"scroll",(function(){o.clientWidth&&e(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wo.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var o=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},wo.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wo.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wo.prototype.zeroWidthHack=function(){var t=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new H,this.disableVert=new H},wo.prototype.enableZeroWidthBar=function(t,e,n){function r(){var o=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=t?t.style.visibility="hidden":e.set(1e3,r)}t.style.visibility="",e.set(1e3,r)},wo.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var xo=function(){};function _o(t,e){e||(e=bo(t));var n=t.display.barWidth,r=t.display.barHeight;Co(t,e);for(var o=0;o<4&&n!=t.display.barWidth||r!=t.display.barHeight;o++)n!=t.display.barWidth&&t.options.lineWrapping&&no(t),Co(t,bo(t)),n=t.display.barWidth,r=t.display.barHeight}function Co(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=""}xo.prototype.update=function(){return{bottom:0,right:0}},xo.prototype.setScrollLeft=function(){},xo.prototype.setScrollTop=function(){},xo.prototype.clear=function(){};var So={native:wo,null:xo};function Oo(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&k(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new So[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),mt(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?yo(t,e):vo(t,e)}),t),t.display.scrollbars.addClass&&R(t.display.wrapper,t.display.scrollbars.addClass)}var Eo=0;function ko(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Eo,markArrays:null},Tn(t.curOp)}function To(t){var e=t.curOp;e&&Pn(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;Ao(t)}))}function Ao(t){for(var e=t.ops,n=0;n<e.length;n++)Po(e[n]);for(var r=0;r<e.length;r++)jo(e[r]);for(var o=0;o<e.length;o++)Mo(e[o]);for(var i=0;i<e.length;i++)No(e[i]);for(var a=0;a<e.length;a++)Ro(e[a])}function Po(t){var e=t.cm,n=e.display;Ho(e),t.updateMaxLine&&pn(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 zo(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function jo(t){t.updatedDisplay=t.mustUpdate&&Uo(t.cm,t.update)}function Mo(t){var e=t.cm,n=e.display;t.updatedDisplay&&no(e),t.barMeasure=bo(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=rr(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+Zn(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 No(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&yo(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==N(D(e));t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&_o(e,t.barMeasure),t.updatedDisplay&&Xo(e,t.barMeasure),t.selectionChanged&&Zr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Jr(t.cm)}function Ro(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&qo(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&mo(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&yo(e,t.scrollLeft,!0,!0),t.scrollToPos&&io(e,ao(e,ge(r,t.scrollToPos.from),ge(r,t.scrollToPos.to),t.scrollToPos.margin));var o=t.maybeHiddenMarkers,i=t.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||wt(o[a],"hide");if(i)for(var s=0;s<i.length;++s)i[s].lines.length&&wt(i[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&wt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Lo(t,e){if(t.curOp)return e();ko(t);try{return e()}finally{To(t)}}function Io(t,e){return function(){if(t.curOp)return e.apply(t,arguments);ko(t);try{return e.apply(t,arguments)}finally{To(t)}}}function Do(t){return function(){if(this.curOp)return t.apply(this,arguments);ko(this);try{return t.apply(this,arguments)}finally{To(this)}}}function Fo(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);ko(e);try{return t.apply(this,arguments)}finally{To(e)}}}function Vo(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,V(Bo,t))}function Bo(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=_e(t,e.highlightFrontier),o=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(i){if(r.line>=t.display.viewFrom){var a=i.styles,s=i.text.length>t.options.maxHighlightLength?Xt(e.mode,r.state):null,l=we(t,i,r,!0);s&&(r.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!p&&d<a.length;++d)p=a[d]!=i.styles[d];p&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=t.options.maxHighlightLength&&Ce(t,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Vo(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),o.length&&Lo(t,(function(){for(var e=0;e<o.length;e++)zr(t,o[e],"text")}))}}var zo=function(t,e,n){var r=t.display;this.viewport=e,this.visible=oo(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=Rr(t),this.events=[]};function Ho(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Zn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Zn(t)+"px",e.scrollbarsClipped=!0)}function $o(t){if(t.hasFocus())return null;var e=N(D(t));if(!e||!M(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=F(t).getSelection();r.anchorNode&&r.extend&&M(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Wo(t){if(t&&t.activeElt&&t.activeElt!=N(t.activeElt.ownerDocument)&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&M(document.body,t.anchorNode)&&M(document.body,t.focusNode))){var e=t.activeElt.ownerDocument,n=e.defaultView.getSelection(),r=e.createRange();r.setEnd(t.anchorNode,t.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(t.focusNode,t.focusOffset)}}function Uo(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return Hr(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==Ur(t))return!1;Jo(t)&&(Hr(t),e.dims=Rr(t));var o=r.first+r.size,i=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(o,e.visible.to+t.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Ne&&(i=on(t.doc,i),a=an(t.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Wr(t,i,a),n.viewOffset=cn(te(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Ur(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=$o(t);return l>4&&(n.lineDiv.style.display="none"),Ko(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Wo(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Vo(t,400)),n.updateLineNumbers=null,!0}function qo(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Jn(t))r&&(e.visible=oo(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Yn(t.display)-Qn(t),n.top)}),e.visible=oo(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Uo(t,e))break;no(t);var o=bo(t);qr(t),_o(t,o),Xo(t,o),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Go(t,e){var n=new zo(t,e);if(Uo(t,n)){no(t),qo(t,n);var r=bo(t);qr(t),_o(t,r),Xo(t,r),n.finish()}}function Ko(t,e,n){var r=t.display,o=t.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(e){var n=e.nextSibling;return l&&b&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,p=0;p<c.length;p++){var d=c[p];if(d.hidden);else if(d.node&&d.node.parentNode==i){for(;a!=d.node;)a=s(a);var f=o&&null!=e&&e<=u&&d.lineNumber;d.changes&&($(d.changes,"gutter")>-1&&(f=!1),Rn(t,d,u,n)),f&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(se(t.options,u)))),a=d.node.nextSibling}else{var h=Hn(t,d,u,n);i.insertBefore(h,a)}u+=d.size}for(;a;)a=s(a)}function Yo(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",Mn(t,"gutterChanged",t)}function Xo(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+Zn(t)+"px"}function Zo(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Lr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,o=e.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}t.options.fixedGutter&&(e.gutters.style.left=r+o+"px")}}function Jo(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=se(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(P("div",[P("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Yo(t.display),!0}return!1}function Qo(t,e){for(var n=[],r=!1,o=0;o<t.length;o++){var i=t[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!e)continue;r=!0}n.push({className:i,style:a})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ti(t){var e=t.gutters,n=t.gutterSpecs;T(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,a=o.style,s=e.appendChild(P("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",Yo(t)}function ei(t){ti(t.display),Br(t),Zo(t)}function ni(t,e,r,o){var i=this;this.input=r,i.scrollbarFiller=P("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=P("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=j("div",null,"CodeMirror-code"),i.selectionDiv=P("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=P("div",null,"CodeMirror-cursors"),i.measure=P("div",null,"CodeMirror-measure"),i.lineMeasure=P("div",null,"CodeMirror-measure"),i.lineSpace=j("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=j("div",[i.lineSpace],"CodeMirror-lines");i.mover=P("div",[c],null,"position: relative"),i.sizer=P("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=P("div",null,null,"position: absolute; height: "+W+"px; width: 1px;"),i.gutters=P("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=P("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=P("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),u&&p>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&y||(i.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(i.wrapper):t(i.wrapper)),i.viewFrom=i.viewTo=e.first,i.reportedViewFrom=i.reportedViewTo=e.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Qo(o.gutters,o.lineNumbers),ti(i),r.init(i)}zo.prototype.signal=function(t,e){Ct(t,e)&&this.events.push(arguments)},zo.prototype.finish=function(){for(var t=0;t<this.events.length;t++)wt.apply(null,this.events[t])};var ri=0,oi=null;function ii(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 ai(t){var e=ii(t);return e.x*=oi,e.y*=oi,e}function si(t,e){u&&102==p&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""}),100));var r=ii(e),o=r.x,i=r.y,a=oi;0===e.deltaMode&&(o=e.deltaX,i=e.deltaY,a=1);var s=t.display,c=s.scroller,f=c.scrollWidth>c.clientWidth,h=c.scrollHeight>c.clientHeight;if(o&&f||i&&h){if(i&&b&&l)t:for(var g=e.target,v=s.view;g!=c;g=g.parentNode)for(var m=0;m<v.length;m++)if(v[m].node==g){t.display.currentWheelTarget=g;break t}if(o&&!n&&!d&&null!=a)return i&&h&&vo(t,Math.max(0,c.scrollTop+i*a)),yo(t,Math.max(0,c.scrollLeft+o*a)),(!i||i&&h)&&Ot(e),void(s.wheelStartX=null);if(i&&null!=a){var y=i*a,w=t.doc.scrollTop,x=w+s.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):x=Math.min(t.doc.height,x+y+50),Go(t,{top:w,bottom:x})}ri<20&&0!==e.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=o,s.wheelDY=i,setTimeout((function(){if(null!=s.wheelStartX){var t=c.scrollLeft-s.wheelStartX,e=c.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(oi=(oi*ri+n)/(ri+1),++ri)}}),200)):(s.wheelDX+=o,s.wheelDY+=i))}}a?oi=-.53:n?oi=15:u?oi=-.7:f&&(oi=-1/3);var li=function(t,e){this.ranges=t,this.primIndex=e};li.prototype.primary=function(){return this.ranges[this.primIndex]},li.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(!ue(n.anchor,r.anchor)||!ue(n.head,r.head))return!1}return!0},li.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new ci(pe(this.ranges[e].anchor),pe(this.ranges[e].head));return new li(t,this.primIndex)},li.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},li.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ce(e,r.from())>=0&&ce(t,r.to())<=0)return n}return-1};var ci=function(t,e){this.anchor=t,this.head=e};function ui(t,e,n){var r=t&&t.options.selectionsMayTouch,o=e[n];e.sort((function(t,e){return ce(t.from(),e.from())})),n=$(e,o);for(var i=1;i<e.length;i++){var a=e[i],s=e[i-1],l=ce(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=fe(s.from(),a.from()),u=de(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,e.splice(--i,2,new ci(p?u:c,p?c:u))}}return new li(e,n)}function pi(t,e){return new li([new ci(t,e||t)],0)}function di(t){return t.text?le(t.from.line+t.text.length-1,J(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function fi(t,e){if(ce(t,e.from)<0)return t;if(ce(t,e.to)<=0)return di(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+=di(e).ch-e.to.ch),le(n,r)}function hi(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var o=t.sel.ranges[r];n.push(new ci(fi(o.anchor,e),fi(o.head,e)))}return ui(t.cm,n,t.sel.primIndex)}function gi(t,e,n){return t.line==e.line?le(n.line,t.ch-e.ch+n.ch):le(n.line+(t.line-e.line),t.ch)}function vi(t,e,n){for(var r=[],o=le(t.first,0),i=o,a=0;a<e.length;a++){var s=e[a],l=gi(s.from,o,i),c=gi(di(s),o,i);if(o=s.to,i=c,"around"==n){var u=t.sel.ranges[a],p=ce(u.head,u.anchor)<0;r[a]=new ci(p?c:l,p?l:c)}else r[a]=new ci(l,l)}return new li(r,t.sel.primIndex)}function mi(t){t.doc.mode=Gt(t.options,t.doc.modeOption),yi(t)}function yi(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,Vo(t,100),t.state.modeGen++,t.curOp&&Br(t)}function bi(t,e){return 0==e.from.ch&&0==e.to.ch&&""==J(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function wi(t,e,n,r){function o(t){return n?n[t]:null}function i(t,n,o){fn(t,n,o,r),Mn(t,"change",t,e)}function a(t,e){for(var n=[],i=t;i<e;++i)n.push(new dn(c[i],o(i),r));return n}var s=e.from,l=e.to,c=e.text,u=te(t,s.line),p=te(t,l.line),d=J(c),f=o(c.length-1),h=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(bi(t,e)){var g=a(0,c.length-1);i(p,p.text,f),h&&t.remove(s.line,h),g.length&&t.insert(s.line,g)}else if(u==p)if(1==c.length)i(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 dn(d+u.text.slice(l.ch),f,r)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),t.insert(s.line+1,v)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+p.text.slice(l.ch),o(0)),t.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(p,d+p.text.slice(l.ch),f);var m=a(1,c.length-1);h>1&&t.remove(s.line+1,h-1),t.insert(s.line+1,m)}Mn(t,"change",t,e)}function xi(t,e,n){function r(t,o,i){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(e(s.doc,l),r(s.doc,t,l))}}}r(t,null,!0)}function _i(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,Dr(t),mi(t),Ci(t),t.options.direction=e.direction,t.options.lineWrapping||pn(t),t.options.mode=e.modeOption,Br(t)}function Ci(t){("rtl"==t.doc.direction?R:k)(t.display.lineDiv,"CodeMirror-rtl")}function Si(t){Lo(t,(function(){Ci(t),Br(t)}))}function Oi(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function Ei(t,e){var n={from:pe(e.from),to:di(e),text:ee(t,e.from,e.to)};return Ni(t,n,e.from.line,e.to.line+1),xi(t,(function(t){return Ni(t,n,e.from.line,e.to.line+1)}),!0),n}function ki(t){for(;t.length&&J(t).ranges;)t.pop()}function Ti(t,e){return e?(ki(t.done),J(t.done)):t.done.length&&!J(t.done).ranges?J(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),J(t.done)):void 0}function Ai(t,e,n,r){var o=t.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&o.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(i=Ti(o,o.lastOp==r)))a=J(i.changes),0==ce(e.from,e.to)&&0==ce(e.from,a.to)?a.to=di(e):i.changes.push(Ei(t,e));else{var l=J(o.done);for(l&&l.ranges||Mi(t.sel,o.done),i={changes:[Ei(t,e)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=e.origin,a||wt(t,"historyAdded")}function Pi(t,e,n,r){var o=e.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ji(t,e,n,r){var o=t.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||Pi(t,i,J(o.done),e))?o.done[o.done.length-1]=e:Mi(e,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&ki(o.undone)}function Mi(t,e){var n=J(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ni(t,e,n,r){var o=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((o||(o=e["spans_"+t.id]={}))[i]=n.markedSpans),++i}))}function Ri(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 Li(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],o=0;o<e.text.length;++o)r.push(Ri(n[o]));return r}function Ii(t,e){var n=Li(t,e),r=He(t,e);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],a=r[o];if(i&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue t;i.push(l)}else a&&(n[o]=a)}return n}function Di(t,e,n){for(var r=[],o=0;o<t.length;++o){var i=t[o];if(i.ranges)r.push(n?li.prototype.deepCopy.call(i):i);else{var a=i.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 p in c)(u=p.match(/^spans_(\d+)$/))&&$(e,Number(u[1]))>-1&&(J(s)[p]=c[p],delete c[p])}}}return r}function Fi(t,e,n,r){if(r){var o=t.anchor;if(n){var i=ce(e,o)<0;i!=ce(n,o)<0?(o=e,e=n):i!=ce(e,n)<0&&(e=n)}return new ci(o,e)}return new ci(n||e,e)}function Vi(t,e,n,r,o){null==o&&(o=t.cm&&(t.cm.display.shift||t.extend)),Ui(t,new li([Fi(t.sel.primary(),e,n,o)],0),r)}function Bi(t,e,n){for(var r=[],o=t.cm&&(t.cm.display.shift||t.extend),i=0;i<t.sel.ranges.length;i++)r[i]=Fi(t.sel.ranges[i],e[i],null,o);Ui(t,ui(t.cm,r,t.sel.primIndex),n)}function zi(t,e,n,r){var o=t.sel.ranges.slice(0);o[e]=n,Ui(t,ui(t.cm,o,t.sel.primIndex),r)}function Hi(t,e,n,r){Ui(t,pi(e,n),r)}function $i(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 ci(ge(t,e[n].anchor),ge(t,e[n].head))},origin:n&&n.origin};return wt(t,"beforeSelectionChange",t,r),t.cm&&wt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?ui(t.cm,r.ranges,r.ranges.length-1):e}function Wi(t,e,n){var r=t.history.done,o=J(r);o&&o.ranges?(r[r.length-1]=e,qi(t,e,n)):Ui(t,e,n)}function Ui(t,e,n){qi(t,e,n),ji(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function qi(t,e,n){(Ct(t,"beforeSelectionChange")||t.cm&&Ct(t.cm,"beforeSelectionChange"))&&(e=$i(t,e,n));var r=n&&n.bias||(ce(e.primary().head,t.sel.primary().head)<0?-1:1);Gi(t,Yi(t,e,r,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||uo(t.cm)}function Gi(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,_t(t.cm)),Mn(t,"cursorActivity",t))}function Ki(t){Gi(t,Yi(t,t.sel,null,!1))}function Yi(t,e,n,r){for(var o,i=0;i<e.ranges.length;i++){var a=e.ranges[i],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[i],l=Zi(t,a.anchor,s&&s.anchor,n,r),c=a.head==a.anchor?l:Zi(t,a.head,s&&s.head,n,r);(o||l!=a.anchor||c!=a.head)&&(o||(o=e.ranges.slice(0,i)),o[i]=new ci(l,c))}return o?ui(t.cm,o,e.primIndex):e}function Xi(t,e,n,r,o){var i=te(t,e.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.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(o&&(wt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(p=Ji(t,p,-r,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=ce(p,n))&&(r<0?d<0:d>0))return Xi(t,p,e,r,o)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ji(t,f,r,f.line==e.line?i:null)),f?Xi(t,f,e,r,o):null}}return e}function Zi(t,e,n,r,o){var i=r||1,a=Xi(t,e,n,i,o)||!o&&Xi(t,e,n,i,!0)||Xi(t,e,n,-i,o)||!o&&Xi(t,e,n,-i,!0);return a||(t.cantEdit=!0,le(t.first,0))}function Ji(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?ge(t,le(e.line-1)):null:n>0&&e.ch==(r||te(t,e.line)).text.length?e.line<t.first+t.size-1?le(e.line+1,0):null:new le(e.line,e.ch+n)}function Qi(t){t.setSelection(le(t.firstLine(),0),le(t.lastLine()),q)}function ta(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,o,i){e&&(r.from=ge(t,e)),n&&(r.to=ge(t,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),wt(t,"beforeChange",t,r),t.cm&&wt(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 ea(t,e,n){if(t.cm){if(!t.cm.curOp)return Io(t.cm,ea)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(Ct(t,"beforeChange")||t.cm&&Ct(t.cm,"beforeChange"))||(e=ta(t,e,!0))){var r=Me&&!n&&We(t,e.from,e.to);if(r)for(var o=r.length-1;o>=0;--o)na(t,{from:r[o].from,to:r[o].to,text:o?[""]:e.text,origin:e.origin});else na(t,e)}}function na(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ce(e.from,e.to)){var n=hi(t,e);Ai(t,e,n,t.cm?t.cm.curOp.id:NaN),ia(t,e,n,He(t,e));var r=[];xi(t,(function(t,n){n||-1!=$(r,t.history)||(ua(t.history,e),r.push(t.history)),ia(t,e,null,He(t,e))}))}}function ra(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var o,i=t.history,a=t.sel,s="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c<s.length&&(o=s[c],n?!o.ranges||o.equals(t.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=s.pop()).ranges){if(r)return void s.push(o);break}if(Mi(o,l),n&&!o.equals(t.sel))return void Ui(t,o,{clearRedo:!1});a=o}var u=[];Mi(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var p=Ct(t,"beforeChange")||t.cm&&Ct(t.cm,"beforeChange"),d=function(n){var r=o.changes[n];if(r.origin=e,p&&!ta(t,r,!1))return s.length=0,{};u.push(Ei(t,r));var i=n?hi(t,r):J(s);ia(t,r,i,Ii(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:di(r)});var a=[];xi(t,(function(t,e){e||-1!=$(a,t.history)||(ua(t.history,r),a.push(t.history)),ia(t,r,null,Ii(t,r))}))},f=o.changes.length-1;f>=0;--f){var h=d(f);if(h)return h.v}}}}function oa(t,e){if(0!=e&&(t.first+=e,t.sel=new li(Q(t.sel.ranges,(function(t){return new ci(le(t.anchor.line+e,t.anchor.ch),le(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Br(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)zr(t.cm,r,"gutter")}}function ia(t,e,n,r){if(t.cm&&!t.cm.curOp)return Io(t.cm,ia)(t,e,n,r);if(e.to.line<t.first)oa(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 o=e.text.length-1-(t.first-e.from.line);oa(t,o),e={from:le(t.first,0),to:le(e.to.line+o,e.to.ch),text:[J(e.text)],origin:e.origin}}var i=t.lastLine();e.to.line>i&&(e={from:e.from,to:le(i,te(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=ee(t,e.from,e.to),n||(n=hi(t,e)),t.cm?aa(t.cm,e,r):wi(t,e,r),qi(t,n,q),t.cantEdit&&Zi(t,le(t.firstLine(),0))&&(t.cantEdit=!1)}}function aa(t,e,n){var r=t.doc,o=t.display,i=e.from,a=e.to,s=!1,l=i.line;t.options.lineWrapping||(l=oe(en(te(r,i.line))),r.iter(l,a.line+1,(function(t){if(t==o.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&_t(t),wi(r,e,n,Ir(t)),t.options.lineWrapping||(r.iter(l,i.line+e.text.length,(function(t){var e=un(t);e>o.maxLineLength&&(o.maxLine=t,o.maxLineLength=e,o.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),je(r,i.line),Vo(t,400);var c=e.text.length-(a.line-i.line)-1;e.full?Br(t):i.line!=a.line||1!=e.text.length||bi(t.doc,e)?Br(t,i.line,a.line+1,c):zr(t,i.line,"text");var u=Ct(t,"changes"),p=Ct(t,"change");if(p||u){var d={from:i,to:a,text:e.text,removed:e.removed,origin:e.origin};p&&Mn(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function sa(t,e,n,r,o){var i;r||(r=n),ce(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof e&&(e=t.splitLines(e)),ea(t,{from:n,to:r,text:e,origin:o})}function la(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function ca(t,e,n,r){for(var o=0;o<t.length;++o){var i=t[o],a=!0;if(i.ranges){i.copied||((i=t[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)la(i.ranges[s].anchor,e,n,r),la(i.ranges[s].head,e,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=le(c.from.line+r,c.from.ch),c.to=le(c.to.line+r,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,o+1),o=0)}}}function ua(t,e){var n=e.from.line,r=e.to.line,o=e.text.length-(r-n)-1;ca(t.done,n,r,o),ca(t.undone,n,r,o)}function pa(t,e,n,r){var o=e,i=e;return"number"==typeof e?i=te(t,he(t,e)):o=oe(e),null==o?null:(r(i,o)&&t.cm&&zr(t.cm,o,n),i)}function da(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 fa(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var o=t[r];e+=o.chunkSize(),n+=o.height,o.parent=this}this.size=e,this.height=n,this.parent=null}ci.prototype.from=function(){return fe(this.anchor,this.head)},ci.prototype.to=function(){return de(this.anchor,this.head)},ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var o=this.lines[n];this.height-=o.height,hn(o),Mn(o,"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}},fa.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],o=r.chunkSize();if(t<o){var i=Math.min(e,o-t),a=r.height;if(r.removeInner(t,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(e-=i))break;t=0}else t-=o}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof da))){var s=[];this.collapse(s),this.children=[new da(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 o=this.children[r],i=o.chunkSize();if(t<=i){if(o.insertInner(t,e,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new da(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}t-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new fa(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=$(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new fa(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 o=this.children[r],i=o.chunkSize();if(t<i){var a=Math.min(e,i-t);if(o.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=i}}};var ha=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 ga(t,e,n){cn(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&co(t,n)}function va(t,e,n,r){var o=new ha(t,n,r),i=t.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),pa(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=e,i&&!sn(t,e)){var r=cn(e)<t.scrollTop;re(e,e.height+qn(o)),r&&co(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&Mn(i,"lineWidgetAdded",i,o,"number"==typeof e?e:oe(e)),o}ha.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=oe(n);if(null!=r&&e){for(var o=0;o<e.length;++o)e[o]==this&&e.splice(o--,1);e.length||(n.widgets=null);var i=qn(this);re(n,Math.max(0,n.height-i)),t&&(Lo(t,(function(){ga(t,n,-i),zr(t,r,"widget")})),Mn(t,"lineWidgetCleared",t,this,r))}},ha.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=qn(this)-e;o&&(sn(this.doc,r)||re(r,r.height+o),n&&Lo(n,(function(){n.curOp.forceUpdate=!0,ga(n,r,o),Mn(n,"lineWidgetChanged",n,t,oe(r))})))},St(ha);var ma=0,ya=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++ma};function ba(t,e,n,r,o){if(r&&r.shared)return xa(t,e,n,r,o);if(t.cm&&!t.cm.curOp)return Io(t.cm,ba)(t,e,n,r,o);var i=new ya(t,o),a=ce(e,n);if(r&&B(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=j("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(tn(t,e.line,e,n,i)||e.line!=n.line&&tn(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le()}i.addToHistory&&Ai(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&en(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=e.line&&re(r,0),Ve(r,new Ie(i,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),i.collapsed&&t.iter(e.line,n.line+1,(function(e){sn(t,e)&&re(e,0)})),i.clearOnEnter&&mt(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(Re(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++ma,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)Br(c,e.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=e.line;u<=n.line;u++)zr(c,u,"text");i.atomic&&Ki(c.doc),Mn(c,"markerAdded",c,i)}return i}ya.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&ko(t),Ct(this,"clear")){var n=this.find();n&&Mn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=De(a.markedSpans,this);t&&!this.collapsed?zr(t,oe(a),"text"):t&&(null!=s.to&&(o=oe(a)),null!=s.from&&(r=oe(a))),a.markedSpans=Fe(a.markedSpans,s),null==s.from&&this.collapsed&&!sn(this.doc,a)&&t&&re(a,Mr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=en(this.lines[l]),u=un(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Br(t,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ki(t.doc)),t&&Mn(t,"markerCleared",t,this,r,o),e&&To(t),this.parent&&this.parent.clear()}},ya.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=De(i.markedSpans,this);if(null!=a.from&&(n=le(e?i:oe(i),a.from),-1==t))return n;if(null!=a.to&&(r=le(e?i:oe(i),a.to),1==t))return r}return n&&{from:n,to:r}},ya.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Lo(r,(function(){var o=e.line,i=oe(e.line),a=or(r,i);if(a&&(fr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!sn(n.doc,o)&&null!=n.height){var s=n.height;n.height=null;var l=qn(n)-s;l&&re(o,o.height+l)}Mn(r,"markerChanged",r,t)}))},ya.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=$(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},ya.prototype.detachLine=function(t){if(this.lines.splice($(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},St(ya);var wa=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function xa(t,e,n,r,o){(r=B(r)).shared=!1;var i=[ba(t,e,n,r,o)],a=i[0],s=r.widgetNode;return xi(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),i.push(ba(t,ge(t,e),ge(t,n),r,o));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=J(i)})),new wa(i,a)}function _a(t){return t.findMarks(le(t.first,0),t.clipPos(le(t.lastLine())),(function(t){return t.parent}))}function Ca(t,e){for(var n=0;n<e.length;n++){var r=e[n],o=r.find(),i=t.clipPos(o.from),a=t.clipPos(o.to);if(ce(i,a)){var s=ba(t,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Sa(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];xi(n.primary.doc,(function(t){return r.push(t)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==$(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<t.length;n++)e(n)}wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();Mn(this,"clear")}},wa.prototype.find=function(t,e){return this.primary.find(t,e)},St(wa);var Oa=0,Ea=function(t,e,n,r,o){if(!(this instanceof Ea))return new Ea(t,e,n,r,o);null==n&&(n=0),fa.call(this,[new da([new dn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=le(n,0);this.sel=pi(i),this.history=new Oi(null),this.id=++Oa,this.modeOption=e,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),wi(this,{from:i,to:i,text:t}),Ui(this,pi(i),q)};Ea.prototype=nt(fa.prototype,{constructor:Ea,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=ne(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:Fo((function(t){var e=le(this.first,0),n=this.first+this.size-1;ea(this,{from:e,to:le(n,te(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&po(this.cm,0,0),Ui(this,pi(e),q)})),replaceRange:function(t,e,n,r){sa(this,t,e=ge(this,e),n=n?ge(this,n):e,r)},getRange:function(t,e,n){var r=ee(this,ge(this,t),ge(this,e));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ae(this,t))return te(this,t)},getLineNumber:function(t){return oe(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=te(this,t)),en(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ge(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:Fo((function(t,e,n){Hi(this,ge(this,"number"==typeof t?le(t,e||0):t),null,n)})),setSelection:Fo((function(t,e,n){Hi(this,ge(this,t),ge(this,e||t),n)})),extendSelection:Fo((function(t,e,n){Vi(this,ge(this,t),e&&ge(this,e),n)})),extendSelections:Fo((function(t,e){Bi(this,me(this,t),e)})),extendSelectionsBy:Fo((function(t,e){Bi(this,me(this,Q(this.sel.ranges,t)),e)})),setSelections:Fo((function(t,e,n){if(t.length){for(var r=[],o=0;o<t.length;o++)r[o]=new ci(ge(this,t[o].anchor),ge(this,t[o].head||t[o].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Ui(this,ui(this.cm,r,e),n)}})),addSelection:Fo((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new ci(ge(this,t),ge(this,e||t))),Ui(this,ui(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var o=ee(this,n[r].from(),n[r].to());e=e?e.concat(o):o}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 o=ee(this,n[r].from(),n[r].to());!1!==t&&(o=o.join(t||this.lineSeparator())),e[r]=o}return e},replaceSelection:function(t,e,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:Fo((function(t,e,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];r[i]={from:a.from(),to:a.to(),text:this.splitLines(t[i]),origin:n}}for(var s=e&&"end"!=e&&vi(this,r,e),l=r.length-1;l>=0;l--)ea(this,r[l]);s?Wi(this,s):this.cm&&uo(this.cm)})),undo:Fo((function(){ra(this,"undo")})),redo:Fo((function(){ra(this,"redo")})),undoSelection:Fo((function(){ra(this,"undo",!0)})),redoSelection:Fo((function(){ra(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 o=0;o<t.undone.length;o++)t.undone[o].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Oi(this.history),xi(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Di(this.history.done),undone:Di(this.history.undone)}},setHistory:function(t){var e=this.history=new Oi(this.history);e.done=Di(t.done.slice(0),null,!0),e.undone=Di(t.undone.slice(0),null,!0)},setGutterMarker:Fo((function(t,e,n){return pa(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&at(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:Fo((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&pa(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,at(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!ae(this,t))return null;if(e=t,!(t=te(this,t)))return null}else if(null==(e=oe(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:Fo((function(t,e,n){return pa(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(O(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:Fo((function(t,e,n){return pa(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",o=t[r];if(!o)return!1;if(null==n)t[r]=null;else{var i=o.match(O(n));if(!i)return!1;var a=i.index+i[0].length;t[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:Fo((function(t,e,n){return va(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return ba(this,ge(this,t),ge(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 ba(this,t=ge(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=te(this,(t=ge(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=t.ch)&&(null==o.to||o.to>=t.ch)&&e.push(o.marker.parent||o.marker)}return e},findMarks:function(t,e,n){t=ge(this,t),e=ge(this,e);var r=[],o=t.line;return this.iter(t.line,e.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==t.line&&t.ch>=l.to||null==l.from&&o!=t.line||null!=l.from&&o==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;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(o){var i=o.text.length+r;if(i>t)return e=t,!0;t-=i,++n})),ge(this,le(n,e))},indexFromPos:function(t){var e=(t=ge(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 Ea(ne(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 Ea(ne(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}],Ca(r,_a(this)),r},unlinkDoc:function(t){if(t instanceof Bs&&(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),Sa(_a(this));break}if(t.history==this.history){var n=[t.id];xi(t,(function(t){return n.push(t.id)}),!0),t.history=new Oi(null),t.history.done=Di(this.history.done,n),t.history.undone=Di(this.history.undone,n)}},iterLinkedDocs:function(t){xi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Dt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Fo((function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Si(this.cm))}))}),Ea.prototype.eachLine=Ea.prototype.iter;var ka=0;function Ta(t){var e=this;if(ja(e),!xt(e,t)&&!Gn(e.display,t)){Ot(t),a&&(ka=+new Date);var n=Fr(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),s=0,l=function(){++s==o&&Io(e,(function(){var t={from:n=ge(e.doc,n),to:n,text:e.doc.splitLines(i.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};ea(e.doc,t),Wi(e.doc,pi(ge(e.doc,n),ge(e.doc,di(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==$(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(i[n]=t),l()},r.readAsText(t)}},u=0;u<r.length;u++)c(r[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var p=t.dataTransfer.getData("Text");if(p){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),qi(e.doc,pi(n,n)),d)for(var f=0;f<d.length;++f)sa(e.doc,"",d[f].anchor,d[f].head,"drag");e.replaceSelection(p,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Aa(t,e){if(a&&(!t.state.draggingText||+new Date-ka<100))Tt(e);else if(!xt(t,e)&&!Gn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!f)){var n=P("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Pa(t,e){var n=Fr(t,e);if(n){var r=document.createDocumentFragment();Kr(t,n,r),t.display.dragCursor||(t.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),A(t.display.dragCursor,r)}}function ja(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Ma(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var o=e[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Na=!1;function Ra(){Na||(La(),Na=!0)}function La(){var t;mt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Ma(Ia)}),100))})),mt(window,"blur",(function(){return Ma(eo)}))}function Ia(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Da={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fa=0;Fa<10;Fa++)Da[Fa+48]=Da[Fa+96]=String(Fa);for(var Va=65;Va<=90;Va++)Da[Va]=String.fromCharCode(Va);for(var Ba=1;Ba<=12;Ba++)Da[Ba+111]=Da[Ba+63235]="F"+Ba;var za={};function Ha(t){var e,n,r,o,i=t.split(/-(?!$)/);t=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!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),o&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function $a(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 o=Q(n.split(" "),Ha),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=r):(s=o.slice(0,i+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 Wa(t,e,n,r){var o=(e=Ka(e)).call?e.call(t,r):e[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Wa(t,e.fallthrough,n,r);for(var i=0;i<e.fallthrough.length;i++){var a=Wa(t,e.fallthrough[i],n,r);if(a)return a}}}function Ua(t){var e="string"==typeof t?t:Da[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function qa(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)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Ga(t,e){if(d&&34==t.keyCode&&t.char)return!1;var n=Da[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),qa(n,t,e))}function Ka(t){return"string"==typeof t?za[t]:t}function Ya(t,e){for(var n=t.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=e(n[o]);r.length&&ce(i.from,J(r).to)<=0;){var a=r.pop();if(ce(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}Lo(t,(function(){for(var e=r.length-1;e>=0;e--)sa(t.doc,"",r[e].from,r[e].to,"+delete");uo(t)}))}function Xa(t,e,n){var r=ct(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Za(t,e,n){var r=Xa(t,e.ch,n);return null==r?null:new le(e.line,r,n<0?"after":"before")}function Ja(t,e,n,r,o){if(t){"rtl"==e.doc.direction&&(o=-o);var i=gt(n,e.doc.direction);if(i){var a,s=o<0?J(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=ir(e,n);a=o<0?n.text.length-1:0;var u=ar(e,c,a).top;a=ut((function(t){return ar(e,c,t).top==u}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Xa(n,a,1))}else a=o<0?s.to:s.from;return new le(r,a,l)}}return new le(r,o<0?n.text.length:0,o<0?"before":"after")}function Qa(t,e,n,r){var o=gt(e,t.doc.direction);if(!o)return Za(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=ft(o,n.ch,n.sticky),a=o[i];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Za(e,n,r);var s,l=function(t,n){return Xa(e,t instanceof le?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||ir(t,e),kr(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 p=1==a.level==r<0,d=l(n,p?1:-1);if(null!=d&&(p?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var f=p?"before":"after";return new le(n.line,d,f)}}var h=function(t,e,r){for(var i=function(t,e){return e?new le(n.line,l(t,1),"before"):new le(n.line,t,"after")};t>=0&&t<o.length;t+=e){var a=o[t],s=e>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return i(c,s)}},g=h(i+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=h(r>0?0:o.length-1,r,c(v)))?null:g}za.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"},za.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"},za.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},za.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"]},za.default=b?za.macDefault:za.pcDefault;var ts={selectAll:Qi,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),q)},killLine:function(t){return Ya(t,(function(e){if(e.empty()){var n=te(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:le(e.head.line+1,0)}:{from:e.head,to:le(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Ya(t,(function(e){return{from:le(e.from().line,0),to:ge(t.doc,le(e.to().line+1,0))}}))},delLineLeft:function(t){return Ya(t,(function(t){return{from:le(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Ya(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 Ya(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(le(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(le(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return es(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return rs(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return ns(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")}),K)},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")}),K)},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/)?rs(t,e.head):r}),K)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=z(t.getLine(i.line),i.ch,r);e.push(Z(r-a%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Lo(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var o=e[r].head,i=te(t.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new le(o.line,o.ch-1)),o.ch>0)o=new le(o.line,o.ch+1),t.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),le(o.line,o.ch-2),o,"+transpose");else if(o.line>t.doc.first){var a=te(t.doc,o.line-1).text;a&&(o=new le(o.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),le(o.line-1,a.length-1),o,"+transpose"))}n.push(new ci(o,o))}t.setSelections(n)}))},newlineAndIndent:function(t){return Lo(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);uo(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function es(t,e){var n=te(t.doc,e),r=en(n);return r!=n&&(e=oe(r)),Ja(!0,t,r,e,1)}function ns(t,e){var n=te(t.doc,e),r=nn(n);return r!=n&&(e=oe(r)),Ja(!0,t,n,e,-1)}function rs(t,e){var n=es(t,e.line),r=te(t.doc,n.line),o=gt(r,t.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=i&&e.ch;return le(n.line,a?0:i,n.sticky)}return n}function os(t,e,n){if("string"==typeof e&&!(e=ts[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,o=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),o=e(t)!=U}finally{t.display.shift=r,t.state.suppressEdits=!1}return o}function is(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var o=Wa(e,t.state.keyMaps[r],n,t);if(o)return o}return t.options.extraKeys&&Wa(e,t.options.extraKeys,n,t)||Wa(e,t.options.keyMap,n,t)}var as=new H;function ss(t,e,n,r){var o=t.state.keySeq;if(o){if(Ua(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:as.set(50,(function(){t.state.keySeq==o&&(t.state.keySeq=null,t.display.input.reset())})),ls(t,o+" "+e,n,r))return!0}return ls(t,e,n,r)}function ls(t,e,n,r){var o=is(t,e,r);return"multi"==o&&(t.state.keySeq=e),"handled"==o&&Mn(t,"keyHandled",t,e,n),"handled"!=o&&"multi"!=o||(Ot(n),Zr(t)),!!o}function cs(t,e){var n=Ga(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?ss(t,"Shift-"+n,e,(function(e){return os(t,e,!0)}))||ss(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return os(t,e)})):ss(t,n,e,(function(e){return os(t,e)})))}function us(t,e,n){return ss(t,"'"+n+"'",e,(function(e){return os(t,e,!0)}))}var ps=null;function ds(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=N(D(e)),xt(e,t)))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var o=cs(e,t);d&&(ps=o?r:null,o||88!=r||Vt||!(b?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!b&&!o&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||fs(e)}}function fs(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(k(e,"CodeMirror-crosshair"),bt(document,"keyup",n),bt(document,"mouseover",n))}R(e,"CodeMirror-crosshair"),mt(document,"keyup",n),mt(document,"mouseover",n)}function hs(t){16==t.keyCode&&(this.doc.sel.shift=!1),xt(this,t)}function gs(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Gn(e.display,t)||xt(e,t)||t.ctrlKey&&!t.altKey||b&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(d&&n==ps)return ps=null,void Ot(t);if(!d||t.which&&!(t.which<10)||!cs(e,t)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(us(e,t,o)||e.display.input.onKeyPress(t))}}}var vs,ms,ys=400,bs=function(t,e,n){this.time=t,this.pos=e,this.button=n};function ws(t,e){var n=+new Date;return ms&&ms.compare(n,t,e)?(vs=ms=null,"triple"):vs&&vs.compare(n,t,e)?(ms=new bs(n,t,e),vs=null,"double"):(vs=new bs(n,t,e),ms=null,"single")}function xs(t){var e=this,n=e.display;if(!(xt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Gn(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ps(e,t)){var r=Fr(e,t),o=Pt(t),i=r?ws(r,o):"single";F(e).focus(),1==o&&e.state.selectingText&&e.state.selectingText(t),r&&_s(e,o,r,i,t)||(1==o?r?Ss(e,r,i,t):At(t)==n.scroller&&Ot(t):2==o?(r&&Vi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(S?e.display.input.onContextMenu(t):Qr(e)))}}function _s(t,e,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),ss(t,qa(i=(1==e?"Left":2==e?"Middle":"Right")+i,o),o,(function(e){if("string"==typeof e&&(e=ts[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=U}finally{t.state.suppressEdits=!1}return r}))}function Cs(t,e,n){var r=t.getOption("configureMouse"),o=r?r(t,e,n):{};if(null==o.unit){var i=w?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==o.extend||t.doc.extend)&&(o.extend=t.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=b?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?n.altKey:n.ctrlKey)),o}function Ss(t,e,n,r){a?setTimeout(V(Jr,t),0):t.curOp.focus=N(D(t));var o,i=Cs(t,n,r),s=t.doc.sel;t.options.dragDrop&&Nt&&!t.isReadOnly()&&"single"==n&&(o=s.contains(e))>-1&&(ce((o=s.ranges[o]).from(),e)<0||e.xRel>0)&&(ce(o.to(),e)>0||e.xRel<0)?Os(t,r,e,i):ks(t,r,e,i)}function Os(t,e,n,r){var o=t.display,i=!1,c=Io(t,(function(e){l&&(o.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Qr(t)),bt(o.wrapper.ownerDocument,"mouseup",c),bt(o.wrapper.ownerDocument,"mousemove",u),bt(o.scroller,"dragstart",p),bt(o.scroller,"drop",c),i||(Ot(e),r.addNew||Vi(t.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(t){i=i||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},p=function(){return i=!0};l&&(o.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,mt(o.wrapper.ownerDocument,"mouseup",c),mt(o.wrapper.ownerDocument,"mousemove",u),mt(o.scroller,"dragstart",p),mt(o.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Es(t,e,n){if("char"==n)return new ci(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ci(le(e.line,0),ge(t.doc,le(e.line+1,0)));var r=n(t,e);return new ci(r.from,r.to)}function ks(t,e,n,r){a&&Qr(t);var o=t.display,i=t.doc;Ot(e);var s,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new ci(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new ci(n,n)),n=Fr(t,e,!0,!0),l=-1;else{var p=Es(t,n,r.unit);s=r.extend?Fi(s,p.anchor,p.head,r.extend):p}r.addNew?-1==l?(l=u.length,Ui(i,ui(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Ui(i,ui(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):zi(i,l,s,G):(l=0,Ui(i,new li([s],0),G),c=i.sel);var d=n;function f(e){if(0!=ce(d,e))if(d=e,"rectangle"==r.unit){for(var o=[],a=t.options.tabSize,u=z(te(i,n.line).text,n.ch,a),p=z(te(i,e.line).text,e.ch,a),f=Math.min(u,p),h=Math.max(u,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=te(i,g).text,y=Y(m,f,a);f==h?o.push(new ci(le(g,y),le(g,y))):m.length>y&&o.push(new ci(le(g,y),le(g,Y(m,h,a))))}o.length||o.push(new ci(n,n)),Ui(i,ui(t,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,x=Es(t,e,r.unit),_=w.anchor;ce(x.anchor,_)>0?(b=x.head,_=fe(w.from(),x.anchor)):(b=x.anchor,_=de(w.to(),x.head));var C=c.ranges.slice(0);C[l]=Ts(t,new ci(ge(i,_),b)),Ui(i,ui(t,C,l),G)}}var h=o.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=Fr(t,e,!0,"rectangle"==r.unit);if(a)if(0!=ce(a,d)){t.curOp.focus=N(D(t)),f(a);var s=oo(o,i);(a.line>=s.to||a.line<s.from)&&setTimeout(Io(t,(function(){g==n&&v(e)})),150)}else{var l=e.clientY<h.top?-20:e.clientY>h.bottom?20:0;l&&setTimeout(Io(t,(function(){g==n&&(o.scroller.scrollTop+=l,v(e))})),50)}}function m(e){t.state.selectingText=!1,g=1/0,e&&(Ot(e),o.input.focus()),bt(o.wrapper.ownerDocument,"mousemove",y),bt(o.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var y=Io(t,(function(t){0!==t.buttons&&Pt(t)?v(t):m(t)})),b=Io(t,m);t.state.selectingText=b,mt(o.wrapper.ownerDocument,"mousemove",y),mt(o.wrapper.ownerDocument,"mouseup",b)}function Ts(t,e){var n=e.anchor,r=e.head,o=te(t.doc,n.line);if(0==ce(n,r)&&n.sticky==r.sticky)return e;var i=gt(o);if(!i)return e;var a=ft(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ft(i,r.ch,r.sticky),p=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?p<0:p>0}var d=i[c+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,g=f?"after":"before";return n.ch==h&&n.sticky==g?e:new ci(new le(n.line,h,g),r)}function As(t,e,n,r){var o,i;if(e.touches)o=e.touches[0].clientX,i=e.touches[0].clientY;else try{o=e.clientX,i=e.clientY}catch(t){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&Ot(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!Ct(t,n))return kt(e);i-=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>=o)return wt(t,n,t,ie(t.doc,i),t.display.gutterSpecs[l].className,e),kt(e)}}function Ps(t,e){return As(t,e,"gutterClick",!0)}function js(t,e){Gn(t.display,e)||Ms(t,e)||xt(t,e,"contextmenu")||S||t.display.input.onContextMenu(e)}function Ms(t,e){return!!Ct(t,"gutterContextMenu")&&As(t,e,"gutterContextMenu",!1)}function Ns(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gr(t)}bs.prototype.compare=function(t,e,n){return this.time+ys>t&&0==ce(e,this.pos)&&n==this.button};var Rs={toString:function(){return"CodeMirror.Init"}},Ls={},Is={};function Ds(t){var e=t.optionHandlers;function n(n,r,o,i){t.defaults[n]=r,o&&(e[n]=i?function(t,e,n){n!=Rs&&o(t,e,n)}:o)}t.defineOption=n,t.Init=Rs,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){yi(t),gr(t),Br(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var o=0;;){var i=t.text.indexOf(e,o);if(-1==i)break;o=i+e.length,n.push(le(r,i))}r++}));for(var o=n.length-1;o>=0;o--)sa(t.doc,e,n[o],le(n[o].line,n[o].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Rs&&t.refresh()})),n("specialCharPlaceholder",bn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"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",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ns(t),ei(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Ka(e),o=n!=Rs&&Ka(n);o&&o.detach&&o.detach(t,r),r.attach&&r.attach(t,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Vs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Qo(e,t.options.lineNumbers),ei(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Lr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return _o(t)}),!0),n("scrollbarStyle","native",(function(t){Oo(t),_o(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=Qo(t.options.gutters,e),ei(t)}),!0),n("firstLineNumber",1,ei,!0),n("lineNumberFormatter",(function(t){return t}),ei,!0),n("showCursorWhenSelecting",!1,qr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(eo(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Fs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,qr,!0),n("singleCursorHeightPerLine",!0,qr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,yi,!0),n("addModeClass",!1,yi,!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,yi,!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)}function Fs(t,e,n){if(!e!=!(n&&n!=Rs)){var r=t.display.dragFunctions,o=e?mt:bt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Vs(t){t.options.lineWrapping?(R(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(k(t.display.wrapper,"CodeMirror-wrap"),pn(t)),Dr(t),Br(t),gr(t),setTimeout((function(){return _o(t)}),100)}function Bs(t,e){var n=this;if(!(this instanceof Bs))return new Bs(t,e);this.options=e=e?B(e):{},B(Ls,e,!1);var r=e.value;"string"==typeof r?r=new Ea(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var o=new Bs.inputStyles[e.inputStyle](this),i=this.display=new ni(t,r,o,e);for(var c in i.wrapper.CodeMirror=this,Ns(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new H,keySeq:null,specialChars:null},e.autofocus&&!y&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),zs(this),Ra(),ko(this),this.curOp.forceUpdate=!0,_i(this,r),e.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&to(n)}),20):eo(this),Is)Is.hasOwnProperty(c)&&Is[c](this,e[c],Rs);Jo(this),e.finishInit&&e.finishInit(this);for(var u=0;u<Hs.length;++u)Hs[u](this);To(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function zs(t){var e=t.display;mt(e.scroller,"mousedown",Io(t,xs)),mt(e.scroller,"dblclick",a&&s<11?Io(t,(function(e){if(!xt(t,e)){var n=Fr(t,e);if(n&&!Ps(t,e)&&!Gn(t.display,e)){Ot(e);var r=t.findWordAt(n);Vi(t.doc,r.anchor,r.head)}}})):function(e){return xt(t,e)||Ot(e)}),mt(e.scroller,"contextmenu",(function(e){return js(t,e)})),mt(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||js(t,n)}));var n,r={end:0};function o(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function i(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}mt(e.scroller,"touchstart",(function(o){if(!xt(t,o)&&!i(o)&&!Ps(t,o)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==o.touches.length&&(e.activeTouch.left=o.touches[0].pageX,e.activeTouch.top=o.touches[0].pageY)}})),mt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),mt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Gn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=t.coordsChar(e.activeTouch,"page");i=!r.prev||l(r,r.prev)?new ci(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new ci(le(a.line,0),ge(t.doc,le(a.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),Ot(n)}o()})),mt(e.scroller,"touchcancel",o),mt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(vo(t,e.scroller.scrollTop),yo(t,e.scroller.scrollLeft,!0),wt(t,"scroll",t))})),mt(e.scroller,"mousewheel",(function(e){return si(t,e)})),mt(e.scroller,"DOMMouseScroll",(function(e){return si(t,e)})),mt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){xt(t,e)||Tt(e)},over:function(e){xt(t,e)||(Pa(t,e),Tt(e))},start:function(e){return Aa(t,e)},drop:Io(t,Ta),leave:function(e){xt(t,e)||ja(t)}};var c=e.input.getField();mt(c,"keyup",(function(e){return hs.call(t,e)})),mt(c,"keydown",Io(t,ds)),mt(c,"keypress",Io(t,gs)),mt(c,"focus",(function(e){return to(t,e)})),mt(c,"blur",(function(e){return eo(t,e)}))}Bs.defaults=Ls,Bs.optionHandlers=Is;var Hs=[];function $s(t,e,n,r){var o,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=_e(t,e).state:n="prev");var a=t.options.tabSize,s=te(i,e),l=z(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=i.mode.indent(o,s.text.slice(u.length),s.text))==U||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?z(te(i,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var p="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)d+=a,p+="\t";if(d<c&&(p+=Z(c-d)),p!=u)return sa(i,p,le(e,0),le(e,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var g=i.sel.ranges[h];if(g.head.line==e&&g.head.ch<u.length){var v=le(e,u.length);zi(i,h,new ci(v,v));break}}}Bs.defineInitHook=function(t){return Hs.push(t)};var Ws=null;function Us(t){Ws=t}function qs(t,e,n,r,o){var i=t.doc;t.display.shift=!1,r||(r=i.sel);var a=+new Date-200,s="paste"==o||t.state.pasteIncoming>a,l=Dt(e),c=null;if(s&&r.ranges.length>1)if(Ws&&Ws.text.join("\n")==e){if(r.ranges.length%Ws.text.length==0){c=[];for(var u=0;u<Ws.text.length;u++)c.push(i.splitLines(Ws.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=Q(l,(function(t){return[t]})));for(var p=t.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=le(h.line,h.ch-n):t.state.overwrite&&!s?g=le(g.line,Math.min(te(i,g.line).text.length,g.ch+J(l).length)):s&&Ws&&Ws.lineWise&&Ws.text.join("\n")==l.join("\n")&&(h=g=le(h.line,0)));var v={from:h,to:g,text:c?c[d%c.length]:l,origin:o||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};ea(t.doc,v),Mn(t,"inputRead",t,v)}e&&!s&&Ks(t,e),uo(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Gs(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Lo(e,(function(){return qs(e,n,0,null,"paste")})),!0}function Ks(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=t.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(e.indexOf(i.electricChars.charAt(s))>-1){a=$s(t,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(te(t.doc,o.head.line).text.slice(0,o.head.ch))&&(a=$s(t,o.head.line,"smart"));a&&Mn(t,"electricInput",t,o.head.line)}}}function Ys(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var o=t.doc.sel.ranges[r].head.line,i={anchor:le(o,0),head:le(o+1,0)};n.push(i),e.push(t.getRange(i.anchor,i.head))}return{text:e,ranges:n}}function Xs(t,e,n,r){t.setAttribute("autocorrect",n?"on":"off"),t.setAttribute("autocapitalize",r?"on":"off"),t.setAttribute("spellcheck",!!e)}function Zs(){var t=P("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),e=P("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),v&&(t.style.border="1px solid black"),e}function Js(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){F(this).focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,o=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&Io(this,e[t])(this,n,o),wt(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"](Ka(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:Do((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");tt(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,Br(this)})),removeOverlay:Do((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 Br(this)}})),indentLine:Do((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ae(this.doc,t)&&$s(this,t,e,n)})),indentSelection:Do((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var o=e[r];if(o.empty())o.head.line>n&&($s(this,o.head.line,t,!0),n=o.head.line,r==this.doc.sel.primIndex&&uo(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)$s(this,l,t);var c=this.doc.sel.ranges;0==i.ch&&e.length==c.length&&c[r].from().ch>0&&zi(this.doc,r,new ci(i,c[r].to()),q)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,le(t),e,!0)},getTokenTypeAt:function(t){t=ge(this.doc,t);var e,n=xe(this,te(this.doc,t.line)),r=0,o=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){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 o=n[e],i=this.getModeAt(t);if("string"==typeof i[e])o[i[e]]&&r.push(o[i[e]]);else if(i[e])for(var a=0;a<i[e].length;a++){var s=o[i[e][a]];s&&r.push(s)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==$(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(t,e){var n=this.doc;return _e(this,(t=he(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return _r(this,null==t?n.head:"object"==typeof t?ge(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return xr(this,ge(this.doc,t),e||"page")},coordsChar:function(t,e){return Or(this,(t=wr(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=wr(this,{top:t,left:0},e||"page").top,ie(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,o=!1;if("number"==typeof t){var i=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>i&&(t=i,o=!0),r=te(this.doc,t)}else r=t;return br(this,r,{top:0,left:0},e||"page",n||o).top+(o?this.doc.height-cn(r):0)},defaultTextHeight:function(){return Mr(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,o){var i=this.display,a=(t=_r(this,ge(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),i.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(i.wrapper.clientHeight,this.doc.height),c=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==o?(s=i.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(i.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&so(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Do(ds),triggerOnKeyPress:Do(gs),triggerOnKeyUp:hs,triggerOnMouseDown:Do(xs),execCommand:function(t){if(ts.hasOwnProperty(t))return ts[t].call(null,this)},triggerElectric:Do((function(t){Ks(this,t)})),findPosH:function(t,e,n,r){var o=1;e<0&&(o=-1,e=-e);for(var i=ge(this.doc,t),a=0;a<e&&!(i=Qs(this.doc,i,o,n,r)).hitSide;++a);return i},moveH:Do((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Qs(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),K)})),deleteH:Do((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ya(this,(function(n){var o=Qs(r,n.head,t,e,!1);return t<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(t,e,n,r){var o=1,i=r;e<0&&(o=-1,e=-e);for(var a=ge(this.doc,t),s=0;s<e;++s){var l=_r(this,a,"div");if(null==i?i=l.left:l.left=i,(a=tl(this,l,o,n)).hitSide)break}return a},moveV:Do((function(t,e){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(i)return t<0?a.from():a.to();var s=_r(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=tl(n,s,t,e);return"page"==e&&a==r.sel.primary()&&co(n,xr(n,l,"div").top-s.top),l}),K),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(t){var e=te(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var o=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var i=e.charAt(n),a=it(i,o)?function(t){return it(t,o)}:/\s/.test(i)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!it(t)};n>0&&a(e.charAt(n-1));)--n;for(;r<e.length&&a(e.charAt(r));)++r}return new ci(le(t.line,n),le(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?R(this.display.cursorDiv,"CodeMirror-overwrite"):k(this.display.cursorDiv,"CodeMirror-overwrite"),wt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N(D(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Do((function(t,e){po(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Zn(this)-this.display.barHeight,width:t.scrollWidth-Zn(this)-this.display.barWidth,clientHeight:Qn(this),clientWidth:Jn(this)}},scrollIntoView:Do((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:le(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?fo(this,t):go(this,t.from,t.to,t.margin)})),setSize:Do((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&&hr(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){zr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,wt(this,"refresh",this)})),operation:function(t){return Lo(this,t)},startOperation:function(){return ko(this)},endOperation:function(){return To(this)},refresh:Do((function(){var t=this.display.cachedTextHeight;Br(this),this.curOp.forceUpdate=!0,gr(this),po(this,this.doc.scrollLeft,this.doc.scrollTop),Yo(this.display),(null==t||Math.abs(t-Mr(this.display))>.5||this.options.lineWrapping)&&Dr(this),wt(this,"refresh",this)})),swapDoc:Do((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),_i(this,t),gr(this),this.display.input.reset(),po(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Mn(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}},St(t),t.registerHelper=function(e,r,o){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=o},t.registerGlobalHelper=function(e,r,o,i){t.registerHelper(e,r,i),n[e]._global.push({pred:o,val:i})}}function Qs(t,e,n,r,o){var i=e,a=n,s=te(t,e.line),l=o&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new le(n,e.ch,e.sticky),s=te(t,n))}function u(i){var a;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new le(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(p?2:1))),-n)}}else a=o?Qa(t.cm,s,e,n):Za(s,e,n);if(null==a){if(i||!c())return!1;e=Ja(o,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var p=null,d="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),h=!0;!(n<0)||u(!h);h=!1){var g=s.text.charAt(e.ch)||"\n",v=it(g,f)?"w":d&&"\n"==g?"n":!d||/\s/.test(g)?null:"p";if(!d||h||v||(v="s"),p&&p!=v){n<0&&(n=1,u(),e.sticky="after");break}if(v&&(p=v),n>0&&!u(!h))break}var m=Zi(t,e,i,a,!0);return ue(i,m)&&(m.hitSide=!0),m}function tl(t,e,n,r){var o,i,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,F(t).innerHeight||a(t).documentElement.clientHeight),c=Math.max(l-.5*Mr(t.display),3);o=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(o=n>0?e.bottom+3:e.top-3);for(;(i=Or(t,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var el=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function nl(t,e){var n=or(t,e.line);if(!n||n.hidden)return null;var r=te(t.doc,e.line),o=er(n,r,e.line),i=gt(r,t.doc.direction),a="left";i&&(a=ft(i,e.ch)%2?"right":"left");var s=cr(o.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function rl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function ol(t,e){return e&&(t.bad=!0),t}function il(t,e,n,r,o){var i="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(i+=s,l&&(i+=s),a=l=!1)}function p(t){t&&(u(),i+=t)}function d(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void p(n);var i,f=e.getAttribute("cm-marker");if(f){var h=t.findMarks(le(r,0),le(o+1,0),c(+f));return void(h.length&&(i=h[0].find(0))&&p(ee(t.doc,i.from,i.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var v=0;v<e.childNodes.length;v++)d(e.childNodes[v]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),g&&(a=!0)}else 3==e.nodeType&&p(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(e),e!=n;)e=e.nextSibling,l=!1;return i}function al(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return ol(t.clipPos(le(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var o=0;o<t.display.view.length;o++){var i=t.display.view[o];if(i.node==r)return sl(i,e,n)}}function sl(t,e,n){var r=t.text.firstChild,o=!1;if(!e||!M(r,e))return ol(le(oe(t.line),0),!0);if(e==r&&(o=!0,e=r.childNodes[n],n=0,!e)){var i=t.rest?J(t.rest):t.line;return ol(le(oe(i),i.text.length),o)}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 o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==e||s==n){var u=oe(o<0?t.line:t.rest[o]),p=i[a]+r;return(r<0||s!=e)&&(p=i[a+(r?1:0)]),le(u,p)}}}var p=u(a,s,n);if(p)return ol(p,o);for(var d=s.nextSibling,f=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(p=u(d,d.firstChild,0))return ol(le(p.line,p.ch-f),o);f+=d.textContent.length}for(var h=s.previousSibling,g=n;h;h=h.previousSibling){if(p=u(h,h.firstChild,-1))return ol(le(p.line,p.ch+g),o);g+=h.textContent.length}}el.prototype.init=function(t){var e=this,n=this,r=n.cm,o=n.div=t.lineDiv;function i(t){for(var e=t.target;e;e=e.parentNode){if(e==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(i(t)&&!xt(r,t)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ys(r);Us({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,q),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=Ws.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Zs(),l=s.firstChild;Xs(l),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Ws.text.join("\n");var c=N(o.ownerDocument);I(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Xs(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),mt(o,"paste",(function(t){!i(t)||xt(r,t)||Gs(t,r)||s<=11&&setTimeout(Io(r,(function(){return e.updateFromDOM()})),20)})),mt(o,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),mt(o,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),mt(o,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),mt(o,"touchstart",(function(){return n.forceCompositionEnd()})),mt(o,"input",(function(){e.composing||e.readFromDOMSoon()})),mt(o,"copy",a),mt(o,"cut",a)},el.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},el.prototype.prepareSelection=function(){var t=Gr(this.cm,!1);return t.focus=N(this.div.ownerDocument)==this.div,t},el.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},el.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},el.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),o=r.from(),i=r.to();if(e.display.viewTo==e.display.viewFrom||o.line>=e.display.viewTo||i.line<e.display.viewFrom)t.removeAllRanges();else{var a=al(e,t.anchorNode,t.anchorOffset),s=al(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=ce(fe(a,s),o)||0!=ce(de(a,s),i)){var l=e.display.view,c=o.line>=e.display.viewFrom&&nl(e,o)||{node:l[0].measure.map[2],offset:0},u=i.line<e.display.viewTo&&nl(e,i);if(!u){var p=l[l.length-1].measure,d=p.maps?p.maps[p.maps.length-1]:p.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var f,h=t.rangeCount&&t.getRangeAt(0);try{f=E(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)),h&&null==t.anchorNode?t.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},el.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)},el.prototype.showMultipleSelections=function(t){A(this.cm.display.cursorDiv,t.cursors),A(this.cm.display.selectionDiv,t.selection)},el.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},el.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return M(this.div,e)},el.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&N(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},el.prototype.blur=function(){this.div.blur()},el.prototype.getField=function(){return this.div},el.prototype.supportsTouch=function(){return!0},el.prototype.receivedFocus=function(){var t=this,e=this;function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):Lo(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},el.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},el.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&rl(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=al(e,t.anchorNode,t.anchorOffset),r=al(e,t.focusNode,t.focusOffset);n&&r&&Lo(e,(function(){Ui(e.doc,pi(n,r),q),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},el.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>r.firstLine()&&(a=le(a.line-1,te(r.doc,a.line-1).length)),s.ch==te(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=le(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(t=Vr(r,a.line))?(e=oe(o.view[0].line),n=o.view[0].node):(e=oe(o.view[t].line),n=o.view[t-1].node.nextSibling);var l,c,u=Vr(r,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=oe(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(il(r,n,c,e,l)),d=ee(r.doc,le(e,0),le(l,te(r.doc,l).text.length));p.length>1&&d.length>1;)if(J(p)==J(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),e++}for(var f=0,h=0,g=p[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=J(p),b=J(d),w=Math.min(y.length-(1==p.length?f:0),b.length-(1==d.length?f:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==p.length&&1==d.length&&e==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var x=le(e,f),_=le(l,d.length?J(d).length-h:0);return p.length>1||p[0]||ce(x,_)?(sa(r.doc,p,x,_,"+input"),!0):void 0},el.prototype.ensurePolled=function(){this.forceCompositionEnd()},el.prototype.reset=function(){this.forceCompositionEnd()},el.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},el.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))},el.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Lo(this.cm,(function(){return Br(t.cm)}))},el.prototype.setUneditable=function(t){t.contentEditable="false"},el.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Io(this.cm,qs)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},el.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},el.prototype.onContextMenu=function(){},el.prototype.resetPosition=function(){},el.prototype.needsContentAttribute=!0;var ll=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null,this.resetting=!1};function cl(t,e){if((e=e?B(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=N(t.ownerDocument);e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var o;if(t.form&&(mt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(bt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=o))}},t.style.display="none";var s=Bs((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function ul(t){t.off=bt,t.on=mt,t.wheelEventPixels=ai,t.Doc=Ea,t.splitLines=Dt,t.countColumn=z,t.findColumn=Y,t.isWordChar=ot,t.Pass=U,t.signal=wt,t.Line=dn,t.changeEnd=di,t.scrollbarModel=So,t.Pos=le,t.cmpPos=ce,t.modes=Ht,t.mimeModes=$t,t.resolveMode=qt,t.getMode=Gt,t.modeExtensions=Kt,t.extendMode=Yt,t.copyState=Xt,t.startState=Jt,t.innerMode=Zt,t.commands=ts,t.keyMap=za,t.keyName=Ga,t.isModifierKey=Ua,t.lookupKey=Wa,t.normalizeKeyMap=$a,t.StringStream=Qt,t.SharedTextMarker=wa,t.TextMarker=ya,t.LineWidget=ha,t.e_preventDefault=Ot,t.e_stopPropagation=Et,t.e_stop=Tt,t.addClass=R,t.contains=M,t.rmClass=k,t.keyNames=Da}ll.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var o=this.textarea;function i(t){if(!xt(r,t)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ys(r);Us({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,q):(n.prevInput="",o.value=e.text.join("\n"),I(o))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(o.style.width="0px"),mt(o,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),mt(o,"paste",(function(t){xt(r,t)||Gs(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),mt(o,"cut",i),mt(o,"copy",i),mt(t.scroller,"paste",(function(e){if(!Gn(t,e)&&!xt(r,e)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=e.clipboardData,o.dispatchEvent(i)}})),mt(t.lineSpace,"selectstart",(function(e){Gn(t,e)||Ot(e)})),mt(o,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),mt(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ll.prototype.createField=function(t){this.wrapper=Zs(),this.textarea=this.wrapper.firstChild;var e=this.cm.options;Xs(this.textarea,e.spellcheck,e.autocorrect,e.autocapitalize)},ll.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ll.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Gr(t);if(t.options.moveInputWithCursor){var o=_r(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},ll.prototype.showSelection=function(t){var e=this.cm.display;A(e.cursorDiv,t.cursors),A(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ll.prototype.reset=function(t){if(!(this.contextMenuPending||this.composing&&t)){var e=this.cm;if(this.resetting=!0,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));this.resetting=!1}},ll.prototype.getField=function(){return this.textarea},ll.prototype.supportsTouch=function(){return!1},ll.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||N(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(t){}},ll.prototype.blur=function(){this.textarea.blur()},ll.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ll.prototype.receivedFocus=function(){this.slowPoll()},ll.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ll.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ll.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Ft(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var o=n.value;if(o==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l<c&&r.charCodeAt(l)==o.charCodeAt(l);)++l;return Lo(e,(function(){qs(e,o.slice(l),r.length-l,null,t.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=o,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ll.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ll.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ll.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,o=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=Fr(n,t),c=r.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Io(n,Ui)(n.doc,pi(i),q);var u,p=o.style.cssText,f=e.wrapper.style.cssText,h=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=o.ownerDocument.defaultView.scrollY),r.input.focus(),l&&o.ownerDocument.defaultView.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),S){Tt(t);var g=function(){bt(window,"mouseup",g),setTimeout(m,20)};mt(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=o.selectionStart){var t=n.somethingSelected(),i="​"+(t?o.value:"");o.value="⇚",o.value=i,e.prevInput=t?"":"​",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&v();var t=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==e.prevInput?Io(n,Qi)(n):t++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},ll.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ll.prototype.setUneditable=function(){},ll.prototype.needsContentAttribute=!1,Ds(Bs),Js(Bs);var pl="iter insert remove copy getEditor constructor".split(" ");for(var dl in Ea.prototype)Ea.prototype.hasOwnProperty(dl)&&$(pl,dl)<0&&(Bs.prototype[dl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ea.prototype[dl]));return St(Ea),Bs.inputStyles={textarea:ll,contenteditable:el},Bs.defineMode=function(t){Bs.defaults.mode||"null"==t||(Bs.defaults.mode=t),Wt.apply(this,arguments)},Bs.defineMIME=Ut,Bs.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Bs.defineMIME("text/plain","null"),Bs.defineExtension=function(t,e){Bs.prototype[t]=e},Bs.defineDocExtension=function(t,e){Ea.prototype[t]=e},Bs.fromTextArea=cl,ul(Bs),Bs.version="5.65.15",Bs}()},629:(t,e,n)=>{!function(t){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 o,i,a=e.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},p=n.mediaValueKeywords||{},d=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},m=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,x=!1!==e.highlightNonStandardPropertyKeywords;function _(t,e){return o=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\\\-]/),_("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?_(null,"compare"):'"'==n||"'"==n?(e.tokenize=S(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),_("atom","hash")):"!"==n?(t.match(/^\s*\w*/),_("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),_("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?_(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?_("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?_(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=O),_("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),_("property","word")):_(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),_("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?_("variable-2","variable-definition"):_("variable-2","variable")):t.match(/^\w+-/)?_("meta","meta"):void 0}function S(t){return function(e,n){for(var r,o=!1;null!=(r=e.next());){if(r==t&&!o){")"==t&&e.backUp(1);break}o=!o&&"\\"==r}return(r==t||!o&&")"!=t)&&(n.tokenize=null),_("string","string")}}function O(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=S(")"),_(null,"(")}function E(t,e,n){this.type=t,this.indent=e,this.prev=n}function k(t,e,n,r){return t.context=new E(n,e.indentation()+(!1===r?0:a),t.context),n}function T(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function A(t,e,n){return M[n.context.type](t,e,n)}function P(t,e,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return A(t,e,n)}function j(t){var e=t.current().toLowerCase();i=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return k(n,e,"block");if("}"==t&&n.context.prev)return T(n);if(w&&/@component/i.test(t))return k(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return k(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return k(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return k(n,e,"at");if("hash"==t)i="builtin";else if("word"==t)i="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return k(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return k(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return d.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i=x?"string-2":"property","maybeprop"):y?(i=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(i="error","block")},maybeprop:function(t,e,n){return":"==t?k(n,e,"prop"):A(t,e,n)},prop:function(t,e,n){if(";"==t)return T(n);if("{"==t&&y)return k(n,e,"propBlock");if("}"==t||"{"==t)return P(t,e,n);if("("==t)return k(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.current())){if("word"==t)j(e);else if("interpolation"==t)return k(n,e,"interpolation")}else i+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?T(n):"word"==t?(i="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?P(t,e,n):")"==t?T(n):"("==t?k(n,e,"parens"):"interpolation"==t?k(n,e,"interpolation"):("word"==t&&j(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(i="variable-3",n.context.type):A(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(i="tag",n.context.type):M.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return k(n,e,"atBlock_parens");if("}"==t||";"==t)return P(t,e,n);if("{"==t)return T(n)&&k(n,e,y?"block":"top");if("interpolation"==t)return k(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?x?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?P(t,e,n):"{"==t?T(n)&&k(n,e,y?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?T(n):"{"==t||"}"==t?P(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?k(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):A(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,T(n)):"word"==t?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(i="variable","keyframes"):"{"==t?k(n,e,"top"):A(t,e,n)},at:function(t,e,n){return";"==t?T(n):"{"==t||"}"==t?P(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?T(n):"{"==t||";"==t?P(t,e,n):("word"==t?i="variable":"variable"!=t&&"("!=t&&")"!=t&&(i="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new E(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||C)(t,e);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(e.state=M[e.state](o,t,e)),i},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-a)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],p=e(u),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=e(d),h=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=e(v),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(y),w=n.concat(o).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:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,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:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:h,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:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:h,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:i,mediaFeatures:s,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,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(631))},531:(t,e,n)=>{!function(t){var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(t,e,n){var r=t.current(),o=r.search(e);return o>-1?t.backUp(r.length-o):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}var r={};function o(t){var e=r[t];return e||(r[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function i(t,e){var n=t.match(o(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(t,e){return new RegExp((e?"^":"")+"</\\s*"+t+"\\s*>","i")}function s(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),o=t[n],i=o.length-1;i>=0;i--)r.unshift(o[i])}function l(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(!r[0]||r[1].test(i(e,r[0])))return r[2]}}t.defineMode("htmlmixed",(function(r,o){var i=t.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag,allowMissingTagName:o.allowMissingTagName}),c={},u=o&&o.tags,p=o&&o.scriptTypes;if(s(e,c),u&&s(u,c),p)for(var d=p.length-1;d>=0;d--)c.script.unshift(["type",p[d].matches,p[d].mode]);function f(e,o){var s,u=i.token(e,o.htmlState),p=/\btag\b/.test(u);if(p&&!/[<>\s\/]/.test(e.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&p&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==e.current()&&l(c[d[1]],d[2]),g=t.getMode(r,h),v=a(d[1],!0),m=a(d[1],!1);o.token=function(t,e){return t.match(v,!1)?(e.token=f,e.localState=e.localMode=null,null):n(t,m,e.localMode.token(t,e.localState))},o.localMode=g,o.localState=t.startState(g,i.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=e.current(),e.eol()&&(o.inTag+=" "));return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:t.startState(i)}},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(i,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?i.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||i}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(631),n(589),n(876),n(629))},876:(t,e,n)=>{var r;(r=n(631)).defineMode("javascript",(function(t,e){var n,o,i=t.indentUnit,a=e.statementIndent,s=e.jsonld,l=e.json||s,c=!1!==e.trackScope,u=e.typescript,p=e.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),o=t("keyword d"),i=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(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}}function v(t,e,r){return n=t,o=r,e}function m(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=y(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&t.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&t.eat(">"))return v("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return t.eat("*")?(e.tokenize=b,b(t,e)):t.eat("/")?(t.skipToEnd(),v("comment","comment")):oe(t,e,1)?(g(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(t.eat("="),v("operator","operator",t.current()));if("`"==n)return e.tokenize=w,w(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),v("meta","meta");if("#"==n&&t.eatWhile(p))return v("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),v("comment","comment");if(f.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?v("."):v("operator","operator",t.current());if(p.test(n)){t.eatWhile(p);var r=t.current();if("."!=e.lastType){if(d.propertyIsEnumerable(r)){var o=d[r];return v(o.type,o.style,r)}if("async"==r&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function y(t){return function(e,n){var r,o=!1;if(s&&"@"==e.peek()&&e.match(h))return n.tokenize=m,v("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||o);)o=!o&&"\\"==r;return o||(n.tokenize=m),v("string","string")}}function b(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=m;break}r="*"==n}return v("comment","comment")}function w(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=m;break}r=!r&&"\\"==n}return v("quasi","string-2",t.current())}var x="([{}])";function _(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=x.indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(p.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(e.fatArrowAt=a)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function S(t,e,n,r,o,i){this.indented=t,this.column=e,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function O(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function E(t,e,n,r,o){var i=t.cc;for(k.state=t,k.stream=o,k.marked=null,k.cc=i,k.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((i.length?i.pop():l?U:$)(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return k.marked?k.marked:"variable"==n&&O(t,r)?"variable-2":e}}var k={state:null,column:null,marked:null,cc:null};function T(){for(var t=arguments.length-1;t>=0;t--)k.cc.push(arguments[t])}function A(){return T.apply(null,arguments),!0}function P(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function j(t){var n=k.state;if(k.marked="def",c){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=M(t,n.context);if(null!=r)return void(n.context=r)}else if(!P(t,n.localVars))return void(n.localVars=new L(t,n.localVars));e.globalVars&&!P(t,n.globalVars)&&(n.globalVars=new L(t,n.globalVars))}}function M(t,e){if(e){if(e.block){var n=M(t,e.prev);return n?n==e.prev?e:new R(n,e.vars,!0):null}return P(t,e.vars)?e:new R(e.prev,new L(t,e.vars),!1)}return null}function N(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function R(t,e,n){this.prev=t,this.vars=e,this.block=n}function L(t,e){this.name=t,this.next=e}var I=new L("this",new L("arguments",null));function D(){k.state.context=new R(k.state.context,k.state.localVars,!1),k.state.localVars=I}function F(){k.state.context=new R(k.state.context,k.state.localVars,!0),k.state.localVars=null}function V(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function B(t,e){var n=function(){var n=k.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new S(r,k.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function z(){var t=k.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function H(t){function e(n){return n==t?A():";"==t||"}"==n||")"==n||"]"==n?T():A(e)}return e}function $(t,e){return"var"==t?A(B("vardef",e),Tt,H(";"),z):"keyword a"==t?A(B("form"),G,$,z):"keyword b"==t?A(B("form"),$,z):"keyword d"==t?k.stream.match(/^\s*$/,!1)?A():A(B("stat"),Y,H(";"),z):"debugger"==t?A(H(";")):"{"==t?A(B("}"),F,dt,z,V):";"==t?A():"if"==t?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==z&&k.state.cc.pop()(),A(B("form"),G,$,z,Rt)):"function"==t?A(Ft):"for"==t?A(B("form"),F,Lt,$,V,z):"class"==t||u&&"interface"==e?(k.marked="keyword",A(B("form","class"==t?t:e),$t,z)):"variable"==t?u&&"declare"==e?(k.marked="keyword",A($)):u&&("module"==e||"enum"==e||"type"==e)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==e?A(ee):"type"==e?A(Bt,H("operator"),mt,H(";")):A(B("form"),At,H("{"),B("}"),dt,z,z)):u&&"namespace"==e?(k.marked="keyword",A(B("form"),U,$,z)):u&&"abstract"==e?(k.marked="keyword",A($)):A(B("stat"),it):"switch"==t?A(B("form"),G,H("{"),B("}","switch"),F,dt,z,z,V):"case"==t?A(U,H(":")):"default"==t?A(H(":")):"catch"==t?A(B("form"),D,W,$,z,V):"export"==t?A(B("stat"),Gt,z):"import"==t?A(B("stat"),Yt,z):"async"==t?A($):"@"==e?A(U,$):T(B("stat"),U,H(";"),z)}function W(t){if("("==t)return A(zt,H(")"))}function U(t,e){return K(t,e,!1)}function q(t,e){return K(t,e,!0)}function G(t){return"("!=t?T():A(B(")"),Y,H(")"),z)}function K(t,e,n){if(k.state.fatArrowAt==k.stream.start){var r=n?et:tt;if("("==t)return A(D,B(")"),ut(zt,")"),z,H("=>"),r,V);if("variable"==t)return T(D,At,H("=>"),r,V)}var o=n?Z:X;return C.hasOwnProperty(t)?A(o):"function"==t?A(Ft,o):"class"==t||u&&"interface"==e?(k.marked="keyword",A(B("form"),Ht,z)):"keyword c"==t||"async"==t?A(n?q:U):"("==t?A(B(")"),Y,H(")"),z,o):"operator"==t||"spread"==t?A(n?q:U):"["==t?A(B("]"),te,z,o):"{"==t?pt(st,"}",null,o):"quasi"==t?T(J,o):"new"==t?A(nt(n)):A()}function Y(t){return t.match(/[;\}\)\],]/)?T():T(U)}function X(t,e){return","==t?A(Y):Z(t,e,!1)}function Z(t,e,n){var r=0==n?X:Z,o=0==n?U:q;return"=>"==t?A(D,n?et:tt,V):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?A(r):u&&"<"==e&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?A(B(">"),ut(mt,">"),z,r):"?"==e?A(U,H(":"),o):A(o):"quasi"==t?T(J,r):";"!=t?"("==t?pt(q,")","call",r):"."==t?A(at,r):"["==t?A(B("]"),Y,H("]"),z,r):u&&"as"==e?(k.marked="keyword",A(mt,r)):"regexp"==t?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),A(o)):void 0:void 0}function J(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?A(J):A(Y,Q)}function Q(t){if("}"==t)return k.marked="string-2",k.state.tokenize=w,A(J)}function tt(t){return _(k.stream,k.state),T("{"==t?$:U)}function et(t){return _(k.stream,k.state),T("{"==t?$:q)}function nt(t){return function(e){return"."==e?A(t?ot:rt):"variable"==e&&u?A(Ot,t?Z:X):T(t?q:U)}}function rt(t,e){if("target"==e)return k.marked="keyword",A(X)}function ot(t,e){if("target"==e)return k.marked="keyword",A(Z)}function it(t){return":"==t?A(z,$):T(X,H(";"),z)}function at(t){if("variable"==t)return k.marked="property",A()}function st(t,e){return"async"==t?(k.marked="property",A(st)):"variable"==t||"keyword"==k.style?(k.marked="property","get"==e||"set"==e?A(lt):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),A(ct))):"number"==t||"string"==t?(k.marked=s?"property":k.style+" property",A(ct)):"jsonld-keyword"==t?A(ct):u&&N(e)?(k.marked="keyword",A(st)):"["==t?A(U,ft,H("]"),ct):"spread"==t?A(q,ct):"*"==e?(k.marked="keyword",A(st)):":"==t?T(ct):void 0;var n}function lt(t){return"variable"!=t?T(ct):(k.marked="property",A(Ft))}function ct(t){return":"==t?A(q):"("==t?T(Ft):void 0}function ut(t,e,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var a=k.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),A((function(n,r){return n==e||r==e?T():T(t)}),r)}return o==e||i==e?A():n&&n.indexOf(";")>-1?T(t):A(H(e))}return function(n,o){return n==e||o==e?A():T(t,r)}}function pt(t,e,n){for(var r=3;r<arguments.length;r++)k.cc.push(arguments[r]);return A(B(e,n),ut(t,e),z)}function dt(t){return"}"==t?A():T($,dt)}function ft(t,e){if(u){if(":"==t)return A(mt);if("?"==e)return A(ft)}}function ht(t,e){if(u&&(":"==t||"in"==e))return A(mt)}function gt(t){if(u&&":"==t)return k.stream.match(/^\s*\w+\s+is\b/,!1)?A(U,vt,mt):A(mt)}function vt(t,e){if("is"==e)return k.marked="keyword",A()}function mt(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(k.marked="keyword",A("typeof"==e?q:mt)):"variable"==t||"void"==e?(k.marked="type",A(St)):"|"==e||"&"==e?A(mt):"string"==t||"number"==t||"atom"==t?A(St):"["==t?A(B("]"),ut(mt,"]",","),z,St):"{"==t?A(B("}"),bt,z,St):"("==t?A(ut(Ct,")"),yt,St):"<"==t?A(ut(mt,">"),mt):"quasi"==t?T(xt,St):void 0}function yt(t){if("=>"==t)return A(mt)}function bt(t){return t.match(/[\}\)\]]/)?A():","==t||";"==t?A(bt):T(wt,bt)}function wt(t,e){return"variable"==t||"keyword"==k.style?(k.marked="property",A(wt)):"?"==e||"number"==t||"string"==t?A(wt):":"==t?A(mt):"["==t?A(H("variable"),ht,H("]"),wt):"("==t?T(Vt,wt):t.match(/[;\}\)\],]/)?void 0:A()}function xt(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?A(xt):A(mt,_t)}function _t(t){if("}"==t)return k.marked="string-2",k.state.tokenize=w,A(xt)}function Ct(t,e){return"variable"==t&&k.stream.match(/^\s*[?:]/,!1)||"?"==e?A(Ct):":"==t?A(mt):"spread"==t?A(Ct):T(mt)}function St(t,e){return"<"==e?A(B(">"),ut(mt,">"),z,St):"|"==e||"."==t||"&"==e?A(mt):"["==t?A(mt,H("]"),St):"extends"==e||"implements"==e?(k.marked="keyword",A(mt)):"?"==e?A(mt,H(":"),mt):void 0}function Ot(t,e){if("<"==e)return A(B(">"),ut(mt,">"),z,St)}function Et(){return T(mt,kt)}function kt(t,e){if("="==e)return A(mt)}function Tt(t,e){return"enum"==e?(k.marked="keyword",A(ee)):T(At,ft,Mt,Nt)}function At(t,e){return u&&N(e)?(k.marked="keyword",A(At)):"variable"==t?(j(e),A()):"spread"==t?A(At):"["==t?pt(jt,"]"):"{"==t?pt(Pt,"}"):void 0}function Pt(t,e){return"variable"!=t||k.stream.match(/^\s*:/,!1)?("variable"==t&&(k.marked="property"),"spread"==t?A(At):"}"==t?T():"["==t?A(U,H("]"),H(":"),Pt):A(H(":"),At,Mt)):(j(e),A(Mt))}function jt(){return T(At,Mt)}function Mt(t,e){if("="==e)return A(q)}function Nt(t){if(","==t)return A(Tt)}function Rt(t,e){if("keyword b"==t&&"else"==e)return A(B("form","else"),$,z)}function Lt(t,e){return"await"==e?A(Lt):"("==t?A(B(")"),It,z):void 0}function It(t){return"var"==t?A(Tt,Dt):"variable"==t?A(Dt):T(Dt)}function Dt(t,e){return")"==t?A():";"==t?A(Dt):"in"==e||"of"==e?(k.marked="keyword",A(U,Dt)):T(U,Dt)}function Ft(t,e){return"*"==e?(k.marked="keyword",A(Ft)):"variable"==t?(j(e),A(Ft)):"("==t?A(D,B(")"),ut(zt,")"),z,gt,$,V):u&&"<"==e?A(B(">"),ut(Et,">"),z,Ft):void 0}function Vt(t,e){return"*"==e?(k.marked="keyword",A(Vt)):"variable"==t?(j(e),A(Vt)):"("==t?A(D,B(")"),ut(zt,")"),z,gt,V):u&&"<"==e?A(B(">"),ut(Et,">"),z,Vt):void 0}function Bt(t,e){return"keyword"==t||"variable"==t?(k.marked="type",A(Bt)):"<"==e?A(B(">"),ut(Et,">"),z):void 0}function zt(t,e){return"@"==e&&A(U,zt),"spread"==t?A(zt):u&&N(e)?(k.marked="keyword",A(zt)):u&&"this"==t?A(ft,Mt):T(At,ft,Mt)}function Ht(t,e){return"variable"==t?$t(t,e):Wt(t,e)}function $t(t,e){if("variable"==t)return j(e),A(Wt)}function Wt(t,e){return"<"==e?A(B(">"),ut(Et,">"),z,Wt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(k.marked="keyword"),A(u?mt:U,Wt)):"{"==t?A(B("}"),Ut,z):void 0}function Ut(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&N(e))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",A(Ut)):"variable"==t||"keyword"==k.style?(k.marked="property",A(qt,Ut)):"number"==t||"string"==t?A(qt,Ut):"["==t?A(U,ft,H("]"),qt,Ut):"*"==e?(k.marked="keyword",A(Ut)):u&&"("==t?T(Vt,Ut):";"==t||","==t?A(Ut):"}"==t?A():"@"==e?A(U,Ut):void 0}function qt(t,e){if("!"==e)return A(qt);if("?"==e)return A(qt);if(":"==t)return A(mt,Mt);if("="==e)return A(q);var n=k.state.lexical.prev;return T(n&&"interface"==n.info?Vt:Ft)}function Gt(t,e){return"*"==e?(k.marked="keyword",A(Qt,H(";"))):"default"==e?(k.marked="keyword",A(U,H(";"))):"{"==t?A(ut(Kt,"}"),Qt,H(";")):T($)}function Kt(t,e){return"as"==e?(k.marked="keyword",A(H("variable"))):"variable"==t?T(q,Kt):void 0}function Yt(t){return"string"==t?A():"("==t?T(U):"."==t?T(X):T(Xt,Zt,Qt)}function Xt(t,e){return"{"==t?pt(Xt,"}"):("variable"==t&&j(e),"*"==e&&(k.marked="keyword"),A(Jt))}function Zt(t){if(","==t)return A(Xt,Zt)}function Jt(t,e){if("as"==e)return k.marked="keyword",A(Xt)}function Qt(t,e){if("from"==e)return k.marked="keyword",A(U)}function te(t){return"]"==t?A():T(ut(q,"]"))}function ee(){return T(B("form"),At,H("{"),B("}"),ut(ne,"}"),z,z)}function ne(){return T(At,Mt)}function re(t,e){return"operator"==t.lastType||","==t.lastType||f.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function oe(t,e,n){return e.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return D.lex=F.lex=!0,V.lex=!0,z.lex=!0,{startState:function(t){var n={tokenize:m,lastType:"sof",cc:[],lexical:new S((t||0)-i,0,"block",!1),localVars:e.localVars,context:e.localVars&&new R(null,null,!1),indented:t||0};return e.globalVars&&"object"==typeof e.globalVars&&(n.globalVars=e.globalVars),n},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),_(t,e)),e.tokenize!=b&&t.eatSpace())return null;var r=e.tokenize(t,e);return"comment"==n?r:(e.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",E(e,r,n,o,t))},indent:function(t,n){if(t.tokenize==b||t.tokenize==w)return r.Pass;if(t.tokenize!=m)return 0;var o,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==z)l=l.prev;else if(u!=Rt&&u!=V)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==X||o==Z)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=s==p;return"vardef"==p?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==p&&"{"==s?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+(re(t,n)?a||i:0):"switch"!=l.info||d||0==e.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:oe,skipExpression:function(t){E(t,"atom","atom","true",new r.StringStream("",2,null))}}})),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})},589:(t,e,n)=>{var r,o,i;r=n(631),o={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},r.defineMode("xml",(function(t,e){var n,a,s=t.indentUnit,l={},c=e.htmlMode?o:i;for(var u in c)l[u]=c[u];for(var u in e)l[u]=e[u];function p(t,e){function r(n){return e.tokenize=n,n(t,e)}var o=t.next();return"<"==o?t.eat("!")?t.eat("[")?t.match("CDATA[")?r(h("atom","]]>")):null:t.match("--")?r(h("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=h("meta","?>"),"meta"):(n=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==o?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=p,n=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return n="equals",null;if("<"==r){e.tokenize=p,e.state=w,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=f(r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=d;break}return"string"};return e.isInAttribute=!0,e}function h(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=p;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=p;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function v(t){return t&&t.toLowerCase()}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function y(t){t.context&&(t.context=t.context.prev)}function b(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(v(n))||!l.contextGrabbers[v(n)].hasOwnProperty(v(e)))return;y(t)}}function w(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?_:w}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",O):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,e,n)):(a="error",x)}function _(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(v(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",C):(a="tag error",S)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,e,n)):(a="error",S)}function C(t,e,n){return"endTag"!=t?(a="error",C):(y(n),w)}function S(t,e,n){return a="error",C(t,e,n)}function O(t,e,n){if("word"==t)return a="attribute",E;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(v(r))?b(n,r):(b(n,r),n.context=new m(n,r,o==n.indented)),w}return a="error",O}function E(t,e,n){return"equals"==t?k:(l.allowMissing||(a="error"),O(t,e,n))}function k(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",O):(a="error",O(t,e,n))}function T(t,e,n){return"string"==t?T:O(t,e,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:w,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;n=null;var r=e.tokenize(t,e);return(r||n)&&"comment"!=r&&(a=null,e.state=e.state(n||r,t,e),a&&(r="error"==a?r+" error":a)),r},indent:function(t,e,n){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(o&&o.noIndent)return r.Pass;if(t.tokenize!=d&&t.tokenize!=p)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(e))return 0;var i=e&&/^<(\/)?([\w_:\.-]*)/.exec(e);if(i&&i[1])for(;o;){if(o.tagName==i[2]){o=o.prev;break}if(!l.implicitlyClosed.hasOwnProperty(v(o.tagName)))break;o=o.prev}else if(i)for(;o;){var a=l.contextGrabbers[v(o.tagName)];if(!a||!a.hasOwnProperty(v(i[2])))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==k&&(t.state=O)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})},642:(t,e,n)=>{n.d(e,{Z:()=>a});var r,o=n(346),i=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const a=function(t){function e(e,n,r){var o=t.call(this,n,r)||this;return o._module=e,o}return i(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(o.Hn)},675:(t,e,n)=>{n.d(e,{Z:()=>l,q:()=>o});var r,o,i=n(642),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t.Select="select",t.Hover="hover",t.Spacing="spacing",t.Target="target",t.Resize="resize"}(o||(o={}));var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.defaults=function(){return{id:"",type:""}},Object.defineProperty(e.prototype,"type",{get:function(){return this.get("type")||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){var t;return this.get("component")||(null===(t=this.get("componentView"))||void 0===t?void 0:t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"componentView",{get:function(){var t;return this.get("componentView")||(null===(t=this.get("component"))||void 0===t?void 0:t.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"el",{get:function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(t){var e=this.el,n=this.em.Canvas.getCanvasView(),r=this.get("boxRect");return r||(e&&n?n.getElBoxRect(e,t):{x:0,y:0,width:0,height:0})},e.prototype.getStyle=function(t){void 0===t&&(t={});var e=t.boxRect||this.getBoxRect(t),n=e.width,r=e.height,o=e.x,i=e.y;return{width:"".concat(n,"px"),height:"".concat(r,"px"),top:"0",left:"0",position:"absolute",translate:"".concat(o,"px ").concat(i,"px")}},e.prototype.isType=function(t){return this.type===t},e}(i.Z);const l=s},713:(t,e,n)=>{var r;n.d(e,{Z:()=>o}),function(t){t.run="command:run",t._run="run",t.runCommand="command:run:",t._runCommand="run:",t.runBeforeCommand="command:run:before:",t.abort="command:abort:",t._abort="abort:",t.stop="command:stop",t._stop="stop",t.stopCommand="command:stop:",t._stopCommand="stop:",t.stopBeforeCommand="command:stop:before:"}(r||(r={}));const o=r},858:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){t.Components.clear(),t.Css.clear()}}},884:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var r=n(50),o=n(668),i=n(491);const a={run:function(t){(0,r.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){" "===(0,i.sN)(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.Z({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger("canvas:move:start",e)},onDrag:function(t,e){r.trigger("canvas:move",e)},onEnd:function(t,e){r.trigger("canvas:move:end",e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?"add":"remove",r=t?"on":"off",o={on:i.on,off:i.S1},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)}}},790:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l,defineCommand:()=>s});var r,o=n(346),i=n(713),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function s(t){return t}const l=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var r=n.config.stylePrefix;return n.pfx=r,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(r,"hover"),n.badgeClass="".concat(r,"badge"),n.plhClass="".concat(r,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return a(e,t),e.prototype.onFrameScroll=function(t){},e.prototype.getCanvas=function(){return this.canvas.getElement()},e.prototype.getCanvasBody=function(){return this.canvas.getBody()},e.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},e.prototype.init=function(t){},e.prototype.callRun=function(t,e){void 0===e&&(e={});var n=this.id;if(t.trigger("".concat(i.Z.runBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._runCommand).concat(n,":before"),e),e.abort)return t.trigger("".concat(i.Z.abort).concat(n),{options:e}),void t.trigger("".concat(i.Z._abort).concat(n),e);var r=e.sender||t,o=this.run(t,r,e),a={id:n,result:o,options:e};return t.trigger("".concat(i.Z.runCommand).concat(n),a),t.trigger(i.Z.run,a),t.trigger("".concat(i.Z._runCommand).concat(n),o,e),t.trigger(i.Z._run,n,o,e),o},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,r=e.sender||t;t.trigger("".concat(i.Z.stopBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._stopCommand).concat(n,":before"),e);var o=this.stop(t,r,e),a={id:n,result:o,options:e};return t.trigger("".concat(i.Z.stopCommand).concat(n),a),t.trigger(i.Z.stop,a),t.trigger("".concat(i.Z._stopCommand).concat(n),o,e),t.trigger(i.Z._stop,n,o,e),o},e.prototype.stopCommand=function(t){this.em.Commands.stop(this.id,t)},e.prototype.run=function(t,e,n){},e.prototype.stop=function(t,e,n){},e}(o.Hn)},180:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o={run:function(t,e,n){var o=this;void 0===n&&(n={});var i=[],a=n.component||t.getSelectedAll();return a=(0,r.isArray)(a)?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],a,!0):[a],a.filter(Boolean).forEach((function(t){var e,n;if(!t.get("removable"))return o.em.logWarning("The element is not removable",{component:t});i.push(t),((null===(n=null===(e=t.delegate)||void 0===e?void 0:e.remove)||void 0===n?void 0:n.call(e,t))||t).remove()})),t.selectRemove(i),i}};const i=o},544:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});var r=n(50),o=n(668),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a="dmode";const s={run:function(t,e,n){var s=this;void 0===n&&(n={}),(0,r.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget");var l=n.target,c=n.event,u=n.mode,p=n.dragger,d=void 0===p?{}:p,f=l.getEl(),h=i({doc:f.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return s.guidesStatic},guidesTarget:function(){return s.guidesTarget}},d);this.setupGuides(),this.opts=n,this.editor=t,this.em=t.getModel(),this.target=l,this.isTran="translate"==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(h):(g=new o.Z(h),this.dragger=g),c&&g.start(c),this.toggleDrag(1),this.em.trigger("".concat(a,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this,o=n.editor,i=n.em,a=n.opts,s=o.getConfig().stylePrefix,l=document.createElement("div"),c=document.createElement("div"),u='<div class="'.concat(s,"guide-info__line ").concat(s,'danger-bg">\n <div class="').concat(s,"guide-info__content ").concat(s,'danger-color"></div>\n </div>');(e=document.createElement("div")).className="".concat(s,"guides"),l.className="".concat(s,"guide-info ").concat(s,"guide-info__x"),c.className="".concat(s,"guide-info ").concat(s,"guide-info__y"),l.innerHTML=u,c.innerHTML=u,e.appendChild(l),e.appendChild(c),o.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=l,this.elGuideInfoY=c,this.elGuideInfoContentX=l.querySelector(".".concat(s,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(s,"guide-info__content")),i.on("canvas:update frame:scroll",(0,r.debounce)((function(){var e;t.updateGuides(),a.debug&&(null===(e=t.guides)||void 0===e||e.forEach((function(e){return t.renderGuide(e)})))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),o=n.parentNode,i=void 0===o?{}:o;return(0,r.each)(i.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,o=this;(t||this.guides).forEach((function(t){var i=t.origin,a=e===i?n:o.getElementPos(i);e=i,n=a,(0,r.each)(o.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,o=e.height,i=e.left,a=e.width;switch(t.type){case"t":n.y=r;break;case"b":n.y=r+o;break;case"l":n.x=i;break;case"r":n.x=i+a;break;case"x":n.x=i+a/2;break;case"y":n.y=r+o/2}return n},renderGuide:function(t){void 0===t&&(t={});var e=t.guide||document.createElement("div"),n="px",r=t.active?2:1,o=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?"green":"red",";"),e.children.length||((o=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",e.appendChild(o)),t.y?(e.style.width="100%",e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height="100%",e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),o=r.top,a=r.height,s=r.left,l=r.width,c=[{type:"t",y:o},{type:"b",y:o+a},{type:"l",x:s},{type:"r",x:s+l},{type:"x",x:s+l/2},{type:"y",y:o+a/2}].map((function(o){return i(i({},o),{origin:t,originRect:r,guide:n.debug&&e.renderGuide(o)})}));return c.forEach((function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)})),c},getTranslate:function(t,e){void 0===e&&(e="x");var n=0;return(t||"").split(" ").forEach((function(t){var r=t.trim(),o="translate".concat(e.toUpperCase(),"(");0===r.indexOf(o)&&(n=parseFloat(r.replace(o,"")))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),o="".concat(r).concat(n,")"),i=(t||"").split(" ").map((function(t){return 0===t.trim().indexOf(r)&&(t=o),t})).join(" ");return i.indexOf(r)<0&&(i+=" ".concat(o)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,o=n.top,i=n.transform,a=0,s=0;return e?(a=this.getTranslate(i),s=this.getTranslate(i,"y")):(a=parseFloat(r||0),s=parseFloat(o||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,o=t.end,i=t.position,a=t.width,s=t.height,l=this,c=l.target,u=l.isTran,p=l.em,d=!o,f="".concat(parseInt(e,10)).concat("px"),h="".concat(parseInt(n,10)).concat("px"),g={};if(u){var v=c.getStyle().transform||"";v=this.setTranslate(v,"x",f),g={transform:v=this.setTranslate(v,"y",h),__p:d},c.addStyle(g,{avoidStore:!o})}else{var m={position:i,width:a,height:s},y={left:f,top:h,__p:d};(0,r.keys)(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,c.addStyle(g,{avoidStore:!o})}null==p||p.Styles.__emitCmpStyleUpdate(g,{components:p.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this,n=e.target,r=e.editor,o=e.isTran,i=e.opts,a=i.center,s=i.onStart,l=r.Canvas,c=n.getStyle(),u="absolute",p=[u,"relative"];if(s&&s(this._getDragData()),!o&&c.position!==u){var d=l.offset(n.getEl()),f=d.left,h=d.top,g=d.width,v=d.height,m=n.parent(),y=void 0;do{var b=m.getStyle();y=p.indexOf(b.position)>=0?m:null,m=m.parent()}while(m&&!y);if(a){var w=l.getMouseRelativeCanvas(t);f=w.x,h=w.y}else if(y){var x=l.offset(y.getEl());f-=x.left,h-=x.top}this.setPosition({x:f,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:u})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e,n){void 0===n&&(n={});var r=this,o=r.editor,s=r.opts,l=r.id,c=s.onEnd;c&&c(t,n,i(i({event:t},n),this._getDragData())),o.stopCommand(l),this.hideGuidesInfo(),this.em.trigger("".concat(a,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;["X","Y"].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display="none")}))},renderGuideInfo:function(t){var e=this;void 0===t&&(t=[]);var n=this.guidesStatic;this.hideGuidesInfo(),t.forEach((function(t){var o=t.origin,s=t.x,l=e.getElementPos(o),c=(0,r.isUndefined)(s)?"y":"x",u="y"===c,p=l[u?"left":"top"],d=l.rect[u?"left":"top"],f=u?p+l.width:p+l.height,h=u?d+l.rect.width:d+l.rect.height,g=e["elGuideInfo".concat(c.toUpperCase())],v=e["elGuideInfoContent".concat(c.toUpperCase())],m=g.style,y=null==n?void 0:n.filter((function(e){return e.type===t.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,o=e.top,i=e.height,a=u?n+r:o+i;return{gap:a<p?p-a:(u?n:o)-f,guide:t}})).filter((function(t){return t.gap>0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,x=b.width,_=b.top,C=b.height,S=b.rect,O=u?w<l.left:_<l.top,E=u?w:_,k=u?S.left:S.top,T=u?w+x:_+C,A=u?S.left+S.width:S.top+S.height,P=u?t.y:t.x,j=O?T:f,M="".concat(P,"px"),N=O?p-T:E-f,R=O?d-A:k-h;m.display="",m[u?"top":"left"]=M,m[u?"left":"top"]="".concat(j,"px"),m[u?"width":"height"]="".concat(N,"px"),v.innerHTML="".concat(Math.round(R),"px"),e.em.trigger("".concat(a,":active"),i(i({},e.getEventOpts()),{guide:t,guidesStatic:n,matched:y,posFirst:P,posSecond:j,size:N,sizeRaw:R,elGuideInfo:g,elGuideInfoCnt:v}))}}))},toggleDrag:function(t){var e=this.ppfx,n=this.editor,r=t?"add":"remove",o=["".concat(e,"is__grabbing")],i=n.Canvas,a=i.getBody();o.forEach((function(t){return a.classList[r](t)})),i[t?"startAutoscroll":"stopAutoscroll"]()}}},236:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),r=n&&n.filter((function(t){return t.get("selectable")}))[0];r&&e.push(r)})),e.length&&t.select(e)}}}},368:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get("selectable");)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},243:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=n.components().length,i=0,a=0;do{i++,r=(a=t.index()+i)<=o?n.getChildAt(a):null}while(r&&!r.get("selectable"));e.push(r||t)}})),e.length&&t.select(e)}}}},400:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=0,i=0;do{o++,r=(i=t.index()-o)>=0?n.getChildAt(i):null}while(r&&!r.get("selectable"));e.push(r||t)}})),e.length&&t.select(e)}}}},910:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={run:function(t,e,n){void 0===n&&(n={});var o=n.target,i=[];if(!o.get("styles"))return i;var a=o.get("type"),s=t.Pages.getAllWrappers();if(!(0,r.flatten)(s.map((function(t){return t.findType(a)}))).length){var l=t.CssComposer.getAll();i=l.filter((function(t){return t.get("group")==="cmp:".concat(a)})),l.remove(i)}return i}}},744:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.getModel(),n=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],t.getSelectedAll(),!0).map((function(t){var e,n;return(null===(n=null===(e=t.delegate)||void 0===e?void 0:e.copy)||void 0===n?void 0:n.call(e,t))||t})).filter(Boolean);n.length&&e.set("clipboard",n)}}},457:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(491);const o={run:function(t,e,n){var o=this;void 0===n&&(n={}),e&&e.set&&e.set("active",0);var i=t.getConfig(),a=t.Modal,s=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.editors){var l=this.buildEditor("htmlmixed","hopscotch","HTML"),c=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=l.model,this.cssEditor=c.model;var u=(0,r.ut)("div",{class:"".concat(s,"export-dl")});u.appendChild(l.el),u.appendChild(c.el),this.editors=u}a.open({title:i.textViewCode,content:this.editors}).getModel().once("change:open",(function(){return t.stopCommand("".concat(o.id))})),this.htmlEditor.setContent(t.getHtml(n.optsHtml)),this.cssEditor.setContent(t.getCss(n.optsCss))},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=this.em.CodeManager,o=r.createViewer({label:n,codeName:t,theme:e});return{model:o,el:new r.EditorView({model:o,config:r.getConfig()}).render().el}}}},975:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={isEnabled:function(){var t=document;return!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement)},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||"","fullscreenchange"),this.fsChanged))},run:function(t,e,n){void 0===n&&(n={}),this.sender=e;var o=n.target,i=(0,r.isElement)(o)?o:document.querySelector(o),a=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+"fullscreenchange",this.fsChanged)},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable()}}},191:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var r=n(50),o=n(895),i=n(491),a=n(407),s=n(189);const l=(0,r.extend)({},s.default,a.default,{init:function(t){a.default.init.apply(this,arguments),(0,r.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a.default.enable.apply(this,t),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var n=this.$wrapper;n.css("cursor","move"),n.on("mousedown",this.initSorter),n.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(t){var e=(0,o.default)(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),(0,i.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(t){var e=t.get("draggable");if(e){this.cacheEl=null;var n=t.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(t){this.cacheEl=null;var e=t[t.length-1],n=this.em.getCurrentFrame(),r=e.getEl(null==n?void 0:n.model),o=r.ownerDocument;this.startSelectPosition(r,o,{onStart:this.onStart}),this.sorter.draggable=e.get("draggable"),this.sorter.toMove=t,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){(0,i.S1)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),(0,i.S1)(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=(0,o.default)(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=(0,o.default)(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a.default.stop.apply(this,t),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass),this.$wrapper.css("cursor","").unbind().removeClass(this.noSelClass)}})},912:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o=n(491);const i={open:function(t){var e=this,n=this,o=n.editor,i=n.title,a=n.config,s=n.am,l=a.custom;if((0,r.isFunction)(l.open))return l.open(s.__customData());o.Modal.open({title:i,content:t}).onceClose((function(){return o.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e,n){void 0===n&&(n={});var r=t.AssetManager,i=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t("assetManager.modalTitle")||"",this.editor=t,this.config=i,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:s,options:n}),i.custom)this.rendered=this.rendered||(0,o.ut)("div"),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get("type"))}))),r.render(u),this.rendered=r.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute("accept",l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},117:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o=n(491);const i={open:function(){var t=this,e=t.container,n=t.editor,o=t.bm,i=t.config,a=i.custom,s=i.appendTo;if((0,r.isFunction)(a.open))return a.open(o.__customData());if(this.firstRender&&!s){var l="views-container",c=n.Panels;(c.getPanel(l)||c.addPanel({id:l})).set("appendContent",e).trigger("change:appendContent"),a||e.appendChild(o.render())}e&&(e.style.display="block")},close:function(){var t=this.container,e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display="none")},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,o.ut)("div"),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},614:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var o="views-container",i=document.createElement("div"),a=n.getPanel(o)||n.addPanel({id:o});r.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),a.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"}},stop:function(){var t=this.layers;t&&(t.style.display="none")}}},801:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={run:function(t,e){if(this.sender=e,!this.$cnt){var n=t.getConfig(),o=t.Panels,i=t.DeviceManager,a=t.SelectorManager,s=t.StyleManager,l="change:appendContent",c=(0,r.default)("<div></div>"),u=(0,r.default)("<div></div>"),p=(0,r.default)("<div></div>"),d=(0,r.default)("<div></div>");if(this.$cnt=c,this.$cntInner=u,u.append(p),u.append(d),c.append(u),i&&n.showDevices){var f=o.addPanel({id:"devices-c"}),h=i.render();f.set("appendContent",h).trigger(l)}var g=a.getConfig();g.custom?a.__trgCustom({container:p.get(0)}):g.appendTo||p.append(a.render([])),this.sm=s;var v=s.getConfig(),m=v.stylePrefix;this.$header=(0,r.default)('<div class="'.concat(m,'header">').concat(t.t("styleManager.empty"),"</div>")),c.append(this.$header),v.custom?s.__trgCustom({container:d.get(0)}):v.appendTo||d.append(s.render());var y="views-container";(o.getPanel(y)||o.addPanel({id:y})).set("appendContent",c).trigger(l);var b=t.getModel();this.listenTo(b,s.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this,e=t.sender,n=t.sm,r=t.$cntInner,o=t.$header;e&&e.get&&!e.get("active")||!n||(n.getSelected()?(null==r||r.show(),null==o||o.hide()):(null==r||r.hide(),null==o||o.show()))},stop:function(){var t,e;null===(t=this.$cntInner)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},395:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={run:function(t,e){this.sender=e;var n,o=t.getModel(),i=t.Config.stylePrefix,a=t.TraitManager,s=a.getConfig();if(!s.appendTo){if(!this.$cn){this.$cn=(0,r.default)("<div></div>"),this.$cn2=(0,r.default)("<div></div>"),this.$cn.append(this.$cn2),this.$header=(0,r.default)("<div>").append('<div class="'.concat(s.stylePrefix,'header">').concat(o.t("traitManager.empty"),"</div>")),this.$cn.append(this.$header),s.custom?a.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append('<div class="'.concat(i,'traits-label">').concat(o.t("traitManager.label"),"</div>")),this.$cn2.append(a.render()));var l=t.Panels;null==(n=l.getPanel("views-container")?l.getPanel("views-container"):l.addPanel({id:"views-container"}))||n.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=t.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get("active")||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},98:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(50);const o={run:function(t,e,n){void 0===n&&(n={});var o=t.getModel(),a=o.get("clipboard"),s=t.getSelected();(null==a?void 0:a.length)&&s&&(t.getSelectedAll().forEach((function(e){var s,l,c,u,p=(null===(l=null===(s=e.delegate)||void 0===s?void 0:s.copy)||void 0===l?void 0:l.call(s,e))||e,d=p.collection;if(d){var f={at:p.index()+1,action:n.action||"paste-component"};u=(0,r.contains)(a,p)&&p.get("copyable")?d.add(p.clone(),f):i(t,a,p.parent(),f)}else{var h=null===(c=o.Pages.getSelected())||void 0===c?void 0:c.getMainComponent();f={at:(null==h?void 0:h.components().length)||0,action:n.action||"paste-component"};u=i(t,a,h,f)}(u=(0,r.isArray)(u)?u:[u]).forEach((function(e){return t.trigger("component:paste",e)}))})),s.emitUpdate())}};function i(t,e,n,r){var o=e.filter((function(t){return t.get("copyable")})).filter((function(e){return t.Components.canMove(n,e).result}));return n.components().add(o.map((function(t){return t.clone()})),r)}},129:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o="core:component-outline";const i={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?"on":"off";if(e){var o=e.Canvas,i=o.getBody(),a=o.getToolbarEl();a&&(a.style.display=t?"none":"");var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,r.each)(s,(function(e){return e.style.pointerEvents=t?"all":""})),e[n]("run:tlb-move:before",this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],t.getSelectedAll(),!0),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(o)),this.shouldRunSwVisibility&&t.stopCommand(o),t.getModel().stopDefault();var r=this.getPanels(t),i=t.Canvas.getElement(),a=t.getEl(),s=t.Config.stylePrefix;if(!this.helper){var l=document.createElement("span");l.className="".concat(s,"off-prv fa fa-eye-slash"),a.appendChild(l),l.onclick=function(){return n.stopCommand()},this.helper=l}this.helper.style.display="inline-block",r.forEach((function(t){return t.set("visible",!1)}));var c=i.style;c.width="100%",c.height="100%",c.top="0",c.left="0",c.padding="0",c.margin="0",t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set("active",0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(o),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set("visible",!0)})),t.Canvas.getElement().setAttribute("style",""),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display="none"),t.refresh(),this.tglEffects()}}},116:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};const o={run:function(t,e,n){var o=n||{},i=t.Canvas,a=i.getCanvasView(),s=r({appendTo:i.getResizerEl(),prefix:t.getConfig().stylePrefix,posFetcher:a.getElementPos.bind(a),mousePosFetcher:i.getMouseRelativePos.bind(i)},o.options||{}),l=this.canvasResizer;return l&&!o.forceNew||(this.canvasResizer=new t.Utils.Resizer(s),l=this.canvasResizer),l.setOptions(s,!0),l.blur(),l.focus(o.el),l},stop:function(){var t;null===(t=this.canvasResizer)||void 0===t||t.blur()}}},407:(t,e,n)=>{n.r(e),n.d(e,{default:()=>S});var r,o=n(50),i=n(346),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.defaults=function(){return{command:"",attributes:{}}},e}(i.Hn);var l=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(i.FE);const u=c;c.prototype.model=s;var p=n(330),d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},f.apply(this,arguments)},h=function(t){function e(e){var n=t.call(this,e)||this;return n.em=e.config.em,n}return d(e,t),e.prototype.events=function(){return this.model.get("events")||{mousedown:"handleClick"}},e.prototype.attributes=function(){return this.model.get("attributes")},e.prototype.handleClick=function(t){t.preventDefault(),t.stopPropagation();var e=this.em,n=e.Canvas.getFrameEl().getBoundingClientRect(),r=n.left,o=n.top,i=f(f({},t),{clientX:t.clientX-r,clientY:t.clientY-o});e.trigger("toolbar:run:before",{event:i}),this.execCommand(i)},e.prototype.execCommand=function(t){var e=this.em,n={event:t},r=this.model.get("command"),i=e.Editor;(0,o.isFunction)(r)&&r(i,null,n),(0,o.isString)(r)&&i.runCommand(r,n)},e.prototype.render=function(){var t=this,e=t.em,n=t.$el,r=t.model,o=r.get("id"),i=r.get("label"),a=e.getConfig().stylePrefix;return n.addClass("".concat(a,"toolbar-item")),o&&n.addClass("".concat(a,"toolbar-item__").concat(o)),i&&n.append(i),this},e}(i.G7);const g=h;var v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),m=function(t){function e(e){var n=t.call(this,e)||this,r=e.em;return n.em=r,n.config={em:r},n.listenTo(n.collection,"reset",n.render),n}return v(e,t),e.prototype.onRender=function(){var t=this.em.config.stylePrefix;this.el.className="".concat(t,"toolbar-items")},e}(p.Z);const y=m;m.prototype.itemView=g;var b,w=n(491),x=n(163),_=n(675),C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},C.apply(this,arguments)};const S={activeResizer:!1,init:function(){this.onSelect=(0,o.debounce)(this.onSelect,0),(0,o.bindAll)(this,"onHover","onOut","onClick","onFrameScroll","onFrameResize","onFrameUpdated","onContainerChange")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),b=!0},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this,n=this.em,r=n.getConfig().listenToEl,o=n.getContainer().parentNode,i=t?"on":"off",a={on:w.on,off:w.S1};!r.length&&o&&r.push(o);a[i](window,"resize",this.onFrameUpdated),a[i](r,"scroll",this.onContainerChange),n[i]("component:toggled component:update undo redo",this.onSelect,this),n[i]("change:componentHovered",this.onHovered,this),n[i]("component:resize styleable:change component:input",this.updateGlobalPos,this),n[i]("component:update:toolbar",this._upToolbar,this),n[i]("frame:updated",this.onFrameUpdated,this),n[i]("canvas:updateTools",this.onFrameUpdated,this),n[i](n.Canvas.events.refresh,this.updateAttached,this),n.Canvas.getFrames().forEach((function(t){var n=t.view,r=null==n?void 0:n.getWindow();r&&function(t,n){a[i](n,"mouseover",e.onHover),a[i](n,"mouseleave",e.onOut),a[i](n,"click",e.onClick),a[i](t,"scroll",e.onFrameScroll,!0),a[i](t,"resize",e.onFrameResize)}(r,null==n?void 0:n.getBody())}))},onHover:function(t){t.stopPropagation();var e=this.em,n=t.target,r=(0,x.getComponentView)(n),o=null==r?void 0:r.frameView,i=null==r?void 0:r.model;if(!i)for(var a=n.parentNode;!i&&a&&!(0,w.Mx)(a);)i=(0,x.getComponentModel)(a),a=a.parentNode;this.currentDoc=n.ownerDocument,e.setHovered(i,{useValid:!0}),o&&e.setCurrentFrame(o)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(t,e){var n,r=this,o={};e?null===(n=e.views)||void 0===n||n.forEach((function(t){var n=t.el,i=r.getElementPos(n);o={el:n,pos:i,component:e,view:(0,x.getViewEl)(n)},n.ownerDocument===r.currentDoc&&(r.elHovered=o),r.updateToolsLocal(o)})):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach((function(t){var e=t.view,n=e&&e.getToolsEl();n&&r.toggleToolsEl(0,0,{el:n})})))},onSelect:function(){var t=this.em,e=t.getSelected(),n=t.getCurrentFrame(),r=e&&e.getView(null==n?void 0:n.model),o=r&&r.el,i={};o&&(0,w.pn)(o)&&(i={el:o,pos:this.getElementPos(o),component:e,view:(0,x.getViewEl)(o)});this.elSelected=i,this.updateToolsGlobal(),this.updateLocalPos(i),this.initResize(e)},updateGlobalPos:function(){var t=this.getElSelected();t.el&&(t.pos=this.getElementPos(t.el),this.updateToolsGlobal())},updateLocalPos:function(t){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal(t))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered()},toggleToolsEl:function(t,e,n){void 0===n&&(n={});var r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?"":"none"),r||{}},showElementOffset:function(t,e,n){void 0===n&&(n={}),b&&this.editor.runCommand("show-offset",{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand("show-offset",{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand("show-offset",{el:t,elPos:e,state:"Fixed"})},hideFixedElementOffset:function(){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get("_cmpDrag"))return e.set("_cmpDrag");var n=t.target,r=(0,x.getComponentModel)(n);if(!r)for(var o=n.parentNode;!r&&o&&!(0,w.Mx)(o);)r=(0,x.getComponentModel)(o),o=o.parentNode;if(r){if(e.isEditing()&&!r.get("textable")&&r.isChildOf("text"))return;this.select(r,t)}},select:function(t,e){void 0===e&&(e={}),t&&(this.editor.select(t,{event:e,useValid:!0}),this.initResize(t))},updateBadge:function(t,e,n){void 0===n&&(n={});var r=this.canvas,o=(0,x.getComponentModel)(t),i=this.getBadge(n),a=i.style;if(o&&o.get("badgable")){if(!n.posOnly){var s=this.canvas.getConfig(),l=o.getIcon(),c=s.pStylePrefix||"",u="".concat(c,"badge"),p=s.customBadgeLabel,d="".concat(l?'<div class="'.concat(u,'__icon">').concat(l,"</div>"):"",'\n <div class="').concat(u,'__name">').concat(o.getName(),"</div>");i.innerHTML=p?p(o):d}a.display="block";var f=r.getTargetToElementFixed(t,i,{pos:e}).top,h=n.leftOff<0?-n.leftOff:0;a.top=f+"px",a.left=h+"px"}else a.display="none"},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=""},initResize:function(t){var e=this.em,n=this.canvas,r=e.Editor,i=!(0,o.isElement)(t)&&(0,w.o5)(t)?t:e.getSelected(),a=null==i?void 0:i.get("resizable"),s=_.q.Resize,l=n.hasCustomSpot(s);if(n.removeSpots({type:s}),i&&a){n.addSpot({type:s,component:i});var c,u=(0,o.isElement)(t)?t:i.getEl(),p=(0,x.isObject)(a)?a:{},d=p.onStart,f=void 0===d?function(){}:d,h=p.onMove,g=void 0===h?function(){}:h,v=p.onEnd,m=void 0===v?function(){}:v,y=p.updateTarget,S=void 0===y?function(){}:y,O=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(p,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var E=e.config.stylePrefix||"",k="".concat(E,"resizing"),T=this,A={component:i,el:u},P=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||"";n.className=("add"==t?"".concat(r," ").concat(k):r.replace(k,"")).trim()}))},j=C({onStart:function(t,o){f(t,o);var a=o.el,s=o.config,l=o.resizer,u=s.keyHeight,p=s.keyWidth,d=s.currentUnit,h=s.keepAutoHeight,g=s.keepAutoWidth;P("add",0,o),c=e.Styles.getModelToStyle(i),n.toggleFramesEvents(!1);var v=getComputedStyle(a),m=c.getStyle(),y=m[p];s.autoWidth=g&&"auto"===y,isNaN(parseFloat(y))&&(y=v[p]);var w=m[u];s.autoHeight=h&&"auto"===w,isNaN(parseFloat(w))&&(w=v[u]),l.startDim.w=parseFloat(y),l.startDim.h=parseFloat(w),b=!1,d&&(s.unitHeight=(0,x.getUnitFromValue)(w),s.unitWidth=(0,x.getUnitFromValue)(y)),T.activeResizer=!0,r.trigger("component:resize",C(C({},A),{type:"start"}))},onMove:function(t){g(t),r.trigger("component:resize",C(C({},A),{type:"move"}))},onEnd:function(t,e){m(t,e),P("remove",0,e),r.trigger("component:resize",C(C({},A),{type:"end"})),n.toggleFramesEvents(!0),b=!0,T.activeResizer=!1},updateTarget:function(t,r,o){if(S(t,r,o),c){var a=o.store,s=o.selectedHandler,l=o.config,u=l.keyHeight,p=l.keyWidth,d=l.autoHeight,f=l.autoWidth,h=l.unitWidth,g=l.unitHeight,v=["tc","bc"].indexOf(s)>=0,m=["cl","cr"].indexOf(s)>=0,y={};if(!v){var b=n.getBody().offsetWidth,w=r.w<b?r.w:b;y[p]=f?"auto":"".concat(w).concat(h)}m||(y[u]=d?"auto":"".concat(r.h).concat(g)),e.getDragMode(i)&&(y.top="".concat(r.t).concat(g),y.left="".concat(r.l).concat(h));var x=C(C({},y),{__p:!a});c.addStyle(x,{avoidStore:!a}),e.Styles.__emitCmpStyleUpdate(x,{components:e.getSelected()})}}},O);this.resizer=r.runCommand("resize",{el:u,options:j,force:1})}else{if(l)return;r.stopCommand("resize"),this.resizer=null}},updateToolbar:function(t){var e=this.canvas,n=this.config.em,r=t===n?n.getSelected():t,o=e.getToolbarEl(),i=o.style,a=r.get("toolbar"),s=n.config.showToolbar,l=!e.hasCustomSpot(_.q.Select);if(r&&s&&a&&a.length&&l){if(i.display="",!this.toolbar){o.innerHTML="",this.toolbar=new u(a);var c=new y({collection:this.toolbar,em:n});o.appendChild(c.render().el)}this.toolbar.reset(a),i.top="-100px",i.left="0"}else i.display="none"},updateToolbarPos:function(t){var e=this.canvas.getToolbarEl().style;e.top="".concat(t.top).concat("px"),e.left="".concat(t.left).concat("px"),e.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(t){return void 0===t&&(t={}),this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools(),this.canvas.refreshSpots()},onFrameResize:function(){this.canvas.refresh({all:!0})},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&"selected"===t.get("status")},updateToolsLocal:function(t){var e=this.em.getConfig(),n=t||this.getElHovered(),r=n.el,o=n.pos,i=n.view,a=n.component;if(r){var s=a.get("hoverable"),l=this.lastHovered!==r,c=l?{}:{posOnly:1},u=this.canvas.hasCustomSpot(_.q.Hover);l&&s&&(this.lastHovered=r,u?this.hideHighlighter(i):this.showHighlighter(i),this.showElementOffset(r,o,{view:i})),this.isCompSelected(a)&&(this.hideHighlighter(i),!e.showOffsetsSelected&&this.hideElementOffset(i));var p="px",d=this.toggleToolsEl(1,i),f=d.style,h=this.canvas.canvasRectOffset(r,o),g=h.top,v=h.left;!u&&this.updateBadge(r,o,C(C({},c),{view:i,topOff:g,leftOff:v})),f.top=g+p,f.left=v+p,f.width=o.width+p,f.height=o.height+p,this._trgToolUp("local",{component:a,el:d,top:g,left:v,width:o.width,height:o.height})}else this.lastHovered=0},_upToolbar:(0,o.debounce)((function(){this.updateToolsGlobal({force:1})}),0),_trgToolUp:function(t,e){void 0===e&&(e={}),this.em.trigger("canvas:tools:update",C({type:t},e))},updateToolsGlobal:function(t){void 0===t&&(t={});var e=this.getElSelected(),n=e.el,r=e.pos,o=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var i=this.canvas;(this.lastSelected!==n||t.force)&&(this.lastSelected=n,this.updateToolbar(o));var a="px",s=this.toggleToolsEl(1),l=s.style,c=i.getTargetToElementFixed(n,i.getToolbarEl(),{pos:r}),u=c.canvasOffsetTop,p=c.canvasOffsetLeft;l.top=u+a,l.left=p+a,l.width=r.width+a,l.height=r.height+a,this.updateToolbarPos({top:c.top,left:c.left}),this._trgToolUp("global",{component:o,el:s,top:u,left:p,width:r.width,height:r.height})},updateAttached:(0,o.debounce)((function(){this.updateGlobalPos()}),0),onContainerChange:(0,o.debounce)((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t,{noScroll:!0})},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(t){t&&t.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){(0,x.hasWin)()&&(this.editor=t&&t.get("Editor"),this.enable())},stop:function(t,e,n){if(void 0===n&&(n={}),(0,x.hasWin)()){var r=this.em,o=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(),this.toggleToolsEl(),o&&o.stopCommand("resize")}}}},189:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(895);const o={startSelectPosition:function(t,e,n){var r=this;void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,i=t.ownerDocument.body;o&&!this.sorter&&(this.sorter=new o.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return r.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),t&&this.sorter.startSort(t,{container:i})},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?(0,r.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,r.default)(this.cDim[this.posIndex][5]).parent():(0,r.default)(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,o=e||"before",i=n.length,a=0!==i&&"after"==o&&r==i;return 0!==i&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},804:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var r=n(50),o=n(675),i=n(895),a=n(491),s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},s.apply(this,arguments)};const l={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var l=this.canvas,c=n||{},u=c.state||"",p=t.getConfig(),d=this.em.getZoomDecimal(),f=c.el;if(p.showOffsets&&f&&!(0,a.BM)(f)&&(p.showOffsetsSelected||"Fixed"!=u)){if(!l.hasCustomSpot(o.q.Spacing)){var h=s({},c.elPos||l.getElementPos(f));(0,r.isUndefined)(c.top)||(h.top=c.top),(0,r.isUndefined)(c.left)||(h.left=c.left);var g=window.getComputedStyle(f),v=this.ppfx,m=u+"State",y=l[this.getOffsetMethod(u)](n.view);y.style.opacity="";var b=this["marginT"+u],w=this["marginB"+u],x=this["marginL"+u],_=this["marginR"+u],C=this["padT"+u],S=this["padB"+u],O=this["padL"+u],E=this["padR"+u];if(y.childNodes.length&&(this[m]="1",b=y.querySelector("[data-offset-m-t]"),w=y.querySelector("[data-offset-m-b]"),x=y.querySelector("[data-offset-m-l]"),_=y.querySelector("[data-offset-m-r]"),C=y.querySelector("[data-offset-p-t]"),S=y.querySelector("[data-offset-p-b]"),O=y.querySelector("[data-offset-p-l]"),E=y.querySelector("[data-offset-p-r]")),!this[m]){var k=u.toLowerCase(),T=k+"margin-v",A=k+"padding-v",P=(0,i.default)('<div class="'.concat(v,'marginName">')).get(0),j=(0,i.default)('<div class="'.concat(v,'paddingName">')).get(0),M=v+A+"-el",N="".concat(v+T+"-el"," ").concat(v+T),R="".concat(M," ").concat(v+A);b=(0,i.default)('<div class="'.concat(N,'-top"></div>')).get(0),w=(0,i.default)('<div class="'.concat(N,'-bottom"></div>')).get(0),x=(0,i.default)('<div class="'.concat(N,'-left"></div>')).get(0),_=(0,i.default)('<div class="'.concat(N,'-right"></div>')).get(0),C=(0,i.default)('<div class="'.concat(R,'-top"></div>')).get(0),S=(0,i.default)('<div class="'.concat(R,'-bottom"></div>')).get(0),O=(0,i.default)('<div class="'.concat(R,'-left"></div>')).get(0),E=(0,i.default)('<div class="'.concat(R,'-right"></div>')).get(0),this["marginT"+u]=b,this["marginB"+u]=w,this["marginL"+u]=x,this["marginR"+u]=_,this["padT"+u]=C,this["padB"+u]=S,this["padL"+u]=O,this["padR"+u]=E,P.appendChild(b),P.appendChild(w),P.appendChild(x),P.appendChild(_),j.appendChild(C),j.appendChild(S),j.appendChild(O),j.appendChild(E),y.appendChild(P),y.appendChild(j),this[m]="1"}var L="px",I=parseFloat(g.marginLeft.replace(L,""))*d,D=parseFloat(g.marginRight.replace(L,""))*d,F=parseFloat(g.marginTop.replace(L,""))*d,V=parseFloat(g.marginBottom.replace(L,""))*d,B=b.style,z=w.style,H=x.style,$=_.style,W=C.style,U=S.style,q=O.style,G=E.style,K=parseFloat(h.left),Y=parseFloat(g.width)*d+L;B.height=F+L,B.width=Y,B.top=h.top-F+L,B.left=K+L,z.height=V+L,z.width=Y,z.top=h.top+h.height+L,z.left=K+L;var X=h.height+F+V+L,Z=h.top-F+L;H.height=X,H.width=I+L,H.top=Z,H.left=K-I+L,$.height=X,$.width=D+L,$.top=Z,$.left=K+h.width+L;var J=parseFloat(g.paddingTop)*d;W.height=J+L;var Q=parseFloat(g.paddingBottom)*d;U.height=Q+L;var tt=h.height-Q-J+L,et=h.top+J+L;q.height=tt,q.width=parseFloat(g.paddingLeft)*d+L,q.top=et;var nt=parseFloat(g.paddingRight)*d;G.height=tt,G.width=nt+L,G.top=et}}else t.stopCommand("".concat(this.id),n)},stop:function(t,e,n){void 0===n&&(n={});var r=(n||{}).state||"",o=this.getOffsetMethod(r),i=n.view;this.canvas[o](i).style.opacity=0}}},434:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(50),o=n(163);const i={init:function(){(0,r.bindAll)(this,"_onFramesChange")},run:function(t){this.toggleVis(t,!0)},stop:function(t){this.toggleVis(t,!1)},toggleVis:function(t,e){if(void 0===e&&(e=!0),!t.Commands.isActive("preview")){var n=t.Canvas,r=e?"on":"off";n.getModel()[r]("change:frames",this._onFramesChange),this.handleFrames(n.getFrames(),e)}},handleFrames:function(t,e){var n=this;t.forEach((function(t){var r;(null===(r=t.view)||void 0===r?void 0:r.loaded)&&n._upFrame(t,e),t.__ol||(t.on("loaded",(function(){return n._upFrame(t)})),t.__ol=!0)}))},_onFramesChange:function(t,e){this.handleFrames(e)},_upFrame:function(t,e){var n,r=this,i=r.ppfx,a=r.em,s=r.id,l=((0,o.isDef)(e)?e:a.Commands.isActive(s))?"add":"remove",c="".concat(i,"dashed");null===(n=t.view)||void 0===n||n.getBody().classList[l](c)}}},346:(t,e,n)=>{n.d(e,{FE:()=>u,G7:()=>p,Hn:()=>c,pH:()=>d,vA:()=>o});var r,o,i=n(316),a=n.n(i),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},l.apply(this,arguments)},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(a().Model),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(a().Collection),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(a().View);!function(t){t.Screen="screen",t.World="world"}(o||(o={}));var d={x:0,y:0};l(l({},d),{width:0,height:0})},330:(t,e,n)=>{n.d(e,{Z:()=>l});var r,o=n(50),i=n(346),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r){void 0===e&&(e={}),void 0===r&&(r=!1);var o=t.call(this,e)||this;return o.itemsView="",o.itemType="type",o.reuseView=!1,o.config=n||e.config||{},r&&o.listenTo(o.collection,"add",o.addTo),o.items=[],o}return a(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,r=e.em,o="".concat(n?"[".concat(n,"]: "):"","'").concat(t,"' type not found");r&&r.logWarning(o)},e.prototype.add=function(t,e){var n,r=this,i=r.config,a=r.reuseView,s=r.items,l=this.itemsView||{},c=e||null,u=this.itemView,p=t.get(this.itemType);l[p]?u=l[p]:!p||l[p]||(0,o.includes)(["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],p)||this.itemViewNotFound(p),n=t.view&&a?t.view:new u({model:t,config:i},i),s&&s.push(n);var d=n.render().el;c?c.appendChild(d):this.$el.append(d)},e.prototype.render=function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(e){void 0===e&&(e={});var n=this.items;return this.onRemoveBefore(n,e),this.clearItems(),t.prototype.remove.call(this),this.onRemove(n,e),this},e.prototype.clearItems=function(){this.items},e}(i.G7);const l=s;s.prototype.itemView=""},668:(t,e,n)=>{n.d(e,{Z:()=>l});var r=n(50),o=n(491),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=["x","y"],s=function(){function t(t){return void 0===t&&(t={}),this.opts={snapOffset:5,scale:1},(0,r.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(t),this.delta={x:0,y:0},this.lastScroll={x:0,y:0},this.lastScrollDiff={x:0,y:0},this.startPointer={x:0,y:0},this.startPosition={x:0,y:0},this.globScrollDiff={x:0,y:0},this.currentPointer={x:0,y:0},this.position={x:0,y:0},this.guidesStatic=[],this.guidesTarget=[],this.docs=[],this}return t.prototype.setOptions=function(t){void 0===t&&(t={}),this.opts=i(i({},this.opts),t)},t.prototype.toggleDrag=function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=t?"on":"off",a={on:o.on,off:o.S1};a[i](n,"mousemove dragover",this.drag),a[i](e,"mouseup dragend touchend",this.stop),a[i](e,"keydown",this.keyHandle),a[i](r,"scroll",this.handleScroll)},t.prototype.handleScroll=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},t.prototype.start=function(t){var e=this.opts,n=e.onStart;this.toggleDrag(!0),this.startPointer=this.getPointerPos(t),this.guidesStatic=(0,r.result)(e,"guidesStatic")||[],this.guidesTarget=(0,r.result)(e,"guidesTarget")||[],(0,r.isFunction)(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(t)},t.prototype.drag=function(t){var e=this,n=this,o=n.opts,s=n.lastScrollDiff,l=n.globScrollDiff,c=o.onDrag,u=this.startPointer,p=this.getPointerPos(t),d={x:l.x+s.x,y:l.y+s.y};this.globScrollDiff=d;var f={x:p.x-u.x+d.x,y:p.y-u.y+d.y};this.lastScrollDiff={x:0,y:0};var h=this.lockedAxis;"x"===(h=t.shiftKey?!h&&this.detectAxisLock(f.x,f.y):null)?f.x=u.x:"y"===h&&(f.y=u.y);var g=function(n){a.forEach((function(t){return n[t]=n[t]*(0,r.result)(o,"scale")})),e.delta=n,e.move(n.x,n.y),(0,r.isFunction)(c)&&c(t,e)},v=i({},f);if(this.currentPointer=p,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),g(f),this.guidesTarget.length){var m=this.snapGuides(v),y=m.newDelta,b=m.trgX,w=m.trgY;(b||w)&&g(y)}0===t.which&&this.stop(t)},t.prototype.snapGuides=function(t){var e=this,n=t,o=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=!1,e.guidesStatic.forEach((function(a){if(!(n.y&&a.x||n.x&&a.y)){var s=n.y&&a.y,l=s?"y":"x",c=n[l],u=a[l],p=t[l],d=s?i:o;if(e.isPointIn(c,u)&&(0,r.isUndefined)(d)){var f=p-(c-u);e.setGuideLock(n,f)}}})))})),o=this.trgX,i=this.trgY,a.forEach((function(o){var i=o.toUpperCase(),a=e["trg".concat(i)];a&&!e.isPointIn(t[o],a.lock)&&(e.setGuideLock(a,null),a=null),a&&!(0,r.isUndefined)(a.lock)&&(n[o]=a.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}},t.prototype.isPointIn=function(t,e,n){var r=(void 0===n?{}:n).offset||this.opts.snapOffset||0;return t>=e&&t<=e+r||t<=e&&t>=e-r},t.prototype.setGuideLock=function(t,e){var n=(0,r.isUndefined)(t.x)?"Y":"X",o="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[o]=t):(delete t.active,delete t.lock,delete this[o]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,o=!!e.cancel,i=o?0:n.x,a=o?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,a,!0);var s=this.opts.onEnd;(0,r.isFunction)(s)&&s(t,this,{cancelled:o})},t.prototype.keyHandle=function(t){(0,o.kl)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var o=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+t,c=a.y+e;this.position={x:l,y:c,end:n},(0,r.isFunction)(s)&&s(this.position),o&&(o.style.left="".concat(l,"px"),o.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,o.VB)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,r.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=t,r=e,o=Math.abs(n),i=Math.abs(r);return r>=o||r<=-o?"x":n>i||n<-i?"y":void 0},t}();const l=s},895:(t,e,n)=>{n.r(e),n.d(e,{default:()=>gt});var r="undefined"!=typeof document?document:null,o="undefined"!=typeof window?window:null,i=Array.prototype,a=i.filter,s=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,d=i.splice,f=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(T(t)){if(e.__cash&&(e=e[0]),!(n=f.test(t)?e.getElementById(t.slice(1)):g.test(t)?dt(t):m(t,e)))return}else if(k(t))return this.ready(t);(n.nodeType||n===o)&&(n=[n]),this.length=n.length;for(var i=0,a=this.length;i<a;i++)this[i]=n[i]}}function b(t,e){return new y(t,e)}var w=b.fn=b.prototype=y.prototype={constructor:b,__cash:!0,length:0,splice:d};w.get=function(t){return void 0===t?p.call(this):this[t<0?t+this.length:t]},w.eq=function(t){return b(this.get(t))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)},w.map=function(t){return b(l.call(this,(function(e,n){return t.call(e,n,e)})))},w.slice=function(){return b(p.apply(this,arguments))};var x=/(?:^\w|[A-Z]|\b\w)/g,_=/[\s-_]+/g;function C(t){return t.replace(x,(function(t,e){return t[e?"toUpperCase":"toLowerCase"]()})).replace(_,"")}function S(t,e){for(var n=0,r=t.length;n<r&&!1!==e.call(t[n],t[n],n,t);n++);}b.camelCase=C,b.each=S,w.each=function(t){return S(this,(function(e,n){return t.call(e,n,e)})),this},w.removeProp=function(t){return this.each((function(e,n){delete n[t]}))},b.extend=w.extend=function(t){void 0===t&&(t=this);for(var e=arguments,n=e.length,r=n<2?0:1;r<n;r++)for(var o in e[r])t[o]=e[r][o];return t};var O=1;function E(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function k(t){return"function"==typeof t}function T(t){return"string"==typeof t}function A(t){return!isNaN(parseFloat(t))&&isFinite(t)}b.guid=O,b.matches=E,b.isFunction=k,b.isString=T,b.isNumeric=A;var P=Array.isArray;function j(t){return T(t)?function(e,n){return E(n,t)}:t.__cash?function(e,n){return t.is(n)}:function(t,e,n){return e===n}}b.isArray=P,w.prop=function(t,e){if(t){if(T(t))return arguments.length<2?this[0]&&this[0][t]:this.each((function(n,r){r[t]=e}));for(var n in t)this.prop(n,t[n]);return this}},w.filter=function(t){if(!t)return b();var e=k(t)?t:j(t);return b(a.call(this,(function(n,r){return e.call(n,r,n,t)})))};var M=/\S+/g;function N(t){return T(t)&&t.match(M)||[]}function R(t){return t.filter((function(t,e,n){return n.indexOf(t)===e}))}function L(t,e,n){if(1===t.nodeType){var r=o.getComputedStyle(t,null);return e?n?r.getPropertyValue(e):r[e]:r}}function I(t,e){return parseInt(L(t,e),10)||0}w.hasClass=function(t){var e=N(t),n=!1;return e.length&&this.each((function(t,r){return!(n=r.classList.contains(e[0]))})),n},w.removeAttr=function(t){var e=N(t);return e.length?this.each((function(t,n){S(e,(function(t){n.removeAttribute(t)}))})):this},w.attr=function(t,e){if(t){if(T(t)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(t);return null===n?void 0:n}return null===e?this.removeAttr(t):this.each((function(n,r){r.setAttribute(t,e)}))}for(var r in t)this.attr(r,t[r]);return this}},w.toggleClass=function(t,e){var n=N(t),r=void 0!==e;return n.length?this.each((function(t,o){S(n,(function(t){r?e?o.classList.add(t):o.classList.remove(t):o.classList.toggle(t)}))})):this},w.addClass=function(t){return this.toggleClass(t,!0)},w.removeClass=function(t){return arguments.length?this.toggleClass(t,!1):this.attr("class","")},b.unique=R,w.add=function(t,e){return b(R(this.get().concat(b(t,e).get())))};var D=/^--/;function F(t){return D.test(t)}var V={},B=r&&r.createElement("div"),z=B?B.style:{},H=["webkit","moz","ms","o"];function $(t,e){if(void 0===e&&(e=F(t)),e)return t;if(!V[t]){var n=C(t),r=""+n.charAt(0).toUpperCase()+n.slice(1);S((n+" "+H.join(r+" ")+r).split(" "),(function(e){if(e in z)return V[t]=e,!1}))}return V[t]}b.prefixedProp=$;var W={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function U(t,e,n){return void 0===n&&(n=F(t)),n||W[t]||!A(e)?e:e+"px"}w.css=function(t,e){if(T(t)){var n=F(t);return t=$(t,n),arguments.length<2?this[0]&&L(this[0],t,n):t?(e=U(t,e,n),this.each((function(r,o){1===o.nodeType&&(n?o.style.setProperty(t,e):o.style[t]=e)}))):this}for(var r in t)this.css(r,t[r]);return this};var q="__cashData",G=/^data-(.*)/;function K(t){return t[q]=t[q]||{}}function Y(t,e){var n=K(t);if(e){if(!(e in n)){var r=t.dataset?t.dataset[e]||t.dataset[C(e)]:b(t).attr("data-"+e);if(void 0!==r){try{r=JSON.parse(r)}catch(t){}n[e]=r}}return n[e]}return n}function X(t,e){return I(t,"border"+(e?"Left":"Top")+"Width")+I(t,"padding"+(e?"Left":"Top"))+I(t,"padding"+(e?"Right":"Bottom"))+I(t,"border"+(e?"Right":"Bottom")+"Width")}function Z(t,e){for(var n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])<0)return!1;return!0}function J(t,e,n){S(t[n],(function(t){t[0];var r=t[1];e.removeEventListener(n,r)})),delete t[n]}b.hasData=function(t){return q in t},w.data=function(t,e){var n=this;if(!t){if(!this[0])return;return S(this[0].attributes,(function(t){var e=t.name.match(G);e&&n.data(e[1])})),Y(this[0])}if(T(t))return void 0===e?this[0]&&Y(this[0],t):this.each((function(n,r){return function(t,e,n){K(t)[e]=n}(r,t,e)}));for(var r in t)this.data(r,t[r]);return this},w.removeData=function(t){return this.each((function(e,n){return function(t,e){void 0===e?delete t[q]:delete K(t)[e]}(n,t)}))},S(["Width","Height"],(function(t){w["inner"+t]=function(){if(this[0])return this[0]===o?o["inner"+t]:this[0]["client"+t]}})),S(["width","height"],(function(t,e){w[t]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each((function(r,o){if(1===o.nodeType){var i=L(o,"boxSizing");o.style[t]=U(t,n+("border-box"===i?X(o,!e):0))}}))):this[0]===o?this[0][C("outer-"+t)]:this[0].getBoundingClientRect()[t]-X(this[0],!e):void 0===n?void 0:this}})),S(["Width","Height"],(function(t,e){w["outer"+t]=function(n){if(this[0])return this[0]===o?o["outer"+t]:this[0]["offset"+t]+(n?I(this[0],"margin"+(e?"Top":"Left"))+I(this[0],"margin"+(e?"Bottom":"Right")):0)}}));var Q="__cashEvents";function tt(t){return t[Q]=t[Q]||{}}function et(t){var e=t.split(".");return[e[0],e.slice(1).sort()]}function nt(t,e,n,r){var o=tt(t);if(e){var i=o[e];if(!i)return;r&&(r.guid=r.guid||O++),o[e]=i.filter((function(o){var i=o[0],a=o[1];if(r&&a.guid!==r.guid||!Z(i,n))return!0;t.removeEventListener(e,a)}))}else if(n&&n.length)for(e in o)nt(t,e,n,r);else for(e in o)J(o,t,e)}w.off=function(t,e){var n=this;return void 0===t?this.each((function(t,e){return nt(e)})):S(N(t),(function(t){var r=et(t),o=r[0],i=r[1];n.each((function(t,n){return nt(n,o,i,e)}))})),this},w.on=function(t,e,n,r){var o=this;if(!T(t)){for(var i in t)this.on(i,e,t[i]);return this}return k(e)&&(n=e,e=!1),S(N(t),(function(t){var i=et(t),a=i[0],s=i[1];o.each((function(t,o){var i=function t(i){if(!i.namespace||Z(s,i.namespace.split("."))){var l=o;if(e){for(var c=i.target;!E(c,e);){if(c===o)return;if(!(c=c.parentNode))return}l=c}i.namespace=i.namespace||"";var u=n.call(l,i,i.data);r&&nt(o,a,s,t),!1===u&&(i.preventDefault(),i.stopPropagation())}};i.guid=n.guid=n.guid||O++,function(t,e,n,r){r.guid=r.guid||O++;var o=tt(t);o[e]=o[e]||[],o[e].push([n,r]),t.addEventListener(e,r)}(o,a,s,i)}))})),this},w.one=function(t,e,n){return this.on(t,e,n,!0)},w.ready=function(t){var e=function(){return t(b)};return"loading"!==r.readyState?setTimeout(e):r.addEventListener("DOMContentLoaded",e),this},w.trigger=function(t,e){var n=t;if(T(t)){var o=et(t),i=o[0],a=o[1];(n=r.createEvent("HTMLEvents")).initEvent(i,!0,!0),n.namespace=a.join(".")}return n.data=e,this.each((function(t,e){e.dispatchEvent(n)}))};var rt=/select-one/i,ot=/select-multiple/i;function it(t){var e=t.type;return rt.test(e)?function(t){return t.selectedIndex<0?null:t.options[t.selectedIndex].value}(t):ot.test(e)?function(t){var e=[];return S(t.options,(function(t){!t.selected||t.disabled||t.parentNode.disabled||e.push(t.value)})),e}(t):t.value}var at=/%20/g;var st=/file|reset|submit|button|image/i,lt=/radio|checkbox/i;w.serialize=function(){var t="";return this.each((function(e,n){S(n.elements||[n],(function(e){if(!e.disabled&&e.name&&"FIELDSET"!==e.tagName&&!st.test(e.type)&&(!lt.test(e.type)||e.checked)){var n=it(e);if(void 0!==n)S(P(n)?n:[n],(function(n){t+=function(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(at,"+")}(e.name,n)}))}}))})),t.substr(1)},w.val=function(t){return void 0===t?this[0]&&it(this[0]):this.each((function(e,n){var r=ot.test(n.type),o=null===t?r?[]:"":t;r&&P(o)?S(n.options,(function(t){t.selected=o.indexOf(t.value)>=0})):n.value=o}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ct,ut=/^\s*<(\w+)[^>]*>/,pt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function dt(t){if(function(){if(!ct){var t=r.createElement("table"),e=r.createElement("tr");ct={"*":r.createElement("div"),tr:r.createElement("tbody"),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!T(t))return[];if(pt.test(t))return[r.createElement(RegExp.$1)];var e=ut.test(t)&&RegExp.$1,n=ct[e]||ct["*"];return n.innerHTML=t,b(n.childNodes).detach().get()}function ft(t,e,n){if(void 0!==e){var r=T(e);!r&&e.length?S(e,(function(e){return ft(t,e,n)})):S(t,r?function(t){t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=dt,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return S(arguments,(function(e){ft(t,e)})),this},w.appendTo=function(t){return ft(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n.nextSibling)}))})),this},w.after=function(){var t=this;return S(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n)}))})),this},w.before=function(){var t=this;return S(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return S(arguments,(function(e){ft(t,e,!0)})),this},w.prependTo=function(t){return ft(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var o=r.parentNode;if(o){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;o.replaceChild(i[0],r),b(i[0]).after(i.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:"":this.each((function(e,n){n.textContent=t}))};var ht=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+o.pageYOffset-ht.clientTop,left:e.left+o.pageXOffset-ht.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(R(e)),t?e.filter((function(e,n){return E(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&R(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n<r;n++){var o=m(t,this[n]);o.length&&c.apply(e,o)}return b(e.length&&R(e))},w.has=function(t){var e=T(t)?function(e,n){return!!m(t,n).length}:function(e,n){return n.contains(t)};return this.filter(e)},w.is=function(t){if(!t||!this[0])return!1;var e=j(t),n=!1;return this.each((function(r,o){return!(n=e(r,o,t))})),n},w.next=function(){return b(this[0]&&this[0].nextElementSibling)},w.not=function(t){if(!t||!this[0])return this;var e=j(t);return this.filter((function(n,r){return!e(n,r,t)}))},w.parent=function(){var t=[];return this.each((function(e,n){n&&n.parentNode&&t.push(n.parentNode)})),b(R(t))},w.index=function(t){var e=t?b(t)[0]:this[0],n=t?this:b(e).parent().children();return s.call(n,e)},w.closest=function(t){return t&&this[0]?this.is(t)?this.filter(t):this.parent().closest(t):b()},w.parents=function(t){var e,n=[];return this.each((function(o,i){for(e=i;e&&e.parentNode&&e!==r.body.parentNode;)e=e.parentNode,(!t||t&&E(e,t))&&n.push(e)})),b(R(n))},w.prev=function(){return b(this[0]&&this[0].previousElementSibling)},w.siblings=function(){var t=this[0];return this.parent().children().filter((function(e,n){return n!==t}))};const gt=b},491:(t,e,n)=>{n.d(e,{$Q:()=>f,BM:()=>b,FW:()=>u,G1:()=>i,GX:()=>_,L_:()=>s,Mx:()=>a,R3:()=>h,S1:()=>P,SJ:()=>y,Ut:()=>x,VB:()=>O,Vb:()=>T,cx:()=>l,dL:()=>d,kl:()=>E,o5:()=>w,on:()=>A,pn:()=>p,r$:()=>k,rw:()=>v,sE:()=>c,sN:()=>S,t3:()=>m,ut:()=>g});var r=n(50),o=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},i="transitionend oTransitionEnd transitionend webkitTransitionEnd",a=function(t){return(null==t?void 0:t.nodeType)===Node.DOCUMENT_NODE},s=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)};function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(Array.isArray(t[0])?t[0]:o([],t,!0)).filter(Boolean).join(" ")}var c=function(t,e){return t.querySelectorAll(e)},u=function(t,e){return void 0===e&&(e={}),t&&t.setAttribute&&(0,r.each)(e,(function(e,n){return t.setAttribute(n,e)}))},p=function(t){var e;return t&&!!(t.offsetWidth||t.offsetHeight||(null===(e=t.getClientRects)||void 0===e?void 0:e.call(t).length))},d=function(t,e){var n;null===(n=t.parentNode)||void 0===n||n.replaceChild(e,t)},f=function(t,e,n){var o=t.childNodes,i=o.length,a=(0,r.isUndefined)(n)?i:n;(0,r.isString)(e)&&(t.insertAdjacentHTML("beforeEnd",e),e=t.lastChild,t.removeChild(e)),a>=i?t.appendChild(e):t.insertBefore(e,o[a])},h=function(t,e){return f(t,e)},g=function(t,e,n){void 0===e&&(e={});var o=document.createElement(t);return e&&(0,r.each)(e,(function(t,e){return o.setAttribute(e,t)})),n&&((0,r.isString)(n)?o.innerHTML=n:o.appendChild(n)),o},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf("key")&&(n.keyCodeVal=t.keyCode,["keyCode","which"].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach((function(e){var n=e.tag||"div",o=e.attributes||{},i=document.createElement(n);(0,r.each)(o,(function(t,e){i.setAttribute(e,t)})),t.appendChild(i)}))},b=function(t){return(null==t?void 0:t.nodeType)===Node.TEXT_NODE},w=function(t){return t&&!b(t)&&!function(t){return(null==t?void 0:t.nodeType)===Node.COMMENT_NODE}(t)},x=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(b(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},_=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,r=e.defaultView||window;return{x:(r.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(r.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},C=function(t){return t.which||t.keyCode},S=function(t){return String.fromCharCode(C(t))},O=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},E=function(t){return 27===C(t)},k=function(t){return 13===C(t)},T=function(t){return function(t){return t.ctrlKey}(t)||t.metaKey},A=function(t,e,n,o){var i=e.split(/\s+/),a=(0,r.isArray)(t)?t:[t];i.forEach((function(t){a.forEach((function(e){return null==e?void 0:e.addEventListener(t,n,o)}))}))},P=function(t,e,n,o){var i=e.split(/\s+/),a=(0,r.isArray)(t)?t:[t];i.forEach((function(t){a.forEach((function(e){return null==e?void 0:e.removeEventListener(t,n,o)}))}))}},163:(t,e,n)=>{n.r(e),n.d(e,{appendStyles:()=>m,buildBase64UrlFromSvg:()=>B,camelCase:()=>x,capitalize:()=>M,createId:()=>V,deepMerge:()=>T,escape:()=>E,escapeNodeContent:()=>k,find:()=>O,getComponentModel:()=>D,getComponentView:()=>I,getElement:()=>S,getGlobal:()=>d,getModel:()=>A,getUiClass:()=>v,getUnitFromValue:()=>b,getViewEl:()=>R,hasDnd:()=>C,hasWin:()=>p,isBultInMethod:()=>s,isComponent:()=>L,isDef:()=>u,isEmptyObj:()=>j,isObject:()=>P,isRule:()=>N,matches:()=>g,normalizeFloat:()=>_,normalizeKey:()=>l,setViewEl:()=>F,shallowDiff:()=>y,toLowerCase:()=>f,upFirst:()=>w,wait:()=>c});var r=n(50),o=n(491),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a={},s=function(t){return(0,r.isFunction)(a[t])},l=function(t){return s(t)?"_".concat(t):t},c=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},u=function(t){return void 0!==t},p=function(){return"undefined"!=typeof window},d=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:n.g},f=function(t){return(t||"").toLowerCase()},h=p()?window.Element.prototype:{},g=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.msMatchesSelector,v=function(t,e){var n=t.getConfig(),r=n.stylePrefix;return[n.customUI&&"".concat(r,"cui"),e].filter((function(t){return t})).join(" ")},m=function(t,e){void 0===e&&(e={});var n=(0,r.isArray)(t)?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],t,!0):[t];if(n.length){var o=n.shift();if(o&&(!e.unique||!document.querySelector('link[href="'.concat(o,'"]')))){var i=document.head,a=document.createElement("link");a.href=o,a.rel="stylesheet",e.prepand?i.insertBefore(a,i.firstChild):i.appendChild(a)}m(n)}},y=function(t,e){var n={},o=(0,r.keys)(e);for(var i in t)if(t.hasOwnProperty(i)){var a=t[i],s=e[i];o.indexOf(i)>=0?a!==s&&(n[i]=s):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,r.isUndefined)(t[i])&&(n[i]=e[i]);return n},b=function(t){return t.replace(parseFloat(t),"")},w=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},x=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},_=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var o=e.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(t.toFixed(r)):t},C=function(t){return"draggable"in document.createElement("i")&&(!t||t.config.nativeDnD)},S=function(t){return(0,r.isElement)(t)||(0,o.BM)(t)?t:t&&t.getEl?t.getEl():void 0},O=function(t,e){var n=null;return t.some((function(r,o){return e(r,o,t)?(n=r,1):0})),n},E=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#96;")},k=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=i({},t[0]),r=1;r<t.length;r++){var o=i({},t[r]);for(var a in o){var s=n[a],l=o[a];P(s)&&P(l)?n[a]=T(s,l):n[a]=l}}return n},A=function(t,e){var n;return!e&&t&&t.__cashData?n=t.__cashData.model:e&&(0,r.isElement)(t)&&(n=e(t).data("model")),n},P=function(t){return t&&!Array.isArray(t)&&"object"==typeof t},j=function(t){return Object.keys(t).length<=0},M=function(t){return void 0===t&&(t=""),t&&t.charAt(0).toUpperCase()+t.substring(1)},N=function(t){return t&&t.toCSS},R=function(t){return null==t?void 0:t.__gjsv},L=function(t){return!!(null==t?void 0:t.toHTML)},I=function(t){return R(t)},D=function(t){var e;return null===(e=I(t))||void 0===e?void 0:e.model},F=function(t,e){t.__gjsv=e},V=function(t){void 0===t&&(t=16);for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<t;r++)e+=n.charAt(Math.floor(62*Math.random()));return e},B=function(t){if(t&&"<svg"===t.substr(0,4)){var e="";return p()?e=window.btoa(t):"undefined"!=typeof Buffer&&(e=Buffer.from(t,"utf8").toString("base64")),e?"data:image/svg+xml;base64,".concat(e):t}return t}},828:(t,e,n)=>{var r={"./CanvasClear":858,"./CanvasClear.ts":858,"./CanvasMove":884,"./CanvasMove.ts":884,"./CommandAbstract":790,"./CommandAbstract.ts":790,"./ComponentDelete":180,"./ComponentDelete.ts":180,"./ComponentDrag":544,"./ComponentDrag.ts":544,"./ComponentEnter":236,"./ComponentEnter.ts":236,"./ComponentExit":368,"./ComponentExit.ts":368,"./ComponentNext":243,"./ComponentNext.ts":243,"./ComponentPrev":400,"./ComponentPrev.ts":400,"./ComponentStyleClear":910,"./ComponentStyleClear.ts":910,"./CopyComponent":744,"./CopyComponent.ts":744,"./ExportTemplate":457,"./ExportTemplate.ts":457,"./Fullscreen":975,"./Fullscreen.ts":975,"./MoveComponent":191,"./MoveComponent.ts":191,"./OpenAssets":912,"./OpenAssets.ts":912,"./OpenBlocks":117,"./OpenBlocks.ts":117,"./OpenLayers":614,"./OpenLayers.ts":614,"./OpenStyleManager":801,"./OpenStyleManager.ts":801,"./OpenTraitManager":395,"./OpenTraitManager.ts":395,"./PasteComponent":98,"./PasteComponent.ts":98,"./Preview":129,"./Preview.ts":129,"./Resize":116,"./Resize.ts":116,"./SelectComponent":407,"./SelectComponent.ts":407,"./SelectPosition":189,"./SelectPosition.ts":189,"./ShowOffset":804,"./ShowOffset.ts":804,"./SwitchVisibility":434,"./SwitchVisibility.ts":434};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=828},50:(t,e,n)=>{n.r(e),n.d(e,{VERSION:()=>o,after:()=>Re,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Rt,before:()=>Le,bind:()=>_e,bindAll:()=>Oe,chain:()=>ye,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>kn,compose:()=>Ne,constant:()=>J,contains:()=>nn,countBy:()=>mn,create:()=>Dt,debounce:()=>Pe,default:()=>$n,defaults:()=>Lt,defer:()=>Te,delay:()=>ke,detect:()=>Ue,difference:()=>An,drop:()=>On,each:()=>Ge,escape:()=>ae,every:()=>tn,extend:()=>Nt,extendOwn:()=>Rt,filter:()=>Je,find:()=>Ue,findIndex:()=>Ve,findKey:()=>De,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>Tn,foldl:()=>Xe,foldr:()=>Ze,forEach:()=>Ge,functions:()=>jt,get:()=>$t,groupBy:()=>gn,has:()=>Wt,head:()=>Sn,identity:()=>Ut,include:()=>nn,includes:()=>nn,indexBy:()=>vn,indexOf:()=>$e,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>T,isDataView:()=>U,isDate:()=>N,isElement:()=>A,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>L,isFinite:()=>X,isFunction:()=>B,isMap:()=>St,isMatch:()=>ct,isNaN:()=>Z,isNull:()=>E,isNumber:()=>M,isObject:()=>O,isRegExp:()=>R,isSet:()=>Et,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>ot,isUndefined:()=>k,isWeakMap:()=>Ot,isWeakSet:()=>kt,iteratee:()=>Xt,keys:()=>st,last:()=>En,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Jt,matcher:()=>qt,matches:()=>qt,max:()=>sn,memoize:()=>Ee,methods:()=>jt,min:()=>ln,mixin:()=>Bn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>In,omit:()=>_n,once:()=>Ie,pairs:()=>At,partial:()=>xe,partition:()=>yn,pick:()=>xn,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Ze,reject:()=>Qe,rest:()=>On,restArguments:()=>S,result:()=>ge,sample:()=>pn,select:()=>Je,shuffle:()=>dn,size:()=>bn,some:()=>en,sortBy:()=>fn,sortedIndex:()=>ze,tail:()=>On,take:()=>Sn,tap:()=>Vt,template:()=>he,templateSettings:()=>le,throttle:()=>Ae,times:()=>ee,toArray:()=>un,toPath:()=>Bt,transpose:()=>Rn,unescape:()=>se,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Rn,values:()=>Tt,where:()=>an,without:()=>Pn,wrap:()=>je,zip:()=>Ln});var r={};n.r(r),n.d(r,{VERSION:()=>o,after:()=>Re,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Rt,before:()=>Le,bind:()=>_e,bindAll:()=>Oe,chain:()=>ye,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>kn,compose:()=>Ne,constant:()=>J,contains:()=>nn,countBy:()=>mn,create:()=>Dt,debounce:()=>Pe,default:()=>zn,defaults:()=>Lt,defer:()=>Te,delay:()=>ke,detect:()=>Ue,difference:()=>An,drop:()=>On,each:()=>Ge,escape:()=>ae,every:()=>tn,extend:()=>Nt,extendOwn:()=>Rt,filter:()=>Je,find:()=>Ue,findIndex:()=>Ve,findKey:()=>De,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>Tn,foldl:()=>Xe,foldr:()=>Ze,forEach:()=>Ge,functions:()=>jt,get:()=>$t,groupBy:()=>gn,has:()=>Wt,head:()=>Sn,identity:()=>Ut,include:()=>nn,includes:()=>nn,indexBy:()=>vn,indexOf:()=>$e,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>T,isDataView:()=>U,isDate:()=>N,isElement:()=>A,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>L,isFinite:()=>X,isFunction:()=>B,isMap:()=>St,isMatch:()=>ct,isNaN:()=>Z,isNull:()=>E,isNumber:()=>M,isObject:()=>O,isRegExp:()=>R,isSet:()=>Et,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>ot,isUndefined:()=>k,isWeakMap:()=>Ot,isWeakSet:()=>kt,iteratee:()=>Xt,keys:()=>st,last:()=>En,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Jt,matcher:()=>qt,matches:()=>qt,max:()=>sn,memoize:()=>Ee,methods:()=>jt,min:()=>ln,mixin:()=>Bn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>In,omit:()=>_n,once:()=>Ie,pairs:()=>At,partial:()=>xe,partition:()=>yn,pick:()=>xn,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Ze,reject:()=>Qe,rest:()=>On,restArguments:()=>S,result:()=>ge,sample:()=>pn,select:()=>Je,shuffle:()=>dn,size:()=>bn,some:()=>en,sortBy:()=>fn,sortedIndex:()=>ze,tail:()=>On,take:()=>Sn,tap:()=>Vt,template:()=>he,templateSettings:()=>le,throttle:()=>Ae,times:()=>ee,toArray:()=>un,toPath:()=>Bt,transpose:()=>Rn,unescape:()=>se,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Rn,values:()=>Tt,where:()=>an,without:()=>Pn,wrap:()=>je,zip:()=>Ln});var o="1.13.6",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,p=s.toString,d=s.hasOwnProperty,f="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,v=Object.keys,m=Object.create,y=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C=Math.pow(2,53)-1;function S(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),o=0;o<n;o++)r[o]=arguments[o+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 i=Array(e+1);for(o=0;o<e;o++)i[o]=arguments[o];return i[e]=r,t.apply(this,i)}}function O(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function E(t){return null===t}function k(t){return void 0===t}function T(t){return!0===t||!1===t||"[object Boolean]"===p.call(t)}function A(t){return!(!t||1!==t.nodeType)}function P(t){var e="[object "+t+"]";return function(t){return p.call(t)===e}}const j=P("String"),M=P("Number"),N=P("Date"),R=P("RegExp"),L=P("Error"),I=P("Symbol"),D=P("ArrayBuffer");var F=P("Function"),V=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof V&&(F=function(t){return"function"==typeof t||!1});const B=F,z=P("Object");var H=h&&z(new DataView(new ArrayBuffer(8))),$="undefined"!=typeof Map&&z(new Map),W=P("DataView");const U=H?function(t){return null!=t&&B(t.getInt8)&&D(t.buffer)}:W,q=g||P("Array");function G(t,e){return null!=t&&d.call(t,e)}var K=P("Arguments");!function(){K(arguments)||(K=function(t){return G(t,"callee")})}();const Y=K;function X(t){return!I(t)&&w(t)&&!isNaN(parseFloat(t))}function Z(t){return M(t)&&b(t)}function J(t){return function(){return t}}function Q(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=C}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt("byteLength"),nt=Q(et);var rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ot=f?function(t){return y?y(t)&&!U(t):nt(t)&&rt.test(p.call(t))}:J(!1),it=tt("length");function at(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=_.length,r=t.constructor,o=B(r)&&r.prototype||s,i="constructor";for(G(t,i)&&!e.contains(i)&&e.push(i);n--;)(i=_[n])in t&&t[i]!==o[i]&&!e.contains(i)&&e.push(i)}function st(t){if(!O(t))return[];if(v)return v(t);var e=[];for(var n in t)G(t,n)&&e.push(n);return x&&at(t,e),e}function lt(t){if(null==t)return!0;var e=it(t);return"number"==typeof e&&(q(t)||j(t)||Y(t))?0===e:0===it(st(t))}function ct(t,e){var n=st(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;i<r;i++){var a=n[i];if(e[a]!==o[a]||!(a in o))return!1}return!0}function ut(t){return t instanceof ut?t:this instanceof ut?void(this._wrapped=t):new ut(t)}function pt(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,et(t))}ut.VERSION=o,ut.prototype.value=function(){return this._wrapped},ut.prototype.valueOf=ut.prototype.toJSON=ut.prototype.value,ut.prototype.toString=function(){return String(this._wrapped)};var dt="[object DataView]";function ft(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&ht(t,e,n,r)}function ht(t,e,n,r){t instanceof ut&&(t=t._wrapped),e instanceof ut&&(e=e._wrapped);var o=p.call(t);if(o!==p.call(e))return!1;if(H&&"[object Object]"==o&&U(t)){if(!U(e))return!1;o=dt}switch(o){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);case"[object ArrayBuffer]":case dt:return ht(pt(t),pt(e),n,r)}var i="[object Array]"===o;if(!i&&ot(t)){if(et(t)!==et(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;i=!0}if(!i){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(B(a)&&a instanceof a&&B(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),i){if((c=t.length)!==e.length)return!1;for(;c--;)if(!ft(t[c],e[c],n,r))return!1}else{var u,d=st(t);if(c=d.length,st(e).length!==c)return!1;for(;c--;)if(!G(e,u=d[c])||!ft(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}function gt(t,e){return ft(t,e)}function vt(t){if(!O(t))return[];var e=[];for(var n in t)e.push(n);return x&&at(t,e),e}function mt(t){var e=it(t);return function(n){if(null==n)return!1;var r=vt(n);if(it(r))return!1;for(var o=0;o<e;o++)if(!B(n[t[o]]))return!1;return t!==_t||!B(n[yt])}}var yt="forEach",bt=["clear","delete"],wt=["get","has","set"],xt=bt.concat(yt,wt),_t=bt.concat(wt),Ct=["add"].concat(bt,yt,"has");const St=$?mt(xt):P("Map"),Ot=$?mt(_t):P("WeakMap"),Et=$?mt(Ct):P("Set"),kt=P("WeakSet");function Tt(t){for(var e=st(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=t[e[o]];return r}function At(t){for(var e=st(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=[e[o],t[e[o]]];return r}function Pt(t){for(var e={},n=st(t),r=0,o=n.length;r<o;r++)e[t[n[r]]]=n[r];return e}function jt(t){var e=[];for(var n in t)B(t[n])&&e.push(n);return e.sort()}function Mt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var o=1;o<r;o++)for(var i=arguments[o],a=t(i),s=a.length,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=i[c])}return n}}const Nt=Mt(vt),Rt=Mt(st),Lt=Mt(vt,!0);function It(t){if(!O(t))return{};if(m)return m(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function Dt(t,e){var n=It(t);return e&&Rt(n,e),n}function Ft(t){return O(t)?q(t)?t.slice():Nt({},t):t}function Vt(t,e){return e(t),t}function Bt(t){return q(t)?t:[t]}function zt(t){return ut.toPath(t)}function Ht(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function $t(t,e,n){var r=Ht(t,zt(e));return k(r)?n:r}function Wt(t,e){for(var n=(e=zt(e)).length,r=0;r<n;r++){var o=e[r];if(!G(t,o))return!1;t=t[o]}return!!n}function Ut(t){return t}function qt(t){return t=Rt({},t),function(e){return ct(e,t)}}function Gt(t){return t=zt(t),function(e){return Ht(e,t)}}function Kt(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,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}}function Yt(t,e,n){return null==t?Ut:B(t)?Kt(t,e,n):O(t)&&!q(t)?qt(t):Gt(t)}function Xt(t,e){return Yt(t,e,1/0)}function Zt(t,e,n){return ut.iteratee!==Xt?ut.iteratee(t,e):Yt(t,e,n)}function Jt(t,e,n){e=Zt(e,n);for(var r=st(t),o=r.length,i={},a=0;a<o;a++){var s=r[a];i[s]=e(t[s],s,t)}return i}function Qt(){}function te(t){return null==t?Qt:function(e){return $t(t,e)}}function ee(t,e,n){var r=Array(Math.max(0,t));e=Kt(e,n,1);for(var o=0;o<t;o++)r[o]=e(o);return r}function ne(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}ut.toPath=Bt,ut.iteratee=Xt;const re=Date.now||function(){return(new Date).getTime()};function oe(t){var e=function(e){return t[e]},n="(?:"+st(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}}const ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},ae=oe(ie),se=oe(Pt(ie)),le=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ce=/(.)^/,ue={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},pe=/\\|'|\r|\n|\u2028|\u2029/g;function de(t){return"\\"+ue[t]}var fe=/^\s*(\w|\$)+\s*$/;function he(t,e,n){!e&&n&&(e=n),e=Lt({},e,ut.templateSettings);var r=RegExp([(e.escape||ce).source,(e.interpolate||ce).source,(e.evaluate||ce).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,(function(e,n,r,a,s){return i+=t.slice(o,s).replace(pe,de),o=s+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e})),i+="';\n";var a,s=e.variable;if(s){if(!fe.test(s))throw new Error("variable is not a bare identifier: "+s)}else i="with(obj||{}){\n"+i+"}\n",s="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{a=new Function(s,"_",i)}catch(t){throw t.source=i,t}var l=function(t){return a.call(this,t,ut)};return l.source="function("+s+"){\n"+i+"}",l}function ge(t,e,n){var r=(e=zt(e)).length;if(!r)return B(n)?n.call(t):n;for(var o=0;o<r;o++){var i=null==t?void 0:t[e[o]];void 0===i&&(i=n,o=r),t=B(i)?i.call(t):i}return t}var ve=0;function me(t){var e=++ve+"";return t?t+e:e}function ye(t){var e=ut(t);return e._chain=!0,e}function be(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=It(t.prototype),a=t.apply(i,o);return O(a)?a:i}var we=S((function(t,e){var n=we.placeholder,r=function(){for(var o=0,i=e.length,a=Array(i),s=0;s<i;s++)a[s]=e[s]===n?arguments[o++]:e[s];for(;o<arguments.length;)a.push(arguments[o++]);return be(t,r,this,this,a)};return r}));we.placeholder=ut;const xe=we,_e=S((function(t,e,n){if(!B(t))throw new TypeError("Bind must be called on a function");var r=S((function(o){return be(t,r,e,this,n.concat(o))}));return r})),Ce=Q(it);function Se(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var o=r.length,i=0,a=it(t);i<a;i++){var s=t[i];if(Ce(s)&&(q(s)||Y(s)))if(e>1)Se(s,e-1,n,r),o=r.length;else for(var l=0,c=s.length;l<c;)r[o++]=s[l++];else n||(r[o++]=s)}return r}const Oe=S((function(t,e){var n=(e=Se(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=_e(t[r],t)}return t}));function Ee(t,e){var n=function(r){var o=n.cache,i=""+(e?e.apply(this,arguments):r);return G(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n}const ke=S((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),Te=xe(ke,ut,1);function Ae(t,e,n){var r,o,i,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:re(),r=null,a=t.apply(o,i),r||(o=i=null)},c=function(){var c=re();s||!1!==n.leading||(s=c);var u=e-(c-s);return o=this,i=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=o=i=null},c}function Pe(t,e,n){var r,o,i,a,s,l=function(){var c=re()-o;e>c?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(s,i)),r||(i=s=null))},c=S((function(c){return s=this,i=c,o=re(),r||(r=setTimeout(l,e),n&&(a=t.apply(s,i))),a}));return c.cancel=function(){clearTimeout(r),r=i=s=null},c}function je(t,e){return xe(e,t)}function Me(t){return function(){return!t.apply(this,arguments)}}function Ne(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Re(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Le(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Ie=xe(Le,2);function De(t,e,n){e=Zt(e,n);for(var r,o=st(t),i=0,a=o.length;i<a;i++)if(e(t[r=o[i]],r,t))return r}function Fe(t){return function(e,n,r){n=Zt(n,r);for(var o=it(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(n(e[i],i,e))return i;return-1}}const Ve=Fe(1),Be=Fe(-1);function ze(t,e,n,r){for(var o=(n=Zt(n,r,1))(e),i=0,a=it(t);i<a;){var s=Math.floor((i+a)/2);n(t[s])<o?i=s+1:a=s}return i}function He(t,e,n){return function(r,o,i){var a=0,s=it(r);if("number"==typeof i)t>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=e(u.call(r,a,s),Z))>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&i<s;i+=t)if(r[i]===o)return i;return-1}}const $e=He(1,Ve,ze),We=He(-1,Be);function Ue(t,e,n){var r=(Ce(t)?Ve:De)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function qe(t,e){return Ue(t,qt(e))}function Ge(t,e,n){var r,o;if(e=Kt(e,n),Ce(t))for(r=0,o=t.length;r<o;r++)e(t[r],r,t);else{var i=st(t);for(r=0,o=i.length;r<o;r++)e(t[i[r]],i[r],t)}return t}function Ke(t,e,n){e=Zt(e,n);for(var r=!Ce(t)&&st(t),o=(r||t).length,i=Array(o),a=0;a<o;a++){var s=r?r[a]:a;i[a]=e(t[s],s,t)}return i}function Ye(t){return function(e,n,r,o){var i=arguments.length>=3;return function(e,n,r,o){var i=!Ce(e)&&st(e),a=(i||e).length,s=t>0?0:a-1;for(o||(r=e[i?i[s]:s],s+=t);s>=0&&s<a;s+=t){var l=i?i[s]:s;r=n(r,e[l],l,e)}return r}(e,Kt(n,o,4),r,i)}}const Xe=Ye(1),Ze=Ye(-1);function Je(t,e,n){var r=[];return e=Zt(e,n),Ge(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}function Qe(t,e,n){return Je(t,Me(Zt(e)),n)}function tn(t,e,n){e=Zt(e,n);for(var r=!Ce(t)&&st(t),o=(r||t).length,i=0;i<o;i++){var a=r?r[i]:i;if(!e(t[a],a,t))return!1}return!0}function en(t,e,n){e=Zt(e,n);for(var r=!Ce(t)&&st(t),o=(r||t).length,i=0;i<o;i++){var a=r?r[i]:i;if(e(t[a],a,t))return!0}return!1}function nn(t,e,n,r){return Ce(t)||(t=Tt(t)),("number"!=typeof n||r)&&(n=0),$e(t,e,n)>=0}const rn=S((function(t,e,n){var r,o;return B(e)?o=e:(e=zt(e),r=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var i=o;if(!i){if(r&&r.length&&(t=Ht(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function on(t,e){return Ke(t,Gt(e))}function an(t,e){return Je(t,qt(e))}function sn(t,e,n){var r,o,i=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Tt(t)).length;s<l;s++)null!=(r=t[s])&&r>i&&(i=r);else e=Zt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))>a||o===-1/0&&i===-1/0)&&(i=t,a=o)}));return i}function ln(t,e,n){var r,o,i=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Tt(t)).length;s<l;s++)null!=(r=t[s])&&r<i&&(i=r);else e=Zt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))<a||o===1/0&&i===1/0)&&(i=t,a=o)}));return i}var cn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function un(t){return t?q(t)?u.call(t):j(t)?t.match(cn):Ce(t)?Ke(t,Ut):Tt(t):[]}function pn(t,e,n){if(null==e||n)return Ce(t)||(t=Tt(t)),t[ne(t.length-1)];var r=un(t),o=it(r);e=Math.max(Math.min(e,o),0);for(var i=o-1,a=0;a<e;a++){var s=ne(a,i),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)}function dn(t){return pn(t,1/0)}function fn(t,e,n){var r=0;return e=Zt(e,n),on(Ke(t,(function(t,n,o){return{value:t,index:r++,criteria:e(t,n,o)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function hn(t,e){return function(n,r,o){var i=e?[[],[]]:{};return r=Zt(r,o),Ge(n,(function(e,o){var a=r(e,o,n);t(i,e,a)})),i}}const gn=hn((function(t,e,n){G(t,n)?t[n].push(e):t[n]=[e]})),vn=hn((function(t,e,n){t[n]=e})),mn=hn((function(t,e,n){G(t,n)?t[n]++:t[n]=1})),yn=hn((function(t,e,n){t[n?0:1].push(e)}),!0);function bn(t){return null==t?0:Ce(t)?t.length:st(t).length}function wn(t,e,n){return e in n}const xn=S((function(t,e){var n={},r=e[0];if(null==t)return n;B(r)?(e.length>1&&(r=Kt(r,e[1])),e=vt(t)):(r=wn,e=Se(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o<i;o++){var a=e[o],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),_n=S((function(t,e){var n,r=e[0];return B(r)?(r=Me(r),e.length>1&&(n=e[1])):(e=Ke(Se(e,!1,!1),String),r=function(t,n){return!nn(e,n)}),xn(t,r,n)}));function Cn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function On(t,e,n){return u.call(t,null==e||n?1:e)}function En(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:On(t,Math.max(0,t.length-e))}function kn(t){return Je(t,Boolean)}function Tn(t,e){return Se(t,e,!1)}const An=S((function(t,e){return e=Se(e,!0,!0),Je(t,(function(t){return!nn(e,t)}))})),Pn=S((function(t,e){return An(t,e)}));function jn(t,e,n,r){T(e)||(r=n,n=e,e=!1),null!=n&&(n=Zt(n,r));for(var o=[],i=[],a=0,s=it(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&i===c||o.push(l),i=c):n?nn(i,c)||(i.push(c),o.push(l)):nn(o,l)||o.push(l)}return o}const Mn=S((function(t){return jn(Se(t,!0,!0))}));function Nn(t){for(var e=[],n=arguments.length,r=0,o=it(t);r<o;r++){var i=t[r];if(!nn(e,i)){var a;for(a=1;a<n&&nn(arguments[a],i);a++);a===n&&e.push(i)}}return e}function Rn(t){for(var e=t&&sn(t,it).length||0,n=Array(e),r=0;r<e;r++)n[r]=on(t,r);return n}const Ln=S(Rn);function In(t,e){for(var n={},r=0,o=it(t);r<o;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function Dn(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),o=Array(r),i=0;i<r;i++,t+=n)o[i]=t;return o}function Fn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(u.call(t,r,r+=e));return n}function Vn(t,e){return t._chain?ut(e).chain():e}function Bn(t){return Ge(jt(t),(function(e){var n=ut[e]=t[e];ut.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),Vn(this,n.apply(ut,t))}})),ut}Ge(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=a[t];ut.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vn(this,n)}})),Ge(["concat","join","slice"],(function(t){var e=a[t];ut.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Vn(this,t)}}));const zn=ut;var Hn=Bn(r);Hn._=Hn;const $n=Hn}},A={};function P(t){var e=A[t];if(void 0!==e)return e.exports;var n=A[t]={exports:{}};return T[t].call(n.exports,n,n.exports,P),n.exports}P.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return P.d(e,{a:e}),e},P.d=(t,e)=>{for(var n in e)P.o(e,n)&&!P.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},P.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),P.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),P.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var j={};(()=>{P.d(j,{ZP:()=>jh,kr:()=>Ph,j7:()=>Ah});var t=P(50),e=P(163);function n(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=t.raw;return o.reduce((function(t,r,i){var a=n[i-1],s=o[i-1];return Array.isArray(a)?a=a.join(""):s&&"$"===s.slice(-1)?t=t.slice(0,-1):a=(0,e.escape)(a),t+a+r}))}const r={stylePrefix:"gjs-",components:"",style:"",fromElement:!1,projectData:void 0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",log:["warning","error"],baseCss:"",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:!0,showDevices:!0,devicePreviewMode:!1,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",keepEmptyTextNodes:!1,jsInHtml:!0,nativeDnD:!0,multipleSelection:!0,optsHtml:{},optsCss:{},avoidInlineStyle:!0,avoidDefaults:!0,clearStyles:!1,listenToEl:[],cssIcons:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",icons:{close:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',move:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',plus:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',caret:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>',delete:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',copy:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /></svg>',arrowUp:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" /></svg>',chevron:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" /></svg>',eye:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg>',eyeOff:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>'},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:!1,customUI:!1};var o=P(316),i=P.n(o),a=P(895);var s,l=P(346),c=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(l.Hn);const p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return c(n,e),n.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},n.prototype.addComponent=function(e,n){var r=this,o=((0,t.isArray)(e)?e:[e]).filter((function(t){return!r.hasComponent(t)})).map((function(t){return new u({component:t})}))[0];return this.push(o,n)},n.prototype.getComponent=function(t){return t.get("component")},n.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},n.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},n.prototype.allComponents=function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))},n.prototype.removeComponent=function(e,n){var r=this,o=((0,t.isArray)(e)?e:[e]).map((function(t){return r.getByComponent(t)}));return this.remove(o,n)},n}(l.FE);var d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},f.apply(this,arguments)},h=function(){function n(n,r,o){this.debounced=[],this.collections=[],this.cls=[],this._em=n,this._name=r;var i=this.name.charAt(0).toLowerCase()+this.name.slice(1),a=(0,t.isUndefined)(n.config[i])?n.config[this.name]:n.config[i],s=!0===a?{}:a||{};s.pStylePrefix=n.config.pStylePrefix||"",(0,t.isUndefined)(a)||a||(s._disable=1),s.em=n,this._config=(0,e.deepMerge)(o||{},s)}return Object.defineProperty(n.prototype,"em",{get:function(){return this._em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),n.prototype.render=function(t){},n.prototype.postLoad=function(t){},Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),n.prototype.getConfig=function(t){return t?this.config[t]:this.config},n.prototype.__logWarn=function(t,e){void 0===e&&(e={}),this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},n.prototype.destroy=function(){this.__destroy()},n.prototype.__destroy=function(){var t,e,n;null===(t=this.view)||void 0===t||t.remove(),null===(e=this.state)||void 0===e||e.stopListening(),null===(n=this.state)||void 0===n||n.clear(),this.debounced.forEach((function(t){return t.cancel()})),this.collections.forEach((function(t){t.stopListening(),t.reset()}))},n.prototype.__appendTo=function(){var e=this.getConfig().appendTo;if(e){var n=(0,t.isElement)(e)?e:document.querySelector(e);if(!n)return this.__logWarn('"appendTo" element not found');n.appendChild(this.render())}},n}();const g=h;var v=function(n){function r(t,e,r,o,i,a){void 0===a&&(a={});var s=n.call(this,t,e,i)||this;return s.cls=[],s.private=!1,s.all=r,s.events=o,!a.skipListen&&s.__initListen(),s}return d(r,n),r.prototype.postLoad=function(t){},r.prototype.render=function(t){},r.prototype.getProjectData=function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},r.prototype.loadProjectData=function(t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.all,o=n.onResult,i=n.reset,a=this.storageKey,s={action:"load"},l=r||this.all,c=t[a];if("string"==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn("Data parsing failed",{input:c})}return i&&c&&l.reset(void 0,s),o?c&&o(c,s):c&&(0,e.isDef)(c.length)&&l.reset(c,s),c},r.prototype.clear=function(t){void 0===t&&(t={});var e=this.all;return e&&e.reset(void 0,t),this},r.prototype.getAll=function(){return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.all.models,!0)},r.prototype.getAllMap=function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},r.prototype.__initListen=function(t){void 0===t&&(t={});var e=this,n=e.all,r=e.em,o=e.events;n&&r&&n.on("add",(function(t,e,n){return r.trigger(o.add,t,n)})).on("remove",(function(t,e,n){return r.trigger(o.remove,t,n)})).on("change",(function(t,e){return r.trigger(o.update,t,t.changedAttributes(),e)})).on("all",this.__catchAllEvent,this),this.cls=[n].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var e=t.entity,o=t.event;e.on("all",(function(t,e,i,a){var s=f({event:t},a||i);[r,n].map((function(t){return t.trigger(o,e,s)}))}))}))},r.prototype.__remove=function(e,n){var r=this;void 0===n&&(n={});var o=this.em,i=(0,t.isString)(e)?this.get(e):e,a=function(){return i&&r.all.remove(i,n),i};return!n.silent&&(null==o||o.trigger(this.events.removeBefore,i,a,n)),!n.abort&&a()},r.prototype.__catchAllEvent=function(t,e,n,r){var o=this.em,i=this.events,a=r||n;o&&i.all&&o.trigger(i.all,{event:t,model:e,options:a}),this.__onAllEvent()},r.prototype.__appendTo=function(e){var n=this.config.appendTo;if(n){var r=(0,t.isElement)(n)?n:document.querySelector(n);if(!r)return this.__logWarn('"appendTo" element not found');r.appendChild(this.render(e))}},r.prototype.__onAllEvent=function(){},r.prototype._createId=function(t){void 0===t&&(t=16);var n,r=this.getAll().length+t,o=this.getAllMap();do{n=(0,e.createId)(r)}while(o[n]);return n},r.prototype.__listenAdd=function(t,e){var n=this;t.on("add",(function(t,r,o){return n.em.trigger(e,t,o)}))},r.prototype.__listenRemove=function(t,e){var n=this;t.on("remove",(function(t,r,o){return n.em.trigger(e,t,o)}))},r.prototype.__listenUpdate=function(t,e){var n=this;t.on("change",(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},r.prototype.__destroy=function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),null===(t=this.view)||void 0===t||t.remove(),this.view=void 0},r}(h);const m={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:void 0,autoscrollLimit:50,extHl:!1,frameContent:"<!DOCTYPE html>",frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:["button","a","input[type=checkbox]","input[type=radio]"],allowExternalDrop:!0};var y=P(642);const b={default:"",devices:[{id:"desktop",name:"Desktop",width:""},{id:"tablet",name:"Tablet",width:"770px",widthMedia:"992px"},{id:"mobileLandscape",name:"Mobile landscape",width:"568px",widthMedia:"768px"},{id:"mobilePortrait",name:"Mobile portrait",width:"320px",widthMedia:"480px"}]};var w=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e.prototype.defaults=function(){return{name:"",width:null,height:"",widthMedia:null,priority:null}},e.prototype.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)}))},e.prototype.checkUnit=function(t){var e=this.get(t)||"";(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))},e.prototype.getName=function(){return this.get("name")||this.get("id")},e.prototype.getWidthMedia=function(){return this.get("widthMedia")||""},e}(l.Hn);var _=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e}(l.FE);const S=C;C.prototype.model=x;var O=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this,e)||this;return n.config=e.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||"",n.listenTo(n.em,"change:device",n.updateSelect),n}return O(e,t),e.prototype.template=function(t){var e,r,o=t.ppfx,i=t.label;return n(T||(e=['\n <div class="','device-label">','</div>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select class="','devices"></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="','add-trasp" data-add-trasp>+</button>\n '],r=['\n <div class="','device-label">','</div>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select class="','devices"></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="','add-trasp" data-add-trasp>+</button>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,T=e),o,i,o,o,o,o,o,o,o)},e.prototype.events=function(){return{change:"updateDevice","click [data-add-trasp]":"startAdd"}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set("device",e?e.val():"")}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get("id"):"")}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n="";return t.forEach((function(t){var r=t.attributes,o=r.name,i=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(i))||o;n+='<option value="'.concat(i||o,'">').concat(a,"</option>")})),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,r=t.$el,o=t.el,i=e&&e.t&&e.t("deviceManager.device");return r.html(this.template({ppfx:n,label:i})),this.devicesEl=r.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get("device")),o.className="".concat(n,"devices-c"),this},e}(l.G7);const k=E;var T,A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(){return M=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},M.apply(this,arguments)},N="device",R="".concat(N,":"),L="".concat(R,"select"),I="".concat(R,"update"),D="".concat(R,"add"),F="".concat(R,"remove"),V="".concat(F,":before"),B={all:N,select:L,update:I,add:D,remove:F,removeBefore:V},z=function(e){function n(t){var n,r=e.call(this,t,"DeviceManager",new S,B,b)||this;return r.Device=x,r.Devices=S,r.storageKey="",r.devices=r.all,null===(n=r.config.devices)||void 0===n||n.forEach((function(t){return r.add(t,{silent:!0})})),r.select(r.config.default||r.devices.at(0)),t.on("change:device",r._onSelect,r),r}return A(n,e),n.prototype._onSelect=function(t,e,n){var r=this.em,o=this.events,i=t.previous("device"),a=this.get(e),s=o.select;r.trigger(s,a,this.get(i)),this.__catchAllEvent(s,a,n)},n.prototype.add=function(e,n){var r;void 0===n&&(n={});var o=n;if((0,t.isString)(e)){var i=n;r=M(M({},o=arguments[2]||{}),{id:e,name:o.name||e,width:i})}else r=e;return r.id||(r.id=r.name||this._createId()),this.devices.add(r,o)},n.prototype.get=function(t){return this.getAll().filter((function(e){return e.get("name")===t}))[0]||this.devices.get(t)||null},n.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},n.prototype.getDevices=function(){return this.devices.models},n.prototype.select=function(e,n){void 0===n&&(n={});var r=(0,t.isString)(e)?this.get(e):e;return r&&this.em.set("device",r.get("id"),n),this},n.prototype.getSelected=function(){return this.get(this.em.get("device"))},n.prototype.getAll=function(){return this.devices},n.prototype.render=function(){var t,e=this.em;return null===(t=this.view)||void 0===t||t.remove(),this.view=new k({collection:this.devices,config:M({em:e},this.config)}),this.view.render().el},n.prototype.destroy=function(){this.__destroy()},n}(v);const H=z;var $;!function(t){t.add="page:add",t.addBefore="page:add:before",t.remove="page:remove",t.removeBefore="page:remove:before",t.select="page:select",t.selectBefore="page:select:before",t.update="page:update",t.all="page"}($||($={}));const W=$;var U=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(e){function n(t,n,r){return e.call(this,n,{module:t,modelConstructor:r})||this}return U(n,e),n.prototype.add=function(n,r){var o,i=this,a=(0,t.isArray)(n)?n:(0,t.isUndefined)(n)?void 0:[n];return a=null!==(o=null==a?void 0:a.map((function(t){return t instanceof i.newModel?t:new i.newModel(i.module,t)})))&&void 0!==o?o:[void 0],e.prototype.add.call(this,(0,t.isArray)(n)?a:a[0],r)},n.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},n}(l.FE);const G=q;var K=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(){return Y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Y.apply(this,arguments)},X=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Z="__aw",J="__ah",Q=function(e,n){var r,o=e.get(n),i=null===(r=e.view)||void 0===r?void 0:r.el["width"===n?"offsetWidth":"offsetHeight"];return(0,t.isNumber)(o)?o:(0,t.isString)(o)&&o.endsWith("px")?parseFloat(o):i||0},tt=function(n){function r(r,o){var i=n.call(this,r,o)||this,a=i.em,s=i.attributes,l=s.styles,c=s.component,u=a.Components,p=u.getConfig(),d=a.Css.getAll(),f={},h={em:a,config:p,frame:i,idMap:f};if(!(0,e.isComponent)(c)){var g=(0,e.isObject)(c)?c:{components:c};!g.type&&(g.type="wrapper");var v=u.getType("wrapper").model;i.set("component",new v(g,h))}if(l){if(!(0,e.isObject)(l)){var m=l;(0,t.keys)(f).length&&(m=(0,t.isString)(m)?a.Parser.parseCss(m):m,a.Css.checkId(m,{idMap:f})),d.add(m),i.set("styles",d)}}else i.set("styles",d);return!o.width&&i.set(Z,1),!o.height&&i.set(J,1),!i.id&&i.set("id",(0,e.createId)()),i}return K(r,n),r.prototype.defaults=function(){return{x:0,y:0,changesCount:0,attributes:{},width:null,height:null,head:[],component:"",styles:"",refFrame:null,_undo:!0,_undoexc:["changesCount"]}},Object.defineProperty(r.prototype,"width",{get:function(){return Q(this,"width")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return Q(this,"height")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"refFrame",{get:function(){return this.get("refFrame")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.refFrame;return(null==t?void 0:t.getComponent())||this.getComponent()},enumerable:!1,configurable:!0}),r.prototype.initRefs=function(){var e=this.refFrame;if((0,t.isString)(e)){var n=this.module.framesById[e];n&&this.set({refFrame:n},{silent:!0})}},r.prototype.getBoxRect=function(){var t=this.attributes;return{x:t.x,y:t.y,width:this.width,height:this.height}},r.prototype.onRemove=function(){!this.refFrame&&this.getComponent().remove({root:1})},r.prototype.changesUp=function(t){void 0===t&&(t={}),t.temporary||t.noCount||t.avoidStore||this.set("changesCount",this.get("changesCount")+1)},r.prototype.getComponent=function(){return this.get("component")},r.prototype.getStyles=function(){return this.get("styles")},r.prototype.disable=function(){this.trigger("disable")},r.prototype.remove=function(){var t;null===(t=this.view)||void 0===t||t.remove(),this.view=void 0;var e=this.collection;return e&&e.remove(this)},r.prototype.getHead=function(){return X([],this.head,!0)},r.prototype.setHead=function(t){return this.set("head",X([],t,!0))},r.prototype.addHeadItem=function(t){this.head.push(t)},r.prototype.getHeadByAttr=function(t,e,n){return this.head.filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]},r.prototype.removeHeadByAttr=function(t,e,n){var r=this.getHeadByAttr(t,e,n),o=this.head.indexOf(r);o>=0&&this.head.splice(o,1)},r.prototype.addLink=function(t){var e="link";!this.getHeadByAttr("href",t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},r.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},r.prototype.addScript=function(t){var e="script";!this.getHeadByAttr("src",t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},r.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},r.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},r.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger("frame:updated",Y({frame:this},t))},r.prototype.hasAutoHeight=function(){return!("auto"!==this.attributes.height&&!this.config.infiniteCanvas)},r.prototype.toJSON=function(e){void 0===e&&(e={});var n=y.Z.prototype.toJSON.call(this,e),r=(0,t.result)(this,"defaults");return e.fromUndo&&delete n.component,delete n.styles,delete n.changesCount,n[Z]&&delete n.width,n[J]&&delete n.height,n.refFrame&&(n.refFrame=n.refFrame.id,delete n.component),(0,t.forEach)(n,(function(t,e){0===e.indexOf("_")&&delete n[e]})),(0,t.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),(0,t.forEach)(["attributes","head"],(function(e){(0,t.isEmpty)(n[e])&&delete n[e]})),n},r}(y.Z);const et=tt;var nt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const rt=function(e){function n(n,r){void 0===r&&(r=[]);var o=e.call(this,n,r,et)||this;return o.loadedItems=0,o.itemsToLoad=0,(0,t.bindAll)(o,"itemLoaded"),o.on("add",o.onAdd),o.on("reset",o.onReset),o.on("remove",o.onRemove),o.forEach((function(t){return o.onAdd(t)})),o}return nt(n,e),n.prototype.onAdd=function(t){this.module.framesById[t.id]=t},n.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},n.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},n.prototype.initRefs=function(){this.forEach((function(t){return t.initRefs()}))},n.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(!1))},n.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},n.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?"on":"off"]("loaded",e.itemLoaded)}))},n}(G);var ot=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=function(t){function e(e){var n=this,r=e.em,o=e.config,i=o.scripts,a=o.styles;return(n=t.call(this,e,{scripts:i,styles:a})||this).set("frames",new rt(e)),n.on("change:zoom",n.onZoomChange),n.on("change:x change:y",n.onCoordsChange),n.on("change:pointer change:pointerScreen",n.onPointerChange),n.listenTo(r,"change:device ".concat(I),n.updateDevice),n.listenTo(r,W.select,n._pageUpdated),n}return ot(e,t),e.prototype.defaults=function(){return{frame:"",frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:l.pH,pointerScreen:l.pH}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get("frames")},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.Pages._initPage();this.set("frames",t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get("readyCanvas")&&n.stopDefault(),null==e||e.getFrames().map((function(t){return t.disable()})),this.set("frames",t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var o=n.attributes,i=o.width,a=o.height;r.set({width:i,height:a},{noUndo:1})}},e.prototype.onZoomChange=function(){var t=this.em,e=this.module;this.get("zoom")<1&&this.set("zoom",1),t.trigger(e.events.zoom)},e.prototype.onCoordsChange=function(){var t=this.em,e=this.module;t.trigger(e.events.coords)},e.prototype.onPointerChange=function(){var t=this.em,e=this.module;t.trigger(e.events.pointer)},e.prototype.getPointerCoords=function(t){void 0===t&&(t=l.vA.World);var e=this.attributes,n=e.pointer,r=e.pointerScreen;return t===l.vA.World?n:r},e}(y.Z);const at=it;var st=P(675),lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ct=function(e){function n(n,r){void 0===r&&(r=[]);var o=e.call(this,n,r,st.Z)||this;o.on("add",o.onAdd),o.on("change",o.onChange),o.on("remove",o.onRemove);var i=o.em;o.refreshDbn=(0,t.debounce)((function(){return o.refresh()}),0);return o.listenTo(i,"component:resize styleable:change component:input component:update frame:updated undo redo",(function(){return o.refreshDbn()})),o}return lt(n,e),Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),n.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.spot)},n.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},n.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},n.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},n.prototype.__trgEvent=function(t,e){this.module.em.trigger(t,e),this.refreshDbn()},n}(G);const ut=ct;var pt;!function(t){t.dragEnter="canvas:dragenter",t.dragOver="canvas:dragover",t.dragEnd="canvas:dragend",t.dragData="canvas:dragdata",t.drop="canvas:drop",t.spot="canvas:spot",t.spotAdd="canvas:spot:add",t.spotUpdate="canvas:spot:update",t.spotRemove="canvas:spot:remove",t.coords="canvas:coords",t.zoom="canvas:zoom",t.pointer="canvas:pointer",t.refresh="canvas:refresh",t.frameLoad="canvas:frame:load",t.frameLoadHead="canvas:frame:load:head",t.frameLoadBody="canvas:frame:load:body"}(pt||(pt={}));const dt=pt;var ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ft(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=""},e}(l.G7);const gt=ht;var vt=P(491),mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const yt=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var r=t.call(this,e)||this;return r.itemsView="",r.itemType="type",r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,"add",r.addTo),r}return mt(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,r=this.reuseView,o=this.viewCollection,i=e||null,a=t.get(this.itemType);n=t.view&&r?t.view:this.renderView(t,a),o.push(n);var s=n.render().el;i?i.appendChild(s):this.$el.append(s)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),l.G7.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(gt);var bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const wt=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var r=n.model;return n.listenTo(r,"change",n.render),n.listenTo(r,"destroy remove",n.remove),n.listenTo(r.get("selectors"),"change",n.render),n}return bt(e,t),e.prototype.tagName=function(){return"style"},e.prototype.render=function(){var t=this.model,e=this.el,n=t.get("important");return e.innerHTML=t.toCSS({important:n}),this},e}(l.G7);var xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const _t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e.prototype._createElement=function(){return document.createTextNode("")},e.prototype.render=function(){var t=this.model,e=t.get("important");return this.el.textContent=t.getDeclaration({important:e}),this},e}(wt);var Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),St=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):"")},Ot=function(e){function n(n){var r=e.call(this,n)||this;(0,t.bindAll)(r,"sortRules");var o=n.config||{};r.atRules={},r.config=o,r.em=o.em,r.pfx=o.stylePrefix||"",r.className=r.pfx+"rules";var i=r.collection;return r.listenTo(i,"add",r.addTo),r.listenTo(i,"reset",r.render),r}return Ct(n,e),n.prototype.addTo=function(t){this.addToCollection(t)},n.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,r,o=e||null,i={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 _t(i),s.appendData(r.render().el.textContent)}else n=(r=new wt(i)).render().el;var c=this.className,u=t.get("mediaText"),p=St(c),d=p;if(u&&(d=St(c,this.getMediaWidth(u))),n){var f=o||this.el,h=void 0;try{h=f.querySelector("#".concat(d))}catch(t){}h||(h=f.querySelector("#".concat(p))),null==h||h.appendChild(n)}return n}},n.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),"").replace(")","")},n.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||"").indexOf("min-width");return n?(n?t:e)-(n?e:t):0},n.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,r=e.$el,o=e.collection,i=this.className,a=document.createDocumentFragment();r.empty();var s=n.Devices.getAll().pluck("priority").sort(this.sortRules);return s.every((function(t){return t}))&&s.unshift(0),s.forEach((function(t){return a.appendChild((0,vt.ut)("div",{id:St(i,t)}))})),o.each((function(e){return t.addToCollection(e,a)})),r.append(a),r.attr("class",i),this},n}(l.G7);const Et=Ot;var kt=function(){return kt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kt.apply(this,arguments)},Tt=function(){function e(e,n){var r=this;this.em=e,this.canvas=e.Canvas;var o=n||this.canvas.getFrames().map((function(t){return t.getComponent().getEl()})),i=Array.isArray(o)?o:[o];this.el=i[0],this.counter=0,(0,t.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),i.forEach((function(t){return r.toggleEffects(t,!0)}))}return e.prototype.toggleEffects=function(t,e){var n={on:vt.on,off:vt.S1},r=e?"on":"off";n[r](t,"dragenter",this.handleDragEnter),n[r](t,"dragover",this.handleDragOver),n[r](t,"drop",this.handleDrop),n[r](t,"dragleave",this.handleDragLeave)},e.prototype.__customTglEff=function(t){var e,n=t?vt.on:vt.S1,r=this.el.ownerDocument,o=null===(e=r.defaultView)||void 0===e?void 0:e.frameElement;this.sortOpts=t?{onStart:function(t){var e=t.sorter;(0,vt.on)(o,"pointermove",e.onMove)},onEnd:function(t){var e=t.sorter;(0,vt.S1)(o,"pointermove",e.onMove)},customTarget:function(t){var e=t.event;return r.elementFromPoint(e.clientX,e.clientY)}}:null,n(o,"pointerenter",this.handleDragEnter),n(o,"pointermove",this.handleDragOver),n(document,"pointerup",this.handleDrop),n(o,"pointerout",this.handleDragLeave)},e.prototype.startCustom=function(){this.__customTglEff(!0)},e.prototype.endCustom=function(t){this.over?this.endDrop(t):this.__customTglEff(!1)},e.prototype.endDrop=function(t,e){var n=this.em,r=this.dragStop;this.counter=0,r&&r(t||!this.over),this.__customTglEff(!1),n.trigger("canvas:dragend",e)},e.prototype.handleDragLeave=function(t){this.updateCounter(-1,t)},e.prototype.updateCounter=function(t,e){this.counter+=t,0===this.counter&&this.endDrop(!0,e)},e.prototype.handleDragEnter=function(t){var e=this,n=this.em,r=this.canvas,o=t.dataTransfer,i=n.get("dragContent");if((i||r.getConfig().allowExternalDrop)&&(this.updateCounter(1,t),!this.over)){this.over=!0;var a,s,l=n.Utils,c=i||"<br>";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.Components.getWrapper(),p=u.append({})[0],d=n.Commands.run("core:component-drag",{event:t,guidesInfo:1,center:1,target:p,onEnd:function(t,n,i){var a;if(!i.cancelled){a=u.append(c)[0];var s=r.getOffset(),l=p.getStyle(),d=l.top,f=l.left,h=l.position,g=(0,vt.GX)(t.target),v=parseInt("".concat(parseFloat(f)+g.x-s.left),10),m=parseInt("".concat(parseFloat(d)+g.y-s.top),10);a.addStyle({left:v+"px",top:m+"px",position:h})}e.handleDragEnd(a,o),p.remove()}});a=function(e){return d.stop(t,{cancel:e})},s=function(t){return c=t}}else{var f=new l.Sorter(kt({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:r.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(t){return e.handleDragEnd(t,o)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(c),f.startSort(),this.sorter=f,a=function(t){t&&(f.moved=!1),f.endMove()},s=function(t){return f.setDropContent(t)}}this.dragStop=a,this.dragContent=s,n.trigger("canvas:dragenter",o,c)}},e.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set("dragResult",t),n.trigger("canvas:drop",e,t)),n.runDefault({preserveSelected:1})},e.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger("canvas:dragover",t)},e.prototype.handleDrop=function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,r=this.getContentByData(n).content;t.target.style.border="",r&&e&&e(r),this.endDrop(!r,t)},e.prototype.getContentByData=function(e){var n=this.em,r=e&&e.types,o=e&&e.files||[],i=n.get("dragContent"),a=e&&e.getData("text");if(o.length){a=[];for(var s=0;s<o.length;s++){var l=o[s],c=l.type.split("/")[0];"image"==c&&a.push({type:c,file:l,attributes:{alt:l.name}})}}else if(i)a=i;else if((0,t.indexOf)(r,"text/html")>=0)a=e&&e.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,t.indexOf)(r,"text/uri-list")>=0)a={type:"link",attributes:{href:a},content:a};else if((0,t.indexOf)(r,"text/json")>=0){var u=e&&e.getData("text/json");u&&(a=JSON.parse(u))}else 1===r.length&&"text/plain"===r[0]&&(a="<div>".concat(a,"</div>"));var p={content:a};return n.trigger("canvas:dragdata",e,p),p},e}();const At=Tt;var Pt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jt=function(){return jt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},jt.apply(this,arguments)},Mt=function(n){function r(r,o){var i=n.call(this,{model:r})||this;i.dragging=!1,i.loaded=!1,i.lastMaxHeight=0,i.tools={},(0,t.bindAll)(i,"updateClientY","stopAutoscroll","autoscroll","_emitUpdate");var a=i.el;i.module._config=jt(jt({},i.config||{}),{frameView:i}),i.frameWrapView=o,i.showGlobalTools=(0,t.debounce)(i.showGlobalTools.bind(i),50);var s=i.getCanvasModel();return i.listenTo(r,"change:head",i.updateHead),i.listenTo(s,"change:styles",i.renderStyles),r.view=i,(0,e.setViewEl)(a,i),i}return Pt(r,n),Object.defineProperty(r.prototype,"tagName",{get:function(){return"iframe"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"attributes",{get:function(){return{allowfullscreen:"allowfullscreen"}},enumerable:!1,configurable:!0}),r.prototype.getBoxRect=function(){var t=this.el,e=this.module,n=e.getCanvasView(),r=e.getCoords(),o=t.getBoundingClientRect(),i=n.getCanvasOffset(),a=n.getViewportDelta(),s=e.getZoomMultiplier();return{x:(o.x-i.left-a.x-r.x)*s,y:(o.y-i.top-a.y-r.y)*s,width:o.width*s,height:o.height*s}},r.prototype.updateHead=function(){var t=this.model,e=this.getHead(),n=[],r=[],o=t.head,i=t.previous("head"),a=function(t){return void 0===t&&(t={}),Object.keys(t).sort().map((function(e){return"[".concat(e,'="').concat(t[e],'"]')})).join("")},s=function(t,e,n){t.forEach((function(t){var r=t.tag,o=t.attributes;!e.some((function(t){return t.tag===r&&a(t.attributes)===a(o)}))&&n.push(t)}))};s(o,i,r),s(i,o,n),n.forEach((function(t){var n,r=e.querySelector("".concat(t.tag).concat(a(t.attributes)));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,vt.SJ)(e,r)},r.prototype.getEl=function(){return this.el},r.prototype.getCanvasModel=function(){return this.em.Canvas.getModel()},r.prototype.getWindow=function(){return this.getEl().contentWindow},r.prototype.getDoc=function(){return this.getEl().contentDocument},r.prototype.getHead=function(){return this.getDoc().querySelector("head")},r.prototype.getBody=function(){return this.getDoc().querySelector("body")},r.prototype.getWrapper=function(){return this.getBody().querySelector("[data-gjs-type=wrapper]")},r.prototype.getJsContainer=function(){return this.jsContainer||(this.jsContainer=(0,vt.ut)("div",{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},r.prototype.getToolsEl=function(){var t;return null===(t=this.frameWrapView)||void 0===t?void 0:t.elTools},r.prototype.getGlobalToolsEl=function(){return this.em.Canvas.getGlobalToolsEl()},r.prototype.getHighlighter=function(){return this._getTool("[data-hl]")},r.prototype.getBadgeEl=function(){return this._getTool("[data-badge]")},r.prototype.getOffsetViewerEl=function(){return this._getTool("[data-offset]")},r.prototype.getRect=function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},r.prototype.getOffsetRect=function(){var t=this.el,e=this.getBody(),n=e.scrollTop,r=e.scrollLeft,o=t.offsetHeight,i=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:o,width:i,scrollTop:n,scrollLeft:r,scrollBottom:n+o,scrollRight:r+i}},r.prototype._getTool=function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},r.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._toggleEffects(!1),this.tools={},null===(t=this.wrapper)||void 0===t||t.remove(),gt.prototype.remove.apply(this,e),this},r.prototype.startAutoscroll=function(){var t=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout((function(){t._toggleAutoscrollFx(!0),requestAnimationFrame(t.autoscroll)}),0)},r.prototype.autoscroll=function(){if(this.dragging){var e=this.lastClientY,n=this.em.Canvas,r=this.getWindow(),o=r.pageYOffset,i=e||0,a=n.getConfig().autoscrollLimit,s=this.getRect().height-a,l=o;if(i<a&&(l-=a-i),i>s&&(l+=i-s),!(0,t.isUndefined)(e)&&l!==o&&l>0&&l<this.lastMaxHeight)this.getGlobalToolsEl().style.opacity="0",this.showGlobalTools(),r.scrollTo(0,l),n.spots.refreshDbn();requestAnimationFrame(this.autoscroll)}},r.prototype.updateClientY=function(t){t.preventDefault(),this.lastClientY=(0,vt.VB)(t).clientY*this.em.getZoomDecimal()},r.prototype.showGlobalTools=function(){this.getGlobalToolsEl().style.opacity=""},r.prototype.stopAutoscroll=function(){this.dragging&&this._toggleAutoscrollFx(!1)},r.prototype._toggleAutoscrollFx=function(t){this.dragging=t;var e=this.getWindow(),n=t?"on":"off",r={on:vt.on,off:vt.S1};r[n](e,"mousemove dragover",this.updateClientY),r[n](e,"mouseup",this.stopAutoscroll)},r.prototype.render=function(){var t=this,e=t.$el,n=t.ppfx,r=t.em;return e.attr({class:"".concat(n,"frame")}),this.renderScripts(),r.trigger("frame:render",this),this},r.prototype.renderScripts=function(){var e=this,n=this,r=n.el,o=n.model,i=n.em,a="frame:load",s={el:r,model:o,view:this},l=this.getCanvasModel(),c=function(n){var o;if(n.length>0){var l=n.shift(),u=(0,vt.ut)("script",jt({type:"text/javascript"},(0,t.isString)(l)?{src:l}:l));null===(o=r.contentDocument)||void 0===o||o.head.appendChild(u),u.hasAttribute("nomodule")&&"noModule"in HTMLScriptElement.prototype?c(n):u.onerror=u.onload=c.bind(null,n)}else null==i||i.trigger(dt.frameLoadHead,s),e.renderBody(),null==i||i.trigger(dt.frameLoadBody,s),null==i||i.trigger(a,s)};r.onload=function(){var t=e.config.frameContent;if(t){var n=e.getDoc();n.open(),n.write(t),n.close()}s.window=e.getWindow(),null==i||i.trigger("".concat(a,":before"),s),null==i||i.trigger(dt.frameLoad,s),c(function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],l.get("scripts"),!0))}},r.prototype.renderStyles=function(e){void 0===e&&(e={});var n=this.getHead(),r=this.getCanvasModel(),o=function(e){return e.map((function(e){return{tag:"link",attributes:jt({rel:"stylesheet"},(0,t.isString)(e)?{href:e}:e)}}))},i=o(e.prev||r.previous("styles")),a=o(r.get("styles")),s=[],l=[],c=function(t,e,n){t.forEach((function(t){var r=t.attributes.href;!e.some((function(t){return t.attributes.href===r}))&&n.push(t)}))};c(a,i,l),c(i,a,s),s.forEach((function(t){var e,r=n.querySelector('link[href="'.concat(t.attributes.href,'"]'));null===(e=null==r?void 0:r.parentNode)||void 0===e||e.removeChild(r)})),(0,vt.SJ)(n,l)},r.prototype.renderBody=function(){var t,n,r=this,o=this,i=o.config,a=o.em,s=o.model,l=o.ppfx,c=this.getDoc(),u=this.getBody(),p=this.getWindow(),d=s.hasAutoHeight(),f=a.config;p._isEditor=!0,this.renderStyles({prev:[]});(0,vt.R3)(u,"<style>\n ".concat(f.baseCss||i.frameStyle||"","\n\n ").concat(d?"body { overflow: hidden }":"",'\n\n [data-gjs-type="wrapper"] {\n ').concat(d?"":"min-height: 100vh;","\n padding-top: 0.001em;\n }\n\n .").concat(l,"dashed *[data-gjs-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(l,"selected {\n outline: 2px solid #3b97e3 !important;\n outline-offset: -2px;\n }\n\n .").concat(l,"selected-parent {\n outline: 2px solid ").concat("#ffca6f"," !important\n }\n\n .").concat(l,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(l,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(l,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(l,"pointer-init {\n pointer-events: initial;\n }\n\n .").concat(l,"plh-image {\n background: #f5f5f5;\n border: none;\n height: 100px;\n width: 100px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .").concat(l,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(l,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(l,"is__grabbing,\n .").concat(l,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(f.canvasCss||"","\n ").concat(f.protectedCss||"","\n </style>"));var h=s.root,g=a.Components.getType("wrapper").view;this.wrapper=new g({model:h,config:jt(jt({},h.config),{em:a,frameView:this})}).render(),(0,vt.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,vt.R3)(u,new Et({collection:s.getStyles(),config:jt(jt({},a.Css.getConfig()),{frameView:this})}).render().el),(0,vt.R3)(u,this.getJsContainer()),(0,vt.on)(u,"click",(function(t){var e;return t&&"A"==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,vt.on)(u,"submit",(function(t){return t&&t.preventDefault()})),[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"mousedown mousemove mouseup",class:"MouseEvent"},{event:"pointerdown pointermove pointerup",class:"PointerEvent"},{event:"wheel",class:"WheelEvent",opts:{passive:!i.infiniteCanvas}}].forEach((function(t){return t.event.split(" ").forEach((function(e){c.addEventListener(e,(function(e){return r.el.dispatchEvent((0,vt.t3)(e,t.class))}),t.opts)}))})),this._toggleEffects(!0),(0,e.hasDnd)(a)&&(this.droppable=new At(a,null===(n=this.wrapper)||void 0===n?void 0:n.el)),this.loaded=!0,s.trigger("loaded")},r.prototype._toggleEffects=function(t){var e=t?vt.on:vt.S1,n=this.getWindow();n&&e(n,"".concat(vt.G1," resize"),this._emitUpdate)},r.prototype._emitUpdate=function(){this.model._emitUpdated()},r}(gt);const Nt=Mt;var Rt=P(668),Lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It=function(){return It=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},It.apply(this,arguments)},Dt=function(e){function n(n,r){var o=e.call(this,{model:n})||this;return(0,t.bindAll)(o,"onScroll","frameLoaded","updateOffset","remove","startDrag"),It(It({},n.config),{frameWrapView:o}),o.cv=r,o.frame=new Nt(n,o),o.classAnim="".concat(o.ppfx,"frame-wrapper--anim"),o.updateOffset=(0,t.debounce)(o.updateOffset.bind(o),0),o.updateSize=(0,t.debounce)(o.updateSize.bind(o),0),o.listenTo(n,"loaded",o.frameLoaded),o.listenTo(n,"change:x change:y",o.updatePos),o.listenTo(n,"change:width change:height",o.updateSize),o.listenTo(n,"destroy remove",o.remove),o.updatePos(),o.setupDragger(),o}return Lt(n,e),n.prototype.events=function(){return{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"}},n.prototype.setupDragger=function(){var t,e,n,r=this,o=this.module,i=this.model,a=function(t){o.toggleFramesEvents(t)};this.dragger=new Rt.Z({onStart:function(){var o=i.attributes,s=o.x,l=o.y;n=r.em.getZoomMultiplier(),t=s,e=l,a(!1)},onEnd:function(){return a(!0)},setPosition:function(r){i.set({x:t+r.x*n,y:e+r.y*n})}})},n.prototype.startDrag=function(t){var e;t&&(null===(e=this.dragger)||void 0===e||e.start(t))},n.prototype.__clear=function(t){var e=this.frame;e&&e.remove(t),(0,vt.L_)(this.elTools)},n.prototype.remove=function(t){var e=this;return this.__clear(t),gt.prototype.remove.apply(this,t),["frame","dragger","cv","elTools"].forEach((function(t){return e[t]=0})),this},n.prototype.updateOffset=function(){var t,e=this,n=e.em,r=e.$el,o=e.frame;n&&!n.destroyed&&(n.runDefault({preserveSelected:1}),r.removeClass(this.classAnim),null===(t=null==o?void 0:o.model)||void 0===t||t._emitUpdated())},n.prototype.updatePos=function(t){var e=this.model,n=this.el,r=e.attributes,o=r.x,i=r.y,a=n.style;this.frame.rect=void 0,a.left=isNaN(o)?o:"".concat(o,"px"),a.top=isNaN(i)?i:"".concat(i,"px"),t&&this.updateOffset()},n.prototype.updateSize=function(){this.updateDim()},n.prototype.updateDim=function(){var e=this,n=e.em,r=e.el,o=e.$el,i=e.model,a=e.classAnim,s=e.frame;if(s){s.rect=void 0,o.addClass(a);var l=this.__handleSize(),c=l.noChanges,u=l.width,p=l.height;((0,t.isNull)(u)||(0,t.isNull)(p))&&i.set(It(It({},u?{}:{width:r.offsetWidth}),p?{}:{height:r.offsetHeight}),{silent:1}),n.stopDefault({preserveSelected:1}),c?this.updateOffset():setTimeout(this.updateOffset,350)}},n.prototype.onScroll=function(){var t=this.frame;this.em.trigger("frame:scroll",{frame:t,body:t.getBody(),target:t.getWindow()})},n.prototype.frameLoaded=function(){var t=this.frame;this.config,t.getWindow().onscroll=this.onScroll,this.updateDim()},n.prototype.__handleSize=function(){var e,n,r=this.model,o=this.el.style,i=r.attributes,a=i.width,s=i.height,l=o.width||"",c=o.height||"",u=a||"",p=s||"",d=l==u&&c==p,f=(0,t.isNumber)(u)?"".concat(u).concat("px"):u,h=(0,t.isNumber)(p)?"".concat(p).concat("px"):p;if(o.width=f,r.hasAutoHeight()){var g=this.frame.el;if(g.contentDocument){var v=g.contentDocument,m=new ResizeObserver((function(){o.height="".concat(v.body.scrollHeight,"px")}));m.observe(v.body),null===(e=this.sizeObserver)||void 0===e||e.disconnect(),this.sizeObserver=m}}else o.height=h,null===(n=this.sizeObserver)||void 0===n||n.disconnect(),delete this.sizeObserver;return{noChanges:d,width:a,height:s,newW:u,newH:p}},n.prototype.render=function(){var t=this,e=t.frame,n=t.$el,r=t.ppfx,o=t.cv,i=t.model,a=t.el,s=i.attributes.onRender;this.__clear(),this.__handleSize(),e.render(),n.empty().attr({class:"".concat(r,"frame-wrapper")}).append('\n <div class="'.concat(r,'frame-wrapper__top gjs-two-color" data-frame-top>\n <div class="').concat(r,'frame-wrapper__name" data-action-move>\n ').concat(i.get("name")||"",'\n </div>\n <div class="').concat(r,'frame-wrapper__top-r">\n <div class="').concat(r,'frame-wrapper__icon" data-action-remove style="display: none">\n <svg viewBox="0 0 24 24"><path d="M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z"></path></svg>\n </div>\n </div>\n </div>\n <div class="').concat(r,'frame-wrapper__right" data-frame-right></div>\n <div class="').concat(r,'frame-wrapper__left" data-frame-left></div>\n <div class="').concat(r,'frame-wrapper__bottom" data-frame-bottom></div>\n ')).append(e.el);var l=(0,vt.ut)("div",{class:"".concat(r,"tools"),style:"pointer-events:none; display: none"},'\n <div class="'.concat(r,'highlighter" data-hl></div>\n <div class="').concat(r,'badge" data-badge></div>\n <div class="').concat(r,'placeholder">\n <div class="').concat(r,'placeholder-int"></div>\n </div>\n <div class="').concat(r,'ghost"></div>\n <div class="').concat(r,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(r,'resizer"></div>\n <div class="').concat(r,'offset-v" data-offset>\n <div class="gjs-marginName" data-offset-m>\n <div class="gjs-margin-v-el gjs-margin-v-top" data-offset-m-t></div>\n <div class="gjs-margin-v-el gjs-margin-v-bottom" data-offset-m-b></div>\n <div class="gjs-margin-v-el gjs-margin-v-left" data-offset-m-l></div>\n <div class="gjs-margin-v-el gjs-margin-v-right" data-offset-m-r></div>\n </div>\n <div class="gjs-paddingName" data-offset-m>\n <div class="gjs-padding-v-el gjs-padding-v-top" data-offset-p-t></div>\n <div class="gjs-padding-v-el gjs-padding-v-bottom" data-offset-p-b></div>\n <div class="gjs-padding-v-el gjs-padding-v-left" data-offset-p-l></div>\n <div class="gjs-padding-v-el gjs-padding-v-right" data-offset-p-r></div>\n </div>\n </div>\n <div class="').concat(r,'offset-fixed-v"></div>\n '));this.elTools=l;var c=null==o?void 0:o.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector("[data-frame-top]"),elRight:a.querySelector("[data-frame-right]"),elBottom:a.querySelector("[data-frame-bottom]"),elLeft:a.querySelector("[data-frame-left]"),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(gt);const Ft=Dt;var Vt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,"reset",r.render),r.canvasView=n.canvasView,r._module=n.module,r}return Vt(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.clearItems=function(){(this.viewCollection||[]).forEach((function(t){return t.remove()})),this.viewCollection=[]},e.prototype.renderView=function(t,e){return new Ft(t,this.canvasView)},e}(yt);const zt=Bt;var Ht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$t=function(){return $t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$t.apply(this,arguments)},Wt=function(n){function r(e){var r=n.call(this,{model:e})||this;r.ready=!1,(0,t.bindAll)(r,"clearOff","onKeyPress","onWheel","onPointer");var o=r,i=o.em,a=o.pfx,s=o.ppfx,l=r.module.events;return r.className="".concat(a,"canvas ").concat(s,"no-touch-actions").concat(i.config.customUI?"":" ".concat(a,"canvas-bg")),r.clsUnscale="".concat(a,"unscale"),r._initFrames(),r.listenTo(i,l.refresh,r.clearOff),r.listenTo(i,"component:selected",r.checkSelected),r.listenTo(i,"".concat(l.coords," ").concat(l.zoom),r.updateFrames),r.listenTo(e,"change:frames",r._onFramesUpdate),r.toggleListeners(!0),r}return Ht(r,n),r.prototype.template=function(){var t=this.pfx;return'\n <div class="'.concat(t,'canvas__frames" data-frames>\n <div class="').concat(t,'canvas__spots" data-spots></div>\n </div>\n <div id="').concat(t,'tools" class="').concat(t,'canvas__tools" data-tools></div>\n <style data-canvas-style></style>\n ')},r.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},r.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,o=t.em,i=n.frames;o.set("readyCanvas",0),i.once("loaded:all",(function(){return o.set("readyCanvas",1)})),null==e||e.remove(),this.frames=new zt({collection:i},$t($t({},r),{canvasView:this}))},r.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,o=this.em.getCurrentFrame();r&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t.frameView===o&&t.scrollIntoView(r)})))},r.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return null===(t=this.frames)||void 0===t||t.remove(),this.frames=void 0,gt.prototype.remove.apply(this,e),this.toggleListeners(!1),this},r.prototype.preventDefault=function(t){var e;t&&(t.preventDefault(),null===(e=t._parentEvent)||void 0===e||e.preventDefault())},r.prototype.toggleListeners=function(t){var e=this.el,n=this.config,r=t?vt.on:vt.S1;r(document,"keypress",this.onKeyPress),r(window,"scroll resize",this.clearOff),r(e,"wheel",this.onWheel,{passive:!n.infiniteCanvas}),r(e,"pointermove",this.onPointer)},r.prototype.screenToWorld=function(t,e){var n=this.module,r=n.getCoords(),o=n.getZoomMultiplier(),i=this.getViewportDelta();return{x:(t-r.x-i.x)*o,y:(e-r.y-i.y)*o}},r.prototype.onPointer=function(t){if(this.config.infiniteCanvas){var e=this.getCanvasOffset(),n=(0,vt.GX)(),r={x:t.clientX-e.left+n.x,y:t.clientY-e.top+n.y};if(t._parentEvent){var o=t.target.getBoundingClientRect(),i=this.module.getZoomDecimal();r.x=o.left-e.left+n.x+t.clientX*i,r.y=o.top-e.top+n.y+t.clientY*i}this.model.set({pointerScreen:r,pointer:this.screenToWorld(r.x,r.y)})}},r.prototype.onKeyPress=function(t){var e=this.em;" "!==(0,vt.sN)(t)||1===e.getZoomDecimal()||e.Canvas.isInputFocused()||(this.preventDefault(t),e.Editor.runCommand("core:canvas-move"))},r.prototype.onWheel=function(t){var e=this.module;if(this.config.infiniteCanvas){this.preventDefault(t);var n=t.deltaX,r=t.deltaY,o=e.getZoomDecimal(),i=(0,vt.Vb)(t),a=e.getCoords();if(i){var s=o-r*o*.01;e.setZoom(100*s);var c=this.model.getPointerCoords(l.vA.Screen),u=this.getCanvasOffset(),p=c.x-u.width/2,d=c.y-u.height/2,f=s/o,h=p-(p-a.x)*f,g=d-(d-a.y)*f;e.setCoords(h,g)}else this.onPointer(t),e.setCoords(a.x-n,a.y-r)}},r.prototype.updateFrames=function(t){var e=this.em,n=this.toolsWrapper,r={preserveSelected:1};this.updateFramesArea(),this.clearOff(),n.style.display="none",e.trigger("canvas:update",t),this.timerZoom&&clearTimeout(this.timerZoom),this.timerZoom=setTimeout((function(){e.stopDefault(r),e.runDefault(r),n.style.display=""}),300)},r.prototype.updateFramesArea=function(){var t=this,e=t.framesArea,n=t.model,r=t.module,o=t.cvStyle,i=t.clsUnscale,a=r.getZoomMultiplier();if(e){var s=n.attributes,l=s.x,c=s.y,u=r.getZoomDecimal();e.style.transform="scale(".concat(u,") translate(").concat(l*a,"px, ").concat(c*a,"px)")}o&&(o.innerHTML="\n .".concat(i," { scale: ").concat(a," }\n "))},r.prototype.fitViewport=function(n){var r,o;void 0===n&&(n={});var i=this,a=i.em,s=i.module,l=i.model,c=this.getCanvasOffset(),u=n.el,p=u&&(null===(r=(0,e.getComponentView)(u))||void 0===r?void 0:r.frameView),d=p?p.model:n.frame||a.getCurrentFrameModel()||l.frames.at(0),f=d.attributes,h=f.x,g=f.y,v={x:null!=h?h:0,y:null!=g?g:0,width:d.width,height:d.height};if(u){var m=this.getElBoxRect(u);v.x=v.x+m.x,v.y=v.y+m.y,v.width=m.width,v.height=m.height}var y=n.ignoreHeight,b=null!==(o=n.gap)&&void 0!==o?o:0,w=(0,t.isNumber)(b),x=w?b:b.x,_=w?b:b.y,C=v.width+2*x,S=v.height+2*_,O=c.width,E=c.height,k=O/C,T=E/S,A=y?k:Math.min(k,T),P=100*A;s.setZoom(P);var j={x:(-v.x+(d.width>=O?O/2-C/2:-x)+x)*A,y:(-v.y+E/2-S/2+_)*A};if(y){var M=s.getZoomMultiplier(),N=(E*M-E)/2;j.y=(-v.y+_)*A-N/M}s.setCoords(j.x,j.y)},r.prototype.isElInViewport=function(t){var n=(0,e.getElement)(t),r=(0,vt.Ut)(n),o=this.getFrameOffset(n),i=r.top,a=r.left;return i>=0&&a>=0&&i<=o.height&&a<=o.width},r.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,r=(0,vt.Ut)(t),o=n?{x:0,y:0}:(0,vt.GX)(t);return{top:r.top+o.y,left:r.left+o.x,width:r.width,height:r.height}},r.prototype.getRectToScreen=function(t){var e,n,r,o,i=this.module.getZoomDecimal(),a=this.module.getCoords(),s=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*i+a.x+s.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*i+a.y+s.y||0,width:(null!==(r=t.width)&&void 0!==r?r:0)*i,height:(null!==(o=t.height)&&void 0!==o?o:0)*i}},r.prototype.getElBoxRect=function(t,n){var r,o,i;void 0===n&&(n={});var a=this.module,s=(0,vt.Ut)(t),l=s.width,c=s.height,u=s.left,p=s.top,d=null===(r=(0,e.getComponentView)(t))||void 0===r?void 0:r.frameView,f=null==d?void 0:d.getBoxRect(),h=a.getZoomMultiplier(),g=null!==(o=null==f?void 0:f.x)&&void 0!==o?o:0,v=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,m=this.el,y=(0,vt.GX)(),b={x:u+g+(m.scrollLeft+y.x)*h,y:p+v+(m.scrollTop+y.y)*h,width:l,height:c};return n.local&&(b.x=u,b.y=p),n.toScreen?this.getRectToScreen(b):b},r.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,r=e.left,o=e.width,i=e.height,a=this.module;if(t.toWorld){var s=a.getZoomMultiplier(),l=a.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*s,y:(-l.y-c.y||0)*s,width:o*s,height:i*s}}return{x:r,y:n,width:o,height:i}},r.prototype.getViewportDelta=function(t){var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),r=n.width,o=n.height;return{x:(r*e-r)/2/e,y:(o*e-o)/2/e}},r.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},r.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,o=r?r.frameElement:n;this.frmOff=this.offset(o||n)}return this.frmOff},r.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},r.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.module.getZoomDecimal(),r=this.getFrameOffset(t),o=this.el,i=this.getCanvasOffset(),a=this.offset(t,e),s=e.avoidFrameOffset?0:r.top,l=e.avoidFrameOffset?0:r.left,c=e.avoidFrameZoom?a.top:a.top*n,u=e.avoidFrameZoom?a.left:a.left*n;return{top:e.avoidFrameOffset?c:c+s-i.top+o.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+o.scrollLeft,height:e.avoidFrameZoom?a.height:a.height*n,width:e.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},r.prototype.getElementOffsets=function(t){if(!t||(0,vt.BM)(t))return{};var e={},n=window.getComputedStyle(t),r=this.module.getZoomDecimal();return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"].forEach((function(t){e[t]=parseFloat(n[t])*r})),e},r.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var r=n.body,o=this.module.getZoomDecimal(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:r.scrollTop)*o-a.top,left:i.left+(s?0:r.scrollLeft)*o-a.left,width:a.width,height:a.height}},r.prototype.updateScript=function(t){var e=t.model,n=e.getId();if(!t.scriptContainer){t.scriptContainer=(0,vt.ut)("div",{"data-id":n});var r=this.getJsContainer();null==r||r.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML="";var o=document.createElement("script"),i=e.getScriptString(),a=e.get("script-props")?i:"function(){\n".concat(i,"\n;}"),s=JSON.stringify(e.__getScriptProps());o.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(a,".bind(item))(").concat(s,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(o)}),0)},r.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},r.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},r.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,o=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var a=i.at(0),s=null==a?void 0:a.view;r.setCurrentFrame(s),null==o||o.appendChild(n.el),this.frame=s,this.updateFramesArea()}},r.prototype.renderFrames=function(){this._renderFrames()},r.prototype.render=function(){var t=this,n=t.el,r=t.$el,o=t.ppfx,i=t.config,a=t.em;r.html(this.template());var s=r.find("[data-frames]");this.framesArea=s.get(0);var l=r.find("[data-tools]");return this.toolsWrapper=l.get(0),l.append('\n <div class="'.concat(o,"tools ").concat(o,'tools-gl" style="pointer-events:none">\n <div class="').concat(o,'placeholder">\n <div class="').concat(o,'placeholder-int"></div>\n </div>\n </div>\n <div id="').concat(o,'tools" style="pointer-events:none">\n ').concat(i.extHl?'<div class="'.concat(o,'highlighter-sel"></div>'):"",'\n <div class="').concat(o,'badge"></div>\n <div class="').concat(o,'ghost"></div>\n <div class="').concat(o,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(o,'resizer"></div>\n <div class="').concat(o,'offset-v"></div>\n <div class="').concat(o,'offset-fixed-v"></div>\n </div>\n ')),this.toolsEl=n.querySelector("#".concat(o,"tools")),this.hlEl=n.querySelector(".".concat(o,"highlighter")),this.badgeEl=n.querySelector(".".concat(o,"badge")),this.placerEl=n.querySelector(".".concat(o,"placeholder")),this.ghostEl=n.querySelector(".".concat(o,"ghost")),this.toolbarEl=n.querySelector(".".concat(o,"toolbar")),this.resizerEl=n.querySelector(".".concat(o,"resizer")),this.offsetEl=n.querySelector(".".concat(o,"offset-v")),this.fixedOffsetEl=n.querySelector(".".concat(o,"offset-fixed-v")),this.toolsGlobEl=n.querySelector(".".concat(o,"tools-gl")),this.spotsEl=n.querySelector("[data-spots]"),this.cvStyle=n.querySelector("[data-canvas-style]"),this.el.className=(0,e.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},r}(gt);const Ut=Wt;var qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gt=function(){return Gt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Gt.apply(this,arguments)},Kt=function(n){function r(t){var e=n.call(this,t,"Canvas",m)||this;return e.events=pt,e.framesById={},e.canvas=new at(e),e.spots=new ut(e),e.model=e.canvas,e.startAutoscroll=e.startAutoscroll.bind(e),e.stopAutoscroll=e.stopAutoscroll.bind(e),e}return qt(r,n),r.prototype.getCanvasView=function(){return this.canvasView},r.prototype.postLoad=function(){this.model.init()},r.prototype.getModel=function(){return this.canvas},r.prototype.getElement=function(){return this.getCanvasView().el},r.prototype.getFrame=function(t){return this.getFrames()[t||0]},r.prototype.getFrameEl=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.el},r.prototype.getFramesEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.framesArea},r.prototype.getWindow=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.getWindow()},r.prototype.getDocument=function(){var t=this.getFrameEl();return null==t?void 0:t.contentDocument},r.prototype.getBody=function(){var t=this.getDocument();return null==t?void 0:t.body},r.prototype._getLocalEl=function(t,e,n){var r=t,o=null==e?void 0:e.frameView;return r=o?o[n]():r},r.prototype.getGlobalToolsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.toolsGlobEl},r.prototype.getToolsEl=function(t){return this._getLocalEl(this.getCanvasView().toolsEl,t,"getToolsEl")},r.prototype.getHighlighter=function(t){return this._getLocalEl(this.getCanvasView().hlEl,t,"getHighlighter")},r.prototype.getBadgeEl=function(t){return this._getLocalEl(this.getCanvasView().badgeEl,t,"getBadgeEl")},r.prototype.getPlacerEl=function(){return this.getCanvasView().placerEl},r.prototype.getGhostEl=function(){return this.getCanvasView().ghostEl},r.prototype.getToolbarEl=function(){return this.getCanvasView().toolbarEl},r.prototype.getResizerEl=function(){return this.getCanvasView().resizerEl},r.prototype.getOffsetViewerEl=function(t){return this._getLocalEl(this.getCanvasView().offsetEl,t,"getOffsetViewerEl")},r.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},r.prototype.getSpotsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.spotsEl},r.prototype.render=function(){var t;return null===(t=this.canvasView)||void 0===t||t.remove(),this.canvasView=new Ut(this.canvas),this.canvasView.render().el},r.prototype.getOffset=function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());return{top:t.top-e.top,left:t.left-e.left}},r.prototype.offset=function(t){return this.getCanvasView().offset(t)},r.prototype.setCustomBadgeLabel=function(t){this.config.customBadgeLabel=t},r.prototype.getElementPos=function(t,e){return this.getCanvasView().getElementPos(t,e)},r.prototype.getElementOffsets=function(t){return this.getCanvasView().getElementOffsets(t)},r.prototype.getRect=function(){var t,e=null!==(t=this.getCanvasView().getPosition())&&void 0!==t?t:{},n=e.top,r=void 0===n?0:n,o=e.left,i=void 0===o?0:o;return Gt(Gt({},this.getCanvasView().getCanvasOffset()),{topScroll:r,leftScroll:i})},r.prototype.getTargetToElementDim=function(t,e,n){void 0===n&&(n={});var r=n||{},o=this.getCanvasView().getPosition();if(o){var i=r.elPos||this.getCanvasView().getElementPos(e),a=n.toRight||0,s=r.targetHeight||t.offsetHeight,l=r.targetWidth||t.offsetWidth,c=r.event||null,u=i.top-s,p=i.left;p+=a?i.width:0;var d=(p=a?p-l:p)<o.left?o.left:p,f=u<o.top?o.top:u,h={top:f=f>i.top+i.height?i.top+i.height:f,left:d,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:o.top,canvasLeft:o.left,canvasWidth:o.width,canvasHeight:o.height};return c&&this.em&&this.em.trigger(c,h),h}},r.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var o=function(t,e,o){void 0===e&&(e=1);var i=r.em.getZoomDecimal(),a=e?"top":"left",s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=s.body||{},h=f.scrollTop,g=void 0===h?0:h,v=f.scrollLeft,m=e?g:void 0===v?0:v,y=e?u:d;return o[a]-(m-y)*i};return{top:o(t,1,e),left:o(t,0,e)}},r.prototype.getTargetToElementFixed=function(e,n,r){void 0===r&&(r={});var o=r.pos||this.getElementPos(e,{noScroll:!0}),i=r.canvasOff||this.canvasRectOffset(e,o),a=n.offsetHeight||0,s=n.offsetWidth||0,l=o.left+o.width,c=this.getCanvasView(),u=c.getPosition(),p=c.getFrameOffset(e),d=r.event,f=-a,h=(0,t.isUndefined)(r.left)?o.width-s:r.left;if(h=o.left<-h?-o.left:h,h=l>u.width?h-(l-u.width):h,i.top<a){var g=o.height+a;g<p.height?f+=g:f=-i.top<o.height?-i.top:o.height}var v={top:f,left:h,canvasOffsetTop:i.top,canvasOffsetLeft:i.left,elRect:o,canvasOffset:i,canvasRect:u,targetWidth:s,targetHeight:a};return d&&this.em.trigger(d,v),v},r.prototype.getMouseRelativePos=function(t,e){void 0===e&&(e={});var n=e.subWinOffset,r=t.target.ownerDocument,o=r.defaultView||r.parentWindow,i=o.frameElement,a=n?o.pageYOffset:0,s=n?o.pageXOffset:0,l=this.getZoomMultiplier(),c=0,u=0;if(i){var p=i.getBoundingClientRect();c=p.top||0,u=p.left||0}return{y:(t.clientY+c-a)*l,x:(t.clientX+u-s)*l}},r.prototype.getMouseRelativeCanvas=function(t,e){var n,r=this.getZoomDecimal(),o=null!==(n=this.getCanvasView().getPosition(e))&&void 0!==n?n:{},i=o.top,a=void 0===i?0:i,s=o.left,l=void 0===s?0:s;return{y:t.clientY*r+a,x:t.clientX*r+l}},r.prototype.hasFocus=function(){return this.getDocument().hasFocus()},r.prototype.isInputFocused=function(){var t=this.getDocument(),e=this.getFrameEl(),n=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}(["body"],this.config.notTextable,!0),r=e&&document.activeElement===e?t&&t.activeElement:document.activeElement;return r&&!n.some((function(t){return r.matches(t)}))},r.prototype.scrollTo=function(t,n){void 0===n&&(n={});var r=(0,e.getElement)(t),o=r&&(0,e.getViewEl)(r);o&&o.scrollIntoView(n)},r.prototype.startAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.startAutoscroll()},r.prototype.stopAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll()},r.prototype.setZoom=function(t){return this.canvas.set("zoom","string"==typeof t?parseFloat(t):t),this},r.prototype.getZoom=function(){return parseFloat(this.canvas.get("zoom"))},r.prototype.setCoords=function(t,e,n){var r;void 0===n&&(n={});var o=t||0===t,i=e||0===e,a={x:this.canvas.get("x"),y:this.canvas.get("y")};if(o&&(a.x=parseFloat("".concat(t))),i&&(a.y=parseFloat("".concat(e))),n.toWorld){var s=null===(r=this.canvasView)||void 0===r?void 0:r.getViewportDelta();s&&(o&&(a.x=a.x-s.x),i&&(a.y=a.y-s.y))}return this.canvas.set(a),this},r.prototype.getCoords=function(){var t=this.canvas.attributes;return{x:t.x,y:t.y}},r.prototype.getPointer=function(t){var e=this.canvas.attributes,n=e.pointer,r=e.pointerScreen;return t?r:n},r.prototype.getZoomDecimal=function(){return this.getZoom()/100},r.prototype.getZoomMultiplier=function(){var t=this.getZoomDecimal();return t?1/t:1},r.prototype.fitViewport=function(t){var e;null===(e=this.canvasView)||void 0===e||e.fitViewport(t)},r.prototype.toggleFramesEvents=function(t){this.getFramesEl().style.pointerEvents=t?"":"none"},r.prototype.getFrames=function(){return this.canvas.frames.map((function(t){return t}))},r.prototype.addFrame=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.canvas.frames.add(new et(this,Gt({},t)),e)},r.prototype.getLastDragResult=function(){return this.em.get("dragResult")},r.prototype.addSpot=function(t,e){var n;void 0===e&&(e={});var r=t,o=this.getSpots(r);if(o.length){var i=o[0];return i.set(r),i}var a=r.componentView||(null===(n=r.component)||void 0===n?void 0:n.view),s=new st.Z(this,Gt(Gt({},r),{id:r.id||"cs_".concat(r.type,"_").concat(null==a?void 0:a.cid),type:r.type||""}));return this.spots.add(s,e),s},r.prototype.getSpots=function(t){return void 0===t&&(t={}),this.spots.where(t.id?{id:t.id}:t)},r.prototype.removeSpots=function(e){void 0===e&&(e={});var n=(0,t.isArray)(e)?e:this.getSpots(e);return this.spots.remove(n)},r.prototype.hasCustomSpot=function(t){var e=this.config.customSpots;return!!(!0===e||e&&t&&e[t])},r.prototype.getWorldRectToScreen=function(t){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.getRectToScreen(t)},r.prototype.refresh=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.events,o=e.canvasView;null==o||o.clearOff(),(t.spots||t.all)&&(this.refreshSpots(),n.trigger("canvas:updateTools")),n.set("canvasOffset",this.getOffset()),n.trigger(r.refresh,t)},r.prototype.refreshSpots=function(){this.spots.refresh()},r.prototype.destroy=function(){var t,e=this;this.canvas.stopListening(),null===(t=this.canvasView)||void 0===t||t.remove(),["model","droppable"].forEach((function(t){return e[t]={}}))},r}(g);const Yt=Kt,Xt={stylePrefix:"comp-",components:[],draggableComponents:!0,disableTextInnerChilds:!1,processor:void 0,useFrameDoc:!1,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]};var Zt="text/html",Jt=Zt;var Qt=function(){return Qt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qt.apply(this,arguments)},te="parse:html";const ee=function(e,n){return void 0===n&&(n={}),{compTypes:"",modelAttrStart:"data-gjs-",getPropAttribute:function(t,e){var n=t.replace(this.modelAttrStart,""),r=(null==e?void 0:e.length)||0,o=null==e?void 0:e.substring(0,1),i=null==e?void 0:e.substring(r-1),a="true"===e||"false"!==e&&e;try{a="{"==o&&"}"==i||"["==o&&"]"==i?JSON.parse(a):a}catch(t){}return{name:n,value:a}},splitPropsFromAttr:function(e){var n=this;void 0===e&&(e={});var r={},o={};return(0,t.each)(e,(function(t,e){if(0===e.indexOf(n.modelAttrStart)){var i=n.getPropAttribute(e,t);r[i.name]=i.value}else o[e]=t})),{props:r,attrs:o}},parseStyle:function(e){for(var n={};e.indexOf("/*")>=0;){var r=e.indexOf("/*"),o=e.indexOf("*/")+2;e=e.replace(e.slice(r,o),"")}for(var i=e.split(";"),a=0,s=i.length;a<s;a++){var l=i[a].trim();if(l){var c=l.split(":"),u=c[0].trim(),p=c.slice(1).join(":").trim();n[u]?((0,t.isArray)(n[u])||(n[u]=[n[u]]),n[u].push(p)):n[u]=p}}return n},parseClass:function(t){for(var e=[],n=t.split(" "),r=0,o=n.length;r<o;r++){var i=n[r].trim();i&&e.push(i)}return e},parseNode:function(e,r){void 0===r&&(r={});for(var o=[],i=e.childNodes,a=0,s=i.length;a<s;a++){var l=i[a],c=l.attributes||[],u=c.length,p=o[o.length-1],d=l.childNodes.length,f=this.compTypes,h={};if(f){var g="",v=l.getAttribute&&l.getAttribute("".concat(this.modelAttrStart,"type"));if(v)h={type:v};else{for(var m=0;m<f.length;m++){var y=f[m];if(g=y.model.isComponent(l,r)){"object"!=typeof g&&(g={type:y.id});break}}h=g}}if(!h.tagName){var b=l.tagName||"",w=l.namespaceURI||"";h.tagName=b&&"http://www.w3.org/1999/xhtml"===w?b.toLowerCase():b}u&&(h.attributes={});for(var x=0;x<u;x++){var _=c[x].nodeName,C=c[x].nodeValue;if("style"==_)h.style=this.parseStyle(C);else if("class"==_)h.classes=this.parseClass(C);else{if("contenteditable"==_)continue;if(0===_.indexOf(this.modelAttrStart)){var S=this.getPropAttribute(_,C);h[S.name]=S.value}else""===C&&!0===l[_]&&(C=!0),h.attributes[_]=C}}if(d&&!h.components){var O=l.childNodes[0];1===d&&3===O.nodeType?(!h.type&&(h.type="text"),h.components={type:"textnode",content:O.nodeValue}):h.components=this.parseNode(l,Qt(Qt({},r),{inSvg:r.inSvg||"svg"===h.type}))}if("textnode"==h.type){if(p&&"textnode"==p.type){p.content+=h.content;continue}if(!r.keepEmptyTextNodes){var E=l.nodeValue;if(" "!=E&&!E.trim())continue}}d||"/>"!=="".concat(l.outerHTML).slice(-2)||(h.void=!0);var k=h.components;if(!h.type&&k){for(var T=n.textTypes,A=void 0===T?[]:T,P=n.textTags,j=void 0===P?[]:P,M=1,N=0,R=0;R<k.length;R++){var L=k[R],I=L.type;if(!A.includes(I)&&!j.includes(L.tagName)){M=0;break}"textnode"===I&&(N=1)}M&&N&&(h.type="text")}!h.tagName&&(0,t.isUndefined)(h.content)||o.push(h)}return o},parse:function(r,o,i){var a;void 0===i&&(i={});var s=(null==e?void 0:e.get("Config"))||{},l={html:[]},c=Qt(Qt({},n),i),u=Qt(Qt(Qt({},n.optionsHtml),{htmlType:(null===(a=n.optionsHtml)||void 0===a?void 0:a.htmlType)||n.htmlType}),i),p=u.preParser,d=(0,t.isFunction)(p)?p(r,{editor:null==e?void 0:e.getEditor()}):r,f=(0,t.isFunction)(c.parserHtml)?c.parserHtml(d,u):function(e,n){void 0===n&&(n={});var r,o=new DOMParser,i=n.htmlType||Jt,a=i===Zt,s=a?e:"<div>".concat(e,"</div>"),l=o.parseFromString(s,i);if(a){var c=l.head,u=l.body,p=c.querySelectorAll("script");(0,t.each)(p,(function(t){return u.appendChild(t)}));var d=[];(0,t.each)(c.children,(function(t){return d.push(t)})),(0,t.each)(d,(function(t,e){return u.insertBefore(t,u.children[e])})),r=u}else r=l.firstChild;return r}(d,u),h=f.querySelectorAll("script"),g=h.length;if(!((0,t.isUndefined)(s.allowScripts)?u.allowScripts:s.allowScripts))for(;g--;)h[g].parentNode.removeChild(h[g]);if(u.allowUnsafeAttr&&u.allowUnsafeAttrValue||this.__sanitizeNode(f,u),o){for(var v=f.querySelectorAll("style"),m=v.length,y="";m--;)y=v[m].innerHTML+y,v[m].parentNode.removeChild(v[m]);y&&(l.css=o.parse(y))}null==e||e.trigger("".concat(te,":root"),{input:d,root:f});var b=this.parseNode(f,c),w=1!==b.length||c.returnArray?b:b[0];return l.html=w,null==e||e.trigger(te,{input:d,output:l}),l},__sanitizeNode:function(e,n){var r=this,o=e.attributes||[],i=e.childNodes||[],a=[];(0,t.each)(o,(function(t){var e=t.nodeName||"",r=t.nodeValue||"";!n.allowUnsafeAttr&&e.startsWith("on")&&a.push(e),!n.allowUnsafeAttrValue&&r.startsWith("javascript:")&&a.push(e)})),a.map((function(t){return e.removeAttribute(t)})),(0,t.each)(i,(function(t){return r.__sanitizeNode(t,n)}))}}};var ne=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),re=function(){return re=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},re.apply(this,arguments)},oe=ee(),ie=function(e){return(0,t.isArray)(e)?e[e.length-1]:e},ae=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return ne(r,n),r.prototype.parseStyle=function(t){return oe.parseStyle(t)},r.prototype.extendStyle=function(t){return re(re({},this.getStyle()),t)},r.prototype.getStyle=function(e){var n=this.get("style")||{},r=re({},n);return e&&(0,t.isString)(e)?r[e]:r},r.prototype.setStyle=function(n,r){var o=this;void 0===n&&(n={}),void 0===r&&(r={}),(0,t.isString)(n)&&(n=this.parseStyle(n));var i=this.getStyle(r);r.partial||r.avoidStore?(r.avoidStore=!0,n.__p=!0):delete n.__p;var a=re({},n),s=re({},a);(0,t.keys)(s).forEach((function(t){""===s[t]&&delete s[t]})),this.set("style",s,r);var l=(0,e.shallowDiff)(i,a);return delete l.__p,(0,t.keys)(l).forEach((function(t){var e=o.em;r.noEvent||(o.trigger("change:style:".concat(t)),e&&(e.trigger("styleable:change",o,t,r),e.trigger("styleable:change:".concat(t),o,t,r)))})),a},r.prototype.addStyle=function(t,e,n){var r;void 0===e&&(e=""),void 0===n&&(n={}),"string"==typeof t?((r={})[t]=e,t=r):n=e||{},n.addStyle=t,t=this.extendStyle(t),this.setStyle(t,n)},r.prototype.removeStyle=function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},r.prototype.styleToString=function(e){void 0===e&&(e={});var n=[],r=this.getStyle(e),o=e.important,i=function(e){var i=(0,t.isArray)(o)?o.indexOf(e)>=0:o;if("__"===e.substring(0,2))return"continue";var a=r[e];((0,t.isArray)(a)?a:[a]).forEach((function(t){var r="".concat(t).concat(i?" !important":"");r&&n.push("".concat(e,":").concat(r,";"))}))};for(var a in r)i(a);return n.join("")},r.prototype.getSelectors=function(){return this.get("selectors")||this.get("classes")},r.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},r}(l.Hn);const se=ae;var le=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(){return ce=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ce.apply(this,arguments)},ue=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},pe=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},de=function(e,n){return void 0===n&&(n=[]),e?(((0,t.isArray)(e)||(0,t.isFunction)(e.map)?e:[e]).map((function(t){n.push(t.getId()),de(t.components().models,n)})),n):[]},fe=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),r.visitedCmps=r.visitedCmps||{};var o=r.visitedCmps;return((0,t.isArray)(e)?e:[e]).map((function(e){var i=e.attributes,a=void 0===i?{}:i,s=e.components,l=e.tagName,c=e.style,u=a.id;a.draggable;var p=ue(a,["id","draggable"]),d=e;if(u)if(o[u])o[u].push(d),u=nn.getNewId(n),d.attributes.id=u;else if(o[u]=[],n[u]){var f=d=n[u];l&&f.set({tagName:l},ce(ce({},r),{silent:!0})),(0,t.keys)(p).length&&f.addAttributes(p,ce({},r)),(0,t.keys)(c).length&&f.addStyle(c,r)}if(s){var h=fe(s,n);if((0,t.isFunction)(d.components)){var g=d.components();g.length>0&&g.reset(h,r)}else d.components=h}return d}))},he=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return le(n,e),n.prototype.initialize=function(t,e){void 0===e&&(e={}),this.opt=e,this.listenTo(this,"add",this.onAdd),this.listenTo(this,"remove",this.removeChildren),this.listenTo(this,"reset",this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||(null==n?void 0:n.Components)},n.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var r=this,o=e.previousModels||[],i=o.filter((function(e){return!t.get(e.cid)})),a=de(t),s=de(o).filter((function(t){return a.indexOf(t)>=0}));e.keepIds=(e.keepIds||[]).concat(s),i.forEach((function(t){return n.removeChildren(t,r,e)})),t.each((function(t){return n.onAdd(t)}))},n.prototype.resetFromString=function(t,e){var n,r;void 0===t&&(t=""),void 0===e&&(e={}),e.keepIds=de(this);var o=this,i=o.domc,a=o.em,s=o.parent,l=null==a?void 0:a.Css,c=(null==i?void 0:i.allById())||{},u=this.parseString(t,e),p=fe(u,c,e),d=e.visitedCmps,f=void 0===d?{}:d;Object.keys(f).forEach((function(t){var e=f[t];if(e.length){var n=(null==l?void 0:l.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set("selectors",["#".concat(t.attributes.id)]),l.getAll().add(n)}))}))}})),this.reset(p,e),null==a||a.trigger("component:content",s,e,t),null===(r=(n=s).__checkInnerChilds)||void 0===r||r.call(n)},n.prototype.removeChildren=function(t,e,n){var r=this;if(void 0===n&&(n={}),t){var o=this.domc,i=this.em,a=n.temporary||n.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(s)<0;delete(o?o.allById():{})[s];var p=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(s)})),n):[];l.remove(p.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(i.Commands.run("core:component-style-clear",{target:t}),t.removed(),t.trigger("removed"),i.trigger("component:remove",t)),t.components().forEach((function(t){return r.removeChildren(t,e,n)}))}var d=t.components();i.stopListening(d),i.stopListening(t),i.stopListening(t.get("classes")),t.__postRemove()}},n.prototype.model=function(t,e){var n,r=e.collection.opt,o=r.em,i=o.Components.componentTypes;e.em=o,e.config=r.config,e.componentTypes=i,e.domc=r.domc;for(var a=0;a<i.length;a++){if(i[a].id==t.type){n=i[a].model;break}}return n||(n=i[i.length-1].model,o&&t.type&&o.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new n(t,e)},n.prototype.parseString=function(t,e){void 0===e&&(e={});var n=this.em,r=this.domc,o=n.Css,i=n.Parser.parseHtml(t);if(nn.checkId(i.html,i.css,r.componentsById,e),i.css&&o&&!e.temporary){e.at;var a=ue(e,["at"]);o.addCollection(i.css,ce(ce({},a),{extend:1}))}return i.html},n.prototype.add=function(e,n){var r=this;void 0===n&&(n={}),n.keepIds=pe(pe([],n.keepIds||[],!0),de(n.previousModels),!0),(0,t.isString)(e)?e=this.parseString(e,n):(0,t.isArray)(e)&&(e=pe([],e,!0)).forEach((function(o,i){if((0,t.isString)(o)){var a=r.parseString(o,n);e[i]=(0,t.isArray)(a)&&!a.length?null:a}}));var o=(0,t.isArray)(e);e=(o?e:[e]).filter(Boolean).map((function(t){return r.processDef(t)})),e=o?(0,t.flatten)(e,1):e[0];var i=l.FE.prototype.add.apply(this,[e,n]);return this.__firstAdd=i,i},n.prototype.processDef=function(e){if(e.cid&&e.ccid)return e;var n=this.em,r=this.config,o=(void 0===r?{}:r).processor,i=e;if(o){var a=o(i=ce({},i));a&&((0,t.each)(i,(function(t,e){return delete i[e]})),(0,t.extend)(i,a))}if(i.$$typeof&&"object"==typeof i.props){(i=ce({},i)).props=ce({},i.props);var s=n.Components,l=n.Parser.parserHtml;(0,t.each)(i,(function(e,n){(0,t.includes)(["props","type"],n)||delete i[n]}));var c=i.props,u=c.children;delete c.children,delete i.props;var p=l.splitPropsFromAttr(c);i.attributes=p.attrs,u&&(i.components=u),i.type?s.getType(i.type)||(i.tagName=i.type,delete i.type):i.type="textnode",(0,t.extend)(i,p.props)}return i},n.prototype.onAdd=function(e,n,r){void 0===r&&(r={});var o=this.domc,i=this.em,a=e.getStyle(),s=i&&i.getConfig().avoidInlineStyle;if(o&&o.Component.ensureInList(e),!(0,t.isEmpty)(a)&&!s&&i&&i.get&&i.getConfig().forceClass&&!r.temporary){var l=e.cid;i.Css.setClassRule(l,a),e.setStyle({}),e.addClass(l)}e.__postAdd({recursive:!0})},n}(l.FE);const ge=he;var ve=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),me=function(e){function n(t,r){void 0===r&&(r={});var o=e.call(this,t,r)||this,i=r.config,a=void 0===i?{}:i,s=o.get("name"),l=o.get("label");s?l||o.set("label",s):o.set("name",l);var c=o.get("name"),u=a.escapeName,p=u?u(c):n.escapeName(c);return o.set("name",p),o.em=r.em,o}return ve(n,e),n.prototype.defaults=function(){return{name:"",label:"",type:1,active:!0,private:!1,protected:!1,_undo:!0}},n.prototype.isId=function(){return 2===this.get("type")},n.prototype.isClass=function(){return 1===this.get("type")},n.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get("name"),r="";switch(this.get("type")){case 1:r=".";break;case 2:r="#"}return r+(e?e(n):n)},n.prototype.toString=function(){return this.getFullName()},n.prototype.getName=function(){return this.get("name")||""},n.prototype.getLabel=function(){return this.get("label")||""},n.prototype.setLabel=function(t){return this.set("label",t)},n.prototype.getActive=function(){return!!this.get("active")},n.prototype.setActive=function(t){return this.set("active",t)},n.prototype.toJSON=function(e){void 0===e&&(e={});var n=this.em,r=l.Hn.prototype.toJSON.call(this,[e]),o=(0,t.result)(this,"defaults");if(n&&n.getConfig().avoidDefaults){(0,t.forEach)(o,(function(t,e){r[e]===t&&delete r[e]})),r.label===r.name&&delete r.label;var i=(0,t.keys)(r).length;1===i&&r.name&&(r=r.name),2===i&&r.name&&r.type&&(r=this.getFullName())}return r},n.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\\:@\\/]+)/gi,"-")},n.TYPE_CLASS=1,n.TYPE_ID=2,n}(l.Hn);const ye=me;me.prototype.idAttribute="name";var be=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),we=function(t,e){return t.reduce((function(n,r,o){return n.concat(we(t.slice(o+1),"".concat(e).concat(r)))}),[e])},xe=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return be(n,e),n.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||ye.TYPE_CLASS)},n.prototype.getStyleable=function(){return(0,t.filter)(this.models,(function(t){return t.getActive()&&!t.get("private")}))},n.prototype.getValid=function(e){var n=(void 0===e?{}:e).noDisabled;return(0,t.filter)(this.models,(function(t){return!t.get("private")})).filter((function(t){return n?t.get("active"):1}))},n.prototype.getFullString=function(t,e){void 0===e&&(e={});var n=[];return(t||this).forEach((function(t){return n.push(t.getFullName(e))})),e.sort&&n.sort(),n.join("").trim()},n.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,r=[],o=this.map((function(e){return e.getFullName(t)})).sort();return e?o.forEach((function(t,e){r=r.concat(we(o.slice(e+1),t))})):r=o,n?r:e?r.join(","):r.join("")},n}(l.FE);const _e=xe;xe.prototype.model=ye;var Ce=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ce(e,t),e.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},e.prototype.getId=function(){return this.get("id")},e.prototype.getLabel=function(){return this.get("label")},e}(l.Hn);function Ee(t){var e=new Set,n=new Map,r={items:[]};t.forEach((function(t){var o=t.category;if(o){e.add(o);var i=n.get(o);i?i.push(t):n.set(o,[t])}else r.items.push(t)}));var o=Array.from(e).map((function(t){return{category:t,items:n.get(t)||[]}}));return Se(Se([],o,!0),[r],!1)}var ke=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Te="category",Ae=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return ke(r,n),r.prototype.initCategory=function(n){var r=n.get(Te),o=r instanceof Oe;if(r&&!o){(0,t.isString)(r)?r={id:r,label:r}:(0,e.isObject)(r)&&!r.id&&(r.id=r.label);var i=this.getCategories().add(r);return n.set(Te,i,{silent:!0}),i}if(o){i=r;return this.getCategories().add(i),i}},r}(l.FE),Pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),je=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Pe(r,n),r.prototype.add=function(r,o){return((0,t.isArray)(r)?r:[r]).forEach((function(t){return t&&(t.id=(0,e.normalizeKey)("".concat(t.id)))})),n.prototype.add.call(this,r,o)},r.prototype.get=function(r){return n.prototype.get.call(this,(0,t.isString)(r)?(0,e.normalizeKey)(r):r)},r}(l.FE);const Me=je;var Ne;je.prototype.model=Oe,function(t){t.select="trait:select",t.value="trait:value",t.custom="trait:custom",t.all="trait"}(Ne||(Ne={}));const Re=Ne;var Le=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ie=function(){return Ie=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ie.apply(this,arguments)},De=function(n){function r(t,e){var r=n.call(this,t)||this,o=r.attributes,i=o.target,a=o.name;return!r.get("id")&&r.set("id",a),i&&r.setTarget(i),r.em=e,r}return Le(r,n),r.prototype.defaults=function(){return{type:"text",label:"",name:"",unit:"",step:1,value:"",default:"",placeholder:"",category:"",changeProp:!1,options:[]}},Object.defineProperty(r.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"category",{get:function(){var t=this.get("category");return t instanceof Oe?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"component",{get:function(){return this.target},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"changeProp",{get:function(){return!!this.get("changeProp")},enumerable:!1,configurable:!0}),r.prototype.setTarget=function(e){if(e){var n=this.attributes,r=n.name,o=n.changeProp,i=n.value,a=n.getValue;this.target=e,this.unset("target");var s=o?"change:".concat(r):"change:attributes:".concat(r);this.listenTo(e,s,this.targetUpdated);var l=i||(a?void 0:this.getValue());!(0,t.isUndefined)(l)&&this.set({value:l},{silent:!0})}},r.prototype.getId=function(){return this.get("id")},r.prototype.getType=function(){return this.get("type")},r.prototype.getName=function(){return this.get("name")},r.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,r=void 0===n||n,o=this.getId(),i=this.get("label")||this.getName();return r&&(null===(e=this.em)||void 0===e?void 0:e.t("traitManager.traits.labels.".concat(o)))||i},r.prototype.getValue=function(t){return this.getTargetValue(t)},r.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={});var r=this.component,o=this.em,i=e.partial,a={},s=this.attributes.setValue;s?s({value:t,component:r,editor:null==o?void 0:o.getEditor(),trait:this,partial:!!i,options:e,emitUpdate:function(){return n.targetUpdated()}}):(i&&(a.avoidStore=!0),this.setTargetValue(t,a))},r.prototype.getDefault=function(){return this.get("default")},r.prototype.getOptions=function(){return this.get("options")||[]},r.prototype.getOption=function(t){var n=this,r=(0,e.isDef)(t)?t:this.getValue();return this.getOptions().filter((function(t){return n.getOptionId(t)===r}))[0]},r.prototype.getOptionId=function(t){return t.id||t.value},r.prototype.getOptionLabel=function(e,n){var r;void 0===n&&(n={});var o=n.locale,i=void 0===o||o,a=(0,t.isString)(e)?this.getOption(e):e,s=this.getOptionId(a),l=a.label||a.name||s,c=this.getName();return i&&(null===(r=this.em)||void 0===r?void 0:r.t("traitManager.traits.options.".concat(c,".").concat(s)))||l},r.prototype.getCategoryLabel=function(t){void 0===t&&(t={});var e=this.em,n=this.category,r=t.locale,o=void 0===r||r,i=null==n?void 0:n.getId(),a=null==n?void 0:n.getLabel();return o&&(null==e?void 0:e.t("traitManager.categories.".concat(i)))||a||""},r.prototype.runCommand=function(){var e=this.em,n=this.attributes.command;if(n&&e)return(0,t.isString)(n)?e.Commands.run(n):n(e.Editor,this)},r.prototype.props=function(){return this.attributes},r.prototype.targetUpdated=function(){var t=this.component,e=this.em,n=this.getTargetValue({useType:!0});this.set({value:n},{fromTarget:1});var r={trait:this,component:t,value:n};t.trigger(Re.value,r),null==e||e.trigger(Re.value,r),null==e||e.trigger("trait:update",r)},r.prototype.getTargetValue=function(e){void 0===e&&(e={});var n,r=this.component,o=this.em,i=this.getName(),a=this.get("getValue");if((n=a?a({editor:null==o?void 0:o.getEditor(),trait:this,component:r}):this.changeProp?r.get(i):r.getAttributes()[i],e.useType)&&"checkbox"===this.getType()){var s=this.attributes,l=s.valueTrue,c=s.valueFalse;(0,t.isUndefined)(l)||l!==n?(0,t.isUndefined)(c)||c!==n||(n=!1):n=!0}return(0,t.isUndefined)(n)?"":n},r.prototype.setTargetValue=function(e,n){var r;void 0===n&&(n={});var o=this.component,i=this.attributes,a=this.getName();if(!(0,t.isUndefined)(e)){var s=e;if("false"===e?s=!1:"true"===e&&(s=!0),"checkbox"===this.getType()){var l=i.valueTrue,c=i.valueFalse;s&&!(0,t.isUndefined)(l)&&(s=l),s||(0,t.isUndefined)(c)||(s=c)}var u=((r={})[a]=s,r);u.__p=n.avoidStore?null:void 0,this.changeProp?o.set(u,n):o.addAttributes(u,n)}},r.prototype.setValueFromInput=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var r={value:t};this.set(r,Ie(Ie({},n),{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},r.prototype.getInitValue=function(){var t,e=this.component,n=this.getName();if(e){var r=e.get("attributes");t=this.changeProp?e.get(n):r[n]}return t||this.get("value")||this.get("default")},r}(l.Hn);const Fe=De;var Ve=function(){function e(t){void 0===t&&(t={}),this.config=t}return e.prototype.build=function(e,n){return(0,t.isString)(e)?this.buildFromString(e,n):new Fe(e,n)},e.prototype.buildFromString=function(t,e){var n={name:t,type:"text"};if("target"===t)n.type="select",n.default=!1,n.options=this.config.optionsTarget;return new Fe(n,e)},e}();const Be=Ve;var ze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),He=function(e){function n(t,n){var r=e.call(this,t)||this;r.categories=new Me,r.em=n.em,r.on("add",r.handleAdd),r.on("reset",r.handleReset);var o=r.module,i=null==o?void 0:o.getConfig();return r.tf=new Be(i),r}return ze(n,e),Object.defineProperty(n.prototype,"module",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),n.prototype.getCategories=function(){return this.categories},n.prototype.handleReset=function(t,e){var n=(void 0===e?{}:e).previousModels;(void 0===n?[]:n).forEach((function(t){return t.trigger("remove")}))},n.prototype.handleAdd=function(t){t.em=this.em;var e=this.target;e&&(t.target=e),this.initCategory(t)},n.prototype.setTarget=function(t){this.target=t,this.models.forEach((function(e){return e.setTarget(t)}))},n.prototype.add=function(n,r){if(null!=n){var o=this.target,i=this.em;if((0,t.isArray)(n)){for(var a=[],s=0,l=n.length;s<l;s++){var c=n[s];a[s]=c instanceof Fe?c:this.tf.build(c,i),a[s].setTarget(o)}return e.prototype.add.call(this,a,r)}var u=n instanceof Fe?n:this.tf.build(n,i);return u.setTarget(o),e.prototype.add.call(this,u,r)}},n}(Ae);const $e=He;var We=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ue=function(){return Ue=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ue.apply(this,arguments)},qe=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Ge=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},Ke=function(t){return!!(null==t?void 0:t.getConfig().avoidInlineStyle)},Ye="component:drag",Xe="__symbols",Ze="__symbol",Je="__symbol_ovrd",Qe="component:update",tn="".concat(Qe,"-inside"),en=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return We(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){var t;return(t={tagName:"div",type:"",name:"",removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,"stylable-require":"","style-signature":"",unstylable:"",highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,void:!1,state:"",status:"",content:"",icon:"",style:"",styles:"",classes:"",script:"","script-props":"","script-export":"",attributes:{},traits:["id","title"],propagate:"",dmode:"",toolbar:null,delegate:null})[Ze]=0,t[Xe]=0,t[Je]=0,t._undo=!0,t._undoexc=["status","open"],t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"classes",{get:function(){return this.get("classes")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"traits",{get:function(){return this.get("traits")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"content",{get:function(){var t;return null!==(t=this.get("content"))&&void 0!==t?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toolbar",{get:function(){return this.get("toolbar")||[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"resizable",{get:function(){return this.get("resizable")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delegate",{get:function(){return this.get("delegate")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"locked",{get:function(){return this.get("locked")},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.updated=function(t,e,n){},r.prototype.removed=function(){},r.prototype.initialize=function(e,n){var o=this;void 0===e&&(e={}),void 0===n&&(n={}),(0,t.bindAll)(this,"__upSymbProps","__upSymbCls","__upSymbComps");var i=n.em,a=this.parent(),s=null==a?void 0:a.attributes,l=this.get("propagate");if(l&&this.set("propagate",(0,t.isArray)(l)?l:[l]),s&&s.propagate&&!l){var c={},u=s.propagate;u.forEach((function(t){return c[t]=a.get(t)})),c.propagate=u,this.set(Ue(Ue({},c),e))}if(n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=i,this.opt=n,this.em=i,this.frame=n.frame,this.config=n.config||{},this.set("attributes",Ue(Ue({},(0,t.result)(this,"defaults").attributes||{}),this.get("attributes")||{})),this.ccid=r.createId(this,n),this.initClasses(),this.initComponents(),this.initTraits(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,"change:script",this.scriptUpdated),this.listenTo(this,"change:tagName",this.tagUpdated),this.listenTo(this,"change:attributes",this.attrUpdated),this.listenTo(this,"change:attributes:id",this._idUpdated),this.on("change:toolbar",this.__emitUpdateTlb),this.on("change",this.__onChange),this.on(tn,this.__propToParent),this.set("status",""),this.views=[],["classes","traits","components"].forEach((function(t){var e="add remove ".concat("components"!==t?"change":"");o.listenTo(o.get(t),e.trim(),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o.emitUpdate.apply(o,qe([t],e,!1))}))})),!n.temporary){var p=i&&i.Css,d=this.attributes,f=d.styles,h=d.type;f&&p&&p.addCollection(f,{avoidUpdateStyle:!0},{group:"cmp:".concat(h)}),this.__postAdd(),this.init(),this.__isSymbolOrInst()&&this.__initSymb(),i&&i.trigger("component:create",this)}},r.prototype.__postAdd=function(t){void 0===t&&(t={});var e=this.em,n=null==e?void 0:e.UndoManager,r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=!0),t.recursive&&r.map((function(e){return e.__postAdd(t)}))},r.prototype.__postRemove=function(){var t=this.em,e=null==t?void 0:t.get("UndoManager");e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)},r.prototype.__onChange=function(n,r){var o=this,i=this.changedAttributes()||{};(0,t.keys)(i).forEach((function(t){return o.emitUpdate(t)})),["status","open","toolbar","traits"].forEach((function(t){return delete i[t]})),(0,e.isEmptyObj)(i)||(this.__changesUp(r),this.__propSelfToParent({component:this,changed:i,options:r}))},r.prototype.__onStyleChange=function(e){var n=this,r=this.em;if(r){var o="component:styleUpdate",i=(0,t.keys)(e),a={style:e};r.trigger(o,this,a),i.forEach((function(t){return r.trigger("".concat(o,":").concat(t),n,a)}))}},r.prototype.__changesUp=function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))},r.prototype.__propSelfToParent=function(t){this.trigger(Qe,t),this.__propToParent(t)},r.prototype.__propToParent=function(t){var e=this.parent();e&&e.trigger(tn,t)},r.prototype.__emitUpdateTlb=function(){this.emitUpdate("toolbar")},r.prototype.is=function(t){return!(this.get("type")!=t)},r.prototype.props=function(){return this.attributes},r.prototype.index=function(){var t=this.collection;return t?t.indexOf(this):0},r.prototype.setDragMode=function(t){return this.set("dmode",t)},r.prototype.getDragMode=function(){return this.get("dmode")||""},r.prototype.find=function(t){var e,n=[],r=null===(e=this.view)||void 0===e?void 0:e.$el.find(t);return null==r||r.each((function(t){var e=r.eq(t).data("model");e&&n.push(e)})),n},r.prototype.findType=function(t){var e=[],n=function(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))};return n(this.components()),e},r.prototype.closest=function(t){var e,n=null===(e=this.view)||void 0===e?void 0:e.$el.closest(t);return(null==n?void 0:n.length)?n.data("model"):void 0},r.prototype.closestType=function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e},r.prototype.contains=function(t){var e=!1;if(!t)return e;var n=function(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e},r.prototype.tagUpdated=function(){this.trigger("rerender")},r.prototype.replaceWith=function(e,n){void 0===n&&(n={});var r=this.collection,o=r.indexOf(this);r.remove(this);var i=r.add(e,Ue(Ue({},n),{at:o}));return(0,t.isArray)(i)?i:[i]},r.prototype.attrUpdated=function(n,r,o){var i=this;void 0===o&&(o={});var a=this.get("attributes"),s=a.class;s&&this.setClass(s),delete a.class;var l=a.style;l&&this.setStyle(l),delete a.style;var c=Ue({},this.previous("attributes")),u=(0,e.shallowDiff)(c,this.get("attributes"));(0,t.keys)(u).forEach((function(t){return i.trigger("change:attributes:".concat(t),i,u[t],o)}))},r.prototype.setAttributes=function(t,e){return void 0===e&&(e={}),this.set("attributes",Ue({},t),e),this},r.prototype.addAttributes=function(t,e){return void 0===e&&(e={}),this.setAttributes(Ue(Ue({},this.getAttributes({noClass:!0})),t),e)},r.prototype.removeAttributes=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)},r.prototype.getStyle=function(e,r){void 0===e&&(e={}),void 0===r&&(r={});var o=this.em,i=(0,t.isString)(e)?e:"",a=i?r:e;if(Ke(o)&&!a.inline){var s=o.get("state"),l=o.Css.getIdRule(this.getId(),Ue({state:s},a));if(this.rule=l,l)return l.getStyle(i)}return n.prototype.getStyle.call(this,i)},r.prototype.setStyle=function(r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o={});var a=this.opt,s=this.em;if(!Ke(s)||a.temporary||o.inline)r=n.prototype.setStyle.apply(this,arguments);else{var l=this.get("style")||{};r=(0,t.isString)(r)?this.parseStyle(r):r,r=Ue(Ue({},r),l);var c=s.get("state"),u=s.Css,p=this.getStyle(o);this.rule=u.setIdRule(this.getId(),r,Ue({state:c},o));var d=(0,e.shallowDiff)(p,r);this.set("style","",{silent:!0}),(0,t.keys)(d).forEach((function(t){return i.trigger("change:style:".concat(t))}))}return a.temporary||this.__onStyleChange(o.addStyle||r),r},r.prototype.getAttributes=function(n){void 0===n&&(n={});var r=this.em,o=[],i=Ue({},this.get("attributes")),a=null==r?void 0:r.Selectors,s=this.getId();if(n.noClass?delete i.class:(this.classes.forEach((function(e){return o.push((0,t.isString)(e)?e:e.getName())})),o.length&&(i.class=o.join(" "))),!n.noStyle){var l=this.get("style");(0,e.isObject)(l)&&!(0,e.isEmptyObj)(l)&&(i.style=this.styleToString({inline:1}))}if(!(0,t.has)(i,"id")){var c=!1;!Ke(r)&&(0,t.isEmpty)(this.getStyle())||(c=!!(null==a?void 0:a.get(s,a.Selector.TYPE_ID))),(this.__getSymbol()||this.__getSymbols()||this.get("script-export")||this.get("script"))&&(c=!0),c&&(i.id=s)}return i},r.prototype.addClass=function(t){var e=this.em.Selectors.addClass(t);return this.classes.add(e)},r.prototype.setClass=function(t){return this.classes.reset(),this.addClass(t)},r.prototype.removeClass=function(e){var n=[];e=(0,t.isArray)(e)?e:[e];var r=this.classes,o=ye.TYPE_CLASS;return e.forEach((function(t){t.split(" ").forEach((function(t){var e=r.where({name:t,type:o})[0];e&&n.push(r.remove(e))}))})),n},r.prototype.getClasses=function(){var t=this.getAttributes().class;return t?t.split(" "):[]},r.prototype.__logSymbol=function(t,e,n){void 0===n&&(n={});var r=this.__getSymbol(),o=this.__getSymbols();(r||o)&&this.em.log(t,{model:this,toUp:e,context:"symbols",opts:n})},r.prototype.__initSymb=function(){this.__symbReady||(this.on("change",this.__upSymbProps),this.__symbReady=!0)},r.prototype.__isSymbol=function(){return(0,t.isArray)(this.get(Xe))},r.prototype.__isSymbolOrInst=function(){return!(!this.__isSymbol()&&!this.get(Ze))},r.prototype.__isSymbolTop=function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())},r.prototype.__isSymbolNested=function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t},r.prototype.__getAllById=function(){var t=this.em;return t?t.Components.allById():{}},r.prototype.__getSymbol=function(){var e=this.get(Ze);if(e&&(0,t.isString)(e)){var n=this.__getAllById()[e];n?(e=n,this.set(Ze,n)):e=0}return e},r.prototype.__getSymbols=function(){var e=this,n=this.get(Xe);return n&&(0,t.isArray)(n)&&(n.forEach((function(r,o){r&&(0,t.isString)(r)&&(n[o]=e.__getAllById()[r])})),n=n.filter((function(e){return e&&!(0,t.isString)(e)}))),n},r.prototype.__isSymbOvrd=function(e){void 0===e&&(e="");var n=this.get(Je),r=e.split(":")[0],o=e!==r?[e,r]:[e];return!0===n||(0,t.isArray)(n)&&o.some((function(t){return n.indexOf(t)>=0}))},r.prototype.__getSymbToUp=function(t){var e=this;void 0===t&&(t={});var n=[],r=t.changed;if(t.fromInstance||t.noPropagate||t.fromUndo||r&&this.__isSymbOvrd(r))return n;var o=this.__getSymbols()||[],i=this.__getSymbol();return n=(i?qe([i],i.__getSymbols()||[],!0):o).filter((function(t){return t!==e})).filter((function(t){return!(r&&t.__isSymbOvrd(r))}))},r.prototype.__getSymbTop=function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e},r.prototype.__upSymbProps=function(n,r){var o=this;void 0===r&&(r={});var i=this.changedAttributes()||{},a=i.attributes||{};if(delete i.status,delete i.open,delete i[Xe],delete i[Ze],delete i[Je],delete i.attributes,delete a.id,(0,e.isEmptyObj)(a)||(i.attributes=a),!(0,e.isEmptyObj)(i)){var s=this.__getSymbToUp(r);(0,t.keys)(i).map((function(t){o.__isSymbOvrd(t)&&delete i[t]})),this.__logSymbol("props",s,{opts:r,changed:i}),s.forEach((function(e){var n=Ue({},i);(0,t.keys)(n).map((function(t){e.__isSymbOvrd(t)&&delete n[t]})),e.set(n,Ue({fromInstance:o},r))}))}},r.prototype.__upSymbCls=function(t,e,n){var r=this;void 0===n&&(n={});var o=this.__getSymbToUp(n);this.__logSymbol("classes",o,{opts:n}),o.forEach((function(t){t.set("classes",r.get("classes"),{fromInstance:r})})),this.__changesUp(n)},r.prototype.__upSymbComps=function(t,e,n){var r=this,o=n||e||{},i={fromInstance:o.fromInstance,fromUndo:o.fromUndo},a=t.opt.temporary;if(n)if(n.add){var s=[],l=!!this.__getSymbols();if((m=this.__getSymbToUp(Ue(Ue({},i),{changed:"components:add"}))).length){var c=t.__getSymbol();s=(c?c.__getSymbols():t.__getSymbols())||[],(s=qe([],s,!0)).push(c||t)}!a&&this.__logSymbol("add",m,{opts:n,addedInstances:s.map((function(t){return t.cid})),added:t.cid}),m.forEach((function(e){var o=e.__getSymbTop(),i=s.filter((function(t){var e=t.__getSymbTop({prev:1});return o&&e&&e===o}))[0]||t.clone({symbol:!0,symbolInv:l});e.append(i,Ue({fromInstance:r},n))}))}else{var u=t.__getSymbol();if(u&&!n.temporary&&u.set(Xe,u.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var p="components:remove",d=n.index,f=t.parent(),h=Ue({fromInstance:t},n),g=t.__isSymbolNested(),v=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(h)};m=(null==f?void 0:f.__isSymbOvrd(p))?[]:t.__getSymbToUp(i);g&&(m=null==f?void 0:f.__getSymbToUp(Ue(Ue({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove(Ue({fromInstance:f},h))}),!a&&this.__logSymbol("remove",m,{opts:n,removed:t.cid,isSymbNested:g}),m.forEach(v)}}else{var m=this.__getSymbToUp(Ue(Ue({},i),{changed:"components:reset"})),y=t.models;this.__logSymbol("reset",m,{components:y}),m.forEach((function(t){var n=y.map((function(t){return t.clone({symbol:!0})}));t.components().reset(n,Ue({fromInstance:r},e))}))}this.__changesUp(o)},r.prototype.initClasses=function(e,n,r){void 0===r&&(r={});var o=this.get("attributes")||{},i=o.class,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["class"]),s=[this,"change:classes",this.initClasses],l=this.get("classes")||i||[],c=(0,t.isString)(l)?l.split(" "):l;this.stopListening.apply(this,s);var u=this.normalizeClasses(c),p=new _e([]);return this.set("classes",p,r),p.add(u),p.on("add remove reset",this.__upSymbCls),i&&u.length&&this.set("attributes",a),this.listenTo.apply(this,s),this},r.prototype.initComponents=function(){var e=[this,"change:components",this.initComponents];this.stopListening.apply(this,e);var n=new ge([],this.opt);n.parent=this;var r=this.get("components"),o=!this.opt.avoidChildren;return this.set("components",n),o&&r&&n.add((0,t.isFunction)(r)?r(this):r,this.opt),n.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,e),this},r.prototype.initTraits=function(t){var e=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var r=Ue({},this.get("attributes")),o=this.traits;return o.each((function(t){if(!t.changeProp){var e=t.getName(),n=t.getInitValue();e&&n&&(r[e]=n)}})),o.length&&this.set("attributes",r),this.on(n,this.initTraits),t&&e&&e.trigger("component:toggled"),this},r.prototype.initScriptProps=function(){if(!this.opt.temporary){var t="script-props",e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],o=n.map((function(t){return"change:".concat(t)})).join(" "),i=r.map((function(t){return"change:".concat(t)})).join(" ");o&&this.off(o,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},r.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger("rerender")},r.prototype.append=function(e,n){void 0===n&&(n={});var r=((0,t.isArray)(e)?qe([],e,!0):[e]).map((function(e){return(0,t.isString)(e)||e.collection&&e.collection.remove(e,{temporary:!0}),e})),o=this.components().add(r,n);return(0,t.isArray)(o)?o:[o]},r.prototype.components=function(e,n){void 0===n&&(n={});var r=this.get("components");return(0,t.isUndefined)(e)?r:(r.reset(void 0,n),e?this.append(e,n):[])},r.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},r.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},r.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},r.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},r.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},r.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},r.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||"";if(!e.get("toolbar")&&t){var r=[];e.collection&&r.push({label:t.getIcon("arrowUp"),command:function(t){return t.runCommand("core:component-exit",{force:1})}}),e.get("draggable")&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon("move"),command:"tlb-move"}),e.get("copyable")&&r.push({label:t.getIcon("copy"),command:"tlb-clone"}),e.get("removable")&&r.push({label:t.getIcon("delete"),command:"tlb-delete"}),e.set("toolbar",r)}},r.prototype.__loadTraits=function(e,n){void 0===n&&(n={});var r=e||this.traits;if(!(r instanceof $e)){r=(0,t.isFunction)(r)?r(this):r;var o=new $e([],this.opt);o.setTarget(this),r.length&&(r.forEach((function(t){return t.attributes&&delete t.attributes.value})),o.add(r)),this.set({traits:o},n)}return this},r.prototype.getTraits=function(){return this.__loadTraits(),qe([],this.traits.models,!0)},r.prototype.setTraits=function(e){var n=(0,t.isArray)(e)?e:[e];return this.set({traits:n}),this.getTraits()},r.prototype.getTrait=function(t){return this.getTraits().filter((function(e){return e.get("id")===t||e.get("name")===t}))[0]||null},r.prototype.updateTrait=function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger("component:toggled"),this},r.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},r.prototype.removeTrait=function(e){var n,r=this,o=((0,t.isArray)(e)?e:[e]).map((function(t){return r.getTrait(t)})),i=this.traits,a=o.length?i.remove(o):[];return null===(n=this.em)||void 0===n||n.trigger("component:toggled"),(0,t.isArray)(a)?a:[a]},r.prototype.addTrait=function(e,n){var r;void 0===n&&(n={}),this.__loadTraits();var o=this.traits.add(e,n);return null===(r=this.em)||void 0===r||r.trigger("component:toggled"),(0,t.isArray)(o)?o:[o]},r.prototype.normalizeClasses=function(t){var e=[],n=this.em,r=null==n?void 0:n.Selectors;return r?t.models?qe([],t.models,!0):(t.forEach((function(t){return e.push(r.add(t))})),e):[]},r.prototype.clone=function(t){void 0===t&&(t={});var e=this.em,n=Ue({},this.attributes),r=Ue({},this.opt),o=this.getId(),i=null==e?void 0:e.Css;n.attributes=Ue({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=!0),this.get("components").each((function(e,r){n.components[r]=e.clone(Ue(Ue({},t),{_inner:1}))})),this.get("traits").each((function(t,e){n.traits[e]=t.clone()})),this.get("classes").each((function(t,e){n.classes[e]=t.get("name")})),n.status="",r.collection=null;var a=new this.constructor(n,r),s="#".concat(a.getId());(i?i.getRules("#".concat(o)):[]).forEach((function(t){var e=t.clone();e.set("selectors",[s]),i.getAll().add(e)})),a.set(Xe,0);var l=this.__getSymbol(),c=this.__getSymbols();t.symbol||!l&&!c?l?(l.set(Xe,qe(qe([],l.__getSymbols(),!0),[a],!1)),a.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(Xe,qe(qe([],c,!0),[a],!1)),a.set(Ze,this),a.__initSymb()):t.symbolInv?(this.set(Xe,[a]),a.set(Ze,this),[this,a].map((function(t){return t.__initSymb()}))):(a.set(Xe,[this]),[this,a].map((function(t){return t.__initSymb()})),this.set(Ze,a))):(a.set(Ze,0),a.set(Xe,0));var u="component:clone";return e&&e.trigger(u,a),this.trigger(u,a),a},r.prototype.getName=function(t){void 0===t&&(t={});var n=this.em,r=this.attributes,o=r.type,i=r.tagName,a=r.name,s=o||i,l=o?"":i,c="domComponents.names.",u=a&&(null==n?void 0:n.t("".concat(c).concat(a))),p=l&&(null==n?void 0:n.t("".concat(c).concat(l))),d=n&&(n.t("".concat(c).concat(o))||n.t("".concat(c).concat(i))),f=this.get("custom-name");return(t.noCustom?"":f)||u||a||p||(0,e.capitalize)(l)||d||(0,e.capitalize)(s)},r.prototype.getIcon=function(){var t=this.get("icon");return t?t+" ":""},r.prototype.toHTML=function(n){void 0===n&&(n={});var r=this,o=[],i=n.tag||r.get("tagName"),a=r.get("void"),s=n.attributes,l=this.getAttrToHTML();if(delete n.tag,s&&((0,t.isFunction)(s)?l=s(r,l)||{}:(0,e.isObject)(s)&&(l=s)),n.withProps){var c=this.toJSON();(0,t.forEach)(c,(function(n,r){"_"!==r[0]&&["classes","attributes","components"].indexOf(r)<0&&(l["data-gjs-".concat(r)]=(0,t.isArray)(n)||(0,e.isObject)(n)?JSON.stringify(n):(0,t.isBoolean)(n)?"".concat(n):n)}))}for(var u in l){var p=l[u];if(!(0,t.isUndefined)(p)&&null!==p)if((0,t.isBoolean)(p))p&&o.push(u);else{var d="";if(n.altQuoteAttr&&(0,t.isString)(p)&&p.indexOf('"')>=0)d="'".concat(p.replace(/'/g,"&apos;"),"'");else{var f=(0,t.isString)(p)?p.replace(/"/g,"&quot;"):p;d='"'.concat(f,'"')}o.push("".concat(u,"=").concat(d))}}var h=o.length?" ".concat(o.join(" ")):"",g=r.getInnerHTML(n),v="<".concat(i).concat(h).concat(a?"/":"",">").concat(g);return!a&&(v+="</".concat(i,">")),v},r.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},r.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(""):this.content},r.prototype.getAttrToHTML=function(){var t=this.getAttributes();return Ke(this.em)&&delete t.style,t},r.prototype.toJSON=function(e){void 0===e&&(e={});var n=o.Model.prototype.toJSON.call(this,e);if(n.attributes=this.getAttributes(),delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,delete n.delegate,!e.fromUndo){var r=n[Ze],i=n[Xe];i&&(0,t.isArray)(i)&&(n[Xe]=i.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),r&&!(0,t.isString)(r)&&(n[Ze]=r.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},r.prototype.getChangedProps=function(e){var n=e||o.Model.prototype.toJSON.apply(this),r=(0,t.result)(this,"defaults");return(0,t.forEach)(r,(function(t,e){-1===["type"].indexOf(e)&&n[e]===t&&delete n[e]})),(0,t.isEmpty)(n.type)&&delete n.type,(0,t.forEach)(["attributes","style"],(function(e){(0,t.isEmpty)(r[e])&&(0,t.isEmpty)(n[e])&&delete n[e]})),(0,t.forEach)(["classes","components"],(function(e){(!n[e]||(0,t.isEmpty)(r[e])&&!n[e].length)&&delete n[e]})),n},r.prototype.getId=function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},r.prototype.setId=function(t,e){var n=Ue({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},r.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},r.prototype.getView=function(t){var e=this,n=e.view,r=e.views,o=e.em,i=t||(null==o?void 0:o.getCurrentFrameModel());return i&&(n=r.filter((function(t){return t.frameView===i.view}))[0]),n},r.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=null==t?void 0:t.model;return this.getView(e)},r.prototype.__getScriptProps=function(){var t=this.props();return(this.get("script-props")||[]).reduce((function(e,n){return e[n]=t[n],e}),{})},r.prototype.getScriptString=function(e){var n=this,r=e||this.get("script")||"";if(!r)return r;if(this.get("script-props"))r=r.toString().trim();else{if((0,t.isFunction)(r)){var o=r.toString().trim();r=(o=o.slice(o.indexOf("{")+1,o.lastIndexOf("}"))).trim()}var i=this.em.getConfig(),a=Ge(i.tagVarStart||"{[ "),s=Ge(i.tagVarEnd||" ]}"),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),"g");r=r.replace(l,(function(e,r){n.scriptUpdated();var o=n.attributes[r]||"";return(0,t.isArray)(o)||"object"==typeof o?JSON.stringify(o):o}))}return r},r.prototype.emitUpdate=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.em,i=Qe+(t?":".concat(t):""),a=t&&this.get(t);t&&this.updated.apply(this,qe([t,a,t&&this.previous(t)],n,!1)),this.trigger.apply(this,qe([i],n,!1)),o&&o.trigger.apply(o,qe([i,this],n,!1)),["components","classes"].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=a,e),options:n[2]||n[1]||{}})},r.prototype.onAll=function(e){return(0,t.isFunction)(e)&&(e(this),this.components().forEach((function(t){return t.onAll(e)}))),this},r.prototype.forEachChild=function(e){(0,t.isFunction)(e)&&this.components().forEach((function(t){e(t),t.forEachChild(e)}))},r.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,r=this.collection,o=function(){r&&r.remove(e,Ue(Ue({},t),{action:"remove-component"})),r||(e.components("",t),e.components().removeChildren(e,void 0,t))},i=Ue({},t);return[this,n].map((function(t){return t.trigger("component:remove:before",e,o,i)})),!i.abort&&o(),this},r.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,r=this.index(),o=t===this.parent();o&&(r===n||r===n-1)||(o&&n&&n>r&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this},r.prototype.isInstanceOf=function(t){var e,n,r=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;return!!r&&this instanceof r},r.prototype.isChildOf=function(e){for(var n=(0,t.isString)(e),r=this.parent();r;){if(n){if(r.isInstanceOf(e))return!0}else if(r===e)return!0;r=r.parent()}return!1},r.prototype.resetId=function(t){var e=this.em,n=this.getId();if(!n)return this;var o=r.createId(this);this.setId(o);var i=null==e?void 0:e.Css.getIdRule(n),a=null==i?void 0:i.get("selectors").at(0);return null==a||a.set("name",o),this},r.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,r=e||this.getId();return null==n?void 0:n.Css.getIdRule(r)},r.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get("selectors").at(0)},r.prototype._idUpdated=function(t,e,n){if(void 0===n&&(n={}),!n.idUpdate){var o=this.ccid,i=(this.get("attributes")||{}).id,a=(this.previous("attributes")||{}).id||o,s=r.getList(this);if(s[i]||!i&&a)return this.setId(a,{idUpdate:!0});delete s[a],s[i]=this,this.ccid=i;var l=this._getStyleSelector({id:a});l&&l.set({name:i,label:i})}},r.getDefaults=function(){return(0,t.result)(this.prototype,"defaults")},r.isComponent=function(t){return{tagName:(0,e.toLowerCase)(t.tagName)}},r.ensureInList=function(t){var e=r.getList(t),n=t.getId(),o=e[n];if(o){if(o!==t){var i=r.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return r.ensureInList(t)}))},r.createId=function(t,e){void 0===e&&(e={});var n,o=r.getList(t),i=e.idMap,a=void 0===i?{}:i,s=t.get("attributes").id;return s?(n=r.getIncrementId(s,o,e),t.setId(n),s!==n&&(a[s]=n)):n=r.getNewId(o),o[n]=t,n},r.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),o="i".concat(n);t[o];)o=r.getNewId(t);return o},r.getIncrementId=function(t,e,n){void 0===n&&(n={});var r=n.keepIds,o=1,i=t;if((void 0===r?[]:r).indexOf(t)<0)for(;e[i];)o++,i="".concat(t,"-").concat(o);return i},r.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,o=n.em,i=r||(null==o?void 0:o.Components);return i?i.componentsById:{}},r.checkId=function(e,n,o,i){void 0===n&&(n=[]),void 0===o&&(o={}),void 0===i&&(i={});var a=(0,t.isArray)(e)?e:[e],s=i.keepIds,l=void 0===s?[]:s,c=i.idMap,u=void 0===c?{}:c;a.forEach((function(e){e.attributes;var a=e.attributes,s=void 0===a?{}:a,c=e.components,p=s.id;if(p&&o[p]&&l.indexOf(p)<0){var d=r.getIncrementId(p,o);u[p]=d,s.id=d,(0,t.isArray)(n)&&n.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(p)&&(e[n]="#".concat(d))}))}))}c&&r.checkId(c,n,o,i)}))},r}(se);const nn=en;var rn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),on=function(){return on=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},on.apply(this,arguments)},an=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return rn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return on(on({},t.prototype.defaults),{tagName:"",droppable:!1,layerable:!1,selectable:!1,editable:!0})},enumerable:!1,configurable:!0}),n.prototype.toHTML=function(){var t=this.content,e=this.parent();return(null==e?void 0:e.is("script"))?t:this.__escapeContent(t)},n.prototype.__escapeContent=function(t){return(0,e.escapeNodeContent)(t)},n.isComponent=function(t){var e;if(3===t.nodeType)return{type:"textnode",content:null!==(e=t.textContent)&&void 0!==e?e:""}},n}(nn);const sn=an;var ln=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cn=function(){return cn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},cn.apply(this,arguments)},un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ln(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return cn({},t.prototype.defaults)},enumerable:!1,configurable:!0}),e.prototype.toHTML=function(){return"\x3c!--".concat(this.content,"--\x3e")},e.isComponent=function(t){var e;if(8==t.nodeType)return{type:"comment",content:null!==(e=t.textContent)&&void 0!==e?e:""}},e}(sn);const pn=un;var dn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(){return fn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},fn.apply(this,arguments)},hn="iframe";const gn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return dn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return fn(fn({},t.prototype.defaults),{type:hn,tagName:hn,droppable:!1,resizable:!0,traits:["id","title","src"],attributes:{frameborder:"0"}})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===hn},n}(nn);var vn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mn=function(){return mn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mn.apply(this,arguments)},yn='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)"',bn=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return vn(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){return mn(mn({},n.prototype.defaults),{type:"image",tagName:"img",void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat(yn,'>\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(yn,'>\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:""})},enumerable:!1,configurable:!0}),r.prototype.initialize=function(r,o){n.prototype.initialize.call(this,r,o);var i=this.get("attributes").src;i&&(0,e.buildBase64UrlFromSvg)((0,t.result)(this,"defaults").src)!==i&&this.set("src",i,{silent:!0})},r.prototype.initToolbar=function(){n.prototype.initToolbar.call(this);var t=this.em;if(t){var e="image-editor";if(t.Commands.has(e)){for(var r=!1,o=this.get("toolbar"),i=0;i<o.length;i++)if("image-editor"===o[i].command){r=!0;break}r||(o.push({attributes:{class:"fa fa-pencil"},command:e}),this.set("toolbar",o))}}},r.prototype.getAttrToHTML=function(){var t=n.prototype.getAttrToHTML.call(this),e=this.getSrcResult();return e&&(t.src=e),t},r.prototype.getSrcResult=function(t){void 0===t&&(t={});var n=this.get(t.fallback?"fallback":"src")||"",r=n;return n&&"<svg"===n.substr(0,4)&&(r=(0,e.buildBase64UrlFromSvg)(n)),r},r.prototype.isDefaultSrc=function(){var n=this.get("src"),r=(0,t.result)(this,"defaults").src;return n===r||n===(0,e.buildBase64UrlFromSvg)(r)},r.prototype.toJSON=function(t){var e=n.prototype.toJSON.call(this,t),r=e.attributes;return r&&e.src===r.src&&delete e.src,e},r.prototype.parseUri=function(t){var n={};if((0,e.hasWin)())(n=document.createElement("a")).href=t;else if("undefined"!=typeof URL)try{n=new URL(t)}catch(t){}return{hostname:n.hostname||"",pathname:n.pathname||"",protocol:n.protocol||"",search:n.search||"",hash:n.hash||"",port:n.port||"",query:function(t){void 0===t&&(t="");for(var e={},n=t.substring(1).split("&"),r=0;r<n.length;r++){var o=n[r].split("="),i=decodeURIComponent(o[0]);i&&(e[i]=decodeURIComponent(o[1]||""))}return e}(n.search)}},r.isComponent=function(t){return"img"===(0,e.toLowerCase)(t.tagName)},r}(nn);const wn=bn;var xn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_n=function(){return _n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},_n.apply(this,arguments)};const Cn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return xn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return _n(_n({},e.prototype.defaults),{type:"text",droppable:!1,editable:!0})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){e.prototype.initialize.call(this,t,n),this.__checkInnerChilds()},n.prototype.__checkInnerChilds=function(){var e=this.em.Components.config.disableTextInnerChilds;if(e){var n=function(t){t.isInstanceOf("textnode")||t.set({locked:!0,layerable:!1})};(0,t.isFunction)(e)?this.forEachChild((function(t){e(t)&&n(t)})):this.forEachChild(n)}},n}(nn);var Sn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),On=function(){return On=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},On.apply(this,arguments)},En="label";const kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Sn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return On(On({},t.prototype.defaults),{type:En,tagName:En,traits:["id","title","for"]})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===En},n}(Cn);var Tn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),An=function(){return An=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},An.apply(this,arguments)},Pn="link",jn=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Tn(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){return An(An({},n.prototype.defaults),{type:Pn,tagName:"a",traits:["title","href","target"]})},enumerable:!1,configurable:!0}),r.isComponent=function(n,r){var o;if(void 0===r&&(r={}),"a"===(0,e.toLowerCase)(n.tagName)){var i=r.textTags||[];o={type:Pn,editable:!1};var a=n.childNodes;a.length||delete o.editable,(0,t.forEach)(a,(function(t){var n=t.tagName;(3==t.nodeType&&""!==t.textContent.trim()||n&&i.indexOf((0,e.toLowerCase)(n))>=0)&&delete o.editable}))}return o},r}(Cn);const Mn=jn;var Nn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rn=function(){return Rn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Rn.apply(this,arguments)},Ln=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Nn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){var e=t.prototype.defaults;return Rn(Rn({},e),{type:"map",src:"",void:!1,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:e.toolbar,traits:[{label:"Address",name:"address",placeholder:"eg. London, UK",changeProp:!0},{type:"select",label:"Map type",name:"mapType",changeProp:!0,options:[{id:"q",label:"Roadmap"},{id:"w",label:"Satellite"}]},{label:"Zoom",name:"zoom",type:"range",min:1,max:20,changeProp:!0}]})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(e,n){this.get("src")?this.parseFromSrc():this.updateSrc(),t.prototype.initialize.call(this,e,n),this.listenTo(this,"change:address change:zoom change:mapType",this.updateSrc)},n.prototype.updateSrc=function(){this.set("src",this.getMapUrl())},n.prototype.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"},n.prototype.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)},n.isComponent=function(t){if("iframe"==(0,e.toLowerCase)(t.tagName)&&/maps\.google\.com/.test(t.src))return{type:"map",src:t.src}},n}(wn);const In=Ln;var Dn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fn=function(){return Fn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fn.apply(this,arguments)},Vn="script";const Bn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Dn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return Fn(Fn({},t.prototype.defaults),{type:Vn,tagName:Vn,droppable:!1,draggable:!1,layerable:!1,highlightable:!1})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===Vn},n}(nn);var zn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hn=function(){return Hn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Hn.apply(this,arguments)},$n="svg";const Wn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return zn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return Hn(Hn({},t.prototype.defaults),{type:$n,tagName:$n,highlightable:!1,resizable:{ratioDefault:!0}})},enumerable:!1,configurable:!0}),n.prototype.getName=function(){var t=this.get("tagName"),e=this.get("custom-name");return t=t.charAt(0).toUpperCase()+t.slice(1),e||t},n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===$n},n}(nn);var Un=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qn=function(){return qn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},qn.apply(this,arguments)};const Gn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Un(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return qn(qn({},t.prototype.defaults),{selectable:!1,hoverable:!1,layerable:!1})},enumerable:!1,configurable:!0}),e.isComponent=function(t,e){return void 0===e&&(e={}),!!e.inSvg},e}(Wn);var Kn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yn=function(){return Yn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Yn.apply(this,arguments)},Xn="table";const Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Kn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return Yn(Yn({},t.prototype.defaults),{type:Xn,tagName:Xn,droppable:["tbody","thead","tfoot"]})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n);var r=this.get("components");!r.length&&r.add({type:"tbody"})},n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===Xn},n}(nn);var Jn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qn=function(){return Qn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qn.apply(this,arguments)},tr="tbody";const er=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Jn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return Qn(Qn({},t.prototype.defaults),{type:tr,tagName:tr,draggable:["table"],droppable:["tr"],columns:1,rows:1})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n);var r=this.get("components"),o=this.get("columns"),i=this.get("rows");if(!r.length){for(var a=[];i--;){for(var s=[],l=o;l--;)s.push({type:"cell",classes:["cell"]});a.push({type:"row",classes:["row"],components:s})}r.add(a)}},n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===tr},n}(nn);var nr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rr=function(){return rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},rr.apply(this,arguments)};const or=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return nr(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return rr(rr({},t.prototype.defaults),{type:"cell",tagName:"td",draggable:["tr"]})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return["td","th"].indexOf((0,e.toLowerCase)(t.tagName))>=0},n}(nn);var ir=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ar=function(){return ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ar.apply(this,arguments)},sr="tfoot";const lr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return ir(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return ar(ar({},t.prototype.defaults),{type:sr,tagName:sr})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===sr},n}(er);var cr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ur=function(){return ur=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ur.apply(this,arguments)},pr="thead";const dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return cr(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return ur(ur({},t.prototype.defaults),{type:pr,tagName:pr})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return(0,e.toLowerCase)(t.tagName)===pr},n}(er);var fr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hr=function(){return hr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hr.apply(this,arguments)};const gr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return fr(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return hr(hr({},t.prototype.defaults),{tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]})},enumerable:!1,configurable:!0}),n.isComponent=function(t){return"tr"===(0,e.toLowerCase)(t.tagName)},n}(nn);var vr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mr=function(){return mr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mr.apply(this,arguments)},yr="video",br="yt",wr="vi",xr="ytnc",_r=function(t){return t&&"0"!==t},Cr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return vr(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return mr(mr({},t.prototype.defaults),{type:yr,tagName:yr,videoId:"",void:!1,provider:"so",ytUrl:"https://www.youtube.com/embed/",ytncUrl:"https://www.youtube-nocookie.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:!1,poster:"",muted:0,autoplay:!1,controls:!0,color:"",list:"",src:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"}})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(e,n){this.em=n.em,this.get("src")&&this.parseFromSrc(),this.updatePropsFromAttr(),this.updateTraits(),this.on("change:provider",this.updateTraits),this.on("change:videoId change:provider",this.updateSrc),t.prototype.initialize.call(this,e,n)},n.prototype.updatePropsFromAttr=function(){if("so"===this.get("provider")){var t=this.get("attributes"),n=t.controls,r=t.autoplay,o=t.loop,i={};(0,e.isDef)(n)&&(i.controls=!!n),(0,e.isDef)(r)&&(i.autoplay=!!r),(0,e.isDef)(o)&&(i.loop=!!o),(0,e.isEmptyObj)(i)||this.set(i)}},n.prototype.updateTraits=function(){var t,e=this.em,n="iframe";switch(this.get("provider")){case br:case xr:t=this.getYoutubeTraits();break;case wr:t=this.getVimeoTraits();break;default:n="video",t=this.getSourceTraits()}this.set({tagName:n},{silent:!0}),this.set({traits:t}),e.get("ready")&&e.trigger("component:toggled")},n.prototype.parseFromSrc=function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case br:case xr:case wr:this.set("videoId",e.pathname.split("/").pop()),n.list&&this.set("list",n.list),_r(n.autoplay)&&this.set("autoplay",!0),_r(n.loop)&&this.set("loop",!0),0===parseInt(n.controls)&&this.set("controls",!1),_r(n.color)&&this.set("color",n.color),"0"===n.rel&&this.set("rel",0),"1"===n.modestbranding&&this.set("modestbranding",1)}},n.prototype.updateSrc=function(){var t="";switch(this.get("provider")){case br:t=this.getYoutubeSrc();break;case xr:t=this.getYoutubeNoCookieSrc();break;case wr:t=this.getVimeoSrc()}this.set({src:t})},n.prototype.getAttrToHTML=function(){var e=t.prototype.getAttrToHTML.call(this);switch(this.get("provider")){case br:case xr:case wr:break;default:e.loop=!!this.get("loop"),e.autoplay=!!this.get("autoplay"),e.controls=!!this.get("controls")}return e},n.prototype.getProviderTrait=function(){return{type:"select",label:"Provider",name:"provider",changeProp:!0,options:[{value:"so",name:"HTML5 Source"},{value:br,name:"Youtube"},{value:xr,name:"Youtube (no cookie)"},{value:wr,name:"Vimeo"}]}},n.prototype.getSourceTraits=function(){return[this.getProviderTrait(),{label:"Source",name:"src",placeholder:"eg. ./media/video.mp4",changeProp:!0},{label:"Poster",name:"poster",placeholder:"eg. ./media/image.jpg"},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},n.prototype.getYoutubeTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. jNQXAC9IVRw",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:"checkbox",label:"Related",name:"rel",changeProp:!0},{type:"checkbox",label:"Modest",name:"modestbranding",changeProp:!0}]},n.prototype.getVimeoTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. 123456789",changeProp:!0},{label:"Color",name:"color",placeholder:"eg. FF0000",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait()]},n.prototype.getAutoplayTrait=function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:!0}},n.prototype.getLoopTrait=function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:!0}},n.prototype.getControlsTrait=function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:!0}},n.prototype.getYoutubeSrc=function(){var t=this.get("videoId"),e=this.get("ytUrl"),n=this.get("list");return e+=t+(t.indexOf("?")<0?"?":""),e+=n?"&list=".concat(n):"",e+=this.get("autoplay")?"&autoplay=1&mute=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":""},n.prototype.getYoutubeNoCookieSrc=function(){var t=this.getYoutubeSrc();return t=t.replace(this.get("ytUrl"),this.get("ytncUrl"))},n.prototype.getVimeoSrc=function(){var t=this.get("viUrl");return t+=this.get("videoId")+"?",t+=this.get("autoplay")?"&autoplay=1&muted=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"):""},n.isComponent=function(t){var n=t.tagName,r=t.src,o=/youtube\.com\/embed/.test(r),i=/youtube-nocookie\.com\/embed/.test(r),a=/player\.vimeo\.com\/video/.test(r),s=o||i||a;if((0,e.toLowerCase)(n)==yr||"iframe"==(0,e.toLowerCase)(n)&&s){var l={type:"video"};return r&&(l.src=r),s&&(o?l.provider=br:i?l.provider=xr:a&&(l.provider=wr)),l}},n}(wn);const Sr=Cr;var Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Er=function(){return Er=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Er.apply(this,arguments)},kr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Or(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Er(Er({},t.prototype.defaults),{tagName:"body",removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]})},enumerable:!1,configurable:!0}),e.prototype.__postAdd=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return!this.__hasUm&&(null==n||n.add(this)),t.prototype.__postAdd.call(this)},e.prototype.__postRemove=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return null==n||n.remove(this),t.prototype.__postRemove.call(this)},e.isComponent=function(){return!1},e}(nn);const Tr=kr;var Ar=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pr=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.compView=Lr,t}return Ar(n,e),n.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},n.prototype.removeChildren=function(t,e,n){var r=this;void 0===n&&(n={}),t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,vt.L_)(n),t.remove.apply(t)}})),t.components().forEach((function(t){return r.removeChildren(t,e,n)}))},n.prototype.addTo=function(t,e,n){void 0===n&&(n={});var r=this.em,o=this.collection.indexOf(t);if(this.addToCollection(t,null,o),r&&!n.temporary){var i=function(t){r.trigger("component:add",t),t.components().forEach((function(t){return i(t)}))};i(t)}},n.prototype.addToCollection=function(e,n,r){for(var o=this,i=o.config,a=o.opts,s=o.em,l=n||null,c=i.frameView,u=(null==c?void 0:c.model)&&e.getView(c.model),p=a.componentTypes||(null==s?void 0:s.Components.getTypes()),d=e.get("type")||"default",f=this.compView,h=0;h<p.length;h++)if(p[h].id==d){f=p[h].view;break}var g,v=u||new f({model:e,config:i,componentTypes:p});try{g=v.render().el}catch(t){g=document.createTextNode(""),s.logError(t)}if(l)l.appendChild(g);else{var m=this.parentEl,y=m.childNodes;if((0,t.isUndefined)(r))m.appendChild(g);else{var b=y.length==r;b&&r--,b||!y.length?m.appendChild(g):m.insertBefore(g,y[r])}}return e.opt.temporary||null==s||s.trigger("component:mount",e),g},n.prototype.resetChildren=function(t,e){var n=this,r=(void 0===e?{}:e).previousModels,o=void 0===r?[]:r;this.parentEl.innerHTML="",o.forEach((function(t){return n.removeChildren(t,n.collection)})),t.each((function(t){return n.addToCollection(t)}))},n.prototype.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},n}(l.G7);const jr=Pr;var Mr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nr=function(){return Nr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Nr.apply(this,arguments)},Rr=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Mr(r,n),r.prototype.className=function(){return this.getClasses()},r.prototype.tagName=function(){return this.model.get("tagName")},r.prototype.preinitialize=function(t){void 0===t&&(t={}),this.opts=t},r.prototype.initialize=function(t){void 0===t&&(t={});var n=this.model,r=t.config||{},o=r.em,i=n.opt||{},a=this.$el,s=this.el;this.opts=t,this.modelOpt=i,this.config=r,this.em=o,this.pfx=r.stylePrefix||"",this.ppfx=r.pStylePrefix||"",this.attr=n.get("attributes"),this.classe=this.attr.class||[],this.listenTo(n,"change:style",this.updateStyle),this.listenTo(n,"change:attributes",this.renderAttributes),this.listenTo(n,"change:highlightable",this.updateHighlight),this.listenTo(n,"change:status change:locked",this.updateStatus),this.listenTo(n,"change:script rerender",this.reset),this.listenTo(n,"change:content",this.updateContent),this.listenTo(n,"change",this.handleChange),this.listenTo(n,"active",this.onActive),this.listenTo(n,"disable",this.onDisable),a.data("model",n),(0,e.setViewEl)(s,this),n.view=this,this.frameView&&n.views.push(this),this.initClasses(),this.initComponents({avoidRender:!0}),this.events=Nr(Nr({},this.constructor.getEvents()),{dragstart:"handleDragStart"}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())},Object.defineProperty(r.prototype,"__cmpStyleOpts",{get:function(){return{state:"",mediaText:""}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"frameView",{get:function(){return this.opts.config.frameView},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createDoc",{get:function(){var t,e,n=(null===(t=this.frameView)||void 0===t?void 0:t.getDoc())||document;return(null===(e=this.opts.config)||void 0===e?void 0:e.useFrameDoc)?n:document},enumerable:!1,configurable:!0}),r.prototype.__isDraggable=function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n},r.prototype._clbObj=function(){var t=this,e=t.em,n=t.model,r=t.el;return{editor:null==e?void 0:e.getEditor(),model:n,el:r}},r.prototype.init=function(t){},r.prototype.removed=function(t){},r.prototype.onRender=function(t){},r.prototype.onActive=function(t){},r.prototype.onDisable=function(t){},r.prototype.remove=function(){var t;n.prototype.remove.call(this);var e=this.model,r=this.$el,o=e.views,i=this.frameView||{};return e.components().forEach((function(t){var e=t.getView(i.model);null==e||e.remove()})),null===(t=this.childrenView)||void 0===t||t.remove(),o.splice(o.indexOf(this),1),this.removed(this._clbObj()),r.data({model:"",collection:"",view:""}),this},r.prototype.handleDragStart=function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.Commands.run("tlb-move",{target:this.model,event:t})},r.prototype.initClasses=function(){var t=this.model,e=t.classes,n="change:classes";e instanceof _e&&(this.stopListening(t,n,this.initClasses),this.listenTo(t,n,this.initClasses),this.listenTo(e,"add remove change reset",this.updateClasses),e.length&&this.importClasses())},r.prototype.initComponents=function(t){void 0===t&&(t={});var e=this,n=e.model,r=e.$el,o=e.childrenView,i=n.get("components"),a=[n,"change:components",this.initComponents];i instanceof ge&&(r.data("collection",i),o&&o.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))},r.prototype.handleChange=function(){var e=this.model,n=(0,t.keys)(e.changed);if(1!==n.length||"status"!==n[0])for(var r in e.emitUpdate(),e.changed)e.emitUpdate(r)},r.prototype.importClasses=function(){var t=this.em,e=this.model,n=t.Selectors;n&&e.classes.forEach((function(t){return n.add(t.getName())}))},r.prototype.updateStatus=function(e){void 0===e&&(e={});var n=this,r=n.em,o=n.el,i=n.ppfx,a=n.model,s=null==r?void 0:r.Canvas,l=null==s?void 0:s.config.extHl,c=a.get("status"),u="".concat(i,"selected"),p="".concat(u,"-parent"),d="".concat(i,"freezed"),f="".concat(i,"hovered"),h="".concat(i,"no-pointer"),g="".concat(i,"pointer-init"),v=[u,p,d,f,h],m=l&&!e.noExtHl?"":u;this.$el.removeClass(v.join(" "));var y=[o.getAttribute("class")||""],b=!(null==s?void 0:s.hasCustomSpot(st.q.Select)),w=!(null==s?void 0:s.hasCustomSpot(st.q.Target));switch(c){case"selected":b&&y.push(m);break;case"selected-parent":w&&y.push(p);break;case"freezed":y.push(d);break;case"freezed-selected":y.push(d),b&&y.push(m);break;case"hovered":!e.avoidHover&&y.push(f)}(0,t.isBoolean)(a.locked)&&y.push(a.locked?h:g);var x=y.filter(Boolean).join(" ");x&&o.setAttribute("class",x)},r.prototype.updateHighlight=function(){var t=this.model,e=t.get("textable"),n=t.get("highlightable")&&(e||!t.isChildOf("text"));this.setAttribute("data-gjs-highlightable",!!n||"")},r.prototype.updateStyle=function(e,n,r){void 0===r&&(r={});var o=this.model,i=this.em;if(Ke(i)&&!r.inline){var a=this.__cmpStyleOpts,s=o.getStyle(a);!(0,t.isEmpty)(s)&&o.setStyle(s,a)}else this.setAttribute("style",o.styleToString(r))},r.prototype.updateClasses=function(){var t=this.model.classes.pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus(),this.onAttrUpdate()},r.prototype.setAttribute=function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},r.prototype.getClasses=function(){return this.model.getClasses().join(" ")},r.prototype.updateAttributes=function(){var e=[],n=this,r=n.model,o=n.$el,i=n.el,a=r.attributes,s=a.textable,l=a.type,c=Nr(Nr({id:r.getId(),"data-gjs-type":l||"default"},this.__isDraggable()&&{draggable:!0}),s&&{contenteditable:"false"});(0,t.each)(i.attributes,(function(t){return e.push(t.nodeName)})),e.forEach((function(t){return o.removeAttr(t)})),this.updateStyle(),this.updateHighlight();var u=Nr(Nr({},c),r.getAttributes());(0,t.keys)(u).forEach((function(t){return!1===u[t]&&delete u[t]})),o.attr(u)},r.prototype.updateContent=function(){var t=this.model.content,e=this.model.components().length;this.getChildrenContainer().innerHTML=e?"":t},r.prototype.prevDef=function(t){t.preventDefault()},r.prototype.updateScript=function(){var t=this.model,e=this.em;t.get("script")&&(null==e||e.Canvas.getCanvasView().updateScript(this))},r.prototype.getChildrenContainer=function(){var t=this.el;return"function"==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},r.prototype.getOffsetRect=function(){var t={top:0,left:0,bottom:0,right:0},e=this.el,n=0,r=0,o=function(i){var a=i.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,o(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)};return o(e),t},r.prototype.isInViewport=function(){var t=this,e=t.el,n=t.em,r=t.frameView,o=n.Canvas.getCanvasView().getElBoxRect(e,{local:!0}),i=r.el,a=i.clientHeight,s=i.clientWidth,l=o.y,c=o.x,u=l+o.height,p=c+o.width;return(l>=0&&l<a||u>0&&u<a)&&(p>=0&&p<s||c>0&&c<=s)},r.prototype.scrollIntoView=function(t){var e;if(void 0===t&&(t={}),!this.isInViewport()||t.force){var n=this.el;if("smooth"!==t.behavior){var r=this.getOffsetRect();null===(e=n.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,r.top)}else n.scrollIntoView(Nr({behavior:"smooth",block:"nearest"},t))}},r.prototype.reset=function(){var t=this.el;this.el="",this._ensureElement(),this._setData(),(0,vt.dL)(t,this.el),this.render()},r.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},r.prototype._createElement=function(t){return this.createDoc.createElement(t)},r.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new jr({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,o=n.length;r<o;r++)t.appendChild(n.shift())},r.prototype.renderAttributes=function(){this.updateAttributes(),this.updateClasses()},r.prototype.onAttrUpdate=function(){},r.prototype.render=function(){return this.renderAttributes(),this.modelOpt.temporary||(this.renderChildren(),this.updateScript(),(0,e.setViewEl)(this.el,this),this.postRender()),this},r.prototype.postRender=function(){this.modelOpt.temporary||this.onRender(this._clbObj())},r.getEvents=function(){return(0,t.result)(this.prototype,"events")},r}(l.G7);const Lr=Rr;var Ir=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Dr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ir(e,t),e.prototype._setAttributes=function(){},e.prototype.renderAttributes=function(){},e.prototype.updateStatus=function(){},e.prototype.updateClasses=function(){},e.prototype.setAttribute=function(){},e.prototype.updateAttributes=function(){},e.prototype.initClasses=function(){},e.prototype.initComponents=function(){},e.prototype.delegateEvents=function(){return this},e.prototype._createElement=function(){return document.createTextNode("")},e.prototype.render=function(){var t=this.model,e=this.el;return t.opt.temporary||(e.textContent=t.content),this},e}(Lr);var Fr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fr(e,t),e.prototype._createElement=function(){return document.createComment(this.model.content)},e}(Dr);var Br=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const zr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Br(e,t),e.prototype.tagName=function(){return"div"},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:attributes:src",this.updateSrc)},e.prototype.updateSrc=function(){var t=(0,vt.sE)(this.el,"iframe")[0];t&&(0,vt.FW)(t,{src:this.__getSrc()})},e.prototype.render=function(){t.prototype.render.call(this);var e=(0,vt.ut)("iframe",{class:"".concat(this.ppfx,"no-pointer"),style:"width: 100%; height: 100%; border: none",src:this.__getSrc()});return this.el.appendChild(e),this},e.prototype.__getSrc=function(){return this.model.getAttributes().src||""},e}(Lr);var Hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$r=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Hr(n,e),n.prototype.tagName=function(){return"img"},n.prototype.events=function(){return{dblclick:"onActive",click:"initResize",error:"onError",load:"onLoad",dragstart:"noDrag"}},n.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.listenTo(this.model,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()},n.prototype.fetchFile=function(){if(!this.modelOpt.temporary){var e=this.model,n=this.em,r=e.get("file");if(r&&n){var o=n.Assets.FileUploader();null==o||o.uploadFile({dataTransfer:{files:[r]}},(function(n){var r=n&&n.data&&n.data[0],o=r&&((0,t.isString)(r)?r:r.src);o&&e.set({src:o})})),e.set("file","")}}},n.prototype.updateSrc=function(){var t=this.model;t.addAttributes({src:t.getSrcResult()}),this.updateClasses()},n.prototype.updateClasses=function(){e.prototype.updateClasses.call(this);var t=this,n=t.el,r=t.classEmpty,o=t.model,i=o.getSrcResult()&&!o.isDefaultSrc()?"remove":"add";n.classList[i](r)},n.prototype.onActive=function(t){null==t||t.stopPropagation();var e=this.em,n=this.model,r=null==e?void 0:e.Assets;r&&n.get("editable")&&r.open({select:function(t,e){n.set({src:t.getSrc()}),e&&r.close()},target:n,types:["image"],accept:"image/*"})},n.prototype.onError=function(){var t=this.model.getSrcResult({fallback:!0});t&&(this.el.src=t)},n.prototype.onLoad=function(){this.em.Canvas.refresh({all:!0})},n.prototype.noDrag=function(t){return t.preventDefault(),!1},n.prototype.render=function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var t=this.$el,e=this.model,n=t.attr("class")||"";return!e.get("src")&&t.attr("class","".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this},n}(Lr);const Wr=$r;var Ur=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qr=function(){return qr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},qr.apply(this,arguments)},Gr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Kr=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Yr=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Ur(r,n),r.prototype.events=function(){return{dblclick:"onActive",input:"onInput"}},r.prototype.initialize=function(e){n.prototype.initialize.call(this,e),(0,t.bindAll)(this,"disableEditing","onDisable");var r=this.model,o=this.em;this.listenTo(r,"focus",this.onActive),this.listenTo(r,"change:content",this.updateContentText),this.listenTo(r,"sync:content",this.syncContent),this.rte=null==o?void 0:o.RichTextEditor},r.prototype.updateContentText=function(t,e,n){void 0===n&&(n={}),!n.fromDisable&&this.disableEditing()},r.prototype.canActivate=function(){var t,e=this,n=e.model,r=e.rteEnabled,o=e.em,i=(null==o?void 0:o.getEditing())===n,a=!0,s=!1;if((r||!n.get("editable")||i||(s=n.isChildOf("text")))&&(a=!1,s&&!n.get("textable"))){for(var l=n.parent();l&&!l.isInstanceOf("text");)l=l.parent();l&&l.get("editable")?t=l:a=!0}return{result:a,delegate:t}},r.prototype.onActive=function(t){var e,n;return Gr(this,void 0,void 0,(function(){var r,o,i,a,s,l,c,u,p;return Kr(this,(function(d){switch(d.label){case 0:return o=(r=this).rte,i=r.em,a=this.canActivate(),s=a.result,l=a.delegate,s?(null===(n=null==t?void 0:t.stopPropagation)||void 0===n||n.call(t),c=this,[4,this.getContent()]):(l&&(null===(e=null==t?void 0:t.stopPropagation)||void 0===e||e.call(t),i.setSelected(l),l.trigger("active",t)),[2]);case 1:if(c.lastContent=d.sent(),!o)return[3,5];d.label=2;case 2:return d.trys.push([2,4,,5]),u=this,[4,o.enable(this,this.activeRte,{event:t})];case 3:return u.activeRte=d.sent(),[3,5];case 4:return p=d.sent(),i.logError(p),[3,5];case 5:return this.toggleEvents(!0),[2]}}))}))},r.prototype.onDisable=function(t){this.disableEditing(t)},r.prototype.disableEditing=function(t){return void 0===t&&(t={}),Gr(this,void 0,void 0,(function(){var e,n,r,o,i,a,s,l;return Kr(this,(function(c){switch(c.label){case 0:if(n=(e=this).model,r=e.rte,o=e.activeRte,i=e.em,a=n&&n.get("editable"),!r)return[3,8];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r.disable(this,o,t)];case 2:return c.sent(),[3,4];case 3:return s=c.sent(),i.logError(s),[3,4];case 4:return(l=a)?[4,this.getContent()]:[3,6];case 5:l=c.sent()!==this.lastContent,c.label=6;case 6:return l?[4,this.syncContent(t)]:[3,8];case 7:c.sent(),this.lastContent="",c.label=8;case 8:return this.toggleEvents(),[2]}}))}))},r.prototype.getContent=function(){return Gr(this,void 0,void 0,(function(){var t,e,n,r;return Kr(this,(function(o){switch(o.label){case 0:return e=(t=this).rte,n=t.activeRte,r="",e?[4,e.getContent(this,n)]:[3,2];case 1:r=o.sent(),o.label=2;case 2:return[2,r]}}))}))},r.prototype.syncContent=function(t){return void 0===t&&(t={}),Gr(this,void 0,void 0,(function(){var e,n,r,o,i,a;return Kr(this,(function(s){switch(s.label){case 0:return n=(e=this).model,r=e.rte,e.rteEnabled||t.force?[4,this.getContent()]:[2];case 1:return o=s.sent(),i=n.components(),a=qr({fromDisable:1},t),n.set("content","",a),(null==r?void 0:r.customRte)&&!r.customRte.parseContent?(i.length&&i.reset(void 0,qr(qr({},t),{keepIds:de(i)})),n.set("content",o,a)):i.resetFromString(o,t),[2]}}))}))},r.prototype.insertComponent=function(t,n){var r;void 0===n&&(n={});var o=this.model,i=this.el.ownerDocument.getSelection();if(null==i?void 0:i.rangeCount){var a=i.getRangeAt(0),s=a.startContainer,l=a.startOffset,c=(0,e.getComponentModel)(s),u=[];if(c&&(null===(r=c.is)||void 0===r?void 0:r.call(c,"textnode"))){var p=c.collection;p.forEach((function(e){if(e===c){var r="textnode",o=n.useDomContent?s.textContent||"":e.content;u.push({type:r,content:o.slice(0,l)}),u.push(t),u.push({type:r,content:o.slice(l)})}else u.push(e)}));var d=u.filter(Boolean),f=d.indexOf(t);return p.reset(d,n),p.at(f)}}return o.append(t,n)},r.prototype.onInput=function(){var t=this.em,e="component",n=["".concat(e,":update"),"".concat(e,":input")].join(" ");t&&t.trigger(n,this.model)},r.prototype.disablePropagation=function(t){t.stopPropagation()},r.prototype.toggleEvents=function(t){var e=this,n=e.em,r=e.model,o=e.$el,i={on:vt.on,off:vt.S1},a=t?"on":"off";n.setEditing(!!t&&this),this.rteEnabled=!!t;var s=[this.el.ownerDocument,document];if(i.off(s,"mousedown",this.onDisable),i[a](s,"mousedown",this.onDisable),n[a]("toolbar:run:before",this.onDisable),r&&(r[a]("removed",this.onDisable),r.trigger("rte:".concat(t?"enable":"disable"))),null==o||o.off("mousedown",this.disablePropagation),o&&o[a]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var l=this.el;l;)l.draggable=!t,(l=l.parentNode)&&"BODY"==l.tagName&&(l=0)},r}(Lr);const Xr=Yr;var Zr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Zr(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.el.addEventListener("click",this.prevDef,!0),this},e}(Xr);var Qr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const to=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Qr(e,t),e}(Jr);var eo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const no=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.tagName=function(){return"div"},e.prototype.events=function(){return{}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.classEmpty=this.ppfx+"plh-map"},e.prototype.updateSrc=function(){this.getIframe().src=this.model.get("src")},e.prototype.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},e.prototype.render=function(){return t.prototype.render.call(this),this.updateClasses(),this.el.appendChild(this.getIframe()),this},e}(Wr);var ro=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const oo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ro(e,t),e.prototype.tagName=function(){return"script"},e.prototype.events=function(){return{}},e}(Lr);var io=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ao=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return io(e,t),e.prototype._createElement=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},e}(Lr);const so=ao;var lo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const co=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lo(e,t),e}(Lr);var uo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return uo(e,t),e}(Lr);var fo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fo(e,t),e}(Lr);var go=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return go(e,t),e}(Lr);var mo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mo(e,t),e}(Lr);var bo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const wo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bo(e,t),e.prototype.events=function(){return{}},e}(Lr);var xo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xo(e,t),e.prototype.tagName=function(){return"div"},e.prototype.events=function(){return{}},e.prototype.initialize=function(){Lr.prototype.initialize.apply(this,arguments);var t=this.model,e=["loop","autoplay","controls","color","rel","modestbranding","poster"].map((function(t){return"change:".concat(t)})).join(" ");this.listenTo(t,"change:provider",this.updateProvider),this.listenTo(t,"change:src",this.updateSrc),this.listenTo(t,e,this.updateVideo)},e.prototype.updateProvider=function(){var t=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(t))},e.prototype.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}},e.prototype.updateVideo=function(){var t=this.model,e=this.videoEl;switch(t.get("provider")){case"yt":case"ytnc":case"vi":t.trigger("change:videoId");break;default:if(e){var n=e;n.loop=t.get("loop"),n.autoplay=t.get("autoplay"),n.controls=t.get("controls"),n.poster=t.get("poster")}}},e.prototype.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},e.prototype.renderSource=function(){var t=document.createElement("video");return t.src=this.model.get("src"),this.initVideoEl(t),t},e.prototype.renderYoutube=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.renderYoutubeNoCookie=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeNoCookieSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.renderVimeo=function(){var t=document.createElement("iframe");return t.src=this.model.getVimeoSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},e.prototype.initVideoEl=function(t){t.className=this.ppfx+"no-pointer",t.style.height="100%",t.style.width="100%"},e.prototype.render=function(){Lr.prototype.render.apply(this),this.updateClasses();var t=this.model.get("provider");return this.el.appendChild(this.renderByProvider(t)),this.updateVideo(),this},e}(Wr);const Co=_o;var So=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Oo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return So(e,t),e.prototype.tagName=function(){return"div"},e}(Lr);var Eo,ko=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),To=function(){return To=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},To.apply(this,arguments)};!function(t){t[t.InvalidSource=0]="InvalidSource",t[t.SourceReject=1]="SourceReject",t[t.TargetReject=2]="TargetReject"}(Eo||(Eo={}));var Ao=function(n){function r(t){var e=n.call(this,t,"DomComponents",new ge(void 0,{em:t}))||this;for(var r in e.componentTypes=[{id:"cell",model:or,view:po},{id:"row",model:gr,view:yo},{id:"table",model:Zn,view:wo},{id:"thead",model:dr,view:vo},{id:"tbody",model:er,view:co},{id:"tfoot",model:lr,view:ho},{id:"map",model:In,view:no},{id:"link",model:Mn,view:Jr},{id:"label",model:kn,view:to},{id:"video",model:Sr,view:Co},{id:"image",model:wn,view:Wr},{id:"script",model:Bn,view:oo},{id:"svg-in",model:Gn,view:so},{id:"svg",model:Wn,view:so},{id:"iframe",model:gn,view:zr},{id:"comment",model:pn,view:Vr},{id:"textnode",model:sn,view:Dr},{id:"text",model:Cn,view:Xr},{id:"wrapper",model:Tr,view:Oo},{id:"default",model:nn,view:Lr}],e.componentsById={},e.Component=nn,e.Components=ge,e.ComponentView=Lr,e.ComponentsView=jr,e.storageKey="components",t&&(e.config.components=t.config.components||e.config.components),Xt)r in e.config||(e.config[r]=Xt[r]);var o=e.config.pStylePrefix;if(o&&(e.config.stylePrefix=o+e.config.stylePrefix),t){t.get("Parser").compTypes=e.componentTypes,t.on("change:componentHovered",e.componentHovered,e);var i=t.get("selected");t.listenTo(i,"add",(function(t,n,r){return e.selectAdd(i.getComponent(t),r)})),t.listenTo(i,"remove",(function(t,n,r){return e.selectRemove(i.getComponent(t),r)}))}return e}return ko(r,n),r.prototype.load=function(e){var n=this;return this.loadProjectData(e,{onResult:function(e){var r=n.getWrapper();if(r||(n.em.Pages.add({},{select:!0}),r=n.getWrapper()),(0,t.isArray)(e))e.length&&r.components(e);else{var o=e.components,i=void 0===o?[]:o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["components"]);r.set(a),r.components(i)}}})},r.prototype.store=function(){return{}},r.prototype.getComponent=function(){var t=this.em.Pages.getSelected(),e=null==t?void 0:t.getMainFrame();return null==e?void 0:e.getComponent()},r.prototype.getWrapper=function(){return this.getComponent()},r.prototype.getComponents=function(){var t=this.getWrapper();return null==t?void 0:t.components()},r.prototype.addComponent=function(t,e){return void 0===e&&(e={}),this.getComponents().add(t,e)},r.prototype.render=function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.render().el},r.prototype.clear=function(t){void 0===t&&(t={});var e=this.getComponents();return null==e||e.filter(Boolean).forEach((function(e){return e.remove(t)})),this},r.prototype.setComponents=function(t,e){void 0===e&&(e={}),this.clear(e).addComponent(t,e)},r.prototype.addType=function(e,n){var r=this.em,o=n.model,i=void 0===o?{}:o,a=n.view,s=void 0===a?{}:a,l=n.isComponent,c=n.extend,u=n.extendView,p=n.extendFn,d=void 0===p?[]:p,f=n.extendFnView,h=void 0===f?[]:f,g=this.getType(e),v=this.getType(c),m=this.getType(u),y=v||(g||this.getType("default")),b=y.model,w=m?m.view:y.view,x=function(t,e,n){return t.reduce((function(t,r){var o=e[r],i=n.prototype[r];return o&&i&&(t[r]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.bind(this).apply(void 0,t),o.bind(this).apply(void 0,t)}),t}),{})};if("object"==typeof i){var _={defaults:i.defaults};delete i.defaults,n.model=b.extend(To(To({},i),x(d,i,b)),{isComponent:!g||v||l?l||function(){return 0}:b.isComponent}),Object.defineProperty(n.model.prototype,"defaults",{get:function(){return To(To({},(0,t.result)(b.prototype,"defaults")||{}),(0,t.result)(_,"defaults")||{})}})}"object"==typeof s&&(n.view=w.extend(To(To({},s),x(h,s,w)))),g?(g.model=n.model,g.view=n.view):(n.id=e,this.componentTypes.unshift(n));var C="component:type:".concat(g?"update":"add");return null==r||r.trigger(C,g||n),this},r.prototype.getType=function(t){for(var e=this.componentTypes,n=0;n<e.length;n++){if(e[n].id==t)return e[n]}},r.prototype.removeType=function(t){var e=this.componentTypes,n=this.getType(t);if(n){var r=e.indexOf(n);return e.splice(r,1),n}},r.prototype.getTypes=function(){return this.componentTypes},r.prototype.selectAdd=function(t,e){var n=this;void 0===e&&(e={}),t&&(t.set({status:"selected"}),["component:selected","component:toggled"].forEach((function(r){return n.em.trigger(r,t,e)})))},r.prototype.selectRemove=function(t,e){var n=this;void 0===e&&(e={}),t&&(this.em,t.set({status:"",state:""}),["component:deselected","component:toggled"].forEach((function(r){return n.em.trigger(r,t,e)})))},r.prototype.componentHovered=function(){var e=this.em,n=e.get("componentHovered"),r=e.previous("componentHovered"),o="hovered";r&&r.get("status")==o&&r.set({status:"",state:""}),n&&(0,t.isEmpty)(n.get("status"))&&n.set("status",o)},r.prototype.getShallowWrapper=function(){var e=this.shallow,n=this.em;if(!e&&n){var r=n.shallow;if(!r)return;var o=r.Components;if(o.componentTypes=this.componentTypes,e=o.getWrapper()){var i=[Qe,tn].join(" ");e.on(i,(0,t.debounce)((function(){return null==e?void 0:e.components("")}),100))}this.shallow=e}return e},r.prototype.isComponent=function(t){return(0,e.isComponent)(t)},r.prototype.canMove=function(n,r,o){var i={result:!1,reason:Eo.InvalidSource,target:n,source:null};if(!r||!n)return i;var a=(0,e.isComponent)(r)?r:null;if(!a){var s=this.getShallowWrapper();a=(null==s?void 0:s.append(r)[0])||null}if(i.source=a,!a)return i;var l=a.get("draggable");if((0,t.isFunction)(l))l=!!l(a,n,o);else{var c=n.getEl();l=(0,t.isArray)(l)?l.join(","):l,l=(0,t.isString)(l)?null==c?void 0:c.matches(l):l}if(!l)return To(To({},i),{reason:Eo.SourceReject});var u=n.get("droppable");if((0,t.isFunction)(u))u=!!u(a,n,o);else if(!1===u&&n.isInstanceOf("text")&&a.get("textable"))u=!0;else{c=a.getEl();u=(0,t.isArray)(u)?u.join(","):u,u=(0,t.isString)(u)?null==c?void 0:c.matches(u):u}var p=[n].concat(n.parents()).indexOf(a)>-1;return To(To({},i),!u||p?{reason:Eo.TargetReject}:{result:!0})},r.prototype.allById=function(){return this.componentsById},r.prototype.getById=function(t){return this.componentsById[t]||null},r.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},r}(v);const Po=Ao;const jo={stylePrefix:"css-",rules:[]};var Mo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),No=Number.MAX_VALUE,Ro=function(n){function r(){var e=n.call(this)||this;return(0,t.bindAll)(e,"sortRules"),e.compCls=[],e.ids=[],e}return Mo(r,n),r.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var r="",o=this.em,i=o&&o.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.classes;return this.ids.push("#".concat(t.getId())),s.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&a&&(r="#".concat(t.getId(),"{").concat(a,"}")),t.components().forEach((function(t){return r+=n.buildFromModel(t,e)})),r},r.prototype.build=function(n,r){var o=this;void 0===r&&(r={});var i=r.json,a=r.em,s=r.cssc||(null==a?void 0:a.Css);this.em=a,this.compCls=[],this.ids=[],this.model=n;var l=[],c=n?this.buildFromModel(n,r):"",u=(0,t.isUndefined)(r.clearStyles)&&a?a.getConfig().clearStyles:r.clearStyles;if(s){var p=r.rules||s.getAll(),d={},f=[];r.onlyMatched&&n&&(0,e.hasWin)()&&(p=this.matchedRules(n,p)),p.forEach((function(t){var e=t.getAtRule();if(e){var n=d[e];n?n.push(t):d[e]=[t]}else{var a=o.buildFromRule(t,f,r);i?l.push(a):c+=a}})),this.sortMediaObject(d).forEach((function(t){var e="",n=t.key;t.value.forEach((function(t){var a=o.buildFromRule(t,f,r);t.get("singleAtRule")?c+="".concat(n,"{").concat(a,"}"):e+=a,i&&l.push(a)})),e&&(c+="".concat(n,"{").concat(e,"}"))})),a&&u&&p.remove&&p.remove(f)}return i?l.filter((function(t){return t})):c},r.prototype.buildFromRule=function(t,e,n){var r,o=this;void 0===n&&(n={});var i,a="",s=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get("selectorsAdd"),u=t.get("singleAtRule");if(null===(r=t.get("selectors"))||void 0===r||r.forEach((function(t){var e=t.getFullName();(o.compCls.indexOf(e)>=0||o.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!s){var p=t.getDeclaration({body:1});p&&(n.json?a=t:a+=p)}else e.push(t);return a},r.prototype.matchedRules=function(t,e){var n=this,r=t.getEl(),o=[];return e.forEach((function(t){try{t.selectorsToString().split(",").some((function(t){return null==r?void 0:r.matches(n.__cleanSelector(t))}))&&o.push(t)}catch(t){}})),t.components().forEach((function(t){o=o.concat(n.matchedRules(t,e))})),o=o.filter((function(t,e){return o.indexOf(t)===e}))},r.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):No},r.prototype.sortMediaObject=function(e){var n=this;void 0===e&&(e={});var r=[];return(0,t.each)(e,(function(t,e){return r.push({key:e,value:t})})),r.sort((function(t,e){var r=[t.key,e.key].every((function(t){return-1!==t.indexOf("min-width")})),o=r?t.key:e.key,i=r?e.key:t.key;return n.getQueryLength(o)-n.getQueryLength(i)}))},r.prototype.sortRules=function(t,e){var n=function(t){return t.get("mediaText")||""},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf("min-width")})),o=n(r?t:e),i=n(r?e:t);return this.getQueryLength(o)-this.getQueryLength(i)},r.prototype.__cleanSelector=function(t){return t.split(" ").map((function(t){return t.split(":")[0]})).join(" ")},r}(l.Hn);const Lo=Ro;var Io=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Do=function(){return Do=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Do.apply(this,arguments)},Fo=((0,e.hasWin)()?window:{}).CSS,Vo=function(n){function r(t,e){void 0===e&&(e={});var r=n.call(this,t)||this;return r.config=t||{},r.opt=e,r.em=e.em,r.ensureSelectors(null,null,{}),r.on("change",r.__onChange),r}return Io(r,n),r.prototype.defaults=function(){return{selectors:[],selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:!1,important:!1,group:"",shallow:!1,_undo:!0}},r.prototype.__onChange=function(t,n){var r=this.em,o=this.changedAttributes();o&&!(0,e.isEmptyObj)(o)&&(null==r||r.changesUp(n))},r.prototype.clone=function(){var t=Do({},this.opt),e=Do({},this.attributes);return e.selectors=this.get("selectors").map((function(t){return t.clone()})),new this.constructor(e,t)},r.prototype.ensureSelectors=function(e,n,r){var o=this.em,i=null==o?void 0:o.get("SelectorManager"),a=[this,"change:selectors",this.ensureSelectors],s=this.getSelectors();if(this.stopListening.apply(this,a),s.models&&(s=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],s.models,!0)),s=(0,t.isString)(s)?[s]:s,Array.isArray(s)){var l=s.filter((function(t){return t})).map((function(t){return i?i.add(t):t}));s=new _e(l)}this.set("selectors",s,r),this.listenTo.apply(this,a)},r.prototype.getAtRule=function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@".concat(t):e?"@media":"";return n+(e&&n?" ".concat(e):"")},r.prototype.selectorsToString=function(t){void 0===t&&(t={});var e=[],n=this.get("state"),r=this.get("selectorsAdd"),o={escape:function(t){return Fo&&Fo.escape?Fo.escape(t):t}},i=this.get("selectors").getFullString(0,o),a=n&&!t.skipState?":".concat(n):"";return i&&e.push("".concat(i).concat(a)),r&&!t.skipAdd&&e.push(r),e.join(", ")},r.prototype.getDeclaration=function(t){void 0===t&&(t={});var e="",n=this.attributes.important,r=this.selectorsToString(t),o=this.styleToString(Do({important:n},t)),i=this.get("singleAtRule");return(r||i)&&(o||t.allowEmpty)&&(e=i?o:"".concat(r,"{").concat(o,"}")),e},r.prototype.getDevice=function(){var t=this.em,e=this.attributes,n=e.atRuleType,r=e.mediaText,o=(null==t?void 0:t.get("DeviceManager").getDevices())||[],i=o.filter((function(t){return""===t.getWidthMedia()}))[0];return"media"===n&&r?o.filter((function(t){return t.getWidthMedia()===function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:""}(r)}))[0]||null:i||null},r.prototype.getState=function(){var t=this.em,e=this.get("state");return((null==t?void 0:t.get("SelectorManager").getStates())||[]).filter((function(t){return t.getName()===e}))[0]||null},r.prototype.getComponent=function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),r=n&&n.isId()&&n.get("name");return r&&(null===(t=this.em)||void 0===t?void 0:t.Components.getById(r))||null},r.prototype.toCSS=function(t){void 0===t&&(t={});var e="",n=this.getAtRule(),r=this.getDeclaration(t);return(r||t.allowEmpty)&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e},r.prototype.toJSON=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=l.Hn.prototype.toJSON.apply(this,n);if(null===(e=this.em)||void 0===e?void 0:e.getConfig().avoidDefaults){var i=this.defaults();(0,t.forEach)(i,(function(t,e){o[e]===t&&delete o[e]})),delete o.style.__p,(0,t.isEmpty)(o.selectors)&&delete o.selectors,(0,t.isEmpty)(o.style)&&delete o.style}return o},r.prototype.compare=function(e,n,r,o){var i;void 0===o&&(o={});var a=n||"",s=r||"",l=o.selectorsAdd||"",c=o.atRuleType||"";s&&!c&&(c="media");var u=((0,t.isArray)(e)||e.models?e.models||e:[e]).map((function(t){return t.getFullName()})),p=null===(i=this.get("selectors"))||void 0===i?void 0:i.map((function(t){return t.getFullName()})),d=u.slice().sort(),f=p.slice().sort();return!(u.length!==p.length||!d.every((function(t,e){return t===f[e]})))&&(this.get("state")===a&&this.get("mediaText")===s&&this.get("selectorsAdd")===l&&this.get("atRuleType")===c)},r}(se);const Bo=Vo;var zo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ho=function(t){function e(e,n){var r=t.call(this,e)||this;return r.editor=null==n?void 0:n.em,setTimeout((function(){r.on("remove",r.onRemove),r.on("add",r.onAdd)})),r}return zo(e,t),e.prototype.toJSON=function(t){return l.FE.prototype.toJSON.call(this,t).filter((function(t){return t.style&&!t.shallow}))},e.prototype.onAdd=function(t,e,n){t.ensureSelectors(t,e,n)},e.prototype.onRemove=function(t){var e=this.editor;e.stopListening(t),e.UndoManager.remove(t)},e.prototype.add=function(t,e){return void 0===e&&(e={}),"string"==typeof t&&(t=this.editor.get("Parser").parseCss(t)),e.em=this.editor,l.FE.prototype.add.apply(this,[t,e])},e}(l.FE);const $o=Ho;Ho.prototype.model=Bo;var Wo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uo=function(){return Uo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Uo.apply(this,arguments)},qo=function(n){function r(t){var e=n.call(this,t,"CssComposer",null,{},jo)||this;e.Selectors=_e,e.storageKey="styles";var r=e.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),r.rules=e.em.config.style||r.rules||"",e.rules=new $o([],r),e}return Wo(r,n),r.prototype.onLoad=function(){this.rules.add(this.config.rules,{silent:!0})},r.prototype.postLoad=function(){var t,e=null===(t=this.em)||void 0===t?void 0:t.get("UndoManager");e&&e.add(this.getAll())},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(t){return this.loadProjectData(t,{all:this.rules})},r.prototype.add=function(t,e,n,r,o){void 0===r&&(r={}),void 0===o&&(o={});var i=e||"",a=n||"",s=Uo({},r),l=this.get(t,i,a,s);return l&&l.config&&!l.config.singleAtRule||(s.state=i,s.mediaText=a,s.selectors=[],a&&!s.atRuleType&&(s.atRuleType="media"),(l=new Bo(s,this.config)).get("selectors").add(t,o),this.rules.add(l,o)),l},r.prototype.get=function(e,n,r,o){var i=e;if((0,t.isString)(e)){var a=this.em.Selectors,s=e.split(",")[0].trim(),l=this.em.Parser.parserCss.checkNode({selectors:s})[0];i=a.get(l.selectors)}return this.rules.find((function(t){return t.compare(i,n,r,o)}))||null},r.prototype.getAll=function(){return this.rules},r.prototype.addCollection=function(n,r,o){void 0===r&&(r={}),void 0===o&&(o={});var i=this.em,a=[];(0,t.isString)(n)&&(n=i.Parser.parseCss(n));for(var s=n instanceof Array?n:[n],l=0,c=s.length;l<c;l++){var u=s[l]||{};if(u.selectors){var p=null==i?void 0:i.Selectors;p||console.warn("Selector Manager not found");for(var d=u.selectors,f=d instanceof Array?d:[d],h=[],g=0,v=f.length;g<v;g++){var m=p.add(f[g]);h.push(m)}var y=this.get(h,u.state,u.mediaText,u),b=this.add(h,u.state,u.mediaText,u,r),w=!y||!r.avoidUpdateStyle,x=u.style||{};if((0,e.isObject)(o)&&b.set(o,r),w){var _=r.extend?Uo(Uo({},b.get("style")),x):x;b.set("style",_,r)}a.push(b)}}return a},r.prototype.addRules=function(t){return this.addCollection(t)},r.prototype.setRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.atRuleType,o=n.atRuleParams,i=this.em.Parser.parserCss.checkNode({selectors:t,style:e})[0],a=i.state,s=i.selectorsAdd,l=this.em.Selectors.add(i.selectors),c=this.add(l,a,o,{selectorsAdd:s,atRule:r});return n.addStyles?c.addStyle(e,n):c.setStyle(e,n),c},r.prototype.getRule=function(t,e){void 0===e&&(e={});var n=this.em,r=n.Selectors,o=n.Parser.parserCss.checkNode({selectors:t})[0],i=r.get(o.selectors),a=o.state,s=o.selectorsAdd,l=e.atRuleType,c=e.atRuleParams;return i?this.get(i,a,c,{selectorsAdd:s,atRuleType:l}):void 0},r.prototype.getRules=function(e){var n=this.getAll();if(!e)return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],n.models,!0);var r={sort:!0},o=(0,t.isString)(e)?e.split(",").map((function(t){return t.trim()})):e,i=n.filter((function(t){return o.indexOf(t.getSelectors().getFullString(null,r))>=0}));return i},r.prototype.setIdRule=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=r.addOpts,i=void 0===o?{}:o,a=r.mediaText,s=r.state||"",l=(0,t.isUndefined)(a)?this.em.getCurrentMedia():a,c=this.em.Selectors.add({name:e,type:ye.TYPE_ID},i),u=this.add(c,s,l,{},i);return u.setStyle(n,Uo(Uo({},r),i)),u},r.prototype.getIdRule=function(e,n){void 0===n&&(n={});var r=n.mediaText,o=n.state||"",i=(0,t.isUndefined)(r)?this.em.getCurrentMedia():r,a=this.em.Selectors.get(e,ye.TYPE_ID);return a&&this.get(a,o,i)},r.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.state||"",o=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:ye.TYPE_CLASS}),a=this.add(i,r,o);return a.setStyle(e,n),a},r.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||"",r=e.mediaText||this.em.getCurrentMedia(),o=this.em.Selectors.get(t,ye.TYPE_CLASS);return o&&this.get(o,n,r)},r.prototype.remove=function(e,n){var r=(0,t.isString)(e)?this.getRules(e):e,o=this.getAll().remove(r,n);return(0,t.isArray)(o)?o:[o]},r.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},r.prototype.getComponentRules=function(e,n){void 0===n&&(n={});var r=n.state,o=n.mediaText;n.current&&(r=this.em.get("state")||"",o=this.em.getCurrentMedia());var i=e.getId(),a=this.getAll().filter((function(e){return!(!(0,t.isUndefined)(r)&&e.get("state")!==r)&&(!(!(0,t.isUndefined)(o)&&e.get("mediaText")!==o)&&e.getSelectorsString()==="#".concat(i))}));return a},r.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new Et({collection:this.rules,config:this.config}),this.rulesView.render().el},r.prototype.checkId=function(e,n){void 0===n&&(n={});var r=n.idMap,o=void 0===r?{}:r,i=[];return Object.keys(o).length?((Array.isArray(e)?e:[e]).forEach((function(e){var n=e.selectors;if(n&&1==n.length){var r=n[0];if((0,t.isString)(r)){if("#"===r[0]){var a=r.substring(1),s=o[a];a&&s&&(n[0]="#".concat(s),i.push(e))}}else if(r.name&&r.type===ye.TYPE_ID){(s=o[r.name])&&(r.name=s,i.push(e))}}})),i):i},r.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},r}(v);const Go=qo;const Ko={appendTo:"",blocks:[],appendOnClick:!1,custom:!1};var Yo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Xo=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Yo(n,e),n.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},Object.defineProperty(n.prototype,"category",{get:function(){var t=this.get("category");return t instanceof Oe?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),n.prototype.getId=function(){return this.id},n.prototype.getLabel=function(){return this.get("label")},n.prototype.getMedia=function(){return this.get("media")},n.prototype.getContent=function(){return this.get("content")},n.prototype.getCategoryLabel=function(){var e=this.get("category");return(0,t.isFunction)(null==e?void 0:e.get)?e.get("label"):(null==e?void 0:e.label)?null==e?void 0:e.label:e},n}(l.Hn);var Zo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jo=function(t){function e(e,n){var r=t.call(this,e)||this;return r.em=n.em,r.on("add",r.handleAdd),r}return Zo(e,t),e.prototype.getCategories=function(){return this.em.Blocks.getCategories()},e.prototype.handleAdd=function(t){this.initCategory(t)},e}(Ae);const Qo=Jo;var ti;Jo.prototype.model=Xo,function(t){t.add="block:add",t.remove="block:remove",t.removeBefore="block:remove:before",t.update="block:update",t.dragStart="block:drag:start",t.drag="block:drag",t.dragEnd="block:drag:stop",t.custom="block:custom",t.all="block"}(ti||(ti={}));var ei=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=function(n){function r(t,e){void 0===e&&(e={});var r=n.call(this,t)||this,o=r.model;return r.em=e.em,r.config=e,r.endDrag=r.endDrag.bind(r),r.ppfx=e.pStylePrefix||"",r.listenTo(o,"destroy remove",r.remove),r.listenTo(o,"change",r.render),r}return ei(r,n),r.prototype.events=function(){return{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"}},r.prototype.__getModule=function(){return this.em.Blocks},r.prototype.handleClick=function(e){var n=this,r=n.config,o=n.model,i=n.em,a=o.get("onClick")||r.appendOnClick;if(i.trigger("block:click",o,e),a){if((0,t.isFunction)(a))return a(o,null==i?void 0:i.getEditor(),{event:e});var s,l,c=r.getSorter(),u=o.get("content"),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)s=p;else{var d=p.parent();d&&c.validTarget(d.getEl(),u).valid&&(s=d,l=d.components().indexOf(p)+1)}if(!s){var f=i.getWrapper();c.validTarget(f.getEl(),u).valid&&(s=f)}var h=s&&s.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},r.prototype.startDrag=function(t){var e=this,n=e.config,r=e.em,o=e.model,i=o.get("disable");if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){r.refreshCanvas();var a=n.getSorter();a.__currentBlock=o,a.setDragHelper(this.el,t),a.setDropContent(this.model.get("content")),a.startSort(this.el),(0,vt.on)(document,"mouseup",this.endDrag)}},r.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},r.prototype.handleDrag=function(t){this.__getModule().__drag(t)},r.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},r.prototype.endDrag=function(){(0,vt.S1)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},r.prototype.render=function(){var t,n=this,r=n.em,o=n.el,i=n.$el,a=n.ppfx,s=n.model,l=s.get("disable"),c=s.get("attributes")||{},u=c.class||"",p="".concat(a,"block"),d=r&&r.t("blockManager.labels.".concat(s.id))||s.get("label"),f=s.get("render"),h=s.get("media"),g=l?"".concat(p,"--disable"):"".concat(a,"four-color-h");i.attr(c),o.className="".concat(u," ").concat(p," ").concat(a,"one-bg ").concat(g).trim(),o.innerHTML="\n ".concat(h?'<div class="'.concat(p,'__media">').concat(h,"</div>"):"",'\n <div class="').concat(p,'-label">').concat(d,"</div>\n "),o.title=c.title||(null===(t=o.textContent)||void 0===t?void 0:t.trim()),o.setAttribute("draggable","".concat(!(!(0,e.hasDnd)(r)||l)));var v=f&&f({el:o,model:s,className:p,prefix:a});return v&&(o.innerHTML=v),this},r}(l.G7);const ri=ni;var oi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ii=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.config=n;var i=n.pStylePrefix||"";return o.em=n.em,o.catName=r,o.pfx=i,o.caretR="fa fa-caret-right",o.caretD="fa fa-caret-down",o.iconClass="".concat(i,"caret-icon"),o.activeClass="".concat(i,"open"),o.className="".concat(i).concat(r,"-category"),o.listenTo(o.model,"change:open",o.updateVisibility),o.model.view=o,o}return oi(e,t),e.prototype.events=function(){return{"click [data-title]":"toggle"}},e.prototype.template=function(t){var e,r,o=t.pfx,i=t.label,a=t.catName;return n(si||(e=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],r=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,si=e),o,o,i,o,a)},e.prototype.attributes=function(){return this.model.get("attributes")||{}},e.prototype.updateVisibility=function(){this.model.get("open")?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getTypeEl().style.display=""},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().style.display="none"},e.prototype.toggle=function(){var t=this.model;t.set("open",!t.get("open"))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},e.prototype.append=function(t){this.getTypeEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,r=t.$el,o=t.model,i=t.pfx,a=t.catName,s=e.t("".concat(a,"Manager.categories.").concat(o.id))||o.get("label");return n.innerHTML=this.template({pfx:i,label:s,catName:a}),r.addClass(this.className),r.css({order:o.get("order")}),this.updateVisibility(),this},e}(l.G7);const ai=ii;var si,li=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ci=function(){return ci=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ci.apply(this,arguments)},ui=function(e){function n(n,r){var o=e.call(this,n)||this;o.renderedCategories=new Map,(0,t.bindAll)(o,"getSorter","onDrag","onDrop","onMove"),o.config=r||{},o.categories=n.categories||"";var i=o.config.pStylePrefix||"";o.ppfx=i,o.noCatClass="".concat(i,"blocks-no-cat"),o.blockContClass="".concat(i,"blocks-c"),o.catsClass="".concat(i,"block-categories");var a=o.collection;return o.listenTo(a,"add",o.addTo),o.listenTo(a,"reset",o.render),o.em=o.config.em,o.em&&(o.config.getSorter=o.getSorter),o}return li(n,e),n.prototype.__getModule=function(){return this.em.Blocks},n.prototype.updateConfig=function(t){void 0===t&&(t={}),this.config=ci(ci({},this.config),t)},n.prototype.getSorter=function(){var t=this.em;if(t){if(!this.sorter){var e=t.Utils,n=t.Canvas;this.sorter=new e.Sorter({container:n.getBody(),placer:n.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:n.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:t,canvasRelative:1})}return this.sorter}},n.prototype.onDrag=function(t){this.em.stopDefault(),this.__getModule().__startDrag(this.sorter.__currentBlock,t)},n.prototype.onMove=function(t){this.__getModule().__drag(t)},n.prototype.onDrop=function(t){this.em.runDefault(),this.__getModule().__endDrag({component:t}),delete this.sorter.__currentBlock},n.prototype.addTo=function(t){this.add(t)},n.prototype.add=function(t,e){var n=this.config,r=this.renderedCategories,o=t.get("attributes"),i=new ri({model:t,attributes:o},n).render().el,a=t.parent.initCategory(t);if(a&&this.categories&&!n.ignoreCategories){var s=a.getId(),l=this.getCategoriesEl(),c=r.get(s);return!c&&l&&(c=new ai({model:a},n,"block").render(),r.set(s,c),l.appendChild(c.el)),void(null==c||c.append(i))}e?e.appendChild(i):this.append(i)},n.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},n.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},n.prototype.append=function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},n.prototype.render=function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();delete this.catsEl,delete this.blocksEl,this.renderedCategories=new Map,this.el.innerHTML='\n <div class="'.concat(this.catsClass,'"></div>\n <div class="').concat(this.noCatClass,'">\n <div class="').concat(this.blockContClass,'"></div>\n </div>\n '),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this},n}(l.G7);const pi=ui;var di=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fi=function(){return fi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},fi.apply(this,arguments)},hi=function(e){function n(n){var r,o=e.call(this,n,"BlockManager",new Qo((null===(r=n.config.blockManager)||void 0===r?void 0:r.blocks)||[],{em:n}),ti,Ko)||this;return o.events=ti,o.Block=Xo,o.Blocks=Qo,o.Category=Oe,o.Categories=Me,o.storageKey="",o.blocks=o.all,o.blocksVisible=new Qo(o.blocks.models,{em:n}),o.categories=new Me,o.blocks.on("add",(function(t){return o.blocksVisible.add(t)})),o.blocks.on("remove",(function(t){return o.blocksVisible.remove(t)})),o.blocks.on("reset",(function(t){return o.blocksVisible.reset(t.models)})),o.__onAllEvent=(0,t.debounce)((function(){return o.__trgCustom()}),0),o}return di(n,e),n.prototype.__trgCustom=function(){this.em.trigger(this.events.custom,this.__customData())},n.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(e,n){return t.startDrag(e,n)},drag:function(e){return t.__drag(e)},dragStop:function(e){return t.endDrag(e)}}},n.prototype.__startDrag=function(t,e){var n=this,r=n.em,o=n.events,i=n.blocks,a=t.getContent?t.getContent():t;this._dragBlock=t,r.set({dragResult:null,dragContent:a}),[r,i].map((function(n){return n.trigger(o.dragStart,t,e)}))},n.prototype.__drag=function(t){var e=this,n=e.em,r=e.events,o=e.blocks,i=this._dragBlock;[n,o].map((function(e){return e.trigger(r.drag,i,t)}))},n.prototype.__endDrag=function(e){void 0===e&&(e={});var n=this,r=n.em,o=n.events,i=n.blocks,a=this._dragBlock,s=e.component||r.get("dragResult");if(delete this._dragBlock,s&&a){var l="activeOnRender",c=s.get&&s.get(l),u=a.get("activate")||c,p=a.get("select"),d=(0,t.isArray)(s)?s[0]:s;(p||u&&!1!==p)&&r.setSelected(d),u&&(d.trigger("active"),c&&d.unset(l)),a.get("resetId")&&d.onAll((function(t){return t.resetId()}))}r.set({dragResult:null,dragContent:null}),a&&[r,i].map((function(t){return t.trigger(o.dragEnd,s,a)}))},n.prototype.__getFrameViews=function(){return this.em.Canvas.getFrames().map((function(t){return t.view})).filter(Boolean)},n.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=fi(fi({},this._bhv||{}),t)},n.prototype.__getBehaviour=function(){return this._bhv||{}},n.prototype.startDrag=function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach((function(t){var e;return null===(e=t.droppable)||void 0===e?void 0:e.startCustom()}))},n.prototype.endDrag=function(t){this.__getFrameViews().forEach((function(e){var n;return null===(n=e.droppable)||void 0===n?void 0:n.endCustom(t)})),this.__endDrag()},n.prototype.postRender=function(){var t=this,e=t.categories,n=t.config,r=t.em,o=this.blocksVisible;this.blocksView=new pi({collection:o,categories:e},fi(fi({},n),{em:r})),this.__appendTo(o.models),this.__trgCustom()},n.prototype.add=function(t,e,n){void 0===n&&(n={});var r=e||{};return r.id=t,this.blocks.add(r,n)},n.prototype.get=function(t){return this.blocks.get(t)},n.prototype.getAll=function(){return this.blocks},n.prototype.getAllVisible=function(){return this.blocksVisible},n.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},n.prototype.getCategories=function(){return this.categories},n.prototype.getContainer=function(){var t;return null===(t=this.blocksView)||void 0===t?void 0:t.el},n.prototype.getDragBlock=function(){return this._dragBlock},n.prototype.getBlocksByCategory=function(t){return Ee(t||this.getAll().models)},n.prototype.render=function(t,e){void 0===e&&(e={});var n=this,r=n.categories,o=n.config,i=n.em,a=t||this.getAll().models;if(e.external){var s=new Qo(a,{em:i});return new pi({collection:s,categories:r},fi(fi({em:i},o),e)).render().el}return this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(a),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=!0)),this.getContainer()},n.prototype.destroy=function(){var t,e=[this.blocks,this.blocksVisible,this.categories];e.map((function(t){return t.stopListening()})),e.map((function(t){return t.reset()})),null===(t=this.blocksView)||void 0===t||t.remove()},n}(v);const gi=hi;const vi={stylePrefix:"clm-",appendTo:"",selectors:[],states:[{name:"hover"},{name:"active"},{name:"nth-of-type(2n)"}],iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',componentFirst:!1,custom:!1};var mi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mi(e,t),e.prototype.defaults=function(){return{name:"",label:""}},e.prototype.getName=function(){return this.get("name")},e.prototype.getLabel=function(){return this.get("label")||this.getName()},e}(l.Hn);const bi=yi;yi.prototype.idAttribute="name";var wi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xi="contentEditable",_i=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.em=r.em,n.listenTo(n.model,"change:active",n.updateStatus),n}return wi(e,t),e.prototype.template=function(){var t,e,r=this,o=r.pfx,i=r.model,a=r.config,s=i.get("label")||"";return n(Si||(t=['\n <span id="','checkbox" class="','tag-status" data-tag-status></span>\n <span id="','tag-label" data-tag-name>','</span>\n <span id="','close" class="','tag-close" data-tag-remove> $'," </span>\n "],e=['\n <span id="','checkbox" class="','tag-status" data-tag-status></span>\n <span id="','tag-label" data-tag-name>','</span>\n <span id="','close" class="','tag-close" data-tag-remove> $'," </span>\n "],Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,Si=t),o,o,o,s,o,o,a.iconTagRemove)},e.prototype.events=function(){return{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[xi]="true",e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),r=n.textContent||"",o=null==e?void 0:e.Selectors;n[xi]="false",null==e||e.setEditing(!1),o&&o.rename(t,r)!==t&&(n.innerText=t.getLabel())},e.prototype.changeStatus=function(){var t=this.model;t.set("active",!t.getActive())},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,r=t.config,o=r.iconTagOn,i=r.iconTagOff,a=n.find("[data-tag-status]");e.get("active")?(a.html(o),n.removeClass("opac50")):(a.html(i),n.addClass("opac50"))},e.prototype.render=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.$el,o=t.model,i="".concat(e,"tag"),a=["".concat(i," ").concat(n,"three-bg")];return o.get("protected")&&a.push("".concat(i,"-protected")),r.html(this.template()),r.attr("class",a.join(" ")),this.updateStatus(),this},e}(l.G7);const Ci=_i;var Si,Oi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ei=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},ki=function(e){function r(n){void 0===n&&(n={});var r=e.call(this,n)||this;r.config=n.config||{},r.pfx=r.config.stylePrefix||"",r.ppfx=r.config.pStylePrefix||"",r.className=r.pfx+"tags",r.stateInputId=r.pfx+"states",r.stateInputC=r.pfx+"input-c",r.states=r.config.states||[];var o=r.config.em,i=r.collection;r.target=o;var a=o.Selectors;r.module=a,r.em=o,r.componentChanged=(0,t.debounce)(r.componentChanged.bind(r),0),r.checkSync=(0,t.debounce)(r.checkSync.bind(r),0);return r.listenTo(o,"component:toggled component:update:classes",r.componentChanged),r.listenTo(o,"styleManager:update",r.componentChanged),r.listenTo(o,"component:update:classes change:state",r.__handleStateChange),r.listenTo(o,"styleable:change change:device",r.checkSync),r.listenTo(i,"add",r.addNew),r.listenTo(i,"reset",r.renderClasses),r.listenTo(i,"remove",r.tagRemoved),r.listenTo(a.getAll(),a.events.state,(0,t.debounce)((function(){return r.renderStates()}),0)),r.delegateEvents(),r}return Oi(r,e),r.prototype.template=function(t){var e=t.labelInfo,r=t.labelHead,o=t.iconSync,i=t.iconAdd,a=t.pfx,s=t.ppfx;return n(Ai||(Ai=Ei([' <div id="','up" class="','header">\n <div id="','label" class="','header-label">','</div>\n <div id="','status-c" class="','header-status">\n <span id="','input-c" data-states-c>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select id="','states" data-states></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="','tags-field" class="','field">\n <div id="','tags-c" data-selectors></div>\n <input id="','new" data-input />\n <span id="','add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',' </span>\n <span class="',"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',' </span>\n </div>\n <div class="','sels-info">\n <div class="','label-sel">',':</div>\n <div class="','sels" data-selected></div>\n </div>'],[' <div id="','up" class="','header">\n <div id="','label" class="','header-label">','</div>\n <div id="','status-c" class="','header-status">\n <span id="','input-c" data-states-c>\n <div class="',"field ",'select">\n <span id="','input-holder">\n <select id="','states" data-states></select>\n </span>\n <div class="','sel-arrow">\n <div class="','d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="','tags-field" class="','field">\n <div id="','tags-c" data-selectors></div>\n <input id="','new" data-input />\n <span id="','add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',' </span>\n <span class="',"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',' </span>\n </div>\n <div class="','sels-info">\n <div class="','label-sel">',':</div>\n <div class="','sels" data-selected></div>\n </div>'])),a,a,a,a,r,a,a,a,s,s,s,a,s,s,a,s,a,a,a,a,a,i,a,a,o,a,a,e,a)},r.prototype.events=function(){return{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"}},r.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.Css,o=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get("state"),a=e.getCurrentMedia(),s=[],l=r.get(o,i,a)||r.add(o,i,a);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:i,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&l.addStyle(t),e.trigger("component:toggled"),e.trigger("component:sync-style",{component:n,selectors:o,mediaText:a,rule:l,ruleComponents:s,state:i})},r.prototype.tagRemoved=function(t){this.updateStateVis()},r.prototype.addNew=function(t){this.addToClasses(t)},r.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:"none"}),null===(e=this.$input)||void 0===e||e.show().focus()},r.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:""}),null===(e=this.$input)||void 0===e||e.hide().val("")},r.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},r.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},r.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},r.prototype.updateSelection=function(e){var n=e||this.getTargets(),r=[];return(n=(0,t.isArray)(n)?n:[n])&&n.length&&(r=this.getCommonSelectors({targets:n}),this.checkSync({validSelectors:r})),this.collection.reset(r),this.updateStateVis(n),this.module.__trgCustom(),r},r.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,o=void 0===r?{}:r,i=n||this.getTargets();return this.module.__getCommonSelectors(i,o)},r.prototype._commonSelectors=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.module).__common.apply(t,e)},r.prototype.checkSync=function(){var e,n=this,r=n.$btnSyncEl,o=n.config,i=n.collection,a=this.getTarget();if(a&&o.componentFirst&&i.length){var s=a.getStyle();e=!(0,t.isEmpty)(s)}r&&r[e?"show":"hide"]()},r.prototype.getTarget=function(){return this.target.getSelected()},r.prototype.getTargets=function(){return this.target.getSelectedAll()},r.prototype.updateStateVis=function(t){var e=this.em,n=e&&e.getConfig().avoidInlineStyle,r=this.collection.length||n?"":"none";this.getStatesC().css("display",r),this.updateSelector(t)},r.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},r.prototype.updateSelector=function(e){var n=this,r=this.el.querySelector("[data-selected]"),o=[],i=e||this.getTargets();(i=(0,t.isArray)(i)?i:[i]).forEach((function(t){return o.push(n.__getName(t))})),r&&(r.innerHTML=o.join(", ")),this.checkStates()},r.prototype.__getName=function(e){var r,o=this,i=o.pfx,a=o.config,s=o.em,l=a.selectedName,c=a.componentFirst;if((0,t.isString)(e))r=n(Pi||(Pi=Ei(['<span class="','sel-gen">',"</span>"],['<span class="','sel-gen">',"</span>"])),i,e);else{var u=null==e?void 0:e.getSelectors();if(!u)return"";var p=u.getStyleable(),d=s.get("state"),f=e.getId?n(ji||(ji=Ei(['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"],['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"])),i,e.getName(),i,e.getId()):"";r=(r=this.collection.getFullString(p))?n(Mi||(Mi=Ei(['<span class="','sel-rule">',"</span>"],['<span class="','sel-rule">',"</span>"])),i,r):e.get("selectorsAdd")||f,r=c&&f?f:r,r+=d?n(Ni||(Ni=Ei(['<span class="','sel-state">:',"</span>"],['<span class="','sel-state">:',"</span>"])),i,d):"",r=l?l({result:r,state:d,target:e}):r}return r&&'<span class="'.concat(i,'sel">').concat(r,"</span>")},r.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set("state",n)},r.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},r.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),o=new Ci({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(o):r.append(o),o},r.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return t.addToClasses(n,e)})),n.append(e)},r.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},r.prototype.getStates=function(){if(!this.$states){var t=this.$el.find("[data-states]");this.$states=t[0]&&t}return this.$states},r.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},r.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t("selectorManager.emptyState"),r=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return'<option value="'.concat(t.id,'">').concat(n,"</option>")})).join(""),o=this.getStates();o&&o.html('<option value="">'.concat(n,"</option>").concat(r)),this.checkStates()},r.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,o=t.config,i=t.$el,a=t.el,s=o.render,l={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:e.t("selectorManager.label"),labelInfo:e.t("selectorManager.selected"),ppfx:r,pfx:n,el:a};i.html(this.template(l));var c=s&&s(l);return c&&c!==a&&i.empty().append(c),this.$input=i.find("[data-input]"),this.$addBtn=i.find("[data-add]"),this.$classes=i.find("#"+n+"tags-c"),this.$btnSyncEl=i.find("[data-sync-style]"),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr("class","".concat(this.className," ").concat(r,"one-bg ").concat(r,"two-color")),this},r}(l.G7);const Ti=ki;var Ai,Pi,ji,Mi,Ni,Ri=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Li=function(){return Li=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Li.apply(this,arguments)},Ii=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Di=function(e){return(0,t.isString)(e)&&"#"==e[0]},Fi=function(e){return(0,t.isString)(e)&&"."==e[0]},Vi="selector",Bi="".concat(Vi,":"),zi="".concat(Bi,"add"),Hi="".concat(Bi,"update"),$i="".concat(Bi,"remove"),Wi="".concat($i,":before"),Ui="".concat(Bi,"custom"),qi="".concat(Bi,"state"),Gi={all:Vi,update:Hi,add:zi,remove:$i,removeBefore:Wi,state:qi,custom:Ui},Ki=function(n){function r(e){var r=n.call(this,e,"SelectorManager",new _e([]),Gi,vi,{skipListen:!0})||this;r.Selector=ye,r.Selectors=_e,r.storageKey="",(0,t.bindAll)(r,"__updateSelectedByComponents");var o=r.config,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),r.all=new _e(o.selectors),r.selected=new _e([],{em:e,config:o}),r.states=new l.FE(o.states.map((function(t){return new bi(t)})),{model:bi}),r.model=new l.Hn({cFirst:o.componentFirst,_undo:!0}),r.__update=(0,t.debounce)((function(){return r.__trgCustom()}),0),r.__initListen({collections:[r.states,r.selected],propagate:[{entity:r.states,event:r.events.state}]}),e.on("change:state",(function(t,n){return e.trigger(qi,n)})),r.model.on("change:cFirst",(function(t,n){return e.trigger("selector:type",n)})),e.on("component:toggled component:update:classes",r.__updateSelectedByComponents);return r.model.listenTo(e,"component:toggled component:update:classes change:device styleManager:update selector:state selector:type style:target",(function(){return r.__update()})),r}return Ri(r,n),r.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,this.__customData(t))},r.prototype.getAll=function(t){return void 0===t&&(t={}),this.all?t.array?Ii([],this.all.models,!0):this.all:[]},r.prototype.__customData=function(t){return void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,{states:this.getStates(),selected:this.getSelected(),container:this.__ctn}},r.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},r.prototype.select=function(t,n){void 0===n&&(n={});var r=Array.isArray(t)?t:[t],o=this.em.Styles.select(r,n);this.selected.reset(this.__getCommonSelectors(o));var i=this.selectorTags,a=o.filter((function(t){return t})).map((function(t){return(0,e.isComponent)(t)||(0,e.isRule)(t)&&!t.get("selectorsAdd")?t:t.getSelectorsString()}));return i&&i.componentChanged({targets:a}),this},r.prototype.addSelector=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=Li({},n);(0,t.isObject)(e)?o=e:o.name=e,Di(o.name)?(o.name=o.name.substr(1),o.type=ye.TYPE_ID):Fi(o.name)&&(o.name=o.name.substr(1)),o.label&&!o.name&&(o.name=this.escapeName(o.label));var i=o.name,a=this.getConfig(),s=this.all,l=this.em,c=i?this.get(i,o.type):s.where(o)[0];if(!c){var u=o instanceof ye?o:new ye(o,Li(Li({},r),{config:a,em:l}));return s.add(u,r)}return c},r.prototype.getSelector=function(t,e){return void 0===e&&(e=ye.TYPE_CLASS),Di(t)?(t=t.substr(1),e=ye.TYPE_ID):Fi(t)&&(t=t.substr(1)),this.all.where({name:t,type:e})[0]},r.prototype.add=function(e,n){var r=this;void 0===n&&(n={});var o=(0,t.isString)(e)?{}:n;return(0,t.isArray)(e)?e.map((function(t){return r.addSelector(t,n,o)})):this.addSelector(e,n,o)},r.prototype.addClass=function(e){var n=this,r=[];return(0,t.isString)(e)&&(e=e.trim().split(" ")),e.forEach((function(t){return r.push(n.addSelector(t))})),r},r.prototype.get=function(e,n){var r=this;if((0,t.isArray)(e)){var o=[];return e.map((function(t){return r.getSelector(t)})).filter(Boolean).forEach((function(t){return o.indexOf(t)<0&&o.push(t)})),o}return this.getSelector(e,n)},r.prototype.remove=function(t,e){return this.__remove(t,e)},r.prototype.rename=function(t,e,n){var r=this.escapeName(e);return this.get(r)||t.set({name:r,label:e},n)},r.prototype.setState=function(t){return this.em.setState(t),this},r.prototype.getState=function(){return this.em.getState()},r.prototype.getStates=function(){return Ii([],this.states.models,!0)},r.prototype.setStates=function(t,e){return this.states.reset(t.map((function(t){return new bi(t)})),e)},r.prototype.getSelected=function(){return this.__getCommon()},r.prototype.getSelectedAll=function(){return Ii([],this.selected.models,!0)},r.prototype.addSelected=function(t){var e=this.add(t);this.em.getSelectedAll().forEach((function(t){t.getSelectors().add(e)}))},r.prototype.removeSelected=function(t){this.em.getSelectedAll().forEach((function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)}))},r.prototype.duplicateSelected=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=this.getSelected();if(!(o.indexOf(t)<0)){var i=this.getState(),a=r.getCurrentMedia(),s=r.Css.get(o,i,a),l=null==s?void 0:s.getStyle();if(r.getSelectedAll().forEach((function(r){var o=r.getSelectors();if(o.includes(t)){var i=e.suffix||" copy",a=t.getLabel(),s=n.addSelector("".concat(a).concat(i)),l=o.indexOf(t);o.remove(t),o.add(s,{at:l})}})),l)r.Css.add(this.getSelected(),i,a).setStyle(l)}},r.prototype.getSelectedTargets=function(){return this.em.Styles.getSelectedAll()},r.prototype.setComponentFirst=function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},r.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},r.prototype.escapeName=function(t){var e=this.getConfig().escapeName;return e?e(t):ye.escapeName(t)},r.prototype.render=function(t){var e=this.selectorTags,n=this.getConfig(),r=null==e?void 0:e.el;return this.selected.reset(t),this.selectorTags=new Ti({el:r,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},r.prototype.destroy=function(){var t=this.selectorTags;this.model.stopListening(),this.__update.cancel(),this.__destroy(),null==t||t.remove(),this.selectorTags=void 0},r.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},r.prototype.__getCommonSelectors=function(t,e){void 0===e&&(e={});var n=t.map((function(t){return t.getSelectors&&t.getSelectors().getValid(e)})).filter(Boolean);return this.__common.apply(this,n)},r.prototype.__common=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length?1===e.length?e[0]:2===e.length?e[0].filter((function(t){return e[1].indexOf(t)>=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},r.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},r}(v);const Yi=Ki;const Xi={textTags:["br","b","i","u","a","ul","ol"],textTypes:["text","textnode","comment"],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:"text/html",allowScripts:!1,allowUnsafeAttr:!1,allowUnsafeAttrValue:!1,keepEmptyTextNodes:!1}};var Zi,Ji=5,Qi=6,ta=7,ea=11,na=12,ra=13,oa=14,ia=15,aa=((Zi={})[4]="media",Zi[Ji]="font-face",Zi[Qi]="page",Zi[ta]="keyframes",Zi[ea]="counter-style",Zi[na]="supports",Zi[ra]="document",Zi[oa]="font-feature-values",Zi[ia]="viewport",Zi),sa=(0,t.keys)(aa),la=[Ji,Qi,ea,ia],ca=sa.filter((function(t){return la.indexOf(Number(t))<0})).map((function(t){return aa[t]})).concat(["container","layer"]),ua=la.map((function(t){return aa[t]})),pa=function(t){void 0===t&&(t="");for(var e=[],n=[],r=t.split(","),o=0,i=r.length;o<i;o++){var a=r[o].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}},da=function(t){for(var e=t.style,n={},r=0,o=e.length;r<o;r++){var i=e[r],a=e.getPropertyValue(i),s=e.getPropertyPriority(i);n[i]="".concat(a).concat(s?" !".concat(s):"")}return n},fa=function(t){return(t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||"").trim()},ha=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r={},o=t.length,i=t[o-1],a=i?i.split(/:(.+)/):[],s=a[1],l=n.atRule,c=n.selectorsAdd,u=n.mediaText;return ua.indexOf(l)>=0&&(r.singleAtRule=!0),l&&(r.atRuleType=l),c&&(r.selectorsAdd=c),u&&(r.mediaText=u),s&&(t[o-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},ga=function(t){var e=t.cssText,n=void 0===e?"":e;return ca.find((function(t){return 0===n.indexOf("@".concat(t))}))},va=function(t){for(var e=[],n=t.cssRules||[],r=0,o=n.length;r<o;r++){var i=n[r],a=i.type,s=!1,l="",c="",u=i.selectorText||i.keyText||"",p=la.indexOf(a)>=0;if(p)s=!0,l=aa[a],c=fa(i);else if(sa.indexOf("".concat(a))>=0||!a&&ga(i)){var d=va(i),f=aa[a]||ga(i);c=fa(i);for(var h=0,g=d.length;h<g;h++){var v=d[h];c&&(v.mediaText=c),v.atRuleType=f}e=e.concat(d)}if(u||p){for(var m=da(i),y=pa(u),b=y.add,w=y.result,x=void 0,_=0,C=w.length;_<C;_++){var S=ha(w[_],m,{atRule:aa[a]});e.push(S),x=S}if(b.length){var O=b.join(", ");if(x)x.selectorsAdd=O;else{S={selectors:[],selectorsAdd:O,style:m};s&&(S.singleAtRule=s),l&&(S.atRuleType=l),c&&(S.mediaText=c),e.push(S)}}}}return e};const ma=function(e,n){return void 0===n&&(n={}),{parse:function(t){var r=this,o=[],i=n.parserCss,a=null==e?void 0:e.Editor,s=i?i(t,a):function(t){var e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;return document.head.removeChild(e),n?va(n):[]}(t);return s.forEach((function(t){return o=o.concat(r.checkNode(t))})),null==e||e.trigger("parse:css",{input:t,output:o,nodes:s}),o},checkNode:function(e){var n=e.selectors,r=e.style,o=[e];if((0,t.isString)(n)){var i=[],a=e,s=pa(n),l=s.result,c=s.add.join(", "),u={atRule:a.atRule,mediaText:a.params};if(l.length?l.forEach((function(t){i.push(ha(t,r,u))})):i.push(ha([],r,u)),c)i[i.length-1].selectorsAdd=c;o=i}return o}}};var ya=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ba=function(t){function e(e){var n=t.call(this,e,"Parser",Xi)||this,r=n.config;return n.parserCss=ma(e,r),n.parserHtml=ee(e,r),n}return ya(e,t),e.prototype.parseHtml=function(t,e){void 0===e&&(e={});var n=this.em,r=this.parserHtml;return r.compTypes=n.Components.getTypes()||{},r.parse(t,this.parserCss,e)},e.prototype.parseCss=function(t){return this.parserCss.parse(t)},e.prototype.destroy=function(){},e}(g);const wa=ba;const xa={id:"gjs-",type:"local",autosave:!0,autoload:!0,stepsBeforeSave:1,recovery:!1,onStore:function(t){return t},onLoad:function(t){return t},options:{local:{key:"gjsProject",checkLocal:!0},remote:{headers:{},urlStore:"",urlLoad:"",contentTypeJson:!0,fetchOptions:"",credentials:"include",onStore:function(t){return t},onLoad:function(t){return t}}}};var _a=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Ca=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};const Sa=function(){function t(){}return t.prototype.store=function(t,e){return void 0===e&&(e={}),_a(this,void 0,void 0,(function(){return Ca(this,(function(n){return this.hasLocal(e,!0)&&localStorage.setItem(e.key,JSON.stringify(t)),[2,t]}))}))},t.prototype.load=function(t){return void 0===t&&(t={}),_a(this,void 0,void 0,(function(){var e;return Ca(this,(function(n){return e={},this.hasLocal(t,!0)&&(e=JSON.parse(localStorage.getItem(t.key)||"{}")),[2,e]}))}))},t.prototype.hasLocal=function(t,n){if(void 0===t&&(t={}),t.checkLocal&&(!(0,e.hasWin)()||!localStorage)){if(n)throw new Error("localStorage not available");return!1}return!0},t}();function Oa(t){return Oa="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},Oa(t)}const Ea=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)}))}))};const ka=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(Oa(t)+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"===Oa(n)||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))};function Ta(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}Ta.prototype=Error.prototype;const Aa=function(t){var e=this;return new e((function(n,r){if(!t||void 0===t.length)return r(new TypeError("Promise.any accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return r();for(var i=[],a=0;a<o.length;a++)try{e.resolve(o[a]).then(n).catch((function(t){i.push(t),i.length===o.length&&r(new Ta(i,"All promises were rejected"))}))}catch(t){r(t)}}))};var Pa=setTimeout;function ja(t){return Boolean(t&&void 0!==t.length)}function Ma(){}function Na(t){if(!(this instanceof Na))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=[],Va(t,this)}function Ra(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,Na._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 Ia(e.promise,t)}La(e.promise,r)}else(1===t._state?La:Ia)(e.promise,t._value)}))):t._deferreds.push(e)}function La(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===Oa(e)||"function"==typeof e)){var n=e.then;if(e instanceof Na)return t._state=3,t._value=e,void Da(t);if("function"==typeof n)return void Va((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,Da(t)}catch(e){Ia(t,e)}var r,o}function Ia(t,e){t._state=2,t._value=e,Da(t)}function Da(t){2===t._state&&0===t._deferreds.length&&Na._immediateFn((function(){t._handled||Na._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)Ra(t,t._deferreds[e]);t._deferreds=null}function Fa(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function Va(t,e){var n=!1;try{t((function(t){n||(n=!0,La(e,t))}),(function(t){n||(n=!0,Ia(e,t))}))}catch(t){if(n)return;n=!0,Ia(e,t)}}Na.prototype.catch=function(t){return this.then(null,t)},Na.prototype.then=function(t,e){var n=new this.constructor(Ma);return Ra(this,new Fa(t,e,n)),n},Na.prototype.finally=Ea,Na.all=function(t){return new Na((function(e,n){if(!ja(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,a){try{if(a&&("object"===Oa(a)||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){i(t,e)}),n)}r[t]=a,0==--o&&e(r)}catch(t){n(t)}}for(var a=0;a<r.length;a++)i(a,r[a])}))},Na.any=Aa,Na.allSettled=ka,Na.resolve=function(t){return t&&"object"===Oa(t)&&t.constructor===Na?t:new Na((function(e){e(t)}))},Na.reject=function(t){return new Na((function(e,n){n(t)}))},Na.race=function(t){return new Na((function(e,n){if(!ja(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=t.length;r<o;r++)Na.resolve(t[r]).then(e,n)}))},Na._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){Pa(t,0)},Na._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};const Ba=Na;(0,e.hasWin)()&&(window.Promise=window.Promise||Ba);const za="function"==typeof fetch?fetch.bind():function(t,e){return new Ba((function(n,r){var o=new XMLHttpRequest;for(var i in o.open(e.method||"get",t),o.withCredentials="include"==e.credentials,e.headers||{})o.setRequestHeader(i,e.headers[i]);o.onload=function(t){return n({status:o.status,statusText:o.statusText,text:function(){return Ba.resolve(o.responseText)}})},o.onerror=r,o.upload&&e.onProgress&&(o.upload.onprogress=e.onProgress),e.body?o.send(e.body):o.send()}))};var Ha=function(){return Ha=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ha.apply(this,arguments)},$a=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Wa=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Ua=function(){function e(){}return e.prototype.store=function(t,e){return void 0===e&&(e={}),$a(this,void 0,void 0,(function(){return Wa(this,(function(n){switch(n.label){case 0:return[4,this.request(e.urlStore,this.__props(e,t),e)];case 1:return[2,n.sent()]}}))}))},e.prototype.load=function(t){return void 0===t&&(t={}),$a(this,void 0,void 0,(function(){return Wa(this,(function(e){switch(e.label){case 0:return[4,this.request(t.urlLoad,this.__props(t),t)];case 1:return[2,e.sent()]}}))}))},e.prototype.request=function(e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),za(e,n).then((function(t){var e=t.text();return 1==(t.status/200|0)?e:e.then(Promise.reject)})).then((function(e){var n=e&&(0,t.isString)(e);return r.contentTypeJson&&n?JSON.parse(e):e}))},e.prototype.__props=function(e,n){void 0===e&&(e={});var r,o=e.contentTypeJson,i=e.headers||{},a=e.fetchOptions||{},s="X-Requested-With",l="Content-Type";if((0,t.isUndefined)(i[s])&&(i[s]="XMLHttpRequest"),(0,t.isUndefined)(i[l])&&o&&(i[l]="application/json; charset=utf-8"),n)if(o)r=JSON.stringify(n);else for(var c in r=new FormData,n)r.append(c,n[c]);var u={method:r?"POST":"GET",credentials:e.credentials,headers:i,body:r};return Ha(Ha({},u),(0,t.isFunction)(a)?a(u):a)},e}();const qa=Ua;var Ga;!function(t){t.start="storage:start",t.startStore="storage:start:store",t.startLoad="storage:start:load",t.load="storage:load",t.store="storage:store",t.after="storage:after",t.afterStore="storage:after:store",t.afterLoad="storage:after:load",t.end="storage:end",t.endStore="storage:end:store",t.endLoad="storage:end:load",t.error="storage:error",t.errorStore="storage:error:store",t.errorLoad="storage:error:load"}(Ga||(Ga={}));const Ka=Ga;var Ya=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xa=function(){return Xa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xa.apply(this,arguments)},Za=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Ja=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Qa="local",ts="remote",es=function(e){function n(t){var n=e.call(this,t,"StorageManager",xa)||this;n.storages={},n.events=Ka;var r=n.config;return r._disable&&(r.type=void 0),n.storages={},n.add(Qa,new Sa),n.add(ts,new qa),n.setCurrent(r.type),n}return Ya(n,e),n.prototype.isAutosave=function(){return!!this.config.autosave},n.prototype.setAutosave=function(t){return this.config.autosave=!!t,this},n.prototype.getStepsBeforeSave=function(){return this.config.stepsBeforeSave},n.prototype.setStepsBeforeSave=function(t){return this.config.stepsBeforeSave=t,this},n.prototype.add=function(t,e){return this.storages[t]=e,this},n.prototype.get=function(t){return this.storages[t]},n.prototype.getStorages=function(){return this.storages},n.prototype.getCurrent=function(){return this.config.currentStorage},n.prototype.setCurrent=function(t){return this.getConfig().currentStorage=t,this},n.prototype.getCurrentStorage=function(){return this.get(this.getCurrent())},n.prototype.getStorageOptions=function(t){return this.getCurrentOptions(t)},n.prototype.store=function(t,e){return void 0===e&&(e={}),Za(this,void 0,void 0,(function(){var n,r,o,i,a;return Ja(this,(function(s){switch(s.label){case 0:n=this.getCurrentStorage(),r=Xa(Xa({},this.getCurrentOptions()),e),o=this.getRecoveryStorage(),i=this.getCurrentOptions(Qa),s.label=1;case 1:return s.trys.push([1,5,,9]),[4,this.__exec(n,r,t)];case 2:return s.sent(),o?[4,this.__exec(o,i,{})]:[3,4];case 3:s.sent(),s.label=4;case 4:return[3,9];case 5:return a=s.sent(),o?[4,this.__exec(o,i,t)]:[3,7];case 6:return s.sent(),[3,8];case 7:throw a;case 8:return[3,9];case 9:return[2,t]}}))}))},n.prototype.load=function(e){return void 0===e&&(e={}),Za(this,void 0,void 0,(function(){var n,r,o,i,a;return Ja(this,(function(s){switch(s.label){case 0:return n=this.getCurrentStorage(),r=Xa(Xa({},this.getCurrentOptions()),e),(o=this.getRecoveryStorage())?[4,this.__exec(o,this.getCurrentOptions(Qa))]:[3,5];case 1:if(a=s.sent(),(0,t.isEmpty)(a))return[3,5];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.__askRecovery()];case 3:return s.sent(),i=a,[3,5];case 4:return s.sent(),[3,5];case 5:return i?[3,7]:[4,this.__exec(n,r)];case 6:i=s.sent(),s.label=7;case 7:return[2,i||{}]}}))}))},n.prototype.__askRecovery=function(){var e=this.em,n=this.getRecovery();return new Promise((function(r,o){(0,t.isFunction)(n)?n(r,o,null==e?void 0:e.getEditor()):confirm(null==e?void 0:e.t("storageManager.recover"))?r(null):o()}))},n.prototype.getRecovery=function(){return this.config.recovery},n.prototype.getRecoveryStorage=function(){return this.getRecovery()&&this.getCurrent()===ts&&this.get(Qa)},n.prototype.__exec=function(t,e,n){var r;return Za(this,void 0,void 0,(function(){var o,i,a,s,l,c,u,p,d,f,h,g,v;return Ja(this,(function(m){switch(m.label){case 0:if(o=n?"store":"load",i=this.getConfig(),a=i.onStore,s=i.onLoad,this.onStart(o,n),!t)return[2,n||{}];m.label=1;case 1:return m.trys.push([1,14,,15]),c=null===(r=this.em)||void 0===r?void 0:r.getEditor(),u=void 0,n?(d=a)?[4,a(n,c)]:[3,3]:[3,7];case 2:d=m.sent(),m.label=3;case 3:return p=d||n,(f=e.onStore)?[4,e.onStore(p,c)]:[3,5];case 4:f=m.sent(),m.label=5;case 5:return p=f||p,[4,t.store(p,e)];case 6:return u=m.sent(),l=n,[3,13];case 7:return[4,t.load(e)];case 8:return u=m.sent(),l=this.__clearKeys(u),(h=e.onLoad)?[4,e.onLoad(l,c)]:[3,10];case 9:h=m.sent(),m.label=10;case 10:return l=h||l,(g=s)?[4,s(l,c)]:[3,12];case 11:g=m.sent(),m.label=12;case 12:l=g||l,m.label=13;case 13:return this.onAfter(o,l,u),this.onEnd(o,l,u),[3,15];case 14:throw v=m.sent(),this.onError(o,v),v;case 15:return[2,l]}}))}))},n.prototype.__clearKeys=function(t){void 0===t&&(t={});var e=this.getConfig(),n=new RegExp("^".concat(e.id)),r={};for(var o in t){r[o.replace(n,"")]=t[o]}return r},n.prototype.getCurrentOptions=function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}},n.prototype.onStart=function(t,e){var n=this.em;if(n){var r="load"===t?Ka.startLoad:Ka.startStore;n.trigger(Ka.start,t,e),n.trigger(r,e)}},n.prototype.onAfter=function(t,e,n){var r=this.em;if(r){var o="load"===t?Ka.afterLoad:Ka.afterStore;r.trigger(Ka.after),r.trigger(o,e,n);var i="load"===t?Ka.load:Ka.store;r.trigger(i,e,n)}},n.prototype.onEnd=function(t,e,n){var r=this.em;if(r){var o="load"===t?Ka.endLoad:Ka.endStore;r.trigger(Ka.end,t,e,n),r.trigger(o,e,n)}},n.prototype.onError=function(t,e){var n=this.em;if(n){var r="load"===t?Ka.errorLoad:Ka.errorStore;n.trigger(Ka.error,e,t),n.trigger(r,e),this.onEnd(t,e)}},n.prototype.canAutoload=function(){return!!this.getCurrentStorage()&&!!this.config.autoload},n.prototype.destroy=function(){this.storages={}},n}(g);const ns=es;const rs={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}],custom:!1};var os=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},is.apply(this,arguments)},as=function(n){function r(t){void 0===t&&(t={});var e=n.call(this,t)||this;e.events={},e.appendInput=!0;var r=t.config,o=void 0===r?{}:r,i=e,a=i.model,s=i.eventCapture,l=a.target,c=a.attributes.type;return e.config=o,e.em=o.em,e.pfx=o.stylePrefix||"",e.ppfx=o.pStylePrefix||"",e.target=l,e.className=e.pfx+"trait",e.clsField="".concat(e.ppfx,"field ").concat(e.ppfx,"field-").concat(c),[["change:value",e.onValueChange],["remove",e.removeView]].forEach((function(t){var n=t[0],r=t[1];a.off(n,r),e.listenTo(a,n,r)})),a.view=e,e.listenTo(a,"change:label",e.render),e.listenTo(a,"change:placeholder",e.rerender),e.events={},s.forEach((function(t){return e.events[t]="onChange"})),e.delegateEvents(),e.init(),e}return os(r,n),r.prototype.attributes=function(){return this.model.get("attributes")||{}},r.prototype.templateLabel=function(t){var e=this.ppfx,n=this.getLabel();return'<div class="'.concat(e,'label" title="').concat(n,'">').concat(n,"</div>")},r.prototype.templateInput=function(t){var e=this.clsField;return'<div class="'.concat(e,'" data-input></div>')},r.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},r.prototype.removeView=function(){this.remove(),this.removed()},r.prototype.init=function(){},r.prototype.removed=function(){},r.prototype.onRender=function(t){},r.prototype.onUpdate=function(t){},r.prototype.onEvent=function(t){},r.prototype.onChange=function(e){var n=this.getInputElem();n&&!(0,t.isUndefined)(n.value)&&this.model.set("value",n.value),this.onEvent(is(is({},this.getClbOpts()),{event:e}))},r.prototype.getValueForTarget=function(){return this.model.get("value")},r.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},r.prototype.onValueChange=function(t,e,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(t.get("value")),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}},r.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||""),t.find("[data-label]").append(r)},r.prototype.getLabel=function(){var t=this.em,n=this.model.attributes,r=n.label,o=n.name;return t.t("traitManager.traits.labels.".concat(o))||(0,e.capitalize)(r||o).replace(/-/g," ")},r.prototype.getComponent=function(){return this.target},r.prototype.getInputEl=function(){if(!this.$input){var e=this.em,n=this.model,r=n,o=n.attributes.name,i=r.get("placeholder")||r.get("default")||"",s=r.get("type")||"text",l=r.get("min"),c=r.get("max"),u=this.getModelValue(),p=(0,a.default)('<input type="'.concat(s,'">')),d=e.t("traitManager.traits.attributes.".concat(o))||{};p.attr(is({placeholder:i},d)),(0,t.isUndefined)(u)||(r.set({value:u},{silent:!0}),p.prop("value",u)),l&&p.prop("min",l),c&&p.prop("max",c),this.$input=p}return this.$input.get(0)},r.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},r.prototype.getModelValue=function(){return this.model.getValue()},r.prototype.getElInput=function(){return this.elInput},r.prototype.renderField=function(){var e=this,n=e.$el,r=e.appendInput,o=e.model,i=n.find("[data-input]"),a=i[i.length-1],s=o.el;s||(s=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,t.isString)(s)?(a.innerHTML=s,this.elInput=a.firstChild):(r?a.appendChild(s):a.insertBefore(s,a.firstChild),this.elInput=s),o.el=this.elInput},r.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},r.prototype.rerender=function(){delete this.model.el,this.render()},r.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},r.prototype.render=function(){var e=this,n=e.$el,r=e.pfx,o=e.ppfx,i=e.model.attributes,a=i.type,s=i.id,l=this.hasLabel&&this.hasLabel(),c="".concat(r,"trait");delete this.$input;var u='<div class="'.concat(c," ").concat(c,"--").concat(a,'">\n ').concat(l?'<div class="'.concat(o,'label-wrp" data-label></div>'):"",'\n <div class="').concat(o,"field-wrp ").concat(o,"field-wrp--").concat(a,'" data-input>\n ').concat(this.templateInput?(0,t.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n </div>\n </div>");return n.empty().append(u),l&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(s),this.postUpdate(),this.onRender(this.getClbOpts()),this},r}(l.G7);const ss=as;as.prototype.eventCapture=["change"];var ls=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ls(e,t),e.prototype.templateInput=function(){return""},e.prototype.onChange=function(){this.handleClick()},e.prototype.handleClick=function(){this.model.runCommand()},e.prototype.renderLabel=function(){this.model.get("label")&&ss.prototype.renderLabel.apply(this)},e.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),r=n.labelButton,o=n.text,i=n.full,a=r||o,s="".concat(e,"btn");return'<button type="button" class="'.concat(s,"-prim").concat(i?" ".concat(s,"--full"):"",'">').concat(a,"</button>")},e}(ss);const us=cs;cs.prototype.eventCapture=["click button"];var ps=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ds=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.appendInput=!1,t}return ps(n,e),n.prototype.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>')},n.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},n.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},n.prototype.getInputEl=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=!this.$input,o=ss.prototype.getInputEl.apply(this,e);if(r){var i=void 0,a=void 0,s=this.model,l=this.target,c=s.attributes.valueFalse,u=s.getName();s.changeProp?a=i=l.get(u):i=!(!(a=l.get("attributes")[u])&&""!==a),(0,t.isUndefined)(c)||a!==c||(i=!1),o.checked=i}return o},n}(ss);var fs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hs=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.ppfx||"";return n.opts=e,n.ppfx=r,n.em=e.target||{},!e.onChange&&n.listenTo(n.model,"change:value",n.handleModelChange),n}return fs(e,t),e.prototype.template=function(){return'<span class="'.concat(this.holderClass(),'"></span>')},e.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.elementUpdated=function(){this.model.trigger("el:change")},e.prototype.setValue=function(t,e){var n=this.model,r=t||n.get("defaults"),o=this.getInputEl();o&&(o.value=r)},e.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},e.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},e.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},e.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,e=this.opts.type||"text",n=t.get("placeholder")||t.get("defaults")||t.get("default")||"";this.inputEl=(0,a.default)('<input type="'.concat(e,'" placeholder="').concat(n,'">'))}return this.inputEl.get(0)},e.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},e}(l.G7);const gs=hs;hs.prototype.events={change:"handleChange"};var vs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ms=function(){return ms=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ms.apply(this,arguments)};a.default&&function(t,n){if((0,e.hasWin)()){var r={beforeShow:k,move:k,change:k,show:k,hide:k,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},o=[],i=!!/msie/i.exec(window.navigator.userAgent),a=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")}(),s=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>","</div>"].join(""),l=function(){var t="";if(i)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",t,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}(),c="spectrum.id";t.fn.spectrum=function(e,n){if("string"==typeof e){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=o[t(this).data(c)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");"get"==e?r=n.get():"container"==e?r=n.container:"option"==e?r=n.option.apply(n,i):"destroy"==e?(n.destroy(),t(this).removeData(c)):a.apply(n,i)}})),r}return this.spectrum("destroy").each((function(){var n=E(this,t.extend({},e,t(this).data()));t(this).data(c,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=P,t.fn.spectrum.defaults=r,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&&!j()&&e.spectrum({preferredFormat:"hex6"})};var u=/^[\s,#]+/,p=/\s+$/,d=0,f=Math,h=f.round,g=f.min,v=f.max,m=f.random,y=function(t,e){if(e=e||{},(t=t||"")instanceof y)return t;if(!(this instanceof y))return new y(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=!1,o=!1;"string"==typeof t&&(t=function(t){t=t.replace(u,"").replace(p,"").toLowerCase();var e,n=!1;if(_[t])t=_[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:et(e[1]),r:J(e[2]),g:J(e[3]),b:J(e[4]),format:n?"name":"hex8"};if(e=S.hex6.exec(t))return{r:J(e[1]),g:J(e[2]),b:J(e[3]),format:n?"name":"hex"};if(e=S.hex3.exec(t))return{r:J(e[1]+""+e[1]),g:J(e[2]+""+e[2]),b:J(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=function(t,e,n){return{r:255*X(t,255),g:255*X(e,255),b:255*X(n,255)}}(t.r,t.g,t.b),r=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=tt(t.s),t.v=tt(t.v),e=function(t,e,n){t=6*X(t,360),e=X(e,100),n=X(n,100);var r=f.floor(t),o=t-r,i=n*(1-e),a=n*(1-o*e),s=n*(1-(1-o)*e),l=r%6,c=[n,a,i,i,s,n][l],u=[s,n,n,a,i,i][l],p=[i,i,s,n,n,a][l];return{r:255*c,g:255*u,b:255*p}}(t.h,t.s,t.v),r=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=tt(t.s),t.l=tt(t.l),e=function(t,e,n){var r,o,i;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=X(t,360),e=X(e,100),n=X(n,100),0===e)r=o=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),o=a(l,s,t),i=a(l,s,t-1/3)}return{r:255*r,g:255*o,b:255*i}}(t.h,t.s,t.l),r=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a));return n=Y(n),{ok:r,format:t.format||o,r:g(255,v(e.r,0)),g:g(255,v(e.g,0)),b:g(255,v(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=h(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=n.ok,this._tc_id=d++};y.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=Y(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=N(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=N(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=M(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return R(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return L(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+h(this._r)+", "+h(this._g)+", "+h(this._b)+")":"rgba("+h(this._r)+", "+h(this._g)+", "+h(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:h(100*X(this._r,255))+"%",g:h(100*X(this._g,255))+"%",b:h(100*X(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+h(100*X(this._r,255))+"%, "+h(100*X(this._g,255))+"%, "+h(100*X(this._b,255))+"%)":"rgba("+h(100*X(this._r,255))+"%, "+h(100*X(this._g,255))+"%, "+h(100*X(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[R(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+L(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";t&&(n=y(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(V,arguments)},brighten:function(){return this._applyModification(B,arguments)},darken:function(){return this._applyModification(z,arguments)},desaturate:function(){return this._applyModification(I,arguments)},saturate:function(){return this._applyModification(D,arguments)},greyscale:function(){return this._applyModification(F,arguments)},spin:function(){return this._applyModification(H,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(G,arguments)},complement:function(){return this._applyCombination($,arguments)},monochromatic:function(){return this._applyCombination(K,arguments)},splitcomplement:function(){return this._applyCombination(q,arguments)},triad:function(){return this._applyCombination(W,arguments)},tetrad:function(){return this._applyCombination(U,arguments)}},y.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:tt(t[r]));t=n}return y(t,e)},y.equals=function(t,e){return!(!t||!e)&&y(t).toRgbString()==y(e).toRgbString()},y.random=function(){return y.fromRatio({r:m(),g:m(),b:m()})},y.mix=function(t,e,n){n=0===n?0:n||50;var r,o=y(t).toRgb(),i=y(e).toRgb(),a=n/100,s=2*a-1,l=i.a-o.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:i.r*r+o.r*c,g:i.g*r+o.g*c,b:i.b*r+o.b*c,a:i.a*a+o.a*(1-a)};return y(u)},y.readability=function(t,e){var n=y(t),r=y(e),o=n.toRgb(),i=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=Math.max(o.r,i.r)-Math.min(o.r,i.r)+Math.max(o.g,i.g)-Math.min(o.g,i.g)+Math.max(o.b,i.b)-Math.min(o.b,i.b);return{brightness:Math.abs(a-s),color:l}},y.isReadable=function(t,e){var n=y.readability(t,e);return n.brightness>125&&n.color>500},y.mostReadable=function(t,e){for(var n=null,r=0,o=!1,i=0;i<e.length;i++){var a=y.readability(t,e[i]),s=a.brightness>125&&a.color>500,l=a.brightness/125*3+a.color/500;(s&&!o||s&&o&&l>r||!s&&!o&&l>r)&&(o=s,r=l,n=y(e[i]))}return n};var b,w,x,_=y.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=y.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(_),S=(w="[\\s|\\(]+("+(b="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",x="[\\s|\\(]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")[,|\\s]+("+b+")\\s*\\)?",{rgb:new RegExp("rgb"+w),rgba:new RegExp("rgba"+x),hsl:new RegExp("hsl"+w),hsla:new RegExp("hsla"+x),hsv:new RegExp("hsv"+w),hsva:new RegExp("hsva"+x),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=y,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function O(e,n,r,o){for(var i=[],s=0;s<e.length;s++){var l=e[s];if(l){var c=y(l),u=c.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";u+=y.equals(n,l)?" sp-thumb-active":"";var p=c.toString(o.preferredFormat||"rgb"),d=a?"background-color:"+c.toRgbString():"filter:"+c.toFilter();i.push('<span title="'+p+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+d+';"></span></span>')}else{i.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",o.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+i.join("")+"</div>"}function E(e,c){var u=function(e,n){var o=t.extend({},r,e);return o.callbacks={move:A(o.move,n),change:A(o.change,n),show:A(o.show,n),hide:A(o.hide,n),beforeShow:A(o.beforeShow,n)},o}(c,e),p=u.flat,d=u.showSelectionPalette,f=u.localStorageKey,h=u.theme,g=u.callbacks,v=function(t,e,n){var r;return function(){var o=this,i=arguments,a=function(){r=null,t.apply(o,i)};n&&clearTimeout(r),!n&&r||(r=setTimeout(a,e))}}(zt,10),m=!1,b=!1,w=!0,x=0,_=0,C=0,S=0,E=0,k=0,M=0,N=0,R=0,L=0,I=1,D=[],F=[],V={},B=u.selectionPalette.slice(0),z=u.maxSelectionSize,H="sp-dragging",$=null,W=e.ownerDocument;W.body;var U=t(e),q=!1,G=t(l,W).addClass(h),K=G.find(".sp-picker-container"),Y=G.find(".sp-color"),X=G.find(".sp-dragger"),Z=G.find(".sp-hue"),J=G.find(".sp-slider"),Q=G.find(".sp-alpha-inner"),tt=G.find(".sp-alpha"),et=G.find(".sp-alpha-handle"),nt=G.find(".sp-input"),rt=G.find(".sp-palette"),ot=G.find(".sp-initial"),it=G.find(".sp-cancel"),at=G.find(".sp-clear"),st=G.find(".sp-choose"),lt=G.find(".sp-palette-toggle"),ct=U.is("input"),ut=ct&&"color"===U.attr("type")&&j(),pt=ct&&!p,dt=pt?t(s).addClass(h).addClass(u.className).addClass(u.replacerClassName):t([]),ft=pt?dt:U,ht=dt.find(".sp-preview-inner"),gt=u.color||ct&&U.val(),vt=!1,mt=u.preferredFormat,yt=!u.showButtons||u.clickoutFiresChange,bt=!gt,wt=u.allowEmpty&&!ut;function xt(){if(u.showPaletteOnly&&(u.showPalette=!0),lt.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),u.palette){D=u.palette.slice(0),F=t.isArray(D[0])?D:[D],V={};for(var e=0;e<F.length;e++)for(var n=0;n<F[e].length;n++){var r=y(F[e][n]).toRgbString();V[r]=!0}}G.toggleClass("sp-flat",p),G.toggleClass("sp-input-disabled",!u.showInput),G.toggleClass("sp-alpha-enabled",u.showAlpha),G.toggleClass("sp-clear-enabled",wt),G.toggleClass("sp-buttons-disabled",!u.showButtons),G.toggleClass("sp-palette-buttons-disabled",!u.togglePaletteOnly),G.toggleClass("sp-palette-disabled",!u.showPalette),G.toggleClass("sp-palette-only",u.showPaletteOnly),G.toggleClass("sp-initial-disabled",!u.showInitial),G.addClass(u.className).addClass(u.containerClassName),zt()}function _t(){if(f&&window.localStorage){try{var e=window.localStorage[f].split(",#");e.length>1&&(delete window.localStorage[f],t.each(e,(function(t,e){Ct(e)})))}catch(t){}try{B=window.localStorage[f].split(";")}catch(t){}}}function Ct(e){if(d){var n=y(e).toRgbString();if(!V[n]&&-1===t.inArray(n,B))for(B.push(n);B.length>z;)B.shift();if(f&&window.localStorage)try{window.localStorage[f]=B.join(";")}catch(t){}}}function St(){var e=It(),n=t.map(F,(function(t,n){return O(t,e,"sp-palette-row sp-palette-row-"+n,u)}));_t(),B&&n.push(O(function(){var t=[];if(u.showPalette)for(var e=0;e<B.length;e++){var n=y(B[e]).toRgbString();V[n]||t.push(B[e])}return t.reverse().slice(0,u.maxSelectionSize)}(),e,"sp-palette-row sp-palette-row-selection",u)),rt.html(n.join(""))}function Ot(){if(u.showInitial){var t=vt,e=It();ot.html(O([t,e],e,"sp-palette-row-initial",u))}}function Et(){(_<=0||x<=0||S<=0)&&zt(),b=!0,G.addClass(H),$=null,U.trigger("dragstart.spectrum",[It()])}function kt(){b=!1,G.removeClass(H),U.trigger("dragstop.spectrum",[It()])}function Tt(){var t=nt.val();if(null!==t&&""!==t||!wt){var e=y(t);e.isValid()?(Lt(e),Bt(!0)):nt.addClass("sp-validation-error")}else Lt(null),Bt(!0)}function At(){m?Nt():Pt()}function Pt(){var e=t.Event("beforeShow.spectrum");if(m)zt();else if(U.trigger("beforeShow.spectrum",[It()]),!1!==g.beforeShow(It())&&!e.isDefaultPrevented()){!function(){for(var t=0;t<o.length;t++)o[t]&&o[t].hide()}(),m=!0;var n=t(W);n.bind("keydown.spectrum",jt),n.bind("click.spectrum",Mt),t(window).bind("resize.spectrum",v),dt.addClass("sp-active"),G.removeClass("sp-hidden"),zt(),Ft(),vt=It(),Ot(),g.show(vt),U.trigger("show.spectrum",[vt])}}function jt(t){27===t.keyCode&&Nt()}function Mt(t){2!=t.button&&(b||(yt?Bt(!0):Rt(),Nt()))}function Nt(){m&&!p&&(m=!1,t(W).unbind("keydown.spectrum",jt),t(W).unbind("click.spectrum",Mt),t(window).unbind("resize.spectrum",v),dt.removeClass("sp-active"),G.addClass("sp-hidden"),g.hide(It()),U.trigger("hide.spectrum",[It()]))}function Rt(){Lt(vt,!0)}function Lt(t,e){var n,r;y.equals(t,It())?Ft():(!t&&wt?bt=!0:(bt=!1,w=!t,r=(n=y(t)).toHsv(),N=r.h%360/360,R=r.s,L=r.v,I=r.a),Ft(),n&&n.isValid()&&!e&&(mt=u.preferredFormat||n.getFormat()))}function It(t){return t=t||{},wt&&bt?null:y.fromRatio({h:N,s:R,v:L,a:Math.round(100*I)/100},{format:t.format||mt})}function Dt(){Ft(),g.move(It()),U.trigger("move.spectrum",[It()])}function Ft(){nt.removeClass("sp-validation-error"),Vt();var t=y.fromRatio({h:N,s:1,v:1});Y.css("background-color",t.toHexString());var e=mt;I<1&&(0!==I||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var n=It({format:e}),r="";if(ht.removeClass("sp-clear-display"),ht.css("background-color","transparent"),!n&&wt)ht.addClass("sp-clear-display");else{var o=n.toHexString(),s=n.toRgbString();if(a||1===n.alpha?ht.css("background-color",s):(ht.css("background-color","transparent"),ht.css("filter",n.toFilter())),u.showAlpha){var l=n.toRgb();l.a=0;var c=y(l).toRgbString(),p="linear-gradient(left, "+c+", "+o+")";i?Q.css("filter",y(c).toFilter({gradientType:1},o)):(Q.css("background","-webkit-"+p),Q.css("background","-moz-"+p),Q.css("background","-ms-"+p),Q.css("background","linear-gradient(to right, "+c+", "+o+")"))}r=n.toString(e)}u.showInput&&nt.val(r),u.showPalette&&St(),Ot()}function Vt(){var t=R,e=L;if(wt&&bt)et.hide(),J.hide(),X.hide();else{et.show(),J.show(),X.show();var n=t*x,r=_-e*_;n=Math.max(-C,Math.min(x-C,n-C)),r=Math.max(-C,Math.min(_-C,r-C)),X.css({top:r+"px",left:n+"px"});var o=I*E;et.css({left:o-k/2+"px"});var i=N*S;J.css({top:i-M+"px"})}}function Bt(t){var e=It(),n="",r=!!w||!y.equals(e,vt);e&&(n=e.toString(mt),!m&&Ct(e)),ct&&U.val(n),t&&r&&(g.change(e),U.trigger("change",[e]))}function zt(){m&&(x=Y.width(),_=Y.height(),C=X.height(),Z.width(),S=Z.height(),M=J.height(),E=tt.width(),k=et.width(),p||(G.css("position","absolute"),u.offset?G.offset(u.offset):G.offset(function(t,e){var n=e[0],r=t[0],o=r.parentElement,i=n.getBoundingClientRect(),a=r.offsetWidth,s=r.offsetHeight,l={top:0,left:0,width:n.offsetWidth,height:n.offsetHeight};for(;n&&(l.top+=n.offsetTop-n.scrollTop,l.left+=n.offsetLeft-n.scrollLeft,n!==o&&o.contains(n.offsetParent));)n=n.offsetParent;i.right+a>window.innerWidth-window.scrollX&&i.right-a>0&&(l.left-=a-l.width);i.bottom+s<window.innerHeight-window.scrollY?l.top+=l.height:l.top-=s;return l}(G,ft))),Vt(),u.showPalette&&St(),U.trigger("reflow.spectrum"))}function Ht(){Nt(),q=!0,U.attr("disabled",!0),ft.addClass("sp-disabled")}!function(){if(i&&G.find("*:not(input)").attr("unselectable","on"),xt(),pt&&U.after(dt).hide(),wt||at.hide(),p)U.after(G).hide();else{var e="parent"===u.appendTo?U.parent():t(u.appendTo);1!==e.length&&(e=t("body")),e.append(G)}function n(e){return e.data&&e.data.ignore?(Lt(t(e.target).closest(".sp-thumb-el").data("color")),Dt()):(Lt(t(e.target).closest(".sp-thumb-el").data("color")),Dt(),u.hideAfterPaletteSelect&&(Bt(!0),Nt())),!1}_t(),ft.bind("click.spectrum touchstart.spectrum",(function(e){q||At(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()})),(U.is(":disabled")||!0===u.disabled)&&Ht(),G.click(T),nt.change(Tt),nt.bind("paste",(function(){setTimeout(Tt,1)})),nt.keydown((function(t){13==t.keyCode&&Tt()})),it.text(u.cancelText),it.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),Rt(),Nt()})),at.attr("title",u.clearText),at.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),bt=!0,Dt(),p&&Bt(!0)})),st.text(u.chooseText),st.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),i&&nt.is(":focus")&&nt.trigger("change"),nt.hasClass("sp-validation-error")||(Bt(!0),Nt())})),lt.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),lt.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),u.showPaletteOnly=!u.showPaletteOnly,u.showPaletteOnly||p||G.css("left","-="+(K.outerWidth(!0)+5)),xt()})),P(tt,(function(t,e,n){I=t/E,bt=!1,n.shiftKey&&(I=Math.round(10*I)/10),Dt()}),Et,kt),P(Z,(function(t,e){N=parseFloat(e/S),bt=!1,u.showAlpha||(I=1),Dt()}),Et,kt),P(Y,(function(t,e,n){if(n.shiftKey){if(!$){var r=R*x,o=_-L*_,i=Math.abs(t-r)>Math.abs(e-o);$=i?"x":"y"}}else $=null;var a=!$||"y"===$;(!$||"x"===$)&&(R=parseFloat(t/x)),a&&(L=parseFloat((_-e)/_)),bt=!1,u.showAlpha||(I=1),Dt()}),Et,kt),gt?(Lt(gt),Ft(),mt=u.preferredFormat||y(gt).getFormat(),Ct(gt)):Ft(),p&&Pt();var r=i?"mousedown.spectrum":"click.spectrum touchstart.spectrum";rt.delegate(".sp-thumb-el",r,n),ot.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},n)}();var $t={show:Pt,hide:Nt,toggle:At,reflow:zt,option:function(e,r){return e===n?t.extend({},u):r===n?u[e]:(u[e]=r,"preferredFormat"===e&&(mt=u.preferredFormat),void xt())},enable:function(){q=!1,U.attr("disabled",!1),ft.removeClass("sp-disabled")},disable:Ht,offset:function(t){u.offset=t,zt()},set:function(t){Lt(t),Bt()},get:It,destroy:function(){U.show(),ft.unbind("click.spectrum touchstart.spectrum"),G.remove(),dt.remove(),o[$t.id]=null},container:G};return $t.id=o.push($t)-1,$t}function k(){}function T(t){t.stopPropagation()}function A(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,p="ontouchstart"in window,d={};function f(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],o=r&&r.pageX||t.pageX,d=r&&r.pageY||t.pageY,h=Math.max(0,Math.min(o-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));p&&f(t),n.apply(e,[h,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"]=h,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"),h(n),f(n))}))}function j(){return t.fn.spectrum.inputTypeColorSupport()}function M(t,e,n){t=X(t,255),e=X(e,255),n=X(n,255);var r,o,i=v(t,e,n),a=g(t,e,n),s=(i+a)/2;if(i==a)r=o=0;else{var l=i-a;switch(o=s>.5?l/(2-i-a):l/(i+a),i){case t:r=(e-n)/l+(e<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:o,l:s}}function N(t,e,n){t=X(t,255),e=X(e,255),n=X(n,255);var r,o,i=v(t,e,n),a=g(t,e,n),s=i,l=i-a;if(o=0===i?0:l/i,i==a)r=0;else{switch(i){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:o,v:s}}function R(t,e,n,r){var o=[Q(h(t).toString(16)),Q(h(e).toString(16)),Q(h(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function L(t,e,n,r){var o;return[Q((o=r,Math.round(255*parseFloat(o)).toString(16))),Q(h(t).toString(16)),Q(h(e).toString(16)),Q(h(n).toString(16))].join("")}function I(t,e){e=0===e?0:e||10;var n=y(t).toHsl();return n.s-=e/100,n.s=Z(n.s),y(n)}function D(t,e){e=0===e?0:e||10;var n=y(t).toHsl();return n.s+=e/100,n.s=Z(n.s),y(n)}function F(t){return y(t).desaturate(100)}function V(t,e){e=0===e?0:e||10;var n=y(t).toHsl();return n.l+=e/100,n.l=Z(n.l),y(n)}function B(t,e){e=0===e?0:e||10;var n=y(t).toRgb();return n.r=v(0,g(255,n.r-h(-e/100*255))),n.g=v(0,g(255,n.g-h(-e/100*255))),n.b=v(0,g(255,n.b-h(-e/100*255))),y(n)}function z(t,e){e=0===e?0:e||10;var n=y(t).toHsl();return n.l-=e/100,n.l=Z(n.l),y(n)}function H(t,e){var n=y(t).toHsl(),r=(h(n.h)+e)%360;return n.h=r<0?360+r:r,y(n)}function $(t){var e=y(t).toHsl();return e.h=(e.h+180)%360,y(e)}function W(t){var e=y(t).toHsl(),n=e.h;return[y(t),y({h:(n+120)%360,s:e.s,l:e.l}),y({h:(n+240)%360,s:e.s,l:e.l})]}function U(t){var e=y(t).toHsl(),n=e.h;return[y(t),y({h:(n+90)%360,s:e.s,l:e.l}),y({h:(n+180)%360,s:e.s,l:e.l}),y({h:(n+270)%360,s:e.s,l:e.l})]}function q(t){var e=y(t).toHsl(),n=e.h;return[y(t),y({h:(n+72)%360,s:e.s,l:e.l}),y({h:(n+216)%360,s:e.s,l:e.l})]}function G(t,e,n){e=e||6,n=n||30;var r=y(t).toHsl(),o=360/n,i=[y(t)];for(r.h=(r.h-(o*e>>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(y(r));return i}function K(t,e){e=e||6;for(var n=y(t).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/e;e--;)a.push(y({h:r,s:o,v:i})),i=(i+s)%1;return a}function Y(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function X(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=g(e,v(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),f.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Z(t){return g(1,v(0,t))}function J(t){return parseInt(t,16)}function Q(t){return 1==t.length?"0"+t:""+t}function tt(t){return t<=1&&(t=100*t+"%"),t}function et(t){return J(t)/255}}(a.default);var ys=function(t){var e="name"===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,"")},bs=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vs(n,e),n.prototype.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 ')},n.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.remove=function(){return e.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},n.prototype.handleChange=function(e){e.stopPropagation();var n=e.target.value;(0,t.isUndefined)(n)||this.__onInputChange(n)},n.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,r=t,o=this.getColorEl();if(o){o.spectrum("set",r);var i=o.spectrum("get"),a=r&&ys(i);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})},n.prototype.setValue=function(e,n){void 0===n&&(n={});var r=this.model,o=(0,t.isUndefined)(n.def)?r.get("defaults"):n.def,i=(0,t.isUndefined)(e)?(0,t.isUndefined)(o)?"":o:e,a=this.getInputEl(),s=this.getColorEl(),l="none"!=i?i:"";a.value=i,s.get(0).style.backgroundColor=l,(n.fromTarget||n.fromInput&&!n.avoidStore)&&(s.spectrum("set",l),this.noneColor="none"==i,this.movedColor=l)},n.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,r=e.model,o=e.opts,i=this.ppfx,s=o.onChange,l=(0,a.default)('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),c=l.get(0).style,u=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var p,d=!1;this.$el.find("[data-colorp-c]").append(l);var f=function(t,e){void 0===e&&(e=!0),s?s(t,!e):(e&&r.setValueFromInput(0,!1),r.setValueFromInput(t,e))};l.spectrum(ms(ms(ms({color:r.getValue()||!1,containerClassName:"".concat(i,"one-bg ").concat(i,"two-color ").concat(i,"editor-sp"),maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},u),r.get("colorPicker")||{}),{move:function(e){var n=ys(e);t.movedColor=n,c.backgroundColor=n,f(n,!1)},change:function(e){d=!0;var n=ys(e);c.backgroundColor=n,f(n),t.noneColor=!1},show:function(e){d=!1,t.movedColor="",p=s?r.getValue({noDefault:!0}):ys(e)},hide:function(){d||!p&&!s||(t.noneColor&&(p=""),c.backgroundColor=p,l.spectrum("set",p),f(p,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",(function(){t.movedColor&&f(t.movedColor),d=!0,t.movedColor="",l.spectrum("hide")})),this.colorEl=l}return this.colorEl},n.prototype.render=function(){return gs.prototype.render.call(this),this.getColorEl(),this},n}(gs);const ws=bs;var xs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const _s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xs(e,t),e.prototype.templateInput=function(){return""},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new ws({model:t,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(ss);var Cs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ss=function(e){function n(n){void 0===n&&(n={});var r=e.call(this,n)||this;return(0,t.bindAll)(r,"moveIncrement","upIncrement"),r.doc=document,r.listenTo(r.model,"change:unit",r.handleModelChange),r}return Cs(n,e),n.prototype.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 ')},n.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},n.prototype.setValue=function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),o={value:r.value,unit:""};(r.unit||r.force)&&(o.unit=r.unit),this.model.set(o,n),n.silent&&this.handleModelChange()},n.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},n.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},n.prototype.handleKeyDown=function(t){"ArrowUp"===t.key&&(t.preventDefault(),this.upArrowClick()),"ArrowDown"===t.key&&(t.preventDefault(),this.downArrowClick())},n.prototype.elementUpdated=function(){this.model.trigger("el:change")},n.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},n.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=['<option value="" disabled hidden>-</option>'];e.forEach((function(e){var r=e==t.get("unit")?"selected":"";n.push("<option ".concat(r,">").concat(e,"</option>"))}));var r=document.createElement("div");r.innerHTML='<select class="'.concat(this.ppfx,'input-unit">').concat(n.join(""),"</select>"),this.unitEl=r.firstChild}}return this.unitEl},n.prototype.upArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},n.prototype.downArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()},n.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var e=this.model.get("value")||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,vt.on)(this.doc,"mousemove",this.moveIncrement),(0,vt.on)(this.doc,"mouseup",this.upIncrement)},n.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get("step"),r=this.current,o=this.normalizeValue(r.val+(r.y-t.pageY)*n),i=this.validateInputValue(o),a=i.value,s=i.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1},n.prototype.upIncrement=function(){var t=this.model,e=t.get("step");if((0,vt.S1)(this.doc,"mouseup",this.upIncrement),(0,vt.S1)(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()}},n.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get("step"),r=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=n.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(t.toFixed(r)):t},n.prototype.validateInputValue=function(e,n){void 0===n&&(n={});var r=0,o=n||{},i=this.model,a=(0,t.isUndefined)(e)?"":e,s=n.units||i.get("units")||[],l=i.get("unit")||s.length&&s[0]||"",c=(0,t.isUndefined)(n.max)?i.get("max"):n.max,u=(0,t.isUndefined)(n.min)?i.get("min"):n.min,p=!!i.get("limitlessMax"),d=!!i.get("limitlessMin");if(o.deepCheck){var f=i.get("fixedValues")||[];if(""===a&&(l=""),a){var h=new RegExp("^"+f.join("|"),"g");if(f.length&&h.test(a))a=a.match(h)[0],l="",r=1;else{var g=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?"":a;var v=g.replace(a,"");(0,t.indexOf)(s,v)>=0&&(l=v)}}}return p||(0,t.isUndefined)(c)||""===c||(a=a>c?c:a),d||(0,t.isUndefined)(u)||""===u||(a=a<u?u:a),{force:r,value:a,unit:l}},n.prototype.render=function(){gs.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},n}(gs);const Os=Ss;Ss.prototype.events={"change input":"handleChange","change select":"handleUnitChange","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement",keydown:"handleKeyDown"};var Es=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ks=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Es(n,e),n.prototype.getValueForTarget=function(){var e=this.model,n=e.attributes,r=n.value,o=n.unit;return(0,t.isUndefined)(r)||""===r?e.get("default"):r+o},n.prototype.getInputEl=function(){if(!this.input){var t=this.ppfx,e=this.model,n=this.getModelValue(),r=new Os({contClass:"".concat(t,"field-int"),type:"number",model:e,ppfx:t});r.render(),this.$input=r.inputEl,this.$unit=r.unitEl,e.set("value",n,{fromTarget:!0}),this.$input.val(n),this.input=r.el}return this.input},n}(ss);const Ts=ks;var As=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ps=function(e){function n(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.listenTo(n.model,"change:options",n.rerender),n}return As(n,e),n.prototype.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>')},n.prototype.getInputEl=function(){if(!this.$input){var e=this.model,n=this.em,r=e.get("name"),o=e.get("options")||[],i=[],s="<select>";o.forEach((function(e){var o,a,l,c="";(0,t.isString)(e)?(o=e,a=e):(o=e.name||e.label||e.value,a="".concat((0,t.isUndefined)(e.value)?e.id:e.value).replace(/"/g,"&quot;"),c+=(l=e.style?e.style.replace(/"/g,"&quot;"):"")?' style="'.concat(l,'"'):"");var u=n.t("traitManager.traits.options.".concat(r,".").concat(a))||o;s+='<option value="'.concat(a,'"').concat(c,">").concat(u,"</option>"),i.push(a)})),s+="</select>",this.$input=(0,a.default)(s);var l=e.getTargetValue(),c=i.indexOf(l)>=0?l:e.get("default");!(0,t.isUndefined)(c)&&this.$input.val(c)}return this.$input.get(0)},n}(ss);const js=Ps;var Ms=P(330),Ns=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rs="data-categories",Ls="data-no-categories",Is=function(t){function e(e,n){var r=t.call(this,e)||this;r.reuseView=!0,r.renderedCategories=new Map,r.itemsView=n;var o=e.config||{};r.config=o;var i=e.editor;r.em=i;var a=o.pStylePrefix||"";return r.ppfx=a,r.pfx=a+o.stylePrefix||"",r.className="".concat(r.pfx,"traits"),r.traitContClass="".concat(a,"traits-c"),r.classNoCat="".concat(a,"traits-empty-c"),r.catsClass="".concat(a,"trait-categories"),r.collection=new $e([],{em:i}),r.listenTo(i,"component:toggled",r.updatedCollection),r.updatedCollection(),r}return Ns(e,t),e.prototype.updatedCollection=function(){var t=this.ppfx,e=this.em,n=e.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=(null==n?void 0:n.traits)||new $e([],{em:e}),this.render()},e.prototype.add=function(t,e){var n=this.config,r=this.renderedCategories,o=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(o=this.itemsView[i]);var a=new o({config:n,model:t,attributes:t.get("attributes")}).render().el,s=t.parent.initCategory(t);if(s){var l=s.getId(),c=this.getCategoriesEl(),u=r.get(l);return!u&&c&&(u=new ai({model:s},n,"trait").render(),r.set(l,u),c.appendChild(u.el)),void(null==u||u.append(a))}e?e.appendChild(a):this.append(a)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(Rs,"]"))),this.catsEl},e.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(Ls,"]"))),this.traitsEl},e.prototype.append=function(t){var e=this.getTraitsEl();null==e||e.appendChild(t)},e.prototype.render=function(){var t=this,e=this,n=e.el,r=e.ppfx,o=e.catsClass,i=e.traitContClass,a=e.classNoCat,s=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,n.innerHTML='\n <div class="'.concat(o,'" ').concat(Rs,'></div>\n <div class="').concat(a," ").concat(i,'" ').concat(Ls,"></div>\n "),this.collection.forEach((function(e){return t.add(e,s)})),this.append(s);var l="".concat(i,"s ").concat(r,"one-bg ").concat(r,"two-color");return this.$el.addClass(l),this.rendered=!0,this},e}(Ms.Z);const Ds=Is;Is.prototype.itemView=ss;var Fs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vs=function(e){function n(n){var r=e.call(this,n,"TraitManager",rs)||this;r.TraitsView=Ds,r.events=Ne,r.state=new l.Hn({traits:[]}),r.types={text:ss,number:Ts,select:js,checkbox:ds,color:_s,button:us};var o=r,i=o.state,a=o.config,s=o.events,c=a.pStylePrefix;c&&(a.stylePrefix="".concat(c).concat(a.stylePrefix)),(0,t.bindAll)(r,"__onSelect");var u=(0,t.debounce)((function(){return r.__upSel()}),0),p=(0,t.debounce)((function(){return r.__onUp()}),0);return i.listenTo(n,"component:toggled",u),i.listenTo(n,s.value,p),i.on("change:traits",r.__onSelect),r.debounced=[u,p],r}return Fs(n,e),n.prototype.select=function(t){var e=(null==t?void 0:t.getTraits())||[];this.state.set({component:t,traits:e}),this.__trgCustom()},n.prototype.getCategories=function(){var t,e=this.getComponent();return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],(null===(t=null==e?void 0:e.traits.categories)||void 0===t?void 0:t.models)||[],!0)},n.prototype.getTraits=function(){return this.getCurrent()},n.prototype.getTraitsByCategory=function(t){return Ee(t||this.getTraits())},n.prototype.getComponent=function(){return this.state.attributes.component},n.prototype.addType=function(t,e){var n=this.getType("text");this.types[t]=n.extend(e)},n.prototype.getType=function(t){return this.getTypes()[t]},n.prototype.getTypes=function(){return this.types},n.prototype.getTraitsViewer=function(){return this.view},n.prototype.getCurrent=function(){return this.state.get("traits")||[]},n.prototype.render=function(){var t=this.view,e=this.em;return t=new Ds({el:null==t?void 0:t.el,collection:[],editor:e,config:this.getConfig()},this.getTypes()),this.view=t,t.el},n.prototype.postRender=function(){this.__appendTo()},n.prototype.__onSelect=function(){var t=this,e=t.em,n=t.events,r=t.state.attributes,o=r.component,i=r.traits;e.trigger(n.select,{component:o,traits:i})},n.prototype.__trgCustom=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.events,o=e.__ctn;this.__ctn=o||t.container,n.trigger(r.custom,this.__customData())},n.prototype.__customData=function(){return{container:this.__ctn}},n.prototype.__upSel=function(){this.select(this.em.getSelected())},n.prototype.__onUp=function(){this.select(this.getComponent())},n}(g);const Bs=Vs;const zs={stylePrefix:"",appendTo:"",sortable:!0,hidable:!0,hideTextnode:!0,root:"",showWrapper:!0,showHover:!0,scrollCanvas:{behavior:"smooth",block:"nearest"},scrollLayers:{behavior:"auto",block:"nearest"},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}};var Hs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$s=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var r=e.config||{};n.config=r,n.parentView=e.parentView;var o=r.stylePrefix||"",i=r.pStylePrefix||"",a=n.collection;n.listenTo(a,"add",n.addTo),n.listenTo(a,"reset resetNavigator",n.render),n.listenTo(a,"remove",n.removeChildren),n.className="".concat(o,"layers");var s=r.em;if(r.sortable&&!n.opt.sorter){var l=s.Utils;n.opt.sorter=new l.Sorter({container:r.sortContainer||n.el,containerSel:".".concat(n.className),itemSel:".".concat(o,"layer"),ignoreViewChildren:1,avoidSelectOnEnd:1,nested:1,ppfx:i,pfx:o,em:s})}return n.$el.data("collection",a),e.parent&&n.$el.data("model",e.parent),n}return Hs(e,t),e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=this,o=r.parentView,i=r.opt,a=r.config,s=i.ItemView,l=i.opened,c=i.module,u=e||null,p=new s({ItemView:s,level:i.level,model:t,parentView:o,config:a,sorter:i.sorter,opened:l,module:c}),d=p.render().el;if(u)u.appendChild(d);else if(void 0!==n){var f="before";this.$el.children().length==n&&(n--,f="after"),n<0?this.$el.append(d):this.$el.children().eq(n)[f](d)}else this.$el.append(d);return this.items.push(p),d},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return l.G7.prototype.remove.apply(this,t),this.items.map((function(t){return t.remove()})),this},e.prototype.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},e}(l.G7);const Ws=$s;var Us=P(790);const qs={stylePrefix:"com-",defaults:{},strict:!0};var Gs=P(713),Ks=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ys=function(){return Ys=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ys.apply(this,arguments)},Xs=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Zs=[["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"]],Js={preserveSelected:1},Qs=function(t){return function(e){return t.trigger("".concat(Ye,":start"),e)}},tl=function(t){return function(e){return t.trigger(Ye,e)}},el=function(t,e,n){return void 0===n&&(n={}),function(r,o,i){e.forEach((function(t){return t.set("status",t.get("selectable")?"selected":"")})),t.setSelected(e),e[0].emitUpdate(),t.trigger("".concat(Ye,":end"),i),setTimeout((function(){return t.runDefault(Js)})),(n.altMode||i.cancelled)&&t.set("_cmpDrag",1)}},nl=function(e){function n(n){var r=e.call(this,n,"Commands",qs)||this;r.CommandAbstract=Us.default,r.defaultCommands={},r.commands={},r.active={},r.events=Gs.Z;var o=r.config,i=o.pStylePrefix,a=r.defaultCommands;for(var s in i&&(o.stylePrefix=i+o.stylePrefix),Object.keys(o.defaults).forEach((function(t){var e=o.defaults[t];e.id&&r.add(e.id,e)})),a["tlb-delete"]={run:function(t){return t.runCommand("core:component-delete")}},a["tlb-clone"]={run:function(t){t.runCommand("core:copy"),t.runCommand("core:paste",{action:"clone-component"})}},a["tlb-move"]={run:function(e,n,r){var o;void 0===r&&(r={});var i=e.getModel(),a=r.event,s=r.target,l=(s?[s]:Xs([],e.getSelectedAll(),!0)).map((function(t){var e,n;return(null===(n=null===(e=t.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,t))||t})).filter(Boolean),c=l[0],u="dragstart"===(null==a?void 0:a.type);if(!(null==c?void 0:c.get("draggable")))return i.logWarning("The element is not draggable");var p=c.get("dmode")||i.get("dmode"),d=function(){return i.stopDefault(Js)},f=(0,t.includes)(["absolute","translate"],p);l.forEach((function(t){return t.trigger("disable",{fromMove:!0})})),u?setTimeout(d,0):d();var h=Qs(i),g=tl(i),v=el(i,l,{altMode:f});if(f)e.runCommand("core:component-drag",{guidesInfo:1,mode:p,target:c,onStart:h,onDrag:g,onEnd:v,event:a});else{u&&a.dataTransfer.setDragImage(null===(o=c.view)||void 0===o?void 0:o.el,0,0);var m=e.Commands.get("move-comp");m.onStart=h,m.onDrag=g,m.onEndMoveFromModel=v,m.initSorterFromModels(l)}l.filter((function(t){return t.get("selectable")})).forEach((function(t){return t.set("status","freezed-selected")}))}},a["core:undo"]=function(t){return t.UndoManager.undo()},a["core:redo"]=function(t){return t.UndoManager.redo()},Zs.forEach((function(t){var e=t[2],r=P(828)("./".concat(t[1])).default,o="core:".concat(t[0]);a[o]=r,e&&(a[e]=r,["run","stop"].forEach((function(t){n.on("".concat(t,":").concat(e),(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.trigger.apply(n,Xs(["".concat(t,":").concat(o)],e,!1))}))})))})),o.model=n.Canvas,a)r.add(s,a[s]);return r}return Ks(n,e),n.prototype.add=function(e,n){var r=(0,t.isFunction)(n)?{run:n}:n;return r.stop||(r.noStop=!0),delete r.initialize,r.id=e,this.commands[e]=Us.default.extend(r),this},n.prototype.get=function(e){var n=this.commands[e];return(0,t.isFunction)(n)?(n=new n(this.config),this.commands[e]=n):n||this.em.logWarning("'".concat(e,"' command not found")),n},n.prototype.extend=function(t,e){void 0===e&&(e={});var n=this.get(t);if(n){var r=Ys(Ys({},n.constructor.prototype),e);this.add(t,r);var o=Zs.filter((function(e){return"core:".concat(e[0])===t&&e[2]}))[0];o&&this.add(o[2],r)}return this},n.prototype.has=function(t){return!!this.commands[t]},n.prototype.getAll=function(){return this.commands},n.prototype.run=function(t,e){return void 0===e&&(e={}),this.runCommand(this.get(t),e)},n.prototype.stop=function(t,e){return void 0===e&&(e={}),this.stopCommand(this.get(t),e)},n.prototype.isActive=function(t){return this.getActive().hasOwnProperty(t)},n.prototype.getActive=function(){return this.active},n.prototype.runCommand=function(t,e){var n;if(void 0===e&&(e={}),t&&t.run){var r=this.em,o=this.config,i=t.id,a=r.Editor;this.isActive(i)&&!e.force&&o.strict||(n=a&&t.callRun(a,e),i&&t.stop&&!t.noStop&&!e.abort&&(this.active[i]=n))}return n},n.prototype.stopCommand=function(t,e){var n;if(void 0===e&&(e={}),t&&t.run){var r=this.em,o=this.config,i=t.id,a=r.Editor;(this.isActive(i)||e.force||!o.strict)&&(i&&delete this.active[i],n=t.callStop(a,e))}return n},n.prototype.create=function(t){return t.stop||(t.noStop=!0),new(Us.default.extend(t))(this.config)},n.prototype.__onRun=function(t,e){var n=this.em,r=this.events;n.on("".concat(r.runCommand).concat(t),e)},n.prototype.__onStop=function(t,e){var n=this.em,r=this.events;n.on("".concat(r.stopCommand).concat(t),e)},n.prototype.destroy=function(){this.defaultCommands={},this.commands={},this.active={}},n}(g);const rl=nl;var ol=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),il="contentEditable",al=function(e){function n(n){var r=e.call(this,n)||this;(0,t.bindAll)(r,"__render"),r.opt=n,r.module=n.module,r.config=n.config||{},r.sorter=n.sorter||"",r.parentView=n.parentView;var o=r,i=o.model,a=o.pfx,s=o.ppfx,l=i.get("type")||"default";return r.className="".concat(a,"layer ").concat(a,"layer__t-").concat(l," no-select ").concat(s,"two-color"),r.inputNameCls="".concat(s,"layer-name"),r.clsTitleC="".concat(a,"layer-title-c"),r.clsTitle="".concat(a,"layer-title"),r.clsCaret="".concat(a,"layer-caret"),r.clsCount="".concat(a,"layer-count"),r.clsMove="".concat(a,"layer-move"),r.clsChildren="".concat(a,"layer-children"),r.clsNoChild="".concat(a,"layer-no-chld"),r.clsEdit="".concat(r.inputNameCls,"--edit"),r.clsNoEdit="".concat(r.inputNameCls,"--no-edit"),r.initComponent(),r}return ol(n,e),n.prototype.events=function(){return{"mousedown [data-toggle-move]":"startSort","touchstart [data-toggle-move]":"startSort","click [data-toggle-visible]":"toggleVisibility","click [data-toggle-open]":"toggleOpening","click [data-toggle-select]":"handleSelect","mouseover [data-toggle-select]":"handleHover","mouseout [data-toggle-select]":"handleHoverOut","dblclick [data-name]":"handleEdit","keydown [data-name]":"handleEditKey","focusout [data-name]":"handleEditEnd"}},n.prototype.template=function(t){var e=this,n=e.pfx,r=e.ppfx,o=e.config,i=e.clsNoEdit,a=e.module,s=e.opt,l=e.em,c=o.hidable,u=a.getComponents(t).length,p=u?"":this.clsNoChild,d="".concat(this.clsTitle," ").concat(p),f="".concat(this.clsTitleC),h="".concat(this.inputNameCls," ").concat(i," ").concat(r,"no-app"),g=s.level||0,v="".concat(10*g,"px"),m=t.getName(),y=t.getIcon(),b="".concat(n,"layer"),w=(null==l?void 0:l.getConfig()).icons,x=w.move,_=w.eye,C=w.eyeOff,S=w.chevron;return'\n <div class="'.concat(n,"layer-item ").concat(r,'one-bg" data-toggle-select>\n <div class="').concat(n,'layer-item-left">\n ').concat(c?'<i class="'.concat(n,'layer-vis" data-toggle-visible>\n <i class="').concat(n,'layer-vis-on">').concat(_,'</i>\n <i class="').concat(n,'layer-vis-off">').concat(C,"</i>\n </i>"):"",'\n <div class="').concat(f,'">\n <div class="').concat(d,'" style="padding-left: ').concat(v,'">\n <div class="').concat(n,'layer-title-inn" title="').concat(m,'">\n <i class="').concat(this.clsCaret,'" data-toggle-open>').concat(S,"</i>\n ").concat(y?'<span class="'.concat(b,'__icon">').concat(y,"</span>"):"",'\n <span class="').concat(h,'" data-name>').concat(m,'</span>\n </div>\n </div>\n </div>\n </div>\n <div class="').concat(n,'layer-item-right">\n <div class="').concat(this.clsCount,'" data-count>').concat(u||"",'</div>\n <div class="').concat(this.clsMove,'" data-toggle-move>').concat(x||"",'</div>\n </div>\n </div>\n <div class="').concat(this.clsChildren,'"></div>\n ')},Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),n.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,"remove add reset",this.checkChildren),[["change:status",this.updateStatus],["change:open",this.updateOpening],["change:layerable",this.updateLayerable],["change:style:display",this.updateVisibility],["rerender:layer",this.render],["change:name change:custom-name",this.updateName]].forEach((function(n){return t.listenTo(e,n[0],n[1])})),this.$el.data("model",e),this.$el.data("collection",r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},n.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},n.prototype.getVisibilityEl=function(){return this.getItemContainer().find("[data-toggle-visible]")},n.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,o="".concat(e,"layer-hidden"),i=!r.isVisible(n)?"addClass":"removeClass";this.$el[i](o),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},n.prototype.toggleVisibility=function(t){null==t||t.stopImmediatePropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},n.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName();a[il]="true",a.focus(),document.execCommand("selectAll",!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(o).addClass(i)},n.prototype.handleEditKey=function(t){t.stopPropagation(),((0,vt.kl)(t)||(0,vt.r$)(t))&&this.handleEditEnd(t)},n.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[il]="false",this.setName(s,{component:this.model,propName:"custom-name"}),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(o).removeClass(i),this.updateName()},n.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},n.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},n.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o="open",i="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(o),a.addClass(i)):(e.removeClass(o),a.removeClass(i))},n.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get("components").length&&n.setOpen(e,!n.isOpen(e))},n.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},n.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},n.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},n.prototype.startSort=function(t){var e,n,r;t.stopPropagation();var o=this,i=o.em,a=o.sorter,s=o.model;if((!t.button||0===t.button)&&a){var l=(null===(n=null===(e=s.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,s))||s;a.onStart=Qs(i),a.onMoveClb=tl(i),a.onEndMove=el(i,[l]);var c=(null===(r=l.viewLayer)||void 0===r?void 0:r.el)||t.target;a.startSort(c)}},n.prototype.updateStatus=function(){Lr.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},n.prototype.getItemContainer=function(){return this.$el.children("[data-toggle-select]")},n.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.module,o=r.getComponents(e).length,i=this.getItemContainer(),a=i.find(".".concat(this.clsTitle)),s=i.find("[data-count]");a[o?"removeClass":"addClass"](n),s.html("".concat(o||"")),!o&&r.setOpen(e,!1)},n.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},n.prototype.setRoot=function(e){var n,r=(0,t.isString)(e)?null===(n=this.em.getWrapper())||void 0===n?void 0:n.find(e)[0]:e;r&&(this.stopListening(),this.model=r,this.initComponent(),this._rendered&&this.render())},n.prototype.updateLayerable=function(){(this.parentView||this).render()},n.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},n.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return l.G7.prototype.remove.apply(this,t),this.__clearItems(),this},n.prototype.render=function(){var t=this,e=t.model,n=t.config,r=t.pfx,o=t.ppfx,i=t.opt,a=t.sorter;this.__clearItems();var s=i.opened,l=i.module,c=i.ItemView,u=!l.__isLayerable(e),p=this.$el.empty(),d=i.level+1;delete this.inputName,this.items=new Ws({ItemView:c,collection:e.get("components"),config:n,sorter:a,opened:s,parentView:this,parent:e,level:d,module:l});var f=this.items.render().$el;return n.showWrapper||1!==d?(p.html(this.template(e)),p.find(".".concat(this.clsChildren)).append(f)):p.append(f),e.get("draggable")&&n.sortable||p.children(".".concat(this.clsMove)).remove(),!l.isVisible(e)&&(this.className+=" ".concat(r,"hide")),u&&(this.className+=" ".concat(o,"hidden")),p.attr("class",this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.__render(),this._rendered=!0,this},n.prototype.__render=function(){var t=this,e=t.model,n=t.config,r={component:e,el:t.el};n.onRender.bind(this)(r),this.em.trigger("layer:render",r)},n}(l.G7);const sl=al;var ll=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cl=function(){return cl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},cl.apply(this,arguments)},ul="layer",pl="".concat(ul,":"),dl="".concat(pl,"root"),fl="".concat(pl,"component"),hl="".concat(pl,"custom"),gl={all:ul,root:dl,component:fl,custom:hl},vl={mediaText:""},ml=["open","status","locked","custom-name","components","classes"].map((function(t){return"component:update:".concat(t)})).join(" "),yl=function(n){function r(e){var r=n.call(this,e,"LayerManager",zs)||this;return r.events=gl,(0,t.bindAll)(r,"componentChanged","__onRootChange","__onComponent"),r.model=new y.Z(r,{opened:{}}),r.config.stylePrefix=r.config.pStylePrefix,r}return ll(r,n),r.prototype.onLoad=function(){var t=this,e=this,n=e.em,r=e.config,o=e.model;o.listenTo(n,"component:selected",this.componentChanged),o.on("change:root",this.__onRootChange),o.listenTo(n,ml,this.__onComponent),this.componentChanged(),o.listenToOnce(n,"load",(function(){t.setRoot(r.root),t.__appendTo()}))},r.prototype.setRoot=function(n){var r=this.em.getWrapper(),o=(0,e.isComponent)(n)?n:r;return n&&(0,t.isString)(n)&&(0,e.hasWin)()&&(o=r.find(n)[0]||r),this.model.set("root",o),o},r.prototype.getRoot=function(){return this.model.get("root")},r.prototype.getComponents=function(t){var e=this;return t.components().filter((function(t){return e.__isLayerable(t)}))},r.prototype.setOpen=function(t,e){t.set("open",e)},r.prototype.isOpen=function(t){return!!t.get("open")},r.prototype.setVisible=function(t,e){var n="__prev-display",r=t.getStyle(vl),o=r.display;if(e){var i=t.get(n);delete r.display,i&&(r.display=i,t.unset(n))}else o&&t.set(n,o),r.display="none";t.setStyle(r,vl),this.updateLayer(t),this.em.trigger("component:toggled")},r.prototype.isVisible=function(t){return!function(t){return void 0===t&&(t={}),0===(t.display||"").trim().indexOf("none")}(t.getStyle(vl))},r.prototype.setLocked=function(t,e){t.set("locked",e)},r.prototype.isLocked=function(t){return!!t.get("locked")},r.prototype.setName=function(t,e){t.set("custom-name",e)},r.prototype.getName=function(t){return t.getName()},r.prototype.getLayerData=function(t){var e=t.get("status");return{name:t.getName(),open:this.isOpen(t),selected:"selected"===e,hovered:"hovered"===e,visible:this.isVisible(t),locked:this.isLocked(t),components:this.getComponents(t)}},r.prototype.setLayerData=function(t,n,r){var o;void 0===r&&(r={});var i=this.em,a=this.config,s=n.open,l=n.selected,c=n.hovered,u=n.visible,p=n.locked,d=n.name,f=cl({fromLayers:!0},r);if((0,e.isDef)(s)&&this.setOpen(t,s),(0,e.isDef)(l))if(l){i.setSelected(t,f);var h=a.scrollCanvas;h&&(null===(o=t.views)||void 0===o||o.forEach((function(t){return t.scrollIntoView(h)})))}else i.removeSelected(t,f);(0,e.isDef)(c)&&a.showHover&&(c?i.setHovered(t,f):i.setHovered(null,f)),(0,e.isDef)(u)&&u!==this.isVisible(t)&&this.setVisible(t,u),(0,e.isDef)(p)&&this.setLocked(t,p),(0,e.isDef)(d)&&this.setName(t,d)},r.prototype.componentChanged=function(t,e){var n;if(void 0===e&&(e={}),!e.fromLayers){var r=this.em,o=this.config.scrollLayers,i=this.model.get("opened"),a=r.getSelected(),s=null==a?void 0:a.parent();for(var l in i)i[l].set("open",!1),delete i[l];for(;s;)s.set("open",!0),i[s.cid]=s,s=s.parent();if(a&&o){var c=null===(n=a.viewLayer)||void 0===n?void 0:n.el;null==c||c.scrollIntoView(o)}}},r.prototype.getAll=function(){return this.view},r.prototype.render=function(){var t,e,n=this.config,r=this.model,o=sl.extend(n.extend);return this.view=new o({el:null===(t=this.view)||void 0===t?void 0:t.el,ItemView:o,level:0,config:n,opened:r.get("opened"),model:this.getRoot(),module:this}),null===(e=this.view)||void 0===e?void 0:e.render().el},r.prototype.destroy=function(){var t;null===(t=this.view)||void 0===t||t.remove()},r.prototype.__onRootChange=function(){var t,e=this.getRoot();null===(t=this.view)||void 0===t||t.setRoot(e),this.em.trigger(dl,e),this.__trgCustom()},r.prototype.__onComponent=function(t){this.updateLayer(t)},r.prototype.__isLayerable=function(t){var e=t.get("tagName");return(!this.config.hideTextnode||!t.isInstanceOf("textnode")&&"br"!==e)&&t.get("layerable")},r.prototype.__trgCustom=function(t){var e=this,n=e.__ctn,r=e.em,o=e.events;this.__ctn=n||(null==t?void 0:t.container),r.trigger(o.custom,{container:this.__ctn,root:this.getRoot()})},r.prototype.updateLayer=function(t,e){this.em.trigger(fl,t,e)},r}(g);const bl=yl;const wl={assets:[],noAssets:"",stylePrefix:"am-",upload:"",uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,multiUploadSuffix:"[]",autoAdd:!0,customFetch:void 0,uploadFile:void 0,embedAsBase64:!0,handleAdd:void 0,beforeUpload:void 0,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:!0,dropzoneContent:""};var xl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_l=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return xl(n,e),n.getDefaults=function(){return(0,t.result)(this.prototype,"defaults")},n.prototype.defaults=function(){return{type:"",src:""}},n.prototype.getType=function(){return this.get("type")},n.prototype.getSrc=function(){return this.get("src")},n.prototype.getFilename=function(){return this.get("src").split("/").pop().split("?").shift()},n.prototype.getExtension=function(){return this.getFilename().split(".").pop()},n}(l.Hn);const Cl=_l;_l.prototype.idAttribute="src";var Sl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ol=function(){return Ol=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ol.apply(this,arguments)};const El=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sl(e,t),e.prototype.defaults=function(){return Ol(Ol({},Cl.getDefaults()),{type:"image",unitDim:"px",height:0,width:0})},e}(Cl);var kl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tl=function(e){function n(t){var n=e.call(this,t)||this;n.options=t,n.collection=t.collection;var r=t.config||{};n.config=r,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.em=r.em,n.className=n.pfx+"asset",n.listenTo(n.model,"destroy remove",n.remove),n.model.view=n;var o=n.init&&n.init.bind(n);return o&&o(t),n}return kl(n,e),n.prototype.__getBhv=function(){var t=this.em,e=null==t?void 0:t.Assets;return(null==e?void 0:e.__getBehaviour())||{}},n.prototype.template=function(t,e){var n=this.pfx;return'\n <div class="'.concat(n,'preview-cont">\n ').concat(this.getPreview(),'\n </div>\n <div class="').concat(n,'meta">\n ').concat(this.getInfo(),'\n </div>\n <div class="').concat(n,'close" data-toggle="asset-remove">\n &Cross;\n </div>\n ')},n.prototype.updateTarget=function(e){e&&e.set&&(e.set("attributes",(0,t.clone)(e.get("attributes"))),e.set("src",this.model.get("src")))},n.prototype.getPreview=function(){return""},n.prototype.getInfo=function(){return""},n.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},n}(l.G7);const Al=Tl;var Pl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jl=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Ml=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Pl(r,e),r.prototype.getPreview=function(){var t=this,e=t.pfx,r=t.ppfx,o=t.model.get("src");return n(Rl||(Rl=jl(['\n <div class="','preview" style="background-image: url(\'','\');"></div>\n <div class="',"preview-bg ",'checker-bg"></div>\n '],['\n <div class="','preview" style="background-image: url(\'','\');"></div>\n <div class="',"preview-bg ",'checker-bg"></div>\n '])),e,o,e,r)},r.prototype.getInfo=function(){var t=this.pfx,e=this.model,r=e.get("name"),o=e.get("width"),i=e.get("height"),a=e.get("unitDim"),s=o&&i?"".concat(o,"x").concat(i).concat(a):"";return r=r||e.getFilename(),n(Ll||(Ll=jl(['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "],['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "])),t,r,t,s)},r.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},r.prototype.onClick=function(){var e=this.model,n=this.pfx,r=this.__getBhv().select,o=this.config.onClick,i=this.collection;i.trigger("deselectAll"),this.$el.addClass(n+"highlight"),(0,t.isFunction)(r)?r(e,!1):(0,t.isFunction)(o)?o(e):this.updateTarget(i.target)},r.prototype.onDblClick=function(){var e=this.em,n=this.model,r=this.__getBhv().select,o=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;(0,t.isFunction)(r)?r(n,!0):(0,t.isFunction)(o)?o(n):(this.updateTarget(a),null==e||e.Modal.close()),(0,t.isFunction)(s)&&s(n)},r.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},r}(Al);const Nl=Ml;var Rl,Ll;Ml.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var Il=function(){return Il=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Il.apply(this,arguments)},Dl={types:[],initialize:function(t,e){var n=this;void 0===e&&(e={});var r=e.em;this.em=r,this.opts=e,this.model=function(t,e){var o,i,a;if(void 0===t&&(t={}),void 0===e&&(e={}),t&&t.type){var s=n.getBaseType();o=(a=n.getType(t.type))?a.model:s.model,i=a?a.view:s.view}else{var l=n.recognizeType(t);o=(a=l.type).model,i=a.view,t=l.attributes}var c=new o(t,Il(Il({},e),{em:r}));return c.typeView=i,c};var o=this.init&&this.init.bind(this);o&&o()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n],o=r.isType(t);if(o="boolean"==typeof o&&o?{type:r.id}:o)return{type:r,attributes:o}}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(e,n){var r=this.getType(e),o=this.getBaseType(),i=r?r.model:o.model,a=r?r.view:o.view,s=n.model,c=n.view,u=n.isType;s=s instanceof l.Hn||(0,t.isFunction)(s)?s:i.extend(s||{}),c=c instanceof l.G7||(0,t.isFunction)(c)?c:a.extend(c||{}),!this.extendViewApi||n.model||n.view||(c=c.extend(n)),r?(r.model=s,r.view=c,r.isType=u||r.isType):(n.id=e,n.model=s,n.view=c,n.isType=u||function(t){if(t&&t.type==e)return!0},this.getTypes().unshift(n))}};const Fl=Dl;var Vl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vl(e,t),e}(l.FE.extend(Fl));const zl=Bl;var Hl;Bl.prototype.types=[{id:"image",model:El,view:Nl,isType:function(t){return"string"==typeof t?{type:"image",src:t}:t}}],function(t){t.add="asset:add",t.remove="asset:remove",t.removeBefore="asset:remove:before",t.update="asset:update",t.open="asset:open",t.close="asset:close",t.uploadStart="asset:upload:start",t.uploadEnd="asset:upload:end",t.uploadError="asset:upload:error",t.uploadResponse="asset:upload:response",t.custom="asset:custom",t.all="asset"}(Hl||(Hl={}));const $l=Hl;var Wl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ul=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.options=e,n.config=e.config,n.pfx=n.config.stylePrefix||"",n.ppfx=n.config.pStylePrefix||"",n.em=n.config.em;var r=n.collection;return n.listenTo(r,"reset",n.renderAssets),n.listenTo(r,"add",n.addToAsset),n.listenTo(r,"remove",n.removedAsset),n.listenTo(r,"deselectAll",n.deselectAll),n}return Wl(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.em,o="";return this.config.showUrlInput&&(o='\n <form class="'.concat(e,'add-asset">\n <div class="').concat(n,"field ").concat(e,'add-field">\n <input placeholder="').concat(null==r?void 0:r.t("assetManager.inputPlh"),'"/>\n </div>\n <button class="').concat(n,'btn-prim">').concat(null==r?void 0:r.t("assetManager.addButton"),'</button>\n <div style="clear:both"></div>\n </form>\n ')),'\n <div class="'.concat(e,'assets-cont">\n <div class="').concat(e,'assets-header">\n ').concat(o,'\n </div>\n <div class="').concat(e,'assets" data-el="assets"></div>\n <div style="clear:both"></div>\n </div>\n ')},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;if(n){e.value="";var o=this.getAssetsEl();o&&(o.scrollTop=0),r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,r=this.collection,o=this.config,i=new t.typeView({model:t,collection:r,config:o}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each((function(n){return t.addAsset(n,e)})),n.append(e)},e.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},e}(l.G7);const ql=Ul;Ul.prototype.events={submit:"handleSubmit"};var Gl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kl=function(t){function e(n){void 0===n&&(n={});var r=t.call(this,n)||this;r.options=n;var o=n.config||{};r.module=n.module,r.config=o,r.em=r.config.em,r.pfx=o.stylePrefix||"",r.ppfx=o.pStylePrefix||"",r.target=r.options.globalCollection||{},r.uploadId=r.pfx+"uploadFile",r.disabled=void 0!==o.disableUpload?o.disableUpload:!o.upload&&!o.embedAsBase64,r.multiUpload=void 0===o.multiUpload||o.multiUpload;var i=o.uploadFile;return i?r.uploadFile=i.bind(r):!o.upload&&o.embedAsBase64&&(r.uploadFile=e.embedAsBase64),r.delegateEvents(),r}return Gl(e,t),e.prototype.template=function(t){var e,r,o=t.pfx,i=t.title,a=t.uploadId,s=t.disabled,l=t.multiUpload;return n(Xl||(e=['\n <form>\n <div id="','title">','</div>\n <input\n data-input\n type="file"\n id="','"\n name="file"\n accept="*/*"\n ',"\n ",'\n />\n <div style="clear:both;"></div>\n </form>\n '],r=['\n <form>\n <div id="','title">','</div>\n <input\n data-input\n type="file"\n id="','"\n name="file"\n accept="*/*"\n ',"\n ",'\n />\n <div style="clear:both;"></div>\n </form>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,Xl=e),o,i,a,s?"disabled":"",l?"multiple":"")},e.prototype.events=function(){return{"change [data-input]":"uploadFile"}},e.prototype.onUploadStart=function(){var t=this.module;null==t||t.__propEv(t.events.uploadStart)},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;null==n||n.__propEv(n.events.uploadEnd,t);var r=e.find("input");r&&r.val("")},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),null==e||e.__propEv(e.events.uploadError,t)},e.prototype.onUploadResponse=function(t,e){var n,r=this,o=r.module,i=r.config,a=r.target;try{n="string"==typeof t?JSON.parse(t):t}catch(e){n=t}null==o||o.__propEv(o.events.uploadResponse,n),i.autoAdd&&a&&a.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o=this.config,i=o.beforeUpload;if(!1!==(i&&i(r))){var a=new FormData,s=o.params,l=o.customFetch,c=o.fetchOptions;for(var u in s)a.append(u,s[u]);if(this.multiUpload)for(var p=0;p<r.length;p++)a.append("".concat(o.uploadName).concat(o.multiUploadSuffix),r[p]);else r.length&&a.append(o.uploadName,r[0]);var d=o.upload,f=o.headers,h="X-Requested-With";if(void 0===f[h]&&(f[h]="XMLHttpRequest"),d){this.onUploadStart();var g={method:"post",credentials:o.credentials||"include",headers:f,body:a},v=(null==c?void 0:c(g))||g;return(l?l(d,v):za(d,v).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)}))}}},e.prototype.initDrop=function(){var t=this;if(!this.uploadForm){this.uploadForm=this.$el.find("form").get(0);var e=this.uploadForm;"draggable"in e&&(this.uploadForm.ondragover=function(){return e.className=t.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return e.className="",!1},this.uploadForm.ondrop=function(n){e.className="",n.preventDefault(),t.uploadFile(n)})}},e.prototype.initDropzone=function(t){var e=this,n=0,r=this.config,o=t.model,i=t.el,a=o.Editor,s=o.Canvas.getBody(),l=this.ppfx,c="".concat(l,"dropzone-active"),u="".concat(l,"dropzone"),p=function(){i.className=i.className.replace(c,"").trim(),n=0},d=function(){return n||(i.className+=" ".concat(c),n=1),!1},f=function(){return p(),!1},h=function(t){if(p(),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>")),p(),"draggable"in i&&[i,s].forEach((function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=h}))},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,r=t.em;return e.html(this.template({title:r&&r.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr("class",n+"file-uploader"),this},e.embedAsBase64=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o={data:[]};if(FileReader){for(var i=[],a=/^(.+)\/(.+)$/,s=function(t){var e=new Promise((function(e,n){var r=new FileReader;r.addEventListener("load",(function(o){var i,s=t.name,l=a.exec(t.type);if("image"===(i=l?l[1]:t.type)){var c={src:r.result,name:s,type:i,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(i?{src:r.result,name:s,type:i}:r.result)})),r.addEventListener("error",(function(t){n(t)})),r.addEventListener("abort",(function(t){n("Aborted")})),r.readAsDataURL(t)}));i.push(e)},l=0,c=r;l<c.length;l++){s(c[l])}return Promise.all(i).then((function(t){o.data=t,n.onUploadResponse(o,e)}),(function(t){n.onUploadError(t)}))}this.onUploadError(new Error("Unsupported platform, FileReader is not defined"))},e}(l.G7);const Yl=Kl;var Xl,Zl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jl=function(){return Jl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Jl.apply(this,arguments)},Ql=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},tc="open-assets",ec=function(e){function n(n){var r=e.call(this,n,"AssetManager",new zl([],n),$l,wl)||this;r.storageKey="assets",r.Asset=Cl,r.Assets=zl,r.events=$l;var o=r,i=o.all,a=o.config;r.assetsVis=new zl([]);var s=a.pStylePrefix;return s&&(a.stylePrefix="".concat(s).concat(a.stylePrefix)),i.on("add",(function(t){return r.getAllVisible().add(t)})),i.on("remove",(function(t){return r.getAllVisible().remove(t)})),r.__onAllEvent=(0,t.debounce)((function(){return r.__trgCustom()}),0),r}return Zl(n,e),n.prototype.open=function(t){void 0===t&&(t={}),this.em.Commands.run(tc,Jl({types:["image"],select:function(){}},t))},n.prototype.close=function(){this.em.Commands.stop(tc)},n.prototype.isOpen=function(){var t=this.em.Commands;return!!(null==t?void 0:t.isActive(tc))},n.prototype.add=function(t,e){return void 0===e&&(e={}),void 0===e.at&&(e.at=0),this.all.add(t,e)},n.prototype.get=function(t){return this.all.where({src:t})[0]||null},n.prototype.getAll=function(){return this.all},n.prototype.getAllVisible=function(){return this.assetsVis},n.prototype.remove=function(t,e){return this.__remove(t,e)},n.prototype.store=function(){return this.getProjectData()},n.prototype.load=function(t){return this.loadProjectData(t)},n.prototype.getContainer=function(){var t;return this.__getBehaviour().container||(null===(t=this.am)||void 0===t?void 0:t.el)},n.prototype.getAssetsEl=function(){var t;return null===(t=this.am)||void 0===t?void 0:t.el.querySelector("[data-el=assets]")},n.prototype.render=function(t){if(!this.getConfig().custom){var e=t||this.getAll().models;if(!this.am){var n=this.__viewParams();n.fu=this.FileUploader(),this.am=new ql(Jl({},n)),this.am.render()}return this.assetsVis.reset(e),this.getContainer()}},n.prototype.__viewParams=function(){return{collection:this.assetsVis,globalCollection:this.all,config:this.config,module:this,fu:void 0}},n.prototype.addType=function(t,e){this.getAll().addType(t,e)},n.prototype.getType=function(t){return this.getAll().getType(t)},n.prototype.getTypes=function(){return this.getAll().getTypes()},n.prototype.AssetsView=function(){return this.am},n.prototype.FileUploader=function(){return this.fu||(this.fu=new Yl(this.__viewParams())),this.fu},n.prototype.onLoad=function(){var t=this;this.getAll().reset(this.config.assets);var e=this.em,n=this.events;e.Commands.__onRun(tc,(function(){return t.__propEv(n.open)})),e.Commands.__onStop(tc,(function(){return t.__propEv(n.close)}))},n.prototype.postRender=function(t){var e;this.config.dropzone&&(null===(e=this.fu)||void 0===e||e.initDropzone(t))},n.prototype.setTarget=function(t){this.assetsVis.target=t},n.prototype.onSelect=function(t){this.assetsVis.onSelect=t},n.prototype.onClick=function(t){this.config.onClick=t},n.prototype.onDblClick=function(t){this.config.onDblClick=t},n.prototype.__propEv=function(t){for(var e,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];(e=this.em).trigger.apply(e,Ql([t],r,!1)),(n=this.getAll()).trigger.apply(n,Ql([t],r,!1))},n.prototype.__trgCustom=function(){var t=this.__getBehaviour(),e=this.getConfig().custom;(t.container||e.open)&&this.em.trigger(this.events.custom,this.__customData())},n.prototype.__customData=function(){var e=this,n=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:n.types||[],container:n.container,close:function(){return e.close()},remove:function(t,n){return e.remove(t,n)},select:function(r,o){var i=e.add(r);(0,t.isFunction)(n.select)&&n.select(i,o)},options:n.options||{}}},n.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=Jl(Jl({},this._bhv||{}),t)},n.prototype.__getBehaviour=function(t){return this._bhv||{}},n.prototype.destroy=function(){var t,e;this.all.stopListening(),this.all.reset(),this.assetsVis.stopListening(),this.assetsVis.reset(),null===(t=this.fu)||void 0===t||t.remove(),null===(e=this.am)||void 0===e||e.remove(),this._bhv={}},n}(v);const nc=ec;var rc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const oc=function(e){function n(t,n){void 0===n&&(n={});var r=e.call(this,t,n)||this,o=n.em,i={};r.em=o,t.frames||(i.component=t.component,i.styles=t.styles,["component","styles"].map((function(t){return r.unset(t)})));var a=t.frames||[i],s=new rt(o.Canvas,a);return s.page=r,r.set("frames",s),!r.getId()&&r.set("id",null==o?void 0:o.Pages._createId()),null==o||o.UndoManager.add(s),r}return rc(n,e),n.prototype.defaults=function(){return{name:"",frames:[],_undo:!0}},n.prototype.onRemove=function(){this.getFrames().reset()},n.prototype.getFrames=function(){return this.get("frames")},n.prototype.getId=function(){return this.id},n.prototype.getName=function(){return this.get("name")},n.prototype.setName=function(t){return this.set({name:t})},n.prototype.getAllFrames=function(){return this.getFrames().models||[]},n.prototype.getMainFrame=function(){return this.getFrames().at(0)},n.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},n.prototype.toJSON=function(e){void 0===e&&(e={});var n=l.Hn.prototype.toJSON.call(this,e),r=(0,t.result)(this,"defaults");return(0,t.forEach)(n,(function(t,e){0===e.indexOf("_")&&delete n[e]})),(0,t.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),n},n}(l.Hn);var ic=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ac=function(){return ac=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ac.apply(this,arguments)},sc=function(t){function e(e,n){var r=t.call(this,e)||this;return r.on("reset",r.onReset),r.on("remove",r.onRemove),r.model=function(t,e){return void 0===e&&(e={}),new oc(t,ac(ac({},e),{em:n}))},r}return ic(e,t),e.prototype.onReset=function(t,e){var n,r=this;null===(n=null==e?void 0:e.previousModels)||void 0===n||n.map((function(t){return r.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e}(l.FE);const lc=sc;var cc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uc="change:selected",pc="main",dc=function(n){function r(e){var r=n.call(this,e,"PageManager",new lc([],e),W)||this;r.events=W,r.storageKey="pages",(0,t.bindAll)(r,"_onPageChange");var o=new y.Z({_undo:!0});return r.model=o,r.pages.on("reset",(function(t){return t.at(0)&&r.select(t.at(0))})),r.pages.on("all",r.__onChange,r),o.on(uc,r._onPageChange),r}return cc(r,n),Object.defineProperty(r.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),r.prototype.getAll=function(){return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.all.models,!0)},r.prototype.__onChange=function(t,e,n,r){var o=this.em,i=this.events,a=r||n;o.trigger(i.all,{event:t,page:e,options:a})},r.prototype.onLoad=function(){var t,e=this,n=e.pages,r=e.config,o=e.em,i={silent:!0},a=(null===(t=r.pages)||void 0===t?void 0:t.map((function(t){return new oc(t,{em:o,config:r})})))||[];n.add(a,i);var s=n.length?this._initPage():this.add({type:pc},i);s&&this.select(s,i)},r.prototype._onPageChange=function(t,e,n){var r=this.em,o=this.events,i=r.Layers,a=e.getMainComponent();i&&a&&i.setRoot(a),r.trigger(o.select,e,t.previous("selected")),this.__onChange(uc,e,n)},r.prototype.postLoad=function(){var t=this,e=t.em,n=t.model,r=t.pages,o=e.UndoManager;o.add(n),o.add(r),r.on("add remove reset change",(function(t,n,r){return e.changesUp(r||n)}))},r.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=this.events;t.id=t.id||this._createId();var i=function(){var r=n.pages.add(new oc(t,{em:n.em,config:n.config}),e);return e.select&&n.select(r),r};return!e.silent&&r.trigger(o.addBefore,t,i,e),e.abort?void 0:i()},r.prototype.remove=function(e,n){var r=this;void 0===n&&(n={});var o=this.em,i=this.events,a=(0,t.isString)(e)?this.get(e):e,s=function(){return a&&r.pages.remove(a,n),a};return!n.silent&&o.trigger(i.removeBefore,a,s,n),!n.abort&&s()},r.prototype.get=function(t){return this.pages.filter((function(e){return e.get(e.idAttribute)===t}))[0]},r.prototype.getMain=function(){var t=this.pages;return t.filter((function(t){return t.get("type")===pc}))[0]||t.at(0)},r.prototype.getAllWrappers=function(){var e=this.getAll();return(0,t.unique)((0,t.flatten)(e.map((function(t){return t.getAllFrames().map((function(t){return t.getComponent()}))}))))},r.prototype.select=function(e,n){void 0===n&&(n={});var r=this,o=r.em,i=r.model,a=r.events,s=(0,t.isString)(e)?this.get(e):e;return s&&(o.trigger(a.selectBefore,s,n),i.set("selected",s,n)),this},r.prototype.getSelected=function(){return this.model.get("selected")},r.prototype.destroy=function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),["selected","model"].map((function(e){return t[e]=0}))},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(t){var e=this.loadProjectData(t,{all:this.pages,reset:!0});return this.pages.forEach((function(t){return t.getFrames().initRefs()})),e},r.prototype._initPage=function(){return this.get(this.config.selected)||this.getMain()},r.prototype._createId=function(){var t,n=this.getAll().length+16,r=this.getAllMap();do{t=(0,e.createId)(n)}while(r[t]);return t},r}(v);const fc=dc;var hc={placeholder:"eg. Text here"};const gc={locale:"en",localeFallback:"en",detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{"text-shadow-h":"X","text-shadow-v":"Y","text-shadow-blur":"Blur","text-shadow-color":"Color","box-shadow-h":"X","box-shadow-v":"Y","box-shadow-blur":"Blur","box-shadow-spread":"Spread","box-shadow-color":"Color","box-shadow-type":"Type","margin-top-sub":"Top","margin-right-sub":"Right","margin-bottom-sub":"Bottom","margin-left-sub":"Left","padding-top-sub":"Top","padding-right-sub":"Right","padding-bottom-sub":"Bottom","padding-left-sub":"Left","border-width-sub":"Width","border-style-sub":"Style","border-color-sub":"Color","border-top-left-radius-sub":"Top Left","border-top-right-radius-sub":"Top Right","border-bottom-right-radius-sub":"Bottom Right","border-bottom-left-radius-sub":"Bottom Left","transform-rotate-x":"Rotate X","transform-rotate-y":"Rotate Y","transform-rotate-z":"Rotate Z","transform-scale-x":"Scale X","transform-scale-y":"Scale Y","transform-scale-z":"Scale Z","transition-property-sub":"Property","transition-duration-sub":"Duration","transition-timing-function-sub":"Timing","background-image-sub":"Image","background-repeat-sub":"Repeat","background-position-sub":"Position","background-attachment-sub":"Attachment","background-size-sub":"Size"}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",categories:{},traits:{labels:{},attributes:{id:hc,alt:hc,title:hc,href:{placeholder:"eg. https://google.com"}},options:{target:{false:"This window",_blank:"New window"}}}},storageManager:{recover:"Do you want to recover unsaved changes?"}}},messagesAdd:void 0};var vc;!function(t){t.add="i18n:add",t.update="i18n:update",t.locale="i18n:locale"}(vc||(vc={}));const mc=vc;var yc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bc=function(n){function r(t){var e=n.call(this,t,"I18n",gc)||this;e.events=mc;var r=e.config.messagesAdd;return r&&e.addMessages(r),e.config.detectLocale&&(e.config.locale=e._localLang()),e}return yc(r,n),r.prototype.setLocale=function(t){var e=this,n=e.em,r=e.config,o=e.events;return n.trigger(o.locale,{value:t,valuePrev:r.locale}),r.locale=t,this},r.prototype.getLocale=function(){return this.config.locale},r.prototype.getMessages=function(t,e){void 0===e&&(e={});var n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n},r.prototype.setMessages=function(t){var e=this,n=e.em,r=e.config,o=e.events;return r.messages=t,n.trigger(o.update,t),this},r.prototype.addMessages=function(t){var n=this,r=n.em,o=n.events,i=n.config.messages;return r.trigger(o.add,t),this.setMessages((0,e.deepMerge)(i,t)),this},r.prototype.t=function(e,n){void 0===n&&(n={});var r=this.config,o=n.params||{},i=n.l||this.getLocale(),a=n.lFlb||r.localeFallback,s=this._getMsg(e,i,n);return s||(s=this._getMsg(e,a,n)),!s&&this._debug("'".concat(e,"' i18n key not found in '").concat(i,"' lang"),n),s=s&&(0,t.isString)(s)?this._addParams(s,o):s},r.prototype._localLang=function(){var t=(0,e.hasWin)()&&window.navigator||{},n=t.language||t.userLanguage;return n?n.split("-")[0]:"en"},r.prototype._addParams=function(t,e){var n=new RegExp("{([\\w\\d-]*)}","g");return t.replace(n,(function(t,n){return e[n]||""})).trim()},r.prototype._getMsg=function(e,n,r){void 0===r&&(r={});var o=this.getMessages(n,r);if(o){var i=o[e];return!i&&e.indexOf(".")>0&&(i=e.split(".").reduce((function(e,n){if(!(0,t.isUndefined)(e))return e[n]}),o)),i}},r.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)},r.prototype.destroy=function(){},r}(g);const wc=bc;var xc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_c=function(){return _c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},_c.apply(this,arguments)},Cc=function(){},Sc={id:"sorter-target",type:st.q.Target},Oc=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return xc(r,n),r.prototype.initialize=function(e){void 0===e&&(e={}),this.opt=e||{},(0,t.bindAll)(this,"startSort","onMove","endMove","rollback","updateOffset","moveDragHelper");var n=e||{};this.elT=0,this.elL=0,this.borderOffset=n.borderOffset||10;var r=n.container;this.el="string"==typeof r?document.querySelector(r):r,this.$el=(0,a.default)(this.el),this.containerSel=n.containerSel||"div",this.itemSel=n.itemSel||"div",this.draggable=n.draggable||!0,this.nested=!!n.nested,this.pfx=n.pfx||"",this.ppfx=n.ppfx||"",this.freezeClass=n.freezeClass||this.pfx+"freezed",this.onStart=n.onStart||Cc,this.onEndMove=n.onEndMove,this.customTarget=n.customTarget,this.onEnd=n.onEnd,this.direction=n.direction||"v",this.onMoveClb=n.onMove,this.relative=n.relative||!1,this.ignoreViewChildren=!!n.ignoreViewChildren,this.plh=n.placer,this.wmargin=n.wmargin||0,this.offTop=n.offsetTop||0,this.offLeft=n.offsetLeft||0,this.document=n.document||document,this.em=n.em,this.canvasRelative=!!n.canvasRelative,this.selectOnEnd=!n.avoidSelectOnEnd,this.scale=n.scale;var o=this.em;(null==o?void 0:o.on)&&(o.on(o.Canvas.events.refresh,this.updateOffset),this.updateOffset())},r.prototype.getScale=function(){return(0,t.result)(this,"scale")||1},r.prototype.getContainerEl=function(t){if(t&&(this.el=t),!this.el){var e=this.opt.container;this.el="string"==typeof e?document.querySelector(e):e,this.$el=(0,a.default)(this.el)}return this.el},r.prototype.getDocuments=function(t){var e=this.em,n=t?t.ownerDocument:null==e?void 0:e.Canvas.getBody().ownerDocument,r=[document];return n&&r.push(n),r},r.prototype.updateOffset=function(){var t,e=(null===(t=this.em)||void 0===t?void 0:t.get("canvasOffset"))||{};this.offTop=e.top,this.offLeft=e.left},r.prototype.setDropContent=function(t){delete this.dropModel,this.dropContent=t},r.prototype.updateTextViewCursorPosition=function(t){var e=this.em;if(e){var n=e.Canvas,r=n.getDocument(),o=null;if(r.caretRangeFromPoint){var i=(0,vt.VB)(t);o=r.caretRangeFromPoint(i.clientX,i.clientY)}else t.rangeParent&&(o=r.createRange()).setStart(t.rangeParent,t.rangeOffset);var a=n.getWindow().getSelection();n.getFrameEl().focus(),null==a||a.removeAllRanges(),o&&(null==a||a.addRange(o)),this.setContentEditable(this.activeTextModel,!0)}},r.prototype.setContentEditable=function(t,e){if(t){var n=t.getEl();n.contentEditable!=e&&(n.contentEditable=e)}},r.prototype.toggleSortCursor=function(t){var e=this.em,n=null==e?void 0:e.Canvas;n&&(t?n.startAutoscroll():n.stopAutoscroll())},r.prototype.setDragHelper=function(t,e){for(var n=e||"",r=t.cloneNode(!0),o=t.getBoundingClientRect(),i=getComputedStyle(t),s="",l=0;l<i.length;l++){var c=i[l];s+="".concat(c,":").concat(i.getPropertyValue(c),";")}(document.body.appendChild(r),r.className+=" ".concat(this.pfx,"bdrag"),r.setAttribute("style",s),this.dragHelper=r,r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px"),n&&this.moveDragHelper(n),this.em)&&(0,a.default)(this.em.Canvas.getBody().ownerDocument).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper);(0,a.default)(document).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)},r.prototype.moveDragHelper=function(t){var e=t.target.ownerDocument;if(this.dragHelper&&e){var n=t.pageY,r=t.pageX,o=0,i=0,a=(e.defaultView||e.parentWindow).frameElement,s=this.dragHelper.style;if(a){var l=a.getBoundingClientRect();o=l.top+document.documentElement.scrollTop,i=l.left+document.documentElement.scrollLeft,n=t.clientY,r=t.clientX}s.top=n+o+"px",s.left=r+i+"px"}},r.prototype.matches=function(t,n){return e.matches.call(t,n)},r.prototype.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}},r.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},r.prototype.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.pointerEvents="none",n.className=t+"placeholder-int",e.appendChild(n),e},r.prototype.startSort=function(t,e){var n,r;void 0===e&&(e={});var o,i=this,a=i.em,s=i.itemSel,l=i.containerSel,c=i.plh,u=this.getContainerEl(e.container),p=this.getDocuments(t);delete this.dropModel,delete this.target,delete this.prevTarget,this.moved=!1,t&&!this.matches(t,"".concat(s,", ").concat(l))&&(t=this.closest(t,s)),this.sourceEl=t,c||(this.plh=this.createPlaceholder(),u.appendChild(this.plh)),t&&((null==(o=this.getSourceModel(t))?void 0:o.set)&&o.set("status","freezed"),this.srcModel=o),(0,vt.on)(u,"mousemove dragover",this.onMove),(0,vt.on)(p,"mouseup dragend touchend",this.endMove),(0,vt.on)(p,"keydown",this.rollback),this.onStart({sorter:this,target:o,parent:o&&(null===(n=o.parent)||void 0===n?void 0:n.call(o)),index:o&&(null===(r=o.index)||void 0===r?void 0:r.call(o))}),null==a||a.clearSelection(),this.toggleSortCursor(!0),null==a||a.trigger("sorter:drag:start",t,o)},r.prototype.getTargetModel=function(t){var e=t||this.target;return(0,a.default)(e).data("model")},r.prototype.getSourceModel=function(t,e){var n=this,r=void 0===e?{}:e,o=r.target,i=r.avoidChildren,s=void 0===i?1:i,l=this.em,c=this.sourceEl,u=t||c,p=this.dropModel,d=this.dropContent,f=function(t){return t&&o&&t.opt&&t.opt.avoidChildren&&n.isTextableActive(t,o)};if(d&&l){if(f(p)&&(p=void 0),!p){var h=l.Components.getComponents(),g={avoidChildren:s,avoidStore:1,avoidUpdateStyle:1},v=h.add(d,_c(_c({},g),{temporary:!0}));if(p=(p=h.remove(v,g))instanceof Array?p[0]:p,this.dropModel=p,f(p))return this.getSourceModel(u,{target:o,avoidChildren:0})}return p}return u&&(0,a.default)(u).data("model")},r.prototype.selectTargetModel=function(t,e){if(!(t instanceof l.FE||e&&e===t)){var n=this.targetModel;if(n&&n!==this.srcModel&&n.set("status",""),null==t?void 0:t.set){var r=this.em.Canvas;[st.q.Select,st.q.Hover,st.q.Spacing].forEach((function(t){return r.removeSpots({type:t})})),r.addSpot(_c(_c({},Sc),{component:t})),t.set("status","selected-parent"),this.targetModel=t}}},r.prototype.onMove=function(e){var n=e,r=this,o=r.em,i=r.onMoveClb,s=r.plh,l=r.customTarget;this.moved=!0;var c=s.style.display;c&&"none"!==c||(s.style.display="block");var u=this.offset(this.el);this.elT=this.wmargin?Math.abs(u.top):u.top,this.elL=this.wmargin?Math.abs(u.left):u.left;var p=e.pageY-this.elT+this.el.scrollTop,d=e.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&o){var f=o.Canvas.getMouseRelativeCanvas(e,{noScroll:1});d=f.x,p=f.y}this.rX=d,this.rY=p,this.eventMove=e;var h=this.getSourceModel(),g=l?l({sorter:this,event:e}):e.target,v=this.dimsFromTarget(g,d,p),m=this.target,y=m&&this.getTargetModel(m);if(this.selectTargetModel(y,h),y||(s.style.display="none"),m){this.lastDims=v;var b=this.findPosition(v,d,p);this.isTextableActive(h,y)?(this.activeTextModel=y,s.style.display="none",this.lastPos=b,this.updateTextViewCursorPosition(n)):(this.disableTextable(),delete this.activeTextModel,this.lastPos&&this.lastPos.index==b.index&&this.lastPos.method==b.method||(this.movePlaceholder(this.plh,v,b,this.prevTargetDim),this.$plh||(this.$plh=(0,a.default)(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=b)),(0,t.isFunction)(i)&&i({event:e,target:h,parent:y,index:b.index+("after"==b.method?1:0)}),o&&o.trigger("sorter:drag",{target:m,targetModel:y,sourceModel:h,dims:v,pos:b,x:d,y:p})}},r.prototype.isTextableActive=function(t,e){var n;return(null===(n=null==t?void 0:t.get)||void 0===n?void 0:n.call(t,"textable"))&&(null==e?void 0:e.isInstanceOf("text"))},r.prototype.disableTextable=function(){var t=this.activeTextModel;null==t||t.getView().disableEditing(),this.setContentEditable(t,!1)},r.prototype.isInFlow=function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},r.prototype.styleInFlow=function(t,e){if(!(0,vt.BM)(t)){var n=t.style||{},r=(0,a.default)(t),o=e&&(0,a.default)(e);if(!n.overflow||"visible"===n.overflow){var i=r.css("float");if(!(i&&"none"!==i||o&&"flex"==o.css("display")&&"column"!==o.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":case"grid":return!0}}}}},r.prototype.validTarget=function(e,n){var r=this.getTargetModel(e),o=this.getSourceModel(n,{target:r}),i={valid:!0,src:n=o&&o.view&&o.view.el,srcModel:o,trg:e=r&&r.view&&r.view.el,trgModel:r,draggable:!1,droppable:!1,dragInfo:"",dropInfo:""};if(!n||!e)return i.valid=!1,i;var a=o.get("draggable");if((0,t.isFunction)(a)){var s=a(o,r);i.dragInfo=s,i.draggable=s,a=s}else a=a instanceof Array?a.join(", "):a,i.dragInfo=a,a=(0,t.isString)(a)?this.matches(e,a):a,i.draggable=a;var c=r.get("droppable");if((0,t.isFunction)(c)){s=c(o,r);i.droppable=s,i.dropInfo=s,c=s}else c=(c=c instanceof l.FE?1:c)instanceof Array?c.join(", "):c,i.dropInfo=c,c=(0,t.isString)(c)?this.matches(n,c):c,c=a&&this.isTextableActive(o,r)?1:c,i.droppable=c;return c&&a||(i.valid=!1),i},r.prototype.dimsFromTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0);var r=this.em,o=[];if(!t)return o;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 o;if(this.prevTarget&&this.prevTarget!=t&&delete this.prevTarget,!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var i=this.validTarget(t);if(r&&r.trigger("sorter:drag:validation",i),!i.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&&(o=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&&(o=this.cacheDimsP,this.target=a)}return delete this.lastPos,o},r.prototype.getTargetFromEl=function(t){var e,n=t,r=this.targetPrev,o=this.em,i=this.containerSel,a=this.itemSel;if(this.matches(n,"".concat(a,", ").concat(i))||(n=this.closest(n,a)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(","))),r&&r!=n&&delete this.targetPrev,!this.targetPrev){e=this.closest(n,i);var s=this.validTarget(n);if(o&&o.trigger("sorter:drag:validation",s),!s.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,i))&&this.validTarget(e).valid&&(n=e),n},r.prototype.nearElBorders=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument.body,r=this.getCurrentPos(),o=r.x,i=r.y,a=e.top+n.scrollTop,s=e.left+n.scrollLeft,l=e.width,c=e.height;if(i<a+10||i>a+c-10||o<s+10||o>s+l-10)return 1},r.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(null==t?void 0:t.pageX)||0,y:(null==t?void 0:t.pageY)||0}},r.prototype.getDim=function(t){var e,n,r,o,i=this.em,a=this.canvasRelative,s=null==i?void 0:i.Canvas,l=s?s.getElementOffsets(t):{};if(a&&i){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,o=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,o=t.offsetWidth}return{top:e,left:n,height:r,width:o,offsets:l}},r.prototype.getChildrenDim=function(n){var r=this,o=[];if(!n)return o;var i=this.getTargetModel(n);if(i&&i.view&&!this.ignoreViewChildren){var s=i.getCurrentView?i.getCurrentView():i.view;n=s.getChildrenContainer()}return(0,t.each)(n.children,(function(t,i){var s=t,l=(0,e.getModel)(s,a.default),c=l&&l.index?l.index():i;if((0,vt.BM)(s)||r.matches(s,r.itemSel)){var u,p=r.getDim(s),d=r.direction;u="v"==d||"h"!=d&&r.isInFlow(s,n),p.dir=u,p.el=s,p.indexEl=c,o.push(p)}})),o},r.prototype.nearBorders=function(t,e,n){var r=!1,o=this.borderOffset,i=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+o>a||a>s+c-o||l+o>i||i>l+u-o)&&(r=!0),r},r.prototype.findPosition=function(t,e,n){for(var r,o={index:0,indexEl:0,method:"before"},i=0,a=0,s=0,l=0,c=0,u=0,p=0,d=t.length;p<d;p++){var f=(r=t[p]).top,h=r.left,g=r.height,v=r.width;if(u=f+g,l=h+v/2,c=f+g/2,!(a&&h>a||s&&c>=s||i&&h+v<i))if(o.index=p,o.indexEl=r.indexEl,r.dir){if(n<c){o.method="before";break}o.method="after"}else n<u&&(s=u),e<l?(a=l,o.method="before"):(i=l,o.method="after")}return o},r.prototype.movePlaceholder=function(t,e,n,r){var o=0,i=0,a="",s="",l="px",c=n.method,u=e[n.index];if(t.classList.remove("vertical"),t.classList.add("horizontal"),u){var p=u.top,d=u.left,f=u.height,h=u.width;u.dir?(a=h+l,s="auto",o="before"==c?p-0:p+f-0,i=d):(a="auto",s=f-0+l,o=p+0,i="before"==c?d-0:d+h-0,t.classList.remove("horizontal"),t.classList.add("vertical"))}else{if(!this.nested)return void(t.style.display="none");if(r){var g=r.offsets||{},v=g.paddingTop||5,m=g.paddingLeft||5,y=g.borderTopWidth||0,b=g.borderLeftWidth||0,w=b+(g.borderRightWidth||0);o=r.top+v+y,i=r.left+m+b,a=parseInt("".concat(r.width))-2*m-w+l,s="auto"}}t.style.top=o+l,t.style.left=i+l,a&&(t.style.width=a),s&&(t.style.height=s)},r.prototype.parents=function(t){return t?[t].concat(this.parents(t.parent())):[]},r.prototype.sort=function(t,e){var n=t.parents.filter((function(t){return e.parents.includes(t)}))[0];if(!n)return e.model.index()-t.model.index();var r=t.parents[t.parents.indexOf(n)-1];return e.parents[e.parents.indexOf(n)-1].index()-r.index()},r.prototype.endMove=function(){var e,n,r=this,o=this.sourceEl,i=[],a=this.getDocuments(),s=this.getContainerEl(),l=this.onEndMove,c=this.onEnd,u=this.target,p=this.lastPos;if((0,vt.S1)(s,"mousemove dragover",this.onMove),(0,vt.S1)(a,"mouseup dragend touchend",this.endMove),(0,vt.S1)(a,"keydown",this.rollback),this.plh.style.display="none",o&&(n=this.getSourceModel()),this.moved&&u){var d=this.toMove,f=(0,t.isArray)(d)?d:d?[d]:[o],h=0;1===f.length?i.push(this.move(u,f[0],p)):f.map((function(t){return{model:t,parents:r.parents(t)}})).sort(this.sort).forEach((function(t){var e=t.model,n=e.index(),o=e.parent().getEl();i.push(r.move(u,e,_c(_c({},p),{indexEl:p.indexEl-h,index:p.index-h}))),o===u&&n<=p.index&&h++}))}this.plh&&(this.plh.style.display="none");var g=this.dragHelper;if(g&&(g.parentNode.removeChild(g),delete this.dragHelper),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),null===(e=this.em)||void 0===e||e.Canvas.removeSpots(Sc),delete this.toMove,delete this.eventMove,delete this.dropModel,(0,t.isFunction)(l)){var v={target:n,parent:n&&n.parent(),index:n&&n.index()};i.length?i.forEach((function(t){return l(t,r,v)})):l(null,this,_c(_c({},v),{cancelled:1}))}(0,t.isFunction)(c)&&c({sorter:this})},r.prototype.move=function(n,r,o){var i,s,c=this.em,u=this.dropContent,p=(0,e.getElement)(r),d=[],f="after"===o.method?o.indexEl+1:o.indexEl,h=this.validTarget(n,p),g=(0,a.default)(n).data("collection"),v=h.trgModel,m=h.srcModel,y=h.draggable,b=v instanceof l.FE?1:h.droppable;if(g&&b&&y){var w={at:f,action:"move-component"},x=this.isTextableActive(m,v);if(u)i=(0,t.isFunction)(u)?u():u,w.avoidUpdateStyle=!0,w.action="add-component";else{var _=m.collection.indexOf(m),C=g===m.collection;(!C||!(_===f||_===f-1)||x)&&(i=m.collection.remove(m,{temporary:!0}),C&&f>_&&(w.at=f-1))}i&&(x?(delete w.at,s=v.getView().insertComponent(i,w)):s=g.add(i,w)),delete this.dropContent,delete this.prevTarget}else if(c){var S=h.dropInfo||(null==v?void 0:v.get("droppable")),O=h.dragInfo||(null==m?void 0:m.get("draggable"));!g&&d.push("Target collection not found"),!b&&S&&d.push("Target is not droppable, accepts [".concat(S,"]")),!y&&O&&d.push("Component not draggable, acceptable by [".concat(O,"]")),c.logWarning("Invalid target position",{errors:d,model:m,context:"sorter",target:v})}return null==c||c.trigger("sorter:drag:end",{targetCollection:g,modelToDrop:i,warns:d,validResult:h,dst:n,srcEl:p}),s},r.prototype.rollback=function(t){(0,vt.S1)(this.getDocuments(),"keydown",this.rollback),27==(t.which||t.keyCode)&&(this.moved=!1,this.endMove())},r}(l.G7);const Ec=Oc;var kc=function(){return kc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kc.apply(this,arguments)},Tc=function(){function n(e){void 0===e&&(e={}),this.defOpts={ratioDefault:!1,onUpdateContainer:function(){},step:1,minDim:10,maxDim:1/0,unitHeight:"px",unitWidth:"px",keyHeight:"height",keyWidth:"width",currentUnit:!0,silentFrames:!1,avoidContainerUpdate:!1,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:!0,tc:!0,tr:!0,cl:!0,cr:!0,bl:!0,bc:!0,br:!0},this.opts=kc({},this.defOpts),this.setOptions(e),(0,t.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop")}return n.prototype.getConfig=function(){return this.opts},n.prototype.setOptions=function(t,e){void 0===t&&(t={}),this.opts=kc(kc({},e?this.defOpts:this.opts),t),this.setup()},n.prototype.setup=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 o={};for(var i in["tl","tc","tr","cl","cr","bl","bc","br"].forEach((function(e){return o[e]=t[e]?function(t,e){void 0===e&&(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):null})),o){var a=o[i];a&&r.appendChild(a)}this.handlers=o,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd,this.onUpdateContainer=t.onUpdateContainer},n.prototype.toggleFrames=function(e){if(this.opts.silentFrames){var n=document.querySelectorAll("iframe");(0,t.each)(n,(function(t){return t.style.pointerEvents=e?"none":""}))}},n.prototype.isHandler=function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},n.prototype.getFocusedEl=function(){return this.el},n.prototype.getParentEl=function(){var t;return null===(t=this.el)||void 0===t?void 0:t.parentElement},n.prototype.getDocumentEl=function(){return[this.el.ownerDocument,document]},n.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.posFetcher;return n?n(t,e):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}}(t)},n.prototype.focus=function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:!0}),(0,vt.on)(this.getDocumentEl(),"pointerdown",this.handleMouseDown))},n.prototype.blur=function(){this.container.style.display="none",this.el&&((0,vt.S1)(this.getDocumentEl(),"pointerdown",this.handleMouseDown),delete this.el)},n.prototype.start=function(e){var n=e;if(0===n.button){n.preventDefault(),n.stopPropagation();var r=this.el,o=this.getParentEl(),i=this.opts||{},a=this.mousePosFetcher,s="data-"+i.prefix+"handler",l=this.getElementPos(r,{avoidFrameZoom:!0,avoidFrameOffset:!0}),c=this.getElementPos(o),u=n.target;this.handlerAttr=u.getAttribute(s),this.clickedHandler=u,this.startDim={t:l.top,l:l.left,w:l.width,h:l.height},this.rectDim={t:l.top,l:l.left,w:l.width,h:l.height},this.startPos=a?a(n):{x:n.clientX,y:n.clientY},this.parentDim={t:c.top,l:c.left,w:c.width,h:c.height};var p=this.getDocumentEl();this.docs=p,(0,vt.on)(p,"pointermove",this.move),(0,vt.on)(p,"keydown",this.handleKeyDown),(0,vt.on)(p,"pointerup",this.stop),(0,t.isFunction)(this.onStart)&&this.onStart(n,{docs:p,config:i,el:r,resizer:this}),this.toggleFrames(!0),this.move(n)}},n.prototype.move=function(t){var e=t,n=this.onMove,r=this.mousePosFetcher,o=r?r(e):{x:e.clientX,y:e.clientY};this.currentPos=o,this.delta={x:o.x-this.startPos.x,y:o.y-this.startPos.y},this.keys={shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey},this.rectDim=this.calc(this),this.updateRect(!1),n&&n(e)},n.prototype.stop=function(e){var n=this.el,r=this.opts,o=this.docs||this.getDocumentEl();(0,vt.S1)(o,"pointermove",this.move),(0,vt.S1)(o,"keydown",this.handleKeyDown),(0,vt.S1)(o,"pointerup",this.stop),this.updateRect(!0),this.toggleFrames(),(0,t.isFunction)(this.onEnd)&&this.onEnd(e,{docs:o,config:r,el:n,resizer:this}),delete this.docs},n.prototype.updateRect=function(e){var n=this.el,r=this.opts,o=this.rectDim,i=this.updateTarget,a=this.getSelectedHandler(),s=r.unitHeight,l=r.unitWidth,c=r.keyWidth,u=r.keyHeight;if((0,t.isFunction)(i))i(n,o,{store:e,selectedHandler:a,resizer:this,config:r});else{var p=n.style;p[c]=o.w+l,p[u]=o.h+s}this.updateContainer()},n.prototype.updateContainer=function(t){var e;void 0===t&&(t={});var n=this,r=n.opts,o=n.container,i=n.el,a=o.style;!r.avoidContainerUpdate&&i&&t.forceShow&&(a.display="block"),null===(e=this.onUpdateContainer)||void 0===e||e.call(this,{el:o,resizer:this,opts:kc(kc({},r),t)})},n.prototype.getSelectedHandler=function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e},n.prototype.handleKeyDown=function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))},n.prototype.handleMouseDown=function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(delete this.selectedHandler,this.blur())},n.prototype.calc=function(t){var n,r=this.opts||{},o=r.step,i=this.startDim,a=r.minDim,s=r.maxDim,l=t.delta.x,c=t.delta.y,u=this.parentDim.w,p=this.parentDim.h,d=this.opts.unitWidth,f=this.opts.unitHeight,h="%"===d?i.w/100*u:i.w,g="%"===f?i.h/100*p:i.h,v={t:i.t,l:i.l,w:h,h:g};if(t){var m=t.handlerAttr;~m.indexOf("r")&&(n="%"===d?(0,e.normalizeFloat)((h+l*o)/u*100,.01):(0,e.normalizeFloat)(h+l*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),v.w=n),~m.indexOf("b")&&(n="%"===f?(0,e.normalizeFloat)((g+c*o)/p*100,.01):(0,e.normalizeFloat)(g+c*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),v.h=n),~m.indexOf("l")&&(n="%"===d?(0,e.normalizeFloat)((h-l*o)/u*100,.01):(0,e.normalizeFloat)(h-l*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),v.w=n),~m.indexOf("t")&&(n="%"===f?(0,e.normalizeFloat)((g-c*o)/p*100,.01):(0,e.normalizeFloat)(g-c*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),v.h=n);var y=r.ratioDefault?!t.keys.shift:t.keys.shift;if(m.indexOf("c")<0&&y){var b=i.w/i.h;v.w/v.h>b?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}for(var w in~m.indexOf("l")&&(v.l+=i.w-v.w),~m.indexOf("t")&&(v.t+=i.h-v.h),v){var x=w;v[x]=parseInt("".concat(v[x]),10)}return v}},n}();const Ac=Tc;var Pc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jc=function(){return jc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},jc.apply(this,arguments)};const Mc=function(t){function n(n){var r=t.call(this,n,"Utils")||this;return r.Sorter=Ec,r.Resizer=Ac,r.Dragger=Rt.Z,r.helpers=jc({},e),r}return Pc(n,t),n.prototype.destroy=function(){},n}(g);var Nc,Rc={},Lc={16:!1,18:!1,17:!1,91:!1},Ic="all",Dc={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},Fc={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},Vc=function(t){return Fc[t]||t.toUpperCase().charCodeAt(0)},Bc=[];for(Nc=1;Nc<20;Nc++)Fc["f"+Nc]=111+Nc;function zc(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function Hc(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 $c={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function Wc(t){for(Nc in Lc)Lc[Nc]=t[$c[Nc]]}function Uc(t){var e,n=t.keyCode,r=zc(Bc,n);if(r>=0&&Bc.splice(r,1),93!=n&&224!=n||(n=91),n in Lc)for(e in Lc[n]=!1,Dc)Dc[e]==n&&(Gc[e]=!1)}function qc(){for(Nc in Lc)Lc[Nc]=!1;for(Nc in Dc)Gc[Nc]=!1}function Gc(t,e,n){var r,o;r=Yc(t),void 0===n&&(n=e,e="all");for(var i=0;i<r.length;i++)o=[],(t=r[i].split("+")).length>1&&(o=Xc(t),t=[t[t.length-1]]),t=t[0],(t=Vc(t))in Rc||(Rc[t]=[]),Rc[t].push({shortcut:r[i],scope:e,method:n,key:r[i],mods:o})}for(Nc in Dc)Gc[Nc]=!1;function Kc(){return Ic||"all"}function Yc(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function Xc(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=Dc[e[n]];return e}function Zc(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,(function(){n(window.event)}))}Gc.setScope=function(t){Ic=t||"all"},Gc.getScope=Kc,Gc.deleteScope=function(t){var e,n,r;for(e in Rc)for(n=Rc[e],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++},Gc.filter=function(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)},Gc.isPressed=function(t){return"string"==typeof t&&(t=Vc(t)),-1!=zc(Bc,t)},Gc.getPressedKeyCodes=function(){return Bc.slice(0)},Gc.unbind=function(t,e){var n,r,o,i,a,s=[];for(n=Yc(t),i=0;i<n.length;i++){if((r=n[i].split("+")).length>1&&(s=Xc(r)),t=r[r.length-1],t=Vc(t),void 0===e&&(e=Kc()),!Rc[t])return;for(o=0;o<Rc[t].length;o++)(a=Rc[t][o]).scope===e&&Hc(a.mods,s)&&(Rc[t][o]={})}},Gc.handlers=Rc,Gc.init=function(t){Zc(t.document,"keydown",(function(t){!function(t){var e,n,r,o,i,a;if(e=t.keyCode,-1==zc(Bc,e)&&Bc.push(e),93!=e&&224!=e||(e=91),e in Lc)for(r in Lc[e]=!0,Dc)Dc[r]==e&&(Gc[r]=!0);else if(Wc(t),Gc.filter.call(this,t)&&e in Rc)for(a=Kc(),o=0;o<Rc[e].length;o++)if((n=Rc[e][o]).scope==a||"all"==n.scope){for(r in i=n.mods.length>0,Lc)(!Lc[r]&&zc(n.mods,+r)>-1||Lc[r]&&-1==zc(n.mods,+r))&&(i=!1);(0!=n.mods.length||Lc[16]||Lc[18]||Lc[17]||Lc[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),Zc(t.document,"keyup",Uc),Zc(t,"focus",qc)};const Jc=Gc;const Qc={defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo",opts:{prevent:!0}},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo",opts:{prevent:!0}},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"},"core:component-next":{keys:"s",handler:"core:component-next"},"core:component-prev":{keys:"w",handler:"core:component-prev"},"core:component-enter":{keys:"d",handler:"core:component-enter"},"core:component-exit":{keys:"a",handler:"core:component-exit"},"core:component-delete":{keys:"backspace, delete",handler:"core:component-delete",opts:{prevent:!0}}}};var tu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eu=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};(0,e.hasWin)()&&Jc.init(window);var nu=function(e){function n(t){var n=e.call(this,t,"Keymaps",Qc)||this;return n.keymaster=Jc,n.keymaps={},n}return tu(n,e),n.prototype.onLoad=function(){var t=this.config.defaults;for(var e in t){var n=t[e];this.add(e,n.keys,n.handler,n.opts||{})}},n.prototype.add=function(e,n,r,o){void 0===o&&(o={});var i=this.em,a=i.Commands,s=i.getEditor(),l=i.Canvas,c={id:e,keys:n,handler:r};return this.keymaps[e]&&this.remove(e),this.keymaps[e]=c,Jc(n,(function(n,c){var u={event:n,h:c},p=(0,t.isString)(r)?a.get(r):r;if(!i.isEditing()&&!s.Canvas.isInputFocused()||o.force){o.prevent&&l.getCanvasView().preventDefault(n),(0,t.isFunction)(p)?p(s,0,u):a.runCommand(p,u);var d=[e,c.shortcut,n];i.trigger.apply(i,eu(["keymap:emit"],d,!1)),i.trigger.apply(i,eu(["keymap:emit:".concat(e)],d,!1))}}),void 0),i.trigger("keymap:add",c),c},n.prototype.get=function(t){return this.keymaps[t]},n.prototype.getAll=function(){return this.keymaps},n.prototype.remove=function(t){var e=this.em,n=this.get(t);if(n)return delete this.keymaps[t],n.keys.split(", ").forEach((function(t){Jc.unbind(t.trim())})),null==e||e.trigger("keymap:remove",n),n},n.prototype.removeAll=function(){var t=this;return Object.keys(this.keymaps).forEach((function(e){return t.remove(e)})),Jc.handlers={},this},n.prototype.destroy=function(){this.removeAll(),this.keymaps={}},n}(g);const ru=nu;const ou={stylePrefix:"mdl-",title:"",content:"",backdrop:!0,custom:!1,extend:{}};var iu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const au=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iu(e,t),e.prototype.defaults=function(){return{title:"",content:"",attributes:{},open:!1}},e.prototype.open=function(){this.set("open",!0)},e.prototype.close=function(){this.set("open",!1)},e}(y.Z);var su=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lu=function(){return lu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},lu.apply(this,arguments)},cu=function(t){function e(e){var n=t.call(this,e)||this,r=n.model;return n.listenTo(r,"change:open",n.updateOpen),n.listenTo(r,"change:title",n.updateTitle),n.listenTo(r,"change:content",n.updateContent),n}return su(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.content,o=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(o,'</div>\n <div class="').concat(e,'btn-close" data-close-modal>&Cross;</div>\n </div>\n <div class="').concat(e,'content">\n <div id="').concat(e,'c">').concat(r,'</div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div class="').concat(e,'collector" style="display: none"></div>')},e.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get("content");e.length&&n.append(e),t.empty().append(r)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get("title"))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get("open")?"":"none"},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,r=e.$el,o=e.el,i=[].slice.call(o.attributes).map((function(t){return t.name}));r.removeAttr(i.join(" ")),r.attr(lu(lu({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||"").trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(gt);const uu=cu;var pu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),du=function(e){function n(n){var r=e.call(this,n,"Modal",ou)||this;return r.model=new au(r),r.model.on("change:open",(function(t,e){n.trigger("modal:".concat(e?"open":"close"))})),r.model.on("change",(0,t.debounce)((function(){var e=r._evData(),o=r.config.custom;(0,t.isFunction)(o)&&o(e),n.trigger("modal",e)}),0)),r}return pu(n,e),n.prototype._evData=function(){var e=this,n=this.getTitle(),r=this.getContent(),o=this.model.attributes;return{open:o.open,attributes:o.attributes,title:(0,t.isString)(n)?(0,vt.rw)(n):n,content:(0,t.isString)(r)?(0,vt.rw)(r):r.get?r.get(0):r,close:function(){e.close()}}},n.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},n.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set("attributes",e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},n.prototype.close=function(){return this.model.close(),this},n.prototype.onceClose=function(t){return this.em.once("modal:close",t),this},n.prototype.onceOpen=function(t){return this.em.once("modal:open",t),this},n.prototype.isOpen=function(){return!!this.model.get("open")},n.prototype.setTitle=function(t){return this.model.set("title",t),this},n.prototype.getTitle=function(){return this.model.get("title")},n.prototype.setContent=function(t){return this.model.set("content"," "),this.model.set("content",t),this},n.prototype.getContent=function(){return this.model.get("content")},n.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},n.prototype.getModel=function(){return this.model},n.prototype.render=function(){var t;if(!this.config.custom){var e=uu.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},n.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},n}(g);const fu=du;var hu="sw-visibility",gu="export-template",vu="open-sm",mu="open-tm",yu="open-layers",bu="open-blocks",wu="fullscreen",xu="preview";const _u={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:hu,className:"fa fa-square-o",command:"core:component-outline",context:hu,attributes:{title:"View components"}},{id:xu,className:"fa fa-eye",command:xu,context:xu,attributes:{title:"Preview"}},{id:wu,className:"fa fa-arrows-alt",command:wu,context:wu,attributes:{title:"Fullscreen"}},{id:gu,className:"fa fa-code",command:gu,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:vu,className:"fa fa-paint-brush",command:vu,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:mu,className:"fa fa-cog",command:mu,togglable:!1,attributes:{title:"Settings"}},{id:yu,className:"fa fa-bars",command:yu,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:bu,className:"fa fa-th-large",command:bu,togglable:!1,attributes:{title:"Open Blocks"}}]}]};var Cu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Su=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get("buttons").length&&r.set("buttons",new ku(r.module,r.get("buttons"))),r}return Cu(e,t),e.prototype.defaults=function(){return{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get("className")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get("command")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get("active")},set:function(t){this.set("active",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get("togglable")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get("runDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get("stopDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get("disable")},enumerable:!1,configurable:!0}),e}(y.Z);var Ou=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eu=function(t){function e(e,n){return t.call(this,e,n,Su)||this}return Ou(e,t),e.prototype.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))}))},e.prototype.deactivateAll=function(t,e){var n=t||"";this.forEach((function(t){t.get("context")==n&&t!==e&&t.set("active",!1,{fromCollection:!0})}))},e.prototype.disableAllButtons=function(t){var e=t||"";this.forEach((function(t,n){t.get("context")==e&&t.set("disable",!0)}))},e.prototype.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))}))},e}(G);const ku=Eu;Eu.prototype.model=Su;var Tu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Au=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.get("buttons")||[];return r.buttons=new ku(e,o),r}return Tu(e,t),e.prototype.defaults=function(){return{id:"",content:"",visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get("buttons")},set:function(t){this.set("buttons",t)},enumerable:!1,configurable:!0}),e}(y.Z);var Pu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ju=function(t){function e(e,n){return t.call(this,e,n,Au)||this}return Pu(e,t),e}(G);const Mu=ju;ju.prototype.model=Au;var Nu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ru=function(){return Ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ru.apply(this,arguments)},Lu=function(e){function n(n){var r=e.call(this,n)||this,o=r,i=o.model,a=o.em,s=o.pfx,l=o.ppfx,c=i.className,u=i.attributes,p=u.command,d=u.listen;if(r.id=s+i.get("id"),r.activeCls="".concat(s,"active ").concat(l,"four-color"),r.disableCls="".concat(l,"disabled"),r.btnsVisCls="".concat(s,"visible"),r.className=s+"btn"+(c?" "+c:""),r.listenTo(i,"change",r.render),r.listenTo(i,"change:active updateActive",r.updateActive),r.listenTo(i,"checkActive",r.checkActive),r.listenTo(i,"change:bntsVis",r.updateBtnsVis),r.listenTo(i,"change:attributes",r.updateAttributes),r.listenTo(i,"change:className",r.updateClassName),r.listenTo(i,"change:disable",r.updateDisable),a&&(0,t.isString)(p)&&d){var f={fromListen:!0};r.listenTo(a,"run:".concat(p),(function(){return i.set("active",!0,f)})),r.listenTo(a,"stop:".concat(p),(function(){return i.set("active",!1,f)}))}return a&&a.get&&(r.commands=a.get("Commands")),r}return Nu(n,e),n.prototype.tagName=function(){return this.model.get("tagName")},n.prototype.events=function(){return{click:"clicked"}},n.prototype.updateClassName=function(){var t=this.model,e=this.pfx,n=t.className,r=t.get("attributes").class,o="".concat(r||""," ").concat(e,"btn ").concat(n||"");this.$el.attr("class",o.trim())},n.prototype.updateAttributes=function(){var t=this,e=t.em,n=t.model,r=t.$el,o=n.get("attributes")||{},i=e&&e.t&&e.t("panels.buttons.titles.".concat(n.id));r.attr(o),i&&r.attr({title:i}),this.updateClassName()},n.prototype.updateBtnsVis=function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},n.prototype.updateActive=function(e,n,r){var o;void 0===r&&(r={});var i=this,a=i.model,s=i.commands,l=i.$el,c=i.activeCls,u=r.fromCollection,p=r.fromListen,d=a.get("context"),f=a.get("options"),h=a.command,g={};h&&(s&&(0,t.isString)(h)?g=s.get(h)||{}:(0,t.isFunction)(h)?g=s.create({run:h}):null!==h&&(0,t.isObject)(h)&&(g=s.create(h)),a.active?(!u&&(null===(o=a.collection)||void 0===o||o.deactivateAll(d,a)),a.set("active",!0,{silent:!0}).trigger("checkActive"),!p&&s.runCommand(g,Ru(Ru({},f),{sender:a})),g.noStop&&a.set("active",!1)):(l.removeClass(c),!p&&s.stopCommand(g,Ru(Ru({},f),{sender:a,force:1}))))},n.prototype.updateDisable=function(){var t=this.disableCls,e=this.model.disable;this.$el[e?"addClass":"removeClass"](t)},n.prototype.checkActive=function(){var t=this,e=t.model,n=t.$el,r=t.activeCls;e.active?n.addClass(r):n.removeClass(r)},n.prototype.clicked=function(){var t=this.model;t.get("bntsVis")||t.disable||!t.command||this.toggleActive()},n.prototype.toggleActive=function(){var t=this.model,e=this.em,n=t.active,r=t.togglable;n&&!r||(t.active=!n,n?t.runDefaultCommand&&e.runDefault():t.stopDefaultCommand&&e.stopDefault())},n.prototype.render=function(){var t=this.model,e=t.get("label"),n=this.$el;return!t.get("el")&&n.empty(),this.updateAttributes(),e&&n.append(e),this.checkActive(),this.updateDisable(),this},n}(gt);const Iu=Lu;var Du=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Fu=function(e){function n(t){var n=e.call(this,{collection:t})||this;return n.listenTo(n.collection,"add",n.addTo),n.listenTo(n.collection,"reset remove",n.render),n.className=n.pfx+"buttons",n}return Du(n,e),n.prototype.addTo=function(t){this.addToCollection(t)},n.prototype.addToCollection=function(t,e){var n=e||null,r=t.get("el"),o=new Iu({el:r,model:t}).render().el;return n?n.appendChild(o):this.$el.append(o),o},n.prototype.render=function(){var e=this,n=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(t){return e.addToCollection(t,n)})),this.$el.append(n),this.$el.attr("class",(0,t.result)(this,"className")),this},n}(gt);var Vu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Bu.apply(this,arguments)},zu=function(t){function e(e){var n=t.call(this,{model:e,el:e.get("el")})||this;return n.className=n.pfx+"panel",n.id=n.pfx+e.get("id"),n.listenTo(e,"change:appendContent",n.appendContent),n.listenTo(e,"change:content",n.updateContent),n.listenTo(e,"change:visible",n.toggleVisible),e.view=n,n}return Vu(e,t),e.prototype.appendContent=function(){this.$el.append(this.model.get("appendContent"))},e.prototype.updateContent=function(){this.$el.html(this.model.get("content"))},e.prototype.toggleVisible=function(){this.model.get("visible")?this.$el.removeClass("".concat(this.ppfx,"hidden")):this.$el.addClass("".concat(this.ppfx,"hidden"))},e.prototype.attributes=function(){return this.model.get("attributes")},e.prototype.initResize=function(){var t=this.em,e=null==t?void 0:t.Editor,n=this.model.get("resizable");if(e&&n){var r=!0===n?[!0,!0,!0,!0]:n,o=r.length,i=void 0,a=void 0,s=void 0,l=!1;if(2==o)i=(c=r)[0],s=c[0],a=c[1],l=c[1];else if(4==o){var c;i=(c=r)[0],a=c[1],s=c[2],l=c[3]}var u=new e.Utils.Resizer(Bu({tc:i,cr:a,bc:s,cl:l,tl:!1,tr:!1,bl:!1,br:!1,appendTo:this.el,silentFrames:!0,avoidContainerUpdate:!0,prefix:e.getConfig().stylePrefix,onEnd:function(){t.Canvas.refresh({all:!0})},posFetcher:function(t,e){var n=e.target,r=t.style,o=u.getConfig(),i=o.keyWidth,a=o.keyHeight,s=t.getBoundingClientRect(),l="container"==n,c=r[i],p=r[a];return{left:0,top:0,width:c&&!l?parseFloat(c):s.width,height:p&&!l?parseFloat(p):s.height}}},n&&"boolean"!=typeof n?n:{}));u.blur=function(){},u.focus(this.el)}},e.prototype.render=function(){var t=this.model.buttons,e=this.$el,n=this.ppfx,r="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");if(e.addClass(r),this.toggleVisible(),t.length){var o=new Fu(t);e.append(o.render().el)}return e.append(this.model.get("content")),this},e}(gt);const Hu=zu;var $u=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Wu=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(e,"add",n.addTo),n.listenTo(e,"reset",n.render),n.listenTo(e,"remove",n.onRemove),n.className=n.pfx+"panels",n}return $u(e,t),e.prototype.onRemove=function(t){var e=t.view;e&&e.remove()},e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,r=t.get("el"),o=new Hu(t),i=o.render().el,a=t.get("appendTo");if(r);else if(a){var s=document.querySelector(a);null==s||s.appendChild(i)}else n?n.appendChild(i):this.$el.append(i);return o.initResize(),i},e.prototype.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}(gt);var Uu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qu=function(t){function e(e){var n=t.call(this,e,"Panels",_u)||this;for(var r in n.panels=new Mu(n,n.config.defaults),_u)r in n.config||(n.config[r]=_u[r]);return n}return Uu(e,t),e.prototype.getPanels=function(){return this.panels},e.prototype.getPanelsEl=function(){var t;return null===(t=this.PanelsViewObj)||void 0===t?void 0:t.el},e.prototype.addPanel=function(t){return this.panels.add(t)},e.prototype.removePanel=function(t){return this.panels.remove(t)},e.prototype.getPanel=function(t){var e=this.panels.where({id:t});return e.length?e[0]:null},e.prototype.addButton=function(t,e){var n=this.getPanel(t);return n?n.buttons.add(e):null},e.prototype.removeButton=function(t,e){var n=this.getPanel(t);return n&&n.buttons.remove(e)},e.prototype.getButton=function(t,e){var n=this.getPanel(t);if(n){var r=n.buttons.where({id:e});return r.length?r[0]:null}return null},e.prototype.render=function(){var t;return null===(t=this.PanelsViewObj)||void 0===t||t.remove(),this.PanelsViewObj=new Wu(this.panels),this.PanelsViewObj.render().el},e.prototype.active=function(){this.getPanels().each((function(t){t.buttons.each((function(t){t.get("active")&&t.trigger("updateActive")}))}))},e.prototype.disableButtons=function(){this.getPanels().each((function(t){t.buttons.each((function(t){t.get("disable")&&t.trigger("change:disable")}))}))},e.prototype.destroy=function(){this.panels.reset(),this.panels.stopListening(),this.PanelsViewObj&&this.PanelsViewObj.remove()},e}(g);const Gu=qu;const Ku={stylePrefix:"cm-",optsCodeViewer:{}};var Yu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Xu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Yu(e,t),e.prototype.build=function(t,e){void 0===e&&(e={});var n=e.em,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["em"]);if(e.cleanId&&n){var o=n.Css.getAll().toJSON().map((function(t){var e=t.selectors,n=e&&1===e.length&&e.models[0];return n&&n.isId()&&n.get("name")})).filter(Boolean);r.attributes||(r.attributes=function(t,e){var n=e.id;return n&&"i"===n[0]&&!t.get("script")&&!t.get("attributes").id&&o.indexOf(n)<0&&delete e.id,e})}return t.toHTML(r)},e}(l.Hn);var Zu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ju=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Zu(n,e),n.prototype.build=function(e){var n=this,r=e.toJSON();return this.beforeEach(r),(0,t.each)(r,(function(t,e){var o=r[e];if(o instanceof l.Hn)r[e]=n.build(o);else if(o instanceof l.FE){var i=o;r[e]=[],i.length&&i.forEach((function(t,o){r[e][o]=n.build(t)}))}})),r},n.prototype.beforeEach=function(t){delete t.status},n}(l.Hn);const Qu=Ju;var tp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ep(t){var e;return 0===((null===(e=t.toString().match(/\{([\s\S]*)\}/m))||void 0===e?void 0:e[1])||"").replace(/^\s*\/\/.*$/gm,"").trim().length}var np=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return tp(n,e),n.prototype.mapModel=function(e){var n,r=this,o="",i=e.get("script-export")||e.get("script"),a=e.get("type"),s=e.get("components"),l=e.getId();if(i){var c=e.get("attributes");c=(0,t.extend)({},c,{id:l}),e.set("attributes",c,{silent:!0});var u=e.getScriptString(i),p=e.get("script-props");if(e.get("scriptUpdated")&&!p)this.mapJs[a+"-"+l]={ids:[l],code:u};else{var d=void 0,f=this.mapJs[a];if(p&&(d=e.__getScriptProps()),f)f.ids.push(l),d&&(f.props[l]=d);else{var h={ids:[l],code:u};d&&(h.props=((n={})[l]=d,n)),this.mapJs[a]=h}}}return s.forEach((function(t){o+=r.mapModel(t)})),o},n.prototype.build=function(t){this.mapJs={},this.mapModel(t);var e="";for(var n in this.mapJs){var r=this.mapJs[n];if(r.code)if(r.props){if(ep(r.code))continue;e+="\n var props = ".concat(JSON.stringify(r.props),";\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (").concat(r.code,".bind(el))(props[el.id]);\n }")}else{var o="#"+r.ids.join(", #");e+="\n var items = document.querySelectorAll('".concat(o,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\n").concat(r.code,"\n}.bind(items[i]))();\n }")}}return e},n}(l.Hn);const rp=np;var op,ip=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(){return ap=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ap.apply(this,arguments)};(0,e.hasWin)()&&(op=P(631),P(531),P(629),P(210));var sp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ip(n,e),n.prototype.defaults=function(){return{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0,autoFormat:!0}},n.prototype.init=function(e){return(0,t.bindAll)(this,"onChange"),this.editor=op.fromTextArea(e,ap({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=e,this.editor.on("change",this.onChange),this},n.prototype.onChange=function(){this.trigger("update",this)},n.prototype.getEditor=function(){return this.editor},n.prototype.getElement=function(){return this.element},n.prototype.setElement=function(t){return this.element=t,this},n.prototype.refresh=function(){return this.getEditor().refresh(),this},n.prototype.focus=function(){return this.getEditor().focus(),this},n.prototype.getContent=function(){var t=this.getEditor();return t&&t.getValue()},n.prototype.setContent=function(t,e){var n=this;void 0===e&&(e={});var r=this.editor;if(r){r.setValue(t);var o=this.get("autoFormat");r.autoFormatRange&&(!0===o||Array.isArray(o)&&o.includes(this.get("codeName")))&&(op.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),op.commands.goDocStart(r)),!e.noRefresh&&setTimeout((function(){return n.refresh()}))}},n}(l.Hn);const lp=sp;sp.prototype.CodeMirror=op;var cp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),up=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cp(e,t),e.prototype.template=function(t){var e,r,o=t.pfx,i=t.codeName,a=t.label;return n(dp||(e=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],r=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,dp=e),o,o,i,o,a,o)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t,e,n=this,r=n.model,o=n.pfx,i=n.$el,a=r.toJSON(),s=r.get("input")||(null===(e=(t=r).getElement)||void 0===e?void 0:e.call(t));return a.pfx=o,i.html(this.template(a)),i.attr("class","".concat(o,"editor-c")),i.find("#".concat(o,"code")).append(s),this},e}(l.G7);const pp=up;var dp,fp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hp=function(){return hp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hp.apply(this,arguments)},gp=function(e){function n(t){var n=e.call(this,t,"CodeManager",Ku)||this;n.EditorView=pp;var r=n.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),n.generators={},n.viewers={},n.defGenerators={html:new Xu,css:new Lo,json:new Qu,js:new rp},n.defViewers={CodeMirror:new lp},n.loadDefaultGenerators().loadDefaultViewers(),n}return fp(n,e),n.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},n.prototype.getGenerator=function(t){return this.generators[t]},n.prototype.getGenerators=function(){return this.generators},n.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},n.prototype.getViewer=function(t){return this.viewers[t]},n.prototype.getViewers=function(){return this.viewers},n.prototype.createViewer=function(e){void 0===e&&(e={});var n=(0,t.isUndefined)(e.type)?"CodeMirror":e.type,r=this.getViewer(n)&&this.getViewer(n).clone(),o=document.createElement("div"),i=document.createElement("textarea");return o.appendChild(i),r.set(hp(hp({},this.config.optsCodeViewer),e)),r.init(i),r.setElement(o),r},n.prototype.updateViewer=function(t,e){t.setContent(e)},n.prototype.getCode=function(t,e,n){void 0===n&&(n={}),n.em=this.em;var r=this.getGenerator(e);return r?r.build(t,n):""},n.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},n.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},n.prototype.destroy=function(){},n}(g);const vp=gp;var mp=P(410),yp=P.n(mp);const bp={maximumStackLength:500,trackSelection:!0};var wp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xp=function(){return xp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xp.apply(this,arguments)},_p=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Cp=function(t){return t.avoidStore||t.noUndo},Sp=function(t){return Object.keys(t.changedAttributes())},Op=function(e){function n(n){var r=e.call(this,n,"UndoManager",bp)||this;r.config._disable&&(r.config.maximumStackLength=0);var o=!0;return r.um=new(yp())(xp({track:!0,register:[]},r.config)),r.um.changeUndoType("change",{condition:function(e){var n=e.get("_undo");if(n){var r=e.get("_undoexc");if((0,t.isArray)(r)&&Sp(e).some((function(t){return r.indexOf(t)>=0})))return!1;if((0,t.isBoolean)(n))return!0;if((0,t.isArray)(n)&&Sp(e).some((function(t){return n.indexOf(t)>=0})))return!0}return!1},on:function(e,n,r){var i=this;!this.beforeCache&&(this.beforeCache=e.previousAttributes());var a=r||n||{};if(a.noUndo&&setTimeout((function(){i.beforeCache=null})),!Cp(a)){var s=e.toJSON({fromUndo:o}),l={object:e,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,t.isEmpty)(s))return l}}}),r.um.changeUndoType("add",{on:function(t,e,n){if(void 0===n&&(n={}),!Cp(n)&&r.isRegistered(e))return{object:e,before:void 0,after:t,options:xp(xp({},n),{fromUndo:o})}}}),r.um.changeUndoType("remove",{on:function(t,e,n){if(void 0===n&&(n={}),!Cp(n)&&r.isRegistered(e))return{object:e,before:t,after:void 0,options:xp(xp({},n),{fromUndo:o})}}}),r.um.changeUndoType("reset",{undo:function(t,e){t.reset(e,{fromUndo:o})},redo:function(t,e,n){t.reset(n,{fromUndo:o})},on:function(t,e){if(void 0===e&&(e={}),!Cp(e)&&r.isRegistered(t))return{object:t,before:e.previousModels,after:_p([],t.models,!0),options:xp(xp({},e),{fromUndo:o})}}}),r.um.on("undo redo",(function(){n.getSelectedAll().map((function(t){return t.trigger("rerender:layer")}))})),["undo","redo"].forEach((function(t){return r.um.on(t,(function(){return n.trigger(t)}))})),r}return wp(n,e),n.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get("selected"))},n.prototype.add=function(t){return this.um.register(t),this},n.prototype.remove=function(t){return this.um.unregister(t),this},n.prototype.removeAll=function(){return this.um.unregisterAll(),this},n.prototype.start=function(){return this.um.startTracking(),this},n.prototype.stop=function(){return this.um.stopTracking(),this},n.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},n.prototype.undoAll=function(){return this.um.undoAll(),this},n.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},n.prototype.redoAll=function(){return this.um.redoAll(),this},n.prototype.hasUndo=function(){return!!this.um.isAvailable("undo")},n.prototype.hasRedo=function(){return!!this.um.isAvailable("redo")},n.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},n.prototype.getStack=function(){return this.um.stack},n.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get("magicFusionIndex");e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},n.prototype.skip=function(t){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},n.prototype.getGroupedStack=function(){var e={},n=this.getStack();return n.forEach((function(t,n){var r=t.get("magicFusionIndex"),o=function(t,e){var n=t.attributes,r=n.type,o=n.after,i=n.before,a=n.object,s=n.options;return{index:e,type:r,after:o,before:i,object:a,options:void 0===s?{}:s}}(t,n);e[r]?e[r].push(o):e[r]=[o]})),Object.keys(e).map((function(n){var r=e[n];return{index:r[r.length-1].index,actions:r,labels:(0,t.unique)(r.reduce((function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t}),[]))}}))},n.prototype.goToGroup=function(e){var n=this;if(e){var r=this.getPointer(),o=e.index-r;(0,t.times)(Math.abs(o),(function(){n[o<0?"undo":"redo"](!1)}))}},n.prototype.getPointer=function(){return this.getStack().pointer},n.prototype.clear=function(){return this.um.clear(),this},n.prototype.getInstance=function(){return this.um},n.prototype.destroy=function(){this.clear().removeAll()},n}(g);const Ep=Op;const kp={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1};var Tp,Ap=function(){return Ap=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ap.apply(this,arguments)};!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.INACTIVE=0]="INACTIVE",t[t.DISABLED=-1]="DISABLED"}(Tp||(Tp={}));var Pp="_rte",jp=1,Mp=0,Np=-1,Rp=function(t,e){void 0===e&&(e="A");var n=t.selection()||{},r=n.anchorNode,o=n.focusNode,i=null==r?void 0:r.parentNode,a=null==o?void 0:o.parentNode;return(null==i?void 0:i.nodeName)==e||(null==a?void 0:a.nodeName)==e},Lp="data-selectme",Ip={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(t){return t.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(t){return t.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(t){return t.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<s>S</s>",attributes:{title:"Strike-through"},result:function(t){return t.exec("strikeThrough")}},link:{icon:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" />\n </svg>',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(t){return t&&t.selection()&&Rp(t)?jp:Mp},result:function(t){Rp(t)?t.exec("unlink"):t.insertHTML('<a href="" '.concat(Lp,">").concat(t.selection(),"</a>"),{select:!0})}},wrap:{name:"wrap",icon:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z" />\n </svg>',attributes:{title:"Wrap for style"},state:function(t){return(null==t?void 0:t.selection())&&Rp(t,"SPAN")?Np:Mp},result:function(t){!Rp(t,"SPAN")&&t.insertHTML("<span ".concat(Lp,">").concat(t.selection(),"</span>"),{select:!0})}}},Dp=function(){function n(e,n,r){var o=this;if(void 0===r&&(r={}),this.em=e,this.settings=r,n[Pp])return n[Pp];n[Pp]=this,this.setEl(n),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var i=(r.actions||[]).map((function(e){var n=e;return(0,t.isString)(e)?n=Ap({},Ip[e]):Ip[e.name]&&(n=Ap(Ap({},Ip[e.name]),e)),n})),a=i.length?i:Object.keys(Ip).map((function(t){return Ip[t]}));r.classes=Ap({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},r.classes);var s=r.classes,l=r.actionbar;if(this.actionbar=l,this.classes=s,this.actions=a,!l){if(!this.isCustom(r.module)){var c=r.actionbarContainer;(l=document.createElement("div")).className=s.actionbar,null==c||c.appendChild(l),this.actionbar=l}a.forEach((function(t){return o.addAction(t)}))}return r.styleWithCSS&&this.exec("styleWithCSS"),this}return n.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!(!(null==e?void 0:e.config.custom)&&!(null==e?void 0:e.customRte))},n.prototype.destroy=function(){},n.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},n.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach((function(e){var n=e.update,r=e.btn,o=t.classes,i=o.active,a=o.inactive,s=o.disabled,l=e.state,c=e.name,u=t.doc,p=Tp.INACTIVE;if(r&&(r.className=r.className.replace(i,"").trim(),r.className=r.className.replace(a,"").trim(),r.className=r.className.replace(s,"").trim()),l){var d=l(t,u);if(p=d,r)switch(d){case jp:r.className+=" ".concat(i);break;case Mp:r.className+=" ".concat(a);break;case Np:r.className+=" ".concat(s)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(r&&(r.className+=" ".concat(i)),p=Tp.ACTIVE);e.currentState=p,null==n||n(t,e)})),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},n.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},n.prototype.disable=function(){return this.__toggleEffects(!1)},n.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?vt.on:vt.S1,r=this.el,o=this.doc,i=this.actionbarEl();if(i&&(i.style.display=t?"":"none"),r.contentEditable="".concat(!!t),n(r,"mouseup keyup",this.updateActiveActions),n(o,"keydown",this.__onKeydown),n(o,"paste",this.__onPaste),this.enabled=t,t){var a=e.event;if(this.syncActions(),this.updateActiveActions(),a){var s=null;if(o.caretRangeFromPoint){var l=(0,vt.VB)(a);s=o.caretRangeFromPoint(l.clientX,l.clientY)}else a.rangeParent&&(s=o.createRange()).setStart(a.rangeParent,a.rangeOffset);var c=o.getSelection();null==c||c.removeAllRanges(),s&&(null==c||c.addRange(s))}r.focus()}return this},n.prototype.__onKeydown=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onKeydown;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var r=this.doc;"Enter"!==t.key||["insertOrderedList","insertUnorderedList"].some((function(t){return r.queryCommandState(t)}))||(r.execCommand("insertLineBreak"),t.preventDefault())},n.prototype.__onPaste=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onPaste;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var r=t.clipboardData,o=r.getData("text"),i=r.getData("text/html");if(o&&!i){t.preventDefault();var a=o.replace(/(?:\r\n|\r|\n)/g,"<br/>");this.doc.execCommand("insertHTML",!1,a)}},n.prototype.syncActions=function(){var t=this;this.getActions().forEach((function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||"click",r=e.btn;r&&(r["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}}))},n.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,r=this.actionbarEl();if(r){var o=t.icon,i=t.attributes,a=void 0===i?{}:i,s=document.createElement("span");for(var l in s.className=this.classes.button,t.btn=s,a)s.setAttribute(l,a[l]);"string"==typeof o?s.innerHTML=o:s.appendChild(o),r.appendChild(s)}n&&(this.actions.push(t),this.syncActions())},n.prototype.getActions=function(){return this.actions},n.prototype.selection=function(){return this.doc.getSelection()},n.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},n.prototype.actionbarEl=function(){return this.actionbar},n.prototype.insertHTML=function(n,r){var o=(void 0===r?{}:r).select,i=this,a=i.em,s=i.doc,l=i.el,c=s.getSelection();if(c&&c.rangeCount){var u=(0,e.getComponentModel)(l)||a.getSelected(),p=s.createElement("div"),d=c.getRangeAt(0);d.deleteContents(),(0,t.isString)(n)?p.innerHTML=n:n&&p.appendChild(n),Array.prototype.slice.call(p.childNodes).forEach((function(t){d.insertNode(t)})),c.removeAllRanges(),c.addRange(d),l.focus(),o&&u&&(u.once("rte:disable",(function(){var t=u.find("[".concat(Lp,"]"))[0];t&&(a.setSelected(t),t.removeAttributes(Lp))})),u.trigger("disable"))}},n}();const Fp=Dp;var Vp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bp=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},zp=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},Hp="".concat(dt.refresh," frame:scroll component:update"),$p={enable:"rte:enable",disable:"rte:disable",custom:"rte:custom"},Wp=function(n){function r(e){var r=n.call(this,e,"RichTextEditor",kp)||this;r.events=$p;var o=r.config,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),r.pfx=o.stylePrefix,r.actions=o.actions||[];var a=new l.Hn;return r.model=a,a.on("change:currentView",r.__trgCustom,r),r.__dbdTrgCustom=(0,t.debounce)((function(){return r.__trgCustom()}),0),r}return Vp(r,n),r.prototype.onLoad=function(){if((0,e.hasWin)()){var t=this.config,n=t.pStylePrefix,r=t.custom,o=(0,vt.ut)("div",{class:(0,vt.cx)("".concat(n,"rte-toolbar"),!r&&"".concat(n,"one-bg ").concat(n,"rte-toolbar-ui"))});this.toolbar=o,this.initRte((0,vt.ut)("div")),(0,vt.on)(o,"mousedown",(function(t){return t.stopPropagation()}))}},r.prototype.__trgCustom=function(){var t=this,e=t.model,n=t.em,r=t.events;n.trigger(r.custom,{enabled:!!e.get("currentView"),container:this.getToolbarEl(),actions:this.getAll()})},r.prototype.destroy=function(){var t,e,n;null===(t=this.globalRte)||void 0===t||t.destroy(),null===(n=null===(e=this.customRte)||void 0===e?void 0:e.destroy)||void 0===n||n.call(e),this.model.stopListening().clear({silent:!0}),this.__dbdTrgCustom.cancel(),(0,vt.L_)(this.toolbar)},r.prototype.postRender=function(t){var e=t.model.get("Canvas");this.toolbar.style.pointerEvents="all",this.hideToolbar(),e.getToolsEl().appendChild(this.toolbar)},r.prototype.initRte=function(t){var e=this.globalRte,n=this,r=n.em,o=n.pfx,i=n.actionbar,a=n.config,s=this.actions||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],a.actions,!0),l={actionbar:"".concat(o,"actionbar"),button:"".concat(o,"action"),active:"".concat(o,"active"),inactive:"".concat(o,"inactive"),disabled:"".concat(o,"disabled")};return e?(e.em=r,e.setEl(t)):(e=new Fp(r,t,{classes:l,actions:s,actionbar:i,actionbarContainer:this.toolbar,module:this}),this.globalRte=e),e.actionbar&&(this.actionbar=e.actionbar),e.actions&&(this.actions=e.actions),e},r.prototype.add=function(t,e){var n;void 0===e&&(e={}),e.name=t,null===(n=this.globalRte)||void 0===n||n.addAction(e,{sync:!0})},r.prototype.get=function(t){var e,n;return null===(e=this.globalRte)||void 0===e||e.getActions().forEach((function(e){e.name==t&&(n=e)})),n},r.prototype.getAll=function(){var t;return(null===(t=this.globalRte)||void 0===t?void 0:t.getActions())||[]},r.prototype.remove=function(t){var e,n=this.getAll(),r=this.get(t);if(r){var o=r.btn,i=n.indexOf(r);null===(e=null==o?void 0:o.parentNode)||void 0===e||e.removeChild(o),n.splice(i,1)}return r},r.prototype.run=function(e){var n=this.globalRte,r=(0,t.isString)(e)?this.get(e):e;n&&r&&(r.result(n,r),n.updateActiveActions())},r.prototype.getToolbarEl=function(){return this.toolbar},r.prototype.updatePosition=function(){var n=this.em,r=this.toolbar,o=n.Canvas,i=r.style,a=o.getTargetToElementFixed(this.lastEl,r,{event:"rteToolbarPosUpdate",left:0});["top","left","bottom","right"].forEach((function(n){var r=a[n];(0,e.isDef)(r)&&(i[n]=(0,t.isString)(r)?r:(r||0)+"px")}))},r.prototype.enable=function(t,e,n){return void 0===n&&(n={}),Bp(this,void 0,void 0,(function(){var r,o,i,a,s;return zp(this,(function(l){switch(l.label){case 0:return this.lastEl=t.el,o=(r=this).customRte,i=r.em,a=t.getChildrenContainer(),this.toolbar.style.display="",[4,o?o.enable(a,e):this.initRte(a).enable(n)];case 1:return s=l.sent(),i&&(setTimeout(this.updatePosition.bind(this),0),i.off(Hp,this.updatePosition,this),i.on(Hp,this.updatePosition,this),i.trigger("rte:enable",t,s)),this.model.set({currentView:t}),[2,s]}}))}))},r.prototype.getContent=function(e,n){return Bp(this,void 0,void 0,(function(){var r;return zp(this,(function(o){switch(o.label){case 0:return(r=this.customRte)&&n&&(0,t.isFunction)(r.getContent)?[4,r.getContent(e.el,n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,e.getChildrenContainer().innerHTML]}}))}))},r.prototype.hideToolbar=function(){var t=this.toolbar.style,e="-1000px";t.top=e,t.left=e,t.display="none"},r.prototype.disable=function(t,e,n){void 0===n&&(n={});var r=this.em,o=this.customRte,i=t.getChildrenContainer();o?o.disable(i,e):e&&e.disable(),this.hideToolbar(),r&&(r.off(Hp,this.updatePosition,this),!n.fromMove&&r.trigger("rte:disable",t,e)),this.model.unset("currentView")},r}(g);const Up=Wp,qp={sectors:[{name:"General",open:!1,properties:["display","float","position","top","right","left","bottom"]},{name:"Flex",open:!1,properties:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,properties:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,properties:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"]},{name:"Decorations",open:!1,properties:["background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,properties:["opacity","transition","transform"]}],appendTo:"",stylePrefix:"sm-",custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:["width","height"]};var Gp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kp=function(){return Kp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Kp.apply(this,arguments)},Yp=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Xp=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Gp(r,n),r.getDefaults=function(){return(0,t.result)(this.prototype,"defaults")},r.prototype.defaults=function(){return{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],full:!1,important:!1,toRequire:!1,requires:void 0,requiresParent:null,parentTarget:null}},r.prototype.initialize=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),this.em=n.em;var o=this.getId()||"",i=this.get("name")||this.get("label")||"";!this.get("property")&&this.set("property",(i||o).replace(/ /g,"-"));var a=this.get("property");!this.get("id")&&this.set("id",a),!i&&this.set("name",(0,e.capitalize)(a).replace(/-/g," ")),this.on("change",this.__upTargets),r.callInit(this,t,n)},r.prototype.__getParentProp=function(){var t,e;return null===(e=null===(t=this.collection)||void 0===t?void 0:t.opts)||void 0===e?void 0:e.parentProp},r.prototype.__upTargets=function(e,n){var r,o=this;void 0===n&&(n={});var i=this.em.Styles,a=this.getName(),s=n.__clear,l=s?"":this.__getFullValue(n),c=this.__getParentProp(),u=this.changedAttributes(),p=(0,t.keys)(u).reduce((function(t,e){return t[e]=o.previous(e),t}),{}),d=Yp(Yp([],(0,t.keys)(this.__getClearProps()),!0),["__p"],!1),f=(0,t.keys)(u),h=!n.__up&&!c&&(s||d.some((function(t){return f.indexOf(t)>=0}))),g=this.get("onChange"),v={property:this,from:p,to:u,value:l,opts:n};i.__trgEv(i.events.propertyUpdate,v),g&&g(v),h&&this.__upTargetsStyle(((r={})[a]=l,r),n)},r.prototype.__upTargetsStyle=function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get("StyleManager");null==r||r.addStyleTargets(Kp(Kp({},t),{__p:!!e.avoidStore}),e)},r.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["partial"]);return t.__p=!(!r.avoidStore&&!n),this.set(t,Kp(Kp({},r),{avoidStore:t.__p}))},r.prototype.up=function(t,e){void 0===e&&(e={}),this.set(t,Kp(Kp({},e),{__up:!0}))},r.prototype.init=function(){},r.prototype.getId=function(){return this.get("id")},r.prototype.getType=function(){return this.get("type")},r.prototype.getName=function(){return this.get("property")},r.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,r=void 0===n||n,o=this.getId(),i=this.get("name")||this.get("label");return r&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.properties.".concat(o)))||i},r.prototype.getValue=function(t){void 0===t&&(t={});var e=t.noDefault,n=this.get("value");return this.hasValue()||e?n:this.getDefaultValue()},r.prototype.hasValue=function(e){void 0===e&&(e={});var n=e.noParent&&this.getParentTarget(),r=this.get("value");return!(0,t.isUndefined)(r)&&""!==r&&!n},r.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},r.prototype.getStyle=function(t){var n;void 0===t&&(t={});var r=this.getName();return(n={})[t.camelCase?(0,e.camelCase)(r):r]=this.__getFullValue(t),n},r.prototype.getDefaultValue=function(){var e=this.get("default");return"".concat((0,t.isUndefined)(e)?this.get("defaults"):e)},r.prototype.upValue=function(t,e){void 0===e&&(e={});var n=null===t||""===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)},r.prototype.isVisible=function(){return!!this.get("visible")},r.prototype.clear=function(t){return void 0===t&&(t={}),this._up(this.__getClearProps(),Kp(Kp({},t),{__clear:!0})),this},r.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},r.prototype.getParent=function(){return this.__getParentProp()},r.prototype.isFull=function(){return!!this.get("full")},r.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},r.prototype.__getClearProps=function(){return{value:""}},r.prototype.setValue=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var r=this.parseValue(t),o=!e;!o&&this.set({value:void 0},{avoidStore:o,silent:!0}),this.set(r,Kp({avoidStore:o},n))},r.prototype.setValueFromInput=function(t,e,n){void 0===n&&(n={}),this.setValue(t,e,Kp(Kp({},n),{fromInput:1}))},r.prototype.parseValue=function(e,n){void 0===n&&(n={});var r={value:e},o="!important",i=this.get("functionName")||"";if((0,t.isString)(e)&&-1!==e.indexOf(o)&&(r.value=e.replace(o,"").trim(),r.important=!0),!i&&!n.complete)return r;var a=[],s="".concat(r.value).trim(),l=s.indexOf("(")+1,c=i||s.substring(0,l-1);if(c&&(r.functionName=c),!i||0===s.indexOf("".concat(i,"("))){var u=s.lastIndexOf(")");a.push(l),u>=0&&a.push(u),r.value=String.prototype.substring.apply(s,a)}if(n.numeric){var p=parseFloat(r.value);r.unit=r.value.replace(p,""),r.value=p}return r},r.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},r.prototype.getFullValue=function(e,n){void 0===n&&(n={});var r=this.get("functionName"),o=this.getDefaultValue(),i=(0,t.isUndefined)(e)?this.get("value"):e,a=!(0,t.isUndefined)(i)&&""!==i;if(i&&o&&i===o)return o;if(r&&a){var s="url"===r?"'".concat(i.replace(/'|"/g,""),"'"):i;i="".concat(r,"(").concat(s,")")}return a&&this.get("important")&&!n.skipImportant&&(i="".concat(i," !important")),i||""},r.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},r.prototype.getParentTarget=function(){return this.get("parentTarget")||null},r.prototype.__parseFn=function(t){void 0===t&&(t="");var e=t.indexOf("(")+1,n=t.lastIndexOf(")");return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}},r.prototype.__checkVisibility=function(n){var r=n.target,o=n.component,i=n.sectors,a=o||r;if(!a)return!1;var s=this.getId(),l=this.getName(),c=this.get("toRequire"),u=this.get("requires"),p=this.get("requiresParent"),d=a.get("unstylable"),f=a.get("stylable-require"),h=a.get("stylable");if((0,t.isArray)(h)&&(h=h.indexOf(l)>=0),(0,t.isArray)(d)&&(h=d.indexOf(l)<0),c&&(h=!r||f&&(f.indexOf(s)>=0||f.indexOf(l)>=0)),i&&u){var g=(0,t.keys)(u);i.forEach((function(e){e.getProperties().forEach((function(e){if((0,t.includes)(g,e.id)){var n=u[e.id];h=h&&(0,t.includes)(n,e.get("value"))}}))}))}if(p){var v=o&&o.parent(),m=v&&v.getEl();if(m){var y=(0,e.hasWin)()?window.getComputedStyle(m):{};(0,t.each)(p,(function(e,n){h=h&&y[n]&&(0,t.includes)(e,y[n])}))}else h=!1}return!!h},r}(l.Hn);const Zp=Xp;Xp.callParentInit=function(t,e,n,r){void 0===r&&(r={}),t.prototype.initialize.apply(e,[n,Kp(Kp({},r),{skipInit:1})])},Xp.callInit=function(t,e,n){void 0===n&&(n={}),!n.skipInit&&t.init(e,n)};var Jp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qp=function(){return Qp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qp.apply(this,arguments)},td=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Jp(n,t),n.prototype.defaults=function(){return{values:{}}},n.prototype.initialize=function(){var t=this.collection;this.prop=null==t?void 0:t.prop},n.prototype.getId=function(){return this.cid},n.prototype.getIndex=function(){var t=this.collection;return t?t.indexOf(this):-1},n.prototype.getValues=function(t){void 0===t&&(t={});var n=this.get("values");return t.camelCase?Object.keys(n).reduce((function(t,r){return t[(0,e.camelCase)(r)]=n[r],t}),{}):n},n.prototype.getLabel=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)},n.prototype.isSelected=function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this},n.prototype.select=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)},n.prototype.remove=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)},n.prototype.move=function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)},n.prototype.getStylePreview=function(t){var e;return void 0===t&&(t={}),null===(e=this.prop)||void 0===e?void 0:e.getStylePreview(this,t)},n.prototype.hasPreview=function(){var t;return!!(null===(t=this.prop)||void 0===t?void 0:t.get("preview"))},n.prototype.upValues=function(t){return void 0===t&&(t={}),this.set("values",Qp(Qp({},this.getValues()),t))},n}(l.Hn);const ed=td;var nd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nd(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={}),this.prop=e.prop},e}(l.FE);const od=rd;rd.prototype.model=ed;var id=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ad=function(){return ad=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ad.apply(this,arguments)},sd=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},ld=function(t){return"integer"===t||"number"===t},cd=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return id(r,n),r.prototype.defaults=function(){return ad(ad({},Zp.getDefaults()),{detached:!1,properties:[],separator:" ",join:null,fromStyle:null,toStyle:null,full:!0})},r.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Zp.callParentInit(Zp,this,t,e);var n=this.em,r=new wf(this.get("properties")||[],{em:n,parentProp:this});this.set("properties",r,{silent:!0}),this.listenTo(r,"change",this.__upProperties),Zp.callInit(this,t,e)},Object.defineProperty(r.prototype,"properties",{get:function(){return this.get("properties")||[]},enumerable:!1,configurable:!0}),r.prototype.getProperties=function(){return sd([],this.get("properties").models,!0)},r.prototype.getProperty=function(t){return this.properties.filter((function(e){return e.getId()===t||e.getName()===t}))[0]},r.prototype.getPropertyAt=function(t){return this.get("properties").at(t)},r.prototype.isDetached=function(){return!!this.get("detached")},r.prototype.getValues=function(t){var e=(void 0===t?{}:t).byName;return this.getProperties().reduce((function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t}),{})},r.prototype.getSeparator=function(){return this.getSplitSeparator()},r.prototype.getJoin=function(){return this.__getJoin()},r.prototype.getStyleFromProps=function(t){var n;void 0===t&&(t={});var r=this.getName(),o=this.__getJoin(),i=this.get("toStyle"),a=this.getValues(),s={};if(i)s=i(a,{join:o,name:r,property:this});else if(a=this.getValues({byName:!0}),this.isDetached())s=a;else{var l=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(o);(n={})[r]=l,s=n}return this.isDetached()?s[r]="":(s[r]=s[r]||"",s=ad(ad({},s),this.getProperties().reduce((function(t,e){return t[e.getName()]="",t}),{}))),t.camelCase?Object.keys(s).reduce((function(t,n){return t[(0,e.camelCase)(n)]=s[n],t}),{}):s},r.prototype.getSplitSeparator=function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},r.prototype.__upProperties=function(t,e){if(void 0===e&&(e={}),!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}},r.prototype.__upTargetsStyleProps=function(t,e){var n;void 0===t&&(t={});var r=this.getStyleFromProps();if(this.isDetached()&&e){var o=e.getName();(n={})[o]=r[o],r=n}this.__upTargetsStyle(r,t)},r.prototype._up=function(t,e){return void 0===e&&(e={}),this.__setProperties(this.__getSplitValue(t.value),e),Zp.prototype._up.call(this,t,e),this},r.prototype.getStyle=function(t){return this.getStyleFromProps(t)},r.prototype.__getFullValue=function(t){if(void 0===t&&(t={}),this.isDetached()||t.__clear)return"";var e=this.getStyleFromProps()[this.getName()]||"";return ie(e)},r.prototype.__getJoin=function(){var e=this.get("join");return(0,t.isString)(e)?e:this.get("separator")},r.prototype.__styleHasProps=function(e){void 0===e&&(e={});var n=this.getName(),r=this.getProperties().map((function(t){return t.getName()}));return sd([n],r,!0).some((function(n){return!(0,t.isUndefined)(e[n])&&""!==e[n]}))},r.prototype.__splitValue=function(t,e){return ie(t).split(e).map((function(t){return t.trim()})).filter(Boolean)},r.prototype.__splitStyleName=function(t,e,n){return this.__splitValue(t[e]||"",n)},r.prototype.__getSplitValue=function(e,n){void 0===e&&(e="");var r=(void 0===n?{}:n).byName,o=this.getProperties(),i=4===o.length&&o.every((function(t){return ld(t.getType())})),a=this.__splitValue(e,this.getSplitSeparator()),s={};return o.forEach((function(e,n){var o=a[n],l=(0,t.isUndefined)(o)?"":o;if(i){var c=a.length;l=a[n]||a[n%c+(1!=c&&c%2?1:0)]||l}var u=r?e.getName():e.getId();s[u]=l||""})),s},r.prototype.__getPropsFromStyle=function(e,n){if(void 0===e&&(e={}),void 0===n&&(n={}),!this.__styleHasProps(e))return null;var r=n.byName,o=this.getName(),i=this.getProperties(),a=this.getSplitSeparator(),s=this.get("fromStyle"),l=s?s(e,{property:this,name:o,separator:a}):{};return s||(l=this.__getSplitValue(e[o]||"",{byName:r}),i.forEach((function(n){var o=e[n.getName()],i=r?n.getName():n.getId();(0,t.isUndefined)(o)||""===o||(l[i]=o)}))),l},r.prototype.__setProperties=function(e,n){void 0===e&&(e={}),void 0===n&&(n={}),this.getProperties().forEach((function(t){var r=e[t.getId()];t.__getFullValue()!==r&&t.upValue(r,n)}));var r=(0,t.keys)(e).map((function(t){return e[t]})).join(" ");this.set("value",r,{silent:!0})},r.prototype.clear=function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),Zp.prototype.clear.call(this),this},r.prototype.hasValue=function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))},r.prototype.getFullValue=function(){return this.__getFullValue()},r.prototype.__canClearProp=function(t){return this.isDetached()&&t.hasValue({noParent:!0})},r}(Zp);const ud=cd;var pd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dd=function(){return dd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dd.apply(this,arguments)},fd=/,(?![^\(]*\))/,hd=/\s(?![^(]*\))/,gd=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return pd(r,n),r.prototype.defaults=function(){return dd(dd({},ud.getDefaults()),{layers:[],emptyValue:"unset",layerSeparator:", ",layerJoin:"",prepend:0,preview:!1,layerLabel:null,selectedLayer:null})},r.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),ud.callParentInit(ud,this,t,e);var n=this.get("layers"),r=new od(n,{prop:this});r.property=this,r.properties=this.get("properties"),this.set("layers",r,{silent:!0}),this.on("change:selectedLayer",this.__upSelected),this.listenTo(r,"add remove",this.__upLayers),ud.callInit(this,t,e)},Object.defineProperty(r.prototype,"layers",{get:function(){return this.get("layers")},enumerable:!1,configurable:!0}),r.prototype.getLayers=function(){return this.layers.models},r.prototype.hasLayers=function(){return this.getLayers().length>0},r.prototype.getLayer=function(t){return void 0===t&&(t=0),this.layers.at(t)||void 0},r.prototype.getSelectedLayer=function(){var t=this.get("selectedLayer");return t&&t.getIndex()>=0?t:void 0},r.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},r.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},r.prototype.moveLayer=function(e,n){void 0===n&&(n=0);var r=this.layers,o=e?e.getIndex():-1;o>=0&&(0,t.isNumber)(n)&&n>=0&&n<r.length&&o!==n&&(this.removeLayer(e),r.add(e,{at:n}))},r.prototype.addLayer=function(e,n){void 0===e&&(e={}),void 0===n&&(n={});var r={};return this.getProperties().forEach((function(n){var o=n.getId(),i=e[o];r[o]=(0,t.isUndefined)(i)?n.getDefaultValue():i})),this.layers.push({values:r},n)},r.prototype.removeLayer=function(t){return this.layers.remove(t)},r.prototype.removeLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e?this.removeLayer(e):null},r.prototype.getLayerLabel=function(t){var e="";if(t){var n=this.get("layerLabel"),r=t.getValues(),o=t.getIndex();if(n)e=n(t,{index:o,values:r,property:this});else{var i=[];this.getProperties().map((function(t){i.push(r[t.getId()])})),e=i.filter(Boolean).join(" ")}}return e},r.prototype.getStyleFromLayer=function(n,r){var o;void 0===r&&(r={});var i,a=this.__getJoin(),s=this.__getJoinLayers(),l=this.get("toStyle"),c=this.getName(),u=n.getValues();if(l)i=l(u,{join:a,joinLayers:s,name:c,layer:n,property:this});else{var p=this.getProperties().map((function(e){var n=e.getName(),o=u[e.getId()],i=(0,t.isUndefined)(o)?e.getDefaultValue():o;if(r.number&&ld(e.getType())){var a=e.parseValue(o,r.number);i="".concat(a.value).concat(a.unit)}return{name:n,value:i}}));i=this.isDetached()?p.reduce((function(t,e){return t[e.name]=e.value,t}),{}):((o={})[this.getName()]=p.map((function(t){return t.value})).join(a),o)}return r.camelCase?Object.keys(i).reduce((function(t,n){return t[(0,e.camelCase)(n)]=i[n],t}),{}):i},r.prototype.getStylePreview=function(t,e){void 0===e&&(e={});var n={};return this.get("preview")&&(n=this.getStyleFromLayer(t,e)),n},r.prototype.getLayerSeparator=function(){var e=this.get("layerSeparator");return(0,t.isString)(e)?new RegExp("".concat(e,"(?![^\\(]*\\))")):e},r.prototype.hasEmptyValue=function(){return!this.hasLayers()&&!!this.attributes.isEmptyValue},r.prototype.__upProperties=function(t,e){var n;void 0===e&&(e={});var r=this.getSelectedLayer();r&&(r.upValues(((n={})[t.getId()]=t.__getFullValue(),n)),e.__up||this.__upTargetsStyleProps(e))},r.prototype.__upLayers=function(t,e,n){this.__upTargetsStyleProps(n||e)},r.prototype.__upTargets=function(t,e){if(void 0===e&&(e={}),!e.__select)return Zp.prototype.__upTargets.call(this,t,e)},r.prototype.__upTargetsStyleProps=function(t){void 0===t&&(t={}),this.__upTargetsStyle(this.getStyleFromLayers(t),t)},r.prototype.__upTargetsStyle=function(t,e){return Zp.prototype.__upTargetsStyle.call(this,t,e)},r.prototype.__upSelected=function(t,e){var n=(void 0===t?{}:t).noEvent;void 0===e&&(e={});var r=this.em.Styles,o=this.getSelectedLayer(),i=null==o?void 0:o.getValues();i&&this.getProperties().forEach((function(t){var n,r=null!==(n=i[t.getId()])&&void 0!==n?n:"";t.__getFullValue()!==r&&t.upValue(r,dd(dd({},e),{__up:!0}))})),!n&&r.__trgEv(r.events.layerSelect,{property:this})},r.prototype._up=function(t,e){void 0===e&&(e={});var n=t.__layers,r=void 0===n?[]:n,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["__layers"]);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),Zp.prototype._up.call(this,o,e),this},r.prototype.__setLayers=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=this.layers,r=t.map((function(t){return{values:t}}));n.length===r.length?r.map((function(t,e){var r;return null===(r=n.at(e))||void 0===r?void 0:r.upValues(t.values)})):n.reset(r),this.set({isEmptyValue:!!e.isEmptyValue}),this.__upSelected({noEvent:!0})},r.prototype.__parseValue=function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(fd).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n},r.prototype.__parseLayer=function(e){var n=this.get("parseLayer"),r=e.split(hd),o=this.getProperties();return n?n({value:e,values:r}):o.reduce((function(e,n,o){var i=r[o];return e[n.getId()]=(0,t.isUndefined)(i)?n.getDefaultValue():i,e}),{})},r.prototype.__getLayersFromStyle=function(e){var n=this;if(void 0===e&&(e={}),!this.__styleHasProps(e))return null;if(this.isEmptyValueStyle(e))return[];var r=this.getName(),o=this.getProperties(),i=this.getLayerSeparator(),a=this.attributes.fromStyle,s=a?a(e,{property:this,name:r,separatorLayers:i}):[];if(!a){var l=this.__splitStyleName(e,r,i).map((function(t){return t.split(n.getSplitSeparator())})).map((function(e){var n={};return o.forEach((function(r,o){var i=e[o];n[r.getId()]=(0,t.isUndefined)(i)?r.getDefaultValue():i})),n}));o.forEach((function(t){var r=t.getId();n.__splitStyleName(e,t.getName(),i).map((function(e){var n;return(n={})[r]=e||t.getDefaultValue(),n})).forEach((function(t,e){l[e]=l[e]?dd(dd({},l[e]),t):t}))})),s=l}return(0,t.isArray)(s)?s:[s]},r.prototype.getStyle=function(t){return void 0===t&&(t={}),this.getStyleFromLayers(t)},r.prototype.getStyleFromLayers=function(e){var n=this;void 0===e&&(e={});var r={},o=this.getName(),i=this.getLayers(),a=this.getProperties();if(i.map((function(t){return n.getStyleFromLayer(t,e)})).forEach((function(e){(0,t.keys)(e).map((function(t){r[t]||(r[t]=[]),r[t].push(e[t])}))})),(0,t.keys)(r).map((function(t){r[t]=r[t].join(n.__getJoinLayers())})),this.isDetached())r[o]="",!i.length&&a.map((function(t){r[t.getName()]=""}));else{var s=a.reduce((function(t,e){return t[e.getName()]="",t}),{});r[o]=r[o]||"",r=dd(dd({},r),s)}return dd(dd({},r),e.__clear?{}:this.getEmptyValueStyle())},r.prototype.isEmptyValueStyle=function(e){void 0===e&&(e={});var n=this.getEmptyValueStyle({force:!0}),r=(0,t.keys)(n);return!!r.length&&r.every((function(t){return n[t]===e[t]}))},r.prototype.getEmptyValueStyle=function(e){void 0===e&&(e={});var n=this.attributes.emptyValue;if(!n||this.hasLayers()&&!e.force)return{};var r=this.getName(),o=this.getProperties(),i=(0,t.isString)(n)?n:n({property:this});if((0,t.isString)(i)){var a={};return this.isDetached()?o.map((function(t){a[t.getName()]=i})):a[r]=i,a}return i},r.prototype.__getJoinLayers=function(){var e=this.get("layerJoin"),n=this.get("layerSeparator");return e||((0,t.isString)(n)?n:e)},r.prototype.__getFullValue=function(){if(this.get("detached"))return"";var t=this.getStyleFromLayers();return ie(t[this.getName()])},r.prototype.hasValue=function(t){void 0===t&&(t={});var e=t.noParent&&this.getParentTarget();return(this.hasLayers()||this.hasEmptyValue())&&!e},r.prototype.clear=function(t){return void 0===t&&(t={}),this.layers.reset(),this.__upTargetsStyleProps(dd(dd({},t),{__clear:!0})),Zp.prototype.clear.call(this),this},r.prototype.__canClearProp=function(){return!1},r.prototype.__getLayers=function(){return this.layers},r}(ud);const vd=gd;var md=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yd=function(){return yd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yd.apply(this,arguments)},bd="data-clear-style",wd=function(n){function r(e){void 0===e&&(e={});var r=n.call(this,e)||this;(0,t.bindAll)(r,"__change","__updateStyle");var o=e.config||{},i=o.em;r.config=o,r.em=i,r.pfx=o.stylePrefix||"",r.ppfx=o.pStylePrefix||"",r.__destroyFn=r.destroy?r.destroy.bind(r):function(){};var a=r.model;a.view=r,r.onValueChange=(0,t.debounce)(r.onValueChange.bind(r),10),r.updateStatus=(0,t.debounce)(r.updateStatus.bind(r),0),r.listenTo(a,"destroy remove",r.remove),r.listenTo(a,"change:visible",r.updateVisibility),r.listenTo(a,"change:name change:className change:full",r.render),r.listenTo(a,"change:value",r.onValueChange),r.listenTo(a,"change:parentTarget",r.updateStatus),r.listenTo(i,"change:device",r.onValueChange);var s=r.init&&r.init.bind(r);return s&&s(),r}return md(r,n),r.prototype.events=function(){var t;return(t={change:"inputValueChanged"})["click [".concat(bd,"]")]="clear",t},r.prototype.template=function(t){var e=this.pfx,n=this.ppfx;return'\n <div class="'.concat(e,'label" data-sm-label></div>\n <div class="').concat(n,'fields" data-sm-fields></div>\n ')},r.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,r=t.parent,o=t.attributes,i=o.icon,a=void 0===i?"":i,s=o.info,l=void 0===s?"":s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||"";return'\n <span class="'.concat(e,"icon ").concat(a,'" title="').concat(l,'">\n ').concat(t.getLabel(),"\n </span>\n ").concat(r?"":'<div class="'.concat(e,'clear" style="display: none" ').concat(bd,">").concat(u,"</div>"),"\n ")},r.prototype.templateInput=function(t){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(t.getDefaultValue(),'"/>\n </div>\n ')},r.prototype.remove=function(){var t=this;return l.G7.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts()),this},r.prototype.updateStatus=function(){var t,e=this,n=e.model,r=e.pfx,o=e.ppfx,i=e.config,a="".concat(o,"four-color"),s="".concat(o,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(a," ").concat(s)),u.display="none",n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(a),i.clearProperties&&(u.display="")):n.hasValue()&&i.highlightComputed&&l.addClass(s),null===(t=this.parent)||void 0===t||t.updateStatus()},r.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},r.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(bd,"]"))),this.clearEl},r.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},r.prototype.onValueChange=function(t,e,n){this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},r.prototype.setValue=function(e){var n=this.model,r=(0,t.isUndefined)(e)||""===e?n.getDefaultValue():e;if(this.update)return this.__update(r);this.__setValueInput(r)},r.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},r.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector("input")),this.input},r.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},r.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},r.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},r.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(yd(yd({},this._getClbOpts()),{value:t}))},r.prototype.__change=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.emit&&this.emit.bind(this);n&&n.apply(void 0,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([this._getClbOpts()],t,!1))},r.prototype.__updateStyle=function(t,n){void 0===n&&(n={});var r=n.complete,o=n.partial;!function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}}(n,["complete","partial"]);var i=this.model,a=!1!==r&&!0!==o;(0,e.isObject)(t)?i.__upTargetsStyle(t,{avoidStore:!a}):i.upValue(t,{partial:!a})},r.prototype._getClbOpts=function(){var t=this,e=t.model;return{el:t.el,createdEl:t.createdEl,property:e,props:e.attributes,change:this.__change,updateStyle:this.__updateStyle}},r.prototype.render=function(){this.clearCached();var t=this,e=t.pfx,n=t.model,r=t.el,o=t.$el,i=n.getName(),a=n.getType(),s=n.get("className")||"",l="".concat(e,"property"),c="number"===a?"".concat(e).concat(a," ").concat(e,"integer"):"".concat(e).concat(a);this.createdEl&&this.__destroyFn(this._getClbOpts()),o.empty().append(this.template(n)),o.find("[data-sm-label]").append(this.templateLabel(n));var u=this.create&&this.create.bind(this);this.createdEl=u&&u(this._getClbOpts()),o.find("[data-sm-fields]").append(this.createdEl||this.templateInput(n)),r.className="".concat(l," ").concat(c," ").concat(l,"__").concat(i," ").concat(s).trim(),r.className+=n.isFull()?" ".concat(l,"--full"):"";var p=this.onRender&&this.onRender.bind(this);return p&&p(),this.setValue(n.getValue()),this},r.prototype.onRender=function(){},r}(l.G7);const xd=wd;var _d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cd=function(t){function e(e){var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||"",n.properties=[],n.parent=e.parent;var r=n.collection;return n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.render),n}return _d(e,t),e.prototype.addTo=function(t,e,n){this.add(t,null,n)},e.prototype.add=function(t,e,n){void 0===n&&(n={});var r=this.parent,o=this.config,i=e||this.el,a=new t.typeView({model:t,config:o});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),(0,vt.$Q)(i,s,n.at)},e.prototype.remove=function(){return l.G7.prototype.remove.apply(this,arguments),this.clearItems(),this},e.prototype.clearItems=function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr("class","".concat(n,"properties")),this},e}(l.G7);const Sd=Cd;var Od=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ed=function(){return Ed=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ed.apply(this,arguments)},kd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Od(e,t),e.prototype.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 ')},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),xd.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get("properties");if(n.length&&!this.props){var r=e.isDetached(),o=new Sd({config:Ed(Ed({},this.config),{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});o.render(),this.$el.find("#".concat(t,"input-holder")).append(o.el),this.props=o}},e.prototype.clearCached=function(){xd.prototype.clearCached.apply(this,arguments),delete this.props},e}(xd);const Td=kd;var Ad=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pd=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ad(n,e),n.prototype.events=function(){return{click:"select","click [data-close-layer]":"removeItem","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"}},n.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.em,o=null==r?void 0:r.getConfig().icons,i=(null==o?void 0:o.close)||"",a=(null==o?void 0:o.move)||"";return'\n <div class="'.concat(e,'label-wrp">\n <div id="').concat(e,'move" class="').concat(n,'no-touch-actions" data-move-layer>\n ').concat(a,'\n </div>\n <div id="').concat(e,'label" data-label></div>\n <div id="').concat(e,'preview-box" class="').concat(e,'layer-preview" style="display: none" data-preview-box>\n <div id="').concat(e,'preview" class="').concat(e,'layer-preview-cnt" data-preview></div>\n </div>\n <div id="').concat(e,'close-layer" class="').concat(e,'btn-close" data-close-layer>\n ').concat(i,'\n </div>\n </div>\n <div id="').concat(e,'inputs" data-properties></div>\n ')},n.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.propertyView=t.propertyView;var r=this.propertyView.model;this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:values",this.updateLabel),this.listenTo(r,"change:selectedLayer",this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},n.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},n.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},n.prototype.select=function(){this.model.select()},n.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},n.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},n.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector("[data-label]")),this.labelEl},n.prototype.updateLabel=function(){var e=this.model,n=e.getLabel();if(this.getLabelEl().innerHTML=n,e.hasPreview()){var r=this.getPreviewEl(),o=e.getStylePreview({number:{min:-3,max:3}}),i=(0,t.keys)(o).map((function(t){return"".concat(t,":").concat(o[t])})).join(";");r.setAttribute("style",i)}},n.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,r=e.model,o=e.propertyView,i=this.getPropertiesWrapper(),a=r.isSelected();i.style.display=a?"":"none",this.$el[a?"addClass":"removeClass"]("".concat(n,"active")),a&&i.appendChild(null===(t=o.props)||void 0===t?void 0:t.el)},n.prototype.render=function(){var t=this,e=t.el,n=t.pfx,r=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),r.hasPreview()&&(e.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},n}(l.G7);const jd=Pd;var Md=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nd=function(t){function e(e){var n=t.call(this,e)||this,r=n.collection,o=e.config||{},i=o.em,a=o.stylePrefix||"",s=o.pStylePrefix||"";n.config=o,n.pfx=a,n.ppfx=s,n.propertyView=e.propertyView,n.className="".concat(a,"layers ").concat(s,"field"),n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(a,"layers"),itemSel:".".concat(a,"layer"),pfx:o.pStylePrefix,em:i}):"",r.view=n,n.$el.data("model",r),n.$el.data("collection",r),n}return Md(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=e||null,o=this,i=o.propertyView,a=o.config,s=o.sorter,l=o.$el,c=new jd({model:t,config:a,sorter:s,propertyView:i}),u=c.render().el;if(this.items.push(c),r)r.appendChild(u);else if(void 0!==n){var p="before";l.children().length===n&&(n--,p="after"),n<0?l.append(u):l.children().eq(n)[p](u)}else l.append(u);return u},e.prototype.reset=function(t,e){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),l.G7.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach((function(t){return t.remove()})),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,r)})),e.append(r),e.attr("class",this.className),n&&(n.plh=null),this},e}(l.G7);const Rd=Nd;var Ld=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Id=function(){return Id=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Id.apply(this,arguments)},Dd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ld(e,t),e.prototype.events=function(){return Id(Id({},Td.prototype.events()),{"click [data-add-layer]":"addLayer",change:""})},e.prototype.templateInput=function(){var t=this.pfx,e=this.em,n=null==e?void 0:e.getConfig().icons,r=(null==n?void 0:n.plus)||"+";return'\n <div class="'.concat(t,"field ").concat(t,'stack">\n <button type="button" id="').concat(t,'add" data-add-layer>\n ').concat(r,"\n </button>\n <div data-layers-wrapper></div>\n </div>\n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.layers,"change reset",this.updateStatus),this.listenTo(t,"change:isEmptyValue",this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),Td.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){Td.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,r=t.config,o=e.get("properties");if(o.length&&!this.props){var i=new Sd({config:Id(Id({},r),{highlightComputed:!1,highlightChanged:!1}),collection:o,parent:this});i.render();var a=new Rd({collection:e.layers,config:r,propertyView:this});a.render(),n.querySelector("[data-layers-wrapper]").appendChild(a.el),this.props=i,this.layersView=a}},e}(Td);const Fd=Dd;var Vd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bd=function(){return Bd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Bd.apply(this,arguments)},zd=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Vd(n,e),n.prototype.events=function(){return Bd(Bd({},xd.prototype.events()),{"click [data-clear-asset]":"clear","click [data-open-assets]":"openAssetManager"})},n.prototype.templateInput=function(){var t,e=this.pfx,n=this.em,r=null===(t=this.em)||void 0===t?void 0:t.getConfig().icons,o=null==r?void 0:r.close;return'\n <div class="'.concat(e,"field ").concat(e,"file\">\n <div id='").concat(e,"input-holder'>\n <div class=\"").concat(e,'btn-c">\n <button class="').concat(e,'btn" id="').concat(e,'images" type="button" data-open-assets>\n ').concat(n.t("styleManager.fileButton"),'\n </button>\n </div>\n <div style="clear:both;"></div>\n </div>\n <div id="').concat(e,'preview-box" class="').concat(e,'preview-file" data-preview-box>\n <div id="').concat(e,'preview-file" class="').concat(e,'preview-file-cnt" data-preview></div>\n <div id="').concat(e,'close" class="').concat(e,'preview-file-close" data-clear-asset>').concat(o,"</div>\n </div>\n </div>\n ")},n.prototype.__setValueInput=function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),o=n.querySelector("[data-preview-box]"),i=n.querySelector("[data-preview]");o.style.display=t&&t!==r?"":"none",i.style.backgroundImage=t||e.getDefaultValue()},n.prototype.openAssetManager=function(){var e,n=this,r=null===(e=this.em)||void 0===e?void 0:e.Assets;null==r||r.open({select:function(e,o){var i=(0,t.isString)(e)?e:e.get("src");n.model.upValue(i,{partial:!o}),o&&r.close()},types:["image"],accept:"image/*"})},n}(xd);const Hd=zd;var $d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $d(e,t),e.prototype.templateInput=function(t){return""},e.prototype.init=function(){var t=this.model;this.listenTo(t,"change:unit",this.onValueChange),this.listenTo(t,"change:units",this.render)},e.prototype.setValue=function(t){},e.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,r=t.el;if(!this.inputInst){var o=n.input;o.ppfx=e,o.render(),r.querySelector(".".concat(e,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}},e.prototype.clearCached=function(){xd.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(xd);const Ud=Wd;var qd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qd(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;Ud.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),["inputInst","$color"].forEach((function(e){return t[e]=null})),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,r=e.model,o=e.em,i=e.el,a=new ws({target:o,model:r,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(a.el),this.input=null===(t=a.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=a}},e}(Ud);const Kd=Gd;var Yd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xd=function(){return Xd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xd.apply(this,arguments)},Zd=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Jd=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Yd(r,n),r.prototype.defaults=function(){return Xd(Xd({},Zp.getDefaults()),{options:[],full:0})},r.prototype.getOptions=function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]},r.prototype.getOption=function(t){var n=this,r=(0,e.isDef)(t)?t:this.getValue();return this.getOptions().filter((function(t){return n.getOptionId(t)===r}))[0]||null},r.prototype.setOptions=function(t){return void 0===t&&(t=[]),this.set("options",t),this},r.prototype.addOption=function(t){if(t){var e=this.getOptions();this.setOptions(Zd(Zd([],e,!0),[t],!1))}return this},r.prototype.getOptionId=function(t){return(0,e.isDef)(t.id)?t.id:t.value},r.prototype.getOptionLabel=function(e,n){var r;void 0===n&&(n={});var o=n.locale,i=void 0===o||o,a=((0,t.isString)(e)?this.getOption(e):e)||{},s=this.getOptionId(a),l=a.label||a.name||s,c=n.property||this.getId();return i&&(null===(r=this.em)||void 0===r?void 0:r.t("styleManager.options.".concat(c,".").concat(s)))||l},r.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];Zp.prototype.initialize.apply(this,t),this.listenTo(this,"change:options",this.__onOptionChange)},r.prototype.__onOptionChange=function(){this.set("list",this.get("options"))},r}(Zp);const Qd=Jd;var tf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ef=function(t){function e(e){var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.updateOptions),n}return tf(e,t),e.prototype.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 ')},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var r=[];n.forEach((function(t){var n=e.getOptionId(t),o=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,"&quot;"):"",a=i?'style="'.concat(i,'"'):"",s=n.replace(/"/g,"&quot;");r.push('<option value="'.concat(s,'" ').concat(a,">").concat(o,"</option>"))}));var o=this.el.querySelector("#".concat(t,"input-holder"));o.innerHTML="<select>".concat(r.join(""),"</select>"),this.input=o.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],o=r?e.getOptionId(r):"";n&&(n.value=t||o)},e}(xd);const nf=ef;var rf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),of=function(){return of=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},of.apply(this,arguments)};const af=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rf(e,t),e.prototype.defaults=function(){return of(of({},Qd.getDefaults()),{full:1})},e}(Qd);var sf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return sf(e,t),e.prototype.templateInput=function(){var t=this.ppfx;return'<div class="'.concat(t,"field ").concat(t,'field-radio"></div>')},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),o=n.getName(),i=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(o),s=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(r):"",u=n.getOptionId(i),p="".concat(o,"-").concat(u,"-").concat(s),d=c?"":n.getOptionLabel(u),f=i.title?'title="'.concat(i.title,'"'):"",h=n.getValue()===u?"checked":"";l.push('\n <div class="'.concat(e,'radio-item">\n <input type="radio" class="').concat(a,'" id="').concat(p,'" name="').concat(o,"-").concat(s,'" value="').concat(u,'" ').concat(h,'/>\n <label class="').concat(c||r,'" ').concat(f,' for="').concat(p,'">').concat(d,"</label>\n </div>\n "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML='<div class="'.concat(e,'radio-items">').concat(l.join(""),"</div>"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,r=t||n.getDefaultValue(),o=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector('[value="'.concat(r,'"]'));o&&(o.checked=!0)},e}(nf);const cf=lf;var uf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pf=function(){return pf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pf.apply(this,arguments)},df=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return uf(r,n),r.prototype.defaults=function(){return pf(pf({},Zp.getDefaults()),{units:[],unit:"",min:"",max:"",step:1})},r.prototype.getUnits=function(){return this.get("units")||[]},r.prototype.getUnit=function(){return this.get("unit")},r.prototype.getMin=function(){return this.get("min")},r.prototype.getMax=function(){return this.get("max")},r.prototype.getStep=function(){return this.get("step")},r.prototype.upUnit=function(t,e){return void 0===e&&(e={}),this._up({unit:t},e)},r.prototype.initialize=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),Zp.callParentInit(Zp,this,t,n);var r=this.get("unit"),o=this.getUnits();this.input=(0,e.hasWin)()?new Os({model:this}):void 0,o.length&&!r&&this.set("unit",o[0],{silent:!0}),Zp.callInit(this,t,n)},r.prototype.__getClearProps=function(){return pf(pf({},Zp.prototype.__getClearProps()),{unit:""})},r.prototype.parseValue=function(t,e){void 0===e&&(e={});var n=Zp.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,pf({deepCheck:1},e)),o=r.value,i=r.unit;return n.value=o,n.unit=i,n},r.prototype.getFullValue=function(){var e=this.get("value"),n=this.get("unit"),r=(0,t.isUndefined)(e)?"":"".concat(e),o=!(0,t.isUndefined)(n)&&r?n:"",i="".concat(r).concat(o);return Zp.prototype.getFullValue.apply(this,[i])},r}(Zp);const ff=df;var hf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gf=function(){return gf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},gf.apply(this,arguments)};const vf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hf(e,t),e.prototype.defaults=function(){return gf(gf({},ff.getDefaults()),{showInput:1})},e}(ff);var mf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yf=function(){return yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yf.apply(this,arguments)};const bf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mf(e,t),e.prototype.events=function(){return yf(yf({},Ud.prototype.events()),{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},e.prototype.templateInput=function(t){var e=this.ppfx;return'\n <div class="'.concat(e,"field ").concat(e,'field-range">\n <input type="range" min="').concat(t.get("min"),'" max="').concat(t.get("max"),'" step="').concat(t.get("step"),'"/>\n </div>\n ')},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=""===t?e.getDefaultValue():parseFloat(n.value),Ud.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){Ud.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},e.prototype.clearCached=function(){Ud.prototype.clearCached.apply(this,arguments),delete this.slider},e}(Ud);const wf=l.FE.extend(Fl).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get("StyleManager"));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:"stack",model:vd,view:Fd,isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:ud,view:Td,isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:Zp,view:Hd,isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:Zp,view:Kd,isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:Qd,view:nf,isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:af,view:cf,isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:vf,view:bf,isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:ff,view:Ud,isType:function(t){if(t&&"integer"==t.type)return t}},{id:"number",model:ff,view:Ud,isType:function(t){if(t&&"number"==t.type)return t}},{id:"base",model:Zp,view:xd,isType:function(t){return t.type="base",t}}]});var xf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_f=function(){return _f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},_f.apply(this,arguments)},Cf=function(e){function n(n,r){void 0===r&&(r={});var o=e.call(this,n)||this,i=r.em;o.em=i;var a=n||{},s=o.buildProperties(a.buildProps),l=o.get("name")||"",c=[];!o.get("id")&&o.set("id",l.replace(/ /g,"_").toLowerCase()),c=(c=s?o.extendProperties(s):o.get("properties").map((function(e){return(0,t.isString)(e)?o.buildProperties(e)[0]:e})).filter(Boolean)).map((function(t){return o.checkExtend(t)}));var u=new wf(c,{em:i});return u.sector=o,o.set("properties",u),o}return xf(n,e),n.prototype.defaults=function(){return{id:"",name:"",open:!0,visible:!0,extendBuilded:!0,properties:[]}},Object.defineProperty(n.prototype,"properties",{get:function(){return this.get("properties")},enumerable:!1,configurable:!0}),n.prototype.getId=function(){return this.get("id")},n.prototype.getName=function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get("name")},n.prototype.setName=function(t){return this.set("name",t)},n.prototype.isOpen=function(){return!!this.get("open")},n.prototype.setOpen=function(t){return this.set("open",t)},n.prototype.isVisible=function(){return!!this.get("visible")},n.prototype.getProperties=function(t){void 0===t&&(t={});var e=this.properties,n=e.models?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],e.models,!0):e;return n.filter((function(e){var n=!0;(t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue)&&(n=!e.hasValue({noParent:!0})&&e.hasValue());return n}))},n.prototype.getProperty=function(t){return this.getProperties().filter((function(e){return e.get("id")===t}))[0]||void 0},n.prototype.addProperty=function(t,e){return this.properties.add(this.checkExtend(t),e)},n.prototype.extendProperties=function(e,n,r){void 0===r&&(r=!1);for(var o=e.length,i=n||this.get("properties"),a=this.get("extendBuilded"),s=[],l=0,c=i.length;l<c;l++){for(var u=i[l],p=0,d=0;d<o;d++){var f=e[d];if(u.property!=f.property&&u.id!=f.property);else{var h=u.properties;h&&h.length&&(u.properties=this.extendProperties(f.properties||[],h,1)),e[d]=a?(0,t.extend)(f,u):u,s[d]=e[d],p=1}}p||(e.push(u),s.push(u))}return r?s.filter((function(t){return t})):e},n.prototype.checkExtend=function(e){var n=((0,t.isString)(e)?{extend:e}:e)||{},r=n.extend,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["extend"]);return r?_f(_f({},this.buildProperties([r])[0]||{}),o):e},n.prototype.buildProperties=function(t){var e,n=t||[];if(!n.length)return[];var r=null===(e=this.em)||void 0===e?void 0:e.Styles.builtIn;return null==r?void 0:r.build(n)},n}(l.Hn);const Sf=Cf;var Of=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ef=function(){return Ef=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ef.apply(this,arguments)};const kf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Of(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={});var n=e.module,r=e.em;this.em=r,this.module=n,this.listenTo(this,"reset",this.onReset)},e.prototype.model=function(t,e){void 0===e&&(e={});var n=e.collection.em;return new Sf(t,Ef(Ef({},e),{em:n}))},e.prototype.onReset=function(t,e){void 0===e&&(e={}),(e.previousModels||[]).forEach((function(t){return t.get("properties").reset()}))},e}(l.FE);var Tf=function(){return Tf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Tf.apply(this,arguments)},Af=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Pf=function(t){return t.map((function(t){return{id:t}}))},jf=function(){function e(){this.props={},this.typeNumber="number",this.typeColor="color",this.typeRadio="radio",this.typeSelect="select",this.typeFile="file",this.typeSlider="slider",this.typeComposite="composite",this.typeStack="stack",this.unitsSize=["px","%","em","rem","vh","vw"],this.unitsSizeNoPerc=["px","em","rem","vh","vw"],this.unitsTime=["s","ms"],this.unitsAngle=["deg","rad","grad"],this.fixedValues=["initial","inherit","auto"];var t=", sans-serif",e=["flex-start","flex-end","center"],n=Af(Af([],e,!0),["baseline","stretch"],!1);this.optsBgSize=Pf(["auto","cover","contain"]),this.optsBgAttach=Pf(["scroll","fixed","local"]),this.optsBgRepeat=Pf(["repeat","repeat-x","repeat-y","no-repeat"]),this.optsWrap=Pf(["nowrap","wrap","wrap-reverse"]),this.optsOverflow=Pf(["visible","hidden","scroll","auto"]),this.optsDir=Pf(["row","row-reverse","column","column-reverse"]),this.opstDisplay=Pf(["block","inline","inline-block","flex","none"]),this.optsTransitFn=Pf(["linear","ease","ease-in","ease-out","ease-in-out"]),this.optsCursor=Pf(["auto","pointer","copy","crosshair","grab","grabbing","help","move","text"]),this.optsFloat=Pf(["none","left","right"]),this.optsPos=Pf(["static","relative","absolute","fixed"]),this.optsTextAlign=Pf(["left","center","right","justify"]),this.optsFlexAlign=Pf(n),this.optsJustCont=Pf(Af(Af([],e,!0),["space-between","space-around","space-evenly"],!1)),this.optsAlignCont=Pf(Af(Af([],e,!0),["space-between","space-around","stretch"],!1)),this.optsAlignSelf=Pf(Af(["auto"],n,!0)),this.optsTransitProp=Pf(["all","width","height","background-color","transform","box-shadow","opacity"]),this.optsBorderStyle=Pf(["none","solid","dotted","dashed","double","groove","ridge","inset","outset"]),this.optsBgPos=Pf(["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"]),this.optsWeight=[{id:"100",label:"Thin"},{id:"200",label:"Extra-Light"},{id:"300",label:"Light"},{id:"400",label:"Normal"},{id:"500",label:"Medium"},{id:"600",label:"Semi-Bold"},{id:"700",label:"Bold"},{id:"800",label:"Extra-Bold"},{id:"900",label:"Ultra-Bold"}],this.optsShadowType=[{id:"",label:"Outside"},{id:"inset",label:"Inside"}],this.optsFonts=["Arial, Helvetica"+t,"Arial Black, Gadget"+t,"Brush Script MT"+t,"Comic Sans MS, cursive"+t,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+t,"Impact, Charcoal"+t,"Lucida Sans Unicode, Lucida Grande"+t,"Tahoma, Geneva"+t,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+t,"Verdana, Geneva"+t].map((function(t){return{id:t,label:t.split(",")[0]}})),this.fixedFontSizes=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"],this.fixedLetSpace=["normal","initial","inherit"],this.requireFlex={display:["flex"]},this.init()}return e.prototype.__sub=function(e){var n=this;return function(){return e.map((function(e){if((0,t.isString)(e))return n.get(e);var r=e.extend,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["extend"]);return Tf(Tf({},n.get(r)),o)}))}},e.prototype.init=function(){var t=this,e=this,n=e.fixedValues,r=e.requireFlex,o=e.typeNumber;this.props={};var i=[["text-shadow-h",{type:o,default:"0",units:this.unitsSizeNoPerc}],["top",{default:"auto",units:this.unitsSize,fixedValues:n},"text-shadow-h"],["right",{},"top"],["bottom",{},"top"],["left",{},"top"],["margin-top",{default:"0"},"top"],["margin-right",{},"margin-top"],["margin-bottom",{},"margin-top"],["margin-left",{},"margin-top"],["padding-top",{min:0},"margin-top"],["padding-right",{},"padding-top"],["padding-bottom",{},"padding-top"],["padding-left",{},"padding-top"],["width",{min:0},"top"],["min-width",{},"width"],["max-width",{},"width"],["height",{},"width"],["min-height",{},"width"],["max-height",{},"width"],["flex-basis",{requiresParent:r},"width"],["font-size",{default:"medium",fixedValues:this.fixedFontSizes},"width"],["letter-spacing",{default:"normal",fixedValues:this.fixedLetSpace},"top"],["line-height",{},"letter-spacing"],["text-shadow-v",{},"text-shadow-h"],["text-shadow-blur",{min:0},"text-shadow-h"],["border-radius-c",{property:"border-radius",fixedValues:void 0},"padding-top"],["border-top-left-radius",{},"border-radius-c"],["border-top-right-radius",{},"border-radius-c"],["border-bottom-left-radius",{},"border-radius-c"],["border-bottom-right-radius",{},"border-radius-c"],["border-width",{units:this.unitsSizeNoPerc},"border-radius-c"],["box-shadow-h",{},"text-shadow-h"],["box-shadow-v",{},"text-shadow-h"],["box-shadow-blur",{default:"5px"},"text-shadow-blur"],["box-shadow-spread",{},"text-shadow-h"],["transition-duration",{default:"2s",units:this.unitsTime},"border-radius-c"],["perspective",{},"border-radius-c"],["order",{type:o,default:"0",requiresParent:r}],["flex-grow",{},"order"],["flex-shrink",{default:"1"},"order"],["float",{type:this.typeRadio,default:"none",options:this.optsFloat}],["position",{default:"static",options:this.optsPos},"float"],["text-align",{default:"left",options:this.optsTextAlign},"float"],["color",{type:this.typeColor,default:"black",full:!0}],["text-shadow-color",{},"color"],["border-color",{},"color"],["box-shadow-color",{},"color"],["background-color",{default:"none"},"color"],["background-image",{type:this.typeFile,functionName:"url",default:"none",full:!0}],["opacity",{type:this.typeSlider,default:"1",min:0,max:1,step:.01,full:!0}],["display",{type:this.typeSelect,default:"block",options:this.opstDisplay}],["flex-direction",{default:"row",options:this.optsDir,requires:r},"display"],["flex-wrap",{default:"nowrap",options:this.optsWrap},"flex-direction"],["justify-content",{default:"flex-start",options:this.optsJustCont},"flex-wrap"],["align-items",{default:"stretch",options:this.optsFlexAlign},"flex-wrap"],["align-content",{options:this.optsAlignCont},"align-items"],["align-self",{default:"auto",options:this.optsAlignSelf,requiresParent:r},"display"],["font-family",{default:"Arial, Helvetica, sans-serif",options:this.optsFonts},"display"],["font-weight",{default:"400",options:this.optsWeight},"display"],["border-style",{default:"solid",options:this.optsBorderStyle},"display"],["box-shadow-type",{default:"",options:this.optsShadowType},"display"],["background-repeat",{default:"repeat",options:this.optsBgRepeat},"display"],["background-position",{default:"left top",options:this.optsBgPos},"display"],["background-attachment",{default:"scroll",options:this.optsBgAttach},"display"],["background-size",{default:"auto",options:this.optsBgSize},"display"],["transition-property",{default:"width",options:this.optsTransitProp},"display"],["transition-timing-function",{default:"ease",options:this.optsTransitFn},"display"],["cursor",{default:"auto",options:this.optsCursor},"display"],["overflow",{default:"visible",options:this.optsOverflow},"display"],["overflow-x",{},"overflow"],["overflow-y",{},"overflow"],["margin",{type:this.typeComposite,properties:this.__sub([{extend:"margin-top",id:"margin-top-sub"},{extend:"margin-right",id:"margin-right-sub"},{extend:"margin-bottom",id:"margin-bottom-sub"},{extend:"margin-left",id:"margin-left-sub"}])}],["padding",{properties:this.__sub([{extend:"padding-top",id:"padding-top-sub"},{extend:"padding-right",id:"padding-right-sub"},{extend:"padding-bottom",id:"padding-bottom-sub"},{extend:"padding-left",id:"padding-left-sub"}])},"margin"],["border",{properties:this.__sub([{extend:"border-width",id:"border-width-sub"},{extend:"border-style",id:"border-style-sub"},{extend:"border-color",id:"border-color-sub"}])},"margin"],["border-radius",{properties:this.__sub([{extend:"border-top-left-radius",id:"border-top-left-radius-sub"},{extend:"border-top-right-radius",id:"border-top-right-radius-sub"},{extend:"border-bottom-right-radius",id:"border-bottom-right-radius-sub"},{extend:"border-bottom-left-radius",id:"border-bottom-left-radius-sub"}])},"margin"],["transition",{type:this.typeStack,properties:this.__sub([{extend:"transition-property",id:"transition-property-sub"},{extend:"transition-duration",id:"transition-duration-sub"},{extend:"transition-timing-function",id:"transition-timing-function-sub"}])}],["box-shadow",{preview:!0,layerLabel:function(t,e){var n=e.values,r=n["box-shadow-h"],o=n["box-shadow-v"],i=n["box-shadow-blur"],a=n["box-shadow-spread"];return"".concat(r," ").concat(o," ").concat(i," ").concat(a)},properties:this.__sub(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"])},"transition"],["text-shadow",{default:"none",layerLabel:function(t,e){var n=e.values,r=n["text-shadow-h"],o=n["text-shadow-v"],i=n["text-shadow-blur"];return"".concat(r," ").concat(o," ").concat(i)},properties:this.__sub(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"])},"box-shadow"],["background",{detached:!0,layerLabel:function(t,e){var n=e.values;return[n["background-repeat-sub"]||"",n["background-position-sub"]||"",n["background-attachment-sub"]||"",n["background-size-sub"]||""].join(" ")},properties:this.__sub([{extend:"background-image",id:"background-image-sub"},{extend:"background-repeat",id:"background-repeat-sub"},{extend:"background-position",id:"background-position-sub"},{extend:"background-attachment",id:"background-attachment-sub"},{extend:"background-size",id:"background-size-sub"}])},"box-shadow"],["transform",{type:"stack",layerSeparator:" ",fromStyle:function(t,e){var n=e.property,r=t[e.name]||"",o=n.getLayerSeparator();return r?r.split(o).map((function(t){var e=n.__parseFn(t);return{"transform-type":e.name,"transform-value":e.value}})):[]},toStyle:function(t,e){var n;return(n={})[e.name]="".concat(t["transform-type"],"(").concat(t["transform-value"],")"),n},properties:[{property:"transform-type",name:"Type",type:this.typeSelect,default:"rotateZ",full:!0,options:[{id:"scaleX",propValue:{units:[""],step:.01}},{id:"scaleY",propValue:{units:[""],step:.01}},{id:"scaleZ",propValue:{units:[""],step:.01}},{id:"rotateX",propValue:{units:this.unitsAngle,step:1}},{id:"rotateY",propValue:{units:this.unitsAngle,step:1}},{id:"rotateZ",propValue:{units:this.unitsAngle,step:1}},{id:"translateX",propValue:{units:this.unitsSize,step:1}},{id:"translateY",propValue:{units:this.unitsSize,step:1}}],onChange:function(t){var e=t.property;if(t.to.value){var n=e.getOption(),r=Tf({},n.propValue||{}),o=e.getParent().getProperty("transform-value"),i=o.getUnit();(!i||(null==r?void 0:r.units.indexOf(i))<0)&&(r.unit=(null==r?void 0:r.units[0])||""),o.up(r)}}},{property:"transform-value",type:this.typeNumber,default:"0",full:!0}]}]];return i.forEach((function(e){var n=e[0],r=e[1],o=e[2];t.add(n,r||{},{from:o})})),this},e.prototype.add=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=r.from||"",i=this.props[o||e]||{},a=Tf(Tf(Tf({},i),{property:e}),n);return a.properties&&(0,t.isFunction)(a.properties)&&(a.properties=a.properties()),this.props[e]=a,a},e.prototype.get=function(t){return this.props[t]},e.prototype.build=function(e){var n=this,r=[];return((0,t.isString)(e)?[e]:e).forEach((function(t){r.push(n.get(t)||{property:t})})),r},e}();const Mf=jf;var Nf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t){function e(e){var n=t.call(this,e)||this,r=e.config||{},o=n.model,i=r.em;return n.config=r,n.em=i,n.pfx=r.stylePrefix||"",n.listenTo(o,"destroy remove",n.remove),n.listenTo(o,"change:open",n.updateOpen),n.listenTo(o,"change:visible",n.updateVisibility),n}return Nf(e,t),e.prototype.template=function(t){var e,r,o,i=t.pfx,a=t.label,s=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,l=(null==s?void 0:s.caret)||"",c="".concat(i,"sector-");return n(If||(r=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],o=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],Object.defineProperty?Object.defineProperty(r,"raw",{value:o}):r.raw=o,If=r),c,c,l,c,a)},e.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o=n.isOpen();e[o?"addClass":"removeClass"]("".concat(r,"open")),this.getPropertiesEl().style.display=o?"":"none"},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get("open"))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get("properties");if(n){var r=new Sd({collection:n,config:e});this.$el.append(r.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,r=t.$el,o=n.getId(),i=n.getName();return r.html(this.template({pfx:e,label:i})),this.renderProperties(),r.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(o," no-select")),this.updateOpen(),this},e}(l.G7);const Lf=Rf;var If,Df=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.module,o=e.config,i=n.collection;return n.pfx=(null==o?void 0:o.stylePrefix)||"",n.ppfx=(null==o?void 0:o.pStylePrefix)||"",n.config=o,n.module=r,n.listenTo(i,"add",n.addTo),n.listenTo(i,"reset",n.render),n}return Df(e,t),e.prototype.remove=function(){var t=this;return l.G7.prototype.remove.apply(this,arguments),["config","module","em"].forEach((function(e){return t[e]={}})),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var r=this.config,o=this.el,i=e||o,a=new Lf({model:t,config:r}).render().el;return(0,vt.$Q)(i,a,n.at),a},e.prototype.render=function(){var t=this,e=this,n=e.$el,r=e.pfx,o=e.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),n.append(i),n.addClass("".concat(r,"sectors ").concat(o,"one-bg ").concat(o,"two-color")),this},e}(l.G7);const Vf=Ff;var Bf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zf=function(){return zf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},zf.apply(this,arguments)},Hf=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},$f="style",Wf="".concat($f,":"),Uf="".concat(Wf,"sector"),qf="".concat(Uf,":add"),Gf="".concat(Uf,":remove"),Kf="".concat(Uf,":update"),Yf="".concat(Wf,"property"),Xf="".concat(Yf,":add"),Zf="".concat(Yf,":remove"),Jf="".concat(Yf,":update"),Qf="".concat(Wf,"layer:select"),th="".concat(Wf,"target"),eh="".concat(Wf,"custom"),nh=function(t){return t||0===t},rh={all:$f,sectorAdd:qf,sectorRemove:Gf,sectorUpdate:Kf,propertyAdd:Xf,propertyRemove:Zf,propertyUpdate:Jf,layerSelect:Qf,target:th,custom:eh},oh=function(n){function r(e){var r=n.call(this,e,"StyleManager",new kf([],{em:e}),rh,qp)||this;r.Sector=Sf,r.storageKey="",(0,t.bindAll)(r,"__clearStateTarget");var o=r.config,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),r.builtIn=new Mf,r.properties=new wf([],{em:e,module:r}),r.sectors=r.all;var a=new l.Hn({targets:[]});r.model=a;r.upAll=(0,t.debounce)((function(){return r.__upSel()}),0),a.listenTo(e,"component:toggled component:update:classes change:state change:device frame:resized selector:type",r.upAll),a.listenTo(e,"component:toggled",r.__clearStateTarget);var s=(0,t.debounce)((function(){r.__upProps(),r.__trgCustom()}),0);a.listenTo(e,"styleable:change undo redo",s);var c=(0,t.debounce)((function(){return r.__trgCustom()}),0);return a.listenTo(e,"".concat(Qf," ").concat(th),c),a.on("change:lastTarget",(function(){return e.trigger(th,r.getSelected())})),r}return Bf(r,n),r.prototype.__upSel=function(){this.select(this.em.getSelectedAll())},r.prototype.__trgCustom=function(t){void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},r.prototype.__trgEv=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(e=this.em).trigger.apply(e,Hf([t],n,!1))},r.prototype.__clearStateTarget=function(){var t=this,e=this.em,n=this.__getStateTarget();n&&(null==e||e.skip((function(){e.Css.remove(n),t.model.set({stateTarget:null})})))},r.prototype.onLoad=function(){this.sectors.add(this.config.sectors,{silent:!0})},r.prototype.postRender=function(){this.__appendTo()},r.prototype.addSector=function(t,e,n){void 0===n&&(n={});var r=this.getSector(t);return r||(e.id=t,r=this.sectors.add(e,n)),r},r.prototype.getSector=function(t,e){void 0===e&&(e={});var n=this.sectors.where({id:t})[0];return!n&&e.warn&&this._logNoSector(t),n||null},r.prototype.getSectors=function(t){void 0===t&&(t={});var e=this.sectors,n=e&&e.models?t.array?Hf([],e.models,!0):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},r.prototype.removeSector=function(t){return this.getSectors().remove(this.getSector(t,{warn:!0}))},r.prototype.addProperty=function(t,e,n){void 0===n&&(n={});var r,o=this.getSector(t,{warn:!0});return o&&(r=o.addProperty(e,n)),r},r.prototype.getProperty=function(t,e){var n,r=this.getSector(t,{warn:!0});return r&&(n=r.properties.filter((function(t){return t.get("property")===e||t.get("id")===e}))[0]),n},r.prototype.getProperties=function(t){var e,n=this.getSector(t,{warn:!0});return n&&(e=n.properties),e},r.prototype.removeProperty=function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},r.prototype.select=function(n,r){var o=this;void 0===r&&(r={});var i=this.em,a=(0,t.isArray)(n)?n:[n],s=r.stylable,l=i.Css,c=[];a.filter(Boolean).forEach((function(e){var n=e;if((0,t.isString)(e)){var r=l.getRule(e)||l.setRule(e);!(0,t.isUndefined)(s)&&r.set({stylable:s}),n=r}c.push(n)}));var u=r.component||c.filter((function(t){return(0,e.isComponent)(t)})).reverse()[0];c=c.map((function(t){return o.getModelToStyle(t)}));var p=i.getState(),d=c.slice().reverse()[0],f=this.getParentRules(d,{state:p,component:u}),h=this.__getStateTarget();return i.skip((function(){var t;if(p&&(null===(t=null==d?void 0:d.getState)||void 0===t?void 0:t.call(d))){var e=d.getStyle();h?h.setStyle(e):h=l.getAll().add({selectors:"gjs-selected",style:e,shallow:!0,important:!0})}else h&&(l.remove(h),h=void 0)})),this.model.set({targets:c,lastTarget:d,lastTargetParents:f,stateTarget:h,component:u}),this.__upProps(r),c},r.prototype.getSelected=function(){return this.model.get("lastTarget")},r.prototype.getSelectedAll=function(){return this.model.get("targets")},r.prototype.getSelectedParents=function(){return this.model.get("lastTargetParents")||[]},r.prototype.__getStateTarget=function(){return this.model.get("stateTarget")},r.prototype.addStyleTargets=function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected();n&&this.__emitCmpStyleUpdate(t);var r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},r.prototype.getBuiltIn=function(t){return this.builtIn.get(t)},r.prototype.getBuiltInAll=function(){return this.builtIn.props},r.prototype.addBuiltIn=function(t,e){return this.builtIn.add(t,e)},r.prototype.getModelToStyle=function(t,e){void 0===e&&(e={});var n=this.em,r=e.skipAdd;if(n&&(null==t?void 0:t.toHTML)){var o=n.getConfig(),i=n.UndoManager,a=n.Css,s=n.Selectors,l=s?s.getConfig():{},c=o.devicePreviewMode?"":n.get("state"),u=t.get("classes").getStyleable(),p=u.length,d=!l.componentFirst||e.useClasses,f={noCount:1},h={state:c,addOpts:f};i.skip((function(){var e;if(p&&d){var i=n.getCurrentMedia();(e=a.get(u,c,i))||r||(e=a.add(u,c,i,{},f))}else if(o.avoidInlineStyle){var s=t.getId();!(e=a.getIdRule(s,h))&&!r&&(e=a.setIdRule(s,{},h)),t.is("wrapper")&&e.set("wrapper",1,f)}e&&(t=e)}))}return t},r.prototype.getParentRules=function(e,n){var r=void 0===n?{}:n,o=r.state,i=r.component,a=this.em,s=[];if(a&&e){var l=i,c=a.Css,u=a.CodeManager.getGenerator("css"),p=e.toHTML?e:e.getComponent(),d={array:!0},f=[],h=[],g=[],v=function(t){return t.length?c.getRules().filter((function(e){var n=e.getSelectors().map((function(t){return t.getFullName()}));return!!n.length&&n.every((function(e){return t.indexOf(e)>=0}))})):[]};p?(f=c.getRules("#".concat(p.getId())),g=(h=l?v(l.getSelectors().getFullName(d)):[]).concat(f)):(f=l?c.getRules("#".concat(l.getId())):[],h=v(e.getSelectors().getFullName(d)),g=f.concat(h));var m=g.filter((function(e){return(0,t.isUndefined)(o)?1:e.get("state")===o})).sort(u.sortRules).reverse();s=m.slice(m.indexOf(e)+1)}return s},r.prototype.addType=function(t,e){this.properties.addType(t,e)},r.prototype.getType=function(t){return this.properties.getType(t)},r.prototype.getTypes=function(){return this.properties.getTypes()},r.prototype.createType=function(t,e){var n=void 0===e?{}:e,r=n.model,o=void 0===r?{}:r,i=n.view,a=void 0===i?{}:i,s=this.config,l=this.getType(t);if(l)return new l.view(zf({model:new l.model(o),config:s},a))},r.prototype.render=function(){var t=this,e=t.config,n=t.em,r=t.SectView,o=r&&r.el;return this.SectView=new Vf({el:o,em:n,config:e,module:this,collection:this.sectors}),this.SectView.render().el},r.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},r.prototype.__emitCmpStyleUpdate=function(t,e){void 0===e&&(e={});var n=this.em;if(!t.__p){var r=this.getSelectedAll(),o=e.components||n.getSelectedAll(),i=Array.isArray(o)?o:[o],a=zf({},t);delete a.__p,i.forEach((function(t){return!r.includes(t)&&t.__onStyleChange(a)}))}},r.prototype.__upProps=function(t){var e=this;void 0===t&&(t={});var n=this.getSelected();if(n){var r=this.sectors,o=this.model.get("component"),i=this.getSelectedParents(),a=n.getStyle(),s=i.map((function(t){return{target:t,style:t.getStyle()}}));r.map((function(n){n.getProperties().map((function(n){e.__upProp(n,a,s,t)}))})),r.forEach((function(t){var e=t.getProperties();e.forEach((function(t){var e=t.__checkVisibility({target:n,component:o,sectors:r});t.set("visible",e)}));var i=e.some((function(t){return t.isVisible()}));t.set("visible",i)}))}},r.prototype.__upProp=function(t,e,n,r){var o=this,i=t.getName(),a=e[i],s=nh(a),l="stack"===t.getType(),c="composite"===t.getType(),u=zf(zf({},r),{__up:!0}),p=!c&&!l,d=t,f=t,h=l?d.__getLayersFromStyle(e):[],g=c?f.__getPropsFromStyle(e):{},v=s?a:null,m=null;if(l&&null===h||c&&null===g){var y=l?"__getLayersFromStyle":"__getPropsFromStyle";if(w=n.filter((function(t){return null!==d[y](t.style)}))[0]){v=w.style[i],m=w.target;var b=d[y](w.style);l?h=b:g=b}}else if(!s){var w;v=null,(w=n.filter((function(t){return nh(t.style[i])}))[0])&&(v=w.style[i],m=w.target)}if(t.__setParentTarget(m),p&&t.__getFullValue()!==v&&t.upValue(v,u),l&&d.__setLayers(h||[],{isEmptyValue:d.isEmptyValueStyle(e)}),c){var x=f.getProperties();if(f.isDetached()){var _=f.__getPropsFromStyle(e,{byName:!0})||{},C=n.map((function(t){return zf(zf({},t),{style:f.__getPropsFromStyle(t.style,{byName:!0})||{}})}));x.map((function(t){return o.__upProp(t,_,C,r)}))}else f.__setProperties(g||{},u),f.getProperties().map((function(t){return t.__setParentTarget(m)}))}},r.prototype.destroy=function(){var t;[this.properties,this.sectors].forEach((function(t){t.reset(),t.stopListening()})),null===(t=this.SectView)||void 0===t||t.remove(),this.model.stopListening(),this.upAll.cancel()},r}(v);const ih=oh;var ah=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sh=function(){return sh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},sh.apply(this,arguments)},lh=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},ch=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};i().$=a.default;var uh=[Mc,wc,ru,Ep,ns,H,wa,ih,Yi,fu,vp,Gu,Up,Bs,bl,Yt,rl,gi],ph=[nc,Go,fc,Po];!function(e){var n=e.$;if(n&&n.prototype&&"jQuery"!==n.prototype.constructor.name){var r=n.fn;r.hide=function(){return this.css("display","none")},r.show=function(){return this.css("display","block")},r.focus=function(){var t=this.get(0);return t&&t.focus(),this},r.bind=function(t,e){return this.on(t,e)},r.unbind=function(e,n){if((0,t.isObject)(e)){for(var r in e)e.hasOwnProperty(r)&&this.off(r,e[r]);return this}return this.off(e,n)},r.click=function(t){return t?this.on("click",t):this.trigger("click")},r.change=function(t){return t?this.on("change",t):this.trigger("change")},r.keydown=function(t){return t?this.on("keydown",t):this.trigger("keydown")},r.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,(function(t){t.data=n,r(t)}))},r.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},r.scrollTop=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageYOffset:t.scrollTop||0};var o=n.prototype.offset;r.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")),o.call(this)},n.map=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n};var i=Array.prototype.indexOf;n.inArray=function(t,e,n){return null==e?-1:i.call(e,t,n)},n.Event=function(t,e){if(!(this instanceof n.Event))return new n.Event(t,e);this.type=t,this.isDefaultPrevented=function(){return!1}}}}({$:a.default});var dh={debug:console.log,info:console.info,warning:console.warn,error:console.error},fh=function(n){function r(e){void 0===e&&(e={});var r=n.call(this)||this;r.__skip=!1,r.defaultRunning=!1,r.destroyed=!1,r._config=e;var o=r.config;r.set("Config",e),r.set("modules",[]),r.set("toLoad",[]),r.set("storables",[]),r.set("selected",new p),r.set("dmode",o.dragMode);var i=o.el,a=o.log,s=!0===a?(0,t.keys)(dh):(0,t.isArray)(a)?a:[];return(0,t.bindAll)(r,"initBaseColorPicker"),i&&o.fromElement&&(o.components=i.innerHTML),r.attrsOrig=i?(0,t.toArray)(i.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):"",o.components&&!o.pageManager&&(o.pageManager={pages:[{component:o.components}]}),uh.forEach((function(t){return r.loadModule(t)})),ph.forEach((function(t){return r.loadStorableModule(t)})),r.on("change:componentHovered",r.componentHovered,r),r.on("change:changesCount",r.updateChanges,r),r.on("change:readyLoad change:readyCanvas",r._checkReady,r),s.forEach((function(t){return r.listenLog(t)})),[{from:"change:selectedComponent",to:"component:toggled"}].forEach((function(t){var e=t.from,n=t.to;r.listenTo(r,e,(function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];r.trigger.apply(r,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([n],t,!1)),r.logWarning("The event '".concat(e,"' is deprecated, replace it with '").concat(n,"'"))}))})),r}return ah(r,n),r.prototype.defaults=function(){return{editing:0,selected:0,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:""}},Object.defineProperty(r.prototype,"storables",{get:function(){return this.get("storables")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"modules",{get:function(){return this.get("modules")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toLoad",{get:function(){return this.get("toLoad")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selected",{get:function(){return this.get("selected")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"shallow",{get:function(){return this.get("shallow")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"I18n",{get:function(){return this.get("I18n")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Utils",{get:function(){return this.get("Utils")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Commands",{get:function(){return this.get("Commands")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Keymaps",{get:function(){return this.get("Keymaps")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Modal",{get:function(){return this.get("Modal")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Panels",{get:function(){return this.get("Panels")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CodeManager",{get:function(){return this.get("CodeManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"UndoManager",{get:function(){return this.get("UndoManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RichTextEditor",{get:function(){return this.get("RichTextEditor")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Canvas",{get:function(){return this.get("Canvas")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Editor",{get:function(){return this.get("Editor")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Components",{get:function(){return this.get("DomComponents")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Css",{get:function(){return this.get("CssComposer")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Blocks",{get:function(){return this.get("BlockManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Selectors",{get:function(){return this.get("SelectorManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Storage",{get:function(){return this.get("StorageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Traits",{get:function(){return this.get("TraitManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Parser",{get:function(){return this.get("Parser")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Layers",{get:function(){return this.get("LayerManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Assets",{get:function(){return this.get("AssetManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Devices",{get:function(){return this.get("DeviceManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Pages",{get:function(){return this.get("PageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Styles",{get:function(){return this.get("StyleManager")},enumerable:!1,configurable:!0}),r.prototype._checkReady=function(){this.get("readyLoad")&&this.get("readyCanvas")&&!this.get("ready")&&this.set("ready",!0)},r.prototype.getContainer=function(){return this.config.el},r.prototype.listenLog=function(t){this.listenTo(this,"log:".concat(t),dh[t])},Object.defineProperty(r.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),r.prototype.getConfig=function(e){var n=this.config;return(0,t.isUndefined)(e)?n:n[e]},r.prototype.loadOnStart=function(){var t=this,e=this.config,n=e.projectData,o=e.headless,i=this.Storage;this.toLoad.reverse().forEach((function(t){return t.onLoad()}));var a=function(){t.modules.forEach((function(e){return e.postLoad&&e.postLoad(t)})),t.set("readyLoad",1)};o?(n&&this.loadData(n),a()):this._storageTimeout=setTimeout((function(){return lh(t,void 0,void 0,(function(){var t;return ch(this,(function(e){switch(e.label){case 0:return n?(this.loadData(n),[3,5]):[3,1];case 1:if(!(null==i?void 0:i.canAutoload()))return[3,5];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.load()];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.logError(t),[3,5];case 5:return a(),[2]}}))}))}));var s=new r({noticeOnUnload:!1,storageManager:!1,undoManager:!1});s.Pages.onLoad(),s.Canvas.postLoad(),this.set("shallow",s)},r.prototype.updateChanges=function(t,e,n){var r=this,o=this.Storage,i=this.getDirtyCount();n.isClear||(this.updateItr&&clearTimeout(this.updateItr),this.updateItr=setTimeout((function(){return r.trigger("update")}))),this.config.noticeOnUnload&&(window.onbeforeunload=i?function(){return!0}:null),o.isAutosave()&&i>=o.getStepsBeforeSave()&&this.store().catch((function(t){return r.logError(t)}))},r.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},r.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},r.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set("Editor",t)},r.prototype.getEditor=function(){return this.get("Editor")},r.prototype.handleUpdates=function(t,e,n){var r=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get("ready")||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=r.getDirtyCount()||0;n.unset;var e=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["unset"]);r.set("changesCount",t+1,e)}),0))},r.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},r.prototype.componentHovered=function(t,e,n){var r=this.previous("componentHovered");r&&this.trigger("component:unhovered",r,n),e&&this.trigger("component:hovered",e,n)},r.prototype.getSelected=function(){return this.selected.lastComponent()},r.prototype.getSelectedAll=function(){return this.selected.allComponents()},r.prototype.setSelected=function(e,n){var r=this;void 0===n&&(n={});var o=n.event,i=o&&(o.ctrlKey||o.metaKey),a=(o||{}).shiftKey,s=((0,t.isArray)(e)?e:[e]).map((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.delegate)||void 0===e?void 0:e.select)||void 0===n?void 0:n.call(e,t))||t})).filter(Boolean),l=this.getSelectedAll(),c=this.getConfig().multipleSelection,u=(0,t.isArray)(e);!u&&e||this.removeSelected(l.filter((function(e){return!(0,t.contains)(s,e)}))),s.forEach((function(e){if(e&&(r.trigger("component:select:before",e,n),!e.get("selectable")||n.abort)){if(!n.useValid)return;for(var o=e.parent();o&&!o.get("selectable");)o=o.parent();e=o}if(i&&c)return r.toggleSelected(e);if(a&&c){r.clearSelection(r.Canvas.getWindow());var s,p,d=e.collection,f=e.index();if(r.getSelectedAll().forEach((function(e){var n=e.collection,r=e.index();n===d&&(r<f?s=(0,t.isUndefined)(s)?r:Math.max(s,r):r>f&&(p=(0,t.isUndefined)(p)?r:Math.min(p,r)))})),!(0,t.isUndefined)(s))for(;s!==f;)r.addSelected(d.at(s)),s++;if(!(0,t.isUndefined)(p))for(;p!==f;)r.addSelected(d.at(p)),p--;return r.addSelected(e)}!u&&r.removeSelected(l.filter((function(t){return t!==e}))),r.addSelected(e,n)}))},r.prototype.addSelected=function(e,n){var r=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(e){var o=r.selected;e&&e.get("selectable")&&!e.parents().some((function(t){return o.hasComponent(t)}))&&(n.forceChange&&r.removeSelected(e,n),o.allComponents().filter((function(n){return(0,t.contains)(n.parents(),e)})).forEach((function(t){return r.removeSelected(t,n)})),o.addComponent(e,n),r.trigger("component:select",e,n),r.Canvas.addSpot({type:st.q.Select,component:e}))}))},r.prototype.removeSelected=function(e,n){var r=this;void 0===n&&(n={}),this.selected.removeComponent(e,n),((0,t.isArray)(e)?e:[e]).forEach((function(t){return r.Canvas.removeSpots({type:st.q.Select,component:t})}))},r.prototype.toggleSelected=function(e,n){var r=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(t){r.selected.hasComponent(t)?r.removeSelected(t,n):r.addSelected(t,n)}))},r.prototype.setHovered=function(t,e){var n=this;void 0===e&&(e={});var r=function(t,e){var r=n,o=r.config,i=r.Canvas,a=n.getHovered(),s=n.getSelectedAll(),l=st.q.Hover,c=st.q.Spacing;n.set("componentHovered",t||null,e),a&&(i.removeSpots({type:l,component:a}),i.removeSpots({type:c,component:a})),t&&(i.addSpot({type:l,component:t}),s.includes(t)&&!o.showOffsetsSelected||i.addSpot({type:c,component:t}))};if(!t)return r();var o="component:hover";if(e.forceChange&&r(),this.trigger("".concat(o,":before"),t,e),!t.get("hoverable")){if(!e.useValid||e.abort)return;for(var i=t.parent();i&&!i.get("hoverable");)i=i.parent();t=i}e.abort||(r(t,e),this.trigger(o,t,e))},r.prototype.getHovered=function(){return this.get("componentHovered")},r.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.Components.setComponents(t,e)},r.prototype.getComponents=function(){var t=this.Components,e=this.CodeManager;if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},r.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.Css;return n.clear(e),n.getAll().add(t,e),this},r.prototype.addStyle=function(e,n){void 0===n&&(n={});var r=this.getStyle().add(e,n);return(0,t.isArray)(r)?r:[r]},r.prototype.getStyle=function(){return this.Css.getAll()},r.prototype.setState=function(t){return this.set("state",t),this},r.prototype.getState=function(){return this.get("state")||""},r.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,r=e.jsInHtml?this.getJs(t):"",o=t.component||this.Components.getComponent(),i=o?this.CodeManager.getCode(o,"html",sh(sh({},n),t)):"";return i+=r?"<script>".concat(r,"<\/script>"):""},r.prototype.getCss=function(e){void 0===e&&(e={});var n=this.config,r=n.optsCss,o=e.avoidProtected,i=(0,t.isUndefined)(e.keepUnusedStyles)?n.keepUnusedStyles:e.keepUnusedStyles,a=this.Css,s=e.component||this.Components.getComponent(),l=o?"":n.protectedCss,c=s&&this.CodeManager.getCode(s,"css",sh(sh({cssc:a,keepUnusedStyles:i},r),e));return s?e.json?c:l+c:""},r.prototype.getJs=function(t){void 0===t&&(t={});var e=t.component||this.Components.getWrapper();return e?this.CodeManager.getCode(e,"js").trim():""},r.prototype.store=function(t){return lh(this,void 0,void 0,(function(){var e;return ch(this,(function(n){switch(n.label){case 0:return e=this.storeData(),[4,this.Storage.store(e,t)];case 1:return n.sent(),this.clearDirtyCount(),[2,e]}}))}))},r.prototype.load=function(t,n){return void 0===n&&(n={}),lh(this,void 0,void 0,(function(){var r;return ch(this,(function(o){switch(o.label){case 0:return[4,this.Storage.load(t)];case 1:return r=o.sent(),this.loadData(r),[4,(0,e.wait)()];case 2:return o.sent(),n.clear&&(this.UndoManager.clear(),this.clearDirtyCount()),[2,r]}}))}))},r.prototype.storeData=function(){var t={},e=this.getEditing();return e&&e.trigger("sync:content",{noCount:!0}),this.storables.forEach((function(e){t=sh(sh({},t),e.store(1))})),JSON.parse(JSON.stringify(t))},r.prototype.loadData=function(t){return void 0===t&&(t={}),(0,e.isEmptyObj)(t)||(this.storables.forEach((function(t){return t.clear()})),this.storables.forEach((function(e){return e.load(t)}))),t},r.prototype.getDeviceModel=function(){var t=this.get("device");return this.Devices.get(t)},r.prototype.runDefault=function(t){void 0===t&&(t={});var e=this.get("Commands").get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=!0)},r.prototype.stopDefault=function(t){void 0===t&&(t={});var e=this.get("Commands").get(this.config.defaultCommand);e&&this.defaultRunning&&(e.stop(this,this,t),this.defaultRunning=!1)},r.prototype.refreshCanvas=function(t){void 0===t&&(t={}),this.Canvas.refresh({spots:t.tools})},r.prototype.clearSelection=function(t){var e;null===(e=(t||window).getSelection())||void 0===e||e.removeAllRanges()},r.prototype.getCurrentMedia=function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,r=t.devicePreviewMode,o=e&&e.get("widthMedia");return e&&o&&!r?"(".concat(n,": ").concat(o,")"):""},r.prototype.getWrapper=function(){return this.Components.getWrapper()},r.prototype.setCurrentFrame=function(t){return this.set("currentFrame",t)},r.prototype.getCurrentFrame=function(){return this.get("currentFrame")},r.prototype.getCurrentFrameModel=function(){var t;return null===(t=this.getCurrentFrame()||{})||void 0===t?void 0:t.model},r.prototype.getIcon=function(t){return(this.config.icons||{})[t]||""},r.prototype.getDirtyCount=function(){return this.get("changesCount")},r.prototype.clearDirtyCount=function(){return this.set({changesCount:0},{isClear:!0})},r.prototype.getZoomDecimal=function(){return this.Canvas.getZoomDecimal()},r.prototype.getZoomMultiplier=function(){return this.Canvas.getZoomMultiplier()},r.prototype.setDragMode=function(t){return this.set("dmode",t)},r.prototype.getDragMode=function(t){return(null==t?void 0:t.getDragMode())||this.get("dmode")||""},r.prototype.t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.get("I18n");return null==n?void 0:n.t.apply(n,t)},r.prototype.inAbsoluteMode=function(t){return"absolute"===this.getDragMode(t)},r.prototype.destroyAll=function(){var t=this,n=this.config,r=this.view,o=this.getEditor(),i=(n.grapesjs||{}).editors,s=void 0===i?[]:i,l=this.get("shallow");this._storageTimeout&&clearTimeout(this._storageTimeout),null==l||l.destroyAll(),this.stopListening(),this.stopDefault(),this.modules.slice().reverse().forEach((function(t){return t.destroy()})),r&&r.remove(),this.clear({silent:!0}),this.destroyed=!0,["_config","view","_previousAttributes","_events","_listeners"].forEach((function(e){return t[e]={}})),s.splice(s.indexOf(o),1),(0,e.hasWin)()&&(0,a.default)(n.el).empty().attr(this.attrsOrig)},r.prototype.getEditing=function(){var t=this.get("editing");return t&&t.model||void 0},r.prototype.setEditing=function(t){return this.set("editing",t),this},r.prototype.isEditing=function(){return!!this.get("editing")},r.prototype.log=function(t,e){void 0===e&&(e={});var n=e.ns,r=e.level,o=void 0===r?"debug":r;if(this.trigger("log",t,e),o&&this.trigger("log:".concat(o),t,e),n){var i="log-".concat(n);this.trigger(i,t,e),o&&this.trigger("".concat(i,":").concat(o),t,e)}},r.prototype.logInfo=function(t,e){this.log(t,sh(sh({},e),{level:"info"}))},r.prototype.logWarning=function(t,e){this.log(t,sh(sh({},e),{level:"warning"}))},r.prototype.logError=function(t,e){this.log(t,sh(sh({},e),{level:"error"}))},r.prototype.initBaseColorPicker=function(t,e){void 0===e&&(e={});var n=this.config,r=n.colorPicker,o=void 0===r?{}:r,i=n.el,s=n.stylePrefix;return(0,a.default)(t).spectrum(sh(sh({containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:i||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},e),o))},r.prototype.skip=function(t){this.__skip=!0;var e=this.UndoManager;e?e.skip(t):t(),this.__skip=!1},r.prototype.data=function(e,n,r){var o="_gjs-data";if(e[o]||(e[o]={}),(0,t.isUndefined)(r))return e[o][n];e[o][n]=r},r}(l.Hn);const hh=fh;var gh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vh=function(t){function n(e){var n=t.call(this,{model:e})||this,r=e.attributes,o=r.Panels,i=r.UndoManager;return e.view=n,e.once("change:ready",(function(){o.active(),o.disableButtons(),i.clear(),setTimeout((function(){e.trigger("load",e.get("Editor")),e.clearDirtyCount()}))})),n}return gh(n,t),n.prototype.render=function(){var t=this,n=this.$el,r=this.model,o=r.attributes,i=o.Panels,s=o.Canvas,l=r.config,c=r.modules,u=l.stylePrefix,p=["".concat(u,"editor")];!l.customUI&&p.push("".concat(u,"one-bg ").concat(u,"two-color"));var d=(0,a.default)(l.el||"body ".concat(l.container));l.cssIcons&&(0,e.appendStyles)(l.cssIcons,{unique:!0,prepand:!0}),n.empty(),l.width&&d.css("width",l.width),l.height&&d.css("height",l.height),n.append(s.render()),n.append(i.render());var f=r.get("shallow").get("Canvas").render();return f.style.display="none",n.append(f),n.attr("class",p.join(" ")),d.addClass("".concat(u,"editor-cont")).empty().append(n),c.forEach((function(e){return e.postRender&&e.postRender(t)})),this},n}(l.G7);const mh=vh;var yh=function(){return yh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yh.apply(this,arguments)},bh=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},wh=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},xh=function(){function t(t,e){var o;void 0===t&&(t={}),void 0===e&&(e={}),this.html=n,this.config=yh(yh(yh({},r),t),{pStylePrefix:null!==(o=t.stylePrefix)&&void 0!==o?o:r.stylePrefix}),this.em=new hh(this.config),this.$=e.$,this.em.init(this),this.editor=this.em}return Object.defineProperty(t.prototype,"Config",{get:function(){return this.em.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"I18n",{get:function(){return this.em.I18n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Utils",{get:function(){return this.em.Utils},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Commands",{get:function(){return this.em.Commands},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Keymaps",{get:function(){return this.em.Keymaps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modal",{get:function(){return this.em.Modal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Panels",{get:function(){return this.em.Panels},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Canvas",{get:function(){return this.em.Canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Parser",{get:function(){return this.em.Parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CodeManager",{get:function(){return this.em.CodeManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UndoManager",{get:function(){return this.em.UndoManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RichTextEditor",{get:function(){return this.em.RichTextEditor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Pages",{get:function(){return this.em.Pages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Components",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DomComponents",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Layers",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LayerManager",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Css",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CssComposer",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StorageManager",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Assets",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AssetManager",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blocks",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BlockManager",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Traits",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TraitManager",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Selectors",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SelectorManager",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Styles",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StyleManager",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Devices",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DeviceManager",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"EditorModel",{get:function(){return this.em},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){return this.em.getConfig(t)},t.prototype.getHtml=function(t){return this.em.getHtml(t)},t.prototype.getCss=function(t){return this.em.getCss(t)},t.prototype.getJs=function(t){return this.em.getJs(t)},t.prototype.getComponents=function(){return this.Components.getComponents()},t.prototype.getWrapper=function(){return this.Components.getWrapper()},t.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.em.setComponents(t,e),this},t.prototype.addComponents=function(t,e){return this.getWrapper().append(t,e)},t.prototype.getStyle=function(){return this.em.Css.getAll()},t.prototype.setStyle=function(t,e){return void 0===e&&(e={}),this.em.setStyle(t,e),this},t.prototype.addStyle=function(t,e){return void 0===e&&(e={}),this.em.addStyle(t,e)},t.prototype.getSelected=function(){return this.em.getSelected()},t.prototype.getSelectedAll=function(){return this.em.getSelectedAll()},t.prototype.getSelectedToStyle=function(){var t=this.em.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},t.prototype.select=function(t,e){return this.em.setSelected(t,e),this},t.prototype.selectAdd=function(t){return this.em.addSelected(t),this},t.prototype.selectRemove=function(t){return this.em.removeSelected(t),this},t.prototype.selectToggle=function(t){return this.em.toggleSelected(t),this},t.prototype.getEditing=function(){return this.em.getEditing()},t.prototype.setDevice=function(t){return this.em.set("device",t),this},t.prototype.getDevice=function(){return this.em.get("device")},t.prototype.runCommand=function(t,e){return void 0===e&&(e={}),this.Commands.run(t,e)},t.prototype.stopCommand=function(t,e){return void 0===e&&(e={}),this.Commands.stop(t,e)},t.prototype.store=function(t){return bh(this,void 0,void 0,(function(){return wh(this,(function(e){switch(e.label){case 0:return[4,this.em.store(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.load=function(t,e){return void 0===e&&(e={}),bh(this,void 0,void 0,(function(){return wh(this,(function(n){switch(n.label){case 0:return[4,this.em.load(t,e)];case 1:return[2,n.sent()]}}))}))},t.prototype.getProjectData=function(){return this.em.storeData()},t.prototype.loadProjectData=function(t){return this.em.loadData(t)},t.prototype.storeData=function(){return this.em.storeData()},t.prototype.loadData=function(t){return this.em.loadData(t)},t.prototype.getContainer=function(){return this.config.el},t.prototype.getDirtyCount=function(){return this.em.getDirtyCount()},t.prototype.clearDirtyCount=function(){return this.em.clearDirtyCount()},t.prototype.refresh=function(t){this.em.refreshCanvas(t)},t.prototype.setCustomRte=function(t){this.RichTextEditor.customRte=t},t.prototype.setCustomParserCss=function(t){return this.Parser.getConfig().parserCss=t,this},t.prototype.setDragMode=function(t){return this.em.setDragMode(t),this},t.prototype.log=function(t,e){return void 0===e&&(e={}),this.em.log(t,e),this},t.prototype.t=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.em).t.apply(t,e)},t.prototype.on=function(t,e){return this.em.on(t,e),this},t.prototype.once=function(t,e){return this.em.once(t,e),this},t.prototype.off=function(t,e){return this.em.off(t,e),this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.em.trigger.apply(this.em,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([t],e,!0)),this},t.prototype.destroy=function(){this.em&&(this.em.destroyAll(),this.editorView=void 0)},t.prototype.getEl=function(){var t;return null===(t=this.editorView)||void 0===t?void 0:t.el},t.prototype.getModel=function(){return this.em},t.prototype.render=function(){var t;return null===(t=this.editorView)||void 0===t||t.remove(),this.editorView=new mh(this.em),this.editorView.render().el},t.prototype.onReady=function(t){this.em.get("ready")?t(this):this.em.on("load",t)},t}();const _h=xh;var Ch=function(n,r){return(0,t.isString)(n)?function(t,n){var r=n.get(t);if(!r){var o=(0,e.getGlobal)()[t];r=(null==o?void 0:o.default)||o}return r}(n,r):(null==n?void 0:n.default)||n},Sh=function(t,e){t.getModel().logWarning("Plugin ".concat(e," not found"),{context:"plugins",plugin:e})};const Oh=function(){function t(){this.plugins={}}return t.prototype.add=function(t,e){var n=this.get(t);return n||(this.plugins[t]=e,e)},t.prototype.get=function(t){return this.plugins[t]},t.prototype.getAll=function(){return this.plugins},t}();var Eh=function(){return Eh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Eh.apply(this,arguments)};!function(){if((0,e.hasWin)()&&function(){for(var t,e=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r<n.length;r++){if(t=n[r][1].exec(e))break}return!!t}()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=""),t.apply(document.implementation,[e])}}}();var kh=new Oh,Th=[],Ah=function(t,e){var n=Ch(t,kh);return function(r){n?n(r,e||{}):Sh(r,t)}},Ph={$:a.default,editors:Th,plugins:kh,usePlugin:Ah,version:"0.21.10",init:function(e){void 0===e&&(e={});var n=e.headless,r=e.container;if(!r&&!n)throw new Error("'container' is required");var o=Eh(Eh({autorender:!0,plugins:[],pluginsOpts:{}},e),{grapesjs:this,el:n?void 0:(0,t.isElement)(r)?r:document.querySelector(r)}),i=new _h(o,{$:a.default}),s=i.getModel();return o.plugins.forEach((function(t){var e=Ch(t,kh),n=o.pluginsOpts[t]||{};e?e(i,n):Sh(i,t)})),s.loadOnStart(),o.autorender&&!n&&i.render(),Th.push(i),i}};const jh=Ph})();var M=j.ZP,N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function L(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var I,D={exports:{}};
11
11
  /*! grapesjs-blocks-basic - 1.0.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,I=()=>(()=>{var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>o});var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};const o=function(t,e){void 0===e&&(e={}),function(t,e){var r=t.BlockManager,o=e.category,i=e.blocks,a=e.stylePrefix,s=e.flexGrid,l=e.rowHeight,c=e.addBasicStyle,u="".concat(a,"row"),p="".concat(a,"cell"),d=s?"\n .".concat(u," {\n display: flex;\n justify-content: flex-start;\n align-items: stretch;\n flex-wrap: nowrap;\n padding: 10px;\n }\n @media (max-width: 768px) {\n .").concat(u," {\n flex-wrap: wrap;\n }\n }"):"\n .".concat(u," {\n display: table;\n padding: 10px;\n width: 100%;\n }\n @media (max-width: 768px) {\n .").concat(a,"cell, .").concat(a,"cell30, .").concat(a,"cell70 {\n width: 100%;\n display: block;\n }\n }"),f=s?"\n .".concat(p," {\n min-height: ").concat(l,"px;\n flex-grow: 1;\n flex-basis: 100%;\n }"):"\n .".concat(p," {\n width: 8%;\n display: table-cell;\n height: ").concat(l,"px;\n }"),h="\n .".concat(a,"cell30 {\n width: 30%;\n }"),g="\n .".concat(a,"cell70 {\n width: 70%;\n }"),v={tl:0,tc:0,tr:0,cl:0,cr:0,bl:0,br:0,minDim:1},m=n(n({},v),{cr:1,bc:0,currentUnit:1,minDim:1,step:.2});s&&(m.keyWidth="flex-basis");var y={class:u,"data-gjs-droppable":".".concat(p),"data-gjs-resizable":v,"data-gjs-name":"Row"},b={class:p,"data-gjs-draggable":".".concat(u),"data-gjs-resizable":m,"data-gjs-name":"Cell"};s&&(b["data-gjs-unstylable"]=["width"],b["data-gjs-stylable-require"]=["flex-basis"]);var w=[".".concat(u),".".concat(p)];t.on("selector:add",(function(t){return w.indexOf(t.getFullName())>=0&&t.set("private",1)}));var x=function(t){var e=[];for(var n in t){var r=t[n];r=r instanceof Array||r instanceof Object?JSON.stringify(r):r,e.push("".concat(n,"=").concat("'".concat(r,"'")))}return e.length?" ".concat(e.join(" ")):""},_=function(t){return i.indexOf(t)>=0},C=x(y),S=x(b),O={category:o,select:!0};_("column1")&&r.add("column1",n(n({},O),{label:e.labelColumn1,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M2 20h20V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),_("column2")&&r.add("column2",n(n({},O),{label:e.labelColumn2,media:'<svg viewBox="0 0 23 24">\n <path fill="currentColor" d="M2 20h8V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM13 20h8V4h-8v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),_("column3")&&r.add("column3",n(n({},O),{label:e.labelColumn3,media:'<svg viewBox="0 0 23 24">\n <path fill="currentColor" d="M2 20h4V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM17 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1ZM9.5 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),_("column3-7")&&r.add("column3-7",n(n({},O),{label:e.labelColumn37,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M2 20h5V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM10 20h12V4H10v16Zm-1 0V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H10a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S," style='").concat(s?"flex-basis":"width",": 30%;'></div>\n <div ").concat(S," style='").concat(s?"flex-basis":"width",": 70%;'></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n ").concat(h,"\n ").concat(g,"\n </style>"):"")})),_("text")&&r.add("text",n(n({},O),{activate:!0,label:e.labelText,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" />\n </svg>',content:{type:"text",content:"Insert your text here",style:{padding:"10px"}}})),_("link")&&r.add("link",n(n({},O),{label:e.labelLink,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" />\n </svg>',content:{type:"link",content:"Link",style:{color:"#d983a6"}}})),_("image")&&r.add("image",n(n({},O),{activate:!0,label:e.labelImage,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M21,3H3C2,3 1,4 1,5V19A2,2 0 0,0 3,21H21C22,21 23,20 23,19V5C23,4 22,3 21,3M5,17L8.5,12.5L11,15.5L14.5,11L19,17H5Z" />\n </svg>',content:{style:{color:"black"},type:"image"}})),_("video")&&r.add("video",n(n({},O),{label:e.labelVideo,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z" />\n </svg>',content:{type:"video",src:"img/video2.webm",style:{height:"350px",width:"615px"}}})),_("map")&&r.add("map",n(n({},O),{label:e.labelMap,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M20.5,3L20.34,3.03L15,5.1L9,3L3.36,4.9C3.15,4.97 3,5.15 3,5.38V20.5A0.5,0.5 0 0,0 3.5,21L3.66,20.97L9,18.9L15,21L20.64,19.1C20.85,19.03 21,18.85 21,18.62V3.5A0.5,0.5 0 0,0 20.5,3M10,5.47L14,6.87V18.53L10,17.13V5.47M5,6.46L8,5.45V17.15L5,18.31V6.46M19,17.54L16,18.55V6.86L19,5.7V17.54Z" />\n </svg>',content:{type:"map",style:{height:"350px"}}}))}(t,r({blocks:["column1","column2","column3","column3-7","text","link","image","video","map"],flexGrid:!1,stylePrefix:"gjs-",addBasicStyle:!0,category:"Basic",labelColumn1:"1 Column",labelColumn2:"2 Columns",labelColumn3:"3 Columns",labelColumn37:"2 Columns 3/7",labelText:"Text",labelLink:"Link",labelImage:"Image",labelVideo:"Video",labelMap:"Map",rowHeight:75},e))};return e})(),D.exports=I();var F,V={exports:{}};
12
- /*! grapesjs-tui-image-editor - 1.0.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,F=()=>(()=>{var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>o});var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const o=function(t,e){void 0===e&&(e={});var o=n({config:{},constructor:"",labelImageEditor:"Image Editor",labelApply:"Apply",height:"650px",width:"100%",commandId:"tui-image-editor",toolbarIcon:'<svg viewBox="0 0 24 24">\n <path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z">\n </path>\n </svg>',hideHeader:!0,addToAssets:!0,upload:!1,onApplyButton:function(){},onApply:null,script:["https://uicdn.toast.com/tui.code-snippet/v1.5.2/tui-code-snippet.min.js","https://uicdn.toast.com/tui-color-picker/v2.2.7/tui-color-picker.min.js","https://uicdn.toast.com/tui-image-editor/v3.15.2/tui-image-editor.min.js"],style:["https://uicdn.toast.com/tui-color-picker/v2.2.7/tui-color-picker.min.css","https://uicdn.toast.com/tui-image-editor/v3.15.2/tui-image-editor.min.css"]},e),i=o.script,a=o.style,s=o.height,l=o.width,c=o.hideHeader,u=o.onApply,p=o.upload,d=o.addToAssets,f=o.commandId,h="undefined"!=typeof window,g=function(){var t;return o.constructor||h&&(null===(t=window.tui)||void 0===t?void 0:t.ImageEditor)},v=g();if(!v&&(null==i?void 0:i.length)&&h){var m=document.head,y=Array.isArray(i)?r([],i,!0):[i],b=Array.isArray(a)?r([],a,!0):[a],w=function(t){if(t.length){var e=document.createElement("link");e.href=t.shift(),e.rel="stylesheet",m.appendChild(e),w(t)}},x=function(t){if(t.length){var e=document.createElement("script");e.src=t.shift(),e.onerror=e.onload=x.bind(null,t),m.appendChild(e)}else v=g()};w(b),x(y)}o.toolbarIcon&&t.Components.addType("image",{extendFn:["initToolbar"],model:{initToolbar:function(){var t=this.get("toolbar");(null==t?void 0:t.some((function(t){return t.command===f})))||(null==t||t.unshift({command:f,label:o.toolbarIcon}),this.set("toolbar",t))}}});var _={level:"error",ns:f};t.Commands.add(f,{imageEditor:null,run:function(t,e,n){var r=this;if(void 0===n&&(n={}),!v)return t.log("TOAST UI Image editor not found",_),t.stopCommand(f);var i=n.target||t.getSelected();if(!i)return t.log("Target not available",_),t.stopCommand(f);var a=this.createContent(),s=o.labelImageEditor,l=a.children[1];t.Modal.open({title:s,content:a}).onceClose((function(){return t.stopCommand(f)}));var c=this.getEditorConfig(i.get("src"));this.imageEditor=new v(a.children[0],c),t.getModel().setEditing(!0),l.onclick=function(){return r.applyChanges(i)},o.onApplyButton(l)},stop:function(t){var e;null===(e=this.imageEditor)||void 0===e||e.destroy(),t.getModel().setEditing(!1)},getEditorConfig:function(t){var e=n({},o.config);return e.includeUI||(e.includeUI={}),e.includeUI=n(n({theme:{}},e.includeUI),{loadImage:{path:t,name:"1"},uiSize:{height:s,width:l}}),c&&(e.includeUI.theme["header.display"]="none"),e},createContent:function(){var t=document.createElement("div");return t.style.position="relative",t.innerHTML='\n <div></div>\n <button class="tui-image-editor__apply-btn" style="\n position: absolute;\n top: 0; right: 0;\n margin: 10px;\n background-color: #fff;\n font-size: 1rem;\n border-radius: 3px;\n border: none;\n padding: 10px 20px;\n cursor: pointer\n ">\n '.concat(o.labelApply,"\n </botton>\n "),t},applyChanges:function(t){var e=this,n=this.imageEditor;u?u(n,t):"CROPPER"===n.getDrawingMode()?n.crop(n.getCropzoneRect()).then((function(){e.uploadImage(n,t)})):this.uploadImage(n,t)},uploadImage:function(e,n){var r=this,o=t.Assets,i=e.toDataURL();if(p){var a=this.dataUrlToBlob(i);o.FileUploader().uploadFile({dataTransfer:{files:[a]}},(function(t){var e=t&&t.data&&t.data[0],o=e&&("string"==typeof e?e:e.src);o&&r.applyToTarget(o,n)}))}else d&&o.add({src:i,name:(n.get("src")||"").split("/").pop()}),this.applyToTarget(i,n)},applyToTarget:function(e,n){n.set("src",e),t.Modal.close()},dataUrlToBlob:function(t){for(var e=t.split(","),n=window.atob(e[1]),r=e[0].split(":")[1].split(";")[0],o=new ArrayBuffer(n.length),i=new Uint8Array(o),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([o],{type:r})}})};return e})();var B=R(V.exports=F()),z={appendTo:"#styles-container",custom:!0,sectors:[]},H={appendTo:"#styles-container",componentFirst:!0},$={defaults:[{id:"basic-actions",el:".panel__basic-actions",buttons:[{id:"visibility",active:!0,className:"btn-toggle-borders",label:'<i class="fa fa-clone"></i>',command:"sw-visibility"}]},{id:"editor-actions",el:".panel__editor",buttons:[{id:"saveDb",className:"fa fa-paper-plane btn-save",command:"saveDb"},{id:"cmd-clear",className:"fa fa-trash",command:"cmd-clear"},{id:"undo",className:"fa fa-undo",command:"undo"},{id:"redo",className:"fa fa-repeat",command:"redo"},{id:"export",className:"fa fa-download",command:"export"},{id:"preview",className:"fa fa-eye",command:"preview"}]},{id:"panel-devices",el:".panel__devices",buttons:[{id:"device-desktop",label:'<i class="fa fa-television"></i>',command:"set-device-desktop",active:!0,togglable:!1},{id:"device-mobile",label:'<i class="fa fa-mobile"></i>',command:"set-device-mobile",togglable:!1}]}]},W=["https://code.jquery.com/jquery-3.5.1.slim.min.js"],U=[],q="removeTopPadding",G="removeBottomPadding",K="50%",Y={label:'<div title=\'image-editor\'><svg viewBox="0 0 24 24">\n <path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z">\n </path>\n </svg></div>',command:"image-editor"},X=[{label:'<div title="move"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"></path></svg></div>',command:"tlb-move"},{label:'<div title="clone"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg></div>',command:"tlb-clone"},{label:'<div title="delete"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"></path></svg></div>',command:"tlb-delete"}],Z="form",J="input",Q="textarea",tt="select",et="checkbox",nt="radio",rt="button",ot="label",it="option";var at=function(t){var e=t.editor,r=t.opts,o=void 0===r?{}:r;n((function(){var t=b({blocks:["Subscribe"],category:"basic",block:function(){return{}}},o);!function(t){var e,n,r=t.Components,o={name:"name"},i={type:"checkbox",name:"required"},a=function(t,e){return{type:it,content:e,attributes:{value:t}}},s=function(e){t.Commands.isActive("preview")||e.preventDefault()};r.addType(Z,{isComponent:function(t){return"FORM"==t.tagName},model:{defaults:{tagName:"form",droppable:":not(form)",draggable:":not(form)",attributes:{method:"get"},traits:[{type:"select",name:"method",options:[{value:"get",name:"GET"},{value:"post",name:"POST"}]},{name:"action"}]}},view:{events:{submit:function(t){return t.preventDefault()}}}}),r.addType("subscribe_form",{isComponent:function(t){return"FORM"==t.tagName},extend:Z,model:{defaults:{toolbar:X,"script-export":function(t){var e=window.$,n=e(this),r=new URLSearchParams(window.location.search),o=r.get("shopName"),i=r.get("campaign_id"),a=r.get("email"),s=n.find("[name='shop_name']"),l=n.find("[name='campaign_id']"),c=n.find("[name='email_address']");null!=s&&s.val(o),null!=l&&l.val(i),null!=c&&c.val(a),n.unbind("submit"),n.submit((function(r){r.preventDefault();var o=n.serializeArray(),i=n.attr("action"),a=e.post(i,o);a.fail((function(t){alert("Request failed")})),a.done((function(r){if(r.message)alert(r.message);else{var o=n.attr("data-redirect");o!==t.success_page_url&&o?window.location=o:e("body").load(t.success_page_url)}}))}));var u=n.find("input[type=checkbox]"),p=n.find(".conf-lbl");t.include_confirmation_checkbox?(p.html(t.confirmation_text),u.attr("style","display:inline"),p.attr("style","display:inline")):(u.remove(),p.remove())},droppable:":not(button)",traits:[{tabType:"content",group:"confirmation_text_section",type:"checkbox-item",name:"include_confirmation_checkbox",label:"Include confirmation checkbox",changeProp:!0},{tabType:"content",group:"confirmation_text_section",type:"text",name:"confirmation_text",label:"Confirmation Text",changeProp:!0}],success_page_url:null===(e=t.getConfig().componentOptions)||void 0===e?void 0:e.success_page_url,confirmation_text:"I agree to add my email address in mailing list","script-props":["include_confirmation_checkbox","confirmation_text","success_page_url"]},init:function(){this.on("change:include_confirmation_checkbox",this.handleConfirmationTextSetupChange),this.on("change:confirmation_text",this.handleConfirmationTextSetupChange)},handleConfirmationTextSetupChange:function(){var t=this.view.el.querySelector("input[type='checkbox']"),e=this.view.el.querySelector(".conf-lbl");e.innerHTML=this.attributes.confirmation_text,1==this.attributes.include_confirmation_checkbox?(t.style.display="inline",e.style.display="inline"):(t.style.display="none",e.style.display="none")}},view:{events:{},onRender:function(t){t.editor,t.el,t.model;try{this.model.handleConfirmationTextSetupChange()}catch(t){}}}}),r.addType("subscribe_button",{model:{defaults:{toolbar:[],"script-export":function(t){var e=(0,window.$)(this);e.css("cursor","pointer");var n=e.parent(),r=n[0],o=new URLSearchParams(window.location.search).get("email");e.unbind("click"),e.click((function(e){e.preventDefault(),r.checkValidity()?("success_page"==t.redirect_to?n.attr("data-redirect",t.success_page_url):"url"==t.redirect_to&&n.attr("data-redirect",t.page_url),n.submit()):r.reportValidity()})),o&&e.click()},tagName:"button",attributes:{type:"button"},text:"Send",properties:["font-family","font-weight"],traits:[{name:"text",changeProp:!0,label:"Button Text",tabType:"button"},{type:"select",name:"redirect_to",label:"Button Action",changeProp:!0,options:[{value:"success_page",name:"Redirect to success page"},{value:"url",name:"Redirect to page"}],tabType:"button"},{type:"text",label:"Enter page url",name:"page_url",changeProp:!0,tabType:"button",disabled:!0}],redirect_to:"success_page",success_page_url:null===(n=t.getConfig().componentOptions)||void 0===n?void 0:n.success_page_url,"script-props":["redirect_to","page_url","success_page_url"],styles:" .subscribe-button { color: black; background: orange;border-radius: 5px; padding: 10px; margin-top: 15px;} "},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r.trim()),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange(),this.on("change:redirect_to",this.__onRedirectToChange)},__onTextChange:function(){this.components(this.get("text"))},__onRedirectToChange:function(){var t=this.get("redirect_to"),e=this.getTrait("page_url");"success_page"===t?(this.set("page_url",""),e.set("disabled",!0)):e.set("disabled",!1)}}}),r.addType(J,{isComponent:function(t){return"INPUT"==t.tagName},model:{defaults:{toolbar:[],tagName:"input",droppable:!1,highlightable:!1,attributes:{type:"text",placeholder:""},traits:[{type:"text",name:"placeholder",label:" ",tabType:"field"},{type:"checkbox-item",name:"required",label:"This field is always required",tabType:"field",tooltip:"This field is always required"}]}},extendFnView:["updateAttributes"],view:{updateAttributes:function(){this.el.setAttribute("autocomplete","off")}}}),r.addType(Q,{extend:J,isComponent:function(t){return"TEXTAREA"==t.tagName},model:{defaults:{tagName:"textarea",attributes:{},traits:[o,{name:"placeholder"},i]}}}),r.addType(it,{isComponent:function(t){return"OPTION"==t.tagName},model:{defaults:{tagName:"option",layerable:!1,droppable:!1,draggable:!1,highlightable:!1}}}),r.addType(tt,{isComponent:function(t){return"SELECT"==t.tagName},model:{defaults:{tagName:"select",droppable:!1,highlightable:!1,components:[a("opt1","Option 1"),a("opt2","Option 2")],traits:[o,{name:"options",type:"select-options"},i]}},view:{events:{mousedown:s}}}),r.addType(et,{extend:J,isComponent:function(t){return"INPUT"==t.tagName&&"checkbox"==t.type},model:{defaults:{toolbar:[],copyable:!1,attributes:{type:"checkbox"},traits:[{name:"id"},o,{name:"value"},i,{type:"checkbox",name:"checked"}]}},view:{events:{click:s},init:function(){this.listenTo(this.model,"change:attributes:checked",this.handleChecked)},handleChecked:function(){var t;this.el.checked=!(null===(t=this.model.get("attributes"))||void 0===t||!t.checked)}}}),r.addType(nt,{extend:et,isComponent:function(t){return"INPUT"==t.tagName&&"radio"==t.type},model:{defaults:{attributes:{type:"radio"}}}}),r.addType(rt,{extend:J,isComponent:function(t){return"BUTTON"==t.tagName},model:{defaults:{tagName:"button",attributes:{type:"button"},text:"Send",traits:[{name:"text",changeProp:!0},{type:"select",name:"type",options:[{value:"button"},{value:"submit"},{value:"reset"}]}],styles:"\n .subscribe-button { color: #ffffff; background: #3D98F2;border-radius: 5px; padding: 10px; font-size:14px}"},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange()},__onTextChange:function(){this.components(this.get("text"))}},view:{events:{click:s}}}),r.addType(ot,{extend:"text",isComponent:function(t){return"LABEL"==t.tagName},model:{defaults:{toolbar:[],tagName:"label",components:"Label",traits:[{name:"for"}],styles:"\n .subscribe-title {font-size:20px; font-weight: 700;}\n .subscribe-sub-title {font-size:16px;}\n "}},init:function(){}})}(e),function(t){t.TraitManager.addType("select-options",{events:{keyup:"onChange"},onValueChange:function(){for(var t,e=this.model,n=this.target,r=e.get("value").trim().split("\n"),o=[],i=0;i<r.length;i++){var a=r[i].split("::");o.push({type:it,components:a[1]||a[0],attributes:{value:a[0]}})}n.components().reset(o),null===(t=n.view)||void 0===t||t.render()},getInputEl:function(){if(!this.$input){for(var t=[],e=this.target.components(),n=0;n<e.length;n++){var r=e.models[n],o=r.get("attributes"),i=(null==o?void 0:o.value)||"",a=r.components().models[0],s=a&&a.get("content")||"";t.push("".concat(i,"::").concat(s))}var l=document.createElement("textarea");l.value=t.join("\n"),this.$input=l}return this.$input}})}(e),function(t,e){var n,r,o=e,i=t.BlockManager,a=function(t,n){var r;(null===(r=o.blocks)||void 0===r?void 0:r.indexOf(t))>=0&&i.add(t,b(b({},n),{},{category:o.category,select:!0},e.block(t)))};a(Z,{label:"Form",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 5.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 8H3V6h18v2zM22 10.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 13H3v-2h18v2z"/><rect width="10" height="3" x="2" y="15" rx=".5"/></svg>',content:{type:Z,components:[{components:[{type:ot,components:"Name"},{type:J}]},{components:[{type:ot,components:"Email"},{type:J,attributes:{type:"email"}}]},{components:[{type:ot,components:"Gender"},{type:et,attributes:{value:"M"}},{type:ot,components:"M"},{type:et,attributes:{value:"F"}},{type:ot,components:"F"}]},{components:[{type:ot,components:"Message"},{type:Q}]},{components:[{type:rt}]}]}}),a("Subscribe",{label:"Signup Form",media:'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect width="40" height="40" fill="url(#pattern0_11853_96895)"/>\n <defs>\n <pattern id="pattern0_11853_96895" patternContentUnits="objectBoundingBox" width="1" height="1">\n <use xlink:href="#image0_11853_96895" transform="scale(0.0111111)"/>\n </pattern>\n <image id="image0_11853_96895" width="90" height="90" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAACOElEQVR4nO2cTU4jMRCFvQKOMBDuYuk9S50L5BZD2E3mhMCsgKOgsMmqRxY/EiySCbhdNdXvk2rbSX8pv06XJackhBBCCCGEEEIIIVLO+QzANck/AJ5JjhELL/d2R3K9XC5Pu/70OedLko/WEti/Huq995J8NlPJ45vsLp39GhfjzOtqctE1kx3c6GhZAG57iN5a3yjta9tDtPVNjh5KoinRo3UXqqP5dQkAdgB+lVIuWi3nei0Am3ptRQffRW+myst6bYnmi+hhGM6nEp1z/uFOdNQlTIeiQy5hehMddQnTm+iWkfEZAAuJ7hAdpZTfEv3xYbjRw7AR1m9knElkuRONoJHlUfQuYmS5E02jkmhK9Gjdhepo2otTdNBeqjKaEt2tsxB0POvu7x2CjmfdiR6Cjme1w0J70SGXML11dNQlTG+io44r6U101HElHYoOOa6kN9FWVYJGljvRCBpZHkXvIkaWO9E0KommRI/WXaiOpr04RQftpSqjKdFNdkbKP/zNUkc3fNHAnjGpRB+QMBwxVt03JpXoxg8TfiOCZv1mmBp9btSdHXeih6A7O+5EF41J///oKBHGpKnR52pMekB0OWLJ79vpsKo0Na2+KI5Y8vuWsEQ32BkpegW37yiqo+0lUBnNMJWmRsexsT5fnnqI1gGD6HPA4Np62dK4APycXHQ9ALUehDpjyfer1eokdTzW+GGOkgEsUk9eO/uq5lXwB+QWwE2Ni26dLIQQQgghhBBCCJF88xd05bQqPZH3SQAAAABJRU5ErkJggg=="/>\n </defs>\n </svg>\n ',content:{type:"subscribe_form",attributes:{class:"subscribe-form",method:(null===(n=t.getConfig().componentOptions)||void 0===n?void 0:n.subscribe_form_method)||"get",action:(null===(r=t.getConfig().componentOptions)||void 0===r?void 0:r.subscribe_form_action)||"/"},components:[{type:J,attributes:{name:"shop_name",type:"hidden"}},{type:J,attributes:{name:"campaign_id",type:"hidden"}},{type:J,selectable:!1,label:"Name",attributes:{name:"name",placeholder:"Enter your name",class:"subscribe-input",label:"Name",jj:"jj"}},{type:J,selectable:!1,label:"Email",removable:!1,editrequired:!0,attributes:{name:"email_address",type:"email",placeholder:"Enter your email",label:"Email",class:"subscribe-input",required:"true"}},{type:"default",selectable:!1,components:[{type:et,selectable:!1,attributes:{id:"conf_txt_chk",name:"agree",required:"true",class:"confirmation-checkbox"}},{type:ot,editable:!1,selectable:!1,label:"Subscribe To Email",attributes:{id:"conf_txt_lbl",for:"conf_txt_chk",labelText:"Subscribe To Email",class:"conf-lbl",required:"true"}}]},{type:"subscribe_button",text:"Subscribe",badgable:!1,copyable:!1,draggable:!1,removable:!1,attributes:{type:"submit",class:"subscribe-button"}}],styles:"\n .subscribe-form { background-color: #fff; padding: 10px; text-align: center; min-width: 270px; width: 100%; }\n .subscribe-input { min-width: 250px; width:100%; font-size: 16px;border-radius: 6px; border: 1px solid rgb(235, 235, 235);padding: 10px; margin: 10px 0px; }\n .confirmation-checkbox { height: 11px; }\n .conf-lbl { margin-left: 8px; color: #000; }\n @media (max-width: 320px) {\n .subscribe-form {\n padding-right: 0px !important;\n padding-left: 0px !important;\n }\n }\n "}}),a(J,{label:"Input",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 10h1v4H4z"/></svg>',content:{type:J}}),a(Q,{label:"Textarea",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 7.5c0-.9-.5-1.5-1.3-1.5H3.4C2.5 6 2 6.6 2 7.5v9c0 .9.5 1.5 1.3 1.5h17.4c.8 0 1.3-.6 1.3-1.5v-9zM21 17H3V7h18v10z"/><path d="M4 8h1v4H4zM19 7h1v10h-1zM20 8h1v1h-1zM20 15h1v1h-1z"/></svg>',content:{type:Q}}),a(tt,{label:"Select",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M18.5 13l1.5-2h-3zM4 11.5h11v1H4z"/></svg>',content:{type:tt}}),a(rt,{label:"Button",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 11.5h16v1H4z"/></svg>',content:{type:rt}}),a(ot,{label:"Label",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 11.9c0-.6-.5-.9-1.3-.9H3.4c-.8 0-1.3.3-1.3.9V17c0 .5.5.9 1.3.9h17.4c.8 0 1.3-.4 1.3-.9V12zM21 17H3v-5h18v5z"/><rect width="14" height="5" x="2" y="5" rx=".5"/><path d="M4 13h1v3H4z"/></svg>',content:{type:ot}}),a(et,{label:"Checkbox",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 17l-5-5 1.41-1.42L10 14.17l7.59-7.59L19 8m0-5H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2z"></path></svg>',content:{type:et}}),a(nt,{label:"Radio",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-18C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 5c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5z"></path></svg>',content:{type:nt}})}(e,t)}),[e])},st=function(t){t.Components.addType("body",{model:{defaults:{traits:[]}}}),t.Components.addType("custom-button",{model:{defaults:{"script-export":function(t){var e=(0,window.$)(this);e.css("cursor","pointer"),e.unbind("click"),e.click((function(t){var e,n;t.preventDefault();var r=(null===(e=t.target)||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.href)||void 0===e?void 0:e.value)||"",o=null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n?void 0:n.blankPage;r&&(o?window.open(r,"_blank"):window.location=r)}))},text:"Custom Button",toolbar:X,traits:[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button"},{type:"text",name:"href",label:"Link",placeholder:"Enter URL",tabType:"button"},{type:"checkbox-item",name:"blankPage",label:"Open link on a new tab",tabType:"button"}]},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r.trim()),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange()},__onTextChange:function(){this.components(this.get("text"))}}}),t.Components.addType("image",{model:{defaults:{toolbar:[Y].concat(O(X)),traits:[{type:"src",name:"image-src",label:"Attach link",changeProp:!0,removePadding:q}]}}}),t.Components.addType("video",{model:{defaults:{toolbar:X,provider:"yt"}}}),t.Components.addType("link",{model:{defaults:{toolbar:X,traits:[{type:"select",label:"Href",name:"href",options:[{value:"/index.html",name:"Home"},{value:"/index2.html",name:"Home2"},{value:"/index3.html",name:"Home3"},{value:"/index4.html",name:"Home4"}]}]}}}),t.Components.addType("text",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("divider",{model:{defaults:{toolbar:X,droppable:!1,traits:[]}}}),t.Components.addType("two-column",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("three-column",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("custom-shopLogo",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("default",{model:{defaults:{traits:[]}}})},lt=function(t){var e=t.editor;return e.getSelected()&&e.getSelected().getStyle()};var ct=function(t,e,n){var r=M.init(b({storageManager:!1,container:"#editor",blockManager:{appendTo:"#blocks"},selectorManager:H,panels:$,canvas:{styles:U,scripts:W},plugins:[st,B],pluginsOpts:x({gjsBlockBasic:{}},B,{config:{includeUI:{menu:["crop","flip","rotate","draw","shape","icon","text","mask","filter"]}},toolbarIcon:"",addToAssets:!0,onApply:function(t,e){return i(t,e,n)}}),styleManager:z,traitManager:{custom:!0}},t));null!=e&&e.customRemoteConfig&&r.Storage.add("remote",e.customRemoteConfig),null==r||r.Commands.add("image-editor",{run:function(t,e){var n,r,o=null==t?void 0:t.getSelected();o&&"image"===(null===(n=o.attributes)||void 0===n?void 0:n.type)&&(o.attributes=b(b({},o.attributes),{},{src:(null==o||null===(r=o.attributes)||void 0===r||null===(r=r.attributes)||void 0===r?void 0:r.src.split("?")[0])+"?nocache="+(new Date).getTime()}),t.runCommand("tui-image-editor"))}});var o=function(t,e){null!=r&&r.getSelected().is("image")&&(r.getSelected().set({src:t,width:"30%"}),r.Modal.close(),r.getSelected()&&r.select(null));e()},i=function(t,e,n){var r=function(t){for(var e=t.match(/data:([^;]+);base64/)[1].split("/")[1],n=atob(t.split(",")[1]),r=t.split(",")[0].split(":")[1].split(";")[0],o=new ArrayBuffer(n.length),i=new Uint8Array(o),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);var s=new Blob([o],{type:r});return new File([s],e,{type:r,lastModified:Date.now()})}(t.toDataURL());n&&n(r,o)};return r};var ut={black:"#000",white:"#fff"};var pt={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};var dt={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};var ft={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};var ht={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};var gt={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var vt={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var mt={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function yt(t){let e="https://mui.com/production-error/?code="+t;for(let t=1;t<arguments.length;t+=1)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified MUI error #"+t+"; visit "+e+" for the full message."}var bt=Object.freeze({__proto__:null,default:yt}),wt="$$material";function xt(){return xt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xt.apply(this,arguments)}function _t(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}function Ct(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}var St=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ot=Ct((function(t){return St.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));var Et=function(){function t(t){var e=this;this._insertTag=function(t){var n;n=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,n),e.tags.push(t)},this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if("production"!==process.env.NODE_ENV){var n=64===t.charCodeAt(0)&&105===t.charCodeAt(1);n&&this._alreadyInsertedOrderInsensitiveRule&&console.error("You're attempting to insert the following rule:\n"+t+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!n}if(this.isSpeedy){var r=function(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}(e);try{r.insertRule(t,r.cssRules.length)}catch(e){"production"===process.env.NODE_ENV||/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(t)||console.error('There was a problem inserting the following rule: "'+t+'"',e)}}else e.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach((function(t){return t.parentNode&&t.parentNode.removeChild(t)})),this.tags=[],this.ctr=0,"production"!==process.env.NODE_ENV&&(this._alreadyInsertedOrderInsensitiveRule=!1)},t}(),kt="-ms-",Tt="-moz-",At="-webkit-",Pt="comm",jt="rule",Mt="decl",Nt="@import",Rt="@keyframes",Lt="@layer",It=Math.abs,Dt=String.fromCharCode,Ft=Object.assign;function Vt(t,e){return 45^Wt(t,0)?(((e<<2^Wt(t,0))<<2^Wt(t,1))<<2^Wt(t,2))<<2^Wt(t,3):0}function Bt(t){return t.trim()}function zt(t,e){return(t=e.exec(t))?t[0]:t}function Ht(t,e,n){return t.replace(e,n)}function $t(t,e,n){return t.indexOf(e,n)}function Wt(t,e){return 0|t.charCodeAt(e)}function Ut(t,e,n){return t.slice(e,n)}function qt(t){return t.length}function Gt(t){return t.length}function Kt(t,e){return e.push(t),t}function Yt(t,e){return t.map(e).join("")}function Xt(t,e){return t.filter((function(t){return!zt(t,e)}))}var Zt=1,Jt=1,Qt=0,te=0,ee=0,ne="";function re(t,e,n,r,o,i,a,s){return{value:t,root:e,parent:n,type:r,props:o,children:i,line:Zt,column:Jt,length:a,return:"",siblings:s}}function oe(t,e){return Ft(re("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function ie(t){for(;t.root;)t=oe(t.root,{children:[t]});Kt(t,t.siblings)}function ae(){return ee=te>0?Wt(ne,--te):0,Jt--,10===ee&&(Jt=1,Zt--),ee}function se(){return ee=te<Qt?Wt(ne,te++):0,Jt++,10===ee&&(Jt=1,Zt++),ee}function le(){return Wt(ne,te)}function ce(){return te}function ue(t,e){return Ut(ne,t,e)}function pe(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function de(t){return Zt=Jt=1,Qt=qt(ne=t),te=0,[]}function fe(t){return ne="",t}function he(t){return Bt(ue(te-1,me(91===t?t+2:40===t?t+1:t)))}function ge(t){for(;(ee=le())&&ee<33;)se();return pe(t)>2||pe(ee)>3?"":" "}function ve(t,e){for(;--e&&se()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return ue(t,ce()+(e<6&&32==le()&&32==se()))}function me(t){for(;se();)switch(ee){case t:return te;case 34:case 39:34!==t&&39!==t&&me(ee);break;case 40:41===t&&me(t);break;case 92:se()}return te}function ye(t,e){for(;se()&&t+ee!==57&&(t+ee!==84||47!==le()););return"/*"+ue(e,te-1)+"*"+Dt(47===t?t:se())}function be(t){for(;!pe(le());)se();return ue(t,te)}function we(t){return fe(xe("",null,null,null,[""],t=de(t),0,[0],t))}function xe(t,e,n,r,o,i,a,s,l){for(var c=0,u=0,p=a,d=0,f=0,h=0,g=1,v=1,m=1,y=0,b="",w=o,x=i,_=r,C=b;v;)switch(h=y,y=se()){case 40:if(108!=h&&58==Wt(C,p-1)){-1!=$t(C+=Ht(he(y),"&","&\f"),"&\f",It(c?s[c-1]:0))&&(m=-1);break}case 34:case 39:case 91:C+=he(y);break;case 9:case 10:case 13:case 32:C+=ge(h);break;case 92:C+=ve(ce()-1,7);continue;case 47:switch(le()){case 42:case 47:Kt(Ce(ye(se(),ce()),e,n,l),l);break;default:C+="/"}break;case 123*g:s[c++]=qt(C)*m;case 125*g:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+u:-1==m&&(C=Ht(C,/\f/g,"")),f>0&&qt(C)-p&&Kt(f>32?Se(C+";",r,n,p-1,l):Se(Ht(C," ","")+";",r,n,p-2,l),l);break;case 59:C+=";";default:if(Kt(_=_e(C,e,n,c,u,o,s,b,w=[],x=[],p,i),i),123===y)if(0===u)xe(C,e,_,_,w,i,p,s,x);else switch(99===d&&110===Wt(C,3)?100:d){case 100:case 108:case 109:case 115:xe(t,_,_,r&&Kt(_e(t,_,_,0,0,o,s,b,o,w=[],p,x),x),o,x,p,s,r?w:x);break;default:xe(C,_,_,_,[""],x,0,s,x)}}c=u=f=0,g=m=1,b=C="",p=a;break;case 58:p=1+qt(C),f=h;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==ae())continue;switch(C+=Dt(y),y*g){case 38:m=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(qt(C)-1)*m,m=1;break;case 64:45===le()&&(C+=he(se())),d=le(),u=p=qt(b=C+=be(ce())),y++;break;case 45:45===h&&2==qt(C)&&(g=0)}}return i}function _e(t,e,n,r,o,i,a,s,l,c,u,p){for(var d=o-1,f=0===o?i:[""],h=Gt(f),g=0,v=0,m=0;g<r;++g)for(var y=0,b=Ut(t,d+1,d=It(v=a[g])),w=t;y<h;++y)(w=Bt(v>0?f[y]+" "+b:Ht(b,/&\f/g,f[y])))&&(l[m++]=w);return re(t,e,n,0===o?jt:s,l,c,u,p)}function Ce(t,e,n,r){return re(t,e,n,Pt,Dt(ee),Ut(t,2,-2),0,r)}function Se(t,e,n,r,o){return re(t,e,n,Mt,Ut(t,0,r),Ut(t,r+1,-1),r,o)}function Oe(t,e,n){switch(Vt(t,e)){case 5103:return At+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return At+t+t;case 4789:return Tt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return At+t+Tt+t+kt+t+t;case 5936:switch(Wt(t,e+11)){case 114:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return At+t+kt+t+t;case 6165:return At+t+kt+"flex-"+t+t;case 5187:return At+t+Ht(t,/(\w+).+(:[^]+)/,At+"box-$1$2"+kt+"flex-$1$2")+t;case 5443:return At+t+kt+"flex-item-"+Ht(t,/flex-|-self/g,"")+(zt(t,/flex-|baseline/)?"":kt+"grid-row-"+Ht(t,/flex-|-self/g,""))+t;case 4675:return At+t+kt+"flex-line-pack"+Ht(t,/align-content|flex-|-self/g,"")+t;case 5548:return At+t+kt+Ht(t,"shrink","negative")+t;case 5292:return At+t+kt+Ht(t,"basis","preferred-size")+t;case 6060:return At+"box-"+Ht(t,"-grow","")+At+t+kt+Ht(t,"grow","positive")+t;case 4554:return At+Ht(t,/([^-])(transform)/g,"$1"+At+"$2")+t;case 6187:return Ht(Ht(Ht(t,/(zoom-|grab)/,At+"$1"),/(image-set)/,At+"$1"),t,"")+t;case 5495:case 3959:return Ht(t,/(image-set\([^]*)/,At+"$1$`$1");case 4968:return Ht(Ht(t,/(.+:)(flex-)?(.*)/,At+"box-pack:$3"+kt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+At+t+t;case 4200:if(!zt(t,/flex-|baseline/))return kt+"grid-column-align"+Ut(t,e)+t;break;case 2592:case 3360:return kt+Ht(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,zt(t.props,/grid-\w+-end/)}))?~$t(t+(n=n[e].value),"span",0)?t:kt+Ht(t,"-start","")+t+kt+"grid-row-span:"+(~$t(n,"span",0)?zt(n,/\d+/):+zt(n,/\d+/)-+zt(t,/\d+/))+";":kt+Ht(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return zt(t.props,/grid-\w+-start/)}))?t:kt+Ht(Ht(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ht(t,/(.+)-inline(.+)/,At+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qt(t)-1-e>6)switch(Wt(t,e+1)){case 109:if(45!==Wt(t,e+4))break;case 102:return Ht(t,/(.+:)(.+)-([^]+)/,"$1"+At+"$2-$3$1"+Tt+(108==Wt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~$t(t,"stretch",0)?Oe(Ht(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Ht(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,r,o,i,a,s){return kt+n+":"+r+s+(o?kt+n+"-span:"+(i?a:+a-+r)+s:"")+t}));case 4949:if(121===Wt(t,e+6))return Ht(t,":",":"+At)+t;break;case 6444:switch(Wt(t,45===Wt(t,14)?18:11)){case 120:return Ht(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+At+(45===Wt(t,14)?"inline-":"")+"box$3$1"+At+"$2$3$1"+kt+"$2box$3")+t;case 100:return Ht(t,":",":"+kt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ht(t,"scroll-","scroll-snap-")+t}return t}function Ee(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function ke(t,e,n,r){switch(t.type){case Lt:if(t.children.length)break;case Nt:case Mt:return t.return=t.return||t.value;case Pt:return"";case Rt:return t.return=t.value+"{"+Ee(t.children,r)+"}";case jt:if(!qt(t.value=t.props.join(",")))return""}return qt(n=Ee(t.children,r))?t.return=t.value+"{"+n+"}":""}function Te(t){var e=Gt(t);return function(n,r,o,i){for(var a="",s=0;s<e;s++)a+=t[s](n,r,o,i)||"";return a}}function Ae(t){return function(e){e.root||(e=e.return)&&t(e)}}function Pe(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case Mt:return void(t.return=Oe(t.value,t.length,n));case Rt:return Ee([oe(t,{value:Ht(t.value,"@","@"+At)})],r);case jt:if(t.length)return Yt(n=t.props,(function(e){switch(zt(e,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ie(oe(t,{props:[Ht(e,/:(read-\w+)/,":"+Tt+"$1")]})),ie(oe(t,{props:[e]})),Ft(t,{props:Xt(n,r)});break;case"::placeholder":ie(oe(t,{props:[Ht(e,/:(plac\w+)/,":"+At+"input-$1")]})),ie(oe(t,{props:[Ht(e,/:(plac\w+)/,":"+Tt+"$1")]})),ie(oe(t,{props:[Ht(e,/:(plac\w+)/,kt+"input-$1")]})),ie(oe(t,{props:[e]})),Ft(t,{props:Xt(n,r)})}return""}))}}var je=function(t,e,n){for(var r=0,o=0;r=o,o=le(),38===r&&12===o&&(e[n]=1),!pe(o);)se();return ue(t,te)},Me=function(t,e){return fe(function(t,e){var n=-1,r=44;do{switch(pe(r)){case 0:38===r&&12===le()&&(e[n]=1),t[n]+=je(te-1,e,n);break;case 2:t[n]+=he(r);break;case 4:if(44===r){t[++n]=58===le()?"&\f":"",e[n]=t[n].length;break}default:t[n]+=Dt(r)}}while(r=se());return t}(de(t),e))},Ne=new WeakMap,Re=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,n=t.parent,r=t.column===n.column&&t.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||Ne.get(n))&&!r){Ne.set(t,!0);for(var o=[],i=Me(e,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)t.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Le=function(t){if("decl"===t.type){var e=t.value;108===e.charCodeAt(0)&&98===e.charCodeAt(2)&&(t.return="",t.value="")}},Ie=function(t){return"comm"===t.type&&t.children.indexOf("emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason")>-1},De=function(t){return 105===t.type.charCodeAt(1)&&64===t.type.charCodeAt(0)},Fe=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},Ve=function(t,e,n){De(t)&&(t.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Fe(t)):function(t,e){for(var n=t-1;n>=0;n--)if(!De(e[n]))return!0;return!1}(e,n)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Fe(t)))};function Be(t,e){switch(Vt(t,e)){case 5103:return At+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return At+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return At+t+Tt+t+kt+t+t;case 6828:case 4268:return At+t+kt+t+t;case 6165:return At+t+kt+"flex-"+t+t;case 5187:return At+t+Ht(t,/(\w+).+(:[^]+)/,At+"box-$1$2"+kt+"flex-$1$2")+t;case 5443:return At+t+kt+"flex-item-"+Ht(t,/flex-|-self/,"")+t;case 4675:return At+t+kt+"flex-line-pack"+Ht(t,/align-content|flex-|-self/,"")+t;case 5548:return At+t+kt+Ht(t,"shrink","negative")+t;case 5292:return At+t+kt+Ht(t,"basis","preferred-size")+t;case 6060:return At+"box-"+Ht(t,"-grow","")+At+t+kt+Ht(t,"grow","positive")+t;case 4554:return At+Ht(t,/([^-])(transform)/g,"$1"+At+"$2")+t;case 6187:return Ht(Ht(Ht(t,/(zoom-|grab)/,At+"$1"),/(image-set)/,At+"$1"),t,"")+t;case 5495:case 3959:return Ht(t,/(image-set\([^]*)/,At+"$1$`$1");case 4968:return Ht(Ht(t,/(.+:)(flex-)?(.*)/,At+"box-pack:$3"+kt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+At+t+t;case 4095:case 3583:case 4068:case 2532:return Ht(t,/(.+)-inline(.+)/,At+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qt(t)-1-e>6)switch(Wt(t,e+1)){case 109:if(45!==Wt(t,e+4))break;case 102:return Ht(t,/(.+:)(.+)-([^]+)/,"$1"+At+"$2-$3$1"+Tt+(108==Wt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~$t(t,"stretch")?Be(Ht(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==Wt(t,e+1))break;case 6444:switch(Wt(t,qt(t)-3-(~$t(t,"!important")&&10))){case 107:return Ht(t,":",":"+At)+t;case 101:return Ht(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+At+(45===Wt(t,14)?"inline-":"")+"box$3$1"+At+"$2$3$1"+kt+"$2box$3")+t}break;case 5936:switch(Wt(t,e+11)){case 114:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return At+t+kt+t+t}return t}var ze,He="undefined"!=typeof document,$e=He?void 0:function(t){var e=new WeakMap;return function(n){if(e.has(n))return e.get(n);var r=t(n);return e.set(n,r),r}}((function(){return Ct((function(){var t={};return function(e){return t[e]}}))})),We=[function(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case Mt:t.return=Be(t.value,t.length);break;case Rt:return Ee([oe(t,{value:Ht(t.value,"@","@"+At)})],r);case jt:if(t.length)return Yt(t.props,(function(e){switch(zt(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ee([oe(t,{props:[Ht(e,/:(read-\w+)/,":"+Tt+"$1")]})],r);case"::placeholder":return Ee([oe(t,{props:[Ht(e,/:(plac\w+)/,":"+At+"input-$1")]}),oe(t,{props:[Ht(e,/:(plac\w+)/,":"+Tt+"$1")]}),oe(t,{props:[Ht(e,/:(plac\w+)/,kt+"input-$1")]})],r)}return""}))}}],Ue=function(t){var e=t.key;if("production"!==process.env.NODE_ENV&&!e)throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");if(He&&"css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var r=t.stylisPlugins||We;if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(e))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+e+'" was passed');var o,i,a={},s=[];He&&(o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;n<e.length;n++)a[e[n]]=!0;s.push(t)})));var l=[Re,Le];if("production"!==process.env.NODE_ENV&&l.push(function(t){return function(e,n,r){if("rule"===e.type&&!t.compat){var o=e.value.match(/(:first|:nth|:nth-last)-child/g);if(o){for(var i=e.parent?e.parent.children:r,a=i.length-1;a>=0;a--){var s=i[a];if(s.line<e.line)break;if(s.column<e.column){if(Ie(s))return;break}}o.forEach((function(t){console.error('The pseudo class "'+t+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+t.split("-child")[0]+'-of-type".')}))}}}}({get compat(){return v.compat}}),Ve),He){var c,u=[ke,"production"!==process.env.NODE_ENV?function(t){t.root||(t.return?c.insert(t.return):t.value&&t.type!==Pt&&c.insert(t.value+"{}"))}:Ae((function(t){c.insert(t)}))],p=Te(l.concat(r,u));i=function(t,e,n,r){c=n,"production"!==process.env.NODE_ENV&&void 0!==e.map&&(c={insert:function(t){n.insert(t+e.map)}}),function(t){Ee(we(t),p)}(t?t+"{"+e.styles+"}":e.styles),r&&(v.inserted[e.name]=!0)}}else{var d=[ke],f=Te(l.concat(r,d)),h=$e(r)(e),g=function(t,e){var n=e.name;return void 0===h[n]&&(h[n]=function(t){return Ee(we(t),f)}(t?t+"{"+e.styles+"}":e.styles)),h[n]};i=function(t,e,n,r){var o=e.name,i=g(t,e);return void 0===v.compat?(r&&(v.inserted[o]=!0),"development"===process.env.NODE_ENV&&void 0!==e.map?i+e.map:i):r?void(v.inserted[o]=i):i}}var v={key:e,sheet:new Et({key:e,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:i};return v.sheet.hydrate(s),v},qe={exports:{}},Ge={};var Ke,Ye={};
12
+ /*! grapesjs-tui-image-editor - 1.0.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,F=()=>(()=>{var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>o});var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const o=function(t,e){void 0===e&&(e={});var o=n({config:{},constructor:"",labelImageEditor:"Image Editor",labelApply:"Apply",height:"650px",width:"100%",commandId:"tui-image-editor",toolbarIcon:'<svg viewBox="0 0 24 24">\n <path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z">\n </path>\n </svg>',hideHeader:!0,addToAssets:!0,upload:!1,onApplyButton:function(){},onApply:null,script:["https://uicdn.toast.com/tui.code-snippet/v1.5.2/tui-code-snippet.min.js","https://uicdn.toast.com/tui-color-picker/v2.2.7/tui-color-picker.min.js","https://uicdn.toast.com/tui-image-editor/v3.15.2/tui-image-editor.min.js"],style:["https://uicdn.toast.com/tui-color-picker/v2.2.7/tui-color-picker.min.css","https://uicdn.toast.com/tui-image-editor/v3.15.2/tui-image-editor.min.css"]},e),i=o.script,a=o.style,s=o.height,l=o.width,c=o.hideHeader,u=o.onApply,p=o.upload,d=o.addToAssets,f=o.commandId,h="undefined"!=typeof window,g=function(){var t;return o.constructor||h&&(null===(t=window.tui)||void 0===t?void 0:t.ImageEditor)},v=g();if(!v&&(null==i?void 0:i.length)&&h){var m=document.head,y=Array.isArray(i)?r([],i,!0):[i],b=Array.isArray(a)?r([],a,!0):[a],w=function(t){if(t.length){var e=document.createElement("link");e.href=t.shift(),e.rel="stylesheet",m.appendChild(e),w(t)}},x=function(t){if(t.length){var e=document.createElement("script");e.src=t.shift(),e.onerror=e.onload=x.bind(null,t),m.appendChild(e)}else v=g()};w(b),x(y)}o.toolbarIcon&&t.Components.addType("image",{extendFn:["initToolbar"],model:{initToolbar:function(){var t=this.get("toolbar");(null==t?void 0:t.some((function(t){return t.command===f})))||(null==t||t.unshift({command:f,label:o.toolbarIcon}),this.set("toolbar",t))}}});var _={level:"error",ns:f};t.Commands.add(f,{imageEditor:null,run:function(t,e,n){var r=this;if(void 0===n&&(n={}),!v)return t.log("TOAST UI Image editor not found",_),t.stopCommand(f);var i=n.target||t.getSelected();if(!i)return t.log("Target not available",_),t.stopCommand(f);var a=this.createContent(),s=o.labelImageEditor,l=a.children[1];t.Modal.open({title:s,content:a}).onceClose((function(){return t.stopCommand(f)}));var c=this.getEditorConfig(i.get("src"));this.imageEditor=new v(a.children[0],c),t.getModel().setEditing(!0),l.onclick=function(){return r.applyChanges(i)},o.onApplyButton(l)},stop:function(t){var e;null===(e=this.imageEditor)||void 0===e||e.destroy(),t.getModel().setEditing(!1)},getEditorConfig:function(t){var e=n({},o.config);return e.includeUI||(e.includeUI={}),e.includeUI=n(n({theme:{}},e.includeUI),{loadImage:{path:t,name:"1"},uiSize:{height:s,width:l}}),c&&(e.includeUI.theme["header.display"]="none"),e},createContent:function(){var t=document.createElement("div");return t.style.position="relative",t.innerHTML='\n <div></div>\n <button class="tui-image-editor__apply-btn" style="\n position: absolute;\n top: 0; right: 0;\n margin: 10px;\n background-color: #fff;\n font-size: 1rem;\n border-radius: 3px;\n border: none;\n padding: 10px 20px;\n cursor: pointer\n ">\n '.concat(o.labelApply,"\n </botton>\n "),t},applyChanges:function(t){var e=this,n=this.imageEditor;u?u(n,t):"CROPPER"===n.getDrawingMode()?n.crop(n.getCropzoneRect()).then((function(){e.uploadImage(n,t)})):this.uploadImage(n,t)},uploadImage:function(e,n){var r=this,o=t.Assets,i=e.toDataURL();if(p){var a=this.dataUrlToBlob(i);o.FileUploader().uploadFile({dataTransfer:{files:[a]}},(function(t){var e=t&&t.data&&t.data[0],o=e&&("string"==typeof e?e:e.src);o&&r.applyToTarget(o,n)}))}else d&&o.add({src:i,name:(n.get("src")||"").split("/").pop()}),this.applyToTarget(i,n)},applyToTarget:function(e,n){n.set("src",e),t.Modal.close()},dataUrlToBlob:function(t){for(var e=t.split(","),n=window.atob(e[1]),r=e[0].split(":")[1].split(";")[0],o=new ArrayBuffer(n.length),i=new Uint8Array(o),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([o],{type:r})}})};return e})();var B=R(V.exports=F()),z={appendTo:"#styles-container",custom:!0,sectors:[]},H={appendTo:"#styles-container",componentFirst:!0},$={defaults:[{id:"basic-actions",el:".panel__basic-actions",buttons:[{id:"visibility",active:!0,className:"btn-toggle-borders",label:'<i class="fa fa-clone"></i>',command:"sw-visibility"}]},{id:"editor-actions",el:".panel__editor",buttons:[{id:"saveDb",className:"fa fa-paper-plane btn-save",command:"saveDb"},{id:"cmd-clear",className:"fa fa-trash",command:"cmd-clear"},{id:"undo",className:"fa fa-undo",command:"undo"},{id:"redo",className:"fa fa-repeat",command:"redo"},{id:"export",className:"fa fa-download",command:"export"},{id:"preview",className:"fa fa-eye",command:"preview"}]},{id:"panel-devices",el:".panel__devices",buttons:[{id:"device-desktop",label:'<i class="fa fa-television"></i>',command:"set-device-desktop",active:!0,togglable:!1},{id:"device-mobile",label:'<i class="fa fa-mobile"></i>',command:"set-device-mobile",togglable:!1}]}]},W=["https://code.jquery.com/jquery-3.5.1.slim.min.js"],U=[],q="removeTopPadding",G="removeBottomPadding",K="50%",Y={label:'<div title=\'image-editor\'><svg viewBox="0 0 24 24">\n <path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z">\n </path>\n </svg></div>',command:"image-editor"},X=[{label:'<div title="move"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"></path></svg></div>',command:"tlb-move"},{label:'<div title="clone"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg></div>',command:"tlb-clone"},{label:'<div title="delete"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"></path></svg></div>',command:"tlb-delete"}],Z="form",J="input",Q="textarea",tt="select",et="checkbox",nt="radio",rt="button",ot="label",it="option";var at=function(t){var e=t.editor,r=t.opts,o=void 0===r?{}:r;n((function(){var t=b({blocks:["Subscribe"],category:"basic",block:function(){return{}}},o);!function(t){var e,n,r=t.Components,o={name:"name"},i={type:"checkbox",name:"required"},a=function(t,e){return{type:it,content:e,attributes:{value:t}}},s=function(e){t.Commands.isActive("preview")||e.preventDefault()};r.addType(Z,{isComponent:function(t){return"FORM"==t.tagName},model:{defaults:{tagName:"form",droppable:":not(form)",draggable:":not(form)",attributes:{method:"get"},traits:[{type:"select",name:"method",options:[{value:"get",name:"GET"},{value:"post",name:"POST"}]},{name:"action"}]}},view:{events:{submit:function(t){return t.preventDefault()}}}}),r.addType("subscribe_form",{isComponent:function(t){return"FORM"==t.tagName},extend:Z,model:{defaults:{toolbar:X,"script-export":function(t){var e=window.$,n=e(this),r=new URLSearchParams(window.location.search),o=r.get("shopName"),i=r.get("campaign_id"),a=r.get("email"),s=n.find("[name='shop_name']"),l=n.find("[name='campaign_id']"),c=n.find("[name='email_address']");null!=s&&s.val(o),null!=l&&l.val(i),null!=c&&c.val(a),n.unbind("submit"),n.submit((function(r){r.preventDefault();var o=n.serializeArray(),i=n.attr("action"),a=e.post(i,o);a.fail((function(t){alert("Request failed")})),a.done((function(r){if(r.message)alert(r.message);else{var o=n.attr("data-redirect");o!==t.success_page_url&&o?window.location=o:e("body").load(t.success_page_url)}}))}));var u=n.find("input[type=checkbox]"),p=n.find(".conf-lbl");t.include_confirmation_checkbox?(p.html(t.confirmation_text),u.attr("style","display:inline"),p.attr("style","display:inline")):(u.remove(),p.remove())},droppable:":not(button)",traits:[{tabType:"content",group:"confirmation_text_section",type:"checkbox-item",name:"include_confirmation_checkbox",label:"Include confirmation checkbox",changeProp:!0},{tabType:"content",group:"confirmation_text_section",type:"text",name:"confirmation_text",label:"Confirmation Text",changeProp:!0}],success_page_url:null===(e=t.getConfig().componentOptions)||void 0===e?void 0:e.success_page_url,confirmation_text:"I agree to add my email address in mailing list","script-props":["include_confirmation_checkbox","confirmation_text","success_page_url"]},init:function(){this.on("change:include_confirmation_checkbox",this.handleConfirmationTextSetupChange),this.on("change:confirmation_text",this.handleConfirmationTextSetupChange)},handleConfirmationTextSetupChange:function(){var t=this.view.el.querySelector("input[type='checkbox']"),e=this.view.el.querySelector(".conf-lbl");e.innerHTML=this.attributes.confirmation_text,1==this.attributes.include_confirmation_checkbox?(t.style.display="inline",e.style.display="inline"):(t.style.display="none",e.style.display="none")}},view:{events:{},onRender:function(t){t.editor,t.el,t.model;try{this.model.handleConfirmationTextSetupChange()}catch(t){}}}}),r.addType("subscribe_button",{model:{defaults:{toolbar:[],"script-export":function(t){var e=(0,window.$)(this);e.css("cursor","pointer");var n=e.parent(),r=n[0],o=new URLSearchParams(window.location.search).get("email");e.unbind("click"),e.click((function(e){e.preventDefault(),r.checkValidity()?("success_page"==t.redirect_to?n.attr("data-redirect",t.success_page_url):"url"==t.redirect_to&&n.attr("data-redirect",t.page_url),n.submit()):r.reportValidity()})),o&&e.click()},tagName:"button",attributes:{type:"button"},text:"Send",properties:["font-family","font-weight"],traits:[{name:"text",changeProp:!0,label:"Button Text",tabType:"button"},{type:"select",name:"redirect_to",label:"Button Action",changeProp:!0,options:[{value:"success_page",name:"Redirect to success page"},{value:"url",name:"Redirect to page"}],tabType:"button"},{type:"text",label:"Enter page url",name:"page_url",changeProp:!0,tabType:"button",disabled:!0}],redirect_to:"success_page",success_page_url:null===(n=t.getConfig().componentOptions)||void 0===n?void 0:n.success_page_url,"script-props":["redirect_to","page_url","success_page_url"],styles:" .subscribe-button { color: black; background: orange;border-radius: 5px; padding: 10px; margin-top: 15px;} "},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r.trim()),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange(),this.on("change:redirect_to",this.__onRedirectToChange)},__onTextChange:function(){this.components(this.get("text"))},__onRedirectToChange:function(){var t=this.get("redirect_to"),e=this.getTrait("page_url");"success_page"===t?(this.set("page_url",""),e.set("disabled",!0)):e.set("disabled",!1)}}}),r.addType(J,{isComponent:function(t){return"INPUT"==t.tagName},model:{defaults:{toolbar:[],tagName:"input",droppable:!1,highlightable:!1,attributes:{type:"text",placeholder:""},traits:[{type:"text",name:"placeholder",label:" ",tabType:"field"},{type:"checkbox-item",name:"required",label:"This field is always required",tabType:"field",tooltip:"This field is always required"}]}},extendFnView:["updateAttributes"],view:{updateAttributes:function(){this.el.setAttribute("autocomplete","off")}}}),r.addType(Q,{extend:J,isComponent:function(t){return"TEXTAREA"==t.tagName},model:{defaults:{tagName:"textarea",attributes:{},traits:[o,{name:"placeholder"},i]}}}),r.addType(it,{isComponent:function(t){return"OPTION"==t.tagName},model:{defaults:{tagName:"option",layerable:!1,droppable:!1,draggable:!1,highlightable:!1}}}),r.addType(tt,{isComponent:function(t){return"SELECT"==t.tagName},model:{defaults:{tagName:"select",droppable:!1,highlightable:!1,components:[a("opt1","Option 1"),a("opt2","Option 2")],traits:[o,{name:"options",type:"select-options"},i]}},view:{events:{mousedown:s}}}),r.addType(et,{extend:J,isComponent:function(t){return"INPUT"==t.tagName&&"checkbox"==t.type},model:{defaults:{toolbar:[],copyable:!1,attributes:{type:"checkbox"},traits:[{name:"id"},o,{name:"value"},i,{type:"checkbox",name:"checked"}]}},view:{events:{click:s},init:function(){this.listenTo(this.model,"change:attributes:checked",this.handleChecked)},handleChecked:function(){var t;this.el.checked=!(null===(t=this.model.get("attributes"))||void 0===t||!t.checked)}}}),r.addType(nt,{extend:et,isComponent:function(t){return"INPUT"==t.tagName&&"radio"==t.type},model:{defaults:{attributes:{type:"radio"}}}}),r.addType(rt,{extend:J,isComponent:function(t){return"BUTTON"==t.tagName},model:{defaults:{tagName:"button",attributes:{type:"button"},text:"Send",traits:[{name:"text",changeProp:!0},{type:"select",name:"type",options:[{value:"button"},{value:"submit"},{value:"reset"}]}],styles:"\n .subscribe-button { color: #ffffff; background: #3D98F2;border-radius: 5px; padding: 10px; font-size:14px}"},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange()},__onTextChange:function(){this.components(this.get("text"))}},view:{events:{click:s}}}),r.addType(ot,{extend:"text",isComponent:function(t){return"LABEL"==t.tagName},model:{defaults:{toolbar:[],tagName:"label",components:"Label",traits:[{name:"for"}],styles:"\n .subscribe-title {font-size:20px; font-weight: 700;}\n .subscribe-sub-title {font-size:16px;}\n "}},init:function(){}})}(e),function(t){t.TraitManager.addType("select-options",{events:{keyup:"onChange"},onValueChange:function(){for(var t,e=this.model,n=this.target,r=e.get("value").trim().split("\n"),o=[],i=0;i<r.length;i++){var a=r[i].split("::");o.push({type:it,components:a[1]||a[0],attributes:{value:a[0]}})}n.components().reset(o),null===(t=n.view)||void 0===t||t.render()},getInputEl:function(){if(!this.$input){for(var t=[],e=this.target.components(),n=0;n<e.length;n++){var r=e.models[n],o=r.get("attributes"),i=(null==o?void 0:o.value)||"",a=r.components().models[0],s=a&&a.get("content")||"";t.push("".concat(i,"::").concat(s))}var l=document.createElement("textarea");l.value=t.join("\n"),this.$input=l}return this.$input}})}(e),function(t,e){var n,r,o=e,i=t.BlockManager,a=function(t,n){var r;(null===(r=o.blocks)||void 0===r?void 0:r.indexOf(t))>=0&&i.add(t,b(b({},n),{},{category:o.category,select:!0},e.block(t)))};a(Z,{label:"Form",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 5.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 8H3V6h18v2zM22 10.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 13H3v-2h18v2z"/><rect width="10" height="3" x="2" y="15" rx=".5"/></svg>',content:{type:Z,components:[{components:[{type:ot,components:"Name"},{type:J}]},{components:[{type:ot,components:"Email"},{type:J,attributes:{type:"email"}}]},{components:[{type:ot,components:"Gender"},{type:et,attributes:{value:"M"}},{type:ot,components:"M"},{type:et,attributes:{value:"F"}},{type:ot,components:"F"}]},{components:[{type:ot,components:"Message"},{type:Q}]},{components:[{type:rt}]}]}}),a("Subscribe",{label:"Signup Form",media:'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect width="40" height="40" fill="url(#pattern0_11853_96895)"/>\n <defs>\n <pattern id="pattern0_11853_96895" patternContentUnits="objectBoundingBox" width="1" height="1">\n <use xlink:href="#image0_11853_96895" transform="scale(0.0111111)"/>\n </pattern>\n <image id="image0_11853_96895" width="90" height="90" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAACOElEQVR4nO2cTU4jMRCFvQKOMBDuYuk9S50L5BZD2E3mhMCsgKOgsMmqRxY/EiySCbhdNdXvk2rbSX8pv06XJackhBBCCCGEEEIIIVLO+QzANck/AJ5JjhELL/d2R3K9XC5Pu/70OedLko/WEti/Huq995J8NlPJ45vsLp39GhfjzOtqctE1kx3c6GhZAG57iN5a3yjta9tDtPVNjh5KoinRo3UXqqP5dQkAdgB+lVIuWi3nei0Am3ptRQffRW+myst6bYnmi+hhGM6nEp1z/uFOdNQlTIeiQy5hehMddQnTm+iWkfEZAAuJ7hAdpZTfEv3xYbjRw7AR1m9knElkuRONoJHlUfQuYmS5E02jkmhK9Gjdhepo2otTdNBeqjKaEt2tsxB0POvu7x2CjmfdiR6Cjme1w0J70SGXML11dNQlTG+io44r6U101HElHYoOOa6kN9FWVYJGljvRCBpZHkXvIkaWO9E0KommRI/WXaiOpr04RQftpSqjKdFNdkbKP/zNUkc3fNHAnjGpRB+QMBwxVt03JpXoxg8TfiOCZv1mmBp9btSdHXeih6A7O+5EF41J///oKBHGpKnR52pMekB0OWLJ79vpsKo0Na2+KI5Y8vuWsEQ32BkpegW37yiqo+0lUBnNMJWmRsexsT5fnnqI1gGD6HPA4Np62dK4APycXHQ9ALUehDpjyfer1eokdTzW+GGOkgEsUk9eO/uq5lXwB+QWwE2Ni26dLIQQQgghhBBCCJF88xd05bQqPZH3SQAAAABJRU5ErkJggg=="/>\n </defs>\n </svg>\n ',content:{type:"subscribe_form",attributes:{class:"subscribe-form",method:(null===(n=t.getConfig().componentOptions)||void 0===n?void 0:n.subscribe_form_method)||"get",action:(null===(r=t.getConfig().componentOptions)||void 0===r?void 0:r.subscribe_form_action)||"/"},components:[{type:J,attributes:{name:"shop_name",type:"hidden"}},{type:J,attributes:{name:"campaign_id",type:"hidden"}},{type:J,selectable:!1,label:"Name",attributes:{name:"name",placeholder:"Enter your name",class:"subscribe-input",label:"Name",jj:"jj"}},{type:J,selectable:!1,label:"Email",removable:!1,editrequired:!0,attributes:{name:"email_address",type:"email",placeholder:"Enter your email",label:"Email",class:"subscribe-input",required:"true"}},{type:"default",selectable:!1,components:[{type:et,selectable:!1,attributes:{id:"conf_txt_chk",name:"agree",required:"true",class:"confirmation-checkbox"}},{type:ot,editable:!1,selectable:!1,label:"Subscribe To Email",attributes:{id:"conf_txt_lbl",for:"conf_txt_chk",labelText:"Subscribe To Email",class:"conf-lbl",required:"true"}}]},{type:"subscribe_button",text:"Subscribe",badgable:!1,copyable:!1,draggable:!1,removable:!1,attributes:{type:"submit",class:"subscribe-button"}}],styles:"\n .subscribe-form { background-color: #fff; padding: 10px; text-align: center; min-width: 270px; width: 100%; }\n .subscribe-input { min-width: 250px; width:100%; font-size: 16px;border-radius: 6px; border: 1px solid rgb(235, 235, 235);padding: 10px; margin: 10px 0px; }\n .confirmation-checkbox { height: 11px; }\n .conf-lbl { margin-left: 8px; color: #000; }\n @media (max-width: 320px) {\n .subscribe-form {\n padding-right: 0px !important;\n padding-left: 0px !important;\n }\n }\n "}}),a(J,{label:"Input",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 10h1v4H4z"/></svg>',content:{type:J}}),a(Q,{label:"Textarea",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 7.5c0-.9-.5-1.5-1.3-1.5H3.4C2.5 6 2 6.6 2 7.5v9c0 .9.5 1.5 1.3 1.5h17.4c.8 0 1.3-.6 1.3-1.5v-9zM21 17H3V7h18v10z"/><path d="M4 8h1v4H4zM19 7h1v10h-1zM20 8h1v1h-1zM20 15h1v1h-1z"/></svg>',content:{type:Q}}),a(tt,{label:"Select",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M18.5 13l1.5-2h-3zM4 11.5h11v1H4z"/></svg>',content:{type:tt}}),a(rt,{label:"Button",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 11.5h16v1H4z"/></svg>',content:{type:rt}}),a(ot,{label:"Label",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 11.9c0-.6-.5-.9-1.3-.9H3.4c-.8 0-1.3.3-1.3.9V17c0 .5.5.9 1.3.9h17.4c.8 0 1.3-.4 1.3-.9V12zM21 17H3v-5h18v5z"/><rect width="14" height="5" x="2" y="5" rx=".5"/><path d="M4 13h1v3H4z"/></svg>',content:{type:ot}}),a(et,{label:"Checkbox",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 17l-5-5 1.41-1.42L10 14.17l7.59-7.59L19 8m0-5H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2z"></path></svg>',content:{type:et}}),a(nt,{label:"Radio",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-18C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 5c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5z"></path></svg>',content:{type:nt}})}(e,t)}),[e])},st=function(t){t.Components.addType("body",{model:{defaults:{traits:[]}}}),t.Components.addType("custom-button",{model:{defaults:{"script-export":function(t){var e=(0,window.$)(this);e.css("cursor","pointer"),e.unbind("click"),e.click((function(t){var e,n;t.preventDefault();var r=(null===(e=t.target)||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.href)||void 0===e?void 0:e.value)||"",o=null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n?void 0:n.blankPage;r&&(o?window.open(r,"_blank"):window.location=r)}))},text:"Custom Button",toolbar:X,traits:[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button"},{type:"text",name:"href",label:"Link",placeholder:"Enter URL",tabType:"button"},{type:"checkbox-item",name:"blankPage",label:"Open link on a new tab",tabType:"button"}]},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r.trim()),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange()},__onTextChange:function(){this.components(this.get("text"))}}}),t.Components.addType("image",{model:{defaults:{toolbar:[Y].concat(O(X)),traits:[{type:"src",name:"image-src",label:"Attach link",changeProp:!0,removePadding:q}]}}}),t.Components.addType("video",{model:{defaults:{toolbar:X,provider:"yt"}}}),t.Components.addType("link",{model:{defaults:{toolbar:X,traits:[{type:"select",label:"Href",name:"href",options:[{value:"/index.html",name:"Home"},{value:"/index2.html",name:"Home2"},{value:"/index3.html",name:"Home3"},{value:"/index4.html",name:"Home4"}]}]}}}),t.Components.addType("text",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("divider",{model:{defaults:{toolbar:X,droppable:!1,traits:[]}}}),t.Components.addType("two-column",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("three-column",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("custom-shopLogo",{model:{defaults:{toolbar:X,traits:[]}}}),t.Components.addType("default",{model:{defaults:{traits:[]}}})},lt=function(t){var e=t.editor;return e.getSelected()&&e.getSelected().getStyle()};var ct=function(t,e,n){var r=M.init(b({storageManager:!1,container:"#editor",blockManager:{appendTo:"#blocks"},selectorManager:H,panels:$,canvas:{styles:U,scripts:W},plugins:[st,B],pluginsOpts:x({gjsBlockBasic:{}},B,{config:{includeUI:{menu:["crop","flip","rotate","draw","shape","icon","text","mask","filter"]}},toolbarIcon:"",addToAssets:!0,onApply:function(t,e){var r,i=t.toDataURL();t.loadImageFromURL(null==e||null===(r=e.attributes)||void 0===r?void 0:r.src,"image").then((function(t){a(i,e,n)})).catch((function(t){console.error("Failed to load image:",t),o()}))}}),styleManager:z,traitManager:{custom:!0}},t));null!=e&&e.customRemoteConfig&&r.Storage.add("remote",e.customRemoteConfig),null==r||r.Commands.add("image-editor",{run:function(t,e){var n,r,o=null==t?void 0:t.getSelected();o&&"image"===(null===(n=o.attributes)||void 0===n?void 0:n.type)&&(o.attributes=b(b({},o.attributes),{},{src:(null==o||null===(r=o.attributes)||void 0===r||null===(r=r.attributes)||void 0===r?void 0:r.src.split("?")[0])+"?nocache="+(new Date).getTime()}),t.runCommand("tui-image-editor"))}});var o=function(){r.Modal.close()},i=function(t,e){null!=r&&r.getSelected().is("image")&&(r.getSelected().set({src:t,width:"30%"}),r.Modal.close(),r.getSelected()&&r.select(null));e()},a=function(t,e,n){var r=function(t){for(var e=t.match(/data:([^;]+);base64/)[1].split("/")[1],n=atob(t.split(",")[1]),r=t.split(",")[0].split(":")[1].split(";")[0],o=new ArrayBuffer(n.length),i=new Uint8Array(o),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);var s=new Blob([o],{type:r});return new File([s],e,{type:r,lastModified:Date.now()})}(t);n&&n(r,i)};return r};var ut={black:"#000",white:"#fff"};var pt={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};var dt={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};var ft={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};var ht={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};var gt={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var vt={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};var mt={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function yt(t){let e="https://mui.com/production-error/?code="+t;for(let t=1;t<arguments.length;t+=1)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified MUI error #"+t+"; visit "+e+" for the full message."}var bt=Object.freeze({__proto__:null,default:yt}),wt="$$material";function xt(){return xt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xt.apply(this,arguments)}function _t(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}function Ct(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}var St=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ot=Ct((function(t){return St.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));var Et=function(){function t(t){var e=this;this._insertTag=function(t){var n;n=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,n),e.tags.push(t)},this.isSpeedy=void 0===t.speedy?"production"===process.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if("production"!==process.env.NODE_ENV){var n=64===t.charCodeAt(0)&&105===t.charCodeAt(1);n&&this._alreadyInsertedOrderInsensitiveRule&&console.error("You're attempting to insert the following rule:\n"+t+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!n}if(this.isSpeedy){var r=function(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}(e);try{r.insertRule(t,r.cssRules.length)}catch(e){"production"===process.env.NODE_ENV||/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(t)||console.error('There was a problem inserting the following rule: "'+t+'"',e)}}else e.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach((function(t){return t.parentNode&&t.parentNode.removeChild(t)})),this.tags=[],this.ctr=0,"production"!==process.env.NODE_ENV&&(this._alreadyInsertedOrderInsensitiveRule=!1)},t}(),kt="-ms-",Tt="-moz-",At="-webkit-",Pt="comm",jt="rule",Mt="decl",Nt="@import",Rt="@keyframes",Lt="@layer",It=Math.abs,Dt=String.fromCharCode,Ft=Object.assign;function Vt(t,e){return 45^Wt(t,0)?(((e<<2^Wt(t,0))<<2^Wt(t,1))<<2^Wt(t,2))<<2^Wt(t,3):0}function Bt(t){return t.trim()}function zt(t,e){return(t=e.exec(t))?t[0]:t}function Ht(t,e,n){return t.replace(e,n)}function $t(t,e,n){return t.indexOf(e,n)}function Wt(t,e){return 0|t.charCodeAt(e)}function Ut(t,e,n){return t.slice(e,n)}function qt(t){return t.length}function Gt(t){return t.length}function Kt(t,e){return e.push(t),t}function Yt(t,e){return t.map(e).join("")}function Xt(t,e){return t.filter((function(t){return!zt(t,e)}))}var Zt=1,Jt=1,Qt=0,te=0,ee=0,ne="";function re(t,e,n,r,o,i,a,s){return{value:t,root:e,parent:n,type:r,props:o,children:i,line:Zt,column:Jt,length:a,return:"",siblings:s}}function oe(t,e){return Ft(re("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function ie(t){for(;t.root;)t=oe(t.root,{children:[t]});Kt(t,t.siblings)}function ae(){return ee=te>0?Wt(ne,--te):0,Jt--,10===ee&&(Jt=1,Zt--),ee}function se(){return ee=te<Qt?Wt(ne,te++):0,Jt++,10===ee&&(Jt=1,Zt++),ee}function le(){return Wt(ne,te)}function ce(){return te}function ue(t,e){return Ut(ne,t,e)}function pe(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function de(t){return Zt=Jt=1,Qt=qt(ne=t),te=0,[]}function fe(t){return ne="",t}function he(t){return Bt(ue(te-1,me(91===t?t+2:40===t?t+1:t)))}function ge(t){for(;(ee=le())&&ee<33;)se();return pe(t)>2||pe(ee)>3?"":" "}function ve(t,e){for(;--e&&se()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return ue(t,ce()+(e<6&&32==le()&&32==se()))}function me(t){for(;se();)switch(ee){case t:return te;case 34:case 39:34!==t&&39!==t&&me(ee);break;case 40:41===t&&me(t);break;case 92:se()}return te}function ye(t,e){for(;se()&&t+ee!==57&&(t+ee!==84||47!==le()););return"/*"+ue(e,te-1)+"*"+Dt(47===t?t:se())}function be(t){for(;!pe(le());)se();return ue(t,te)}function we(t){return fe(xe("",null,null,null,[""],t=de(t),0,[0],t))}function xe(t,e,n,r,o,i,a,s,l){for(var c=0,u=0,p=a,d=0,f=0,h=0,g=1,v=1,m=1,y=0,b="",w=o,x=i,_=r,C=b;v;)switch(h=y,y=se()){case 40:if(108!=h&&58==Wt(C,p-1)){-1!=$t(C+=Ht(he(y),"&","&\f"),"&\f",It(c?s[c-1]:0))&&(m=-1);break}case 34:case 39:case 91:C+=he(y);break;case 9:case 10:case 13:case 32:C+=ge(h);break;case 92:C+=ve(ce()-1,7);continue;case 47:switch(le()){case 42:case 47:Kt(Ce(ye(se(),ce()),e,n,l),l);break;default:C+="/"}break;case 123*g:s[c++]=qt(C)*m;case 125*g:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+u:-1==m&&(C=Ht(C,/\f/g,"")),f>0&&qt(C)-p&&Kt(f>32?Se(C+";",r,n,p-1,l):Se(Ht(C," ","")+";",r,n,p-2,l),l);break;case 59:C+=";";default:if(Kt(_=_e(C,e,n,c,u,o,s,b,w=[],x=[],p,i),i),123===y)if(0===u)xe(C,e,_,_,w,i,p,s,x);else switch(99===d&&110===Wt(C,3)?100:d){case 100:case 108:case 109:case 115:xe(t,_,_,r&&Kt(_e(t,_,_,0,0,o,s,b,o,w=[],p,x),x),o,x,p,s,r?w:x);break;default:xe(C,_,_,_,[""],x,0,s,x)}}c=u=f=0,g=m=1,b=C="",p=a;break;case 58:p=1+qt(C),f=h;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==ae())continue;switch(C+=Dt(y),y*g){case 38:m=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(qt(C)-1)*m,m=1;break;case 64:45===le()&&(C+=he(se())),d=le(),u=p=qt(b=C+=be(ce())),y++;break;case 45:45===h&&2==qt(C)&&(g=0)}}return i}function _e(t,e,n,r,o,i,a,s,l,c,u,p){for(var d=o-1,f=0===o?i:[""],h=Gt(f),g=0,v=0,m=0;g<r;++g)for(var y=0,b=Ut(t,d+1,d=It(v=a[g])),w=t;y<h;++y)(w=Bt(v>0?f[y]+" "+b:Ht(b,/&\f/g,f[y])))&&(l[m++]=w);return re(t,e,n,0===o?jt:s,l,c,u,p)}function Ce(t,e,n,r){return re(t,e,n,Pt,Dt(ee),Ut(t,2,-2),0,r)}function Se(t,e,n,r,o){return re(t,e,n,Mt,Ut(t,0,r),Ut(t,r+1,-1),r,o)}function Oe(t,e,n){switch(Vt(t,e)){case 5103:return At+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return At+t+t;case 4789:return Tt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return At+t+Tt+t+kt+t+t;case 5936:switch(Wt(t,e+11)){case 114:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return At+t+kt+t+t;case 6165:return At+t+kt+"flex-"+t+t;case 5187:return At+t+Ht(t,/(\w+).+(:[^]+)/,At+"box-$1$2"+kt+"flex-$1$2")+t;case 5443:return At+t+kt+"flex-item-"+Ht(t,/flex-|-self/g,"")+(zt(t,/flex-|baseline/)?"":kt+"grid-row-"+Ht(t,/flex-|-self/g,""))+t;case 4675:return At+t+kt+"flex-line-pack"+Ht(t,/align-content|flex-|-self/g,"")+t;case 5548:return At+t+kt+Ht(t,"shrink","negative")+t;case 5292:return At+t+kt+Ht(t,"basis","preferred-size")+t;case 6060:return At+"box-"+Ht(t,"-grow","")+At+t+kt+Ht(t,"grow","positive")+t;case 4554:return At+Ht(t,/([^-])(transform)/g,"$1"+At+"$2")+t;case 6187:return Ht(Ht(Ht(t,/(zoom-|grab)/,At+"$1"),/(image-set)/,At+"$1"),t,"")+t;case 5495:case 3959:return Ht(t,/(image-set\([^]*)/,At+"$1$`$1");case 4968:return Ht(Ht(t,/(.+:)(flex-)?(.*)/,At+"box-pack:$3"+kt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+At+t+t;case 4200:if(!zt(t,/flex-|baseline/))return kt+"grid-column-align"+Ut(t,e)+t;break;case 2592:case 3360:return kt+Ht(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,zt(t.props,/grid-\w+-end/)}))?~$t(t+(n=n[e].value),"span",0)?t:kt+Ht(t,"-start","")+t+kt+"grid-row-span:"+(~$t(n,"span",0)?zt(n,/\d+/):+zt(n,/\d+/)-+zt(t,/\d+/))+";":kt+Ht(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return zt(t.props,/grid-\w+-start/)}))?t:kt+Ht(Ht(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ht(t,/(.+)-inline(.+)/,At+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qt(t)-1-e>6)switch(Wt(t,e+1)){case 109:if(45!==Wt(t,e+4))break;case 102:return Ht(t,/(.+:)(.+)-([^]+)/,"$1"+At+"$2-$3$1"+Tt+(108==Wt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~$t(t,"stretch",0)?Oe(Ht(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Ht(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,r,o,i,a,s){return kt+n+":"+r+s+(o?kt+n+"-span:"+(i?a:+a-+r)+s:"")+t}));case 4949:if(121===Wt(t,e+6))return Ht(t,":",":"+At)+t;break;case 6444:switch(Wt(t,45===Wt(t,14)?18:11)){case 120:return Ht(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+At+(45===Wt(t,14)?"inline-":"")+"box$3$1"+At+"$2$3$1"+kt+"$2box$3")+t;case 100:return Ht(t,":",":"+kt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ht(t,"scroll-","scroll-snap-")+t}return t}function Ee(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function ke(t,e,n,r){switch(t.type){case Lt:if(t.children.length)break;case Nt:case Mt:return t.return=t.return||t.value;case Pt:return"";case Rt:return t.return=t.value+"{"+Ee(t.children,r)+"}";case jt:if(!qt(t.value=t.props.join(",")))return""}return qt(n=Ee(t.children,r))?t.return=t.value+"{"+n+"}":""}function Te(t){var e=Gt(t);return function(n,r,o,i){for(var a="",s=0;s<e;s++)a+=t[s](n,r,o,i)||"";return a}}function Ae(t){return function(e){e.root||(e=e.return)&&t(e)}}function Pe(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case Mt:return void(t.return=Oe(t.value,t.length,n));case Rt:return Ee([oe(t,{value:Ht(t.value,"@","@"+At)})],r);case jt:if(t.length)return Yt(n=t.props,(function(e){switch(zt(e,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ie(oe(t,{props:[Ht(e,/:(read-\w+)/,":"+Tt+"$1")]})),ie(oe(t,{props:[e]})),Ft(t,{props:Xt(n,r)});break;case"::placeholder":ie(oe(t,{props:[Ht(e,/:(plac\w+)/,":"+At+"input-$1")]})),ie(oe(t,{props:[Ht(e,/:(plac\w+)/,":"+Tt+"$1")]})),ie(oe(t,{props:[Ht(e,/:(plac\w+)/,kt+"input-$1")]})),ie(oe(t,{props:[e]})),Ft(t,{props:Xt(n,r)})}return""}))}}var je=function(t,e,n){for(var r=0,o=0;r=o,o=le(),38===r&&12===o&&(e[n]=1),!pe(o);)se();return ue(t,te)},Me=function(t,e){return fe(function(t,e){var n=-1,r=44;do{switch(pe(r)){case 0:38===r&&12===le()&&(e[n]=1),t[n]+=je(te-1,e,n);break;case 2:t[n]+=he(r);break;case 4:if(44===r){t[++n]=58===le()?"&\f":"",e[n]=t[n].length;break}default:t[n]+=Dt(r)}}while(r=se());return t}(de(t),e))},Ne=new WeakMap,Re=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,n=t.parent,r=t.column===n.column&&t.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||Ne.get(n))&&!r){Ne.set(t,!0);for(var o=[],i=Me(e,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)t.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Le=function(t){if("decl"===t.type){var e=t.value;108===e.charCodeAt(0)&&98===e.charCodeAt(2)&&(t.return="",t.value="")}},Ie=function(t){return"comm"===t.type&&t.children.indexOf("emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason")>-1},De=function(t){return 105===t.type.charCodeAt(1)&&64===t.type.charCodeAt(0)},Fe=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},Ve=function(t,e,n){De(t)&&(t.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Fe(t)):function(t,e){for(var n=t-1;n>=0;n--)if(!De(e[n]))return!0;return!1}(e,n)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Fe(t)))};function Be(t,e){switch(Vt(t,e)){case 5103:return At+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return At+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return At+t+Tt+t+kt+t+t;case 6828:case 4268:return At+t+kt+t+t;case 6165:return At+t+kt+"flex-"+t+t;case 5187:return At+t+Ht(t,/(\w+).+(:[^]+)/,At+"box-$1$2"+kt+"flex-$1$2")+t;case 5443:return At+t+kt+"flex-item-"+Ht(t,/flex-|-self/,"")+t;case 4675:return At+t+kt+"flex-line-pack"+Ht(t,/align-content|flex-|-self/,"")+t;case 5548:return At+t+kt+Ht(t,"shrink","negative")+t;case 5292:return At+t+kt+Ht(t,"basis","preferred-size")+t;case 6060:return At+"box-"+Ht(t,"-grow","")+At+t+kt+Ht(t,"grow","positive")+t;case 4554:return At+Ht(t,/([^-])(transform)/g,"$1"+At+"$2")+t;case 6187:return Ht(Ht(Ht(t,/(zoom-|grab)/,At+"$1"),/(image-set)/,At+"$1"),t,"")+t;case 5495:case 3959:return Ht(t,/(image-set\([^]*)/,At+"$1$`$1");case 4968:return Ht(Ht(t,/(.+:)(flex-)?(.*)/,At+"box-pack:$3"+kt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+At+t+t;case 4095:case 3583:case 4068:case 2532:return Ht(t,/(.+)-inline(.+)/,At+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qt(t)-1-e>6)switch(Wt(t,e+1)){case 109:if(45!==Wt(t,e+4))break;case 102:return Ht(t,/(.+:)(.+)-([^]+)/,"$1"+At+"$2-$3$1"+Tt+(108==Wt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~$t(t,"stretch")?Be(Ht(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==Wt(t,e+1))break;case 6444:switch(Wt(t,qt(t)-3-(~$t(t,"!important")&&10))){case 107:return Ht(t,":",":"+At)+t;case 101:return Ht(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+At+(45===Wt(t,14)?"inline-":"")+"box$3$1"+At+"$2$3$1"+kt+"$2box$3")+t}break;case 5936:switch(Wt(t,e+11)){case 114:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return At+t+kt+Ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return At+t+kt+t+t}return t}var ze,He="undefined"!=typeof document,$e=He?void 0:function(t){var e=new WeakMap;return function(n){if(e.has(n))return e.get(n);var r=t(n);return e.set(n,r),r}}((function(){return Ct((function(){var t={};return function(e){return t[e]}}))})),We=[function(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case Mt:t.return=Be(t.value,t.length);break;case Rt:return Ee([oe(t,{value:Ht(t.value,"@","@"+At)})],r);case jt:if(t.length)return Yt(t.props,(function(e){switch(zt(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ee([oe(t,{props:[Ht(e,/:(read-\w+)/,":"+Tt+"$1")]})],r);case"::placeholder":return Ee([oe(t,{props:[Ht(e,/:(plac\w+)/,":"+At+"input-$1")]}),oe(t,{props:[Ht(e,/:(plac\w+)/,":"+Tt+"$1")]}),oe(t,{props:[Ht(e,/:(plac\w+)/,kt+"input-$1")]})],r)}return""}))}}],Ue=function(t){var e=t.key;if("production"!==process.env.NODE_ENV&&!e)throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");if(He&&"css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var r=t.stylisPlugins||We;if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(e))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+e+'" was passed');var o,i,a={},s=[];He&&(o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;n<e.length;n++)a[e[n]]=!0;s.push(t)})));var l=[Re,Le];if("production"!==process.env.NODE_ENV&&l.push(function(t){return function(e,n,r){if("rule"===e.type&&!t.compat){var o=e.value.match(/(:first|:nth|:nth-last)-child/g);if(o){for(var i=e.parent?e.parent.children:r,a=i.length-1;a>=0;a--){var s=i[a];if(s.line<e.line)break;if(s.column<e.column){if(Ie(s))return;break}}o.forEach((function(t){console.error('The pseudo class "'+t+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+t.split("-child")[0]+'-of-type".')}))}}}}({get compat(){return v.compat}}),Ve),He){var c,u=[ke,"production"!==process.env.NODE_ENV?function(t){t.root||(t.return?c.insert(t.return):t.value&&t.type!==Pt&&c.insert(t.value+"{}"))}:Ae((function(t){c.insert(t)}))],p=Te(l.concat(r,u));i=function(t,e,n,r){c=n,"production"!==process.env.NODE_ENV&&void 0!==e.map&&(c={insert:function(t){n.insert(t+e.map)}}),function(t){Ee(we(t),p)}(t?t+"{"+e.styles+"}":e.styles),r&&(v.inserted[e.name]=!0)}}else{var d=[ke],f=Te(l.concat(r,d)),h=$e(r)(e),g=function(t,e){var n=e.name;return void 0===h[n]&&(h[n]=function(t){return Ee(we(t),f)}(t?t+"{"+e.styles+"}":e.styles)),h[n]};i=function(t,e,n,r){var o=e.name,i=g(t,e);return void 0===v.compat?(r&&(v.inserted[o]=!0),"development"===process.env.NODE_ENV&&void 0!==e.map?i+e.map:i):r?void(v.inserted[o]=i):i}}var v={key:e,sheet:new Et({key:e,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:i};return v.sheet.hydrate(s),v},qe={exports:{}},Ge={};var Ke,Ye={};
13
13
  /** @license React v16.13.1
14
14
  * react-is.development.js
15
15
  *