everbee-landing-page-builder 1.3.5 → 1.3.6
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
|
@@ -8,7 +8,7 @@ import*as e from"react";import t,{forwardRef as n,useContext as r,Children as o,
|
|
|
8
8
|
* Documentation and full license available at
|
|
9
9
|
* https://github.com/osartun/Backbone.Undo.js
|
|
10
10
|
*/o=[n(50),n(316)],r=function(e,t){var n=Array.prototype.slice;function r(e,t,n){return n.length<=4?e.call(t,n[0],n[1],n[2],n[3]):e.apply(t,n)}function o(e,t){return n.call(e,t)}function i(t,n){return null!=t&&(e.isArray(n)||(n=o(arguments,1)),e.all(n,(function(e){return e in t})))}var a=function(){var t=!1,n=-1;function r(){n++,t=!0,e.defer((function(){t=!1}))}return function(){return t||r(),n}}();function s(){this.registeredObjects=[],this.cidIndexes=[]}function l(t,n,r,o){for(var i,a=0,s=n.length;a<s;a++)if(i=n[a]){if("on"===t){if(!o.objectRegistry.register(i))continue}else if(!o.objectRegistry.unregister(i))continue;e.isFunction(i[t])&&i[t]("all",r,o)}}function c(t,n){var r=n.type,o=n.undoTypes,i=!o[r]||o[r][t];e.isFunction(i)&&i(n.object,n.before,n.after,n.options)}function u(t,r,o,i,a){if(!(o.isCurrentlyUndoRedoing||"undo"===t&&-1===o.pointer||"redo"===t&&o.pointer===o.length-1)){o.isCurrentlyUndoRedoing=!0;var s,l,c="undo"===t;for(a?l=c&&o.pointer===o.length-1||!c&&-1===o.pointer?e.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[t]();o.isCurrentlyUndoRedoing=!1,r.trigger(t,r)}}function d(e,t){var n=e.condition,o=typeof n;return"function"===o?!!r(n,e,t):"boolean"!==o||n}function p(e,t,n,o){if(e.track&&!e.isCurrentlyUndoRedoing&&t in o&&d(o[t],n)){var s=r(o[t].on,o[t],n);if(i(s,"object","before","after")){if(s.type=t,s.magicFusionIndex=a(),s.undoTypes=o,e.pointer<e.length-1)for(var l=e.length-e.pointer-1;l--;)e.pop();e.pointer=e.length,e.add(s),e.length>e.maximumStackLength&&(e.shift(),e.pointer--)}}}s.prototype={isRegistered:function(t){return t&&t.cid?this.registeredObjects[t.cid]:e.contains(this.registeredObjects,t)},register:function(e){return!this.isRegistered(e)&&(e&&e.cid?(this.registeredObjects[e.cid]=e,this.cidIndexes.push(e.cid)):this.registeredObjects.push(e),!0)},unregister:function(t){if(this.isRegistered(t)){if(t&&t.cid)delete this.registeredObjects[t.cid],this.cidIndexes.splice(e.indexOf(this.cidIndexes,t.cid),1);else{var n=e.indexOf(this.registeredObjects,t);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return e.map(this.cidIndexes,(function(e){return this.registeredObjects[e]}),this).concat(this.registeredObjects)}};var f={add:{undo:function(e,t,n,r){e.remove(n,r)},redo:function(e,t,n,r){r.index&&(r.at=r.index),e.add(n,r)},on:function(t,n,r){return{object:n,before:void 0,after:t,options:e.clone(r)}}},remove:{undo:function(e,t,n,r){"index"in r&&(r.at=r.index),e.add(t,r)},redo:function(e,t,n,r){e.remove(t,r)},on:function(t,n,r){return{object:n,before:t,after:void 0,options:e.clone(r)}}},change:{undo:function(t,n,r,o){e.isEmpty(n)?e.each(e.keys(r),t.unset,t):(t.set(n),o&&o.unsetData&&o.unsetData.before&&o.unsetData.before.length&&e.each(o.unsetData.before,t.unset,t))},redo:function(t,n,r,o){e.isEmpty(r)?e.each(e.keys(n),t.unset,t):(t.set(r),o&&o.unsetData&&o.unsetData.after&&o.unsetData.after.length&&e.each(o.unsetData.after,t.unset,t))},on:function(t,n){var r=t.changedAttributes(),o=e.keys(r),i=e.pick(t.previousAttributes(),o),a=e.keys(i),s=(n||(n={})).unsetData={after:[],before:[]};return o.length!=a.length&&(o.length>a.length?e.each(o,(function(e){e in i||s.before.push(e)}),this):e.each(a,(function(e){e in r||s.after.push(e)}))),{object:t,before:i,after:r,options:e.clone(n)}}},reset:{undo:function(e,t,n){e.reset(t)},redo:function(e,t,n){e.reset(n)},on:function(t,n){return{object:t,before:n.previousModels,after:e.clone(t.models)}}}};function h(){}function g(t,n,r,o){if("object"==typeof n)return e.each(n,(function(e,n){2===t?g(t,e,r,o):g(t,n,e,r)}));switch(t){case 0:i(r,"undo","redo","on")&&e.all(e.pick(r,"undo","redo","on"),e.isFunction)&&(o[n]=r);break;case 1:o[n]&&e.isObject(r)&&(o[n]=e.extend({},o[n],r));break;case 2:delete o[n]}return this}h.prototype=f;var m=t.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(e){c("undo",this.attributes)},redo:function(e){c("redo",this.attributes)}}),v=t.Collection.extend({model:m,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(e){this.maximumStackLength=e}}),y=t.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(t){this.stack=new v,this.objectRegistry=new s,this.undoTypes=new h,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(e,t){this.stack.setMaxLength(t)}),this),t&&t.track&&this.startTracking(),t&&t.register&&(e.isArray(t.register)||e.isArguments(t.register)?r(this.register,this,t.register):this.register(t.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(e){p(this.stack,e,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(e){u("undo",this,this.stack,e)},undoAll:function(){u("undo",this,this.stack,!1,!0)},redo:function(e){u("redo",this,this.stack,e)},redoAll:function(){u("redo",this,this.stack,!1,!0)},isAvailable:function(e){var t=this.stack,n=t.length;switch(e){case"undo":return n>0&&t.pointer>-1;case"redo":return n>0&&t.pointer<n-1;default:return!1}},merge:function(t){for(var n,r=e.isArray(t)?t:o(arguments);n=r.pop();)n instanceof y&&n.stack instanceof v&&(n.stack=this.stack)},addUndoType:function(e,t){g(0,e,t,this.undoTypes)},changeUndoType:function(e,t){g(1,e,t,this.undoTypes)},removeUndoType:function(e){g(2,e,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return e.extend(y,{defaults:function(t){e.extend(y.prototype.defaults,t)},addUndoType:function(e,t){g(0,e,t,f)},changeUndoType:function(e,t){g(1,e,t,f)},removeUndoType:function(e){g(2,e,void 0,f)}}),t.UndoManager=y},void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},316:(e,t,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),t],o=function(e,t,n){a.Backbone=function(e,t,n,r){var o=e.Backbone,i=Array.prototype.slice;t.VERSION="1.4.1",t.$=r,t.noConflict=function(){return e.Backbone=o,this},t.emulateHTTP=!1,t.emulateJSON=!1;var a,s=t.Events={},l=/\s+/,c=function(e,t,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++)t=c(e,t,a[s],r[a[s]],i)}else if(r&&l.test(r))for(a=r.split(l);s<a.length;s++)t=e(t,a[s],o,i);else t=e(t,r,o,i);return t};s.on=function(e,t,n){(this._events=c(u,this._events||{},e,t,{context:n,ctx:this,listening:a}),a)&&((this._listeners||(this._listeners={}))[a.id]=a,a.interop=!1);return this},s.listenTo=function(e,t,r){if(!e)return this;var o=e._listenId||(e._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 m(this,e));var l=d(e,t,r,this);if(a=void 0,l)throw l;return s.interop&&s.on(t,r),this};var u=function(e,t,n,r){if(n){var o=e[t]||(e[t]=[]),i=r.context,a=r.ctx,s=r.listening;s&&s.count++,o.push({callback:n,context:i,ctx:i||a,listening:s})}return e},d=function(e,t,n,r){try{e.on(t,n,r)}catch(e){return e}};s.off=function(e,t,n){return this._events?(this._events=c(p,this._events,e,t,{context:n,listeners:this._listeners}),this):this},s.stopListening=function(e,t,r){var o=this._listeningTo;if(!o)return this;for(var i=e?[e._listenId]:n.keys(o),a=0;a<i.length;a++){var s=o[i[a]];if(!s)break;s.obj.off(t,r,this),s.interop&&s.off(t,r)}return n.isEmpty(o)&&(this._listeningTo=void 0),this};var p=function(e,t,r,o){if(e){var i,a=o.context,s=o.listeners,l=0;if(t||a||r){for(i=t?[t]:n.keys(e);l<i.length;l++){var c=e[t=i[l]];if(!c)break;for(var u=[],d=0;d<c.length;d++){var p=c[d];if(r&&r!==p.callback&&r!==p.callback._callback||a&&a!==p.context)u.push(p);else{var f=p.listening;f&&f.off(t,r)}}u.length?e[t]=u:delete e[t]}return e}for(i=n.keys(s);l<i.length;l++)s[i[l]].cleanup()}};s.once=function(e,t,n){var r=c(f,{},e,t,this.off.bind(this));return"string"==typeof e&&null==n&&(t=void 0),this.on(r,t,n)},s.listenToOnce=function(e,t,n){var r=c(f,{},t,n,this.stopListening.bind(this,e));return this.listenTo(e,r)};var f=function(e,t,r,o){if(r){var i=e[t]=n.once((function(){o(t,i),r.apply(this,arguments)}));i._callback=r}return e};s.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),n=Array(t),r=0;r<t;r++)n[r]=arguments[r+1];return c(h,this._events,e,void 0,n),this};var h=function(e,t,n,r){if(e){var o=e[t],i=e.all;o&&i&&(i=i.slice()),o&&g(o,r),i&&g(i,[t].concat(r))}return e},g=function(e,t){var n,r=-1,o=e.length,i=t[0],a=t[1],s=t[2];switch(t.length){case 0:for(;++r<o;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a);return;case 3:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=e[r]).callback.apply(n.ctx,t);return}},m=function(e,t){this.id=e._listenId,this.listener=e,this.obj=t,this.interop=!0,this.count=0,this._events=void 0};m.prototype.on=s.on,m.prototype.off=function(e,t){var n;this.interop?(this._events=c(p,this._events,e,t,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},m.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(t,s);var v=t.Model=function(e,t){var r=e||{};t||(t={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{});var o=n.result(this,"defaults");r=n.defaults(n.extend({},o,r),o),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(v.prototype,s,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return!!n.iteratee(e,this)(this.attributes)},set:function(e,t,r){if(null==e)return this;var o;if("object"==typeof e?(o=e,r=t):(o={})[e]=t,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,d=this._previousAttributes;for(var p in o)t=o[p],n.isEqual(c[p],t)||s.push(p),n.isEqual(d[p],t)?delete u[p]:u[p]=t,i?delete c[p]:c[p]=t;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(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&n.clone(this.changed);var t,r=this._changing?this._previousAttributes:this.attributes,o={};for(var i in e){var a=e[i];n.isEqual(r[i],a)||(o[i]=a,t=!0)}return!!t&&o},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=n.extend({parse:!0},e);var t=this,r=e.success;return e.success=function(n){var o=e.parse?t.parse(n,e):n;if(!t.set(o,e))return!1;r&&r.call(e.context,t,n,e),t.trigger("sync",t,n,e)},Y(this,e),this.sync("read",this,e)},save:function(e,t,r){var o;null==e||"object"==typeof e?(o=e,r=t):(o={})[e]=t;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(e){a.attributes=l;var t=r.parse?a.parse(e,r):e;if(i&&(t=n.extend({},o,t)),t&&!a.set(t,r))return!1;s&&s.call(r.context,a,e,r),a.trigger("sync",a,e,r)},Y(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(e){e=e?n.clone(e):{};var t=this,r=e.success,o=e.wait,i=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(n){o&&i(),r&&r.call(e.context,t,n,e),t.isNew()||t.trigger("sync",t,n,e)};var a=!1;return this.isNew()?n.defer(e.success):(Y(this,e),a=this.sync("delete",this,e)),o||i(),a},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||G();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return!r||(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1)}});var y=t.Collection=function(e,t){t||(t={}),this.preinitialize.apply(this,arguments),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},b={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},x=function(e,t,n){n=Math.min(Math.max(n,0),e.length);var r,o=Array(e.length-n),i=t.length;for(r=0;r<o.length;r++)o[r]=e[r+n];for(r=0;r<i;r++)e[r+n]=t[r];for(r=0;r<o.length;r++)e[r+i+n]=o[r]};n.extend(y.prototype,s,{model:v,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map((function(t){return t.toJSON(e)}))},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,w))},remove:function(e,t){t=n.extend({},t);var r=!n.isArray(e);e=r?[e]:e.slice();var o=this._removeModels(e,t);return!t.silent&&o.length&&(t.changes={added:[],merged:[],removed:o},this.trigger("update",this,t)),r?o[0]:o},set:function(e,t){if(null!=e){(t=n.extend({},b,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var r=!n.isArray(e);e=r?[e]:e.slice();var o=t.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,a,s=[],l=[],c=[],u=[],d={},p=t.add,f=t.merge,h=t.remove,g=!1,m=this.comparator&&null==o&&!1!==t.sort,v=n.isString(this.comparator)?this.comparator:null;for(a=0;a<e.length;a++){i=e[a];var y=this.get(i);if(y){if(f&&i!==y){var w=this._isModel(i)?i.attributes:i;t.parse&&(w=y.parse(w,t)),y.set(w,t),c.push(y),m&&!g&&(g=y.hasChanged(v))}d[y.cid]||(d[y.cid]=!0,s.push(y)),e[a]=y}else p&&(i=e[a]=this._prepareModel(i,t))&&(l.push(i),this._addReference(i,t),d[i.cid]=!0,s.push(i))}if(h){for(a=0;a<this.length;a++)d[(i=this.models[a]).cid]||u.push(i);u.length&&this._removeModels(u,t)}var C=!1,S=!m&&p&&h;if(s.length&&S?(C=this.length!==s.length||n.some(this.models,(function(e,t){return e!==s[t]})),this.models.length=0,x(this.models,s,0),this.length=this.models.length):l.length&&(m&&(g=!0),x(this.models,l,null==o?this.length:o),this.length=this.models.length),g&&this.sort({silent:!0}),!t.silent){for(a=0;a<l.length;a++)null!=o&&(t.index=o+a),(i=l[a]).trigger("add",i,this,t);(g||C)&&this.trigger("sort",this,t),(l.length||u.length||c.length)&&(t.changes={added:l,removed:u,merged:c},this.trigger("update",this,t))}return r?e[0]:e}},reset:function(e,t){t=t?n.clone(t):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return i.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(this._isModel(e)?e.attributes:e,e.idAttribute)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},sort:function(e){var t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});var r=t.length;return n.isFunction(t)&&(t=t.bind(this)),1===r||n.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){var t=(e=n.extend({parse:!0},e)).success,r=this;return e.success=function(n){var o=e.reset?"reset":"set";r[o](n,e),t&&t.call(e.context,r,n,e),r.trigger("sync",r,n,e)},Y(this,e),this.sync("read",this,e)},create:function(e,t){var r=(t=t?n.clone(t):{}).wait;if(!(e=this._prepareModel(e,t)))return!1;r||this.add(e,t);var o=this,i=t.success;return t.success=function(e,t,n){r&&o.add(e,n),i&&i.call(n.context,e,t,n)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e,t){return e[t||this.model.prototype.idAttribute||"id"]},values:function(){return new S(this,_)},keys:function(){return new S(this,E)},entries:function(){return new S(this,O)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){return this._isModel(e)?(e.collection||(e.collection=this),e):((t=t?n.clone(t):{}).collection=this,(r=this.model.prototype?new this.model(e,t):this.model(e,t)).validationError?(this.trigger("invalid",this,r.validationError,t),!1):r);var r},_removeModels:function(e,t){for(var n=[],r=0;r<e.length;r++){var o=this.get(e[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],t.silent||(t.index=i,o.trigger("remove",o,this,t)),n.push(o),this._removeReference(o,t)}}return n},_isModel:function(e){return e instanceof v},_addReference:function(e,t){this._byId[e.cid]=e;var n=this.modelId(e.attributes,e.idAttribute);null!=n&&(this._byId[n]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var n=this.modelId(e.attributes,e.idAttribute);null!=n&&delete this._byId[n],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if(t){if(("add"===e||"remove"===e)&&n!==this)return;if("destroy"===e&&this.remove(t,r),"changeId"===e){var o=this.modelId(t.previousAttributes(),t.idAttribute),i=this.modelId(t.attributes,t.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=t)}}this.trigger.apply(this,arguments)}});var C="function"==typeof Symbol&&Symbol.iterator;C&&(y.prototype[C]=y.prototype.values);var S=function(e,t){this._collection=e,this._kind=t,this._index=0},_=1,E=2,O=3;C&&(S.prototype[C]=function(){return this});S.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var e,t=this._collection.at(this._index);if(this._index++,this._kind===_)e=t;else{var n=this._collection.modelId(t.attributes,t.idAttribute);e=this._kind===E?n:[n,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var k=t.View=function(e){this.cid=n.uniqueId("view"),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(e,P)),this._ensureElement(),this.initialize.apply(this,arguments)},T=/^(\S+)\s*(.*)$/,P=["model","collection","el","id","attributes","className","tagName","events"];n.extend(k.prototype,s,{tagName:"div",$:function(e){return this.$el.find(e)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=n.result(this,"events")),!e)return this;for(var t in this.undelegateEvents(),e){var r=e[t];if(n.isFunction(r)||(r=this[r]),r){var o=t.match(T);this.delegate(o[1],o[2],r.bind(this))}}return this},delegate:function(e,t,n){return this.$el.on(e+".delegateEvents"+this.cid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,n){return this.$el.off(e+".delegateEvents"+this.cid,t,n),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}});var M=function(e,t,n,r){switch(t){case 1:return function(){return e[n](this[r])};case 2:return function(t){return e[n](this[r],t)};case 3:return function(t,o){return e[n](this[r],D(t,this),o)};case 4:return function(t,o,i){return e[n](this[r],D(t,this),o,i)};default:return function(){var t=i.call(arguments);return t.unshift(this[r]),e[n].apply(e,t)}}},A=function(e,t,r,o){n.each(r,(function(n,r){t[r]&&(e.prototype[r]=M(t,n,r,o))}))},D=function(e,t){return n.isFunction(e)?e:n.isObject(e)&&!t._isModel(e)?N(e):n.isString(e)?function(t){return t.get(e)}:e},N=function(e){var t=n.matches(e);return function(e){return t(e.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},j={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};n.each([[y,R,"models"],[v,j,"attributes"]],(function(e){var t=e[0],r=e[1],o=e[2];t.mixin=function(e){var r=n.reduce(n.functions(e),(function(e,t){return e[t]=0,e}),{});A(t,e,r,o)},A(t,n,r,o)})),t.sync=function(e,r,o){var i=I[e];n.defaults(o||(o={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var a={type:i,dataType:"json"};if(o.url||(a.url=n.result(r,"url")||G()),null!=o.data||!r||"create"!==e&&"update"!==e&&"patch"!==e||(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(e){if(e.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(e,t,n){o.textStatus=t,o.errorThrown=n,l&&l.call(o.context,e,t,n)};var c=o.xhr=t.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"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var L=t.Router=function(e){e||(e={}),this.preinitialize.apply(this,arguments),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},F=/\((.*?)\)/g,V=/(\(\?)?:\w+/g,B=/\*\w+/g,z=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(L.prototype,s,{preinitialize:function(){},initialize:function(){},route:function(e,r,o){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(o=r,r=""),o||(o=this[r]);var i=this;return t.history.route(e,(function(n){var a=i._extractParameters(e,n);!1!==i.execute(o,a,r)&&(i.trigger.apply(i,["route:"+r].concat(a)),i.trigger("route",r,a),t.history.trigger("route",i,r,a))})),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var e,t=n.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(z,"\\$&").replace(F,"(?:$1)?").replace(V,(function(e,t){return t?e:"([^/?]+)"})).replace(B,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,(function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null}))}});var H=t.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(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace($,"")},start:function(e){if(H.started)throw new Error("Backbone.history has already been started");if(H.started=!0,this.options=n.extend({root:"/"},this.options,e),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 t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+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(e,t){return attachEvent("on"+e,t)};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 e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),H.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),!0})))},navigate:function(e,t){if(!H.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+e;e=e.replace(U,"");var o=this.decodeFragment(e);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;t.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new H;var q=function(e,t){var r,o=this;return r=e&&n.has(e,"constructor")?e.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,t),r.prototype=n.create(o.prototype,e),r.prototype.constructor=r,r.__super__=o.prototype,r};v.extend=y.extend=L.extend=k.extend=H.extend=q;var G=function(){throw new Error('A "url" property or function must be specified')},Y=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger("error",e,r,t)}};return t}(a,n,e,t)}.apply(t,r),void 0===o||(e.exports=o)}()},210:(e,t,n)=>{!function(e){e.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t){return/^[;{}]$/.test(t)}}),e.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t,n,r){return this.jsonMode?/^[\[,{]$/.test(t)||/^}/.test(n):(";"!=t||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(t)&&!/^;/.test(n)}});var t=/^(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)$/;e.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(e,n,r,o){var i=!1;return"html"==this.configuration&&(i=!!o.context&&t.test(o.context.tagName)),!i&&("tag"==e&&/>$/.test(n)&&o.context||/^</.test(r))}}),e.defineExtension("commentRange",(function(t,n,r){var o=this,i=e.innerMode(o.getMode(),o.getTokenAt(n).state).mode;o.operation((function(){if(t)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 e=o.getRange(n,r),a=e.indexOf(i.commentStart),s=e.lastIndexOf(i.commentEnd);a>-1&&s>-1&&s>a&&(e=e.substr(0,a)+e.substring(a+i.commentStart.length,s)+e.substr(s+i.commentEnd.length)),o.replaceRange(e,n,r)}}))})),e.defineExtension("autoIndentRange",(function(e,t){var n=this;this.operation((function(){for(var r=e.line;r<=t.line;r++)n.indentLine(r,"smart")}))})),e.defineExtension("autoFormatRange",(function(t,n){var r=this,o=r.getMode(),i=r.getRange(t,n).split("\n"),a=e.copyState(o,r.getTokenAt(t).state),s=r.getOption("tabSize"),l="",c=0,u=0===t.ch;function d(){l+="\n",u=!0,++c}for(var p=0;p<i.length;++p){for(var f=new e.StringStream(i[p],s);!f.eol();){var h=e.innerMode(o,a),g=o.token(f,a),m=f.current();f.start=f.pos,u&&!/\S/.test(m)||(l+=m,u=!1),!u&&h.mode.newlineAfterToken&&h.mode.newlineAfterToken(g,m,f.string.slice(f.pos)||i[p+1]||"",h.state)&&d()}!f.pos&&o.blankLine&&o.blankLine(a),!u&&p<i.length-1&&d()}r.operation((function(){r.replaceRange(l,t,n);for(var e=t.line+1,o=t.line+c;e<=o;++e)r.indentLine(e,"smart");r.setSelection(t,r.getCursor(!1))}))}))}(n(631))},631:function(e){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],p=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=p&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(p=!1,l=!0);var S=b&&(c||p&&(null==C||C<12.11)),_=n||a&&s>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O,k=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function P(e,t){return T(e).appendChild(t)}function M(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function A(e,t,n,r){var o=M(e,t,n,r);return o.setAttribute("role","presentation"),o}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function N(e){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function R(e,t){var n=e.className;E(t).test(n)||(e.className+=(n?" ":"")+t)}function j(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!E(n[r]).test(t)&&(t+=" "+n[r]);return t}O=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var I=function(e){e.select()};function L(e){return e.display.wrapper.ownerDocument}function F(e){return L(e).defaultView}function V(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function z(e,t,n,r,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=r||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}m?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(I=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=V(this.onTimeout,this)};function $(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var W=50,U={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},G={origin:"*mouse"},Y={origin:"+move"};function K(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var Z=[""];function X(e){for(;Z.length<=e;)Z.push(J(Z)+" ");return Z[e]}function J(e){return e[e.length-1]}function Q(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ee(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)}function te(){}function ne(e,t){var n;return Object.create?n=Object.create(e):(te.prototype=e,n=new te),t&&B(t,n),n}var re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function oe(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function ie(e,t){return t?!!(t.source.indexOf("\\w")>-1&&oe(e))||t.test(e):oe(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var se=/[\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 le(e){return e.charCodeAt(0)>=768&&se.test(e)}function ce(e,t,n){for(;(n<0?t>0:t<e.length)&&le(e.charAt(t));)t+=n;return t}function ue(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}var pe=null;function fe(e,t,n){var r;pe=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:pe=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:pe=o)}return null!=r?r:pe}var he=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.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(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var u=e.length,d=[],p=0;p<u;++p)d.push(n(e.charCodeAt(p)));for(var f=0,h=c;f<u;++f){var g=d[f];"m"==g?d[f]=h:h=g}for(var m=0,v=c;m<u;++m){var y=d[m];"1"==y&&"r"==v?d[m]="n":i.test(y)&&(v=y,"r"==y&&(d[m]="R"))}for(var b=1,w=d[0];b<u-1;++b){var x=d[b];"+"==x&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=x||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=x}for(var C=0;C<u;++C){var S=d[C];if(","==S)d[C]="N";else if("%"==S){var _=void 0;for(_=C+1;_<u&&"%"==d[_];++_);for(var E=C&&"!"==d[C-1]||_<u&&"1"==d[_]?"1":"N",O=C;O<_;++O)d[O]=E;C=_-1}}for(var k=0,T=c;k<u;++k){var P=d[k];"L"==T&&"1"==P?d[k]="L":i.test(P)&&(T=P)}for(var M=0;M<u;++M)if(o.test(d[M])){var A=void 0;for(A=M+1;A<u&&o.test(d[A]);++A);for(var D="L"==(M?d[M-1]:c),N=D==("L"==(A<u?d[A]:c))?D?"L":"R":c,R=M;R<A;++R)d[R]=N;M=A-1}for(var j,I=[],L=0;L<u;)if(a.test(d[L])){var F=L;for(++L;L<u&&a.test(d[L]);++L);I.push(new l(0,F,L))}else{var V=L,B=I.length,z="rtl"==t?1:0;for(++L;L<u&&"L"!=d[L];++L);for(var H=V;H<L;)if(s.test(d[H])){V<H&&(I.splice(B,0,new l(1,V,H)),B+=z);var $=H;for(++H;H<L&&s.test(d[H]);++H);I.splice(B,0,new l(2,$,H)),B+=z,V=H}else++H;V<L&&I.splice(B,0,new l(1,V,L))}return"ltr"==t&&(1==I[0].level&&(j=e.match(/^\s+/))&&(I[0].from=j[0].length,I.unshift(new l(0,0,j[0].length))),1==J(I).level&&(j=e.match(/\s+$/))&&(J(I).to-=j[0].length,I.push(new l(0,u-j[0].length,u)))),"rtl"==t?I.reverse():I}}();function ge(e,t){var n=e.order;return null==n&&(n=e.order=he(e.text,t)),n}var me=[],ve=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||me).concat(n)}};function ye(e,t){return e._handlers&&e._handlers[t]||me}function be(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,o=r&&r[t];if(o){var i=$(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function we(e,t){var n=ye(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function xe(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,n||t.type,e,t),ke(t)||t.codemirrorIgnore}function Ce(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==$(n,t[r])&&n.push(t[r])}function Se(e,t){return ye(e,t).length>0}function _e(e){e.prototype.on=function(e,t){ve(this,e,t)},e.prototype.off=function(e,t){be(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Te(e){Ee(e),Oe(e)}function Pe(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ae,De,Ne=function(){if(a&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function Re(e){if(null==Ae){var t=M("span","");P(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ae?M("span",""):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function je(e){if(null!=De)return De;var t=P(e,document.createTextNode("AخA")),n=O(t,0,1).getBoundingClientRect(),r=O(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(De=r.right-n.right<3)}var Ie,Le=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ve="oncopy"in(Ie=M("div"))||(Ie.setAttribute("oncopy","return;"),"function"==typeof Ie.oncopy),Be=null;function ze(e){if(null!=Be)return Be;var t=P(e,M("span","x")),n=t.getBoundingClientRect(),r=O(t,0,1).getBoundingClientRect();return Be=Math.abs(n.left-r.left)>1}var He={},$e={};function We(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),He[e]=t}function Ue(e,t){$e[e]=t}function qe(e){if("string"==typeof e&&$e.hasOwnProperty(e))e=$e[e];else if(e&&"string"==typeof e.name&&$e.hasOwnProperty(e.name)){var t=$e[e.name];"string"==typeof t&&(t={name:t}),(e=ne(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=qe(t);var n=He[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if(Ye.hasOwnProperty(t.name)){var o=Ye[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ye={};function Ke(e,t){B(t,Ye.hasOwnProperty(e)?Ye[e]:Ye[e]={})}function Ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Xe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Je(e,t,n){return!e.startState||e.startState(t,n)}var Qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function et(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function tt(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,(function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o})),r}function nt(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function rt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ot(e){if(null==e.parent)return null;for(var t=e.parent,n=$(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function it(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function at(e,t){return t>=e.first&&t<e.first+e.size}function st(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function lt(e,t,n){if(void 0===n&&(n=null),!(this instanceof lt))return new lt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ut(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function dt(e){return lt(e.line,e.ch)}function pt(e,t){return ct(e,t)<0?t:e}function ft(e,t){return ct(e,t)<0?e:t}function ht(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return lt(e.first,0);var n=e.first+e.size-1;return t.line>n?lt(n,et(e,n).text.length):mt(t,et(e,t.line).text.length)}function mt(e,t){var n=e.ch;return null==n||n>t?lt(e.line,t):n<0?lt(e.line,0):e}function vt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=gt(e,t[r]);return n}Qe.prototype.eol=function(){return this.pos>=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.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)},Qe.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var yt=function(e,t){this.state=e,this.lookAhead=t},bt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function wt(e,t,n,r){var o=[e.state.modeGen],i={};Pt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Pt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=o[l];r>e&&o.splice(l,1,e,o[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function xt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ct(e,ot(t)),o=t.text.length>e.options.maxHighlightLength&&Ze(e.doc.mode,r.state),i=wt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ct(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new bt(r,!0,t);var i=Mt(e,t,n),a=i>r.first&&et(r,i-1).stateAfter,s=a?bt.fromSaved(r,a,i):new bt(r,Je(r.mode),i);return r.iter(i,t,(function(n){St(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function St(e,t,n,r){var o=e.doc.mode,i=new Qe(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&_t(o,n.state);!i.eol();)Et(o,i,n.state),i.start=i.pos}function _t(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Xe(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Et(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Xe(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},bt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bt.fromSaved=function(e,t,n){return t instanceof yt?new bt(e,Ze(e.mode,t.state),n,t.lookAhead):new bt(e,Ze(e.mode,t),n)},bt.prototype.save=function(e){var t=!1!==e?Ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new yt(t,this.maxLookAhead):t};var Ot=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function kt(e,t,n,r){var o,i,a=e.doc,s=a.mode,l=et(a,(t=gt(a,t)).line),c=Ct(e,t.line,n),u=new Qe(l.text,e.options.tabSize,c);for(r&&(i=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=Et(s,u,c.state),r&&i.push(new Ot(u,o,Ze(a.mode,c.state)));return r?i:new Ot(u,o,c.state)}function Tt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Pt(e,t,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new Qe(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];for(""==t&&Tt(_t(n,r.state),i);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&St(e,t,r,d.pos),d.pos=t.length,l=null):l=Tt(Et(n,d,r.state,p),i),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;c<d.start;)o(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);o(h,u),c=h}}function Mt(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=et(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof yt?c.lookAhead:0)<=i.modeFrontier))return s;var u=z(l.text,null,e.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}function At(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=et(e,r).stateAfter;if(o&&(!(o instanceof yt)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Dt=!1,Nt=!1;function Rt(){Dt=!0}function jt(){Nt=!0}function It(e,t,n){this.marker=e,this.from=t,this.to=n}function Lt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ft(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Vt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Bt(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new It(a,i.from,s?null:i.to))}}return r}function zt(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new It(a,s?null:i.from-t,null==i.to?null:i.to-t))}}return r}function Ht(e,t){if(t.full)return null;var n=at(e,t.from.line)&&et(e,t.from.line).markedSpans,r=at(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,a=0==ct(t.from,t.to),s=Bt(n,o,a),l=zt(r,i,a),c=1==t.text.length,u=J(t.text).length+(c?o:0);if(s)for(var d=0;d<s.length;++d){var p=s[d];if(null==p.to){var f=Lt(l,p.marker);f?c&&(p.to=null==f.to?null:f.to+u):p.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?Lt(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=$t(s)),l&&l!=s&&(l=$t(l));var m=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new It(s[b].marker,null,null));for(var w=0;w<y;++w)m.push(v);m.push(l)}return m}function $t(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Wt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=$(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:t,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(!(ct(c.to,s.from)<0||ct(c.from,s.to)>0)){var u=[l,1],d=ct(c.from,s.from),p=ct(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}function Ut(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function qt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Gt(e){return e.inclusiveLeft?-1:0}function Yt(e){return e.inclusiveRight?1:0}function Kt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=ct(r.from,o.from)||Gt(e)-Gt(t);if(i)return-i;var a=ct(r.to,o.to)||Yt(e)-Yt(t);return a||t.id-e.id}function Zt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!n||Kt(n,o.marker)<0)&&(n=o.marker);return n}function Xt(e){return Zt(e,!0)}function Jt(e){return Zt(e,!1)}function Qt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Kt(n,i.marker)<0)&&(n=i.marker)}return n}function en(e,t,n,r,o){var i=et(e,t),a=Nt&&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=ct(c.from,n)||Gt(l.marker)-Gt(o),d=ct(c.to,r)||Yt(l.marker)-Yt(o);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ct(c.to,n)>=0:ct(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ct(c.from,r)<=0:ct(c.from,r)<0)))return!0}}}function tn(e){for(var t;t=Xt(e);)e=t.find(-1,!0).line;return e}function nn(e){for(var t;t=Jt(e);)e=t.find(1,!0).line;return e}function rn(e){for(var t,n;t=Jt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function on(e,t){var n=et(e,t),r=tn(n);return n==r?t:ot(r)}function an(e,t){if(t>e.lastLine())return t;var n,r=et(e,t);if(!sn(e,r))return t;for(;n=Jt(r);)r=n.find(1,!0).line;return ot(r)+1}function sn(e,t){var n=Nt&&t.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(e,t,r))return!0}}function ln(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return ln(e,r.line,Lt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.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(e,t,o))return!0}function cn(e){for(var t=0,n=(e=tn(e)).parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=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;t+=s.height}return t}function un(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Xt(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=Jt(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function dn(e){var t=e.display,n=e.doc;t.maxLine=et(n,n.first),t.maxLineLength=un(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=un(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var pn=function(e,t,n){this.text=e,qt(this,t),this.height=n?n(this):1};function fn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ut(e),qt(e,n);var o=r?r(e):1;o!=e.height&&rt(e,o)}function hn(e){e.parent=null,Ut(e)}pn.prototype.lineNo=function(){return ot(this)},_e(pn);var gn={},mn={};function vn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?mn:gn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function yn(e,t){var n=A("span",null,null,l?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=wn,je(e.display.measure)&&(a=ge(i,e.doc.direction))&&(r.addToken=Cn(r.addToken,a)),r.map=[],_n(i,r,xt(e,i,t!=e.display.externalMeasured&&ot(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=j(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=j(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Re(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.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 we(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function bn(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function wn(e,t,n,r,o,i,l){if(t){var c,u=e.splitSpaces?xn(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var h=d.exec(t),g=h?h.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(M("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!h)break;f+=g+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(M("span",X(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(M("span","\r"==h[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(M("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||p||i||l){var w=n||"";r&&(w+=r),o&&(w+=o);var x=M("span",[c],w,i);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return e.content.appendChild(x)}e.content.appendChild(c)}}function xn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}function Cn(e,t){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 d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(n,r,o,i,a,s,l);e(n,r.slice(0,d.to-c),o,i,null,s,l),i=null,r=r.slice(d.to-c),c=d.to}}}function Sn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function _n(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,c,u,d,p,f=o.length,h=0,g=1,m="",v=0;;){if(v==h){l=c=u=s="",p=null,d=null,v=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==h&&C.widgetNode)y.push(C);else if(x.from<=h&&(null==x.to||x.to>h||C.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==h&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((p||(p={})).title=C.title),C.attributes)for(var S in C.attributes)(p||(p={}))[S]=C.attributes[S];C.collapsed&&(!d||Kt(d.marker,C)<0)&&(d=x)}else x.from>h&&v>x.from&&(v=x.from)}if(b)for(var _=0;_<b.length;_+=2)b[_+1]==v&&(c+=" "+b[_]);if(!d||d.from==h)for(var E=0;E<y.length;++E)Sn(t,0,y[E]);if(d&&(d.from||0)==h){if(Sn(t,(null==d.to?f+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=f)break;for(var O=Math.min(f,v);;){if(m){var k=h+m.length;if(!d){var T=k>O?m.slice(0,O-h):m;t.addToken(t,T,a?a+l:l,u,h+T.length==v?c:"",s,p)}if(k>=O){m=m.slice(O-h),h=O;break}h=k,u=""}m=o.slice(i,i=n[g++]),a=vn(n[g++],t.cm.options)}}else for(var P=1;P<n.length;P+=2)t.addToken(t,o.slice(i,i=n[P]),vn(n[P+1],t.cm.options))}function En(e,t,n){this.line=t,this.rest=rn(t),this.size=this.rest?ot(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sn(e,t)}function On(e,t,n){for(var r,o=[],i=t;i<n;i=r){var a=new En(e.doc,et(e.doc,i),i);r=i+a.size,o.push(a)}return o}var kn=null;function Tn(e){kn?kn.ops.push(e):e.ownsGroup=kn={ops:[e],delayedCallbacks:[]}}function Pn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}function Mn(e,t){var n=e.ownsGroup;if(n)try{Pn(n)}finally{kn=null,t(n)}}var An=null;function Dn(e,t){var n=ye(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);kn?r=kn.delayedCallbacks:An?r=An:(r=An=[],setTimeout(Nn,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},a=0;a<n.length;++a)i(a)}}function Nn(){var e=An;An=null;for(var t=0;t<e.length;++t)e[t]()}function Rn(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?Fn(e,t):"gutter"==i?Bn(e,t,n,r):"class"==i?Vn(e,t):"widget"==i&&zn(e,t,r)}t.changes=null}function jn(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function In(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=jn(t);t.background=r.insertBefore(M("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Ln(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):yn(e,t)}function Fn(e,t){var n=t.text.className,r=Ln(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Vn(e,t)):n&&(t.text.className=n)}function Vn(e,t){In(e,t),t.line.wrapClass?jn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Bn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=jn(t);t.gutterBackground=M("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=jn(t),s=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(M("div",st(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function zn(e,t,n){t.alignable&&(t.alignable=null);for(var r=E("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&t.node.removeChild(o);$n(e,t,n)}function Hn(e,t,n,r){var o=Ln(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),Vn(e,t),Bn(e,t,n,r),$n(e,t,r),t.node}function $n(e,t,n){if(Wn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Wn(e,t.rest[r],t,n,!1)}function Wn(e,t,n,r,o){if(t.widgets)for(var i=jn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Un(l,c,n,r),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),Dn(l,"redraw")}}function Un(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function qn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),P(t.display.measure,M("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Gn(e,t){for(var n=Pe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yn(e){return e.lineSpace.offsetTop}function Kn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Zn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=P(e.measure,M("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Xn(e){return W-e.display.nativeBarWidth}function Jn(e){return e.display.scroller.clientWidth-Xn(e)-e.display.barWidth}function Qn(e){return e.display.scroller.clientHeight-Xn(e)-e.display.barHeight}function er(e,t,n){var r=e.options.lineWrapping,o=r&&Jn(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var a=t.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 tr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(ot(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function nr(e,t){var n=ot(t=tn(t)),r=e.display.externalMeasured=new En(e.doc,t,n);r.lineN=n;var o=r.built=yn(e,r);return r.text=o.pre,P(e.display.lineMeasure,o.pre),r}function rr(e,t,n,r){return ar(e,ir(e,t),n,r)}function or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Vr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function ir(e,t){var n=ot(t),r=or(e,n);r&&!r.text?r=null:r&&r.changes&&(Rn(e,r,n,Rr(e)),e.curOp.forceUpdate=!0),r||(r=nr(e,t));var o=tr(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function ar(e,t,n,r,o){t.before&&(n=-1);var i,a=n+(r||"");return t.cache.hasOwnProperty(a)?i=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(er(e,t.view,t.rect),t.hasHeights=!0),(i=dr(e,t,n,r)).bogus||(t.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(e,t,n){for(var r,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?i=1+(o=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function ur(e,t){var n=lr;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function dr(e,t,n,r){var o,i=cr(t.map,n,r),l=i.node,c=i.start,u=i.end,d=i.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;c&&le(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&le(t.line.text.charAt(i.coverStart+u));)++u;if((o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():ur(O(l,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,d="right"}a&&s<11&&(o=pr(e.display.measure,o))}else{var f;c>0&&(d=r="right"),o=e.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(e.display),top:h.top,bottom:h.bottom}:lr}for(var g=o.top-t.rect.top,m=o.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==d?o.right:o.left)-t.rect.left,right:("left"==d?o.left:o.right)-t.rect.left,top:w,bottom:x};return o.left||o.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=m),C}function pr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!ze(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function hr(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)fr(e.display.view[t])}function gr(e){hr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function mr(e){return u&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function vr(e){return u&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function yr(e){var t=tn(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=qn(t[r]));return n}function br(e,t,n,r,o){if(!o){var i=yr(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=cn(t);if("local"==r?a+=Yn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:vr(L(e)));var l=s.left+("window"==r?0:mr(L(e)));n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function wr(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=mr(L(e)),o-=vr(L(e));else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function xr(e,t,n,r,o){return r||(r=et(e.doc,t.line)),br(e,r,rr(e,r,t.ch,o),n)}function Cr(e,t,n,r,o,i){function a(t,a){var s=ar(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,br(e,r,s,n)}r=r||et(e.doc,t.line),o||(o=ir(e,r));var s=ge(r,e.doc.direction),l=t.ch,c=t.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(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=fe(s,l,c),p=pe,f=u(l,d,"before"==c);return null!=p&&(f.other=u(l,p,"before"!=c)),f}function Sr(e,t){var n=0;t=gt(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=et(e.doc,t.line),o=cn(r)+Yn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function _r(e,t,n,r,o){var i=lt(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Er(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return _r(r.first,0,null,-1,-1);var o=it(r,n),i=r.first+r.size-1;if(o>i)return _r(r.first+r.size-1,et(r,i).text.length,null,1,1);t<0&&(t=0);for(var a=et(r,o);;){var s=Pr(e,a,o,t,n),l=Qt(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=et(r,o=c.line)}}function Or(e,t,n,r){r-=yr(t);var o=t.text.length,i=ue((function(t){return ar(e,n,t-1).bottom<=r}),o,0);return{begin:i,end:o=ue((function(t){return ar(e,n,t).top>r}),i,o)}}function kr(e,t,n,r){return n||(n=ir(e,t)),Or(e,t,n,br(e,t,ar(e,n,r),"line").top)}function Tr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Pr(e,t,n,r,o){o-=cn(t);var i=ir(e,t),a=yr(t),s=0,l=t.text.length,c=!0,u=ge(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Ar:Mr)(e,t,n,i,u,r,o);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var p,f,h=null,g=null,m=ue((function(t){var n=ar(e,i,t);return n.top+=a,n.bottom+=a,!!Tr(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left<g.right-r,b=y==c;m=h+(b?0:1),f=b?"after":"before",p=y?g.left:g.right}else{c||m!=l&&m!=s||m++,f=0==m?"after":m==t.text.length?"before":ar(e,i,m-(c?1:0)).bottom+a<=o==c?"after":"before";var w=Cr(e,lt(n,m,f),"line",t,i);p=w.left,v=o<w.top?-1:o>=w.bottom?1:0}return _r(n,m=ce(t.text,m,1),f,v,r-p)}function Mr(e,t,n,r,o,i,a){var s=ue((function(s){var l=o[s],c=1!=l.level;return Tr(Cr(e,lt(n,c?l.to:l.from,c?"before":"after"),"line",t,r),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=Cr(e,lt(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Tr(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function Ar(e,t,n,r,o,i,a){var s=Or(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<o.length;p++){var f=o[p];if(!(f.from>=c||f.to<=l)){var h=ar(e,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||d>g)&&(u=f,d=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 Dr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==sr){sr=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)sr.appendChild(document.createTextNode("x")),sr.appendChild(M("br"));sr.appendChild(document.createTextNode("x"))}P(e.measure,sr);var n=sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),n=M("pre",[t],"CodeMirror-line-like");P(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function Rr(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:jr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function jr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ir(e){var t=Dr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(o){if(sn(e.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)*t:i+t}}function Lr(e){var t=e.doc,n=Ir(e);t.iter((function(e){var t=n(e);t!=e.height&&rt(e,t)}))}function Fr(e,t,n,r){var o=e.display;if(!n&&"true"==Pe(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Er(e,i,a);if(r&&c.xRel>0&&(l=et(e.doc,c.line).text).length==c.ch){var u=z(l,l.length,e.options.tabSize)-l.length;c=lt(c.line,Math.max(0,Math.round((i-Zn(e.display).left)/Nr(e.display))-u))}return c}function Vr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Br(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Nt&&on(e.doc,t)<o.viewTo&&Hr(e);else if(n<=o.viewFrom)Nt&&an(e.doc,n+r)>o.viewFrom?Hr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)Hr(e);else if(t<=o.viewFrom){var i=$r(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):Hr(e)}else if(n>=o.viewTo){var a=$r(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):Hr(e)}else{var s=$r(e,t,t,-1),l=$r(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(On(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):Hr(e)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(o.externalMeasured=null))}function zr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[Vr(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==$(a,n)&&a.push(n)}}}function Hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function $r(e,t,n,r){var o,i=Vr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;on(e.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(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=On(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=On(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Vr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(On(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Vr(e,n)))),r.viewTo=n}function Ur(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function qr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Gr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var c=l.empty();if(a){var u=a(e,l);u&&Yr(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&Yr(e,l.head,o);c||Zr(e,l,i)}}return r}function Yr(e,t,n){var r=Cr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(M("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)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var i=xr(e,t,"div",null,null),a=i.right-i.left;o.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(M("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 Kr(e,t){return e.top-t.top||e.left-t.left}function Zr(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),a=Zn(e.display),s=a.left,l=Math.max(r.sizerWidth,Jn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var i,a,d=et(o,t),p=d.text.length;function f(n,r){return xr(e,lt(t,n),"div",d,r)}function h(t,n,r){var o=kr(e,d,null,t),i="ltr"==n==("after"==r)?"left":"right";return f("after"==r?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),i)[i]}var g=ge(d,o.direction);return de(g,n||0,null==r?p:r,(function(e,t,o,d){var m="ltr"==o,v=f(e,m?"left":"right"),y=f(t-1,m?"right":"left"),b=null==n&&0==e,w=null==r&&t==p,x=0==d,C=!g||d==g.length-1;if(y.top-v.top<=3){var S=(c?w:b)&&C,_=(c?b:w)&&x?s:(m?v:y).left,E=S?l:(m?y:v).right;u(_,v.top,E-_,v.bottom)}else{var O,k,T,P;m?(O=c&&b&&x?s:v.left,k=c?l:h(e,o,"before"),T=c?s:h(t,o,"after"),P=c&&w&&C?l:y.right):(O=c?h(e,o,"before"):s,k=!c&&b&&x?l:v.right,T=!c&&w&&C?s:y.left,P=c?h(t,o,"after"):l),u(O,v.top,k-O,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(T,y.top,P-T,y.bottom)}(!i||Kr(v,i)<0)&&(i=v),Kr(y,i)<0&&(i=y),(!a||Kr(v,a)<0)&&(a=v),Kr(y,a)<0&&(a=y)})),{start:i,end:a}}var p=t.from(),f=t.to();if(p.line==f.line)d(p.line,p.ch,f.ch);else{var h=et(o,p.line),g=et(o,f.line),m=tn(h)==tn(g),v=d(p.line,p.ch,m?h.text.length+1:null).end,y=d(f.line,m?0:null,f.ch).start;m&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(i)}function Xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||to(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Jr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||eo(e))}function Qr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&to(e))}),100)}function eo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Xr(e))}function to(e,t){e.state.delayingBlurEvent||(e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,k(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function no(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,l=0;l<t.view.length;l++){var c=t.view[l],u=e.options.lineWrapping,d=void 0,p=0;if(!c.hidden){if(o+=c.line.height,a&&s<8){var f=c.node.offsetTop+c.node.offsetHeight;d=f-n,n=f}else{var h=c.node.getBoundingClientRect();d=h.bottom-h.top,!u&&c.text.firstChild&&(p=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var g=c.line.height-d;if((g>.005||g<-.005)&&(o<r&&(i-=g),rt(c.line,d),ro(c.line),c.rest))for(var m=0;m<c.rest.length;m++)ro(c.rest[m]);if(p>e.display.sizerWidth){var v=Math.ceil(p/Nr(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function ro(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function oo(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Yn(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=it(t,r),a=it(t,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=it(t,cn(et(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=it(t,cn(et(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function io(e,t){if(!xe(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null,i=n.wrapper.ownerDocument;if(t.top+r.top<0?o=!0:t.bottom+r.top>(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(o=!1),null!=o&&!g){var a=M("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Yn(e.display))+"px;\n height: "+(t.bottom-t.top+Xn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function ao(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?lt(t.line,t.ch+1,"before"):t,t=t.ch?lt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=Cr(e,t),l=n&&n!=t?Cr(e,n):s,c=lo(e,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=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(mo(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(yo(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return o}function so(e,t){var n=lo(e,t);null!=n.scrollTop&&mo(e,n.scrollTop),null!=n.scrollLeft&&yo(e,n.scrollLeft)}function lo(e,t){var n=e.display,r=Dr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Qn(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+Kn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Jn(e)-n.gutters.offsetWidth,h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>f+p-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function co(e,t){null!=t&&(ho(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function uo(e){ho(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function po(e,t,n){null==t&&null==n||ho(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function fo(e,t){ho(e),e.curOp.scrollToPos=t}function ho(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,go(e,Sr(e,t.from),Sr(e,t.to),t.margin))}function go(e,t,n,r){var o=lo(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});po(e,o.scrollLeft,o.scrollTop)}function mo(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Go(e,{top:t}),vo(e,t,!0),n&&Go(e),Vo(e,100))}function vo(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function yo(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bo(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Kn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var wo=function(e,t,n){this.cm=n;var r=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),ve(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),ve(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wo.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},wo.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wo.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wo.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new H,this.disableVert=new H},wo.prototype.enableZeroWidthBar=function(e,t,n){function r(){var o=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,r)}e.style.visibility="",t.set(1e3,r)},wo.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xo=function(){};function Co(e,t){t||(t=bo(e));var n=e.display.barWidth,r=e.display.barHeight;So(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&no(e),So(e,bo(e)),n=e.display.barWidth,r=e.display.barHeight}function So(e,t){var n=e.display,r=n.scrollbars.update(t);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&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.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 _o={native:wo,null:xo};function Eo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _o[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?yo(e,t):mo(e,t)}),e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var Oo=0;function ko(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.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:++Oo,markArrays:null},Tn(e.curOp)}function To(e){var t=e.curOp;t&&Mn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Po(e)}))}function Po(e){for(var t=e.ops,n=0;n<t.length;n++)Mo(t[n]);for(var r=0;r<t.length;r++)Ao(t[r]);for(var o=0;o<t.length;o++)Do(t[o]);for(var i=0;i<t.length;i++)No(t[i]);for(var a=0;a<t.length;a++)Ro(t[a])}function Mo(e){var t=e.cm,n=t.display;Ho(t),e.updateMaxLine&&dn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new zo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ao(e){e.updatedDisplay=e.mustUpdate&&Uo(e.cm,e.update)}function Do(e){var t=e.cm,n=t.display;e.updatedDisplay&&no(t),e.barMeasure=bo(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=rr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Jn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function No(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&yo(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N(L(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Co(t,e.barMeasure),e.updatedDisplay&&Zo(t,e.barMeasure),e.selectionChanged&&Xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Jr(e.cm)}function Ro(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&qo(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&vo(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&yo(t,e.scrollLeft,!0,!0),e.scrollToPos&&io(t,ao(t,gt(r,e.scrollToPos.from),gt(r,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||we(o[a],"hide");if(i)for(var s=0;s<i.length;++s)i[s].lines.length&&we(i[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function jo(e,t){if(e.curOp)return t();ko(e);try{return t()}finally{To(e)}}function Io(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ko(e);try{return t.apply(e,arguments)}finally{To(e)}}}function Lo(e){return function(){if(this.curOp)return e.apply(this,arguments);ko(this);try{return e.apply(this,arguments)}finally{To(this)}}}function Fo(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ko(t);try{return e.apply(this,arguments)}finally{To(t)}}}function Vo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,V(Bo,e))}function Bo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ct(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?Ze(t.mode,r.state):null,l=wt(e,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 d=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=i.styles[p];d&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&St(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Vo(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&jo(e,(function(){for(var t=0;t<o.length;t++)zr(e,o[t],"text")}))}}var zo=function(e,t,n){var r=e.display;this.viewport=t,this.visible=oo(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Jn(e),this.force=n,this.dims=Rr(e),this.events=[]};function Ho(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Xn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xn(e)+"px",t.scrollbarsClipped=!0)}function $o(e){if(e.hasFocus())return null;var t=N(L(e));if(!t||!D(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=F(e).getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Wo(e){if(e&&e.activeElt&&e.activeElt!=N(e.activeElt.ownerDocument)&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Uo(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ur(e))return!1;Jo(e)&&(Hr(e),t.dims=Rr(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.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)),Nt&&(i=on(e.doc,i),a=an(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Wr(e,i,a),n.viewOffset=cn(et(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ur(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=$o(e);return l>4&&(n.lineDiv.style.display="none"),Yo(e,n.updateLineNumbers,t.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=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Vo(e,400)),n.updateLineNumbers=null,!0}function qo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Jn(e))r&&(t.visible=oo(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Kn(e.display)-Qn(e),n.top)}),t.visible=oo(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Uo(e,t))break;no(e);var o=bo(e);qr(e),Co(e,o),Zo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Go(e,t){var n=new zo(e,t);if(Uo(e,n)){no(e),qo(e,n);var r=bo(e);qr(e),Co(e,r),Zo(e,r),n.finish()}}function Yo(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var p=c[d];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;a!=p.node;)a=s(a);var f=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&($(p.changes,"gutter")>-1&&(f=!1),Rn(e,p,u,n)),f&&(T(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(st(e.options,u)))),a=p.node.nextSibling}else{var h=Hn(e,p,u,n);i.insertBefore(h,a)}u+=p.size}for(;a;)a=s(a)}function Ko(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Dn(e,"gutterChanged",e)}function Zo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Xn(e)+"px"}function Xo(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=jr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.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}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function Jo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=st(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(M("div",[M("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",Ko(e.display),!0}return!1}function Qo(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ei(e){var t=e.gutters,n=e.gutterSpecs;T(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,a=o.style,s=t.appendChild(M("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ko(e)}function ti(e){ei(e.display),Br(e),Xo(e)}function ni(e,t,r,o){var i=this;this.input=r,i.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=A("div",null,"CodeMirror-code"),i.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=M("div",null,"CodeMirror-cursors"),i.measure=M("div",null,"CodeMirror-measure"),i.lineMeasure=M("div",null,"CodeMirror-measure"),i.lineSpace=A("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=A("div",[i.lineSpace],"CodeMirror-lines");i.mover=M("div",[c],null,"position: relative"),i.sizer=M("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=M("div",null,null,"position: absolute; height: "+W+"px; width: 1px;"),i.gutters=M("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=M("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=M("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),u&&d>=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),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.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),ei(i),r.init(i)}zo.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},zo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};var ri=0,oi=null;function ii(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function ai(e){var t=ii(e);return t.x*=oi,t.y*=oi,t}function si(e,t){u&&102==d&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=ii(t),o=r.x,i=r.y,a=oi;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,a=1);var s=e.display,c=s.scroller,f=c.scrollWidth>c.clientWidth,h=c.scrollHeight>c.clientHeight;if(o&&f||i&&h){if(i&&b&&l)e:for(var g=t.target,m=s.view;g!=c;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){e.display.currentWheelTarget=g;break e}if(o&&!n&&!p&&null!=a)return i&&h&&mo(e,Math.max(0,c.scrollTop+i*a)),yo(e,Math.max(0,c.scrollLeft+o*a)),(!i||i&&h)&&Ee(t),void(s.wheelStartX=null);if(i&&null!=a){var y=i*a,w=e.doc.scrollTop,x=w+s.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):x=Math.min(e.doc.height,x+y+50),Go(e,{top:w,bottom:x})}ri<20&&0!==t.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 e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/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(e,t){this.ranges=e,this.primIndex=t};li.prototype.primary=function(){return this.ranges[this.primIndex]},li.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ut(n.anchor,r.anchor)||!ut(n.head,r.head))return!1}return!0},li.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ci(dt(this.ranges[t].anchor),dt(this.ranges[t].head));return new li(e,this.primIndex)},li.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},li.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ct(t,r.from())>=0&&ct(e,r.to())<=0)return n}return-1};var ci=function(e,t){this.anchor=e,this.head=t};function ui(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return ct(e.from(),t.from())})),n=$(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=ct(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=ft(s.from(),a.from()),u=pt(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,t.splice(--i,2,new ci(d?u:c,d?c:u))}}return new li(t,n)}function di(e,t){return new li([new ci(e,t||e)],0)}function pi(e){return e.text?lt(e.from.line+e.text.length-1,J(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function fi(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return pi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=pi(t).ch-t.to.ch),lt(n,r)}function hi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new ci(fi(o.anchor,t),fi(o.head,t)))}return ui(e.cm,n,e.sel.primIndex)}function gi(e,t,n){return e.line==t.line?lt(n.line,e.ch-t.ch+n.ch):lt(n.line+(e.line-t.line),e.ch)}function mi(e,t,n){for(var r=[],o=lt(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=gi(s.from,o,i),c=gi(pi(s),o,i);if(o=s.to,i=c,"around"==n){var u=e.sel.ranges[a],d=ct(u.head,u.anchor)<0;r[a]=new ci(d?c:l,d?l:c)}else r[a]=new ci(l,l)}return new li(r,e.sel.primIndex)}function vi(e){e.doc.mode=Ge(e.options,e.doc.modeOption),yi(e)}function yi(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Vo(e,100),e.state.modeGen++,e.curOp&&Br(e)}function bi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==J(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function wi(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){fn(e,n,o,r),Dn(e,"change",e,t)}function a(e,t){for(var n=[],i=e;i<t;++i)n.push(new pn(c[i],o(i),r));return n}var s=t.from,l=t.to,c=t.text,u=et(e,s.line),d=et(e,l.line),p=J(c),f=o(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(bi(e,t)){var g=a(0,c.length-1);i(d,d.text,f),h&&e.remove(s.line,h),g.length&&e.insert(s.line,g)}else if(u==d)if(1==c.length)i(u,u.text.slice(0,s.ch)+p+u.text.slice(l.ch),f);else{var m=a(1,c.length-1);m.push(new pn(p+u.text.slice(l.ch),f,r)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,m)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(d,p+d.text.slice(l.ch),f);var v=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}Dn(e,"change",e,t)}function xi(e,t,n){function r(e,o,i){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function Ci(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Lr(e),vi(e),Si(e),e.options.direction=t.direction,e.options.lineWrapping||dn(e),e.options.mode=t.modeOption,Br(e)}function Si(e){("rtl"==e.doc.direction?R:k)(e.display.lineDiv,"CodeMirror-rtl")}function _i(e){jo(e,(function(){Si(e),Br(e)}))}function Ei(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Oi(e,t){var n={from:dt(t.from),to:pi(t),text:tt(e,t.from,t.to)};return Ni(e,n,t.from.line,t.to.line+1),xi(e,(function(e){return Ni(e,n,t.from.line,t.to.line+1)}),!0),n}function ki(e){for(;e.length&&J(e).ranges;)e.pop()}function Ti(e,t){return t?(ki(e.done),J(e.done)):e.done.length&&!J(e.done).ranges?J(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),J(e.done)):void 0}function Pi(e,t,n,r){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=Ti(o,o.lastOp==r)))a=J(i.changes),0==ct(t.from,t.to)&&0==ct(t.from,a.to)?a.to=pi(t):i.changes.push(Oi(e,t));else{var l=J(o.done);for(l&&l.ranges||Di(e.sel,o.done),i={changes:[Oi(e,t)],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=t.origin,a||we(e,"historyAdded")}function Mi(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ai(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||Mi(e,i,J(o.done),t))?o.done[o.done.length-1]=t:Di(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&ki(o.undone)}function Di(e,t){var n=J(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ni(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function Ri(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function ji(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push(Ri(n[o]));return r}function Ii(e,t){var n=ji(e,t),r=Ht(e,t);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)e: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 e;i.push(l)}else a&&(n[o]=a)}return n}function Li(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[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}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&$(t,Number(u[1]))>-1&&(J(s)[d]=c[d],delete c[d])}}}return r}function Fi(e,t,n,r){if(r){var o=e.anchor;if(n){var i=ct(t,o)<0;i!=ct(n,o)<0?(o=t,t=n):i!=ct(t,n)<0&&(t=n)}return new ci(o,t)}return new ci(n||t,t)}function Vi(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Ui(e,new li([Fi(e.sel.primary(),t,n,o)],0),r)}function Bi(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=Fi(e.sel.ranges[i],t[i],null,o);Ui(e,ui(e.cm,r,e.sel.primIndex),n)}function zi(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,Ui(e,ui(e.cm,o,e.sel.primIndex),r)}function Hi(e,t,n,r){Ui(e,di(t,n),r)}function $i(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new ci(gt(e,t[n].anchor),gt(e,t[n].head))},origin:n&&n.origin};return we(e,"beforeSelectionChange",e,r),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ui(e.cm,r.ranges,r.ranges.length-1):t}function Wi(e,t,n){var r=e.history.done,o=J(r);o&&o.ranges?(r[r.length-1]=t,qi(e,t,n)):Ui(e,t,n)}function Ui(e,t,n){qi(e,t,n),Ai(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function qi(e,t,n){(Se(e,"beforeSelectionChange")||e.cm&&Se(e.cm,"beforeSelectionChange"))&&(t=$i(e,t,n));var r=n&&n.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);Gi(e,Ki(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||uo(e.cm)}function Gi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),Dn(e,"cursorActivity",e))}function Yi(e){Gi(e,Ki(e,e.sel,null,!1))}function Ki(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=Xi(e,a.anchor,s&&s.anchor,n,r),c=a.head==a.anchor?l:Xi(e,a.head,s&&s.head,n,r);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new ci(l,c))}return o?ui(e.cm,o,t.primIndex):t}function Zi(e,t,n,r,o){var i=et(e,t.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<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(we(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=Ji(e,d,-r,d&&d.line==t.line?i:null)),d&&d.line==t.line&&(p=ct(d,n))&&(r<0?p<0:p>0))return Zi(e,d,t,r,o)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ji(e,f,r,f.line==t.line?i:null)),f?Zi(e,f,t,r,o):null}}return t}function Xi(e,t,n,r,o){var i=r||1,a=Zi(e,t,n,i,o)||!o&&Zi(e,t,n,i,!0)||Zi(e,t,n,-i,o)||!o&&Zi(e,t,n,-i,!0);return a||(e.cantEdit=!0,lt(e.first,0))}function Ji(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?gt(e,lt(t.line-1)):null:n>0&&t.ch==(r||et(e,t.line)).text.length?t.line<e.first+e.size-1?lt(t.line+1,0):null:new lt(t.line,t.ch+n)}function Qi(e){e.setSelection(lt(e.firstLine(),0),lt(e.lastLine()),q)}function ea(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,o,i){t&&(r.from=gt(e,t)),n&&(r.to=gt(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),we(e,"beforeChange",e,r),e.cm&&we(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ta(e,t,n){if(e.cm){if(!e.cm.curOp)return Io(e.cm,ta)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"))||(t=ea(e,t,!0))){var r=Dt&&!n&&Wt(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)na(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else na(e,t)}}function na(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ct(t.from,t.to)){var n=hi(e,t);Pi(e,t,n,e.cm?e.cm.curOp.id:NaN),ia(e,t,n,Ht(e,t));var r=[];xi(e,(function(e,n){n||-1!=$(r,e.history)||(ua(e.history,t),r.push(e.history)),ia(e,t,null,Ht(e,t))}))}}function ra(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],n?!o.ranges||o.equals(e.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(Di(o,l),n&&!o.equals(e.sel))return void Ui(e,o,{clearRedo:!1});a=o}var u=[];Di(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var d=Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"),p=function(n){var r=o.changes[n];if(r.origin=t,d&&!ea(e,r,!1))return s.length=0,{};u.push(Oi(e,r));var i=n?hi(e,r):J(s);ia(e,r,i,Ii(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:pi(r)});var a=[];xi(e,(function(e,t){t||-1!=$(a,e.history)||(ua(e.history,r),a.push(e.history)),ia(e,r,null,Ii(e,r))}))},f=o.changes.length-1;f>=0;--f){var h=p(f);if(h)return h.v}}}}function oa(e,t){if(0!=t&&(e.first+=t,e.sel=new li(Q(e.sel.ranges,(function(e){return new ci(lt(e.anchor.line+t,e.anchor.ch),lt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Br(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)zr(e.cm,r,"gutter")}}function ia(e,t,n,r){if(e.cm&&!e.cm.curOp)return Io(e.cm,ia)(e,t,n,r);if(t.to.line<e.first)oa(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);oa(e,o),t={from:lt(e.first,0),to:lt(t.to.line+o,t.to.ch),text:[J(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:lt(i,et(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tt(e,t.from,t.to),n||(n=hi(e,t)),e.cm?aa(e.cm,t,r):wi(e,t,r),qi(e,n,q),e.cantEdit&&Xi(e,lt(e.firstLine(),0))&&(e.cantEdit=!1)}}function aa(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=ot(tn(et(r,i.line))),r.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&Ce(e),wi(r,t,n,Ir(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,(function(e){var t=un(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),At(r,i.line),Vo(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?Br(e):i.line!=a.line||1!=t.text.length||bi(e.doc,t)?Br(e,i.line,a.line+1,c):zr(e,i.line,"text");var u=Se(e,"changes"),d=Se(e,"change");if(d||u){var p={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Dn(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function sa(e,t,n,r,o){var i;r||(r=n),ct(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ta(e,{from:n,to:r,text:t,origin:o})}function la(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ca(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)la(i.ranges[s].anchor,t,n,r),la(i.ranges[s].head,t,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=lt(c.from.line+r,c.from.ch),c.to=lt(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function ua(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;ca(e.done,n,r,o),ca(e.undone,n,r,o)}function da(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=et(e,ht(e,t)):o=ot(t),null==o?null:(r(i,o)&&e.cm&&zr(e.cm,o,n),i)}function pa(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function fa(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}ci.prototype.from=function(){return ft(this.anchor,this.head)},ci.prototype.to=function(){return pt(this.anchor,this.head)},ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},pa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,hn(o),Dn(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},fa.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pa))){var s=[];this.collapse(s),this.children=[new pa(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new pa(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}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new fa(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=$(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new fa(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var ha=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function ga(e,t,n){cn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&co(e,n)}function ma(e,t,n,r){var o=new ha(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),da(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!sn(e,t)){var r=cn(t)<e.scrollTop;rt(t,t.height+qn(o)),r&&co(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&Dn(i,"lineWidgetAdded",i,o,"number"==typeof t?t:ot(t)),o}ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ot(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=qn(this);rt(n,Math.max(0,n.height-i)),e&&(jo(e,(function(){ga(e,n,-i),zr(e,r,"widget")})),Dn(e,"lineWidgetCleared",e,this,r))}},ha.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=qn(this)-t;o&&(sn(this.doc,r)||rt(r,r.height+o),n&&jo(n,(function(){n.curOp.forceUpdate=!0,ga(n,r,o),Dn(n,"lineWidgetChanged",n,e,ot(r))})))},_e(ha);var va=0,ya=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++va};function ba(e,t,n,r,o){if(r&&r.shared)return xa(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return Io(e.cm,ba)(e,t,n,r,o);var i=new ya(e,o),a=ct(t,n);if(r&&B(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=A("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(en(e,t.line,t,n,i)||t.line!=n.line&&en(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");jt()}i.addToHistory&&Pi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&tn(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&rt(r,0),Vt(r,new It(i,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){sn(e,t)&&rt(t,0)})),i.clearOnEnter&&ve(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(Rt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++va,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)Br(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)zr(c,u,"text");i.atomic&&Yi(c.doc),Dn(c,"markerAdded",c,i)}return i}ya.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ko(e),Se(this,"clear")){var n=this.find();n&&Dn(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=Lt(a.markedSpans,this);e&&!this.collapsed?zr(e,ot(a),"text"):e&&(null!=s.to&&(o=ot(a)),null!=s.from&&(r=ot(a))),a.markedSpans=Ft(a.markedSpans,s),null==s.from&&this.collapsed&&!sn(this.doc,a)&&e&&rt(a,Dr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=tn(this.lines[l]),u=un(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Br(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Yi(e.doc)),e&&Dn(e,"markerCleared",e,this,r,o),t&&To(e),this.parent&&this.parent.clear()}},ya.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=Lt(i.markedSpans,this);if(null!=a.from&&(n=lt(t?i:ot(i),a.from),-1==e))return n;if(null!=a.to&&(r=lt(t?i:ot(i),a.to),1==e))return r}return n&&{from:n,to:r}},ya.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&jo(r,(function(){var o=t.line,i=ot(t.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&&rt(o,o.height+l)}Dn(r,"markerChanged",r,e)}))},ya.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=$(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ya.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},_e(ya);var wa=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function xa(e,t,n,r,o){(r=B(r)).shared=!1;var i=[ba(e,t,n,r,o)],a=i[0],s=r.widgetNode;return xi(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(ba(e,gt(e,t),gt(e,n),r,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=J(i)})),new wa(i,a)}function Ca(e){return e.findMarks(lt(e.first,0),e.clipPos(lt(e.lastLine())),(function(e){return e.parent}))}function Sa(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(ct(i,a)){var s=ba(e,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function _a(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];xi(n.primary.doc,(function(e){return r.push(e)}));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<e.length;n++)t(n)}wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Dn(this,"clear")}},wa.prototype.find=function(e,t){return this.primary.find(e,t)},_e(wa);var Ea=0,Oa=function(e,t,n,r,o){if(!(this instanceof Oa))return new Oa(e,t,n,r,o);null==n&&(n=0),fa.call(this,[new pa([new pn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=lt(n,0);this.sel=di(i),this.history=new Ei(null),this.id=++Ea,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),wi(this,{from:i,to:i,text:e}),Ui(this,di(i),q)};Oa.prototype=ne(fa.prototype,{constructor:Oa,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=nt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Fo((function(e){var t=lt(this.first,0),n=this.first+this.size-1;ta(this,{from:t,to:lt(n,et(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&po(this.cm,0,0),Ui(this,di(t),q)})),replaceRange:function(e,t,n,r){sa(this,e,t=gt(this,t),n=n?gt(this,n):t,r)},getRange:function(e,t,n){var r=tt(this,gt(this,e),gt(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e))return et(this,e)},getLineNumber:function(e){return ot(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=et(this,e)),tn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Fo((function(e,t,n){Hi(this,gt(this,"number"==typeof e?lt(e,t||0):e),null,n)})),setSelection:Fo((function(e,t,n){Hi(this,gt(this,e),gt(this,t||e),n)})),extendSelection:Fo((function(e,t,n){Vi(this,gt(this,e),t&>(this,t),n)})),extendSelections:Fo((function(e,t){Bi(this,vt(this,e),t)})),extendSelectionsBy:Fo((function(e,t){Bi(this,vt(this,Q(this.sel.ranges,e)),t)})),setSelections:Fo((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new ci(gt(this,e[o].anchor),gt(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ui(this,ui(this.cm,r,t),n)}})),addSelection:Fo((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new ci(gt(this,e),gt(this,t||e))),Ui(this,ui(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=tt(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=tt(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Fo((function(e,t,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(e[i]),origin:n}}for(var s=t&&"end"!=t&&mi(this,r,t),l=r.length-1;l>=0;l--)ta(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(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ei(this.history),xi(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Li(this.history.done),undone:Li(this.history.undone)}},setHistory:function(e){var t=this.history=new Ei(this.history);t.done=Li(e.done.slice(0),null,!0),t.undone=Li(e.undone.slice(0),null,!0)},setGutterMarker:Fo((function(e,t,n){return da(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ae(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Fo((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&da(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ae(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!at(this,e))return null;if(t=e,!(e=et(this,e)))return null}else if(null==(t=ot(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Fo((function(e,t,n){return da(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(E(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Fo((function(e,t,n){return da(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(E(n));if(!i)return!1;var a=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:Fo((function(e,t,n){return ma(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ba(this,gt(this,e),gt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ba(this,e=gt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=et(this,(e=gt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=gt(this,e),t=gt(this,t);var r=[],o=e.line;return this.iter(e.line,t.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==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n})),gt(this,lt(n,t))},indexFromPos:function(e){var t=(e=gt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Oa(nt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Oa(nt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sa(r,Ca(this)),r},unlinkDoc:function(e){if(e instanceof Bs&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),_a(Ca(this));break}if(e.history==this.history){var n=[e.id];xi(e,(function(e){return n.push(e.id)}),!0),e.history=new Ei(null),e.history.done=Li(this.history.done,n),e.history.undone=Li(this.history.undone,n)}},iterLinkedDocs:function(e){xi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Le(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Fo((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&_i(this.cm))}))}),Oa.prototype.eachLine=Oa.prototype.iter;var ka=0;function Ta(e){var t=this;if(Aa(t),!xe(t,e)&&!Gn(t.display,e)){Ee(e),a&&(ka=+new Date);var n=Fr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),s=0,l=function(){++s==o&&Io(t,(function(){var e={from:n=gt(t.doc,n),to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ta(t.doc,e),Wi(t.doc,di(gt(t.doc,n),gt(t.doc,pi(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==$(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),qi(t.doc,di(n,n)),p)for(var f=0;f<p.length;++f)sa(t.doc,"",p[f].anchor,p[f].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Pa(e,t){if(a&&(!e.state.draggingText||+new Date-ka<100))Te(t);else if(!xe(e,t)&&!Gn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=M("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),p&&n.parentNode.removeChild(n)}}function Ma(e,t){var n=Fr(e,t);if(n){var r=document.createDocumentFragment();Yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),P(e.display.dragCursor,r)}}function Aa(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Da(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var o=t[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Na=!1;function Ra(){Na||(ja(),Na=!0)}function ja(){var e;ve(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Da(Ia)}),100))})),ve(window,"blur",(function(){return Da(to)}))}function Ia(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var La={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++)La[Fa+48]=La[Fa+96]=String(Fa);for(var Va=65;Va<=90;Va++)La[Va]=String.fromCharCode(Va);for(var Ba=1;Ba<=12;Ba++)La[Ba+111]=La[Ba+63235]="F"+Ba;var za={};function Ha(e){var t,n,r,o,i=e.split(/-(?!$)/);e=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))t=!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 t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $a(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[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=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Wa(e,t,n,r){var o=(t=Ya(t)).call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Wa(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var a=Wa(e,t.fallthrough[i],n,r);if(a)return a}}}function Ua(e){var t="string"==typeof e?e:La[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function qa(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Ga(e,t){if(p&&34==e.keyCode&&e.char)return!1;var n=La[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),qa(n,e,t))}function Ya(e){return"string"==typeof e?za[e]:e}function Ka(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&ct(i.from,J(r).to)<=0;){var a=r.pop();if(ct(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}jo(e,(function(){for(var t=r.length-1;t>=0;t--)sa(e.doc,"",r[t].from,r[t].to,"+delete");uo(e)}))}function Za(e,t,n){var r=ce(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Xa(e,t,n){var r=Za(e,t.ch,n);return null==r?null:new lt(t.line,r,n<0?"after":"before")}function Ja(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ge(n,t.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"==t.doc.direction){var c=ir(t,n);a=o<0?n.text.length-1:0;var u=ar(t,c,a).top;a=ue((function(e){return ar(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Za(n,a,1))}else a=o<0?s.to:s.from;return new lt(r,a,l)}}return new lt(r,o<0?n.text.length:0,o<0?"before":"after")}function Qa(e,t,n,r){var o=ge(t,e.doc.direction);if(!o)return Xa(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=fe(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Xa(t,n,r);var s,l=function(e,n){return Za(t,e instanceof lt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||ir(e,t),kr(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,p=l(n,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var f=d?"before":"after";return new lt(n.line,p,f)}}var h=function(e,t,r){for(var i=function(e,t){return t?new lt(n.line,l(e,1),"before"):new lt(n.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>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 m=r>0?u.end:l(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=h(r>0?0:o.length-1,r,c(m)))?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 es={selectAll:Qi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Ka(e,(function(t){if(t.empty()){var n=et(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:lt(t.head.line+1,0)}:{from:t.head,to:lt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ka(e,(function(t){return{from:lt(t.from().line,0),to:gt(e.doc,lt(t.to().line+1,0))}}))},delLineLeft:function(e){return Ka(e,(function(e){return{from:lt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ka(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Ka(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(lt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(lt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ts(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return rs(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return ns(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?rs(e,t.head):r}),Y)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=z(e.getLine(i.line),i.ch,r);t.push(X(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return jo(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=et(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new lt(o.line,o.ch-1)),o.ch>0)o=new lt(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),lt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=et(e.doc,o.line-1).text;a&&(o=new lt(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),lt(o.line-1,a.length-1),o,"+transpose"))}n.push(new ci(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return jo(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);uo(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ts(e,t){var n=et(e.doc,t),r=tn(n);return r!=n&&(t=ot(r)),Ja(!0,e,r,t,1)}function ns(e,t){var n=et(e.doc,t),r=nn(n);return r!=n&&(t=ot(r)),Ja(!0,e,n,t,-1)}function rs(e,t){var n=ts(e,t.line),r=et(e.doc,n.line),o=ge(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return lt(n.line,a?0:i,n.sticky)}return n}function os(e,t,n){if("string"==typeof t&&!(t=es[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}function is(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Wa(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Wa(t,e.options.extraKeys,n,e)||Wa(t,e.options.keyMap,n,e)}var as=new H;function ss(e,t,n,r){var o=e.state.keySeq;if(o){if(Ua(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:as.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),ls(e,o+" "+t,n,r))return!0}return ls(e,t,n,r)}function ls(e,t,n,r){var o=is(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Dn(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ee(n),Xr(e)),!!o}function cs(e,t){var n=Ga(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ss(e,"Shift-"+n,t,(function(t){return os(e,t,!0)}))||ss(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return os(e,t)})):ss(e,n,t,(function(t){return os(e,t)})))}function us(e,t,n){return ss(e,"'"+n+"'",t,(function(t){return os(e,t,!0)}))}var ds=null;function ps(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=N(L(t)),xe(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=cs(t,e);p&&(ds=o?r:null,o||88!=r||Ve||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!o&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fs(t)}}function fs(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(k(t,"CodeMirror-crosshair"),be(document,"keyup",n),be(document,"mouseover",n))}R(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n)}function hs(e){16==e.keyCode&&(this.doc.sel.shift=!1),xe(this,e)}function gs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Gn(t.display,e)||xe(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(p&&n==ds)return ds=null,void Ee(e);if(!p||e.which&&!(e.which<10)||!cs(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(us(t,e,o)||t.display.input.onKeyPress(e))}}}var ms,vs,ys=400,bs=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ws(e,t){var n=+new Date;return vs&&vs.compare(n,e,t)?(ms=vs=null,"triple"):ms&&ms.compare(n,e,t)?(vs=new bs(n,e,t),ms=null,"double"):(ms=new bs(n,e,t),vs=null,"single")}function xs(e){var t=this,n=t.display;if(!(xe(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Gn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ms(t,e)){var r=Fr(t,e),o=Me(e),i=r?ws(r,o):"single";F(t).focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),r&&Cs(t,o,r,i,e)||(1==o?r?_s(t,r,i,e):Pe(e)==n.scroller&&Ee(e):2==o?(r&&Vi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(_?t.display.input.onContextMenu(e):Qr(t)))}}function Cs(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),ss(e,qa(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=es[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=U}finally{e.state.suppressEdits=!1}return r}))}function Ss(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=w?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.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 _s(e,t,n,r){a?setTimeout(V(Jr,e),0):e.curOp.focus=N(L(e));var o,i=Ss(e,n,r),s=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(o=s.contains(t))>-1&&(ct((o=s.ranges[o]).from(),t)<0||t.xRel>0)&&(ct(o.to(),t)>0||t.xRel<0)?Es(e,r,t,i):ks(e,r,t,i)}function Es(e,t,n,r){var o=e.display,i=!1,c=Io(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Qr(e)),be(o.wrapper.ownerDocument,"mouseup",c),be(o.wrapper.ownerDocument,"mousemove",u),be(o.scroller,"dragstart",d),be(o.scroller,"drop",c),i||(Ee(t),r.addNew||Vi(e.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(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,ve(o.wrapper.ownerDocument,"mouseup",c),ve(o.wrapper.ownerDocument,"mousemove",u),ve(o.scroller,"dragstart",d),ve(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Os(e,t,n){if("char"==n)return new ci(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ci(lt(t.line,0),gt(e.doc,lt(t.line+1,0)));var r=n(e,t);return new ci(r.from,r.to)}function ks(e,t,n,r){a&&Qr(e);var o=e.display,i=e.doc;Ee(t);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(e,t,!0,!0),l=-1;else{var d=Os(e,n,r.unit);s=r.extend?Fi(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,Ui(i,ui(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Ui(i,ui(e,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 p=n;function f(t){if(0!=ct(p,t))if(p=t,"rectangle"==r.unit){for(var o=[],a=e.options.tabSize,u=z(et(i,n.line).text,n.ch,a),d=z(et(i,t.line).text,t.ch,a),f=Math.min(u,d),h=Math.max(u,d),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=et(i,g).text,y=K(v,f,a);f==h?o.push(new ci(lt(g,y),lt(g,y))):v.length>y&&o.push(new ci(lt(g,y),lt(g,K(v,h,a))))}o.length||o.push(new ci(n,n)),Ui(i,ui(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=Os(e,t,r.unit),C=w.anchor;ct(x.anchor,C)>0?(b=x.head,C=ft(w.from(),x.anchor)):(b=x.anchor,C=pt(w.to(),x.head));var S=c.ranges.slice(0);S[l]=Ts(e,new ci(gt(i,C),b)),Ui(i,ui(e,S,l),G)}}var h=o.wrapper.getBoundingClientRect(),g=0;function m(t){var n=++g,a=Fr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=ct(a,p)){e.curOp.focus=N(L(e)),f(a);var s=oo(o,i);(a.line>=s.to||a.line<s.from)&&setTimeout(Io(e,(function(){g==n&&m(t)})),150)}else{var l=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;l&&setTimeout(Io(e,(function(){g==n&&(o.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(Ee(t),o.input.focus()),be(o.wrapper.ownerDocument,"mousemove",y),be(o.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var y=Io(e,(function(e){0!==e.buttons&&Me(e)?m(e):v(e)})),b=Io(e,v);e.state.selectingText=b,ve(o.wrapper.ownerDocument,"mousemove",y),ve(o.wrapper.ownerDocument,"mouseup",b)}function Ts(e,t){var n=t.anchor,r=t.head,o=et(e.doc,n.line);if(0==ct(n,r)&&n.sticky==r.sticky)return t;var i=ge(o);if(!i)return t;var a=fe(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=fe(i,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var p=i[c+(l?-1:0)],f=l==(1==p.level),h=f?p.from:p.to,g=f?"after":"before";return n.ch==h&&n.sticky==g?t:new ci(new lt(n.line,h,g),r)}function Ps(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ee(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!Se(e,n))return ke(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o)return we(e,n,e,it(e.doc,i),e.display.gutterSpecs[l].className,t),ke(t)}}function Ms(e,t){return Ps(e,t,"gutterClick",!0)}function As(e,t){Gn(e.display,t)||Ds(e,t)||xe(e,t,"contextmenu")||_||e.display.input.onContextMenu(t)}function Ds(e,t){return!!Se(e,"gutterContextMenu")&&Ps(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gr(e)}bs.prototype.compare=function(e,t,n){return this.time+ys>e&&0==ct(t,this.pos)&&n==this.button};var Rs={toString:function(){return"CodeMirror.Init"}},js={},Is={};function Ls(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=Rs&&o(e,t,n)}:o)}e.defineOption=n,e.Init=Rs,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,vi(e)}),!0),n("indentUnit",2,vi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){yi(e),gr(e),Br(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(lt(r,i))}r++}));for(var o=n.length-1;o>=0;o--)sa(e.doc,t,n[o],lt(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Rs&&e.refresh()})),n("specialCharPlaceholder",bn,(function(e){return e.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(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),ti(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ya(t),o=n!=Rs&&Ya(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Vs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Qo(t,e.options.lineNumbers),ti(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?jr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Co(e)}),!0),n("scrollbarStyle","native",(function(e){Eo(e),Co(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Qo(e.options.gutters,t),ti(e)}),!0),n("firstLineNumber",1,ti,!0),n("lineNumberFormatter",(function(e){return e}),ti,!0),n("showCursorWhenSelecting",!1,qr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(to(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.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(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,yi,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Fs(e,t,n){if(!t!=!(n&&n!=Rs)){var r=e.display.dragFunctions,o=t?ve:be;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Vs(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(k(e.display.wrapper,"CodeMirror-wrap"),dn(e)),Lr(e),Br(e),gr(e),setTimeout((function(){return Co(e)}),100)}function Bs(e,t){var n=this;if(!(this instanceof Bs))return new Bs(e,t);this.options=t=t?B(t):{},B(js,t,!1);var r=t.value;"string"==typeof r?r=new Oa(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Bs.inputStyles[t.inputStyle](this),i=this.display=new ni(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Eo(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},t.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,Ci(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&eo(n)}),20):to(this),Is)Is.hasOwnProperty(c)&&Is[c](this,t[c],Rs);Jo(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Hs.length;++u)Hs[u](this);To(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function zs(e){var t=e.display;ve(t.scroller,"mousedown",Io(e,xs)),ve(t.scroller,"dblclick",a&&s<11?Io(e,(function(t){if(!xe(e,t)){var n=Fr(e,t);if(n&&!Ms(e,t)&&!Gn(e.display,t)){Ee(t);var r=e.findWordAt(n);Vi(e.doc,r.anchor,r.head)}}})):function(t){return xe(e,t)||Ee(t)}),ve(t.scroller,"contextmenu",(function(t){return As(e,t)})),ve(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||As(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function i(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}ve(t.scroller,"touchstart",(function(o){if(!xe(e,o)&&!i(o)&&!Ms(e,o)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),ve(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ve(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Gn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=e.coordsChar(t.activeTouch,"page");i=!r.prev||l(r,r.prev)?new ci(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new ci(lt(a.line,0),gt(e.doc,lt(a.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),Ee(n)}o()})),ve(t.scroller,"touchcancel",o),ve(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(mo(e,t.scroller.scrollTop),yo(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))})),ve(t.scroller,"mousewheel",(function(t){return si(e,t)})),ve(t.scroller,"DOMMouseScroll",(function(t){return si(e,t)})),ve(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){xe(e,t)||Te(t)},over:function(t){xe(e,t)||(Ma(e,t),Te(t))},start:function(t){return Pa(e,t)},drop:Io(e,Ta),leave:function(t){xe(e,t)||Aa(e)}};var c=t.input.getField();ve(c,"keyup",(function(t){return hs.call(e,t)})),ve(c,"keydown",Io(e,ps)),ve(c,"keypress",Io(e,gs)),ve(c,"focus",(function(t){return eo(e,t)})),ve(c,"blur",(function(t){return to(e,t)}))}Bs.defaults=js,Bs.optionHandlers=Is;var Hs=[];function $s(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=Ct(e,t).state:n="prev");var a=e.options.tabSize,s=et(i,t),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=t>i.first?z(et(i,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)p+=a,d+="\t";if(p<c&&(d+=X(c-p)),d!=u)return sa(i,d,lt(t,0),lt(t,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==t&&g.head.ch<u.length){var m=lt(t,u.length);zi(i,h,new ci(m,m));break}}}Bs.defineInitHook=function(e){return Hs.push(e)};var Ws=null;function Us(e){Ws=e}function qs(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=Le(t),c=null;if(s&&r.ranges.length>1)if(Ws&&Ws.text.join("\n")==t){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&&e.options.pasteLinesPerSelection&&(c=Q(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var f=r.ranges[p],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=lt(h.line,h.ch-n):e.state.overwrite&&!s?g=lt(g.line,Math.min(et(i,g.line).text.length,g.ch+J(l).length)):s&&Ws&&Ws.lineWise&&Ws.text.join("\n")==l.join("\n")&&(h=g=lt(h.line,0)));var m={from:h,to:g,text:c?c[p%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ta(e.doc,m),Dn(e,"inputRead",e,m)}t&&!s&&Ys(e,t),uo(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||jo(t,(function(){return qs(t,n,0,null,"paste")})),!0}function Ys(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.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=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=$s(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(et(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=$s(e,o.head.line,"smart"));a&&Dn(e,"electricInput",e,o.head.line)}}}function Ks(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:lt(o,0),head:lt(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Zs(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Xs(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),t}function Js(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){F(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Io(this,t[e])(this,n,o),we(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ya(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Lo((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");ee(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Br(this)})),removeOverlay:Lo((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Br(this)}})),indentLine:Lo((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),at(this.doc,e)&&$s(this,e,t,n)})),indentSelection:Lo((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&($s(this,o.head.line,e,!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,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&zi(this.doc,r,new ci(i,c[r].to()),q)}}})),getTokenAt:function(e,t){return kt(this,e,t)},getLineTokens:function(e,t){return kt(this,lt(e),t,!0)},getTokenTypeAt:function(e){e=gt(this.doc,e);var t,n=xt(this,et(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][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(e,t){var n=this.doc;return Ct(this,(e=ht(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Cr(this,null==e?n.head:"object"==typeof e?gt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return xr(this,gt(this.doc,e),t||"page")},coordsChar:function(e,t){return Er(this,(e=wr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=wr(this,{top:e,left:0},t||"page").top,it(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=et(this.doc,e)}else r=e;return br(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-cn(r):0)},defaultTextHeight:function(){return Dr(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i=this.display,a=(e=Cr(this,gt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==r)a=e.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||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==o?(s=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&so(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Lo(ps),triggerOnKeyPress:Lo(gs),triggerOnKeyUp:hs,triggerOnMouseDown:Lo(xs),execCommand:function(e){if(es.hasOwnProperty(e))return es[e].call(null,this)},triggerElectric:Lo((function(e){Ys(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=gt(this.doc,e),a=0;a<t&&!(i=Qs(this.doc,i,o,n,r)).hitSide;++a);return i},moveH:Lo((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Qs(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),Y)})),deleteH:Lo((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ka(this,(function(n){var o=Qs(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var a=gt(this.doc,e),s=0;s<t;++s){var l=Cr(this,a,"div");if(null==i?i=l.left:l.left=i,(a=el(this,l,o,n)).hitSide)break}return a},moveV:Lo((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=Cr(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=el(n,s,e,t);return"page"==t&&a==r.sel.primary()&&co(n,xr(n,l,"div").top-s.top),l}),Y),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=et(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var i=t.charAt(n),a=ie(i,o)?function(e){return ie(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ie(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new ci(lt(e.line,n),lt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?R(this.display.cursorDiv,"CodeMirror-overwrite"):k(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N(L(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Lo((function(e,t){po(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xn(this)-this.display.barHeight,width:e.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:Qn(this),clientWidth:Jn(this)}},scrollIntoView:Lo((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:lt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?fo(this,e):go(this,e.from,e.to,e.margin)})),setSize:Lo((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&hr(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){zr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,we(this,"refresh",this)})),operation:function(e){return jo(this,e)},startOperation:function(){return ko(this)},endOperation:function(){return To(this)},refresh:Lo((function(){var e=this.display.cachedTextHeight;Br(this),this.curOp.forceUpdate=!0,gr(this),po(this,this.doc.scrollLeft,this.doc.scrollTop),Ko(this.display),(null==e||Math.abs(e-Dr(this.display))>.5||this.options.lineWrapping)&&Lr(this),we(this,"refresh",this)})),swapDoc:Lo((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ci(this,e),gr(this),this.display.input.reset(),po(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Dn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},_e(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}function Qs(e,t,n,r,o){var i=t,a=n,s=et(e,t.line),l=o&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n<e.first||n>=e.first+e.size)&&(t=new lt(n,t.ch,t.sticky),s=et(e,n))}function u(i){var a;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new lt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=o?Qa(e.cm,s,t,n):Xa(s,t,n);if(null==a){if(i||!c())return!1;t=Ja(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var d=null,p="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||u(!h);h=!1){var g=s.text.charAt(t.ch)||"\n",m=ie(g,f)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||h||m||(m="s"),d&&d!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(d=m),n>0&&!u(!h))break}var v=Xi(e,t,i,a,!0);return ut(i,v)&&(v.hitSide=!0),v}function el(e,t,n,r){var o,i,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,F(e).innerHeight||a(e).documentElement.clientHeight),c=Math.max(l-.5*Dr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=Er(e,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var tl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function nl(e,t){var n=or(e,t.line);if(!n||n.hidden)return null;var r=et(e.doc,t.line),o=tr(n,r,t.line),i=ge(r,e.doc.direction),a="left";i&&(a=fe(i,t.ch)%2?"right":"left");var s=cr(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function rl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ol(e,t){return t&&(e.bad=!0),e}function il(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(i+=s,l&&(i+=s),a=l=!1)}function d(e){e&&(u(),i+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var i,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(lt(r,0),lt(o+1,0),c(+f));return void(h.length&&(i=h[0].find(0))&&d(tt(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&u();for(var m=0;m<t.childNodes.length;m++)p(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),g&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;p(t),t!=n;)t=t.nextSibling,l=!1;return i}function al(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return ol(e.clipPos(lt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return sl(i,t,n)}}function sl(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!D(r,t))return ol(lt(ot(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?J(e.rest):e.line;return ol(lt(ot(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,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==t||s==n){var u=ot(o<0?e.line:e.rest[o]),d=i[a]+r;return(r<0||s!=t)&&(d=i[a+(r?1:0)]),lt(u,d)}}}var d=u(a,s,n);if(d)return ol(d,o);for(var p=s.nextSibling,f=a?a.nodeValue.length-n:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return ol(lt(d.line,d.ch-f),o);f+=p.textContent.length}for(var h=s.previousSibling,g=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1))return ol(lt(d.line,d.ch+g),o);g+=h.textContent.length}}tl.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!xe(r,e)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ks(r);Us({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,q),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ws.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Xs(),l=s.firstChild;Zs(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,Zs(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),ve(o,"paste",(function(e){!i(e)||xe(r,e)||Gs(e,r)||s<=11&&setTimeout(Io(r,(function(){return t.updateFromDOM()})),20)})),ve(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),ve(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),ve(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),ve(o,"touchstart",(function(){return n.forceCompositionEnd()})),ve(o,"input",(function(){t.composing||t.readFromDOMSoon()})),ve(o,"copy",a),ve(o,"cut",a)},tl.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},tl.prototype.prepareSelection=function(){var e=Gr(this.cm,!1);return e.focus=N(this.div.ownerDocument)==this.div,e},tl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},tl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},tl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),o=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=al(t,e.anchorNode,e.anchorOffset),s=al(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=ct(ft(a,s),o)||0!=ct(pt(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&nl(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&nl(t,i);if(!u){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=O(c.node,c.offset,u.offset,u.node)}catch(e){}f&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},tl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},tl.prototype.showMultipleSelections=function(e){P(this.cm.display.cursorDiv,e.cursors),P(this.cm.display.selectionDiv,e.selection)},tl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},tl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},tl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&N(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},tl.prototype.blur=function(){this.div.blur()},tl.prototype.getField=function(){return this.div},tl.prototype.supportsTouch=function(){return!0},tl.prototype.receivedFocus=function(){var e=this,t=this;function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):jo(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},tl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},tl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&rl(e.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(t,e.anchorNode,e.anchorOffset),r=al(t,e.focusNode,e.focusOffset);n&&r&&jo(t,(function(){Ui(t.doc,di(n,r),q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},tl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,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=lt(a.line-1,et(r.doc,a.line-1).length)),s.ch==et(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=lt(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=Vr(r,a.line))?(t=ot(o.view[0].line),n=o.view[0].node):(t=ot(o.view[e].line),n=o.view[e-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=ot(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(il(r,n,c,t,l)),p=tt(r.doc,lt(t,0),lt(l,et(r.doc,l).text.length));d.length>1&&p.length>1;)if(J(d)==J(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var f=0,h=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var y=J(d),b=J(p),w=Math.min(y.length-(1==d.length?f:0),b.length-(1==p.length?f:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==d.length&&1==p.length&&t==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var x=lt(t,f),C=lt(l,p.length?J(p).length-h:0);return d.length>1||d[0]||ct(x,C)?(sa(r.doc,d,x,C,"+input"),!0):void 0},tl.prototype.ensurePolled=function(){this.forceCompositionEnd()},tl.prototype.reset=function(){this.forceCompositionEnd()},tl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},tl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},tl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||jo(this.cm,(function(){return Br(e.cm)}))},tl.prototype.setUneditable=function(e){e.contentEditable="false"},tl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Io(this.cm,qs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},tl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},tl.prototype.onContextMenu=function(){},tl.prototype.resetPosition=function(){},tl.prototype.needsContentAttribute=!0;var ll=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null,this.resetting=!1};function cl(e,t){if((t=t?B(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=N(e.ownerDocument);t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var o;if(e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(be(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Bs((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function ul(e){e.off=be,e.on=ve,e.wheelEventPixels=ai,e.Doc=Oa,e.splitLines=Le,e.countColumn=z,e.findColumn=K,e.isWordChar=oe,e.Pass=U,e.signal=we,e.Line=pn,e.changeEnd=pi,e.scrollbarModel=_o,e.Pos=lt,e.cmpPos=ct,e.modes=He,e.mimeModes=$e,e.resolveMode=qe,e.getMode=Ge,e.modeExtensions=Ye,e.extendMode=Ke,e.copyState=Ze,e.startState=Je,e.innerMode=Xe,e.commands=es,e.keyMap=za,e.keyName=Ga,e.isModifierKey=Ua,e.lookupKey=Wa,e.normalizeKeyMap=$a,e.StringStream=Qe,e.SharedTextMarker=wa,e.TextMarker=ya,e.LineWidget=ha,e.e_preventDefault=Ee,e.e_stopPropagation=Oe,e.e_stop=Te,e.addClass=R,e.contains=D,e.rmClass=k,e.keyNames=La}ll.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!xe(r,e)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ks(r);Us({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,q):(n.prevInput="",o.value=t.text.join("\n"),I(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),ve(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),ve(o,"paste",(function(e){xe(r,e)||Gs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ve(o,"cut",i),ve(o,"copy",i),ve(e.scroller,"paste",(function(t){if(!Gn(e,t)&&!xe(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),ve(e.lineSpace,"selectstart",(function(t){Gn(e,t)||Ee(t)})),ve(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ve(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ll.prototype.createField=function(e){this.wrapper=Xs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Zs(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},ll.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ll.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Gr(e);if(e.options.moveInputWithCursor){var o=Cr(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},ll.prototype.showSelection=function(e){var t=this.cm.display;P(t.cursorDiv,e.cursors),P(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ll.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(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(e){}},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 e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ll.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ll.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Fe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.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 jo(t,(function(){qs(t,o.slice(l),r.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.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(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=Fr(n,e),c=r.scroller.scrollTop;if(i&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Io(n,Ui)(n.doc,di(i),q);var u,d=o.style.cssText,f=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.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=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),_){Te(e);var g=function(){be(window,"mouseup",g),setTimeout(v,20)};ve(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=o.selectionStart){var e=n.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,o.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&m();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?Io(n,Qi)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},ll.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ll.prototype.setUneditable=function(){},ll.prototype.needsContentAttribute=!1,Ls(Bs),Js(Bs);var dl="iter insert remove copy getEditor constructor".split(" ");for(var pl in Oa.prototype)Oa.prototype.hasOwnProperty(pl)&&$(dl,pl)<0&&(Bs.prototype[pl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Oa.prototype[pl]));return _e(Oa),Bs.inputStyles={textarea:ll,contenteditable:tl},Bs.defineMode=function(e){Bs.defaults.mode||"null"==e||(Bs.defaults.mode=e),We.apply(this,arguments)},Bs.defineMIME=Ue,Bs.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Bs.defineMIME("text/plain","null"),Bs.defineExtension=function(e,t){Bs.prototype[e]=t},Bs.defineDocExtension=function(e,t){Oa.prototype[e]=t},Bs.fromTextArea=cl,ul(Bs),Bs.version="5.65.15",Bs}()},629:(e,t,n)=>{!function(e){function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var o,i,a=t.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},p=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},g=n.counterDescriptors||{},m=n.colorKeywords||{},v=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,x=!1!==t.highlightNonStandardPropertyKeywords;function C(e,t){return o=t,e}function S(e,t){var n=e.next();if(s[n]){var r=s[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),C("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?C(null,"compare"):'"'==n||"'"==n?(t.tokenize=_(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),C("atom","hash")):"!"==n?(e.match(/^\s*\w*/),C("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),C("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?C(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?C("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?C(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=E),C("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),C("property","word")):C(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),C("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?C("variable-2","variable-definition"):C("variable-2","variable")):e.match(/^\w+-/)?C("meta","meta"):void 0}function _(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),C("string","string")}}function E(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=_(")"),C(null,"(")}function O(e,t,n){this.type=e,this.indent=t,this.prev=n}function k(e,t,n,r){return e.context=new O(n,t.indentation()+(!1===r?0:a),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function P(e,t,n){return D[n.context.type](e,t,n)}function M(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return P(e,t,n)}function A(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var D={top:function(e,t,n){if("{"==e)return k(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(w&&/@component/i.test(e))return k(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return k(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return k(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return k(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return k(n,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return k(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return p.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i=x?"string-2":"property","maybeprop"):y?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?D.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?k(n,t,"prop"):P(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&y)return k(n,t,"propBlock");if("}"==e||"{"==e)return M(e,t,n);if("("==e)return k(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return k(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?M(e,t,n):")"==e?T(n):"("==e?k(n,t,"parens"):"interpolation"==e?k(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):P(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):D.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return k(n,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,n);if("{"==e)return T(n)&&k(n,t,y?"block":"top");if("interpolation"==e)return k(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":p.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?x?"string-2":"property":v.hasOwnProperty(r)?"atom":m.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?M(e,t,n):"{"==e?T(n)&&k(n,t,y?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?M(e,t,n,2):D.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?k(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):P(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?k(n,t,"top"):P(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?M(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?M(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new O(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||S)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=D[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.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=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(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=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(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"],d=t(u),p=["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=t(p),h=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["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"],v=t(m),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=t(y),w=n.concat(o).concat(a).concat(l).concat(u).concat(p).concat(m).concat(y);function x(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=x,x(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x,x(e,t))}},name:"css",helperType:"gss"})}(n(631))},531:(e,t,n)=>{!function(e){var t={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(e,t,n){var r=e.current(),o=r.search(t);return o>-1?e.backUp(r.length-o):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var r={};function o(e){var t=r[e];return t||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function i(e,t){var n=e.match(o(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(e,t){return new RegExp((t?"^":"")+"</\\s*"+e+"\\s*>","i")}function s(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),o=e[n],i=o.length-1;i>=0;i--)r.unshift(o[i])}function l(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(!r[0]||r[1].test(i(t,r[0])))return r[2]}}e.defineMode("htmlmixed",(function(r,o){var i=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag,allowMissingTagName:o.allowMissingTagName}),c={},u=o&&o.tags,d=o&&o.scriptTypes;if(s(t,c),u&&s(u,c),d)for(var p=d.length-1;p>=0;p--)c.script.unshift(["type",d[p].matches,d[p].mode]);function f(t,o){var s,u=i.token(t,o.htmlState),d=/\btag\b/.test(u);if(d&&!/[<>\s\/]/.test(t.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&d&&/>$/.test(t.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==t.current()&&l(c[p[1]],p[2]),g=e.getMode(r,h),m=a(p[1],!0),v=a(p[1],!1);o.token=function(e,t){return e.match(m,!1)?(t.token=f,t.localState=t.localMode=null,null):n(e,v,t.localMode.token(e,t.localState))},o.localMode=g,o.localState=e.startState(g,i.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:e.startState(i)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(i,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?i.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||i}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(631),n(589),n(876),n(629))},876:(e,t,n)=>{var r;(r=n(631)).defineMode("javascript",(function(e,t){var n,o,i=e.indentUnit,a=t.statementIndent,s=t.jsonld,l=t.json||s,c=!1!==t.trackScope,u=t.typescript,d=t.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),i=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function m(e,t,r){return n=e,o=r,t}function v(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=y(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=b,b(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):ot(e,t,1)?(g(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=w,w(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==n&&e.eatWhile(d))return m("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(f.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?m("."):m("operator","operator",e.current());if(d.test(n)){e.eatWhile(d);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var o=p[r];return m(o.type,o.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",r)}return m("variable","variable",r)}}function y(e){return function(t,n){var r,o=!1;if(s&&"@"==t.peek()&&t.match(h))return n.tokenize=v,m("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=v),m("string","string")}}function b(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=v;break}r="*"==n}return m("comment","comment")}function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}var x="([{}])";function C(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=e.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(d.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(t.fatArrowAt=a)}}var S={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function _(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function E(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function O(e,t,n,r,o){var i=e.cc;for(k.state=e,k.stream=o,k.marked=null,k.cc=i,k.style=t,e.lexical.hasOwnProperty("align")||(e.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&&E(e,r)?"variable-2":t}}var k={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function P(){return T.apply(null,arguments),!0}function M(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function A(e){var n=k.state;if(k.marked="def",c){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=D(e,n.context);if(null!=r)return void(n.context=r)}else if(!M(e,n.localVars))return void(n.localVars=new j(e,n.localVars));t.globalVars&&!M(e,n.globalVars)&&(n.globalVars=new j(e,n.globalVars))}}function D(e,t){if(t){if(t.block){var n=D(e,t.prev);return n?n==t.prev?t:new R(n,t.vars,!0):null}return M(e,t.vars)?t:new R(t.prev,new j(e,t.vars),!1)}return null}function N(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function j(e,t){this.name=e,this.next=t}var I=new j("this",new j("arguments",null));function L(){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(e,t){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 _(r,k.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function z(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function H(e){function t(n){return n==e?P():";"==e||"}"==n||")"==n||"]"==n?T():P(t)}return t}function $(e,t){return"var"==e?P(B("vardef",t),Te,H(";"),z):"keyword a"==e?P(B("form"),G,$,z):"keyword b"==e?P(B("form"),$,z):"keyword d"==e?k.stream.match(/^\s*$/,!1)?P():P(B("stat"),K,H(";"),z):"debugger"==e?P(H(";")):"{"==e?P(B("}"),F,pe,z,V):";"==e?P():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==z&&k.state.cc.pop()(),P(B("form"),G,$,z,Re)):"function"==e?P(Fe):"for"==e?P(B("form"),F,je,$,V,z):"class"==e||u&&"interface"==t?(k.marked="keyword",P(B("form","class"==e?e:t),$e,z)):"variable"==e?u&&"declare"==t?(k.marked="keyword",P($)):u&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?P(tt):"type"==t?P(Be,H("operator"),ve,H(";")):P(B("form"),Pe,H("{"),B("}"),pe,z,z)):u&&"namespace"==t?(k.marked="keyword",P(B("form"),U,$,z)):u&&"abstract"==t?(k.marked="keyword",P($)):P(B("stat"),ie):"switch"==e?P(B("form"),G,H("{"),B("}","switch"),F,pe,z,z,V):"case"==e?P(U,H(":")):"default"==e?P(H(":")):"catch"==e?P(B("form"),L,W,$,z,V):"export"==e?P(B("stat"),Ge,z):"import"==e?P(B("stat"),Ke,z):"async"==e?P($):"@"==t?P(U,$):T(B("stat"),U,H(";"),z)}function W(e){if("("==e)return P(ze,H(")"))}function U(e,t){return Y(e,t,!1)}function q(e,t){return Y(e,t,!0)}function G(e){return"("!=e?T():P(B(")"),K,H(")"),z)}function Y(e,t,n){if(k.state.fatArrowAt==k.stream.start){var r=n?te:ee;if("("==e)return P(L,B(")"),ue(ze,")"),z,H("=>"),r,V);if("variable"==e)return T(L,Pe,H("=>"),r,V)}var o=n?X:Z;return S.hasOwnProperty(e)?P(o):"function"==e?P(Fe,o):"class"==e||u&&"interface"==t?(k.marked="keyword",P(B("form"),He,z)):"keyword c"==e||"async"==e?P(n?q:U):"("==e?P(B(")"),K,H(")"),z,o):"operator"==e||"spread"==e?P(n?q:U):"["==e?P(B("]"),et,z,o):"{"==e?de(se,"}",null,o):"quasi"==e?T(J,o):"new"==e?P(ne(n)):P()}function K(e){return e.match(/[;\}\)\],]/)?T():T(U)}function Z(e,t){return","==e?P(K):X(e,t,!1)}function X(e,t,n){var r=0==n?Z:X,o=0==n?U:q;return"=>"==e?P(L,n?te:ee,V):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?P(r):u&&"<"==t&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?P(B(">"),ue(ve,">"),z,r):"?"==t?P(U,H(":"),o):P(o):"quasi"==e?T(J,r):";"!=e?"("==e?de(q,")","call",r):"."==e?P(ae,r):"["==e?P(B("]"),K,H("]"),z,r):u&&"as"==t?(k.marked="keyword",P(ve,r)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),P(o)):void 0:void 0}function J(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?P(J):P(K,Q)}function Q(e){if("}"==e)return k.marked="string-2",k.state.tokenize=w,P(J)}function ee(e){return C(k.stream,k.state),T("{"==e?$:U)}function te(e){return C(k.stream,k.state),T("{"==e?$:q)}function ne(e){return function(t){return"."==t?P(e?oe:re):"variable"==t&&u?P(Ee,e?X:Z):T(e?q:U)}}function re(e,t){if("target"==t)return k.marked="keyword",P(Z)}function oe(e,t){if("target"==t)return k.marked="keyword",P(X)}function ie(e){return":"==e?P(z,$):T(Z,H(";"),z)}function ae(e){if("variable"==e)return k.marked="property",P()}function se(e,t){return"async"==e?(k.marked="property",P(se)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?P(le):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),P(ce))):"number"==e||"string"==e?(k.marked=s?"property":k.style+" property",P(ce)):"jsonld-keyword"==e?P(ce):u&&N(t)?(k.marked="keyword",P(se)):"["==e?P(U,fe,H("]"),ce):"spread"==e?P(q,ce):"*"==t?(k.marked="keyword",P(se)):":"==e?T(ce):void 0;var n}function le(e){return"variable"!=e?T(ce):(k.marked="property",P(Fe))}function ce(e){return":"==e?P(q):"("==e?T(Fe):void 0}function ue(e,t,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),P((function(n,r){return n==t||r==t?T():T(e)}),r)}return o==t||i==t?P():n&&n.indexOf(";")>-1?T(e):P(H(t))}return function(n,o){return n==t||o==t?P():T(e,r)}}function de(e,t,n){for(var r=3;r<arguments.length;r++)k.cc.push(arguments[r]);return P(B(t,n),ue(e,t),z)}function pe(e){return"}"==e?P():T($,pe)}function fe(e,t){if(u){if(":"==e)return P(ve);if("?"==t)return P(fe)}}function he(e,t){if(u&&(":"==e||"in"==t))return P(ve)}function ge(e){if(u&&":"==e)return k.stream.match(/^\s*\w+\s+is\b/,!1)?P(U,me,ve):P(ve)}function me(e,t){if("is"==t)return k.marked="keyword",P()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(k.marked="keyword",P("typeof"==t?q:ve)):"variable"==e||"void"==t?(k.marked="type",P(_e)):"|"==t||"&"==t?P(ve):"string"==e||"number"==e||"atom"==e?P(_e):"["==e?P(B("]"),ue(ve,"]",","),z,_e):"{"==e?P(B("}"),be,z,_e):"("==e?P(ue(Se,")"),ye,_e):"<"==e?P(ue(ve,">"),ve):"quasi"==e?T(xe,_e):void 0}function ye(e){if("=>"==e)return P(ve)}function be(e){return e.match(/[\}\)\]]/)?P():","==e||";"==e?P(be):T(we,be)}function we(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",P(we)):"?"==t||"number"==e||"string"==e?P(we):":"==e?P(ve):"["==e?P(H("variable"),he,H("]"),we):"("==e?T(Ve,we):e.match(/[;\}\)\],]/)?void 0:P()}function xe(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?P(xe):P(ve,Ce)}function Ce(e){if("}"==e)return k.marked="string-2",k.state.tokenize=w,P(xe)}function Se(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?P(Se):":"==e?P(ve):"spread"==e?P(Se):T(ve)}function _e(e,t){return"<"==t?P(B(">"),ue(ve,">"),z,_e):"|"==t||"."==e||"&"==t?P(ve):"["==e?P(ve,H("]"),_e):"extends"==t||"implements"==t?(k.marked="keyword",P(ve)):"?"==t?P(ve,H(":"),ve):void 0}function Ee(e,t){if("<"==t)return P(B(">"),ue(ve,">"),z,_e)}function Oe(){return T(ve,ke)}function ke(e,t){if("="==t)return P(ve)}function Te(e,t){return"enum"==t?(k.marked="keyword",P(tt)):T(Pe,fe,De,Ne)}function Pe(e,t){return u&&N(t)?(k.marked="keyword",P(Pe)):"variable"==e?(A(t),P()):"spread"==e?P(Pe):"["==e?de(Ae,"]"):"{"==e?de(Me,"}"):void 0}function Me(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?P(Pe):"}"==e?T():"["==e?P(U,H("]"),H(":"),Me):P(H(":"),Pe,De)):(A(t),P(De))}function Ae(){return T(Pe,De)}function De(e,t){if("="==t)return P(q)}function Ne(e){if(","==e)return P(Te)}function Re(e,t){if("keyword b"==e&&"else"==t)return P(B("form","else"),$,z)}function je(e,t){return"await"==t?P(je):"("==e?P(B(")"),Ie,z):void 0}function Ie(e){return"var"==e?P(Te,Le):"variable"==e?P(Le):T(Le)}function Le(e,t){return")"==e?P():";"==e?P(Le):"in"==t||"of"==t?(k.marked="keyword",P(U,Le)):T(U,Le)}function Fe(e,t){return"*"==t?(k.marked="keyword",P(Fe)):"variable"==e?(A(t),P(Fe)):"("==e?P(L,B(")"),ue(ze,")"),z,ge,$,V):u&&"<"==t?P(B(">"),ue(Oe,">"),z,Fe):void 0}function Ve(e,t){return"*"==t?(k.marked="keyword",P(Ve)):"variable"==e?(A(t),P(Ve)):"("==e?P(L,B(")"),ue(ze,")"),z,ge,V):u&&"<"==t?P(B(">"),ue(Oe,">"),z,Ve):void 0}function Be(e,t){return"keyword"==e||"variable"==e?(k.marked="type",P(Be)):"<"==t?P(B(">"),ue(Oe,">"),z):void 0}function ze(e,t){return"@"==t&&P(U,ze),"spread"==e?P(ze):u&&N(t)?(k.marked="keyword",P(ze)):u&&"this"==e?P(fe,De):T(Pe,fe,De)}function He(e,t){return"variable"==e?$e(e,t):We(e,t)}function $e(e,t){if("variable"==e)return A(t),P(We)}function We(e,t){return"<"==t?P(B(">"),ue(Oe,">"),z,We):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(k.marked="keyword"),P(u?ve:U,We)):"{"==e?P(B("}"),Ue,z):void 0}function Ue(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&N(t))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",P(Ue)):"variable"==e||"keyword"==k.style?(k.marked="property",P(qe,Ue)):"number"==e||"string"==e?P(qe,Ue):"["==e?P(U,fe,H("]"),qe,Ue):"*"==t?(k.marked="keyword",P(Ue)):u&&"("==e?T(Ve,Ue):";"==e||","==e?P(Ue):"}"==e?P():"@"==t?P(U,Ue):void 0}function qe(e,t){if("!"==t)return P(qe);if("?"==t)return P(qe);if(":"==e)return P(ve,De);if("="==t)return P(q);var n=k.state.lexical.prev;return T(n&&"interface"==n.info?Ve:Fe)}function Ge(e,t){return"*"==t?(k.marked="keyword",P(Qe,H(";"))):"default"==t?(k.marked="keyword",P(U,H(";"))):"{"==e?P(ue(Ye,"}"),Qe,H(";")):T($)}function Ye(e,t){return"as"==t?(k.marked="keyword",P(H("variable"))):"variable"==e?T(q,Ye):void 0}function Ke(e){return"string"==e?P():"("==e?T(U):"."==e?T(Z):T(Ze,Xe,Qe)}function Ze(e,t){return"{"==e?de(Ze,"}"):("variable"==e&&A(t),"*"==t&&(k.marked="keyword"),P(Je))}function Xe(e){if(","==e)return P(Ze,Xe)}function Je(e,t){if("as"==t)return k.marked="keyword",P(Ze)}function Qe(e,t){if("from"==t)return k.marked="keyword",P(U)}function et(e){return"]"==e?P():T(ue(q,"]"))}function tt(){return T(B("form"),Pe,H("{"),B("}"),ue(nt,"}"),z,z)}function nt(){return T(Pe,De)}function rt(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,n){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return L.lex=F.lex=!0,V.lex=!0,z.lex=!0,{startState:function(e){var n={tokenize:v,lastType:"sof",cc:[],lexical:new _((e||0)-i,0,"block",!1),localVars:t.localVars,context:t.localVars&&new R(null,null,!1),indented:e||0};return t.globalVars&&"object"==typeof t.globalVars&&(n.globalVars=t.globalVars),n},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),C(e,t)),t.tokenize!=b&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",O(t,r,n,o,e))},indent:function(e,n){if(e.tokenize==b||e.tokenize==w)return r.Pass;if(e.tokenize!=v)return 0;var o,s=n&&n.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(n))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==z)l=l.prev;else if(u!=Re&&u!=V)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=e.cc[e.cc.length-1])&&(o==Z||o==X)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,p=s==d;return"vardef"==d?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+i:"stat"==d?l.indented+(rt(e,n)?a||i:0):"switch"!=l.info||p||0==t.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?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:ot,skipExpression:function(e){O(e,"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:(e,t,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(e,t){var n,a,s=e.indentUnit,l={},c=t.htmlMode?o:i;for(var u in c)l[u]=c[u];for(var u in t)l[u]=t[u];function d(e,t){function r(n){return t.tokenize=n,n(e,t)}var o=e.next();return"<"==o?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(h("atom","]]>")):null:e.match("--")?r(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(g(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(n=e.eat("/")?"closeTag":"openTag",t.tokenize=p,"tag bracket"):"&"==o?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function p(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=d,n=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return n="equals",null;if("<"==r){t.tokenize=d,t.state=w,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=f(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=p;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function g(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=g(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=g(e-1),n.tokenize(t,n)}}return"meta"}}function m(e){return e&&e.toLowerCase()}function v(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function y(e){e.context&&(e.context=e.context.prev)}function b(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(m(n))||!l.contextGrabbers[m(n)].hasOwnProperty(m(t)))return;y(e)}}function w(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?C:w}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",E):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",E(e,t,n)):(a="error",x)}function C(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(m(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",S):(a="tag error",_)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",_)}function S(e,t,n){return"endTag"!=e?(a="error",S):(y(n),w)}function _(e,t,n){return a="error",S(e,t,n)}function E(e,t,n){if("word"==e)return a="attribute",O;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(m(r))?b(n,r):(b(n,r),n.context=new v(n,r,o==n.indented)),w}return a="error",E}function O(e,t,n){return"equals"==e?k:(l.allowMissing||(a="error"),E(e,t,n))}function k(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(a="string",E):(a="error",E(e,t,n))}function T(e,t,n){return"string"==e?T:E(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:w,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;n=null;var r=t.tokenize(e,t);return(r||n)&&"comment"!=r&&(a=null,t.state=t.state(n||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(e,t,n){var o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(o&&o.noIndent)return r.Pass;if(e.tokenize!=p&&e.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;o;){if(o.tagName==i[2]){o=o.prev;break}if(!l.implicitlyClosed.hasOwnProperty(m(o.tagName)))break;o=o.prev}else if(i)for(;o;){var a=l.contextGrabbers[m(o.tagName)];if(!a||!a.hasOwnProperty(m(i[2])))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=E)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.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:(e,t,n)=>{n.d(t,{Z:()=>a});var r,o=n(346),i=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});const a=function(e){function t(t,n,r){var o=e.call(this,n,r)||this;return o._module=t,o}return i(t,e),Object.defineProperty(t.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),t}(o.Hn)},675:(e,t,n)=>{n.d(t,{Z:()=>l,q:()=>o});var r,o,i=n(642),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!function(e){e.Select="select",e.Hover="hover",e.Spacing="spacing",e.Target="target",e.Resize="resize"}(o||(o={}));var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.defaults=function(){return{id:"",type:""}},Object.defineProperty(t.prototype,"type",{get:function(){return this.get("type")||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){var e;return this.get("component")||(null===(e=this.get("componentView"))||void 0===e?void 0:e.model)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"componentView",{get:function(){var e;return this.get("componentView")||(null===(e=this.get("component"))||void 0===e?void 0:e.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"el",{get:function(){var e;return null===(e=this.componentView)||void 0===e?void 0:e.el},enumerable:!1,configurable:!0}),t.prototype.getBoxRect=function(e){var t=this.el,n=this.em.Canvas.getCanvasView(),r=this.get("boxRect");return r||(t&&n?n.getElBoxRect(t,e):{x:0,y:0,width:0,height:0})},t.prototype.getStyle=function(e){void 0===e&&(e={});var t=e.boxRect||this.getBoxRect(e),n=t.width,r=t.height,o=t.x,i=t.y;return{width:"".concat(n,"px"),height:"".concat(r,"px"),top:"0",left:"0",position:"absolute",translate:"".concat(o,"px ").concat(i,"px")}},t.prototype.isType=function(e){return this.type===e},t}(i.Z);const l=s},713:(e,t,n)=>{var r;n.d(t,{Z:()=>o}),function(e){e.run="command:run",e._run="run",e.runCommand="command:run:",e._runCommand="run:",e.runBeforeCommand="command:run:before:",e.abort="command:abort:",e._abort="abort:",e.stop="command:stop",e._stop="stop",e.stopCommand="command:stop:",e._stopCommand="stop:",e.stopBeforeCommand="command:stop:before:"}(r||(r={}));const o=r},858:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){e.Components.clear(),e.Css.clear()}}},884:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var r=n(50),o=n(668),i=n(491);const a={run:function(e){(0,r.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=e,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(e){this.toggleMove(),this.disableDragger()},onKeyUp:function(e){" "===(0,i.sN)(e)&&this.editor.stopCommand(this.id)},enableDragger:function(e){this.toggleDragger(1,e)},disableDragger:function(e){this.toggleDragger(0,e)},toggleDragger:function(e,t){var n=this.canvasModel,r=this.em,i=this.dragger,a=e?"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(e){var t=e.x,r=e.y;n.set({x:t,y:r})},onStart:function(e,t){r.trigger("canvas:move:start",t)},onDrag:function(e,t){r.trigger("canvas:move",t)},onEnd:function(e,t){r.trigger("canvas:move:end",t)}}),this.dragger=i),e?i.start(t):i.stop()},toggleMove:function(e){var t=this.ppfx,n=e?"add":"remove",r=e?"on":"off",o={on:i.on,off:i.S1},a=this.getCanvas(),s=["".concat(t,"is__grab")];!e&&s.push("".concat(t,"is__grabbing")),s.forEach((function(e){return a.classList[n](e)})),o[r](document,"keyup",this.onKeyUp),o[r](a,"mousedown",this.enableDragger),o[r](document,"mouseup",this.disableDragger)}}},790:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l,defineCommand:()=>s});var r,o=n(346),i=n(713),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function s(e){return e}const l=function(e){function t(t){var n=e.call(this,0)||this;n.config=t||{},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(t,e),t.prototype.onFrameScroll=function(e){},t.prototype.getCanvas=function(){return this.canvas.getElement()},t.prototype.getCanvasBody=function(){return this.canvas.getBody()},t.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},t.prototype.offset=function(e){var t=e.getBoundingClientRect();return{top:t.top+e.ownerDocument.body.scrollTop,left:t.left+e.ownerDocument.body.scrollLeft}},t.prototype.init=function(e){},t.prototype.callRun=function(e,t){void 0===t&&(t={});var n=this.id;if(e.trigger("".concat(i.Z.runBeforeCommand).concat(n),{options:t}),e.trigger("".concat(i.Z._runCommand).concat(n,":before"),t),t.abort)return e.trigger("".concat(i.Z.abort).concat(n),{options:t}),void e.trigger("".concat(i.Z._abort).concat(n),t);var r=t.sender||e,o=this.run(e,r,t),a={id:n,result:o,options:t};return e.trigger("".concat(i.Z.runCommand).concat(n),a),e.trigger(i.Z.run,a),e.trigger("".concat(i.Z._runCommand).concat(n),o,t),e.trigger(i.Z._run,n,o,t),o},t.prototype.callStop=function(e,t){void 0===t&&(t={});var n=this.id,r=t.sender||e;e.trigger("".concat(i.Z.stopBeforeCommand).concat(n),{options:t}),e.trigger("".concat(i.Z._stopCommand).concat(n,":before"),t);var o=this.stop(e,r,t),a={id:n,result:o,options:t};return e.trigger("".concat(i.Z.stopCommand).concat(n),a),e.trigger(i.Z.stop,a),e.trigger("".concat(i.Z._stopCommand).concat(n),o,t),e.trigger(i.Z._stop,n,o,t),o},t.prototype.stopCommand=function(e){this.em.Commands.stop(this.id,e)},t.prototype.run=function(e,t,n){},t.prototype.stop=function(e,t,n){},t}(o.Hn)},180:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(50),o={run:function(e,t,n){var o=this;void 0===n&&(n={});var i=[],a=n.component||e.getSelectedAll();return a=(0,r.isArray)(a)?function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],a,!0):[a],a.filter(Boolean).forEach((function(e){var t,n;if(!e.get("removable"))return o.em.logWarning("The element is not removable",{component:e});i.push(e),((null===(n=null===(t=e.delegate)||void 0===t?void 0:t.remove)||void 0===n?void 0:n.call(t,e))||e).remove()})),e.selectRemove(i),i}};const i=o},544:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(50),o=n(668),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a="dmode";const s={run:function(e,t,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,d=n.dragger,p=void 0===d?{}:d,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}},p);this.setupGuides(),this.opts=n,this.editor=e,this.em=e.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(e){var t=e.guide;t&&t.parentNode.removeChild(t)})),this.guides=[]},getGuidesContainer:function(){var e=this,t=this.guidesEl;if(!t){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>');(t=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,t.appendChild(l),t.appendChild(c),o.Canvas.getGlobalToolsEl().appendChild(t),this.guidesEl=t,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 t;e.updateGuides(),a.debug&&(null===(t=e.guides)||void 0===t||t.forEach((function(t){return e.renderGuide(t)})))}),200))}return t},getGuidesStatic:function(){var e=this,t=[],n=this.target.getEl(),o=n.parentNode,i=void 0===o?{}:o;return(0,r.each)(i.children,(function(r){return t=t.concat(n!==r?e.getElementGuides(r):[])})),t.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(e){var t,n,o=this;(e||this.guides).forEach((function(e){var i=e.origin,a=t===i?n:o.getElementPos(i);t=i,n=a,(0,r.each)(o.getGuidePosUpdate(e,a),(function(t,n){return e[n]=t})),e.originRect=a}))},getGuidePosUpdate:function(e,t){var n={},r=t.top,o=t.height,i=t.left,a=t.width;switch(e.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(e){void 0===e&&(e={});var t=e.guide||document.createElement("div"),n="px",r=e.active?2:1,o=t.children[0];return t.style="position: absolute; background-color: ".concat(e.active?"green":"red",";"),t.children.length||((o=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",t.appendChild(o)),e.y?(t.style.width="100%",t.style.height="".concat(r).concat(n),t.style.top="".concat(e.y).concat(n),t.style.left=0):(t.style.width="".concat(r).concat(n),t.style.height="100%",t.style.left="".concat(e.x).concat(n),t.style.top="0".concat(n)),!e.guide&&this.guidesContainer.appendChild(t),t},getElementPos:function(e){return this.editor.Canvas.getElementPos(e,{noScroll:1})},getElementGuides:function(e){var t=this,n=this.opts,r=this.getElementPos(e),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:e,originRect:r,guide:n.debug&&t.renderGuide(o)})}));return c.forEach((function(e){var n;return null===(n=t.guides)||void 0===n?void 0:n.push(e)})),c},getTranslate:function(e,t){void 0===t&&(t="x");var n=0;return(e||"").split(" ").forEach((function(e){var r=e.trim(),o="translate".concat(t.toUpperCase(),"(");0===r.indexOf(o)&&(n=parseFloat(r.replace(o,"")))})),n},setTranslate:function(e,t,n){var r="translate".concat(t.toUpperCase(),"("),o="".concat(r).concat(n,")"),i=(e||"").split(" ").map((function(e){return 0===e.trim().indexOf(r)&&(e=o),e})).join(" ");return i.indexOf(r)<0&&(i+=" ".concat(o)),i},getPosition:function(){var e=this.target,t=this.isTran,n=e.getStyle(),r=n.left,o=n.top,i=n.transform,a=0,s=0;return t?(a=this.getTranslate(i),s=this.getTranslate(i,"y")):(a=parseFloat(r||0),s=parseFloat(o||0)),{x:a,y:s}},setPosition:function(e){var t=e.x,n=e.y,o=e.end,i=e.position,a=e.width,s=e.height,l=this,c=l.target,u=l.isTran,d=l.em,p=!o,f="".concat(parseInt(t,10)).concat("px"),h="".concat(parseInt(n,10)).concat("px"),g={};if(u){var m=c.getStyle().transform||"";m=this.setTranslate(m,"x",f),g={transform:m=this.setTranslate(m,"y",h),__p:p},c.addStyle(g,{avoidStore:!o})}else{var v={position:i,width:a,height:s},y={left:f,top:h,__p:p};(0,r.keys)(v).forEach((function(e){var t=v[e];t&&(y[e]=t)})),g=y,c.addStyle(g,{avoidStore:!o})}null==d||d.Styles.__emitCmpStyleUpdate(g,{components:d.getSelected()})},_getDragData:function(){var e=this.target;return{target:e,parent:e.parent(),index:e.index()}},onStart:function(e){var t=this,n=t.target,r=t.editor,o=t.isTran,i=t.opts,a=i.center,s=i.onStart,l=r.Canvas,c=n.getStyle(),u="absolute",d=[u,"relative"];if(s&&s(this._getDragData()),!o&&c.position!==u){var p=l.offset(n.getEl()),f=p.left,h=p.top,g=p.width,m=p.height,v=n.parent(),y=void 0;do{var b=v.getStyle();y=d.indexOf(b.position)>=0?v:null,v=v.parent()}while(v&&!y);if(a){var w=l.getMouseRelativeCanvas(e);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(m,"px"),position:u})}},onDrag:function(){var e=this,t=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(t),n.debug&&t.forEach((function(t){return e.renderGuide(t)})),n.guidesInfo&&this.renderGuideInfo(t.filter((function(e){return e.active}))),r&&r(this._getDragData())},onEnd:function(e,t,n){void 0===n&&(n={});var r=this,o=r.editor,s=r.opts,l=r.id,c=s.onEnd;c&&c(e,n,i(i({event:e},n),this._getDragData())),o.stopCommand(l),this.hideGuidesInfo(),this.em.trigger("".concat(a,":end"),this.getEventOpts())},hideGuidesInfo:function(){var e=this;["X","Y"].forEach((function(t){var n=e["elGuideInfo".concat(t)];n&&(n.style.display="none")}))},renderGuideInfo:function(e){var t=this;void 0===e&&(e=[]);var n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var o=e.origin,s=e.x,l=t.getElementPos(o),c=(0,r.isUndefined)(s)?"y":"x",u="y"===c,d=l[u?"left":"top"],p=l.rect[u?"left":"top"],f=u?d+l.width:d+l.height,h=u?p+l.rect.width:p+l.rect.height,g=t["elGuideInfo".concat(c.toUpperCase())],m=t["elGuideInfoContent".concat(c.toUpperCase())],v=g.style,y=null==n?void 0:n.filter((function(t){return t.type===e.type})).map((function(e){var t=e.originRect,n=t.left,r=t.width,o=t.top,i=t.height,a=u?n+r:o+i;return{gap:a<d?d-a:(u?n:o)-f,guide:e}})).filter((function(e){return e.gap>0})).sort((function(e,t){return e.gap-t.gap})).map((function(e){return e.guide}))[0];if(y){var b=y.originRect,w=b.left,x=b.width,C=b.top,S=b.height,_=b.rect,E=u?w<l.left:C<l.top,O=u?w:C,k=u?_.left:_.top,T=u?w+x:C+S,P=u?_.left+_.width:_.top+_.height,M=u?e.y:e.x,A=E?T:f,D="".concat(M,"px"),N=E?d-T:O-f,R=E?p-P:k-h;v.display="",v[u?"top":"left"]=D,v[u?"left":"top"]="".concat(A,"px"),v[u?"width":"height"]="".concat(N,"px"),m.innerHTML="".concat(Math.round(R),"px"),t.em.trigger("".concat(a,":active"),i(i({},t.getEventOpts()),{guide:e,guidesStatic:n,matched:y,posFirst:M,posSecond:A,size:N,sizeRaw:R,elGuideInfo:g,elGuideInfoCnt:m}))}}))},toggleDrag:function(e){var t=this.ppfx,n=this.editor,r=e?"add":"remove",o=["".concat(t,"is__grabbing")],i=n.Canvas,a=i.getBody();o.forEach((function(e){return a.classList[r](e)})),i[e?"startAutoscroll":"stopAutoscroll"]()}}},236:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach((function(e){var n=e.components(),r=n&&n.filter((function(e){return e.get("selectable")}))[0];r&&t.push(r)})),t.length&&e.select(t)}}}},368:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e,t,n){if(void 0===n&&(n={}),e.Canvas.hasFocus()||n.force){var r=[];e.getSelectedAll().forEach((function(e){for(var t=e.parent();t&&!t.get("selectable");)t=t.parent();t&&r.push(t)})),r.length&&e.select(r)}}}},243:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach((function(e){var n=e.parent();if(n){var r,o=n.components().length,i=0,a=0;do{i++,r=(a=e.index()+i)<=o?n.getChildAt(a):null}while(r&&!r.get("selectable"));t.push(r||e)}})),t.length&&e.select(t)}}}},400:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach((function(e){var n=e.parent();if(n){var r,o=0,i=0;do{o++,r=(i=e.index()-o)>=0?n.getChildAt(i):null}while(r&&!r.get("selectable"));t.push(r||e)}})),t.length&&e.select(t)}}}},910:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(50);const o={run:function(e,t,n){void 0===n&&(n={});var o=n.target,i=[];if(!o.get("styles"))return i;var a=o.get("type"),s=e.Pages.getAllWrappers();if(!(0,r.flatten)(s.map((function(e){return e.findType(a)}))).length){var l=e.CssComposer.getAll();i=l.filter((function(e){return e.get("group")==="cmp:".concat(a)})),l.remove(i)}return i}}},744:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){var t=e.getModel(),n=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e.getSelectedAll(),!0).map((function(e){var t,n;return(null===(n=null===(t=e.delegate)||void 0===t?void 0:t.copy)||void 0===n?void 0:n.call(t,e))||e})).filter(Boolean);n.length&&t.set("clipboard",n)}}},457:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(491);const o={run:function(e,t,n){var o=this;void 0===n&&(n={}),t&&t.set&&t.set("active",0);var i=e.getConfig(),a=e.Modal,s=i.stylePrefix;if(this.cm=e.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 e.stopCommand("".concat(o.id))})),this.htmlEditor.setContent(e.getHtml(n.optsHtml)),this.cssEditor.setContent(e.getCss(n.optsCss))},stop:function(e){var t=e.Modal;t&&t.close()},buildEditor:function(e,t,n){var r=this.em.CodeManager,o=r.createViewer({label:n,codeName:e,theme:t});return{model:o,el:new r.EditorView({model:o,config:r.getConfig()}).render().el}}}},975:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(50);const o={isEnabled:function(){var e=document;return!!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement)},enable:function(e){var t="";return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?(t="webkit",e.webkitRequestFullscreen()):e.mozRequestFullScreen?(t="moz",e.mozRequestFullScreen()):e.msRequestFullscreen&&e.msRequestFullscreen(),t},disable:function(){var e=document;this.isEnabled()&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},fsChanged:function(e){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(e||"","fullscreenchange"),this.fsChanged))},run:function(e,t,n){void 0===n&&(n={}),this.sender=t;var o=n.target,i=(0,r.isElement)(o)?o:document.querySelector(o),a=this.enable(i||e.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+"fullscreenchange",this.fsChanged)},stop:function(e,t){t&&t.set&&t.set("active",!1),this.disable()}}},191:(e,t,n)=>{n.r(t),n.d(t,{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(e){a.default.init.apply(this,arguments),(0,r.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=e,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.default.enable.apply(this,e),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(e){var t=(0,o.default)(e.target).data("model").get("draggable");t&&(this.cacheEl=null,this.startSelectPosition(e.target,this.frameEl.contentDocument),this.sorter.draggable=t,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(e){var t=e.get("draggable");if(t){this.cacheEl=null;var n=e.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=t,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(e){this.cacheEl=null;var t=e[e.length-1],n=this.em.getCurrentFrame(),r=t.getEl(null==n?void 0:n.model),o=r.ownerDocument;this.startSelectPosition(r,o,{onStart:this.onStart}),this.sorter.draggable=t.get("draggable"),this.sorter.toMove=e,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(e,t){},rollback:function(e,t){(27==(e.which||e.keyCode)||t)&&(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 e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];a.default.stop.apply(this,e),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass),this.$wrapper.css("cursor","").unbind().removeClass(this.noSelClass)}})},912:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(50),o=n(491);const i={open:function(e){var t=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:e}).onceClose((function(){return o.stopCommand(t.id)}))},close:function(){var e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.am.__customData());var t=this.editor.Modal;t&&t.close()},run:function(e,t,n){void 0===n&&(n={});var r=e.AssetManager,i=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||e.t("assetManager.modalTitle")||"",this.editor=e,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(e){return e}));s&&s.length&&(u=u.filter((function(e){return-1!==s.indexOf(e.get("type"))}))),r.render(u),this.rendered=r.getContainer()}if(l){var d=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));d&&d.setAttribute("accept",l)}}return this.open(this.rendered),this},stop:function(e){this.editor=e,this.close(this.rendered)}}},117:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(50),o=n(491);const i={open:function(){var e=this,t=e.container,n=e.editor,o=e.bm,i=e.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",t).trigger("change:appendContent"),a||t.appendChild(o.render())}t&&(t.style.display="block")},close:function(){var e=this.container,t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.bm.__customData());e&&(e.style.display="none")},run:function(e){var t=e.Blocks;this.config=t.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,o.ut)("div"),this.editor=e,this.bm=t;var n=this.container;t.__behaviour({container:n}),this.config.custom&&t.__trgCustom(),this.open()},stop:function(){this.close()}}},614:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const r={run:function(e){var t=e.LayerManager,n=e.Panels,r=t.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?t.__trgCustom({container:i}):i.appendChild(t.render()),a.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"}},stop:function(){var e=this.layers;e&&(e.style.display="none")}}},801:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(895);const o={run:function(e,t){if(this.sender=t,!this.$cnt){var n=e.getConfig(),o=e.Panels,i=e.DeviceManager,a=e.SelectorManager,s=e.StyleManager,l="change:appendContent",c=(0,r.default)("<div></div>"),u=(0,r.default)("<div></div>"),d=(0,r.default)("<div></div>"),p=(0,r.default)("<div></div>");if(this.$cnt=c,this.$cntInner=u,u.append(d),u.append(p),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:d.get(0)}):g.appendTo||d.append(a.render([])),this.sm=s;var m=s.getConfig(),v=m.stylePrefix;this.$header=(0,r.default)('<div class="'.concat(v,'header">').concat(e.t("styleManager.empty"),"</div>")),c.append(this.$header),m.custom?s.__trgCustom({container:p.get(0)}):m.appendTo||p.append(s.render());var y="views-container";(o.getPanel(y)||o.addPanel({id:y})).set("appendContent",c).trigger(l);var b=e.getModel();this.listenTo(b,s.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var e=this,t=e.sender,n=e.sm,r=e.$cntInner,o=e.$header;t&&t.get&&!t.get("active")||!n||(n.getSelected()?(null==r||r.show(),null==o||o.hide()):(null==r||r.hide(),null==o||o.show()))},stop:function(){var e,t;null===(e=this.$cntInner)||void 0===e||e.hide(),null===(t=this.$header)||void 0===t||t.hide()}}},395:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(895);const o={run:function(e,t){this.sender=t;var n,o=e.getModel(),i=e.Config.stylePrefix,a=e.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=e.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=e.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var e=this.sender;e&&e.get&&!e.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:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(50);const o={run:function(e,t,n){void 0===n&&(n={});var o=e.getModel(),a=o.get("clipboard"),s=e.getSelected();(null==a?void 0:a.length)&&s&&(e.getSelectedAll().forEach((function(t){var s,l,c,u,d=(null===(l=null===(s=t.delegate)||void 0===s?void 0:s.copy)||void 0===l?void 0:l.call(s,t))||t,p=d.collection;if(p){var f={at:d.index()+1,action:n.action||"paste-component"};u=(0,r.contains)(a,d)&&d.get("copyable")?p.add(d.clone(),f):i(e,a,d.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(e,a,h,f)}(u=(0,r.isArray)(u)?u:[u]).forEach((function(t){return e.trigger("component:paste",t)}))})),s.emitUpdate())}};function i(e,t,n,r){var o=t.filter((function(e){return e.get("copyable")})).filter((function(t){return e.Components.canMove(n,t).result}));return n.components().add(o.map((function(e){return e.clone()})),r)}},129:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(50),o="core:component-outline";const i={getPanels:function(e){return this.panels||(this.panels=e.Panels.getPanels()),this.panels},preventDrag:function(e){e.abort=1},tglEffects:function(e){var t=this.em,n=e?"on":"off";if(t){var o=t.Canvas,i=o.getBody(),a=o.getToolbarEl();a&&(a.style.display=e?"none":"");var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,r.each)(s,(function(t){return t.style.pointerEvents=e?"all":""})),t[n]("run:tlb-move:before",this.preventDrag)}},run:function(e,t){var n=this;this.sender=t,this.selected=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e.getSelectedAll(),!0),e.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=e.Commands.isActive(o)),this.shouldRunSwVisibility&&e.stopCommand(o),e.getModel().stopDefault();var r=this.getPanels(e),i=e.Canvas.getElement(),a=e.getEl(),s=e.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(e){return e.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",e.refresh(),this.tglEffects(1)},stop:function(e){var t=this.sender,n=void 0===t?{}:t,r=this.selected;n.set&&n.set("active",0);var i=this.getPanels(e);this.shouldRunSwVisibility&&(e.runCommand(o),this.shouldRunSwVisibility=!1),e.getModel().runDefault(),i.forEach((function(e){return e.set("visible",!0)})),e.Canvas.getElement().setAttribute("style",""),r&&e.select(r),delete this.selected,this.helper&&(this.helper.style.display="none"),e.refresh(),this.tglEffects()}}},116:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};const o={run:function(e,t,n){var o=n||{},i=e.Canvas,a=i.getCanvasView(),s=r({appendTo:i.getResizerEl(),prefix:e.getConfig().stylePrefix,posFetcher:a.getElementPos.bind(a),mousePosFetcher:i.getMouseRelativePos.bind(i)},o.options||{}),l=this.canvasResizer;return l&&!o.forceNew||(this.canvasResizer=new e.Utils.Resizer(s),l=this.canvasResizer),l.setOptions(s,!0),l.blur(),l.focus(o.el),l},stop:function(){var e;null===(e=this.canvasResizer)||void 0===e||e.blur()}}},407:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var r,o=n(50),i=n(346),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});const s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.defaults=function(){return{command:"",attributes:{}}},t}(i.Hn);var l=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(i.FE);const u=c;c.prototype.model=s;var d=n(330),p=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)},h=function(e){function t(t){var n=e.call(this,t)||this;return n.em=t.config.em,n}return p(t,e),t.prototype.events=function(){return this.model.get("events")||{mousedown:"handleClick"}},t.prototype.attributes=function(){return this.model.get("attributes")},t.prototype.handleClick=function(e){e.preventDefault(),e.stopPropagation();var t=this.em,n=t.Canvas.getFrameEl().getBoundingClientRect(),r=n.left,o=n.top,i=f(f({},e),{clientX:e.clientX-r,clientY:e.clientY-o});t.trigger("toolbar:run:before",{event:i}),this.execCommand(i)},t.prototype.execCommand=function(e){var t=this.em,n={event:e},r=this.model.get("command"),i=t.Editor;(0,o.isFunction)(r)&&r(i,null,n),(0,o.isString)(r)&&i.runCommand(r,n)},t.prototype.render=function(){var e=this,t=e.em,n=e.$el,r=e.model,o=r.get("id"),i=r.get("label"),a=t.getConfig().stylePrefix;return n.addClass("".concat(a,"toolbar-item")),o&&n.addClass("".concat(a,"toolbar-item__").concat(o)),i&&n.append(i),this},t}(i.G7);const g=h;var m=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(e){function t(t){var n=e.call(this,t)||this,r=t.em;return n.em=r,n.config={em:r},n.listenTo(n.collection,"reset",n.render),n}return m(t,e),t.prototype.onRender=function(){var e=this.em.config.stylePrefix;this.el.className="".concat(e,"toolbar-items")},t}(d.Z);const y=v;v.prototype.itemView=g;var b,w=n(491),x=n(163),C=n(675),S=function(){return S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},S.apply(this,arguments)};const _={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(e){var t=this,n=this.em,r=n.getConfig().listenToEl,o=n.getContainer().parentNode,i=e?"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(e){var n=e.view,r=null==n?void 0:n.getWindow();r&&function(e,n){a[i](n,"mouseover",t.onHover),a[i](n,"mouseleave",t.onOut),a[i](n,"click",t.onClick),a[i](e,"scroll",t.onFrameScroll,!0),a[i](e,"resize",t.onFrameResize)}(r,null==n?void 0:n.getBody())}))},onHover:function(e){e.stopPropagation();var t=this.em,n=e.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,t.setHovered(i,{useValid:!0}),o&&t.setCurrentFrame(o)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(e,t){var n,r=this,o={};t?null===(n=t.views)||void 0===n||n.forEach((function(e){var n=e.el,i=r.getElementPos(n);o={el:n,pos:i,component:t,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(e){var t=e.view,n=t&&t.getToolsEl();n&&r.toggleToolsEl(0,0,{el:n})})))},onSelect:function(){var e=this.em,t=e.getSelected(),n=e.getCurrentFrame(),r=t&&t.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:t,view:(0,x.getViewEl)(o)});this.elSelected=i,this.updateToolsGlobal(),this.updateLocalPos(i),this.initResize(t)},updateGlobalPos:function(){var e=this.getElSelected();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsGlobal())},updateLocalPos:function(e){var t=this.getElHovered();t.el&&(t.pos=this.getElementPos(t.el),this.updateToolsLocal(e))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered()},toggleToolsEl:function(e,t,n){void 0===n&&(n={});var r=n.el||this.canvas.getToolsEl(t);return r&&(r.style.display=e?"":"none"),r||{}},showElementOffset:function(e,t,n){void 0===n&&(n={}),b&&this.editor.runCommand("show-offset",{el:e,elPos:t,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(e){this.editor.stopCommand("show-offset",{view:e})},showFixedElementOffset:function(e,t){this.editor.runCommand("show-offset",{el:e,elPos:t,state:"Fixed"})},hideFixedElementOffset:function(){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=0},onClick:function(e){e.stopPropagation(),e.preventDefault();var t=this.em;if(t.get("_cmpDrag"))return t.set("_cmpDrag");var n=e.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(t.isEditing()&&!r.get("textable")&&r.isChildOf("text"))return;this.select(r,e)}},select:function(e,t){void 0===t&&(t={}),e&&(this.editor.select(e,{event:t,useValid:!0}),this.initResize(e))},updateBadge:function(e,t,n){void 0===n&&(n={});var r=this.canvas,o=(0,x.getComponentModel)(e),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"),d=s.customBadgeLabel,p="".concat(l?'<div class="'.concat(u,'__icon">').concat(l,"</div>"):"",'\n <div class="').concat(u,'__name">').concat(o.getName(),"</div>");i.innerHTML=d?d(o):p}a.display="block";var f=r.getTargetToElementFixed(e,i,{pos:t}).top,h=n.leftOff<0?-n.leftOff:0;a.top=f+"px",a.left=h+"px"}else a.display="none"},showHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=""},initResize:function(e){var t=this.em,n=this.canvas,r=t.Editor,i=!(0,o.isElement)(e)&&(0,w.o5)(e)?e:t.getSelected(),a=null==i?void 0:i.get("resizable"),s=C.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)(e)?e:i.getEl(),d=(0,x.isObject)(a)?a:{},p=d.onStart,f=void 0===p?function(){}:p,h=d.onMove,g=void 0===h?function(){}:h,m=d.onEnd,v=void 0===m?function(){}:m,y=d.updateTarget,_=void 0===y?function(){}:y,E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(d,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var O=t.config.stylePrefix||"",k="".concat(O,"resizing"),T=this,P={component:i,el:u},M=function(e,t,n){var r=n.docs;r&&r.forEach((function(t){var n=t.body,r=n.className||"";n.className=("add"==e?"".concat(r," ").concat(k):r.replace(k,"")).trim()}))},A=S({onStart:function(e,o){f(e,o);var a=o.el,s=o.config,l=o.resizer,u=s.keyHeight,d=s.keyWidth,p=s.currentUnit,h=s.keepAutoHeight,g=s.keepAutoWidth;M("add",0,o),c=t.Styles.getModelToStyle(i),n.toggleFramesEvents(!1);var m=getComputedStyle(a),v=c.getStyle(),y=v[d];s.autoWidth=g&&"auto"===y,isNaN(parseFloat(y))&&(y=m[d]);var w=v[u];s.autoHeight=h&&"auto"===w,isNaN(parseFloat(w))&&(w=m[u]),l.startDim.w=parseFloat(y),l.startDim.h=parseFloat(w),b=!1,p&&(s.unitHeight=(0,x.getUnitFromValue)(w),s.unitWidth=(0,x.getUnitFromValue)(y)),T.activeResizer=!0,r.trigger("component:resize",S(S({},P),{type:"start"}))},onMove:function(e){g(e),r.trigger("component:resize",S(S({},P),{type:"move"}))},onEnd:function(e,t){v(e,t),M("remove",0,t),r.trigger("component:resize",S(S({},P),{type:"end"})),n.toggleFramesEvents(!0),b=!0,T.activeResizer=!1},updateTarget:function(e,r,o){if(_(e,r,o),c){var a=o.store,s=o.selectedHandler,l=o.config,u=l.keyHeight,d=l.keyWidth,p=l.autoHeight,f=l.autoWidth,h=l.unitWidth,g=l.unitHeight,m=["tc","bc"].indexOf(s)>=0,v=["cl","cr"].indexOf(s)>=0,y={};if(!m){var b=n.getBody().offsetWidth,w=r.w<b?r.w:b;y[d]=f?"auto":"".concat(w).concat(h)}v||(y[u]=p?"auto":"".concat(r.h).concat(g)),t.getDragMode(i)&&(y.top="".concat(r.t).concat(g),y.left="".concat(r.l).concat(h));var x=S(S({},y),{__p:!a});c.addStyle(x,{avoidStore:!a}),t.Styles.__emitCmpStyleUpdate(x,{components:t.getSelected()})}}},E);this.resizer=r.runCommand("resize",{el:u,options:A,force:1})}else{if(l)return;r.stopCommand("resize"),this.resizer=null}},updateToolbar:function(e){var t=this.canvas,n=this.config.em,r=e===n?n.getSelected():e,o=t.getToolbarEl(),i=o.style,a=r.get("toolbar"),s=n.config.showToolbar,l=!t.hasCustomSpot(C.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(e){var t=this.canvas.getToolbarEl().style;t.top="".concat(e.top).concat("px"),t.left="".concat(e.left).concat("px"),t.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(e){return void 0===e&&(e={}),this.canvas.getBadgeEl(e.view)},onFrameScroll:function(){this.updateTools(),this.canvas.refreshSpots()},onFrameResize:function(){this.canvas.refresh({all:!0})},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(e){return e&&"selected"===e.get("status")},updateToolsLocal:function(e){var t=this.em.getConfig(),n=e||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(C.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),!t.showOffsetsSelected&&this.hideElementOffset(i));var d="px",p=this.toggleToolsEl(1,i),f=p.style,h=this.canvas.canvasRectOffset(r,o),g=h.top,m=h.left;!u&&this.updateBadge(r,o,S(S({},c),{view:i,topOff:g,leftOff:m})),f.top=g+d,f.left=m+d,f.width=o.width+d,f.height=o.height+d,this._trgToolUp("local",{component:a,el:p,top:g,left:m,width:o.width,height:o.height})}else this.lastHovered=0},_upToolbar:(0,o.debounce)((function(){this.updateToolsGlobal({force:1})}),0),_trgToolUp:function(e,t){void 0===t&&(t={}),this.em.trigger("canvas:tools:update",S({type:e},t))},updateToolsGlobal:function(e){void 0===e&&(e={});var t=this.getElSelected(),n=t.el,r=t.pos,o=t.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var i=this.canvas;(this.lastSelected!==n||e.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,d=c.canvasOffsetLeft;l.top=u+a,l.left=d+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:d,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(e){return this.canvas.getCanvasView().getElementPos(e,{noScroll:!0})},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(e){e&&e.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(e){(0,x.hasWin)()&&(this.editor=e&&e.get("Editor"),this.enable())},stop:function(e,t,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:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(895);const o={startSelectPosition:function(e,t,n){var r=this;void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,i=e.ownerDocument.body;o&&!this.sorter&&(this.sorter=new o.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:t,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return r.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),e&&this.sorter.startSort(e,{container:i})},getOffsetDim:function(){var e=this.offset(this.canvas.getFrameEl()),t=this.offset(this.canvas.getElement());return{top:e.top-t.top,left:e.left-t.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(e,t,n){var r=e||0,o=t||"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:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(50),o=n(675),i=n(895),a=n(491),s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};const l={getOffsetMethod:function(e){return"get"+(e||"")+"OffsetViewerEl"},run:function(e,t,n){var l=this.canvas,c=n||{},u=c.state||"",d=e.getConfig(),p=this.em.getZoomDecimal(),f=c.el;if(d.showOffsets&&f&&!(0,a.BM)(f)&&(d.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),m=this.ppfx,v=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],C=this["marginR"+u],S=this["padT"+u],_=this["padB"+u],E=this["padL"+u],O=this["padR"+u];if(y.childNodes.length&&(this[v]="1",b=y.querySelector("[data-offset-m-t]"),w=y.querySelector("[data-offset-m-b]"),x=y.querySelector("[data-offset-m-l]"),C=y.querySelector("[data-offset-m-r]"),S=y.querySelector("[data-offset-p-t]"),_=y.querySelector("[data-offset-p-b]"),E=y.querySelector("[data-offset-p-l]"),O=y.querySelector("[data-offset-p-r]")),!this[v]){var k=u.toLowerCase(),T=k+"margin-v",P=k+"padding-v",M=(0,i.default)('<div class="'.concat(m,'marginName">')).get(0),A=(0,i.default)('<div class="'.concat(m,'paddingName">')).get(0),D=m+P+"-el",N="".concat(m+T+"-el"," ").concat(m+T),R="".concat(D," ").concat(m+P);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),C=(0,i.default)('<div class="'.concat(N,'-right"></div>')).get(0),S=(0,i.default)('<div class="'.concat(R,'-top"></div>')).get(0),_=(0,i.default)('<div class="'.concat(R,'-bottom"></div>')).get(0),E=(0,i.default)('<div class="'.concat(R,'-left"></div>')).get(0),O=(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]=C,this["padT"+u]=S,this["padB"+u]=_,this["padL"+u]=E,this["padR"+u]=O,M.appendChild(b),M.appendChild(w),M.appendChild(x),M.appendChild(C),A.appendChild(S),A.appendChild(_),A.appendChild(E),A.appendChild(O),y.appendChild(M),y.appendChild(A),this[v]="1"}var j="px",I=parseFloat(g.marginLeft.replace(j,""))*p,L=parseFloat(g.marginRight.replace(j,""))*p,F=parseFloat(g.marginTop.replace(j,""))*p,V=parseFloat(g.marginBottom.replace(j,""))*p,B=b.style,z=w.style,H=x.style,$=C.style,W=S.style,U=_.style,q=E.style,G=O.style,Y=parseFloat(h.left),K=parseFloat(g.width)*p+j;B.height=F+j,B.width=K,B.top=h.top-F+j,B.left=Y+j,z.height=V+j,z.width=K,z.top=h.top+h.height+j,z.left=Y+j;var Z=h.height+F+V+j,X=h.top-F+j;H.height=Z,H.width=I+j,H.top=X,H.left=Y-I+j,$.height=Z,$.width=L+j,$.top=X,$.left=Y+h.width+j;var J=parseFloat(g.paddingTop)*p;W.height=J+j;var Q=parseFloat(g.paddingBottom)*p;U.height=Q+j;var ee=h.height-Q-J+j,te=h.top+J+j;q.height=ee,q.width=parseFloat(g.paddingLeft)*p+j,q.top=te;var ne=parseFloat(g.paddingRight)*p;G.height=ee,G.width=ne+j,G.top=te}}else e.stopCommand("".concat(this.id),n)},stop:function(e,t,n){void 0===n&&(n={});var r=(n||{}).state||"",o=this.getOffsetMethod(r),i=n.view;this.canvas[o](i).style.opacity=0}}},434:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(50),o=n(163);const i={init:function(){(0,r.bindAll)(this,"_onFramesChange")},run:function(e){this.toggleVis(e,!0)},stop:function(e){this.toggleVis(e,!1)},toggleVis:function(e,t){if(void 0===t&&(t=!0),!e.Commands.isActive("preview")){var n=e.Canvas,r=t?"on":"off";n.getModel()[r]("change:frames",this._onFramesChange),this.handleFrames(n.getFrames(),t)}},handleFrames:function(e,t){var n=this;e.forEach((function(e){var r;(null===(r=e.view)||void 0===r?void 0:r.loaded)&&n._upFrame(e,t),e.__ol||(e.on("loaded",(function(){return n._upFrame(e)})),e.__ol=!0)}))},_onFramesChange:function(e,t){this.handleFrames(t)},_upFrame:function(e,t){var n,r=this,i=r.ppfx,a=r.em,s=r.id,l=((0,o.isDef)(t)?t:a.Commands.isActive(s))?"add":"remove",c="".concat(i,"dashed");null===(n=e.view)||void 0===n||n.getBody().classList[l](c)}}},346:(e,t,n)=>{n.d(t,{FE:()=>u,G7:()=>d,Hn:()=>c,pH:()=>p,vA:()=>o});var r,o,i=n(316),a=n.n(i),s=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)},c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(a().Model),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(a().Collection),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(a().View);!function(e){e.Screen="screen",e.World="world"}(o||(o={}));var p={x:0,y:0};l(l({},p),{width:0,height:0})},330:(e,t,n)=>{n.d(t,{Z:()=>l});var r,o=n(50),i=n(346),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=function(e){function t(t,n,r){void 0===t&&(t={}),void 0===r&&(r=!1);var o=e.call(this,t)||this;return o.itemsView="",o.itemType="type",o.reuseView=!1,o.config=n||t.config||{},r&&o.listenTo(o.collection,"add",o.addTo),o.items=[],o}return a(t,e),t.prototype.addTo=function(e){this.add(e)},t.prototype.itemViewNotFound=function(e){var t=this.config,n=this.ns,r=t.em,o="".concat(n?"[".concat(n,"]: "):"","'").concat(e,"' type not found");r&&r.logWarning(o)},t.prototype.add=function(e,t){var n,r=this,i=r.config,a=r.reuseView,s=r.items,l=this.itemsView||{},c=t||null,u=this.itemView,d=e.get(this.itemType);l[d]?u=l[d]:!d||l[d]||(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"],d)||this.itemViewNotFound(d),n=e.view&&a?e.view:new u({model:e,config:i},i),s&&s.push(n);var p=n.render().el;c?c.appendChild(p):this.$el.append(p)},t.prototype.render=function(){var e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(t){this.add(t,e)}),this),this.$el.append(e),this.onRender(),this},t.prototype.onRender=function(){},t.prototype.onRemoveBefore=function(e,t){},t.prototype.onRemove=function(e,t){},t.prototype.remove=function(t){void 0===t&&(t={});var n=this.items;return this.onRemoveBefore(n,t),this.clearItems(),e.prototype.remove.call(this),this.onRemove(n,t),this},t.prototype.clearItems=function(){this.items},t}(i.G7);const l=s;s.prototype.itemView=""},668:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(50),o=n(491),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=["x","y"],s=function(){function e(e){return void 0===e&&(e={}),this.opts={snapOffset:5,scale:1},(0,r.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(e),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 e.prototype.setOptions=function(e){void 0===e&&(e={}),this.opts=i(i({},this.opts),e)},e.prototype.toggleDrag=function(e){var t=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=e?"on":"off",a={on:o.on,off:o.S1};a[i](n,"mousemove dragover",this.drag),a[i](t,"mouseup dragend touchend",this.stop),a[i](t,"keydown",this.keyHandle),a[i](r,"scroll",this.handleScroll)},e.prototype.handleScroll=function(){var e=this.lastScroll,t=this.delta,n=this.getScrollInfo(),r={x:n.x-e.x,y:n.y-e.y};this.move(t.x+r.x,t.y+r.y),this.lastScrollDiff=r},e.prototype.start=function(e){var t=this.opts,n=t.onStart;this.toggleDrag(!0),this.startPointer=this.getPointerPos(e),this.guidesStatic=(0,r.result)(t,"guidesStatic")||[],this.guidesTarget=(0,r.result)(t,"guidesTarget")||[],(0,r.isFunction)(n)&&n(e,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(e)},e.prototype.drag=function(e){var t=this,n=this,o=n.opts,s=n.lastScrollDiff,l=n.globScrollDiff,c=o.onDrag,u=this.startPointer,d=this.getPointerPos(e),p={x:l.x+s.x,y:l.y+s.y};this.globScrollDiff=p;var f={x:d.x-u.x+p.x,y:d.y-u.y+p.y};this.lastScrollDiff={x:0,y:0};var h=this.lockedAxis;"x"===(h=e.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(e){return n[e]=n[e]*(0,r.result)(o,"scale")})),t.delta=n,t.move(n.x,n.y),(0,r.isFunction)(c)&&c(e,t)},m=i({},f);if(this.currentPointer=d,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),g(f),this.guidesTarget.length){var v=this.snapGuides(m),y=v.newDelta,b=v.trgX,w=v.trgY;(b||w)&&g(y)}0===e.which&&this.stop(e)},e.prototype.snapGuides=function(e){var t=this,n=e,o=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&t.trgX||n.y&&t.trgY||(n.active=!1,t.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],d=e[l],p=s?i:o;if(t.isPointIn(c,u)&&(0,r.isUndefined)(p)){var f=d-(c-u);t.setGuideLock(n,f)}}})))})),o=this.trgX,i=this.trgY,a.forEach((function(o){var i=o.toUpperCase(),a=t["trg".concat(i)];a&&!t.isPointIn(e[o],a.lock)&&(t.setGuideLock(a,null),a=null),a&&!(0,r.isUndefined)(a.lock)&&(n[o]=a.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}},e.prototype.isPointIn=function(e,t,n){var r=(void 0===n?{}:n).offset||this.opts.snapOffset||0;return e>=t&&e<=t+r||e<=t&&e>=t-r},e.prototype.setGuideLock=function(e,t){var n=(0,r.isUndefined)(e.x)?"Y":"X",o="trg".concat(n);return null!==t?(e.active=!0,e.lock=t,this[o]=e):(delete e.active,delete e.lock,delete this[o]),e},e.prototype.stop=function(e,t){void 0===t&&(t={});var n=this.delta,o=!!t.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(e,this,{cancelled:o})},e.prototype.keyHandle=function(e){(0,o.kl)(e)&&this.stop(e,{cancel:!0})},e.prototype.move=function(e,t,n){var o=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+e,c=a.y+t;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"))}},e.prototype.getContainerEl=function(){var e=this.opts.container;return e?[e]:this.getDocumentEl()},e.prototype.getWindowEl=function(){return this.getContainerEl().map((function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow}))},e.prototype.getDocumentEl=function(e){var t=this.opts.doc;if(e=e||this.el,!this.docs.length){var n=[document];e&&n.push(e.ownerDocument),t&&n.push(t),this.docs=n}return this.docs},e.prototype.getPointerPos=function(e){var t=this.opts.getPointerPosition,n=(0,o.VB)(e);return t?t(e):{x:n.clientX,y:n.clientY}},e.prototype.getStartPosition=function(){var e=this.el,t=this.opts.getPosition,n={x:0,y:0};return(0,r.isFunction)(t)?n=t():e&&(n={x:parseFloat(e.style.left),y:parseFloat(e.style.top)}),n},e.prototype.getScrollInfo=function(){var e=this.opts.doc,t=e&&e.body;return{y:t?t.scrollTop:0,x:t?t.scrollLeft:0}},e.prototype.detectAxisLock=function(e,t){var n=e,r=t,o=Math.abs(n),i=Math.abs(r);return r>=o||r<=-o?"x":n>i||n<-i?"y":void 0},e}();const l=s},895:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ge});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,d=i.slice,p=i.splice,f=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,m=/^\w+$/;function v(e,t){return void 0===t&&(t=r),h.test(e)?t.getElementsByClassName(e.slice(1)):m.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}function y(e,t){if(void 0===t&&(t=r),e){if(e.__cash)return e;var n=e;if(T(e)){if(t.__cash&&(t=t[0]),!(n=f.test(e)?t.getElementById(e.slice(1)):g.test(e)?pe(e):v(e,t)))return}else if(k(e))return this.ready(e);(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(e,t){return new y(e,t)}var w=b.fn=b.prototype=y.prototype={constructor:b,__cash:!0,length:0,splice:p};w.get=function(e){return void 0===e?d.call(this):this[e<0?e+this.length:e]},w.eq=function(e){return b(this.get(e))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)},w.map=function(e){return b(l.call(this,(function(t,n){return e.call(t,n,t)})))},w.slice=function(){return b(d.apply(this,arguments))};var x=/(?:^\w|[A-Z]|\b\w)/g,C=/[\s-_]+/g;function S(e){return e.replace(x,(function(e,t){return e[t?"toUpperCase":"toLowerCase"]()})).replace(C,"")}function _(e,t){for(var n=0,r=e.length;n<r&&!1!==t.call(e[n],e[n],n,e);n++);}b.camelCase=S,b.each=_,w.each=function(e){return _(this,(function(t,n){return e.call(t,n,t)})),this},w.removeProp=function(e){return this.each((function(t,n){delete n[e]}))},b.extend=w.extend=function(e){void 0===e&&(e=this);for(var t=arguments,n=t.length,r=n<2?0:1;r<n;r++)for(var o in t[r])e[o]=t[r][o];return e};var E=1;function O(e,t){var n=e&&(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function k(e){return"function"==typeof e}function T(e){return"string"==typeof e}function P(e){return!isNaN(parseFloat(e))&&isFinite(e)}b.guid=E,b.matches=O,b.isFunction=k,b.isString=T,b.isNumeric=P;var M=Array.isArray;function A(e){return T(e)?function(t,n){return O(n,e)}:e.__cash?function(t,n){return e.is(n)}:function(e,t,n){return t===n}}b.isArray=M,w.prop=function(e,t){if(e){if(T(e))return arguments.length<2?this[0]&&this[0][e]:this.each((function(n,r){r[e]=t}));for(var n in e)this.prop(n,e[n]);return this}},w.filter=function(e){if(!e)return b();var t=k(e)?e:A(e);return b(a.call(this,(function(n,r){return t.call(n,r,n,e)})))};var D=/\S+/g;function N(e){return T(e)&&e.match(D)||[]}function R(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))}function j(e,t,n){if(1===e.nodeType){var r=o.getComputedStyle(e,null);return t?n?r.getPropertyValue(t):r[t]:r}}function I(e,t){return parseInt(j(e,t),10)||0}w.hasClass=function(e){var t=N(e),n=!1;return t.length&&this.each((function(e,r){return!(n=r.classList.contains(t[0]))})),n},w.removeAttr=function(e){var t=N(e);return t.length?this.each((function(e,n){_(t,(function(e){n.removeAttribute(e)}))})):this},w.attr=function(e,t){if(e){if(T(e)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(e);return null===n?void 0:n}return null===t?this.removeAttr(e):this.each((function(n,r){r.setAttribute(e,t)}))}for(var r in e)this.attr(r,e[r]);return this}},w.toggleClass=function(e,t){var n=N(e),r=void 0!==t;return n.length?this.each((function(e,o){_(n,(function(e){r?t?o.classList.add(e):o.classList.remove(e):o.classList.toggle(e)}))})):this},w.addClass=function(e){return this.toggleClass(e,!0)},w.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")},b.unique=R,w.add=function(e,t){return b(R(this.get().concat(b(e,t).get())))};var L=/^--/;function F(e){return L.test(e)}var V={},B=r&&r.createElement("div"),z=B?B.style:{},H=["webkit","moz","ms","o"];function $(e,t){if(void 0===t&&(t=F(e)),t)return e;if(!V[e]){var n=S(e),r=""+n.charAt(0).toUpperCase()+n.slice(1);_((n+" "+H.join(r+" ")+r).split(" "),(function(t){if(t in z)return V[e]=t,!1}))}return V[e]}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(e,t,n){return void 0===n&&(n=F(e)),n||W[e]||!P(t)?t:t+"px"}w.css=function(e,t){if(T(e)){var n=F(e);return e=$(e,n),arguments.length<2?this[0]&&j(this[0],e,n):e?(t=U(e,t,n),this.each((function(r,o){1===o.nodeType&&(n?o.style.setProperty(e,t):o.style[e]=t)}))):this}for(var r in e)this.css(r,e[r]);return this};var q="__cashData",G=/^data-(.*)/;function Y(e){return e[q]=e[q]||{}}function K(e,t){var n=Y(e);if(t){if(!(t in n)){var r=e.dataset?e.dataset[t]||e.dataset[S(t)]:b(e).attr("data-"+t);if(void 0!==r){try{r=JSON.parse(r)}catch(e){}n[t]=r}}return n[t]}return n}function Z(e,t){return I(e,"border"+(t?"Left":"Top")+"Width")+I(e,"padding"+(t?"Left":"Top"))+I(e,"padding"+(t?"Right":"Bottom"))+I(e,"border"+(t?"Right":"Bottom")+"Width")}function X(e,t){for(var n=0,r=t.length;n<r;n++)if(e.indexOf(t[n])<0)return!1;return!0}function J(e,t,n){_(e[n],(function(e){e[0];var r=e[1];t.removeEventListener(n,r)})),delete e[n]}b.hasData=function(e){return q in e},w.data=function(e,t){var n=this;if(!e){if(!this[0])return;return _(this[0].attributes,(function(e){var t=e.name.match(G);t&&n.data(t[1])})),K(this[0])}if(T(e))return void 0===t?this[0]&&K(this[0],e):this.each((function(n,r){return function(e,t,n){Y(e)[t]=n}(r,e,t)}));for(var r in e)this.data(r,e[r]);return this},w.removeData=function(e){return this.each((function(t,n){return function(e,t){void 0===t?delete e[q]:delete Y(e)[t]}(n,e)}))},_(["Width","Height"],(function(e){w["inner"+e]=function(){if(this[0])return this[0]===o?o["inner"+e]:this[0]["client"+e]}})),_(["width","height"],(function(e,t){w[e]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each((function(r,o){if(1===o.nodeType){var i=j(o,"boxSizing");o.style[e]=U(e,n+("border-box"===i?Z(o,!t):0))}}))):this[0]===o?this[0][S("outer-"+e)]:this[0].getBoundingClientRect()[e]-Z(this[0],!t):void 0===n?void 0:this}})),_(["Width","Height"],(function(e,t){w["outer"+e]=function(n){if(this[0])return this[0]===o?o["outer"+e]:this[0]["offset"+e]+(n?I(this[0],"margin"+(t?"Top":"Left"))+I(this[0],"margin"+(t?"Bottom":"Right")):0)}}));var Q="__cashEvents";function ee(e){return e[Q]=e[Q]||{}}function te(e){var t=e.split(".");return[t[0],t.slice(1).sort()]}function ne(e,t,n,r){var o=ee(e);if(t){var i=o[t];if(!i)return;r&&(r.guid=r.guid||E++),o[t]=i.filter((function(o){var i=o[0],a=o[1];if(r&&a.guid!==r.guid||!X(i,n))return!0;e.removeEventListener(t,a)}))}else if(n&&n.length)for(t in o)ne(e,t,n,r);else for(t in o)J(o,e,t)}w.off=function(e,t){var n=this;return void 0===e?this.each((function(e,t){return ne(t)})):_(N(e),(function(e){var r=te(e),o=r[0],i=r[1];n.each((function(e,n){return ne(n,o,i,t)}))})),this},w.on=function(e,t,n,r){var o=this;if(!T(e)){for(var i in e)this.on(i,t,e[i]);return this}return k(t)&&(n=t,t=!1),_(N(e),(function(e){var i=te(e),a=i[0],s=i[1];o.each((function(e,o){var i=function e(i){if(!i.namespace||X(s,i.namespace.split("."))){var l=o;if(t){for(var c=i.target;!O(c,t);){if(c===o)return;if(!(c=c.parentNode))return}l=c}i.namespace=i.namespace||"";var u=n.call(l,i,i.data);r&&ne(o,a,s,e),!1===u&&(i.preventDefault(),i.stopPropagation())}};i.guid=n.guid=n.guid||E++,function(e,t,n,r){r.guid=r.guid||E++;var o=ee(e);o[t]=o[t]||[],o[t].push([n,r]),e.addEventListener(t,r)}(o,a,s,i)}))})),this},w.one=function(e,t,n){return this.on(e,t,n,!0)},w.ready=function(e){var t=function(){return e(b)};return"loading"!==r.readyState?setTimeout(t):r.addEventListener("DOMContentLoaded",t),this},w.trigger=function(e,t){var n=e;if(T(e)){var o=te(e),i=o[0],a=o[1];(n=r.createEvent("HTMLEvents")).initEvent(i,!0,!0),n.namespace=a.join(".")}return n.data=t,this.each((function(e,t){t.dispatchEvent(n)}))};var re=/select-one/i,oe=/select-multiple/i;function ie(e){var t=e.type;return re.test(t)?function(e){return e.selectedIndex<0?null:e.options[e.selectedIndex].value}(e):oe.test(t)?function(e){var t=[];return _(e.options,(function(e){!e.selected||e.disabled||e.parentNode.disabled||t.push(e.value)})),t}(e):e.value}var ae=/%20/g;var se=/file|reset|submit|button|image/i,le=/radio|checkbox/i;w.serialize=function(){var e="";return this.each((function(t,n){_(n.elements||[n],(function(t){if(!t.disabled&&t.name&&"FIELDSET"!==t.tagName&&!se.test(t.type)&&(!le.test(t.type)||t.checked)){var n=ie(t);if(void 0!==n)_(M(n)?n:[n],(function(n){e+=function(e,t){return"&"+encodeURIComponent(e)+"="+encodeURIComponent(t).replace(ae,"+")}(t.name,n)}))}}))})),e.substr(1)},w.val=function(e){return void 0===e?this[0]&&ie(this[0]):this.each((function(t,n){var r=oe.test(n.type),o=null===e?r?[]:"":e;r&&M(o)?_(n.options,(function(e){e.selected=o.indexOf(e.value)>=0})):n.value=o}))},w.clone=function(){return this.map((function(e,t){return t.cloneNode(!0)}))},w.detach=function(){return this.each((function(e,t){t.parentNode&&t.parentNode.removeChild(t)}))};var ce,ue=/^\s*<(\w+)[^>]*>/,de=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function pe(e){if(function(){if(!ce){var e=r.createElement("table"),t=r.createElement("tr");ce={"*":r.createElement("div"),tr:r.createElement("tbody"),td:t,th:t,thead:e,tbody:e,tfoot:e}}}(),!T(e))return[];if(de.test(e))return[r.createElement(RegExp.$1)];var t=ue.test(e)&&RegExp.$1,n=ce[t]||ce["*"];return n.innerHTML=e,b(n.childNodes).detach().get()}function fe(e,t,n){if(void 0!==t){var r=T(t);!r&&t.length?_(t,(function(t){return fe(e,t,n)})):_(e,r?function(e){e.insertAdjacentHTML(n?"afterbegin":"beforeend",t)}:function(e,r){return function(e,t,n){n?e.insertBefore(t,e.childNodes[0]):e.appendChild(t)}(e,r?t.cloneNode(!0):t,n)})}}b.parseHTML=pe,w.empty=function(){var e=this[0];if(e)for(;e.firstChild;)e.removeChild(e.firstChild);return this},w.append=function(){var e=this;return _(arguments,(function(t){fe(e,t)})),this},w.appendTo=function(e){return fe(b(e),this),this},w.html=function(e){if(void 0===e)return this[0]&&this[0].innerHTML;var t=e.nodeType?e[0].outerHTML:e;return this.each((function(e,n){n.innerHTML=t}))},w.insertAfter=function(e){var t=this;return b(e).each((function(e,n){var r=n.parentNode;t.each((function(t,o){r.insertBefore(e?o.cloneNode(!0):o,n.nextSibling)}))})),this},w.after=function(){var e=this;return _(u.apply(arguments),(function(t){u.apply(b(t).slice()).insertAfter(e)})),this},w.insertBefore=function(e){var t=this;return b(e).each((function(e,n){var r=n.parentNode;t.each((function(t,o){r.insertBefore(e?o.cloneNode(!0):o,n)}))})),this},w.before=function(){var e=this;return _(arguments,(function(t){b(t).insertBefore(e)})),this},w.prepend=function(){var e=this;return _(arguments,(function(t){fe(e,t,!0)})),this},w.prependTo=function(e){return fe(b(e),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(e){var t=this;return this.each((function(n,r){var o=r.parentNode;if(o){var i=n?b(e).clone():b(e);if(!i[0])return t.remove(),!1;o.replaceChild(i[0],r),b(i[0]).after(i.slice(1))}}))},w.replaceAll=function(e){return b(e).replaceWith(this),this},w.text=function(e){return void 0===e?this[0]?this[0].textContent:"":this.each((function(t,n){n.textContent=e}))};var he=r&&r.documentElement;w.offset=function(){var e=this[0];if(e){var t=e.getBoundingClientRect();return{top:t.top+o.pageYOffset-he.clientTop,left:t.left+o.pageXOffset-he.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var e=this[0];if(e)return{left:e.offsetLeft,top:e.offsetTop}},w.children=function(e){var t=[];return this.each((function(e,n){c.apply(t,n.children)})),t=b(R(t)),e?t.filter((function(t,n){return O(n,e)})):t},w.contents=function(){var e=[];return this.each((function(t,n){c.apply(e,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)})),b(e.length&&R(e))},w.find=function(e){for(var t=[],n=0,r=this.length;n<r;n++){var o=v(e,this[n]);o.length&&c.apply(t,o)}return b(t.length&&R(t))},w.has=function(e){var t=T(e)?function(t,n){return!!v(e,n).length}:function(t,n){return n.contains(e)};return this.filter(t)},w.is=function(e){if(!e||!this[0])return!1;var t=A(e),n=!1;return this.each((function(r,o){return!(n=t(r,o,e))})),n},w.next=function(){return b(this[0]&&this[0].nextElementSibling)},w.not=function(e){if(!e||!this[0])return this;var t=A(e);return this.filter((function(n,r){return!t(n,r,e)}))},w.parent=function(){var e=[];return this.each((function(t,n){n&&n.parentNode&&e.push(n.parentNode)})),b(R(e))},w.index=function(e){var t=e?b(e)[0]:this[0],n=e?this:b(t).parent().children();return s.call(n,t)},w.closest=function(e){return e&&this[0]?this.is(e)?this.filter(e):this.parent().closest(e):b()},w.parents=function(e){var t,n=[];return this.each((function(o,i){for(t=i;t&&t.parentNode&&t!==r.body.parentNode;)t=t.parentNode,(!e||e&&O(t,e))&&n.push(t)})),b(R(n))},w.prev=function(){return b(this[0]&&this[0].previousElementSibling)},w.siblings=function(){var e=this[0];return this.parent().children().filter((function(t,n){return n!==e}))};const ge=b},491:(e,t,n)=>{n.d(t,{$Q:()=>f,BM:()=>b,FW:()=>u,G1:()=>i,GX:()=>C,L_:()=>s,Mx:()=>a,R3:()=>h,S1:()=>M,SJ:()=>y,Ut:()=>x,VB:()=>E,Vb:()=>T,cx:()=>l,dL:()=>p,kl:()=>O,o5:()=>w,on:()=>P,pn:()=>d,r$:()=>k,rw:()=>m,sE:()=>c,sN:()=>_,t3:()=>v,ut:()=>g});var r=n(50),o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},i="transitionend oTransitionEnd transitionend webkitTransitionEnd",a=function(e){return(null==e?void 0:e.nodeType)===Node.DOCUMENT_NODE},s=function(e){var t=e&&e.parentNode;t&&t.removeChild(e)};function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(Array.isArray(e[0])?e[0]:o([],e,!0)).filter(Boolean).join(" ")}var c=function(e,t){return e.querySelectorAll(t)},u=function(e,t){return void 0===t&&(t={}),e&&e.setAttribute&&(0,r.each)(t,(function(t,n){return e.setAttribute(n,t)}))},d=function(e){var t;return e&&!!(e.offsetWidth||e.offsetHeight||(null===(t=e.getClientRects)||void 0===t?void 0:t.call(e).length))},p=function(e,t){var n;null===(n=e.parentNode)||void 0===n||n.replaceChild(t,e)},f=function(e,t,n){var o=e.childNodes,i=o.length,a=(0,r.isUndefined)(n)?i:n;(0,r.isString)(t)&&(e.insertAdjacentHTML("beforeEnd",t),t=e.lastChild,e.removeChild(t)),a>=i?e.appendChild(t):e.insertBefore(t,o[a])},h=function(e,t){return f(e,t)},g=function(e,t,n){void 0===t&&(t={});var o=document.createElement(e);return t&&(0,r.each)(t,(function(e,t){return o.setAttribute(t,e)})),n&&((0,r.isString)(n)?o.innerHTML=n:o.appendChild(n)),o},m=function(e){return document.createTextNode(e)},v=function(e,t){var n,r=e.type;try{n=new window[t](r,e)}catch(e){(n=document.createEvent(t)).initEvent(r,!0,!0)}return n._parentEvent=e,0===r.indexOf("key")&&(n.keyCodeVal=e.keyCode,["keyCode","which"].forEach((function(e){Object.defineProperty(n,e,{get:function(){return this.keyCodeVal}})}))),n},y=function(e,t){void 0===t&&(t=[]),(Array.isArray(t)?t:[t]).forEach((function(t){var n=t.tag||"div",o=t.attributes||{},i=document.createElement(n);(0,r.each)(o,(function(e,t){i.setAttribute(t,e)})),e.appendChild(i)}))},b=function(e){return(null==e?void 0:e.nodeType)===Node.TEXT_NODE},w=function(e){return e&&!b(e)&&!function(e){return(null==e?void 0:e.nodeType)===Node.COMMENT_NODE}(e)},x=function(e){var t,n={top:0,left:0,width:0,height:0};if(!e)return n;if(b(e)){var r=document.createRange();r.selectNode(e),t=r.getBoundingClientRect(),r.detach()}return t||(e.getBoundingClientRect?e.getBoundingClientRect():n)},C=function(e){var t=(null==e?void 0:e.ownerDocument)||document,n=t.documentElement,r=t.defaultView||window;return{x:(r.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(r.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},S=function(e){return e.which||e.keyCode},_=function(e){return String.fromCharCode(S(e))},E=function(e){return e.touches&&e.touches[0]?e.touches[0]:e},O=function(e){return 27===S(e)},k=function(e){return 13===S(e)},T=function(e){return function(e){return e.ctrlKey}(e)||e.metaKey},P=function(e,t,n,o){var i=t.split(/\s+/),a=(0,r.isArray)(e)?e:[e];i.forEach((function(e){a.forEach((function(t){return null==t?void 0:t.addEventListener(e,n,o)}))}))},M=function(e,t,n,o){var i=t.split(/\s+/),a=(0,r.isArray)(e)?e:[e];i.forEach((function(e){a.forEach((function(t){return null==t?void 0:t.removeEventListener(e,n,o)}))}))}},163:(e,t,n)=>{n.r(t),n.d(t,{appendStyles:()=>v,buildBase64UrlFromSvg:()=>B,camelCase:()=>x,capitalize:()=>D,createId:()=>V,deepMerge:()=>T,escape:()=>O,escapeNodeContent:()=>k,find:()=>E,getComponentModel:()=>L,getComponentView:()=>I,getElement:()=>_,getGlobal:()=>p,getModel:()=>P,getUiClass:()=>m,getUnitFromValue:()=>b,getViewEl:()=>R,hasDnd:()=>S,hasWin:()=>d,isBultInMethod:()=>s,isComponent:()=>j,isDef:()=>u,isEmptyObj:()=>A,isObject:()=>M,isRule:()=>N,matches:()=>g,normalizeFloat:()=>C,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(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a={},s=function(e){return(0,r.isFunction)(a[e])},l=function(e){return s(e)?"_".concat(e):e},c=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},u=function(e){return void 0!==e},d=function(){return"undefined"!=typeof window},p=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:n.g},f=function(e){return(e||"").toLowerCase()},h=d()?window.Element.prototype:{},g=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.msMatchesSelector,m=function(e,t){var n=e.getConfig(),r=n.stylePrefix;return[n.customUI&&"".concat(r,"cui"),t].filter((function(e){return e})).join(" ")},v=function(e,t){void 0===t&&(t={});var n=(0,r.isArray)(e)?function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0):[e];if(n.length){var o=n.shift();if(o&&(!t.unique||!document.querySelector('link[href="'.concat(o,'"]')))){var i=document.head,a=document.createElement("link");a.href=o,a.rel="stylesheet",t.prepand?i.insertBefore(a,i.firstChild):i.appendChild(a)}v(n)}},y=function(e,t){var n={},o=(0,r.keys)(t);for(var i in e)if(e.hasOwnProperty(i)){var a=e[i],s=t[i];o.indexOf(i)>=0?a!==s&&(n[i]=s):n[i]=null}for(var i in t)t.hasOwnProperty(i)&&(0,r.isUndefined)(e[i])&&(n[i]=t[i]);return n},b=function(e){return e.replace(parseFloat(e),"")},w=function(e){return e[0].toUpperCase()+e.toLowerCase().slice(1)},x=function(e){return e.replace(/-./g,(function(e){return e[1].toUpperCase()}))},C=function(e,t,n){void 0===t&&(t=1),void 0===n&&(n=0);var r=0;if(isNaN(e))return n;if(e=parseFloat(e),Math.floor(e)!==e){var o=t.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(e.toFixed(r)):e},S=function(e){return"draggable"in document.createElement("i")&&(!e||e.config.nativeDnD)},_=function(e){return(0,r.isElement)(e)||(0,o.BM)(e)?e:e&&e.getEl?e.getEl():void 0},E=function(e,t){var n=null;return e.some((function(r,o){return t(r,o,e)?(n=r,1):0})),n},O=function(e){return void 0===e&&(e=""),"".concat(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},k=function(e){return void 0===e&&(e=""),"".concat(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},T=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=i({},e[0]),r=1;r<e.length;r++){var o=i({},e[r]);for(var a in o){var s=n[a],l=o[a];M(s)&&M(l)?n[a]=T(s,l):n[a]=l}}return n},P=function(e,t){var n;return!t&&e&&e.__cashData?n=e.__cashData.model:t&&(0,r.isElement)(e)&&(n=t(e).data("model")),n},M=function(e){return e&&!Array.isArray(e)&&"object"==typeof e},A=function(e){return Object.keys(e).length<=0},D=function(e){return void 0===e&&(e=""),e&&e.charAt(0).toUpperCase()+e.substring(1)},N=function(e){return e&&e.toCSS},R=function(e){return null==e?void 0:e.__gjsv},j=function(e){return!!(null==e?void 0:e.toHTML)},I=function(e){return R(e)},L=function(e){var t;return null===(t=I(e))||void 0===t?void 0:t.model},F=function(e,t){e.__gjsv=t},V=function(e){void 0===e&&(e=16);for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t},B=function(e){if(e&&"<svg"===e.substr(0,4)){var t="";return d()?t=window.btoa(e):"undefined"!=typeof Buffer&&(t=Buffer.from(e,"utf8").toString("base64")),t?"data:image/svg+xml;base64,".concat(t):e}return e}},828:(e,t,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(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=828},50:(e,t,n)=>{n.r(t),n.d(t,{VERSION:()=>o,after:()=>Rt,all:()=>en,allKeys:()=>me,any:()=>tn,assign:()=>Re,before:()=>jt,bind:()=>Ct,bindAll:()=>Et,chain:()=>yt,chunk:()=>Fn,clone:()=>Fe,collect:()=>Yt,compact:()=>kn,compose:()=>Nt,constant:()=>J,contains:()=>nn,countBy:()=>vn,create:()=>Le,debounce:()=>Mt,default:()=>$n,defaults:()=>je,defer:()=>Tt,delay:()=>kt,detect:()=>Ut,difference:()=>Pn,drop:()=>En,each:()=>Gt,escape:()=>at,every:()=>en,extend:()=>Ne,extendOwn:()=>Re,filter:()=>Jt,find:()=>Ut,findIndex:()=>Vt,findKey:()=>Lt,findLastIndex:()=>Bt,findWhere:()=>qt,first:()=>_n,flatten:()=>Tn,foldl:()=>Zt,foldr:()=>Xt,forEach:()=>Gt,functions:()=>Ae,get:()=>$e,groupBy:()=>gn,has:()=>We,head:()=>_n,identity:()=>Ue,include:()=>nn,includes:()=>nn,indexBy:()=>mn,indexOf:()=>$t,initial:()=>Sn,inject:()=>Zt,intersection:()=>Nn,invert:()=>Me,invoke:()=>rn,isArguments:()=>K,isArray:()=>q,isArrayBuffer:()=>L,isBoolean:()=>T,isDataView:()=>U,isDate:()=>N,isElement:()=>P,isEmpty:()=>le,isEqual:()=>ge,isError:()=>j,isFinite:()=>Z,isFunction:()=>B,isMap:()=>_e,isMatch:()=>ce,isNaN:()=>X,isNull:()=>O,isNumber:()=>D,isObject:()=>E,isRegExp:()=>R,isSet:()=>Oe,isString:()=>A,isSymbol:()=>I,isTypedArray:()=>oe,isUndefined:()=>k,isWeakMap:()=>Ee,isWeakSet:()=>ke,iteratee:()=>Ze,keys:()=>se,last:()=>On,lastIndexOf:()=>Wt,map:()=>Yt,mapObject:()=>Je,matcher:()=>qe,matches:()=>qe,max:()=>sn,memoize:()=>Ot,methods:()=>Ae,min:()=>ln,mixin:()=>Bn,negate:()=>Dt,noop:()=>Qe,now:()=>rt,object:()=>In,omit:()=>Cn,once:()=>It,pairs:()=>Pe,partial:()=>xt,partition:()=>yn,pick:()=>xn,pluck:()=>on,property:()=>Ge,propertyOf:()=>et,random:()=>nt,range:()=>Ln,reduce:()=>Zt,reduceRight:()=>Xt,reject:()=>Qt,rest:()=>En,restArguments:()=>_,result:()=>gt,sample:()=>dn,select:()=>Jt,shuffle:()=>pn,size:()=>bn,some:()=>tn,sortBy:()=>fn,sortedIndex:()=>zt,tail:()=>En,take:()=>_n,tap:()=>Ve,template:()=>ht,templateSettings:()=>lt,throttle:()=>Pt,times:()=>tt,toArray:()=>un,toPath:()=>Be,transpose:()=>Rn,unescape:()=>st,union:()=>Dn,uniq:()=>An,unique:()=>An,uniqueId:()=>vt,unzip:()=>Rn,values:()=>Te,where:()=>an,without:()=>Mn,wrap:()=>At,zip:()=>jn});var r={};n.r(r),n.d(r,{VERSION:()=>o,after:()=>Rt,all:()=>en,allKeys:()=>me,any:()=>tn,assign:()=>Re,before:()=>jt,bind:()=>Ct,bindAll:()=>Et,chain:()=>yt,chunk:()=>Fn,clone:()=>Fe,collect:()=>Yt,compact:()=>kn,compose:()=>Nt,constant:()=>J,contains:()=>nn,countBy:()=>vn,create:()=>Le,debounce:()=>Mt,default:()=>zn,defaults:()=>je,defer:()=>Tt,delay:()=>kt,detect:()=>Ut,difference:()=>Pn,drop:()=>En,each:()=>Gt,escape:()=>at,every:()=>en,extend:()=>Ne,extendOwn:()=>Re,filter:()=>Jt,find:()=>Ut,findIndex:()=>Vt,findKey:()=>Lt,findLastIndex:()=>Bt,findWhere:()=>qt,first:()=>_n,flatten:()=>Tn,foldl:()=>Zt,foldr:()=>Xt,forEach:()=>Gt,functions:()=>Ae,get:()=>$e,groupBy:()=>gn,has:()=>We,head:()=>_n,identity:()=>Ue,include:()=>nn,includes:()=>nn,indexBy:()=>mn,indexOf:()=>$t,initial:()=>Sn,inject:()=>Zt,intersection:()=>Nn,invert:()=>Me,invoke:()=>rn,isArguments:()=>K,isArray:()=>q,isArrayBuffer:()=>L,isBoolean:()=>T,isDataView:()=>U,isDate:()=>N,isElement:()=>P,isEmpty:()=>le,isEqual:()=>ge,isError:()=>j,isFinite:()=>Z,isFunction:()=>B,isMap:()=>_e,isMatch:()=>ce,isNaN:()=>X,isNull:()=>O,isNumber:()=>D,isObject:()=>E,isRegExp:()=>R,isSet:()=>Oe,isString:()=>A,isSymbol:()=>I,isTypedArray:()=>oe,isUndefined:()=>k,isWeakMap:()=>Ee,isWeakSet:()=>ke,iteratee:()=>Ze,keys:()=>se,last:()=>On,lastIndexOf:()=>Wt,map:()=>Yt,mapObject:()=>Je,matcher:()=>qe,matches:()=>qe,max:()=>sn,memoize:()=>Ot,methods:()=>Ae,min:()=>ln,mixin:()=>Bn,negate:()=>Dt,noop:()=>Qe,now:()=>rt,object:()=>In,omit:()=>Cn,once:()=>It,pairs:()=>Pe,partial:()=>xt,partition:()=>yn,pick:()=>xn,pluck:()=>on,property:()=>Ge,propertyOf:()=>et,random:()=>nt,range:()=>Ln,reduce:()=>Zt,reduceRight:()=>Xt,reject:()=>Qt,rest:()=>En,restArguments:()=>_,result:()=>gt,sample:()=>dn,select:()=>Jt,shuffle:()=>pn,size:()=>bn,some:()=>tn,sortBy:()=>fn,sortedIndex:()=>zt,tail:()=>En,take:()=>_n,tap:()=>Ve,template:()=>ht,templateSettings:()=>lt,throttle:()=>Pt,times:()=>tt,toArray:()=>un,toPath:()=>Be,transpose:()=>Rn,unescape:()=>st,union:()=>Dn,uniq:()=>An,unique:()=>An,uniqueId:()=>vt,unzip:()=>Rn,values:()=>Te,where:()=>an,without:()=>Mn,wrap:()=>At,zip:()=>jn});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,d=s.toString,p=s.hasOwnProperty,f="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,m=Object.keys,v=Object.create,y=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1;function _(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),o=0;o<n;o++)r[o]=arguments[o+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var i=Array(t+1);for(o=0;o<t;o++)i[o]=arguments[o];return i[t]=r,e.apply(this,i)}}function E(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function O(e){return null===e}function k(e){return void 0===e}function T(e){return!0===e||!1===e||"[object Boolean]"===d.call(e)}function P(e){return!(!e||1!==e.nodeType)}function M(e){var t="[object "+e+"]";return function(e){return d.call(e)===t}}const A=M("String"),D=M("Number"),N=M("Date"),R=M("RegExp"),j=M("Error"),I=M("Symbol"),L=M("ArrayBuffer");var F=M("Function"),V=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof V&&(F=function(e){return"function"==typeof e||!1});const B=F,z=M("Object");var H=h&&z(new DataView(new ArrayBuffer(8))),$="undefined"!=typeof Map&&z(new Map),W=M("DataView");const U=H?function(e){return null!=e&&B(e.getInt8)&&L(e.buffer)}:W,q=g||M("Array");function G(e,t){return null!=e&&p.call(e,t)}var Y=M("Arguments");!function(){Y(arguments)||(Y=function(e){return G(e,"callee")})}();const K=Y;function Z(e){return!I(e)&&w(e)&&!isNaN(parseFloat(e))}function X(e){return D(e)&&b(e)}function J(e){return function(){return e}}function Q(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=S}}function ee(e){return function(t){return null==t?void 0:t[e]}}const te=ee("byteLength"),ne=Q(te);var re=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const oe=f?function(e){return y?y(e)&&!U(e):ne(e)&&re.test(d.call(e))}:J(!1),ie=ee("length");function ae(e,t){t=function(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=C.length,r=e.constructor,o=B(r)&&r.prototype||s,i="constructor";for(G(e,i)&&!t.contains(i)&&t.push(i);n--;)(i=C[n])in e&&e[i]!==o[i]&&!t.contains(i)&&t.push(i)}function se(e){if(!E(e))return[];if(m)return m(e);var t=[];for(var n in e)G(e,n)&&t.push(n);return x&&ae(e,t),t}function le(e){if(null==e)return!0;var t=ie(e);return"number"==typeof t&&(q(e)||A(e)||K(e))?0===t:0===ie(se(e))}function ce(e,t){var n=se(t),r=n.length;if(null==e)return!r;for(var o=Object(e),i=0;i<r;i++){var a=n[i];if(t[a]!==o[a]||!(a in o))return!1}return!0}function ue(e){return e instanceof ue?e:this instanceof ue?void(this._wrapped=e):new ue(e)}function de(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}ue.VERSION=o,ue.prototype.value=function(){return this._wrapped},ue.prototype.valueOf=ue.prototype.toJSON=ue.prototype.value,ue.prototype.toString=function(){return String(this._wrapped)};var pe="[object DataView]";function fe(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&he(e,t,n,r)}function he(e,t,n,r){e instanceof ue&&(e=e._wrapped),t instanceof ue&&(t=t._wrapped);var o=d.call(e);if(o!==d.call(t))return!1;if(H&&"[object Object]"==o&&U(e)){if(!U(t))return!1;o=pe}switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return l.valueOf.call(e)===l.valueOf.call(t);case"[object ArrayBuffer]":case pe:return he(de(e),de(t),n,r)}var i="[object Array]"===o;if(!i&&oe(e)){if(te(e)!==te(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;i=!0}if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(B(a)&&a instanceof a&&B(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===e)return r[c]===t;if(n.push(e),r.push(t),i){if((c=e.length)!==t.length)return!1;for(;c--;)if(!fe(e[c],t[c],n,r))return!1}else{var u,p=se(e);if(c=p.length,se(t).length!==c)return!1;for(;c--;)if(!G(t,u=p[c])||!fe(e[u],t[u],n,r))return!1}return n.pop(),r.pop(),!0}function ge(e,t){return fe(e,t)}function me(e){if(!E(e))return[];var t=[];for(var n in e)t.push(n);return x&&ae(e,t),t}function ve(e){var t=ie(e);return function(n){if(null==n)return!1;var r=me(n);if(ie(r))return!1;for(var o=0;o<t;o++)if(!B(n[e[o]]))return!1;return e!==Ce||!B(n[ye])}}var ye="forEach",be=["clear","delete"],we=["get","has","set"],xe=be.concat(ye,we),Ce=be.concat(we),Se=["add"].concat(be,ye,"has");const _e=$?ve(xe):M("Map"),Ee=$?ve(Ce):M("WeakMap"),Oe=$?ve(Se):M("Set"),ke=M("WeakSet");function Te(e){for(var t=se(e),n=t.length,r=Array(n),o=0;o<n;o++)r[o]=e[t[o]];return r}function Pe(e){for(var t=se(e),n=t.length,r=Array(n),o=0;o<n;o++)r[o]=[t[o],e[t[o]]];return r}function Me(e){for(var t={},n=se(e),r=0,o=n.length;r<o;r++)t[e[n[r]]]=n[r];return t}function Ae(e){var t=[];for(var n in e)B(e[n])&&t.push(n);return t.sort()}function De(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var o=1;o<r;o++)for(var i=arguments[o],a=e(i),s=a.length,l=0;l<s;l++){var c=a[l];t&&void 0!==n[c]||(n[c]=i[c])}return n}}const Ne=De(me),Re=De(se),je=De(me,!0);function Ie(e){if(!E(e))return{};if(v)return v(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function Le(e,t){var n=Ie(e);return t&&Re(n,t),n}function Fe(e){return E(e)?q(e)?e.slice():Ne({},e):e}function Ve(e,t){return t(e),e}function Be(e){return q(e)?e:[e]}function ze(e){return ue.toPath(e)}function He(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0}function $e(e,t,n){var r=He(e,ze(t));return k(r)?n:r}function We(e,t){for(var n=(t=ze(t)).length,r=0;r<n;r++){var o=t[r];if(!G(e,o))return!1;e=e[o]}return!!n}function Ue(e){return e}function qe(e){return e=Re({},e),function(t){return ce(t,e)}}function Ge(e){return e=ze(e),function(t){return He(t,e)}}function Ye(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)}}return function(){return e.apply(t,arguments)}}function Ke(e,t,n){return null==e?Ue:B(e)?Ye(e,t,n):E(e)&&!q(e)?qe(e):Ge(e)}function Ze(e,t){return Ke(e,t,1/0)}function Xe(e,t,n){return ue.iteratee!==Ze?ue.iteratee(e,t):Ke(e,t,n)}function Je(e,t,n){t=Xe(t,n);for(var r=se(e),o=r.length,i={},a=0;a<o;a++){var s=r[a];i[s]=t(e[s],s,e)}return i}function Qe(){}function et(e){return null==e?Qe:function(t){return $e(e,t)}}function tt(e,t,n){var r=Array(Math.max(0,e));t=Ye(t,n,1);for(var o=0;o<e;o++)r[o]=t(o);return r}function nt(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ue.toPath=Be,ue.iteratee=Ze;const rt=Date.now||function(){return(new Date).getTime()};function ot(e){var t=function(t){return e[t]},n="(?:"+se(e).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(o,t):e}}const it={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},at=ot(it),st=ot(Me(it)),lt=ue.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ct=/(.)^/,ut={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g;function pt(e){return"\\"+ut[e]}var ft=/^\s*(\w|\$)+\s*$/;function ht(e,t,n){!t&&n&&(t=n),t=je({},t,ue.templateSettings);var r=RegExp([(t.escape||ct).source,(t.interpolate||ct).source,(t.evaluate||ct).source].join("|")+"|$","g"),o=0,i="__p+='";e.replace(r,(function(t,n,r,a,s){return i+=e.slice(o,s).replace(dt,pt),o=s+t.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t})),i+="';\n";var a,s=t.variable;if(s){if(!ft.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(e){throw e.source=i,e}var l=function(e){return a.call(this,e,ue)};return l.source="function("+s+"){\n"+i+"}",l}function gt(e,t,n){var r=(t=ze(t)).length;if(!r)return B(n)?n.call(e):n;for(var o=0;o<r;o++){var i=null==e?void 0:e[t[o]];void 0===i&&(i=n,o=r),e=B(i)?i.call(e):i}return e}var mt=0;function vt(e){var t=++mt+"";return e?e+t:t}function yt(e){var t=ue(e);return t._chain=!0,t}function bt(e,t,n,r,o){if(!(r instanceof t))return e.apply(n,o);var i=Ie(e.prototype),a=e.apply(i,o);return E(a)?a:i}var wt=_((function(e,t){var n=wt.placeholder,r=function(){for(var o=0,i=t.length,a=Array(i),s=0;s<i;s++)a[s]=t[s]===n?arguments[o++]:t[s];for(;o<arguments.length;)a.push(arguments[o++]);return bt(e,r,this,this,a)};return r}));wt.placeholder=ue;const xt=wt,Ct=_((function(e,t,n){if(!B(e))throw new TypeError("Bind must be called on a function");var r=_((function(o){return bt(e,r,t,this,n.concat(o))}));return r})),St=Q(ie);function _t(e,t,n,r){if(r=r||[],t||0===t){if(t<=0)return r.concat(e)}else t=1/0;for(var o=r.length,i=0,a=ie(e);i<a;i++){var s=e[i];if(St(s)&&(q(s)||K(s)))if(t>1)_t(s,t-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 Et=_((function(e,t){var n=(t=_t(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=Ct(e[r],e)}return e}));function Ot(e,t){var n=function(r){var o=n.cache,i=""+(t?t.apply(this,arguments):r);return G(o,i)||(o[i]=e.apply(this,arguments)),o[i]};return n.cache={},n}const kt=_((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})),Tt=xt(kt,ue,1);function Pt(e,t,n){var r,o,i,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:rt(),r=null,a=e.apply(o,i),r||(o=i=null)},c=function(){var c=rt();s||!1!==n.leading||(s=c);var u=t-(c-s);return o=this,i=arguments,u<=0||u>t?(r&&(clearTimeout(r),r=null),s=c,a=e.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 Mt(e,t,n){var r,o,i,a,s,l=function(){var c=rt()-o;t>c?r=setTimeout(l,t-c):(r=null,n||(a=e.apply(s,i)),r||(i=s=null))},c=_((function(c){return s=this,i=c,o=rt(),r||(r=setTimeout(l,t),n&&(a=e.apply(s,i))),a}));return c.cancel=function(){clearTimeout(r),r=i=s=null},c}function At(e,t){return xt(t,e)}function Dt(e){return function(){return!e.apply(this,arguments)}}function Nt(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function Rt(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function jt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}const It=xt(jt,2);function Lt(e,t,n){t=Xe(t,n);for(var r,o=se(e),i=0,a=o.length;i<a;i++)if(t(e[r=o[i]],r,e))return r}function Ft(e){return function(t,n,r){n=Xe(n,r);for(var o=ie(t),i=e>0?0:o-1;i>=0&&i<o;i+=e)if(n(t[i],i,t))return i;return-1}}const Vt=Ft(1),Bt=Ft(-1);function zt(e,t,n,r){for(var o=(n=Xe(n,r,1))(t),i=0,a=ie(e);i<a;){var s=Math.floor((i+a)/2);n(e[s])<o?i=s+1:a=s}return i}function Ht(e,t,n){return function(r,o,i){var a=0,s=ie(r);if("number"==typeof i)e>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=t(u.call(r,a,s),X))>=0?i+a:-1;for(i=e>0?a:s-1;i>=0&&i<s;i+=e)if(r[i]===o)return i;return-1}}const $t=Ht(1,Vt,zt),Wt=Ht(-1,Bt);function Ut(e,t,n){var r=(St(e)?Vt:Lt)(e,t,n);if(void 0!==r&&-1!==r)return e[r]}function qt(e,t){return Ut(e,qe(t))}function Gt(e,t,n){var r,o;if(t=Ye(t,n),St(e))for(r=0,o=e.length;r<o;r++)t(e[r],r,e);else{var i=se(e);for(r=0,o=i.length;r<o;r++)t(e[i[r]],i[r],e)}return e}function Yt(e,t,n){t=Xe(t,n);for(var r=!St(e)&&se(e),o=(r||e).length,i=Array(o),a=0;a<o;a++){var s=r?r[a]:a;i[a]=t(e[s],s,e)}return i}function Kt(e){return function(t,n,r,o){var i=arguments.length>=3;return function(t,n,r,o){var i=!St(t)&&se(t),a=(i||t).length,s=e>0?0:a-1;for(o||(r=t[i?i[s]:s],s+=e);s>=0&&s<a;s+=e){var l=i?i[s]:s;r=n(r,t[l],l,t)}return r}(t,Ye(n,o,4),r,i)}}const Zt=Kt(1),Xt=Kt(-1);function Jt(e,t,n){var r=[];return t=Xe(t,n),Gt(e,(function(e,n,o){t(e,n,o)&&r.push(e)})),r}function Qt(e,t,n){return Jt(e,Dt(Xe(t)),n)}function en(e,t,n){t=Xe(t,n);for(var r=!St(e)&&se(e),o=(r||e).length,i=0;i<o;i++){var a=r?r[i]:i;if(!t(e[a],a,e))return!1}return!0}function tn(e,t,n){t=Xe(t,n);for(var r=!St(e)&&se(e),o=(r||e).length,i=0;i<o;i++){var a=r?r[i]:i;if(t(e[a],a,e))return!0}return!1}function nn(e,t,n,r){return St(e)||(e=Te(e)),("number"!=typeof n||r)&&(n=0),$t(e,t,n)>=0}const rn=_((function(e,t,n){var r,o;return B(t)?o=t:(t=ze(t),r=t.slice(0,-1),t=t[t.length-1]),Yt(e,(function(e){var i=o;if(!i){if(r&&r.length&&(e=He(e,r)),null==e)return;i=e[t]}return null==i?i:i.apply(e,n)}))}));function on(e,t){return Yt(e,Ge(t))}function an(e,t){return Jt(e,qe(t))}function sn(e,t,n){var r,o,i=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=St(e)?e:Te(e)).length;s<l;s++)null!=(r=e[s])&&r>i&&(i=r);else t=Xe(t,n),Gt(e,(function(e,n,r){((o=t(e,n,r))>a||o===-1/0&&i===-1/0)&&(i=e,a=o)}));return i}function ln(e,t,n){var r,o,i=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=St(e)?e:Te(e)).length;s<l;s++)null!=(r=e[s])&&r<i&&(i=r);else t=Xe(t,n),Gt(e,(function(e,n,r){((o=t(e,n,r))<a||o===1/0&&i===1/0)&&(i=e,a=o)}));return i}var cn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function un(e){return e?q(e)?u.call(e):A(e)?e.match(cn):St(e)?Yt(e,Ue):Te(e):[]}function dn(e,t,n){if(null==t||n)return St(e)||(e=Te(e)),e[nt(e.length-1)];var r=un(e),o=ie(r);t=Math.max(Math.min(t,o),0);for(var i=o-1,a=0;a<t;a++){var s=nt(a,i),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,t)}function pn(e){return dn(e,1/0)}function fn(e,t,n){var r=0;return t=Xe(t,n),on(Yt(e,(function(e,n,o){return{value:e,index:r++,criteria:t(e,n,o)}})).sort((function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index})),"value")}function hn(e,t){return function(n,r,o){var i=t?[[],[]]:{};return r=Xe(r,o),Gt(n,(function(t,o){var a=r(t,o,n);e(i,t,a)})),i}}const gn=hn((function(e,t,n){G(e,n)?e[n].push(t):e[n]=[t]})),mn=hn((function(e,t,n){e[n]=t})),vn=hn((function(e,t,n){G(e,n)?e[n]++:e[n]=1})),yn=hn((function(e,t,n){e[n?0:1].push(t)}),!0);function bn(e){return null==e?0:St(e)?e.length:se(e).length}function wn(e,t,n){return t in n}const xn=_((function(e,t){var n={},r=t[0];if(null==e)return n;B(r)?(t.length>1&&(r=Ye(r,t[1])),t=me(e)):(r=wn,t=_t(t,!1,!1),e=Object(e));for(var o=0,i=t.length;o<i;o++){var a=t[o],s=e[a];r(s,a,e)&&(n[a]=s)}return n})),Cn=_((function(e,t){var n,r=t[0];return B(r)?(r=Dt(r),t.length>1&&(n=t[1])):(t=Yt(_t(t,!1,!1),String),r=function(e,n){return!nn(t,n)}),xn(e,r,n)}));function Sn(e,t,n){return u.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function _n(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Sn(e,e.length-t)}function En(e,t,n){return u.call(e,null==t||n?1:t)}function On(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:En(e,Math.max(0,e.length-t))}function kn(e){return Jt(e,Boolean)}function Tn(e,t){return _t(e,t,!1)}const Pn=_((function(e,t){return t=_t(t,!0,!0),Jt(e,(function(e){return!nn(t,e)}))})),Mn=_((function(e,t){return Pn(e,t)}));function An(e,t,n,r){T(t)||(r=n,n=t,t=!1),null!=n&&(n=Xe(n,r));for(var o=[],i=[],a=0,s=ie(e);a<s;a++){var l=e[a],c=n?n(l,a,e):l;t&&!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 Dn=_((function(e){return An(_t(e,!0,!0))}));function Nn(e){for(var t=[],n=arguments.length,r=0,o=ie(e);r<o;r++){var i=e[r];if(!nn(t,i)){var a;for(a=1;a<n&&nn(arguments[a],i);a++);a===n&&t.push(i)}}return t}function Rn(e){for(var t=e&&sn(e,ie).length||0,n=Array(t),r=0;r<t;r++)n[r]=on(e,r);return n}const jn=_(Rn);function In(e,t){for(var n={},r=0,o=ie(e);r<o;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}function Ln(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),o=Array(r),i=0;i<r;i++,e+=n)o[i]=e;return o}function Fn(e,t){if(null==t||t<1)return[];for(var n=[],r=0,o=e.length;r<o;)n.push(u.call(e,r,r+=t));return n}function Vn(e,t){return e._chain?ue(t).chain():t}function Bn(e){return Gt(Ae(e),(function(t){var n=ue[t]=e[t];ue.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),Vn(this,n.apply(ue,e))}})),ue}Gt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=a[e];ue.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Vn(this,n)}})),Gt(["concat","join","slice"],(function(e){var t=a[e];ue.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Vn(this,e)}}));const zn=ue;var Hn=Bn(r);Hn._=Hn;const $n=Hn}},V={};function B(e){var t=V[e];if(void 0!==t)return t.exports;var n=V[e]={exports:{}};return F[e].call(n.exports,n,n.exports,B),n.exports}B.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return B.d(t,{a:t}),t},B.d=(e,t)=>{for(var n in t)B.o(t,n)&&!B.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},B.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),B.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),B.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var z={};(()=>{B.d(z,{ZP:()=>Dh,kr:()=>Ah,j7:()=>Mh});var e=B(50),t=B(163);function n(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=e.raw;return o.reduce((function(e,r,i){var a=n[i-1],s=o[i-1];return Array.isArray(a)?a=a.join(""):s&&"$"===s.slice(-1)?e=e.slice(0,-1):a=(0,t.escape)(a),e+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=B(316),i=B.n(o),a=B(895);var s,l=B(346),c=(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t}(l.Hn);const d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return c(n,t),n.prototype.getByComponent=function(e){var t=this;return this.filter((function(n){return t.getComponent(n)===e}))[0]},n.prototype.addComponent=function(t,n){var r=this,o=((0,e.isArray)(t)?t:[t]).filter((function(e){return!r.hasComponent(e)})).map((function(e){return new u({component:e})}))[0];return this.push(o,n)},n.prototype.getComponent=function(e){return e.get("component")},n.prototype.hasComponent=function(e){var t=this.getByComponent(e);return t&&this.contains(t)},n.prototype.lastComponent=function(){var e=this.last();return e?this.getComponent(e):void 0},n.prototype.allComponents=function(){var e=this;return this.map((function(t){return e.getComponent(t)})).filter((function(e){return e}))},n.prototype.removeComponent=function(t,n){var r=this,o=((0,e.isArray)(t)?t:[t]).map((function(e){return r.getByComponent(e)}));return this.remove(o,n)},n}(l.FE);var p=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},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,e.isUndefined)(n.config[i])?n.config[this.name]:n.config[i],s=!0===a?{}:a||{};s.pStylePrefix=n.config.pStylePrefix||"",(0,e.isUndefined)(a)||a||(s._disable=1),s.em=n,this._config=(0,t.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(e){},n.prototype.postLoad=function(e){},Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),n.prototype.getConfig=function(e){return e?this.config[e]:this.config},n.prototype.__logWarn=function(e,t){void 0===t&&(t={}),this.em.logWarning("[".concat(this.name,"]: ").concat(e),t)},n.prototype.destroy=function(){this.__destroy()},n.prototype.__destroy=function(){var e,t,n;null===(e=this.view)||void 0===e||e.remove(),null===(t=this.state)||void 0===t||t.stopListening(),null===(n=this.state)||void 0===n||n.clear(),this.debounced.forEach((function(e){return e.cancel()})),this.collections.forEach((function(e){e.stopListening(),e.reset()}))},n.prototype.__appendTo=function(){var t=this.getConfig().appendTo;if(t){var n=(0,e.isElement)(t)?t:document.querySelector(t);if(!n)return this.__logWarn('"appendTo" element not found');n.appendChild(this.render())}},n}();const g=h;var m=function(n){function r(e,t,r,o,i,a){void 0===a&&(a={});var s=n.call(this,e,t,i)||this;return s.cls=[],s.private=!1,s.all=r,s.events=o,!a.skipListen&&s.__initListen(),s}return p(r,n),r.prototype.postLoad=function(e){},r.prototype.render=function(e){},r.prototype.getProjectData=function(e){var t={},n=this.storageKey;return n&&(t[n]=e||this.getAll()),t},r.prototype.loadProjectData=function(e,n){void 0===e&&(e={}),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=e[a];if("string"==typeof c)try{c=JSON.parse(c)}catch(e){this.__logWarn("Data parsing failed",{input:c})}return i&&c&&l.reset(void 0,s),o?c&&o(c,s):c&&(0,t.isDef)(c.length)&&l.reset(c,s),c},r.prototype.clear=function(e){void 0===e&&(e={});var t=this.all;return t&&t.reset(void 0,e),this},r.prototype.getAll=function(){return function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],this.all.models,!0)},r.prototype.getAllMap=function(){return this.getAll().reduce((function(e,t){return e[t.get(t.idAttribute)]=t,e}),{})},r.prototype.__initListen=function(e){void 0===e&&(e={});var t=this,n=t.all,r=t.em,o=t.events;n&&r&&n.on("add",(function(e,t,n){return r.trigger(o.add,e,n)})).on("remove",(function(e,t,n){return r.trigger(o.remove,e,n)})).on("change",(function(e,t){return r.trigger(o.update,e,e.changedAttributes(),t)})).on("all",this.__catchAllEvent,this),this.cls=[n].concat(e.collections||[]),(e.propagate||[]).forEach((function(e){var t=e.entity,o=e.event;t.on("all",(function(e,t,i,a){var s=f({event:e},a||i);[r,n].map((function(e){return e.trigger(o,t,s)}))}))}))},r.prototype.__remove=function(t,n){var r=this;void 0===n&&(n={});var o=this.em,i=(0,e.isString)(t)?this.get(t):t,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(e,t,n,r){var o=this.em,i=this.events,a=r||n;o&&i.all&&o.trigger(i.all,{event:e,model:t,options:a}),this.__onAllEvent()},r.prototype.__appendTo=function(t){var n=this.config.appendTo;if(n){var r=(0,e.isElement)(n)?n:document.querySelector(n);if(!r)return this.__logWarn('"appendTo" element not found');r.appendChild(this.render(t))}},r.prototype.__onAllEvent=function(){},r.prototype._createId=function(e){void 0===e&&(e=16);var n,r=this.getAll().length+e,o=this.getAllMap();do{n=(0,t.createId)(r)}while(o[n]);return n},r.prototype.__listenAdd=function(e,t){var n=this;e.on("add",(function(e,r,o){return n.em.trigger(t,e,o)}))},r.prototype.__listenRemove=function(e,t){var n=this;e.on("remove",(function(e,r,o){return n.em.trigger(t,e,o)}))},r.prototype.__listenUpdate=function(e,t){var n=this;e.on("change",(function(e,r){return n.em.trigger(t,e,e.changedAttributes(),r)}))},r.prototype.__destroy=function(){var e;this.cls.forEach((function(e){e.stopListening(),e.reset()})),null===(e=this.view)||void 0===e||e.remove(),this.view=void 0},r}(h);const v={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=B(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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.defaults=function(){return{name:"",width:null,height:"",widthMedia:null,priority:null}},t.prototype.initialize=function(){var e=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(t){return e.checkUnit(t)}))},t.prototype.checkUnit=function(e){var t=this.get(e)||"";(parseFloat(t)||0).toString()===t.toString()&&this.set(e,"".concat(t,"px"))},t.prototype.getName=function(){return this.get("name")||this.get("id")},t.prototype.getWidthMedia=function(){return this.get("widthMedia")||""},t}(l.Hn);var C=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(l.FE);const _=S;S.prototype.model=x;var E=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(e){function t(t){var n=e.call(this,t)||this;return n.config=t.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||"",n.listenTo(n.em,"change:device",n.updateSelect),n}return E(t,e),t.prototype.template=function(e){var t,r,o=e.ppfx,i=e.label;return n(T||(t=['\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(t,"raw",{value:r}):t.raw=r,T=t),o,i,o,o,o,o,o,o,o)},t.prototype.events=function(){return{change:"updateDevice","click [data-add-trasp]":"startAdd"}},t.prototype.startAdd=function(){},t.prototype.updateDevice=function(){var e=this.em;if(e){var t=this.devicesEl;e.set("device",t?t.val():"")}},t.prototype.updateSelect=function(){var e=this.em,t=this.devicesEl;if(e&&e.getDeviceModel&&t){var n=e.getDeviceModel();t.val(n?n.get("id"):"")}},t.prototype.getOptions=function(){var e=this.collection,t=this.em,n="";return e.forEach((function(e){var r=e.attributes,o=r.name,i=r.id,a=t&&t.t&&t.t("deviceManager.devices.".concat(i))||o;n+='<option value="'.concat(i||o,'">').concat(a,"</option>")})),n},t.prototype.render=function(){var e=this,t=e.em,n=e.ppfx,r=e.$el,o=e.el,i=t&&t.t&&t.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(t.get("device")),o.className="".concat(n,"devices-c"),this},t}(l.G7);const k=O;var T,P=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)},A="device",D="".concat(A,":"),N="".concat(D,"select"),R="".concat(D,"update"),j="".concat(D,"add"),I="".concat(D,"remove"),L="".concat(I,":before"),F={all:A,select:N,update:R,add:j,remove:I,removeBefore:L},V=function(t){function n(e){var n,r=t.call(this,e,"DeviceManager",new _,F,b)||this;return r.Device=x,r.Devices=_,r.storageKey="",r.devices=r.all,null===(n=r.config.devices)||void 0===n||n.forEach((function(e){return r.add(e,{silent:!0})})),r.select(r.config.default||r.devices.at(0)),e.on("change:device",r._onSelect,r),r}return P(n,t),n.prototype._onSelect=function(e,t,n){var r=this.em,o=this.events,i=e.previous("device"),a=this.get(t),s=o.select;r.trigger(s,a,this.get(i)),this.__catchAllEvent(s,a,n)},n.prototype.add=function(t,n){var r;void 0===n&&(n={});var o=n;if((0,e.isString)(t)){var i=n;r=M(M({},o=arguments[2]||{}),{id:t,name:o.name||t,width:i})}else r=t;return r.id||(r.id=r.name||this._createId()),this.devices.add(r,o)},n.prototype.get=function(e){return this.getAll().filter((function(t){return t.get("name")===e}))[0]||this.devices.get(e)||null},n.prototype.remove=function(e,t){return void 0===t&&(t={}),this.__remove(e,t)},n.prototype.getDevices=function(){return this.devices.models},n.prototype.select=function(t,n){void 0===n&&(n={});var r=(0,e.isString)(t)?this.get(t):t;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 e,t=this.em;return null===(e=this.view)||void 0===e||e.remove(),this.view=new k({collection:this.devices,config:M({em:t},this.config)}),this.view.render().el},n.prototype.destroy=function(){this.__destroy()},n}(m);const H=V;var $;!function(e){e.add="page:add",e.addBefore="page:add:before",e.remove="page:remove",e.removeBefore="page:remove:before",e.select="page:select",e.selectBefore="page:select:before",e.update="page:update",e.all="page"}($||($={}));const W=$;var U=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(t){function n(e,n,r){return t.call(this,n,{module:e,modelConstructor:r})||this}return U(n,t),n.prototype.add=function(n,r){var o,i=this,a=(0,e.isArray)(n)?n:(0,e.isUndefined)(n)?void 0:[n];return a=null!==(o=null==a?void 0:a.map((function(e){return e instanceof i.newModel?e:new i.newModel(i.module,e)})))&&void 0!==o?o:[void 0],t.prototype.add.call(this,(0,e.isArray)(n)?a:a[0],r)},n.prototype.preinitialize=function(e,t){this.newModel=t.modelConstructor,this.module=t.module},n}(l.FE);const G=q;var Y=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),K=function(){return K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},K.apply(this,arguments)},Z=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},X="__aw",J="__ah",Q=function(t,n){var r,o=t.get(n),i=null===(r=t.view)||void 0===r?void 0:r.el["width"===n?"offsetWidth":"offsetHeight"];return(0,e.isNumber)(o)?o:(0,e.isString)(o)&&o.endsWith("px")?parseFloat(o):i||0},ee=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,d=u.getConfig(),p=a.Css.getAll(),f={},h={em:a,config:d,frame:i,idMap:f};if(!(0,t.isComponent)(c)){var g=(0,t.isObject)(c)?c:{components:c};!g.type&&(g.type="wrapper");var m=u.getType("wrapper").model;i.set("component",new m(g,h))}if(l){if(!(0,t.isObject)(l)){var v=l;(0,e.keys)(f).length&&(v=(0,e.isString)(v)?a.Parser.parseCss(v):v,a.Css.checkId(v,{idMap:f})),p.add(v),i.set("styles",p)}}else i.set("styles",p);return!o.width&&i.set(X,1),!o.height&&i.set(J,1),!i.id&&i.set("id",(0,t.createId)()),i}return Y(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 e=this.refFrame;return(null==e?void 0:e.getComponent())||this.getComponent()},enumerable:!1,configurable:!0}),r.prototype.initRefs=function(){var t=this.refFrame;if((0,e.isString)(t)){var n=this.module.framesById[t];n&&this.set({refFrame:n},{silent:!0})}},r.prototype.getBoxRect=function(){var e=this.attributes;return{x:e.x,y:e.y,width:this.width,height:this.height}},r.prototype.onRemove=function(){!this.refFrame&&this.getComponent().remove({root:1})},r.prototype.changesUp=function(e){void 0===e&&(e={}),e.temporary||e.noCount||e.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 e;null===(e=this.view)||void 0===e||e.remove(),this.view=void 0;var t=this.collection;return t&&t.remove(this)},r.prototype.getHead=function(){return Z([],this.head,!0)},r.prototype.setHead=function(e){return this.set("head",Z([],e,!0))},r.prototype.addHeadItem=function(e){this.head.push(e)},r.prototype.getHeadByAttr=function(e,t,n){return this.head.filter((function(r){return r.attributes&&r.attributes[e]==t&&(!n||n===r.tag)}))[0]},r.prototype.removeHeadByAttr=function(e,t,n){var r=this.getHeadByAttr(e,t,n),o=this.head.indexOf(r);o>=0&&this.head.splice(o,1)},r.prototype.addLink=function(e){var t="link";!this.getHeadByAttr("href",e,t)&&this.addHeadItem({tag:t,attributes:{href:e,rel:"stylesheet"}})},r.prototype.removeLink=function(e){this.removeHeadByAttr("href",e,"link")},r.prototype.addScript=function(e){var t="script";!this.getHeadByAttr("src",e,t)&&this.addHeadItem({tag:t,attributes:{src:e}})},r.prototype.removeScript=function(e){this.removeHeadByAttr("src",e,"script")},r.prototype.getPage=function(){var e;return null===(e=this.collection)||void 0===e?void 0:e.page},r.prototype._emitUpdated=function(e){void 0===e&&(e={}),this.em.trigger("frame:updated",K({frame:this},e))},r.prototype.hasAutoHeight=function(){return!("auto"!==this.attributes.height&&!this.config.infiniteCanvas)},r.prototype.toJSON=function(t){void 0===t&&(t={});var n=y.Z.prototype.toJSON.call(this,t),r=(0,e.result)(this,"defaults");return t.fromUndo&&delete n.component,delete n.styles,delete n.changesCount,n[X]&&delete n.width,n[J]&&delete n.height,n.refFrame&&(n.refFrame=n.refFrame.id,delete n.component),(0,e.forEach)(n,(function(e,t){0===t.indexOf("_")&&delete n[t]})),(0,e.forEach)(r,(function(e,t){n[t]===e&&delete n[t]})),(0,e.forEach)(["attributes","head"],(function(t){(0,e.isEmpty)(n[t])&&delete n[t]})),n},r}(y.Z);const te=ee;var ne=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const re=function(t){function n(n,r){void 0===r&&(r=[]);var o=t.call(this,n,r,te)||this;return o.loadedItems=0,o.itemsToLoad=0,(0,e.bindAll)(o,"itemLoaded"),o.on("add",o.onAdd),o.on("reset",o.onReset),o.on("remove",o.onRemove),o.forEach((function(e){return o.onAdd(e)})),o}return ne(n,t),n.prototype.onAdd=function(e){this.module.framesById[e.id]=e},n.prototype.onReset=function(e,t){var n=this;((null==t?void 0:t.previousModels)||[]).map((function(e){return n.onRemove(e)}))},n.prototype.onRemove=function(e){e.onRemove(),delete this.module.framesById[e.id]},n.prototype.initRefs=function(){this.forEach((function(e){return e.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(e){var t=this;this.forEach((function(n){return n[e?"on":"off"]("loaded",t.itemLoaded)}))},n}(G);var oe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ie=function(e){function t(t){var n=this,r=t.em,o=t.config,i=o.scripts,a=o.styles;return(n=e.call(this,t,{scripts:i,styles:a})||this).set("frames",new re(t)),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(R),n.updateDevice),n.listenTo(r,W.select,n._pageUpdated),n}return oe(t,e),t.prototype.defaults=function(){return{frame:"",frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:l.pH,pointerScreen:l.pH}},Object.defineProperty(t.prototype,"frames",{get:function(){return this.get("frames")},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=this.em.Pages._initPage();this.set("frames",e.getFrames()),this.updateDevice({frame:e.getMainFrame()})},t.prototype._pageUpdated=function(e,t){var n=this.em;n.setSelected(),n.get("readyCanvas")&&n.stopDefault(),null==t||t.getFrames().map((function(e){return e.disable()})),this.set("frames",e.getFrames()),this.updateDevice({frame:e.getMainFrame()})},t.prototype.updateDevice=function(e){void 0===e&&(e={});var t=this.em,n=t.getDeviceModel(),r=e.frame||t.getCurrentFrameModel();if(r&&n){var o=n.attributes,i=o.width,a=o.height;r.set({width:i,height:a},{noUndo:1})}},t.prototype.onZoomChange=function(){var e=this.em,t=this.module;this.get("zoom")<1&&this.set("zoom",1),e.trigger(t.events.zoom)},t.prototype.onCoordsChange=function(){var e=this.em,t=this.module;e.trigger(t.events.coords)},t.prototype.onPointerChange=function(){var e=this.em,t=this.module;e.trigger(t.events.pointer)},t.prototype.getPointerCoords=function(e){void 0===e&&(e=l.vA.World);var t=this.attributes,n=t.pointer,r=t.pointerScreen;return e===l.vA.World?n:r},t}(y.Z);const ae=ie;var se=B(675),le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(t){function n(n,r){void 0===r&&(r=[]);var o=t.call(this,n,r,se.Z)||this;o.on("add",o.onAdd),o.on("change",o.onChange),o.on("remove",o.onRemove);var i=o.em;o.refreshDbn=(0,e.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 le(n,t),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 e=this.em,t=this.events;e.trigger(t.spot)},n.prototype.onAdd=function(e){this.__trgEvent(this.events.spotAdd,{spot:e})},n.prototype.onChange=function(e){this.__trgEvent(this.events.spotUpdate,{spot:e})},n.prototype.onRemove=function(e){this.__trgEvent(this.events.spotRemove,{spot:e})},n.prototype.__trgEvent=function(e,t){this.module.em.trigger(e,t),this.refreshDbn()},n}(G);const ue=ce;var de;!function(e){e.dragEnter="canvas:dragenter",e.dragOver="canvas:dragover",e.dragEnd="canvas:dragend",e.dragData="canvas:dragdata",e.drop="canvas:drop",e.spot="canvas:spot",e.spotAdd="canvas:spot:add",e.spotUpdate="canvas:spot:update",e.spotRemove="canvas:spot:remove",e.coords="canvas:coords",e.zoom="canvas:zoom",e.pointer="canvas:pointer",e.refresh="canvas:refresh",e.frameLoad="canvas:frame:load",e.frameLoadHead="canvas:frame:load:head",e.frameLoadBody="canvas:frame:load:body"}(de||(de={}));const pe=de;var fe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fe(t,e),Object.defineProperty(t.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"module",{get:function(){var e,t;return null!==(t=null===(e=this.model)||void 0===e?void 0:e.module)&&void 0!==t?t:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),t.prototype.preinitialize=function(e){this.className=""},t}(l.G7);const ge=he;var me=B(491),ve=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ye=function(e){function t(t,n){void 0===t&&(t={}),void 0===n&&(n=!1);var r=e.call(this,t)||this;return r.itemsView="",r.itemType="type",r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,"add",r.addTo),r}return ve(t,e),t.prototype.addTo=function(e){this.add(e)},t.prototype.itemViewNotFound=function(e){},t.prototype.add=function(e,t){var n,r=this.reuseView,o=this.viewCollection,i=t||null,a=e.get(this.itemType);n=e.view&&r?e.view:this.renderView(e,a),o.push(n);var s=n.render().el;i?i.appendChild(s):this.$el.append(s)},t.prototype.render=function(){var e=this,t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return e.add(n,t)})),this.$el.append(t),this.onRender(),this},t.prototype.onRender=function(){},t.prototype.onRemoveBefore=function(e,t){},t.prototype.onRemove=function(e,t){},t.prototype.remove=function(e){void 0===e&&(e={});var t=this.viewCollection;return this.onRemoveBefore(t,e),this.clearItems(),l.G7.prototype.remove.apply(this,e),this.onRemove(t,e),this},t.prototype.clearItems=function(){this.viewCollection},t}(ge);var be=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const we=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;n.config=t.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 be(t,e),t.prototype.tagName=function(){return"style"},t.prototype.render=function(){var e=this.model,t=this.el,n=e.get("important");return t.innerHTML=e.toCSS({important:n}),this},t}(l.G7);var xe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xe(t,e),t.prototype._createElement=function(){return document.createTextNode("")},t.prototype.render=function(){var e=this.model,t=e.get("important");return this.el.textContent=e.getDeclaration({important:t}),this},t}(we);var Se=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_e=function(e,t){return"".concat(e).concat(t?"-".concat(parseFloat(t)):"")},Ee=function(t){function n(n){var r=t.call(this,n)||this;(0,e.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 Se(n,t),n.prototype.addTo=function(e){this.addToCollection(e)},n.prototype.addToCollection=function(e,t){if(this.renderStarted){var n,r,o=t||null,i={model:e,config:this.config};if("keyframes"===e.get("atRuleType")){var a=e.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 Ce(i),s.appendData(r.render().el.textContent)}else n=(r=new we(i)).render().el;var c=this.className,u=e.get("mediaText"),d=_e(c),p=d;if(u&&(p=_e(c,this.getMediaWidth(u))),n){var f=o||this.el,h=void 0;try{h=f.querySelector("#".concat(p))}catch(e){}h||(h=f.querySelector("#".concat(d))),null==h||h.appendChild(n)}return n}},n.prototype.getMediaWidth=function(e){return e&&e.replace("(".concat(this.em.getConfig().mediaCondition,": "),"").replace(")","")},n.prototype.sortRules=function(e,t){var n=-1!==(this.em.getConfig().mediaCondition||"").indexOf("min-width");return n?(n?e:t)-(n?t:e):0},n.prototype.render=function(){var e=this;this.renderStarted=!0,this.atRules={};var t=this,n=t.em,r=t.$el,o=t.collection,i=this.className,a=document.createDocumentFragment();r.empty();var s=n.Devices.getAll().pluck("priority").sort(this.sortRules);return s.every((function(e){return e}))&&s.unshift(0),s.forEach((function(e){return a.appendChild((0,me.ut)("div",{id:_e(i,e)}))})),o.each((function(t){return e.addToCollection(t,a)})),r.append(a),r.attr("class",i),this},n}(l.G7);const Oe=Ee;var ke=function(){return ke=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ke.apply(this,arguments)},Te=function(){function t(t,n){var r=this;this.em=t,this.canvas=t.Canvas;var o=n||this.canvas.getFrames().map((function(e){return e.getComponent().getEl()})),i=Array.isArray(o)?o:[o];this.el=i[0],this.counter=0,(0,e.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),i.forEach((function(e){return r.toggleEffects(e,!0)}))}return t.prototype.toggleEffects=function(e,t){var n={on:me.on,off:me.S1},r=t?"on":"off";n[r](e,"dragenter",this.handleDragEnter),n[r](e,"dragover",this.handleDragOver),n[r](e,"drop",this.handleDrop),n[r](e,"dragleave",this.handleDragLeave)},t.prototype.__customTglEff=function(e){var t,n=e?me.on:me.S1,r=this.el.ownerDocument,o=null===(t=r.defaultView)||void 0===t?void 0:t.frameElement;this.sortOpts=e?{onStart:function(e){var t=e.sorter;(0,me.on)(o,"pointermove",t.onMove)},onEnd:function(e){var t=e.sorter;(0,me.S1)(o,"pointermove",t.onMove)},customTarget:function(e){var t=e.event;return r.elementFromPoint(t.clientX,t.clientY)}}:null,n(o,"pointerenter",this.handleDragEnter),n(o,"pointermove",this.handleDragOver),n(document,"pointerup",this.handleDrop),n(o,"pointerout",this.handleDragLeave)},t.prototype.startCustom=function(){this.__customTglEff(!0)},t.prototype.endCustom=function(e){this.over?this.endDrop(e):this.__customTglEff(!1)},t.prototype.endDrop=function(e,t){var n=this.em,r=this.dragStop;this.counter=0,r&&r(e||!this.over),this.__customTglEff(!1),n.trigger("canvas:dragend",t)},t.prototype.handleDragLeave=function(e){this.updateCounter(-1,e)},t.prototype.updateCounter=function(e,t){this.counter+=e,0===this.counter&&this.endDrop(!0,t)},t.prototype.handleDragEnter=function(e){var t=this,n=this.em,r=this.canvas,o=e.dataTransfer,i=n.get("dragContent");if((i||r.getConfig().allowExternalDrop)&&(this.updateCounter(1,e),!this.over)){this.over=!0;var a,s,l=n.Utils,c=i||"<br>";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.Components.getWrapper(),d=u.append({})[0],p=n.Commands.run("core:component-drag",{event:e,guidesInfo:1,center:1,target:d,onEnd:function(e,n,i){var a;if(!i.cancelled){a=u.append(c)[0];var s=r.getOffset(),l=d.getStyle(),p=l.top,f=l.left,h=l.position,g=(0,me.GX)(e.target),m=parseInt("".concat(parseFloat(f)+g.x-s.left),10),v=parseInt("".concat(parseFloat(p)+g.y-s.top),10);a.addStyle({left:m+"px",top:v+"px",position:h})}t.handleDragEnd(a,o),d.remove()}});a=function(t){return p.stop(e,{cancel:t})},s=function(e){return c=e}}else{var f=new l.Sorter(ke({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:r.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(e){return t.handleDragEnd(e,o)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(c),f.startSort(),this.sorter=f,a=function(e){e&&(f.moved=!1),f.endMove()},s=function(e){return f.setDropContent(e)}}this.dragStop=a,this.dragContent=s,n.trigger("canvas:dragenter",o,c)}},t.prototype.handleDragEnd=function(e,t){var n=this.em;this.over=!1,e&&(n.set("dragResult",e),n.trigger("canvas:drop",t,e)),n.runDefault({preserveSelected:1})},t.prototype.handleDragOver=function(e){e.preventDefault(),this.em.trigger("canvas:dragover",e)},t.prototype.handleDrop=function(e){e.preventDefault();var t=this.dragContent,n=e.dataTransfer,r=this.getContentByData(n).content;e.target.style.border="",r&&t&&t(r),this.endDrop(!r,e)},t.prototype.getContentByData=function(t){var n=this.em,r=t&&t.types,o=t&&t.files||[],i=n.get("dragContent"),a=t&&t.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,e.indexOf)(r,"text/html")>=0)a=t&&t.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,e.indexOf)(r,"text/uri-list")>=0)a={type:"link",attributes:{href:a},content:a};else if((0,e.indexOf)(r,"text/json")>=0){var u=t&&t.getData("text/json");u&&(a=JSON.parse(u))}else 1===r.length&&"text/plain"===r[0]&&(a="<div>".concat(a,"</div>"));var d={content:a};return n.trigger("canvas:dragdata",t,d),d},t}();const Pe=Te;var Me=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ae=function(){return Ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ae.apply(this,arguments)},De=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,e.bindAll)(i,"updateClientY","stopAutoscroll","autoscroll","_emitUpdate");var a=i.el;i.module._config=Ae(Ae({},i.config||{}),{frameView:i}),i.frameWrapView=o,i.showGlobalTools=(0,e.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,t.setViewEl)(a,i),i}return Me(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 e=this.el,t=this.module,n=t.getCanvasView(),r=t.getCoords(),o=e.getBoundingClientRect(),i=n.getCanvasOffset(),a=n.getViewportDelta(),s=t.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 e=this.model,t=this.getHead(),n=[],r=[],o=e.head,i=e.previous("head"),a=function(e){return void 0===e&&(e={}),Object.keys(e).sort().map((function(t){return"[".concat(t,'="').concat(e[t],'"]')})).join("")},s=function(e,t,n){e.forEach((function(e){var r=e.tag,o=e.attributes;!t.some((function(e){return e.tag===r&&a(e.attributes)===a(o)}))&&n.push(e)}))};s(o,i,r),s(i,o,n),n.forEach((function(e){var n,r=t.querySelector("".concat(e.tag).concat(a(e.attributes)));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,me.SJ)(t,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,me.ut)("div",{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},r.prototype.getToolsEl=function(){var e;return null===(e=this.frameWrapView)||void 0===e?void 0:e.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 e=this.el,t=this.getBody(),n=t.scrollTop,r=t.scrollLeft,o=e.offsetHeight,i=e.offsetWidth;return{top:e.offsetTop,left:e.offsetLeft,height:o,width:i,scrollTop:n,scrollLeft:r,scrollBottom:n+o,scrollRight:r+i}},r.prototype._getTool=function(e){var t=this.tools,n=this.getToolsEl();return t[e]||(t[e]=n.querySelector(e)),t[e]},r.prototype.remove=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._toggleEffects(!1),this.tools={},null===(e=this.wrapper)||void 0===e||e.remove(),ge.prototype.remove.apply(this,t),this},r.prototype.startAutoscroll=function(){var e=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout((function(){e._toggleAutoscrollFx(!0),requestAnimationFrame(e.autoscroll)}),0)},r.prototype.autoscroll=function(){if(this.dragging){var t=this.lastClientY,n=this.em.Canvas,r=this.getWindow(),o=r.pageYOffset,i=t||0,a=n.getConfig().autoscrollLimit,s=this.getRect().height-a,l=o;if(i<a&&(l-=a-i),i>s&&(l+=i-s),!(0,e.isUndefined)(t)&&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(e){e.preventDefault(),this.lastClientY=(0,me.VB)(e).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(e){this.dragging=e;var t=this.getWindow(),n=e?"on":"off",r={on:me.on,off:me.S1};r[n](t,"mousemove dragover",this.updateClientY),r[n](t,"mouseup",this.stopAutoscroll)},r.prototype.render=function(){var e=this,t=e.$el,n=e.ppfx,r=e.em;return t.attr({class:"".concat(n,"frame")}),this.renderScripts(),r.trigger("frame:render",this),this},r.prototype.renderScripts=function(){var t=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,me.ut)("script",Ae({type:"text/javascript"},(0,e.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(pe.frameLoadHead,s),t.renderBody(),null==i||i.trigger(pe.frameLoadBody,s),null==i||i.trigger(a,s)};r.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}s.window=t.getWindow(),null==i||i.trigger("".concat(a,":before"),s),null==i||i.trigger(pe.frameLoad,s),c(function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],l.get("scripts"),!0))}},r.prototype.renderStyles=function(t){void 0===t&&(t={});var n=this.getHead(),r=this.getCanvasModel(),o=function(t){return t.map((function(t){return{tag:"link",attributes:Ae({rel:"stylesheet"},(0,e.isString)(t)?{href:t}:t)}}))},i=o(t.prev||r.previous("styles")),a=o(r.get("styles")),s=[],l=[],c=function(e,t,n){e.forEach((function(e){var r=e.attributes.href;!t.some((function(e){return e.attributes.href===r}))&&n.push(e)}))};c(a,i,l),c(i,a,s),s.forEach((function(e){var t,r=n.querySelector('link[href="'.concat(e.attributes.href,'"]'));null===(t=null==r?void 0:r.parentNode)||void 0===t||t.removeChild(r)})),(0,me.SJ)(n,l)},r.prototype.renderBody=function(){var e,n,r=this,o=this,i=o.config,a=o.em,s=o.model,l=o.ppfx,c=this.getDoc(),u=this.getBody(),d=this.getWindow(),p=s.hasAutoHeight(),f=a.config;d._isEditor=!0,this.renderStyles({prev:[]});(0,me.R3)(u,"<style>\n ".concat(f.baseCss||i.frameStyle||"","\n\n ").concat(p?"body { overflow: hidden }":"",'\n\n [data-gjs-type="wrapper"] {\n ').concat(p?"":"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:Ae(Ae({},h.config),{em:a,frameView:this})}).render(),(0,me.R3)(u,null===(e=this.wrapper)||void 0===e?void 0:e.el),(0,me.R3)(u,new Oe({collection:s.getStyles(),config:Ae(Ae({},a.Css.getConfig()),{frameView:this})}).render().el),(0,me.R3)(u,this.getJsContainer()),(0,me.on)(u,"click",(function(e){var t;return e&&"A"==(null===(t=e.target)||void 0===t?void 0:t.tagName)&&e.preventDefault()})),(0,me.on)(u,"submit",(function(e){return e&&e.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(e){return e.event.split(" ").forEach((function(t){c.addEventListener(t,(function(t){return r.el.dispatchEvent((0,me.t3)(t,e.class))}),e.opts)}))})),this._toggleEffects(!0),(0,t.hasDnd)(a)&&(this.droppable=new Pe(a,null===(n=this.wrapper)||void 0===n?void 0:n.el)),this.loaded=!0,s.trigger("loaded")},r.prototype._toggleEffects=function(e){var t=e?me.on:me.S1,n=this.getWindow();n&&t(n,"".concat(me.G1," resize"),this._emitUpdate)},r.prototype._emitUpdate=function(){this.model._emitUpdated()},r}(ge);const Ne=De;var Re=B(668),je=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)},Le=function(t){function n(n,r){var o=t.call(this,{model:n})||this;return(0,e.bindAll)(o,"onScroll","frameLoaded","updateOffset","remove","startDrag"),Ie(Ie({},n.config),{frameWrapView:o}),o.cv=r,o.frame=new Ne(n,o),o.classAnim="".concat(o.ppfx,"frame-wrapper--anim"),o.updateOffset=(0,e.debounce)(o.updateOffset.bind(o),0),o.updateSize=(0,e.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 je(n,t),n.prototype.events=function(){return{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"}},n.prototype.setupDragger=function(){var e,t,n,r=this,o=this.module,i=this.model,a=function(e){o.toggleFramesEvents(e)};this.dragger=new Re.Z({onStart:function(){var o=i.attributes,s=o.x,l=o.y;n=r.em.getZoomMultiplier(),e=s,t=l,a(!1)},onEnd:function(){return a(!0)},setPosition:function(r){i.set({x:e+r.x*n,y:t+r.y*n})}})},n.prototype.startDrag=function(e){var t;e&&(null===(t=this.dragger)||void 0===t||t.start(e))},n.prototype.__clear=function(e){var t=this.frame;t&&t.remove(e),(0,me.L_)(this.elTools)},n.prototype.remove=function(e){var t=this;return this.__clear(e),ge.prototype.remove.apply(this,e),["frame","dragger","cv","elTools"].forEach((function(e){return t[e]=0})),this},n.prototype.updateOffset=function(){var e,t=this,n=t.em,r=t.$el,o=t.frame;n&&!n.destroyed&&(n.runDefault({preserveSelected:1}),r.removeClass(this.classAnim),null===(e=null==o?void 0:o.model)||void 0===e||e._emitUpdated())},n.prototype.updatePos=function(e){var t=this.model,n=this.el,r=t.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"),e&&this.updateOffset()},n.prototype.updateSize=function(){this.updateDim()},n.prototype.updateDim=function(){var t=this,n=t.em,r=t.el,o=t.$el,i=t.model,a=t.classAnim,s=t.frame;if(s){s.rect=void 0,o.addClass(a);var l=this.__handleSize(),c=l.noChanges,u=l.width,d=l.height;((0,e.isNull)(u)||(0,e.isNull)(d))&&i.set(Ie(Ie({},u?{}:{width:r.offsetWidth}),d?{}:{height:r.offsetHeight}),{silent:1}),n.stopDefault({preserveSelected:1}),c?this.updateOffset():setTimeout(this.updateOffset,350)}},n.prototype.onScroll=function(){var e=this.frame;this.em.trigger("frame:scroll",{frame:e,body:e.getBody(),target:e.getWindow()})},n.prototype.frameLoaded=function(){var e=this.frame;this.config,e.getWindow().onscroll=this.onScroll,this.updateDim()},n.prototype.__handleSize=function(){var t,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||"",d=s||"",p=l==u&&c==d,f=(0,e.isNumber)(u)?"".concat(u).concat("px"):u,h=(0,e.isNumber)(d)?"".concat(d).concat("px"):d;if(o.width=f,r.hasAutoHeight()){var g=this.frame.el;if(g.contentDocument){var m=g.contentDocument,v=new ResizeObserver((function(){o.height="".concat(m.body.scrollHeight,"px")}));v.observe(m.body),null===(t=this.sizeObserver)||void 0===t||t.disconnect(),this.sizeObserver=v}}else o.height=h,null===(n=this.sizeObserver)||void 0===n||n.disconnect(),delete this.sizeObserver;return{noChanges:p,width:a,height:s,newW:u,newH:d}},n.prototype.render=function(){var e=this,t=e.frame,n=e.$el,r=e.ppfx,o=e.cv,i=e.model,a=e.el,s=i.attributes.onRender;this.__clear(),this.__handleSize(),t.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(t.el);var l=(0,me.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}(ge);const Fe=Le;var Ve=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Be=function(e){function t(t,n){void 0===t&&(t={});var r=e.call(this,t,!0)||this;return r.listenTo(r.collection,"reset",r.render),r.canvasView=n.canvasView,r._module=n.module,r}return Ve(t,e),t.prototype.onRemoveBefore=function(e,t){void 0===t&&(t={}),e.forEach((function(e){return e.remove(t)}))},t.prototype.onRender=function(){var e=this.$el,t=this.ppfx;e.attr({class:"".concat(t,"frames")})},t.prototype.clearItems=function(){(this.viewCollection||[]).forEach((function(e){return e.remove()})),this.viewCollection=[]},t.prototype.renderView=function(e,t){return new Fe(e,this.canvasView)},t}(ye);const ze=Be;var He=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$e=function(){return $e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$e.apply(this,arguments)},We=function(n){function r(t){var r=n.call(this,{model:t})||this;r.ready=!1,(0,e.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(t,"change:frames",r._onFramesUpdate),r.toggleListeners(!0),r}return He(r,n),r.prototype.template=function(){var e=this.pfx;return'\n <div class="'.concat(e,'canvas__frames" data-frames>\n <div class="').concat(e,'canvas__spots" data-spots></div>\n </div>\n <div id="').concat(e,'tools" class="').concat(e,'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 e=this,t=e.frames,n=e.model,r=e.config,o=e.em,i=n.frames;o.set("readyCanvas",0),i.once("loaded:all",(function(){return o.set("readyCanvas",1)})),null==t||t.remove(),this.frames=new ze({collection:i},$e($e({},r),{canvasView:this}))},r.prototype.checkSelected=function(e,t){var n;void 0===t&&(t={});var r=t.scroll,o=this.em.getCurrentFrame();r&&(null===(n=e.views)||void 0===n||n.forEach((function(e){e.frameView===o&&e.scrollIntoView(r)})))},r.prototype.remove=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null===(e=this.frames)||void 0===e||e.remove(),this.frames=void 0,ge.prototype.remove.apply(this,t),this.toggleListeners(!1),this},r.prototype.preventDefault=function(e){var t;e&&(e.preventDefault(),null===(t=e._parentEvent)||void 0===t||t.preventDefault())},r.prototype.toggleListeners=function(e){var t=this.el,n=this.config,r=e?me.on:me.S1;r(document,"keypress",this.onKeyPress),r(window,"scroll resize",this.clearOff),r(t,"wheel",this.onWheel,{passive:!n.infiniteCanvas}),r(t,"pointermove",this.onPointer)},r.prototype.screenToWorld=function(e,t){var n=this.module,r=n.getCoords(),o=n.getZoomMultiplier(),i=this.getViewportDelta();return{x:(e-r.x-i.x)*o,y:(t-r.y-i.y)*o}},r.prototype.onPointer=function(e){if(this.config.infiniteCanvas){var t=this.getCanvasOffset(),n=(0,me.GX)(),r={x:e.clientX-t.left+n.x,y:e.clientY-t.top+n.y};if(e._parentEvent){var o=e.target.getBoundingClientRect(),i=this.module.getZoomDecimal();r.x=o.left-t.left+n.x+e.clientX*i,r.y=o.top-t.top+n.y+e.clientY*i}this.model.set({pointerScreen:r,pointer:this.screenToWorld(r.x,r.y)})}},r.prototype.onKeyPress=function(e){var t=this.em;" "!==(0,me.sN)(e)||1===t.getZoomDecimal()||t.Canvas.isInputFocused()||(this.preventDefault(e),t.Editor.runCommand("core:canvas-move"))},r.prototype.onWheel=function(e){var t=this.module;if(this.config.infiniteCanvas){this.preventDefault(e);var n=e.deltaX,r=e.deltaY,o=t.getZoomDecimal(),i=(0,me.Vb)(e),a=t.getCoords();if(i){var s=o-r*o*.01;t.setZoom(100*s);var c=this.model.getPointerCoords(l.vA.Screen),u=this.getCanvasOffset(),d=c.x-u.width/2,p=c.y-u.height/2,f=s/o,h=d-(d-a.x)*f,g=p-(p-a.y)*f;t.setCoords(h,g)}else this.onPointer(e),t.setCoords(a.x-n,a.y-r)}},r.prototype.updateFrames=function(e){var t=this.em,n=this.toolsWrapper,r={preserveSelected:1};this.updateFramesArea(),this.clearOff(),n.style.display="none",t.trigger("canvas:update",e),this.timerZoom&&clearTimeout(this.timerZoom),this.timerZoom=setTimeout((function(){t.stopDefault(r),t.runDefault(r),n.style.display=""}),300)},r.prototype.updateFramesArea=function(){var e=this,t=e.framesArea,n=e.model,r=e.module,o=e.cvStyle,i=e.clsUnscale,a=r.getZoomMultiplier();if(t){var s=n.attributes,l=s.x,c=s.y,u=r.getZoomDecimal();t.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,d=u&&(null===(r=(0,t.getComponentView)(u))||void 0===r?void 0:r.frameView),p=d?d.model:n.frame||a.getCurrentFrameModel()||l.frames.at(0),f=p.attributes,h=f.x,g=f.y,m={x:null!=h?h:0,y:null!=g?g:0,width:p.width,height:p.height};if(u){var v=this.getElBoxRect(u);m.x=m.x+v.x,m.y=m.y+v.y,m.width=v.width,m.height=v.height}var y=n.ignoreHeight,b=null!==(o=n.gap)&&void 0!==o?o:0,w=(0,e.isNumber)(b),x=w?b:b.x,C=w?b:b.y,S=m.width+2*x,_=m.height+2*C,E=c.width,O=c.height,k=E/S,T=O/_,P=y?k:Math.min(k,T),M=100*P;s.setZoom(M);var A={x:(-m.x+(p.width>=E?E/2-S/2:-x)+x)*P,y:(-m.y+O/2-_/2+C)*P};if(y){var D=s.getZoomMultiplier(),N=(O*D-O)/2;A.y=(-m.y+C)*P-N/D}s.setCoords(A.x,A.y)},r.prototype.isElInViewport=function(e){var n=(0,t.getElement)(e),r=(0,me.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(e,t){void 0===t&&(t={});var n=t.noScroll,r=(0,me.Ut)(e),o=n?{x:0,y:0}:(0,me.GX)(e);return{top:r.top+o.y,left:r.left+o.x,width:r.width,height:r.height}},r.prototype.getRectToScreen=function(e){var t,n,r,o,i=this.module.getZoomDecimal(),a=this.module.getCoords(),s=this.getViewportDelta();return{x:(null!==(t=e.x)&&void 0!==t?t:0)*i+a.x+s.x||0,y:(null!==(n=e.y)&&void 0!==n?n:0)*i+a.y+s.y||0,width:(null!==(r=e.width)&&void 0!==r?r:0)*i,height:(null!==(o=e.height)&&void 0!==o?o:0)*i}},r.prototype.getElBoxRect=function(e,n){var r,o,i;void 0===n&&(n={});var a=this.module,s=(0,me.Ut)(e),l=s.width,c=s.height,u=s.left,d=s.top,p=null===(r=(0,t.getComponentView)(e))||void 0===r?void 0:r.frameView,f=null==p?void 0:p.getBoxRect(),h=a.getZoomMultiplier(),g=null!==(o=null==f?void 0:f.x)&&void 0!==o?o:0,m=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,v=this.el,y=(0,me.GX)(),b={x:u+g+(v.scrollLeft+y.x)*h,y:d+m+(v.scrollTop+y.y)*h,width:l,height:c};return n.local&&(b.x=u,b.y=d),n.toScreen?this.getRectToScreen(b):b},r.prototype.getViewportRect=function(e){void 0===e&&(e={});var t=this.getCanvasOffset(),n=t.top,r=t.left,o=t.width,i=t.height,a=this.module;if(e.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(e){var t=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),r=n.width,o=n.height;return{x:(r*t-r)/2/t,y:(o*t-o)/2/t}},r.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},r.prototype.getFrameOffset=function(e){var t;if(!this.frmOff||e){var n=null===(t=this.frame)||void 0===t?void 0:t.el,r=null==e?void 0:e.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(e,t){void 0===t&&(t={});var n=this.module.getZoomDecimal(),r=this.getFrameOffset(e),o=this.el,i=this.getCanvasOffset(),a=this.offset(e,t),s=t.avoidFrameOffset?0:r.top,l=t.avoidFrameOffset?0:r.left,c=t.avoidFrameZoom?a.top:a.top*n,u=t.avoidFrameZoom?a.left:a.left*n;return{top:t.avoidFrameOffset?c:c+s-i.top+o.scrollTop,left:t.avoidFrameOffset?u:u+l-i.left+o.scrollLeft,height:t.avoidFrameZoom?a.height:a.height*n,width:t.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},r.prototype.getElementOffsets=function(e){if(!e||(0,me.BM)(e))return{};var t={},n=window.getComputedStyle(e),r=this.module.getZoomDecimal();return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"].forEach((function(e){t[e]=parseFloat(n[e])*r})),t},r.prototype.getPosition=function(e){var t;void 0===e&&(e={});var n=null===(t=this.frame)||void 0===t?void 0:t.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=e.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(e){var t=e.model,n=t.getId();if(!e.scriptContainer){e.scriptContainer=(0,me.ut)("div",{"data-id":n});var r=this.getJsContainer();null==r||r.appendChild(e.scriptContainer)}e.el.id=n,e.scriptContainer.innerHTML="";var o=document.createElement("script"),i=t.getScriptString(),a=t.get("script-props")?i:"function(){\n".concat(i,"\n;}"),s=JSON.stringify(t.__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 t=e.scriptContainer;null==t||t.appendChild(o)}),0)},r.prototype.getJsContainer=function(e){var t=this.getFrameView(e);return null==t?void 0:t.getJsContainer()},r.prototype.getFrameView=function(e){return(null==e?void 0:e.frameView)||this.em.getCurrentFrame()},r.prototype._renderFrames=function(){if(this.ready){var e=this,t=e.model,n=e.frames,r=e.em,o=e.framesArea,i=t.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 e=this,n=e.el,r=e.$el,o=e.ppfx,i=e.config,a=e.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,t.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},r}(ge);const Ue=We;var qe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ge=function(){return Ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ge.apply(this,arguments)},Ye=function(n){function r(e){var t=n.call(this,e,"Canvas",v)||this;return t.events=de,t.framesById={},t.canvas=new ae(t),t.spots=new ue(t),t.model=t.canvas,t.startAutoscroll=t.startAutoscroll.bind(t),t.stopAutoscroll=t.stopAutoscroll.bind(t),t}return qe(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(e){return this.getFrames()[e||0]},r.prototype.getFrameEl=function(){var e=(this.canvasView||{}).frame;return null==e?void 0:e.el},r.prototype.getFramesEl=function(){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.framesArea},r.prototype.getWindow=function(){var e=(this.canvasView||{}).frame;return null==e?void 0:e.getWindow()},r.prototype.getDocument=function(){var e=this.getFrameEl();return null==e?void 0:e.contentDocument},r.prototype.getBody=function(){var e=this.getDocument();return null==e?void 0:e.body},r.prototype._getLocalEl=function(e,t,n){var r=e,o=null==t?void 0:t.frameView;return r=o?o[n]():r},r.prototype.getGlobalToolsEl=function(){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.toolsGlobEl},r.prototype.getToolsEl=function(e){return this._getLocalEl(this.getCanvasView().toolsEl,e,"getToolsEl")},r.prototype.getHighlighter=function(e){return this._getLocalEl(this.getCanvasView().hlEl,e,"getHighlighter")},r.prototype.getBadgeEl=function(e){return this._getLocalEl(this.getCanvasView().badgeEl,e,"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(e){return this._getLocalEl(this.getCanvasView().offsetEl,e,"getOffsetViewerEl")},r.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},r.prototype.getSpotsEl=function(){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.spotsEl},r.prototype.render=function(){var e;return null===(e=this.canvasView)||void 0===e||e.remove(),this.canvasView=new Ue(this.canvas),this.canvasView.render().el},r.prototype.getOffset=function(){var e=this.offset(this.getFrameEl()),t=this.offset(this.getElement());return{top:e.top-t.top,left:e.left-t.left}},r.prototype.offset=function(e){return this.getCanvasView().offset(e)},r.prototype.setCustomBadgeLabel=function(e){this.config.customBadgeLabel=e},r.prototype.getElementPos=function(e,t){return this.getCanvasView().getElementPos(e,t)},r.prototype.getElementOffsets=function(e){return this.getCanvasView().getElementOffsets(e)},r.prototype.getRect=function(){var e,t=null!==(e=this.getCanvasView().getPosition())&&void 0!==e?e:{},n=t.top,r=void 0===n?0:n,o=t.left,i=void 0===o?0:o;return Ge(Ge({},this.getCanvasView().getCanvasOffset()),{topScroll:r,leftScroll:i})},r.prototype.getTargetToElementDim=function(e,t,n){void 0===n&&(n={});var r=n||{},o=this.getCanvasView().getPosition();if(o){var i=r.elPos||this.getCanvasView().getElementPos(t),a=n.toRight||0,s=r.targetHeight||e.offsetHeight,l=r.targetWidth||e.offsetWidth,c=r.event||null,u=i.top-s,d=i.left;d+=a?i.width:0;var p=(d=a?d-l:d)<o.left?o.left:d,f=u<o.top?o.top:u,h={top:f=f>i.top+i.height?i.top+i.height:f,left:p,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:e.offsetWidth,targetHeight:e.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(e,t,n){var r=this;void 0===n&&(n={});var o=function(e,t,o){void 0===t&&(t=1);var i=r.em.getZoomDecimal(),a=t?"top":"left",s=e.ownerDocument,l=n.offset?function(e){var t=e.defaultView;return null==t?void 0:t.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,d=l.offsetLeft,p=void 0===d?0:d,f=s.body||{},h=f.scrollTop,g=void 0===h?0:h,m=f.scrollLeft,v=t?g:void 0===m?0:m,y=t?u:p;return o[a]-(v-y)*i};return{top:o(e,1,t),left:o(e,0,t)}},r.prototype.getTargetToElementFixed=function(t,n,r){void 0===r&&(r={});var o=r.pos||this.getElementPos(t,{noScroll:!0}),i=r.canvasOff||this.canvasRectOffset(t,o),a=n.offsetHeight||0,s=n.offsetWidth||0,l=o.left+o.width,c=this.getCanvasView(),u=c.getPosition(),d=c.getFrameOffset(t),p=r.event,f=-a,h=(0,e.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<d.height?f+=g:f=-i.top<o.height?-i.top:o.height}var m={top:f,left:h,canvasOffsetTop:i.top,canvasOffsetLeft:i.left,elRect:o,canvasOffset:i,canvasRect:u,targetWidth:s,targetHeight:a};return p&&this.em.trigger(p,m),m},r.prototype.getMouseRelativePos=function(e,t){void 0===t&&(t={});var n=t.subWinOffset,r=e.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 d=i.getBoundingClientRect();c=d.top||0,u=d.left||0}return{y:(e.clientY+c-a)*l,x:(e.clientX+u-s)*l}},r.prototype.getMouseRelativeCanvas=function(e,t){var n,r=this.getZoomDecimal(),o=null!==(n=this.getCanvasView().getPosition(t))&&void 0!==n?n:{},i=o.top,a=void 0===i?0:i,s=o.left,l=void 0===s?0:s;return{y:e.clientY*r+a,x:e.clientX*r+l}},r.prototype.hasFocus=function(){return this.getDocument().hasFocus()},r.prototype.isInputFocused=function(){var e=this.getDocument(),t=this.getFrameEl(),n=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}(["body"],this.config.notTextable,!0),r=t&&document.activeElement===t?e&&e.activeElement:document.activeElement;return r&&!n.some((function(e){return r.matches(e)}))},r.prototype.scrollTo=function(e,n){void 0===n&&(n={});var r=(0,t.getElement)(e),o=r&&(0,t.getViewEl)(r);o&&o.scrollIntoView(n)},r.prototype.startAutoscroll=function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.startAutoscroll()},r.prototype.stopAutoscroll=function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.stopAutoscroll()},r.prototype.setZoom=function(e){return this.canvas.set("zoom","string"==typeof e?parseFloat(e):e),this},r.prototype.getZoom=function(){return parseFloat(this.canvas.get("zoom"))},r.prototype.setCoords=function(e,t,n){var r;void 0===n&&(n={});var o=e||0===e,i=t||0===t,a={x:this.canvas.get("x"),y:this.canvas.get("y")};if(o&&(a.x=parseFloat("".concat(e))),i&&(a.y=parseFloat("".concat(t))),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 e=this.canvas.attributes;return{x:e.x,y:e.y}},r.prototype.getPointer=function(e){var t=this.canvas.attributes,n=t.pointer,r=t.pointerScreen;return e?r:n},r.prototype.getZoomDecimal=function(){return this.getZoom()/100},r.prototype.getZoomMultiplier=function(){var e=this.getZoomDecimal();return e?1/e:1},r.prototype.fitViewport=function(e){var t;null===(t=this.canvasView)||void 0===t||t.fitViewport(e)},r.prototype.toggleFramesEvents=function(e){this.getFramesEl().style.pointerEvents=e?"":"none"},r.prototype.getFrames=function(){return this.canvas.frames.map((function(e){return e}))},r.prototype.addFrame=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),this.canvas.frames.add(new te(this,Ge({},e)),t)},r.prototype.getLastDragResult=function(){return this.em.get("dragResult")},r.prototype.addSpot=function(e,t){var n;void 0===t&&(t={});var r=e,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 se.Z(this,Ge(Ge({},r),{id:r.id||"cs_".concat(r.type,"_").concat(null==a?void 0:a.cid),type:r.type||""}));return this.spots.add(s,t),s},r.prototype.getSpots=function(e){return void 0===e&&(e={}),this.spots.where(e.id?{id:e.id}:e)},r.prototype.removeSpots=function(t){void 0===t&&(t={});var n=(0,e.isArray)(t)?t:this.getSpots(t);return this.spots.remove(n)},r.prototype.hasCustomSpot=function(e){var t=this.config.customSpots;return!!(!0===t||t&&e&&t[e])},r.prototype.getWorldRectToScreen=function(e){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.getRectToScreen(e)},r.prototype.refresh=function(e){void 0===e&&(e={});var t=this,n=t.em,r=t.events,o=t.canvasView;null==o||o.clearOff(),(e.spots||e.all)&&(this.refreshSpots(),n.trigger("canvas:updateTools")),n.set("canvasOffset",this.getOffset()),n.trigger(r.refresh,e)},r.prototype.refreshSpots=function(){this.spots.refresh()},r.prototype.destroy=function(){var e,t=this;this.canvas.stopListening(),null===(e=this.canvasView)||void 0===e||e.remove(),["model","droppable"].forEach((function(e){return t[e]={}}))},r}(g);const Ke=Ye,Ze={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 Xe="text/html",Je=Xe;var Qe=function(){return Qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Qe.apply(this,arguments)},et="parse:html";const tt=function(t,n){return void 0===n&&(n={}),{compTypes:"",modelAttrStart:"data-gjs-",getPropAttribute:function(e,t){var n=e.replace(this.modelAttrStart,""),r=(null==t?void 0:t.length)||0,o=null==t?void 0:t.substring(0,1),i=null==t?void 0:t.substring(r-1),a="true"===t||"false"!==t&&t;try{a="{"==o&&"}"==i||"["==o&&"]"==i?JSON.parse(a):a}catch(e){}return{name:n,value:a}},splitPropsFromAttr:function(t){var n=this;void 0===t&&(t={});var r={},o={};return(0,e.each)(t,(function(e,t){if(0===t.indexOf(n.modelAttrStart)){var i=n.getPropAttribute(t,e);r[i.name]=i.value}else o[t]=e})),{props:r,attrs:o}},parseStyle:function(t){for(var n={};t.indexOf("/*")>=0;){var r=t.indexOf("/*"),o=t.indexOf("*/")+2;t=t.replace(t.slice(r,o),"")}for(var i=t.split(";"),a=0,s=i.length;a<s;a++){var l=i[a].trim();if(l){var c=l.split(":"),u=c[0].trim(),d=c.slice(1).join(":").trim();n[u]?((0,e.isArray)(n[u])||(n[u]=[n[u]]),n[u].push(d)):n[u]=d}}return n},parseClass:function(e){for(var t=[],n=e.split(" "),r=0,o=n.length;r<o;r++){var i=n[r].trim();i&&t.push(i)}return t},parseNode:function(t,r){void 0===r&&(r={});for(var o=[],i=t.childNodes,a=0,s=i.length;a<s;a++){var l=i[a],c=l.attributes||[],u=c.length,d=o[o.length-1],p=l.childNodes.length,f=this.compTypes,h={};if(f){var g="",m=l.getAttribute&&l.getAttribute("".concat(this.modelAttrStart,"type"));if(m)h={type:m};else{for(var v=0;v<f.length;v++){var y=f[v];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=c[x].nodeName,S=c[x].nodeValue;if("style"==C)h.style=this.parseStyle(S);else if("class"==C)h.classes=this.parseClass(S);else{if("contenteditable"==C)continue;if(0===C.indexOf(this.modelAttrStart)){var _=this.getPropAttribute(C,S);h[_.name]=_.value}else""===S&&!0===l[C]&&(S=!0),h.attributes[C]=S}}if(p&&!h.components){var E=l.childNodes[0];1===p&&3===E.nodeType?(!h.type&&(h.type="text"),h.components={type:"textnode",content:E.nodeValue}):h.components=this.parseNode(l,Qe(Qe({},r),{inSvg:r.inSvg||"svg"===h.type}))}if("textnode"==h.type){if(d&&"textnode"==d.type){d.content+=h.content;continue}if(!r.keepEmptyTextNodes){var O=l.nodeValue;if(" "!=O&&!O.trim())continue}}p||"/>"!=="".concat(l.outerHTML).slice(-2)||(h.void=!0);var k=h.components;if(!h.type&&k){for(var T=n.textTypes,P=void 0===T?[]:T,M=n.textTags,A=void 0===M?[]:M,D=1,N=0,R=0;R<k.length;R++){var j=k[R],I=j.type;if(!P.includes(I)&&!A.includes(j.tagName)){D=0;break}"textnode"===I&&(N=1)}D&&N&&(h.type="text")}!h.tagName&&(0,e.isUndefined)(h.content)||o.push(h)}return o},parse:function(r,o,i){var a;void 0===i&&(i={});var s=(null==t?void 0:t.get("Config"))||{},l={html:[]},c=Qe(Qe({},n),i),u=Qe(Qe(Qe({},n.optionsHtml),{htmlType:(null===(a=n.optionsHtml)||void 0===a?void 0:a.htmlType)||n.htmlType}),i),d=u.preParser,p=(0,e.isFunction)(d)?d(r,{editor:null==t?void 0:t.getEditor()}):r,f=(0,e.isFunction)(c.parserHtml)?c.parserHtml(p,u):function(t,n){void 0===n&&(n={});var r,o=new DOMParser,i=n.htmlType||Je,a=i===Xe,s=a?t:"<div>".concat(t,"</div>"),l=o.parseFromString(s,i);if(a){var c=l.head,u=l.body,d=c.querySelectorAll("script");(0,e.each)(d,(function(e){return u.appendChild(e)}));var p=[];(0,e.each)(c.children,(function(e){return p.push(e)})),(0,e.each)(p,(function(e,t){return u.insertBefore(e,u.children[t])})),r=u}else r=l.firstChild;return r}(p,u),h=f.querySelectorAll("script"),g=h.length;if(!((0,e.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 m=f.querySelectorAll("style"),v=m.length,y="";v--;)y=m[v].innerHTML+y,m[v].parentNode.removeChild(m[v]);y&&(l.css=o.parse(y))}null==t||t.trigger("".concat(et,":root"),{input:p,root:f});var b=this.parseNode(f,c),w=1!==b.length||c.returnArray?b:b[0];return l.html=w,null==t||t.trigger(et,{input:p,output:l}),l},__sanitizeNode:function(t,n){var r=this,o=t.attributes||[],i=t.childNodes||[],a=[];(0,e.each)(o,(function(e){var t=e.nodeName||"",r=e.nodeValue||"";!n.allowUnsafeAttr&&t.startsWith("on")&&a.push(t),!n.allowUnsafeAttrValue&&r.startsWith("javascript:")&&a.push(t)})),a.map((function(e){return t.removeAttribute(e)})),(0,e.each)(i,(function(e){return r.__sanitizeNode(e,n)}))}}};var nt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rt=function(){return rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rt.apply(this,arguments)},ot=tt(),it=function(t){return(0,e.isArray)(t)?t[t.length-1]:t},at=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return nt(r,n),r.prototype.parseStyle=function(e){return ot.parseStyle(e)},r.prototype.extendStyle=function(e){return rt(rt({},this.getStyle()),e)},r.prototype.getStyle=function(t){var n=this.get("style")||{},r=rt({},n);return t&&(0,e.isString)(t)?r[t]:r},r.prototype.setStyle=function(n,r){var o=this;void 0===n&&(n={}),void 0===r&&(r={}),(0,e.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=rt({},n),s=rt({},a);(0,e.keys)(s).forEach((function(e){""===s[e]&&delete s[e]})),this.set("style",s,r);var l=(0,t.shallowDiff)(i,a);return delete l.__p,(0,e.keys)(l).forEach((function(e){var t=o.em;r.noEvent||(o.trigger("change:style:".concat(e)),t&&(t.trigger("styleable:change",o,e,r),t.trigger("styleable:change:".concat(e),o,e,r)))})),a},r.prototype.addStyle=function(e,t,n){var r;void 0===t&&(t=""),void 0===n&&(n={}),"string"==typeof e?((r={})[e]=t,e=r):n=t||{},n.addStyle=e,e=this.extendStyle(e),this.setStyle(e,n)},r.prototype.removeStyle=function(e){var t=this.getStyle();delete t[e],this.setStyle(t)},r.prototype.styleToString=function(t){void 0===t&&(t={});var n=[],r=this.getStyle(t),o=t.important,i=function(t){var i=(0,e.isArray)(o)?o.indexOf(t)>=0:o;if("__"===t.substring(0,2))return"continue";var a=r[t];((0,e.isArray)(a)?a:[a]).forEach((function(e){var r="".concat(e).concat(i?" !important":"");r&&n.push("".concat(t,":").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(e){return this.selectorsToString?this.selectorsToString(e):this.getSelectors().getFullString()},r}(l.Hn);const st=at;var lt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ct=function(){return ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ct.apply(this,arguments)},ut=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},dt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},pt=function(t,n){return void 0===n&&(n=[]),t?(((0,e.isArray)(t)||(0,e.isFunction)(t.map)?t:[t]).map((function(e){n.push(e.getId()),pt(e.components().models,n)})),n):[]},ft=function(t,n,r){void 0===n&&(n={}),void 0===r&&(r={}),r.visitedCmps=r.visitedCmps||{};var o=r.visitedCmps;return((0,e.isArray)(t)?t:[t]).map((function(t){var i=t.attributes,a=void 0===i?{}:i,s=t.components,l=t.tagName,c=t.style,u=a.id;a.draggable;var d=ut(a,["id","draggable"]),p=t;if(u)if(o[u])o[u].push(p),u=nn.getNewId(n),p.attributes.id=u;else if(o[u]=[],n[u]){var f=p=n[u];l&&f.set({tagName:l},ct(ct({},r),{silent:!0})),(0,e.keys)(d).length&&f.addAttributes(d,ct({},r)),(0,e.keys)(c).length&&f.addStyle(c,r)}if(s){var h=ft(s,n);if((0,e.isFunction)(p.components)){var g=p.components();g.length>0&&g.reset(h,r)}else p.components=h}return p}))},ht=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lt(n,t),n.prototype.initialize=function(e,t){void 0===t&&(t={}),this.opt=t,this.listenTo(this,"add",this.onAdd),this.listenTo(this,"remove",this.removeChildren),this.listenTo(this,"reset",this.resetChildren);var n=t.em,r=t.config;this.config=r,this.em=n,this.domc=t.domc||(null==n?void 0:n.Components)},n.prototype.resetChildren=function(e,t){var n=this;void 0===t&&(t={});var r=this,o=t.previousModels||[],i=o.filter((function(t){return!e.get(t.cid)})),a=pt(e),s=pt(o).filter((function(e){return a.indexOf(e)>=0}));t.keepIds=(t.keepIds||[]).concat(s),i.forEach((function(e){return n.removeChildren(e,r,t)})),e.each((function(e){return n.onAdd(e)}))},n.prototype.resetFromString=function(e,t){var n,r;void 0===e&&(e=""),void 0===t&&(t={}),t.keepIds=pt(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(e,t),d=ft(u,c,t),p=t.visitedCmps,f=void 0===p?{}:p;Object.keys(f).forEach((function(e){var t=f[e];if(t.length){var n=(null==l?void 0:l.getRules("#".concat(e)))||[];n.length&&t.forEach((function(e){n.forEach((function(t){var n=t.clone();n.set("selectors",["#".concat(e.attributes.id)]),l.getAll().add(n)}))}))}})),this.reset(d,t),null==a||a.trigger("component:content",s,t,e),null===(r=(n=s).__checkInnerChilds)||void 0===r||r.call(n)},n.prototype.removeChildren=function(e,t,n){var r=this;if(void 0===n&&(n={}),e){var o=this.domc,i=this.em,a=n.temporary||n.fromUndo;if(e.prevColl=this,!a){var s=e.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(s)<0;delete(o?o.allById():{})[s];var d=u?c.remove(c.filter((function(e){return e.getSelectors().getFullString()==="#".concat(s)})),n):[];l.remove(d.map((function(e){return e.getSelectors().at(0)}))),e.opt.temporary||(i.Commands.run("core:component-style-clear",{target:e}),e.removed(),e.trigger("removed"),i.trigger("component:remove",e)),e.components().forEach((function(e){return r.removeChildren(e,t,n)}))}var p=e.components();i.stopListening(p),i.stopListening(e),i.stopListening(e.get("classes")),e.__postRemove()}},n.prototype.model=function(e,t){var n,r=t.collection.opt,o=r.em,i=o.Components.componentTypes;t.em=o,t.config=r.config,t.componentTypes=i,t.domc=r.domc;for(var a=0;a<i.length;a++){if(i[a].id==e.type){n=i[a].model;break}}return n||(n=i[i.length-1].model,o&&e.type&&o.logWarning("Component type '".concat(e.type,"' not found"),{attrs:e,options:t})),new n(e,t)},n.prototype.parseString=function(e,t){void 0===t&&(t={});var n=this.em,r=this.domc,o=n.Css,i=n.Parser.parseHtml(e);if(nn.checkId(i.html,i.css,r.componentsById,t),i.css&&o&&!t.temporary){t.at;var a=ut(t,["at"]);o.addCollection(i.css,ct(ct({},a),{extend:1}))}return i.html},n.prototype.add=function(t,n){var r=this;void 0===n&&(n={}),n.keepIds=dt(dt([],n.keepIds||[],!0),pt(n.previousModels),!0),(0,e.isString)(t)?t=this.parseString(t,n):(0,e.isArray)(t)&&(t=dt([],t,!0)).forEach((function(o,i){if((0,e.isString)(o)){var a=r.parseString(o,n);t[i]=(0,e.isArray)(a)&&!a.length?null:a}}));var o=(0,e.isArray)(t);t=(o?t:[t]).filter(Boolean).map((function(e){return r.processDef(e)})),t=o?(0,e.flatten)(t,1):t[0];var i=l.FE.prototype.add.apply(this,[t,n]);return this.__firstAdd=i,i},n.prototype.processDef=function(t){if(t.cid&&t.ccid)return t;var n=this.em,r=this.config,o=(void 0===r?{}:r).processor,i=t;if(o){var a=o(i=ct({},i));a&&((0,e.each)(i,(function(e,t){return delete i[t]})),(0,e.extend)(i,a))}if(i.$$typeof&&"object"==typeof i.props){(i=ct({},i)).props=ct({},i.props);var s=n.Components,l=n.Parser.parserHtml;(0,e.each)(i,(function(t,n){(0,e.includes)(["props","type"],n)||delete i[n]}));var c=i.props,u=c.children;delete c.children,delete i.props;var d=l.splitPropsFromAttr(c);i.attributes=d.attrs,u&&(i.components=u),i.type?s.getType(i.type)||(i.tagName=i.type,delete i.type):i.type="textnode",(0,e.extend)(i,d.props)}return i},n.prototype.onAdd=function(t,n,r){void 0===r&&(r={});var o=this.domc,i=this.em,a=t.getStyle(),s=i&&i.getConfig().avoidInlineStyle;if(o&&o.Component.ensureInList(t),!(0,e.isEmpty)(a)&&!s&&i&&i.get&&i.getConfig().forceClass&&!r.temporary){var l=t.cid;i.Css.setClassRule(l,a),t.setStyle({}),t.addClass(l)}t.__postAdd({recursive:!0})},n}(l.FE);const gt=ht;var mt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vt=function(t){function n(e,r){void 0===r&&(r={});var o=t.call(this,e,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,d=u?u(c):n.escapeName(c);return o.set("name",d),o.em=r.em,o}return mt(n,t),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(e){void 0===e&&(e={});var t=e.escape,n=this.get("name"),r="";switch(this.get("type")){case 1:r=".";break;case 2:r="#"}return r+(t?t(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(e){return this.set("label",e)},n.prototype.getActive=function(){return!!this.get("active")},n.prototype.setActive=function(e){return this.set("active",e)},n.prototype.toJSON=function(t){void 0===t&&(t={});var n=this.em,r=l.Hn.prototype.toJSON.call(this,[t]),o=(0,e.result)(this,"defaults");if(n&&n.getConfig().avoidDefaults){(0,e.forEach)(o,(function(e,t){r[t]===e&&delete r[t]})),r.label===r.name&&delete r.label;var i=(0,e.keys)(r).length;1===i&&r.name&&(r=r.name),2===i&&r.name&&r.type&&(r=this.getFullName())}return r},n.escapeName=function(e){return"".concat(e).trim().replace(/([^a-z0-9\w-\\:@\\/]+)/gi,"-")},n.TYPE_CLASS=1,n.TYPE_ID=2,n}(l.Hn);const yt=vt;vt.prototype.idAttribute="name";var bt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wt=function(e,t){return e.reduce((function(n,r,o){return n.concat(wt(e.slice(o+1),"".concat(t).concat(r)))}),[t])},xt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return bt(n,t),n.prototype.modelId=function(e){return"".concat(e.name,"_").concat(e.type||yt.TYPE_CLASS)},n.prototype.getStyleable=function(){return(0,e.filter)(this.models,(function(e){return e.getActive()&&!e.get("private")}))},n.prototype.getValid=function(t){var n=(void 0===t?{}:t).noDisabled;return(0,e.filter)(this.models,(function(e){return!e.get("private")})).filter((function(e){return n?e.get("active"):1}))},n.prototype.getFullString=function(e,t){void 0===t&&(t={});var n=[];return(e||this).forEach((function(e){return n.push(e.getFullName(t))})),t.sort&&n.sort(),n.join("").trim()},n.prototype.getFullName=function(e){void 0===e&&(e={});var t=e.combination,n=e.array,r=[],o=this.map((function(t){return t.getFullName(e)})).sort();return t?o.forEach((function(e,t){r=r.concat(wt(o.slice(t+1),e))})):r=o,n?r:t?r.join(","):r.join("")},n}(l.FE);const Ct=xt;xt.prototype.model=yt;var St=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};const Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return St(t,e),t.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},t.prototype.getId=function(){return this.get("id")},t.prototype.getLabel=function(){return this.get("label")},t}(l.Hn);function Ot(e){var t=new Set,n=new Map,r={items:[]};e.forEach((function(e){var o=e.category;if(o){t.add(o);var i=n.get(o);i?i.push(e):n.set(o,[e])}else r.items.push(e)}));var o=Array.from(t).map((function(e){return{category:e,items:n.get(e)||[]}}));return _t(_t([],o,!0),[r],!1)}var kt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tt="category",Pt=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return kt(r,n),r.prototype.initCategory=function(n){var r=n.get(Tt),o=r instanceof Et;if(r&&!o){(0,e.isString)(r)?r={id:r,label:r}:(0,t.isObject)(r)&&!r.id&&(r.id=r.label);var i=this.getCategories().add(r);return n.set(Tt,i,{silent:!0}),i}if(o){i=r;return this.getCategories().add(i),i}},r}(l.FE),Mt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),At=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Mt(r,n),r.prototype.add=function(r,o){return((0,e.isArray)(r)?r:[r]).forEach((function(e){return e&&(e.id=(0,t.normalizeKey)("".concat(e.id)))})),n.prototype.add.call(this,r,o)},r.prototype.get=function(r){return n.prototype.get.call(this,(0,e.isString)(r)?(0,t.normalizeKey)(r):r)},r}(l.FE);const Dt=At;var Nt;At.prototype.model=Et,function(e){e.select="trait:select",e.value="trait:value",e.custom="trait:custom",e.all="trait"}(Nt||(Nt={}));const Rt=Nt;var jt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It=function(){return It=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},It.apply(this,arguments)},Lt=function(n){function r(e,t){var r=n.call(this,e)||this,o=r.attributes,i=o.target,a=o.name;return!r.get("id")&&r.set("id",a),i&&r.setTarget(i),r.em=t,r}return jt(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 e=this.get("category");return e instanceof Et?e: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(t){if(t){var n=this.attributes,r=n.name,o=n.changeProp,i=n.value,a=n.getValue;this.target=t,this.unset("target");var s=o?"change:".concat(r):"change:attributes:".concat(r);this.listenTo(t,s,this.targetUpdated);var l=i||(a?void 0:this.getValue());!(0,e.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(e){var t;void 0===e&&(e={});var n=e.locale,r=void 0===n||n,o=this.getId(),i=this.get("label")||this.getName();return r&&(null===(t=this.em)||void 0===t?void 0:t.t("traitManager.traits.labels.".concat(o)))||i},r.prototype.getValue=function(e){return this.getTargetValue(e)},r.prototype.setValue=function(e,t){var n=this;void 0===t&&(t={});var r=this.component,o=this.em,i=t.partial,a={},s=this.attributes.setValue;s?s({value:e,component:r,editor:null==o?void 0:o.getEditor(),trait:this,partial:!!i,options:t,emitUpdate:function(){return n.targetUpdated()}}):(i&&(a.avoidStore=!0),this.setTargetValue(e,a))},r.prototype.getDefault=function(){return this.get("default")},r.prototype.getOptions=function(){return this.get("options")||[]},r.prototype.getOption=function(e){var n=this,r=(0,t.isDef)(e)?e:this.getValue();return this.getOptions().filter((function(e){return n.getOptionId(e)===r}))[0]},r.prototype.getOptionId=function(e){return e.id||e.value},r.prototype.getOptionLabel=function(t,n){var r;void 0===n&&(n={});var o=n.locale,i=void 0===o||o,a=(0,e.isString)(t)?this.getOption(t):t,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(e){void 0===e&&(e={});var t=this.em,n=this.category,r=e.locale,o=void 0===r||r,i=null==n?void 0:n.getId(),a=null==n?void 0:n.getLabel();return o&&(null==t?void 0:t.t("traitManager.categories.".concat(i)))||a||""},r.prototype.runCommand=function(){var t=this.em,n=this.attributes.command;if(n&&t)return(0,e.isString)(n)?t.Commands.run(n):n(t.Editor,this)},r.prototype.props=function(){return this.attributes},r.prototype.targetUpdated=function(){var e=this.component,t=this.em,n=this.getTargetValue({useType:!0});this.set({value:n},{fromTarget:1});var r={trait:this,component:e,value:n};e.trigger(Rt.value,r),null==t||t.trigger(Rt.value,r),null==t||t.trigger("trait:update",r)},r.prototype.getTargetValue=function(t){void 0===t&&(t={});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],t.useType)&&"checkbox"===this.getType()){var s=this.attributes,l=s.valueTrue,c=s.valueFalse;(0,e.isUndefined)(l)||l!==n?(0,e.isUndefined)(c)||c!==n||(n=!1):n=!0}return(0,e.isUndefined)(n)?"":n},r.prototype.setTargetValue=function(t,n){var r;void 0===n&&(n={});var o=this.component,i=this.attributes,a=this.getName();if(!(0,e.isUndefined)(t)){var s=t;if("false"===t?s=!1:"true"===t&&(s=!0),"checkbox"===this.getType()){var l=i.valueTrue,c=i.valueFalse;s&&!(0,e.isUndefined)(l)&&(s=l),s||(0,e.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(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={});var r={value:e};this.set(r,It(It({},n),{avoidStore:1})),t&&(this.set("value","",n),this.set(r,n))},r.prototype.getInitValue=function(){var e,t=this.component,n=this.getName();if(t){var r=t.get("attributes");e=this.changeProp?t.get(n):r[n]}return e||this.get("value")||this.get("default")},r}(l.Hn);const Ft=Lt;var Vt=function(){function t(e){void 0===e&&(e={}),this.config=e}return t.prototype.build=function(t,n){return(0,e.isString)(t)?this.buildFromString(t,n):new Ft(t,n)},t.prototype.buildFromString=function(e,t){var n={name:e,type:"text"};if("target"===e)n.type="select",n.default=!1,n.options=this.config.optionsTarget;return new Ft(n,t)},t}();const Bt=Vt;var zt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function n(e,n){var r=t.call(this,e)||this;r.categories=new Dt,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 Bt(i),r}return zt(n,t),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(e,t){var n=(void 0===t?{}:t).previousModels;(void 0===n?[]:n).forEach((function(e){return e.trigger("remove")}))},n.prototype.handleAdd=function(e){e.em=this.em;var t=this.target;t&&(e.target=t),this.initCategory(e)},n.prototype.setTarget=function(e){this.target=e,this.models.forEach((function(t){return t.setTarget(e)}))},n.prototype.add=function(n,r){if(null!=n){var o=this.target,i=this.em;if((0,e.isArray)(n)){for(var a=[],s=0,l=n.length;s<l;s++){var c=n[s];a[s]=c instanceof Ft?c:this.tf.build(c,i),a[s].setTarget(o)}return t.prototype.add.call(this,a,r)}var u=n instanceof Ft?n:this.tf.build(n,i);return u.setTarget(o),t.prototype.add.call(this,u,r)}},n}(Pt);const $t=Ht;var Wt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ut=function(){return Ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ut.apply(this,arguments)},qt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Gt=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},Yt=function(e){return!!(null==e?void 0:e.getConfig().avoidInlineStyle)},Kt="component:drag",Zt="__symbols",Xt="__symbol",Jt="__symbol_ovrd",Qt="component:update",en="".concat(Qt,"-inside"),tn=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Wt(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){var e;return(e={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})[Xt]=0,e[Zt]=0,e[Jt]=0,e._undo=!0,e._undoexc=["status","open"],e},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 e;return null!==(e=this.get("content"))&&void 0!==e?e:""},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(e,t,n){},r.prototype.removed=function(){},r.prototype.initialize=function(t,n){var o=this;void 0===t&&(t={}),void 0===n&&(n={}),(0,e.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,e.isArray)(l)?l:[l]),s&&s.propagate&&!l){var c={},u=s.propagate;u.forEach((function(e){return c[e]=a.get(e)})),c.propagate=u,this.set(Ut(Ut({},c),t))}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",Ut(Ut({},(0,e.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(en,this.__propToParent),this.set("status",""),this.views=[],["classes","traits","components"].forEach((function(e){var t="add remove ".concat("components"!==e?"change":"");o.listenTo(o.get(e),t.trim(),(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.emitUpdate.apply(o,qt([e],t,!1))}))})),!n.temporary){var d=i&&i.Css,p=this.attributes,f=p.styles,h=p.type;f&&d&&d.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(e){void 0===e&&(e={});var t=this.em,n=null==t?void 0:t.UndoManager,r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=!0),e.recursive&&r.map((function(t){return t.__postAdd(e)}))},r.prototype.__postRemove=function(){var e=this.em,t=null==e?void 0:e.get("UndoManager");t&&(t.remove(this.components()),t.remove(this.getSelectors()),delete this.__hasUm)},r.prototype.__onChange=function(n,r){var o=this,i=this.changedAttributes()||{};(0,e.keys)(i).forEach((function(e){return o.emitUpdate(e)})),["status","open","toolbar","traits"].forEach((function(e){return delete i[e]})),(0,t.isEmptyObj)(i)||(this.__changesUp(r),this.__propSelfToParent({component:this,changed:i,options:r}))},r.prototype.__onStyleChange=function(t){var n=this,r=this.em;if(r){var o="component:styleUpdate",i=(0,e.keys)(t),a={style:t};r.trigger(o,this,a),i.forEach((function(e){return r.trigger("".concat(o,":").concat(e),n,a)}))}},r.prototype.__changesUp=function(e){var t=this.em;[this.frame,t].forEach((function(t){return t&&t.changesUp(e)}))},r.prototype.__propSelfToParent=function(e){this.trigger(Qt,e),this.__propToParent(e)},r.prototype.__propToParent=function(e){var t=this.parent();t&&t.trigger(en,e)},r.prototype.__emitUpdateTlb=function(){this.emitUpdate("toolbar")},r.prototype.is=function(e){return!(this.get("type")!=e)},r.prototype.props=function(){return this.attributes},r.prototype.index=function(){var e=this.collection;return e?e.indexOf(this):0},r.prototype.setDragMode=function(e){return this.set("dmode",e)},r.prototype.getDragMode=function(){return this.get("dmode")||""},r.prototype.find=function(e){var t,n=[],r=null===(t=this.view)||void 0===t?void 0:t.$el.find(e);return null==r||r.each((function(e){var t=r.eq(e).data("model");t&&n.push(t)})),n},r.prototype.findType=function(e){var t=[],n=function(r){return r.forEach((function(r){r.is(e)&&t.push(r),n(r.components())}))};return n(this.components()),t},r.prototype.closest=function(e){var t,n=null===(t=this.view)||void 0===t?void 0:t.$el.closest(e);return(null==n?void 0:n.length)?n.data("model"):void 0},r.prototype.closestType=function(e){for(var t=this.parent();t&&!t.is(e);)t=t.parent();return t},r.prototype.contains=function(e){var t=!1;if(!e)return t;var n=function(r){!t&&r.forEach((function(r){r===e&&(t=!0),!t&&n(r.components())}))};return n(this.components()),t},r.prototype.tagUpdated=function(){this.trigger("rerender")},r.prototype.replaceWith=function(t,n){void 0===n&&(n={});var r=this.collection,o=r.indexOf(this);r.remove(this);var i=r.add(t,Ut(Ut({},n),{at:o}));return(0,e.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=Ut({},this.previous("attributes")),u=(0,t.shallowDiff)(c,this.get("attributes"));(0,e.keys)(u).forEach((function(e){return i.trigger("change:attributes:".concat(e),i,u[e],o)}))},r.prototype.setAttributes=function(e,t){return void 0===t&&(t={}),this.set("attributes",Ut({},e),t),this},r.prototype.addAttributes=function(e,t){return void 0===t&&(t={}),this.setAttributes(Ut(Ut({},this.getAttributes({noClass:!0})),e),t)},r.prototype.removeAttributes=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var n=Array.isArray(e)?e:[e],r=this.getAttributes();return n.map((function(e){return delete r[e]})),this.setAttributes(r,t)},r.prototype.getStyle=function(t,r){void 0===t&&(t={}),void 0===r&&(r={});var o=this.em,i=(0,e.isString)(t)?t:"",a=i?r:t;if(Yt(o)&&!a.inline){var s=o.get("state"),l=o.Css.getIdRule(this.getId(),Ut({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(!Yt(s)||a.temporary||o.inline)r=n.prototype.setStyle.apply(this,arguments);else{var l=this.get("style")||{};r=(0,e.isString)(r)?this.parseStyle(r):r,r=Ut(Ut({},r),l);var c=s.get("state"),u=s.Css,d=this.getStyle(o);this.rule=u.setIdRule(this.getId(),r,Ut({state:c},o));var p=(0,t.shallowDiff)(d,r);this.set("style","",{silent:!0}),(0,e.keys)(p).forEach((function(e){return i.trigger("change:style:".concat(e))}))}return a.temporary||this.__onStyleChange(o.addStyle||r),r},r.prototype.getAttributes=function(n){void 0===n&&(n={});var r=this.em,o=[],i=Ut({},this.get("attributes")),a=null==r?void 0:r.Selectors,s=this.getId();if(n.noClass?delete i.class:(this.classes.forEach((function(t){return o.push((0,e.isString)(t)?t:t.getName())})),o.length&&(i.class=o.join(" "))),!n.noStyle){var l=this.get("style");(0,t.isObject)(l)&&!(0,t.isEmptyObj)(l)&&(i.style=this.styleToString({inline:1}))}if(!(0,e.has)(i,"id")){var c=!1;!Yt(r)&&(0,e.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(e){var t=this.em.Selectors.addClass(e);return this.classes.add(t)},r.prototype.setClass=function(e){return this.classes.reset(),this.addClass(e)},r.prototype.removeClass=function(t){var n=[];t=(0,e.isArray)(t)?t:[t];var r=this.classes,o=yt.TYPE_CLASS;return t.forEach((function(e){e.split(" ").forEach((function(e){var t=r.where({name:e,type:o})[0];t&&n.push(r.remove(t))}))})),n},r.prototype.getClasses=function(){var e=this.getAttributes().class;return e?e.split(" "):[]},r.prototype.__logSymbol=function(e,t,n){void 0===n&&(n={});var r=this.__getSymbol(),o=this.__getSymbols();(r||o)&&this.em.log(e,{model:this,toUp:t,context:"symbols",opts:n})},r.prototype.__initSymb=function(){this.__symbReady||(this.on("change",this.__upSymbProps),this.__symbReady=!0)},r.prototype.__isSymbol=function(){return(0,e.isArray)(this.get(Zt))},r.prototype.__isSymbolOrInst=function(){return!(!this.__isSymbol()&&!this.get(Xt))},r.prototype.__isSymbolTop=function(){var e=this.parent();return this.__isSymbolOrInst()&&(!e||e&&!e.__isSymbol()&&!e.__getSymbol())},r.prototype.__isSymbolNested=function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var e=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),t=this.__getSymbTop();return(t.__isSymbol()?t:t.__getSymbol())!==e},r.prototype.__getAllById=function(){var e=this.em;return e?e.Components.allById():{}},r.prototype.__getSymbol=function(){var t=this.get(Xt);if(t&&(0,e.isString)(t)){var n=this.__getAllById()[t];n?(t=n,this.set(Xt,n)):t=0}return t},r.prototype.__getSymbols=function(){var t=this,n=this.get(Zt);return n&&(0,e.isArray)(n)&&(n.forEach((function(r,o){r&&(0,e.isString)(r)&&(n[o]=t.__getAllById()[r])})),n=n.filter((function(t){return t&&!(0,e.isString)(t)}))),n},r.prototype.__isSymbOvrd=function(t){void 0===t&&(t="");var n=this.get(Jt),r=t.split(":")[0],o=t!==r?[t,r]:[t];return!0===n||(0,e.isArray)(n)&&o.some((function(e){return n.indexOf(e)>=0}))},r.prototype.__getSymbToUp=function(e){var t=this;void 0===e&&(e={});var n=[],r=e.changed;if(e.fromInstance||e.noPropagate||e.fromUndo||r&&this.__isSymbOvrd(r))return n;var o=this.__getSymbols()||[],i=this.__getSymbol();return n=(i?qt([i],i.__getSymbols()||[],!0):o).filter((function(e){return e!==t})).filter((function(e){return!(r&&e.__isSymbOvrd(r))}))},r.prototype.__getSymbTop=function(e){for(var t=this,n=this.parent(e);n&&(n.__isSymbol()||n.__getSymbol());)t=n,n=n.parent(e);return t},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[Zt],delete i[Xt],delete i[Jt],delete i.attributes,delete a.id,(0,t.isEmptyObj)(a)||(i.attributes=a),!(0,t.isEmptyObj)(i)){var s=this.__getSymbToUp(r);(0,e.keys)(i).map((function(e){o.__isSymbOvrd(e)&&delete i[e]})),this.__logSymbol("props",s,{opts:r,changed:i}),s.forEach((function(t){var n=Ut({},i);(0,e.keys)(n).map((function(e){t.__isSymbOvrd(e)&&delete n[e]})),t.set(n,Ut({fromInstance:o},r))}))}},r.prototype.__upSymbCls=function(e,t,n){var r=this;void 0===n&&(n={});var o=this.__getSymbToUp(n);this.__logSymbol("classes",o,{opts:n}),o.forEach((function(e){e.set("classes",r.get("classes"),{fromInstance:r})})),this.__changesUp(n)},r.prototype.__upSymbComps=function(e,t,n){var r=this,o=n||t||{},i={fromInstance:o.fromInstance,fromUndo:o.fromUndo},a=e.opt.temporary;if(n)if(n.add){var s=[],l=!!this.__getSymbols();if((v=this.__getSymbToUp(Ut(Ut({},i),{changed:"components:add"}))).length){var c=e.__getSymbol();s=(c?c.__getSymbols():e.__getSymbols())||[],(s=qt([],s,!0)).push(c||e)}!a&&this.__logSymbol("add",v,{opts:n,addedInstances:s.map((function(e){return e.cid})),added:e.cid}),v.forEach((function(t){var o=t.__getSymbTop(),i=s.filter((function(e){var t=e.__getSymbTop({prev:1});return o&&t&&t===o}))[0]||e.clone({symbol:!0,symbolInv:l});t.append(i,Ut({fromInstance:r},n))}))}else{var u=e.__getSymbol();if(u&&!n.temporary&&u.set(Zt,u.__getSymbols().filter((function(t){return t!==e}))),!e.__isSymbolTop()){var d="components:remove",p=n.index,f=e.parent(),h=Ut({fromInstance:e},n),g=e.__isSymbolNested(),m=function(e){var t=e.parent();t&&!t.__isSymbOvrd(d)&&e.remove(h)};v=(null==f?void 0:f.__isSymbOvrd(d))?[]:e.__getSymbToUp(i);g&&(v=null==f?void 0:f.__getSymbToUp(Ut(Ut({},i),{changed:d})),m=function(e){var t=e.components().at(p);t&&t.remove(Ut({fromInstance:f},h))}),!a&&this.__logSymbol("remove",v,{opts:n,removed:e.cid,isSymbNested:g}),v.forEach(m)}}else{var v=this.__getSymbToUp(Ut(Ut({},i),{changed:"components:reset"})),y=e.models;this.__logSymbol("reset",v,{components:y}),v.forEach((function(e){var n=y.map((function(e){return e.clone({symbol:!0})}));e.components().reset(n,Ut({fromInstance:r},t))}))}this.__changesUp(o)},r.prototype.initClasses=function(t,n,r){void 0===r&&(r={});var o=this.get("attributes")||{},i=o.class,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(o,["class"]),s=[this,"change:classes",this.initClasses],l=this.get("classes")||i||[],c=(0,e.isString)(l)?l.split(" "):l;this.stopListening.apply(this,s);var u=this.normalizeClasses(c),d=new Ct([]);return this.set("classes",d,r),d.add(u),d.on("add remove reset",this.__upSymbCls),i&&u.length&&this.set("attributes",a),this.listenTo.apply(this,s),this},r.prototype.initComponents=function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var n=new gt([],this.opt);n.parent=this;var r=this.get("components"),o=!this.opt.avoidChildren;return this.set("components",n),o&&r&&n.add((0,e.isFunction)(r)?r(this):r,this.opt),n.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,t),this},r.prototype.initTraits=function(e){var t=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var r=Ut({},this.get("attributes")),o=this.traits;return o.each((function(e){if(!e.changeProp){var t=e.getName(),n=e.getInitValue();t&&n&&(r[t]=n)}})),o.length&&this.set("attributes",r),this.on(n,this.initTraits),e&&t&&t.trigger("component:toggled"),this},r.prototype.initScriptProps=function(){if(!this.opt.temporary){var e="script-props",t=["change:".concat(e),this.initScriptProps];this.off.apply(this,t);var n=this.previous(e)||[],r=this.get(e)||[],o=n.map((function(e){return"change:".concat(e)})).join(" "),i=r.map((function(e){return"change:".concat(e)})).join(" ");o&&this.off(o,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,t)}},r.prototype.__scriptPropsChange=function(e,t,n){void 0===n&&(n={}),n.avoidStore||this.trigger("rerender")},r.prototype.append=function(t,n){void 0===n&&(n={});var r=((0,e.isArray)(t)?qt([],t,!0):[t]).map((function(t){return(0,e.isString)(t)||t.collection&&t.collection.remove(t,{temporary:!0}),t})),o=this.components().add(r,n);return(0,e.isArray)(o)?o:[o]},r.prototype.components=function(t,n){void 0===n&&(n={});var r=this.get("components");return(0,e.isUndefined)(t)?r:(r.reset(void 0,n),t?this.append(t,n):[])},r.prototype.getChildAt=function(e){return this.components().at(e||0)||void 0},r.prototype.getLastChild=function(){var e=this.components();return e.at(e.length-1)||null},r.prototype.empty=function(e){return void 0===e&&(e={}),this.components().reset(void 0,e),this},r.prototype.parent=function(e){void 0===e&&(e={});var t=this.collection||e.prev&&this.prevColl;return t?t.parent:void 0},r.prototype.parents=function(){var e=this.parent();return e?[e].concat(e.parents()):[]},r.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},r.prototype.initToolbar=function(){var e=this.em,t=this,n=e&&e.getConfig().stylePrefix||"";if(!t.get("toolbar")&&e){var r=[];t.collection&&r.push({label:e.getIcon("arrowUp"),command:function(e){return e.runCommand("core:component-exit",{force:1})}}),t.get("draggable")&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:e.getIcon("move"),command:"tlb-move"}),t.get("copyable")&&r.push({label:e.getIcon("copy"),command:"tlb-clone"}),t.get("removable")&&r.push({label:e.getIcon("delete"),command:"tlb-delete"}),t.set("toolbar",r)}},r.prototype.__loadTraits=function(t,n){void 0===n&&(n={});var r=t||this.traits;if(!(r instanceof $t)){r=(0,e.isFunction)(r)?r(this):r;var o=new $t([],this.opt);o.setTarget(this),r.length&&(r.forEach((function(e){return e.attributes&&delete e.attributes.value})),o.add(r)),this.set({traits:o},n)}return this},r.prototype.getTraits=function(){return this.__loadTraits(),qt([],this.traits.models,!0)},r.prototype.setTraits=function(t){var n=(0,e.isArray)(t)?t:[t];return this.set({traits:n}),this.getTraits()},r.prototype.getTrait=function(e){return this.getTraits().filter((function(t){return t.get("id")===e||t.get("name")===e}))[0]||null},r.prototype.updateTrait=function(e,t){var n,r=this.getTrait(e);return r&&r.set(t),null===(n=this.em)||void 0===n||n.trigger("component:toggled"),this},r.prototype.getTraitIndex=function(e){var t=this.getTrait(e);return t?this.traits.indexOf(t):-1},r.prototype.removeTrait=function(t){var n,r=this,o=((0,e.isArray)(t)?t:[t]).map((function(e){return r.getTrait(e)})),i=this.traits,a=o.length?i.remove(o):[];return null===(n=this.em)||void 0===n||n.trigger("component:toggled"),(0,e.isArray)(a)?a:[a]},r.prototype.addTrait=function(t,n){var r;void 0===n&&(n={}),this.__loadTraits();var o=this.traits.add(t,n);return null===(r=this.em)||void 0===r||r.trigger("component:toggled"),(0,e.isArray)(o)?o:[o]},r.prototype.normalizeClasses=function(e){var t=[],n=this.em,r=null==n?void 0:n.Selectors;return r?e.models?qt([],e.models,!0):(e.forEach((function(e){return t.push(r.add(e))})),t):[]},r.prototype.clone=function(e){void 0===e&&(e={});var t=this.em,n=Ut({},this.attributes),r=Ut({},this.opt),o=this.getId(),i=null==t?void 0:t.Css;n.attributes=Ut({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(e.symbol=!0),this.get("components").each((function(t,r){n.components[r]=t.clone(Ut(Ut({},e),{_inner:1}))})),this.get("traits").each((function(e,t){n.traits[t]=e.clone()})),this.get("classes").each((function(e,t){n.classes[t]=e.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(e){var t=e.clone();t.set("selectors",[s]),i.getAll().add(t)})),a.set(Zt,0);var l=this.__getSymbol(),c=this.__getSymbols();e.symbol||!l&&!c?l?(l.set(Zt,qt(qt([],l.__getSymbols(),!0),[a],!1)),a.__initSymb()):e.symbol&&(this.__isSymbol()?(this.set(Zt,qt(qt([],c,!0),[a],!1)),a.set(Xt,this),a.__initSymb()):e.symbolInv?(this.set(Zt,[a]),a.set(Xt,this),[this,a].map((function(e){return e.__initSymb()}))):(a.set(Zt,[this]),[this,a].map((function(e){return e.__initSymb()})),this.set(Xt,a))):(a.set(Xt,0),a.set(Zt,0));var u="component:clone";return t&&t.trigger(u,a),this.trigger(u,a),a},r.prototype.getName=function(e){void 0===e&&(e={});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))),d=l&&(null==n?void 0:n.t("".concat(c).concat(l))),p=n&&(n.t("".concat(c).concat(o))||n.t("".concat(c).concat(i))),f=this.get("custom-name");return(e.noCustom?"":f)||u||a||d||(0,t.capitalize)(l)||p||(0,t.capitalize)(s)},r.prototype.getIcon=function(){var e=this.get("icon");return e?e+" ":""},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,e.isFunction)(s)?l=s(r,l)||{}:(0,t.isObject)(s)&&(l=s)),n.withProps){var c=this.toJSON();(0,e.forEach)(c,(function(n,r){"_"!==r[0]&&["classes","attributes","components"].indexOf(r)<0&&(l["data-gjs-".concat(r)]=(0,e.isArray)(n)||(0,t.isObject)(n)?JSON.stringify(n):(0,e.isBoolean)(n)?"".concat(n):n)}))}for(var u in l){var d=l[u];if(!(0,e.isUndefined)(d)&&null!==d)if((0,e.isBoolean)(d))d&&o.push(u);else{var p="";if(n.altQuoteAttr&&(0,e.isString)(d)&&d.indexOf('"')>=0)p="'".concat(d.replace(/'/g,"'"),"'");else{var f=(0,e.isString)(d)?d.replace(/"/g,"""):d;p='"'.concat(f,'"')}o.push("".concat(u,"=").concat(p))}}var h=o.length?" ".concat(o.join(" ")):"",g=r.getInnerHTML(n),m="<".concat(i).concat(h).concat(a?"/":"",">").concat(g);return!a&&(m+="</".concat(i,">")),m},r.prototype.getInnerHTML=function(e){return this.__innerHTML(e)},r.prototype.__innerHTML=function(e){void 0===e&&(e={});var t=this.components();return t.length?t.map((function(t){return t.toHTML(e)})).join(""):this.content},r.prototype.getAttrToHTML=function(){var e=this.getAttributes();return Yt(this.em)&&delete e.style,e},r.prototype.toJSON=function(t){void 0===t&&(t={});var n=o.Model.prototype.toJSON.call(this,t);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,!t.fromUndo){var r=n[Xt],i=n[Zt];i&&(0,e.isArray)(i)&&(n[Zt]=i.filter((function(e){return e})).map((function(e){return e.getId?e.getId():e}))),r&&!(0,e.isString)(r)&&(n[Xt]=r.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},r.prototype.getChangedProps=function(t){var n=t||o.Model.prototype.toJSON.apply(this),r=(0,e.result)(this,"defaults");return(0,e.forEach)(r,(function(e,t){-1===["type"].indexOf(t)&&n[t]===e&&delete n[t]})),(0,e.isEmpty)(n.type)&&delete n.type,(0,e.forEach)(["attributes","style"],(function(t){(0,e.isEmpty)(r[t])&&(0,e.isEmpty)(n[t])&&delete n[t]})),(0,e.forEach)(["classes","components"],(function(t){(!n[t]||(0,e.isEmpty)(r[t])&&!n[t].length)&&delete n[t]})),n},r.prototype.getId=function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},r.prototype.setId=function(e,t){var n=Ut({},this.get("attributes"));return n.id=e,this.set("attributes",n,t),this},r.prototype.getEl=function(e){var t=this.getView(e);return t&&t.el},r.prototype.getView=function(e){var t=this,n=t.view,r=t.views,o=t.em,i=e||(null==o?void 0:o.getCurrentFrameModel());return i&&(n=r.filter((function(e){return e.frameView===i.view}))[0]),n},r.prototype.getCurrentView=function(){var e=this.em.getCurrentFrame(),t=null==e?void 0:e.model;return this.getView(t)},r.prototype.__getScriptProps=function(){var e=this.props();return(this.get("script-props")||[]).reduce((function(t,n){return t[n]=e[n],t}),{})},r.prototype.getScriptString=function(t){var n=this,r=t||this.get("script")||"";if(!r)return r;if(this.get("script-props"))r=r.toString().trim();else{if((0,e.isFunction)(r)){var o=r.toString().trim();r=(o=o.slice(o.indexOf("{")+1,o.lastIndexOf("}"))).trim()}var i=this.em.getConfig(),a=Gt(i.tagVarStart||"{[ "),s=Gt(i.tagVarEnd||" ]}"),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),"g");r=r.replace(l,(function(t,r){n.scriptUpdated();var o=n.attributes[r]||"";return(0,e.isArray)(o)||"object"==typeof o?JSON.stringify(o):o}))}return r},r.prototype.emitUpdate=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.em,i=Qt+(e?":".concat(e):""),a=e&&this.get(e);e&&this.updated.apply(this,qt([e,a,e&&this.previous(e)],n,!1)),this.trigger.apply(this,qt([i],n,!1)),o&&o.trigger.apply(o,qt([i,this],n,!1)),["components","classes"].indexOf(e)>=0&&this.__propSelfToParent({component:this,changed:(t={},t[e]=a,t),options:n[2]||n[1]||{}})},r.prototype.onAll=function(t){return(0,e.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this},r.prototype.forEachChild=function(t){(0,e.isFunction)(t)&&this.components().forEach((function(e){t(e),e.forEachChild(t)}))},r.prototype.remove=function(e){var t=this;void 0===e&&(e={});var n=this.em,r=this.collection,o=function(){r&&r.remove(t,Ut(Ut({},e),{action:"remove-component"})),r||(t.components("",e),t.components().removeChildren(t,void 0,e))},i=Ut({},e);return[this,n].map((function(e){return e.trigger("component:remove:before",t,o,i)})),!i.abort&&o(),this},r.prototype.move=function(e,t){if(void 0===t&&(t={}),e){var n=t.at,r=this.index(),o=e===this.parent();o&&(r===n||r===n-1)||(o&&n&&n>r&&(t.at=n-1),this.remove({temporary:1}),e.append(this,t),this.emitUpdate())}return this},r.prototype.isInstanceOf=function(e){var t,n,r=null===(n=null===(t=this.em)||void 0===t?void 0:t.Components.getType(e))||void 0===n?void 0:n.model;return!!r&&this instanceof r},r.prototype.isChildOf=function(t){for(var n=(0,e.isString)(t),r=this.parent();r;){if(n){if(r.isInstanceOf(t))return!0}else if(r===t)return!0;r=r.parent()}return!1},r.prototype.resetId=function(e){var t=this.em,n=this.getId();if(!n)return this;var o=r.createId(this);this.setId(o);var i=null==t?void 0:t.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(e){var t=(void 0===e?{}:e).id,n=this.em,r=t||this.getId();return null==n?void 0:n.Css.getIdRule(r)},r.prototype._getStyleSelector=function(e){var t=this._getStyleRule(e);return null==t?void 0:t.get("selectors").at(0)},r.prototype._idUpdated=function(e,t,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,e.result)(this.prototype,"defaults")},r.isComponent=function(e){return{tagName:(0,t.toLowerCase)(e.tagName)}},r.ensureInList=function(e){var t=r.getList(e),n=e.getId(),o=t[n];if(o){if(o!==e){var i=r.getIncrementId(n,t);e.setId(i),t[i]=e}}else t[n]=e;e.components().forEach((function(e){return r.ensureInList(e)}))},r.createId=function(e,t){void 0===t&&(t={});var n,o=r.getList(e),i=t.idMap,a=void 0===i?{}:i,s=e.get("attributes").id;return s?(n=r.getIncrementId(s,o,t),e.setId(n),s!==n&&(a[s]=n)):n=r.getNewId(o),o[n]=e,n},r.getNewId=function(e){for(var t=Object.keys(e).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-t),o="i".concat(n);e[o];)o=r.getNewId(e);return o},r.getIncrementId=function(e,t,n){void 0===n&&(n={});var r=n.keepIds,o=1,i=e;if((void 0===r?[]:r).indexOf(e)<0)for(;t[i];)o++,i="".concat(e,"-").concat(o);return i},r.getList=function(e){var t=e.opt,n=void 0===t?{}:t,r=n.domc,o=n.em,i=r||(null==o?void 0:o.Components);return i?i.componentsById:{}},r.checkId=function(t,n,o,i){void 0===n&&(n=[]),void 0===o&&(o={}),void 0===i&&(i={});var a=(0,e.isArray)(t)?t:[t],s=i.keepIds,l=void 0===s?[]:s,c=i.idMap,u=void 0===c?{}:c;a.forEach((function(t){t.attributes;var a=t.attributes,s=void 0===a?{}:a,c=t.components,d=s.id;if(d&&o[d]&&l.indexOf(d)<0){var p=r.getIncrementId(d,o);u[d]=p,s.id=p,(0,e.isArray)(n)&&n.forEach((function(e){var t=e.selectors;t.forEach((function(e,n){e==="#".concat(d)&&(t[n]="#".concat(p))}))}))}c&&r.checkId(c,n,o,i)}))},r}(st);const nn=tn;var rn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),on=function(){return on=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},on.apply(this,arguments)},an=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return rn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return on(on({},e.prototype.defaults),{tagName:"",droppable:!1,layerable:!1,selectable:!1,editable:!0})},enumerable:!1,configurable:!0}),n.prototype.toHTML=function(){var e=this.content,t=this.parent();return(null==t?void 0:t.is("script"))?e:this.__escapeContent(e)},n.prototype.__escapeContent=function(e){return(0,t.escapeNodeContent)(e)},n.isComponent=function(e){var t;if(3===e.nodeType)return{type:"textnode",content:null!==(t=e.textContent)&&void 0!==t?t:""}},n}(nn);const sn=an;var ln=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cn=function(){return cn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cn.apply(this,arguments)},un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ln(t,e),Object.defineProperty(t.prototype,"defaults",{get:function(){return cn({},e.prototype.defaults)},enumerable:!1,configurable:!0}),t.prototype.toHTML=function(){return"\x3c!--".concat(this.content,"--\x3e")},t.isComponent=function(e){var t;if(8==e.nodeType)return{type:"comment",content:null!==(t=e.textContent)&&void 0!==t?t:""}},t}(sn);const dn=un;var pn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(){return fn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fn.apply(this,arguments)},hn="iframe";const gn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return pn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return fn(fn({},e.prototype.defaults),{type:hn,tagName:hn,droppable:!1,resizable:!0,traits:["id","title","src"],attributes:{frameborder:"0"}})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===hn},n}(nn);var mn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vn=function(){return vn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vn.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 mn(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){return vn(vn({},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,t.buildBase64UrlFromSvg)((0,e.result)(this,"defaults").src)!==i&&this.set("src",i,{silent:!0})},r.prototype.initToolbar=function(){n.prototype.initToolbar.call(this);var e=this.em;if(e){var t="image-editor";if(e.Commands.has(t)){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:t}),this.set("toolbar",o))}}},r.prototype.getAttrToHTML=function(){var e=n.prototype.getAttrToHTML.call(this),t=this.getSrcResult();return t&&(e.src=t),e},r.prototype.getSrcResult=function(e){void 0===e&&(e={});var n=this.get(e.fallback?"fallback":"src")||"",r=n;return n&&"<svg"===n.substr(0,4)&&(r=(0,t.buildBase64UrlFromSvg)(n)),r},r.prototype.isDefaultSrc=function(){var n=this.get("src"),r=(0,e.result)(this,"defaults").src;return n===r||n===(0,t.buildBase64UrlFromSvg)(r)},r.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=t.attributes;return r&&t.src===r.src&&delete t.src,t},r.prototype.parseUri=function(e){var n={};if((0,t.hasWin)())(n=document.createElement("a")).href=e;else if("undefined"!=typeof URL)try{n=new URL(e)}catch(e){}return{hostname:n.hostname||"",pathname:n.pathname||"",protocol:n.protocol||"",search:n.search||"",hash:n.hash||"",port:n.port||"",query:function(e){void 0===e&&(e="");for(var t={},n=e.substring(1).split("&"),r=0;r<n.length;r++){var o=n[r].split("="),i=decodeURIComponent(o[0]);i&&(t[i]=decodeURIComponent(o[1]||""))}return t}(n.search)}},r.isComponent=function(e){return"img"===(0,t.toLowerCase)(e.tagName)},r}(nn);const wn=bn;var xn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cn=function(){return Cn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Cn.apply(this,arguments)};const Sn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return xn(n,t),Object.defineProperty(n.prototype,"defaults",{get:function(){return Cn(Cn({},t.prototype.defaults),{type:"text",droppable:!1,editable:!0})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.__checkInnerChilds()},n.prototype.__checkInnerChilds=function(){var t=this.em.Components.config.disableTextInnerChilds;if(t){var n=function(e){e.isInstanceOf("textnode")||e.set({locked:!0,layerable:!1})};(0,e.isFunction)(t)?this.forEachChild((function(e){t(e)&&n(e)})):this.forEachChild(n)}},n}(nn);var _n=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(){return En=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},En.apply(this,arguments)},On="label";const kn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return _n(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return En(En({},e.prototype.defaults),{type:On,tagName:On,traits:["id","title","for"]})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===On},n}(Sn);var Tn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pn=function(){return Pn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pn.apply(this,arguments)},Mn="link",An=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Tn(r,n),Object.defineProperty(r.prototype,"defaults",{get:function(){return Pn(Pn({},n.prototype.defaults),{type:Mn,tagName:"a",traits:["title","href","target"]})},enumerable:!1,configurable:!0}),r.isComponent=function(n,r){var o;if(void 0===r&&(r={}),"a"===(0,t.toLowerCase)(n.tagName)){var i=r.textTags||[];o={type:Mn,editable:!1};var a=n.childNodes;a.length||delete o.editable,(0,e.forEach)(a,(function(e){var n=e.tagName;(3==e.nodeType&&""!==e.textContent.trim()||n&&i.indexOf((0,t.toLowerCase)(n))>=0)&&delete o.editable}))}return o},r}(Sn);const Dn=An;var Nn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rn=function(){return Rn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rn.apply(this,arguments)},jn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Nn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){var t=e.prototype.defaults;return Rn(Rn({},t),{type:"map",src:"",void:!1,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:t.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(t,n){this.get("src")?this.parseFromSrc():this.updateSrc(),e.prototype.initialize.call(this,t,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 e=this.get("address"),t=this.get("zoom"),n=this.get("mapType");e=e?"&q="+e:"",t=t?"&z="+t:"",n=n?"&t="+n:"";var r=this.get("mapUrl")+"?"+e+t+n;return r+="&output=embed"},n.prototype.parseFromSrc=function(){var e=this.parseUri(this.get("src")).query;e.q&&this.set("address",e.q),e.z&&this.set("zoom",e.z),e.t&&this.set("mapType",e.t)},n.isComponent=function(e){if("iframe"==(0,t.toLowerCase)(e.tagName)&&/maps\.google\.com/.test(e.src))return{type:"map",src:e.src}},n}(wn);const In=jn;var Ln=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fn=function(){return Fn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Fn.apply(this,arguments)},Vn="script";const Bn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ln(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return Fn(Fn({},e.prototype.defaults),{type:Vn,tagName:Vn,droppable:!1,draggable:!1,layerable:!1,highlightable:!1})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===Vn},n}(nn);var zn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hn=function(){return Hn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Hn.apply(this,arguments)},$n="svg";const Wn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return zn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return Hn(Hn({},e.prototype.defaults),{type:$n,tagName:$n,highlightable:!1,resizable:{ratioDefault:!0}})},enumerable:!1,configurable:!0}),n.prototype.getName=function(){var e=this.get("tagName"),t=this.get("custom-name");return e=e.charAt(0).toUpperCase()+e.slice(1),t||e},n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===$n},n}(nn);var Un=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qn=function(){return qn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qn.apply(this,arguments)};const Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Un(t,e),Object.defineProperty(t.prototype,"defaults",{get:function(){return qn(qn({},e.prototype.defaults),{selectable:!1,hoverable:!1,layerable:!1})},enumerable:!1,configurable:!0}),t.isComponent=function(e,t){return void 0===t&&(t={}),!!t.inSvg},t}(Wn);var Yn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kn=function(){return Kn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Kn.apply(this,arguments)},Zn="table";const Xn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Yn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return Kn(Kn({},e.prototype.defaults),{type:Zn,tagName:Zn,droppable:["tbody","thead","tfoot"]})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){e.prototype.initialize.call(this,t,n);var r=this.get("components");!r.length&&r.add({type:"tbody"})},n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===Zn},n}(nn);var Jn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qn=function(){return Qn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Qn.apply(this,arguments)},er="tbody";const tr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Jn(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return Qn(Qn({},e.prototype.defaults),{type:er,tagName:er,draggable:["table"],droppable:["tr"],columns:1,rows:1})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){e.prototype.initialize.call(this,t,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(e){return(0,t.toLowerCase)(e.tagName)===er},n}(nn);var nr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rr=function(){return rr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rr.apply(this,arguments)};const or=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return nr(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return rr(rr({},e.prototype.defaults),{type:"cell",tagName:"td",draggable:["tr"]})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return["td","th"].indexOf((0,t.toLowerCase)(e.tagName))>=0},n}(nn);var ir=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ar=function(){return ar=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ar.apply(this,arguments)},sr="tfoot";const lr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ir(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return ar(ar({},e.prototype.defaults),{type:sr,tagName:sr})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===sr},n}(tr);var cr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ur=function(){return ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ur.apply(this,arguments)},dr="thead";const pr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return cr(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return ur(ur({},e.prototype.defaults),{type:dr,tagName:dr})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return(0,t.toLowerCase)(e.tagName)===dr},n}(tr);var fr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hr=function(){return hr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},hr.apply(this,arguments)};const gr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return fr(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return hr(hr({},e.prototype.defaults),{tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]})},enumerable:!1,configurable:!0}),n.isComponent=function(e){return"tr"===(0,t.toLowerCase)(e.tagName)},n}(nn);var mr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vr=function(){return vr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vr.apply(this,arguments)},yr="video",br="yt",wr="vi",xr="ytnc",Cr=function(e){return e&&"0"!==e},Sr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return mr(n,e),Object.defineProperty(n.prototype,"defaults",{get:function(){return vr(vr({},e.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(t,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),e.prototype.initialize.call(this,t,n)},n.prototype.updatePropsFromAttr=function(){if("so"===this.get("provider")){var e=this.get("attributes"),n=e.controls,r=e.autoplay,o=e.loop,i={};(0,t.isDef)(n)&&(i.controls=!!n),(0,t.isDef)(r)&&(i.autoplay=!!r),(0,t.isDef)(o)&&(i.loop=!!o),(0,t.isEmptyObj)(i)||this.set(i)}},n.prototype.updateTraits=function(){var e,t=this.em,n="iframe";switch(this.get("provider")){case br:case xr:e=this.getYoutubeTraits();break;case wr:e=this.getVimeoTraits();break;default:n="video",e=this.getSourceTraits()}this.set({tagName:n},{silent:!0}),this.set({traits:e}),t.get("ready")&&t.trigger("component:toggled")},n.prototype.parseFromSrc=function(){var e=this.get("provider"),t=this.parseUri(this.get("src")),n=t.query;switch(e){case br:case xr:case wr:this.set("videoId",t.pathname.split("/").pop()),n.list&&this.set("list",n.list),Cr(n.autoplay)&&this.set("autoplay",!0),Cr(n.loop)&&this.set("loop",!0),0===parseInt(n.controls)&&this.set("controls",!1),Cr(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 e="";switch(this.get("provider")){case br:e=this.getYoutubeSrc();break;case xr:e=this.getYoutubeNoCookieSrc();break;case wr:e=this.getVimeoSrc()}this.set({src:e})},n.prototype.getAttrToHTML=function(){var t=e.prototype.getAttrToHTML.call(this);switch(this.get("provider")){case br:case xr:case wr:break;default:t.loop=!!this.get("loop"),t.autoplay=!!this.get("autoplay"),t.controls=!!this.get("controls")}return t},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 e=this.get("videoId"),t=this.get("ytUrl"),n=this.get("list");return t+=e+(e.indexOf("?")<0?"?":""),t+=n?"&list=".concat(n):"",t+=this.get("autoplay")?"&autoplay=1&mute=1":"",t+=this.get("controls")?"":"&controls=0&showinfo=0",t+=this.get("loop")?"&loop=1&playlist=".concat(e):"",t+=this.get("rel")?"":"&rel=0",t+=this.get("modestbranding")?"&modestbranding=1":""},n.prototype.getYoutubeNoCookieSrc=function(){var e=this.getYoutubeSrc();return e=e.replace(this.get("ytUrl"),this.get("ytncUrl"))},n.prototype.getVimeoSrc=function(){var e=this.get("viUrl");return e+=this.get("videoId")+"?",e+=this.get("autoplay")?"&autoplay=1&muted=1":"",e+=this.get("loop")?"&loop=1":"",e+=this.get("controls")?"":"&title=0&portrait=0&badge=0",e+=this.get("color")?"&color="+this.get("color"):""},n.isComponent=function(e){var n=e.tagName,r=e.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,t.toLowerCase)(n)==yr||"iframe"==(0,t.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 _r=Sr;var Er=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(){return Or=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Or.apply(this,arguments)},kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Er(t,e),Object.defineProperty(t.prototype,"defaults",{get:function(){return Or(Or({},e.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}),t.prototype.__postAdd=function(){var t,n=null===(t=this.em)||void 0===t?void 0:t.UndoManager;return!this.__hasUm&&(null==n||n.add(this)),e.prototype.__postAdd.call(this)},t.prototype.__postRemove=function(){var t,n=null===(t=this.em)||void 0===t?void 0:t.UndoManager;return null==n||n.remove(this),e.prototype.__postRemove.call(this)},t.isComponent=function(){return!1},t}(nn);const Tr=kr;var Pr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mr=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.compView=jr,e}return Pr(n,t),n.prototype.initialize=function(e){this.opts=e||{},this.config=e.config||{},this.em=this.config.em;var t=this.collection;this.listenTo(t,"add",this.addTo),this.listenTo(t,"reset",this.resetChildren),this.listenTo(t,"remove",this.removeChildren)},n.prototype.removeChildren=function(e,t,n){var r=this;void 0===n&&(n={}),e.views.forEach((function(e){if(e){var t=e.childrenView,n=e.scriptContainer;t&&t.stopListening(),(0,me.L_)(n),e.remove.apply(e)}})),e.components().forEach((function(e){return r.removeChildren(e,t,n)}))},n.prototype.addTo=function(e,t,n){void 0===n&&(n={});var r=this.em,o=this.collection.indexOf(e);if(this.addToCollection(e,null,o),r&&!n.temporary){var i=function(e){r.trigger("component:add",e),e.components().forEach((function(e){return i(e)}))};i(e)}},n.prototype.addToCollection=function(t,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)&&t.getView(c.model),d=a.componentTypes||(null==s?void 0:s.Components.getTypes()),p=t.get("type")||"default",f=this.compView,h=0;h<d.length;h++)if(d[h].id==p){f=d[h].view;break}var g,m=u||new f({model:t,config:i,componentTypes:d});try{g=m.render().el}catch(e){g=document.createTextNode(""),s.logError(e)}if(l)l.appendChild(g);else{var v=this.parentEl,y=v.childNodes;if((0,e.isUndefined)(r))v.appendChild(g);else{var b=y.length==r;b&&r--,b||!y.length?v.appendChild(g):v.insertBefore(g,y[r])}}return t.opt.temporary||null==s||s.trigger("component:mount",t),g},n.prototype.resetChildren=function(e,t){var n=this,r=(void 0===t?{}:t).previousModels,o=void 0===r?[]:r;this.parentEl.innerHTML="",o.forEach((function(e){return n.removeChildren(e,n.collection)})),e.each((function(e){return n.addToCollection(e)}))},n.prototype.render=function(e){var t=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=e||this.el,this.collection.each((function(e){return t.addToCollection(e,r)})),n.innerHTML="",n.appendChild(r),this},n}(l.G7);const Ar=Mr;var Dr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nr=function(){return Nr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Nr.apply(this,arguments)},Rr=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Dr(r,n),r.prototype.className=function(){return this.getClasses()},r.prototype.tagName=function(){return this.model.get("tagName")},r.prototype.preinitialize=function(e){void 0===e&&(e={}),this.opts=e},r.prototype.initialize=function(e){void 0===e&&(e={});var n=this.model,r=e.config||{},o=r.em,i=n.opt||{},a=this.$el,s=this.el;this.opts=e,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,t.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 e,t,n=(null===(e=this.frameView)||void 0===e?void 0:e.getDoc())||document;return(null===(t=this.opts.config)||void 0===t?void 0:t.useFrameDoc)?n:document},enumerable:!1,configurable:!0}),r.prototype.__isDraggable=function(){var e=this.model,t=this.config,n=e.attributes.draggable;return t.draggableComponents&&n},r.prototype._clbObj=function(){var e=this,t=e.em,n=e.model,r=e.el;return{editor:null==t?void 0:t.getEditor(),model:n,el:r}},r.prototype.init=function(e){},r.prototype.removed=function(e){},r.prototype.onRender=function(e){},r.prototype.onActive=function(e){},r.prototype.onDisable=function(e){},r.prototype.remove=function(){var e;n.prototype.remove.call(this);var t=this.model,r=this.$el,o=t.views,i=this.frameView||{};return t.components().forEach((function(e){var t=e.getView(i.model);null==t||t.remove()})),null===(e=this.childrenView)||void 0===e||e.remove(),o.splice(o.indexOf(this),1),this.removed(this._clbObj()),r.data({model:"",collection:"",view:""}),this},r.prototype.handleDragStart=function(e){if(!this.__isDraggable())return!1;e.stopPropagation(),e.preventDefault(),this.em.Commands.run("tlb-move",{target:this.model,event:e})},r.prototype.initClasses=function(){var e=this.model,t=e.classes,n="change:classes";t instanceof Ct&&(this.stopListening(e,n,this.initClasses),this.listenTo(e,n,this.initClasses),this.listenTo(t,"add remove change reset",this.updateClasses),t.length&&this.importClasses())},r.prototype.initComponents=function(e){void 0===e&&(e={});var t=this,n=t.model,r=t.$el,o=t.childrenView,i=n.get("components"),a=[n,"change:components",this.initComponents];i instanceof gt&&(r.data("collection",i),o&&o.remove(),this.stopListening.apply(this,a),!e.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))},r.prototype.handleChange=function(){var t=this.model,n=(0,e.keys)(t.changed);if(1!==n.length||"status"!==n[0])for(var r in t.emitUpdate(),t.changed)t.emitUpdate(r)},r.prototype.importClasses=function(){var e=this.em,t=this.model,n=e.Selectors;n&&t.classes.forEach((function(e){return n.add(e.getName())}))},r.prototype.updateStatus=function(t){void 0===t&&(t={});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"),d="".concat(u,"-parent"),p="".concat(i,"freezed"),f="".concat(i,"hovered"),h="".concat(i,"no-pointer"),g="".concat(i,"pointer-init"),m=[u,d,p,f,h],v=l&&!t.noExtHl?"":u;this.$el.removeClass(m.join(" "));var y=[o.getAttribute("class")||""],b=!(null==s?void 0:s.hasCustomSpot(se.q.Select)),w=!(null==s?void 0:s.hasCustomSpot(se.q.Target));switch(c){case"selected":b&&y.push(v);break;case"selected-parent":w&&y.push(d);break;case"freezed":y.push(p);break;case"freezed-selected":y.push(p),b&&y.push(v);break;case"hovered":!t.avoidHover&&y.push(f)}(0,e.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 e=this.model,t=e.get("textable"),n=e.get("highlightable")&&(t||!e.isChildOf("text"));this.setAttribute("data-gjs-highlightable",!!n||"")},r.prototype.updateStyle=function(t,n,r){void 0===r&&(r={});var o=this.model,i=this.em;if(Yt(i)&&!r.inline){var a=this.__cmpStyleOpts,s=o.getStyle(a);!(0,e.isEmpty)(s)&&o.setStyle(s,a)}else this.setAttribute("style",o.styleToString(r))},r.prototype.updateClasses=function(){var e=this.model.classes.pluck("name").join(" ");this.setAttribute("class",e),this.updateStatus(),this.onAttrUpdate()},r.prototype.setAttribute=function(e,t){var n=this.$el;t?n.attr(e,t):n.removeAttr(e)},r.prototype.getClasses=function(){return this.model.getClasses().join(" ")},r.prototype.updateAttributes=function(){var t=[],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,e.each)(i.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(e){return o.removeAttr(e)})),this.updateStyle(),this.updateHighlight();var u=Nr(Nr({},c),r.getAttributes());(0,e.keys)(u).forEach((function(e){return!1===u[e]&&delete u[e]})),o.attr(u)},r.prototype.updateContent=function(){var e=this.model.content,t=this.model.components().length;this.getChildrenContainer().innerHTML=t?"":e},r.prototype.prevDef=function(e){e.preventDefault()},r.prototype.updateScript=function(){var e=this.model,t=this.em;e.get("script")&&(null==t||t.Canvas.getCanvasView().updateScript(this))},r.prototype.getChildrenContainer=function(){var e=this.el;return"function"==typeof this.getChildrenSelector?e=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,e},r.prototype.getOffsetRect=function(){var e={top:0,left:0,bottom:0,right:0},t=this.el,n=0,r=0,o=function(i){var a=i.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,o(a)):(e.top=t.offsetTop+n,e.left=t.offsetLeft+r,e.bottom=e.top+t.offsetHeight,e.right=e.left+t.offsetWidth)};return o(t),e},r.prototype.isInViewport=function(){var e=this,t=e.el,n=e.em,r=e.frameView,o=n.Canvas.getCanvasView().getElBoxRect(t,{local:!0}),i=r.el,a=i.clientHeight,s=i.clientWidth,l=o.y,c=o.x,u=l+o.height,d=c+o.width;return(l>=0&&l<a||u>0&&u<a)&&(d>=0&&d<s||c>0&&c<=s)},r.prototype.scrollIntoView=function(e){var t;if(void 0===e&&(e={}),!this.isInViewport()||e.force){var n=this.el;if("smooth"!==e.behavior){var r=this.getOffsetRect();null===(t=n.ownerDocument.defaultView)||void 0===t||t.scrollTo(0,r.top)}else n.scrollIntoView(Nr({behavior:"smooth",block:"nearest"},e))}},r.prototype.reset=function(){var e=this.el;this.el="",this._ensureElement(),this._setData(),(0,me.dL)(e,this.el),this.render()},r.prototype._setData=function(){var e=this.model,t=e.components();this.$el.data({model:e,collection:t,view:this})},r.prototype._createElement=function(e){return this.createDoc.createElement(e)},r.prototype.renderChildren=function(){this.updateContent();var e=this.getChildrenContainer(),t=this.childrenView||new Ar({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});t.render(e),this.childrenView=t;for(var n=Array.prototype.slice.call(t.el.childNodes),r=0,o=n.length;r<o;r++)e.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,t.setViewEl)(this.el,this),this.postRender()),this},r.prototype.postRender=function(){this.modelOpt.temporary||this.onRender(this._clbObj())},r.getEvents=function(){return(0,e.result)(this.prototype,"events")},r}(l.G7);const jr=Rr;var Ir=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Lr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ir(t,e),t.prototype._setAttributes=function(){},t.prototype.renderAttributes=function(){},t.prototype.updateStatus=function(){},t.prototype.updateClasses=function(){},t.prototype.setAttribute=function(){},t.prototype.updateAttributes=function(){},t.prototype.initClasses=function(){},t.prototype.initComponents=function(){},t.prototype.delegateEvents=function(){return this},t.prototype._createElement=function(){return document.createTextNode("")},t.prototype.render=function(){var e=this.model,t=this.el;return e.opt.temporary||(t.textContent=e.content),this},t}(jr);var Fr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Fr(t,e),t.prototype._createElement=function(){return document.createComment(this.model.content)},t}(Lr);var Br=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const zr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Br(t,e),t.prototype.tagName=function(){return"div"},t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.listenTo(this.model,"change:attributes:src",this.updateSrc)},t.prototype.updateSrc=function(){var e=(0,me.sE)(this.el,"iframe")[0];e&&(0,me.FW)(e,{src:this.__getSrc()})},t.prototype.render=function(){e.prototype.render.call(this);var t=(0,me.ut)("iframe",{class:"".concat(this.ppfx,"no-pointer"),style:"width: 100%; height: 100%; border: none",src:this.__getSrc()});return this.el.appendChild(t),this},t.prototype.__getSrc=function(){return this.model.getAttributes().src||""},t}(jr);var Hr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Hr(n,t),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(e){t.prototype.initialize.call(this,e),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 t=this.model,n=this.em,r=t.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,e.isString)(r)?r:r.src);o&&t.set({src:o})})),t.set("file","")}}},n.prototype.updateSrc=function(){var e=this.model;e.addAttributes({src:e.getSrcResult()}),this.updateClasses()},n.prototype.updateClasses=function(){t.prototype.updateClasses.call(this);var e=this,n=e.el,r=e.classEmpty,o=e.model,i=o.getSrcResult()&&!o.isDefaultSrc()?"remove":"add";n.classList[i](r)},n.prototype.onActive=function(e){null==e||e.stopPropagation();var t=this.em,n=this.model,r=null==t?void 0:t.Assets;r&&n.get("editable")&&r.open({select:function(e,t){n.set({src:e.getSrc()}),t&&r.close()},target:n,types:["image"],accept:"image/*"})},n.prototype.onError=function(){var e=this.model.getSrcResult({fallback:!0});e&&(this.el.src=e)},n.prototype.onLoad=function(){this.em.Canvas.refresh({all:!0})},n.prototype.noDrag=function(e){return e.preventDefault(),!1},n.prototype.render=function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var e=this.$el,t=this.model,n=e.attr("class")||"";return!t.get("src")&&e.attr("class","".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this},n}(jr);const Wr=$r;var Ur=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qr=function(){return qr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qr.apply(this,arguments)},Gr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Yr=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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])}}},Kr=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(t){n.prototype.initialize.call(this,t),(0,e.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(e,t,n){void 0===n&&(n={}),!n.fromDisable&&this.disableEditing()},r.prototype.canActivate=function(){var e,t=this,n=t.model,r=t.rteEnabled,o=t.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")?e=l:a=!0}return{result:a,delegate:e}},r.prototype.onActive=function(e){var t,n;return Gr(this,void 0,void 0,(function(){var r,o,i,a,s,l,c,u,d;return Yr(this,(function(p){switch(p.label){case 0:return o=(r=this).rte,i=r.em,a=this.canActivate(),s=a.result,l=a.delegate,s?(null===(n=null==e?void 0:e.stopPropagation)||void 0===n||n.call(e),c=this,[4,this.getContent()]):(l&&(null===(t=null==e?void 0:e.stopPropagation)||void 0===t||t.call(e),i.setSelected(l),l.trigger("active",e)),[2]);case 1:if(c.lastContent=p.sent(),!o)return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),u=this,[4,o.enable(this,this.activeRte,{event:e})];case 3:return u.activeRte=p.sent(),[3,5];case 4:return d=p.sent(),i.logError(d),[3,5];case 5:return this.toggleEvents(!0),[2]}}))}))},r.prototype.onDisable=function(e){this.disableEditing(e)},r.prototype.disableEditing=function(e){return void 0===e&&(e={}),Gr(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,l;return Yr(this,(function(c){switch(c.label){case 0:if(n=(t=this).model,r=t.rte,o=t.activeRte,i=t.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,e)];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(e)]:[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 e,t,n,r;return Yr(this,(function(o){switch(o.label){case 0:return t=(e=this).rte,n=e.activeRte,r="",t?[4,t.getContent(this,n)]:[3,2];case 1:r=o.sent(),o.label=2;case 2:return[2,r]}}))}))},r.prototype.syncContent=function(e){return void 0===e&&(e={}),Gr(this,void 0,void 0,(function(){var t,n,r,o,i,a;return Yr(this,(function(s){switch(s.label){case 0:return n=(t=this).model,r=t.rte,t.rteEnabled||e.force?[4,this.getContent()]:[2];case 1:return o=s.sent(),i=n.components(),a=qr({fromDisable:1},e),n.set("content","",a),(null==r?void 0:r.customRte)&&!r.customRte.parseContent?(i.length&&i.reset(void 0,qr(qr({},e),{keepIds:pt(i)})),n.set("content",o,a)):i.resetFromString(o,e),[2]}}))}))},r.prototype.insertComponent=function(e,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,t.getComponentModel)(s),u=[];if(c&&(null===(r=c.is)||void 0===r?void 0:r.call(c,"textnode"))){var d=c.collection;d.forEach((function(t){if(t===c){var r="textnode",o=n.useDomContent?s.textContent||"":t.content;u.push({type:r,content:o.slice(0,l)}),u.push(e),u.push({type:r,content:o.slice(l)})}else u.push(t)}));var p=u.filter(Boolean),f=p.indexOf(e);return d.reset(p,n),d.at(f)}}return o.append(e,n)},r.prototype.onInput=function(){var e=this.em,t="component",n=["".concat(t,":update"),"".concat(t,":input")].join(" ");e&&e.trigger(n,this.model)},r.prototype.disablePropagation=function(e){e.stopPropagation()},r.prototype.toggleEvents=function(e){var t=this,n=t.em,r=t.model,o=t.$el,i={on:me.on,off:me.S1},a=e?"on":"off";n.setEditing(!!e&&this),this.rteEnabled=!!e;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(e?"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=!e,(l=l.parentNode)&&"BODY"==l.tagName&&(l=0)},r}(jr);const Zr=Kr;var Xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Jr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xr(t,e),t.prototype.render=function(){return e.prototype.render.call(this),this.el.addEventListener("click",this.prevDef,!0),this},t}(Zr);var Qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const eo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Qr(t,e),t}(Jr);var to=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const no=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return to(t,e),t.prototype.tagName=function(){return"div"},t.prototype.events=function(){return{}},t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.classEmpty=this.ppfx+"plh-map"},t.prototype.updateSrc=function(){this.getIframe().src=this.model.get("src")},t.prototype.getIframe=function(){if(!this.iframe){var e=document.createElement("iframe");e.src=this.model.get("src"),e.frameBorder="0",e.style.height="100%",e.style.width="100%",e.className=this.ppfx+"no-pointer",this.iframe=e}return this.iframe},t.prototype.render=function(){return e.prototype.render.call(this),this.updateClasses(),this.el.appendChild(this.getIframe()),this},t}(Wr);var ro=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const oo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ro(t,e),t.prototype.tagName=function(){return"script"},t.prototype.events=function(){return{}},t}(jr);var io=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ao=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return io(t,e),t.prototype._createElement=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)},t}(jr);const so=ao;var lo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const co=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lo(t,e),t}(jr);var uo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const po=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uo(t,e),t}(jr);var fo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ho=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fo(t,e),t}(jr);var go=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const mo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return go(t,e),t}(jr);var vo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vo(t,e),t}(jr);var bo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const wo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return bo(t,e),t.prototype.events=function(){return{}},t}(jr);var xo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Co=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xo(t,e),t.prototype.tagName=function(){return"div"},t.prototype.events=function(){return{}},t.prototype.initialize=function(){jr.prototype.initialize.apply(this,arguments);var e=this.model,t=["loop","autoplay","controls","color","rel","modestbranding","poster"].map((function(e){return"change:".concat(e)})).join(" ");this.listenTo(e,"change:provider",this.updateProvider),this.listenTo(e,"change:src",this.updateSrc),this.listenTo(e,t,this.updateVideo)},t.prototype.updateProvider=function(){var e=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(e))},t.prototype.updateSrc=function(){var e=this.model,t=this.videoEl;if(t){var n=e.get("provider"),r=e.get("src");switch(n){case"yt":r=e.getYoutubeSrc();break;case"ytnc":r=e.getYoutubeNoCookieSrc();break;case"vi":r=e.getVimeoSrc()}t.src=r}},t.prototype.updateVideo=function(){var e=this.model,t=this.videoEl;switch(e.get("provider")){case"yt":case"ytnc":case"vi":e.trigger("change:videoId");break;default:if(t){var n=t;n.loop=e.get("loop"),n.autoplay=e.get("autoplay"),n.controls=e.get("controls"),n.poster=e.get("poster")}}},t.prototype.renderByProvider=function(e){var t;switch(e){case"yt":t=this.renderYoutube();break;case"ytnc":t=this.renderYoutubeNoCookie();break;case"vi":t=this.renderVimeo();break;default:t=this.renderSource()}return this.videoEl=t,t},t.prototype.renderSource=function(){var e=document.createElement("video");return e.src=this.model.get("src"),this.initVideoEl(e),e},t.prototype.renderYoutube=function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeSrc(),e.frameBorder="0",e.setAttribute("allowfullscreen","true"),this.initVideoEl(e),e},t.prototype.renderYoutubeNoCookie=function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeNoCookieSrc(),e.frameBorder="0",e.setAttribute("allowfullscreen","true"),this.initVideoEl(e),e},t.prototype.renderVimeo=function(){var e=document.createElement("iframe");return e.src=this.model.getVimeoSrc(),e.frameBorder="0",e.setAttribute("allowfullscreen","true"),this.initVideoEl(e),e},t.prototype.initVideoEl=function(e){e.className=this.ppfx+"no-pointer",e.style.height="100%",e.style.width="100%"},t.prototype.render=function(){jr.prototype.render.apply(this),this.updateClasses();var e=this.model.get("provider");return this.el.appendChild(this.renderByProvider(e)),this.updateVideo(),this},t}(Wr);const So=Co;var _o=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Eo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _o(t,e),t.prototype.tagName=function(){return"div"},t}(jr);var Oo,ko=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),To=function(){return To=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},To.apply(this,arguments)};!function(e){e[e.InvalidSource=0]="InvalidSource",e[e.SourceReject=1]="SourceReject",e[e.TargetReject=2]="TargetReject"}(Oo||(Oo={}));var Po=function(n){function r(e){var t=n.call(this,e,"DomComponents",new gt(void 0,{em:e}))||this;for(var r in t.componentTypes=[{id:"cell",model:or,view:po},{id:"row",model:gr,view:yo},{id:"table",model:Xn,view:wo},{id:"thead",model:pr,view:mo},{id:"tbody",model:tr,view:co},{id:"tfoot",model:lr,view:ho},{id:"map",model:In,view:no},{id:"link",model:Dn,view:Jr},{id:"label",model:kn,view:eo},{id:"video",model:_r,view:So},{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:dn,view:Vr},{id:"textnode",model:sn,view:Lr},{id:"text",model:Sn,view:Zr},{id:"wrapper",model:Tr,view:Eo},{id:"default",model:nn,view:jr}],t.componentsById={},t.Component=nn,t.Components=gt,t.ComponentView=jr,t.ComponentsView=Ar,t.storageKey="components",e&&(t.config.components=e.config.components||t.config.components),Ze)r in t.config||(t.config[r]=Ze[r]);var o=t.config.pStylePrefix;if(o&&(t.config.stylePrefix=o+t.config.stylePrefix),e){e.get("Parser").compTypes=t.componentTypes,e.on("change:componentHovered",t.componentHovered,t);var i=e.get("selected");e.listenTo(i,"add",(function(e,n,r){return t.selectAdd(i.getComponent(e),r)})),e.listenTo(i,"remove",(function(e,n,r){return t.selectRemove(i.getComponent(e),r)}))}return t}return ko(r,n),r.prototype.load=function(t){var n=this;return this.loadProjectData(t,{onResult:function(t){var r=n.getWrapper();if(r||(n.em.Pages.add({},{select:!0}),r=n.getWrapper()),(0,e.isArray)(t))t.length&&r.components(t);else{var o=t.components,i=void 0===o?[]:o,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["components"]);r.set(a),r.components(i)}}})},r.prototype.store=function(){return{}},r.prototype.getComponent=function(){var e=this.em.Pages.getSelected(),t=null==e?void 0:e.getMainFrame();return null==t?void 0:t.getComponent()},r.prototype.getWrapper=function(){return this.getComponent()},r.prototype.getComponents=function(){var e=this.getWrapper();return null==e?void 0:e.components()},r.prototype.addComponent=function(e,t){return void 0===t&&(t={}),this.getComponents().add(e,t)},r.prototype.render=function(){var e;return null===(e=this.componentView)||void 0===e?void 0:e.render().el},r.prototype.clear=function(e){void 0===e&&(e={});var t=this.getComponents();return null==t||t.filter(Boolean).forEach((function(t){return t.remove(e)})),this},r.prototype.setComponents=function(e,t){void 0===t&&(t={}),this.clear(t).addComponent(e,t)},r.prototype.addType=function(t,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,d=n.extendFn,p=void 0===d?[]:d,f=n.extendFnView,h=void 0===f?[]:f,g=this.getType(t),m=this.getType(c),v=this.getType(u),y=m||(g||this.getType("default")),b=y.model,w=v?v.view:y.view,x=function(e,t,n){return e.reduce((function(e,r){var o=t[r],i=n.prototype[r];return o&&i&&(e[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.bind(this).apply(void 0,e),o.bind(this).apply(void 0,e)}),e}),{})};if("object"==typeof i){var C={defaults:i.defaults};delete i.defaults,n.model=b.extend(To(To({},i),x(p,i,b)),{isComponent:!g||m||l?l||function(){return 0}:b.isComponent}),Object.defineProperty(n.model.prototype,"defaults",{get:function(){return To(To({},(0,e.result)(b.prototype,"defaults")||{}),(0,e.result)(C,"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=t,this.componentTypes.unshift(n));var S="component:type:".concat(g?"update":"add");return null==r||r.trigger(S,g||n),this},r.prototype.getType=function(e){for(var t=this.componentTypes,n=0;n<t.length;n++){if(t[n].id==e)return t[n]}},r.prototype.removeType=function(e){var t=this.componentTypes,n=this.getType(e);if(n){var r=t.indexOf(n);return t.splice(r,1),n}},r.prototype.getTypes=function(){return this.componentTypes},r.prototype.selectAdd=function(e,t){var n=this;void 0===t&&(t={}),e&&(e.set({status:"selected"}),["component:selected","component:toggled"].forEach((function(r){return n.em.trigger(r,e,t)})))},r.prototype.selectRemove=function(e,t){var n=this;void 0===t&&(t={}),e&&(this.em,e.set({status:"",state:""}),["component:deselected","component:toggled"].forEach((function(r){return n.em.trigger(r,e,t)})))},r.prototype.componentHovered=function(){var t=this.em,n=t.get("componentHovered"),r=t.previous("componentHovered"),o="hovered";r&&r.get("status")==o&&r.set({status:"",state:""}),n&&(0,e.isEmpty)(n.get("status"))&&n.set("status",o)},r.prototype.getShallowWrapper=function(){var t=this.shallow,n=this.em;if(!t&&n){var r=n.shallow;if(!r)return;var o=r.Components;if(o.componentTypes=this.componentTypes,t=o.getWrapper()){var i=[Qt,en].join(" ");t.on(i,(0,e.debounce)((function(){return null==t?void 0:t.components("")}),100))}this.shallow=t}return t},r.prototype.isComponent=function(e){return(0,t.isComponent)(e)},r.prototype.canMove=function(n,r,o){var i={result:!1,reason:Oo.InvalidSource,target:n,source:null};if(!r||!n)return i;var a=(0,t.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,e.isFunction)(l))l=!!l(a,n,o);else{var c=n.getEl();l=(0,e.isArray)(l)?l.join(","):l,l=(0,e.isString)(l)?null==c?void 0:c.matches(l):l}if(!l)return To(To({},i),{reason:Oo.SourceReject});var u=n.get("droppable");if((0,e.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,e.isArray)(u)?u.join(","):u,u=(0,e.isString)(u)?null==c?void 0:c.matches(u):u}var d=[n].concat(n.parents()).indexOf(a)>-1;return To(To({},i),!u||d?{reason:Oo.TargetReject}:{result:!0})},r.prototype.allById=function(){return this.componentsById},r.prototype.getById=function(e){return this.componentsById[e]||null},r.prototype.destroy=function(){var e,t=this.allById();Object.keys(t).forEach((function(e){return t[e]&&t[e].remove()})),null===(e=this.componentView)||void 0===e||e.remove(),[this.em,this.componentsById,this.componentView].forEach((function(e){return{}}))},r}(m);const Mo=Po;const Ao={stylePrefix:"css-",rules:[]};var Do=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),No=Number.MAX_VALUE,Ro=function(n){function r(){var t=n.call(this)||this;return(0,e.bindAll)(t,"sortRules"),t.compCls=[],t.ids=[],t}return Do(r,n),r.prototype.buildFromModel=function(e,t){var n=this;void 0===t&&(t={});var r="",o=this.em,i=o&&o.getConfig().avoidInlineStyle,a=e.styleToString(),s=e.classes;return this.ids.push("#".concat(e.getId())),s.forEach((function(e){return n.compCls.push(e.getFullName())})),!i&&a&&(r="#".concat(e.getId(),"{").concat(a,"}")),e.components().forEach((function(e){return r+=n.buildFromModel(e,t)})),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,e.isUndefined)(r.clearStyles)&&a?a.getConfig().clearStyles:r.clearStyles;if(s){var d=r.rules||s.getAll(),p={},f=[];r.onlyMatched&&n&&(0,t.hasWin)()&&(d=this.matchedRules(n,d)),d.forEach((function(e){var t=e.getAtRule();if(t){var n=p[t];n?n.push(e):p[t]=[e]}else{var a=o.buildFromRule(e,f,r);i?l.push(a):c+=a}})),this.sortMediaObject(p).forEach((function(e){var t="",n=e.key;e.value.forEach((function(e){var a=o.buildFromRule(e,f,r);e.get("singleAtRule")?c+="".concat(n,"{").concat(a,"}"):t+=a,i&&l.push(a)})),t&&(c+="".concat(n,"{").concat(t,"}"))})),a&&u&&d.remove&&d.remove(f)}return i?l.filter((function(e){return e})):c},r.prototype.buildFromRule=function(e,t,n){var r,o=this;void 0===n&&(n={});var i,a="",s=this.model,l=e.selectorsToString({skipAdd:1}),c=e.get("selectorsAdd"),u=e.get("singleAtRule");if(null===(r=e.get("selectors"))||void 0===r||r.forEach((function(e){var t=e.getFullName();(o.compCls.indexOf(t)>=0||o.ids.indexOf(t)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!s){var d=e.getDeclaration({body:1});d&&(n.json?a=e:a+=d)}else t.push(e);return a},r.prototype.matchedRules=function(e,t){var n=this,r=e.getEl(),o=[];return t.forEach((function(e){try{e.selectorsToString().split(",").some((function(e){return null==r?void 0:r.matches(n.__cleanSelector(e))}))&&o.push(e)}catch(e){}})),e.components().forEach((function(e){o=o.concat(n.matchedRules(e,t))})),o=o.filter((function(e,t){return o.indexOf(e)===t}))},r.prototype.getQueryLength=function(e){var t=/(-?\d*\.?\d+)\w{0,}/.exec(e);return t?parseFloat(t[1]):No},r.prototype.sortMediaObject=function(t){var n=this;void 0===t&&(t={});var r=[];return(0,e.each)(t,(function(e,t){return r.push({key:t,value:e})})),r.sort((function(e,t){var r=[e.key,t.key].every((function(e){return-1!==e.indexOf("min-width")})),o=r?e.key:t.key,i=r?t.key:e.key;return n.getQueryLength(o)-n.getQueryLength(i)}))},r.prototype.sortRules=function(e,t){var n=function(e){return e.get("mediaText")||""},r=[n(e),n(t)].every((function(e){return-1!==e.indexOf("min-width")})),o=n(r?e:t),i=n(r?t:e);return this.getQueryLength(o)-this.getQueryLength(i)},r.prototype.__cleanSelector=function(e){return e.split(" ").map((function(e){return e.split(":")[0]})).join(" ")},r}(l.Hn);const jo=Ro;var Io=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lo=function(){return Lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lo.apply(this,arguments)},Fo=((0,t.hasWin)()?window:{}).CSS,Vo=function(n){function r(e,t){void 0===t&&(t={});var r=n.call(this,e)||this;return r.config=e||{},r.opt=t,r.em=t.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(e,n){var r=this.em,o=this.changedAttributes();o&&!(0,t.isEmptyObj)(o)&&(null==r||r.changesUp(n))},r.prototype.clone=function(){var e=Lo({},this.opt),t=Lo({},this.attributes);return t.selectors=this.get("selectors").map((function(e){return e.clone()})),new this.constructor(t,e)},r.prototype.ensureSelectors=function(t,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(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],s.models,!0)),s=(0,e.isString)(s)?[s]:s,Array.isArray(s)){var l=s.filter((function(e){return e})).map((function(e){return i?i.add(e):e}));s=new Ct(l)}this.set("selectors",s,r),this.listenTo.apply(this,a)},r.prototype.getAtRule=function(){var e=this.get("atRuleType"),t=this.get("mediaText"),n=e?"@".concat(e):t?"@media":"";return n+(t&&n?" ".concat(t):"")},r.prototype.selectorsToString=function(e){void 0===e&&(e={});var t=[],n=this.get("state"),r=this.get("selectorsAdd"),o={escape:function(e){return Fo&&Fo.escape?Fo.escape(e):e}},i=this.get("selectors").getFullString(0,o),a=n&&!e.skipState?":".concat(n):"";return i&&t.push("".concat(i).concat(a)),r&&!e.skipAdd&&t.push(r),t.join(", ")},r.prototype.getDeclaration=function(e){void 0===e&&(e={});var t="",n=this.attributes.important,r=this.selectorsToString(e),o=this.styleToString(Lo({important:n},e)),i=this.get("singleAtRule");return(r||i)&&(o||e.allowEmpty)&&(t=i?o:"".concat(r,"{").concat(o,"}")),t},r.prototype.getDevice=function(){var e=this.em,t=this.attributes,n=t.atRuleType,r=t.mediaText,o=(null==e?void 0:e.get("DeviceManager").getDevices())||[],i=o.filter((function(e){return""===e.getWidthMedia()}))[0];return"media"===n&&r?o.filter((function(e){return e.getWidthMedia()===function(e){var t=/(-?\d*\.?\d+)\w{0,}/.exec(e);return t?t[0]:""}(r)}))[0]||null:i||null},r.prototype.getState=function(){var e=this.em,t=this.get("state");return((null==e?void 0:e.get("SelectorManager").getStates())||[]).filter((function(e){return e.getName()===t}))[0]||null},r.prototype.getComponent=function(){var e,t=this.getSelectors(),n=1==t.length&&t.at(0),r=n&&n.isId()&&n.get("name");return r&&(null===(e=this.em)||void 0===e?void 0:e.Components.getById(r))||null},r.prototype.toCSS=function(e){void 0===e&&(e={});var t="",n=this.getAtRule(),r=this.getDeclaration(e);return(r||e.allowEmpty)&&(t=r),n&&t&&(t="".concat(n,"{").concat(t,"}")),t},r.prototype.toJSON=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=l.Hn.prototype.toJSON.apply(this,n);if(null===(t=this.em)||void 0===t?void 0:t.getConfig().avoidDefaults){var i=this.defaults();(0,e.forEach)(i,(function(e,t){o[t]===e&&delete o[t]})),delete o.style.__p,(0,e.isEmpty)(o.selectors)&&delete o.selectors,(0,e.isEmpty)(o.style)&&delete o.style}return o},r.prototype.compare=function(t,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,e.isArray)(t)||t.models?t.models||t:[t]).map((function(e){return e.getFullName()})),d=null===(i=this.get("selectors"))||void 0===i?void 0:i.map((function(e){return e.getFullName()})),p=u.slice().sort(),f=d.slice().sort();return!(u.length!==d.length||!p.every((function(e,t){return e===f[t]})))&&(this.get("state")===a&&this.get("mediaText")===s&&this.get("selectorsAdd")===l&&this.get("atRuleType")===c)},r}(st);const Bo=Vo;var zo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ho=function(e){function t(t,n){var r=e.call(this,t)||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(t,e),t.prototype.toJSON=function(e){return l.FE.prototype.toJSON.call(this,e).filter((function(e){return e.style&&!e.shallow}))},t.prototype.onAdd=function(e,t,n){e.ensureSelectors(e,t,n)},t.prototype.onRemove=function(e){var t=this.editor;t.stopListening(e),t.UndoManager.remove(e)},t.prototype.add=function(e,t){return void 0===t&&(t={}),"string"==typeof e&&(e=this.editor.get("Parser").parseCss(e)),t.em=this.editor,l.FE.prototype.add.apply(this,[e,t])},t}(l.FE);const $o=Ho;Ho.prototype.model=Bo;var Wo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uo=function(){return Uo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Uo.apply(this,arguments)},qo=function(n){function r(e){var t=n.call(this,e,"CssComposer",null,{},Ao)||this;t.Selectors=Ct,t.storageKey="styles";var r=t.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),r.rules=t.em.config.style||r.rules||"",t.rules=new $o([],r),t}return Wo(r,n),r.prototype.onLoad=function(){this.rules.add(this.config.rules,{silent:!0})},r.prototype.postLoad=function(){var e,t=null===(e=this.em)||void 0===e?void 0:e.get("UndoManager");t&&t.add(this.getAll())},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(e){return this.loadProjectData(e,{all:this.rules})},r.prototype.add=function(e,t,n,r,o){void 0===r&&(r={}),void 0===o&&(o={});var i=t||"",a=n||"",s=Uo({},r),l=this.get(e,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(e,o),this.rules.add(l,o)),l},r.prototype.get=function(t,n,r,o){var i=t;if((0,e.isString)(t)){var a=this.em.Selectors,s=t.split(",")[0].trim(),l=this.em.Parser.parserCss.checkNode({selectors:s})[0];i=a.get(l.selectors)}return this.rules.find((function(e){return e.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,e.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 d=null==i?void 0:i.Selectors;d||console.warn("Selector Manager not found");for(var p=u.selectors,f=p instanceof Array?p:[p],h=[],g=0,m=f.length;g<m;g++){var v=d.add(f[g]);h.push(v)}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,t.isObject)(o)&&b.set(o,r),w){var C=r.extend?Uo(Uo({},b.get("style")),x):x;b.set("style",C,r)}a.push(b)}}return a},r.prototype.addRules=function(e){return this.addCollection(e)},r.prototype.setRule=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.atRuleType,o=n.atRuleParams,i=this.em.Parser.parserCss.checkNode({selectors:e,style:t})[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(t,n):c.setStyle(t,n),c},r.prototype.getRule=function(e,t){void 0===t&&(t={});var n=this.em,r=n.Selectors,o=n.Parser.parserCss.checkNode({selectors:e})[0],i=r.get(o.selectors),a=o.state,s=o.selectorsAdd,l=t.atRuleType,c=t.atRuleParams;return i?this.get(i,a,c,{selectorsAdd:s,atRuleType:l}):void 0},r.prototype.getRules=function(t){var n=this.getAll();if(!t)return function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],n.models,!0);var r={sort:!0},o=(0,e.isString)(t)?t.split(",").map((function(e){return e.trim()})):t,i=n.filter((function(e){return o.indexOf(e.getSelectors().getFullString(null,r))>=0}));return i},r.prototype.setIdRule=function(t,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,e.isUndefined)(a)?this.em.getCurrentMedia():a,c=this.em.Selectors.add({name:t,type:yt.TYPE_ID},i),u=this.add(c,s,l,{},i);return u.setStyle(n,Uo(Uo({},r),i)),u},r.prototype.getIdRule=function(t,n){void 0===n&&(n={});var r=n.mediaText,o=n.state||"",i=(0,e.isUndefined)(r)?this.em.getCurrentMedia():r,a=this.em.Selectors.get(t,yt.TYPE_ID);return a&&this.get(a,o,i)},r.prototype.setClassRule=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.state||"",o=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:e,type:yt.TYPE_CLASS}),a=this.add(i,r,o);return a.setStyle(t,n),a},r.prototype.getClassRule=function(e,t){void 0===t&&(t={});var n=t.state||"",r=t.mediaText||this.em.getCurrentMedia(),o=this.em.Selectors.get(e,yt.TYPE_CLASS);return o&&this.get(o,n,r)},r.prototype.remove=function(t,n){var r=(0,e.isString)(t)?this.getRules(t):t,o=this.getAll().remove(r,n);return(0,e.isArray)(o)?o:[o]},r.prototype.clear=function(e){return void 0===e&&(e={}),this.getAll().reset([],e),this},r.prototype.getComponentRules=function(t,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=t.getId(),a=this.getAll().filter((function(t){return!(!(0,e.isUndefined)(r)&&t.get("state")!==r)&&(!(!(0,e.isUndefined)(o)&&t.get("mediaText")!==o)&&t.getSelectorsString()==="#".concat(i))}));return a},r.prototype.render=function(){var e;return null===(e=this.rulesView)||void 0===e||e.remove(),this.rulesView=new Oe({collection:this.rules,config:this.config}),this.rulesView.render().el},r.prototype.checkId=function(t,n){void 0===n&&(n={});var r=n.idMap,o=void 0===r?{}:r,i=[];return Object.keys(o).length?((Array.isArray(t)?t:[t]).forEach((function(t){var n=t.selectors;if(n&&1==n.length){var r=n[0];if((0,e.isString)(r)){if("#"===r[0]){var a=r.substring(1),s=o[a];a&&s&&(n[0]="#".concat(s),i.push(t))}}else if(r.name&&r.type===yt.TYPE_ID){(s=o[r.name])&&(r.name=s,i.push(t))}}})),i):i},r.prototype.destroy=function(){var e;this.rules.reset(),this.rules.stopListening(),null===(e=this.rulesView)||void 0===e||e.remove()},r}(m);const Go=qo;const Yo={appendTo:"",blocks:[],appendOnClick:!1,custom:!1};var Ko=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Zo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Ko(n,t),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 e=this.get("category");return e instanceof Et?e: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 t=this.get("category");return(0,e.isFunction)(null==t?void 0:t.get)?t.get("label"):(null==t?void 0:t.label)?null==t?void 0:t.label:t},n}(l.Hn);var Xo=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jo=function(e){function t(t,n){var r=e.call(this,t)||this;return r.em=n.em,r.on("add",r.handleAdd),r}return Xo(t,e),t.prototype.getCategories=function(){return this.em.Blocks.getCategories()},t.prototype.handleAdd=function(e){this.initCategory(e)},t}(Pt);const Qo=Jo;var ei;Jo.prototype.model=Zo,function(e){e.add="block:add",e.remove="block:remove",e.removeBefore="block:remove:before",e.update="block:update",e.dragStart="block:drag:start",e.drag="block:drag",e.dragEnd="block:drag:stop",e.custom="block:custom",e.all="block"}(ei||(ei={}));var ti=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=function(n){function r(e,t){void 0===t&&(t={});var r=n.call(this,e)||this,o=r.model;return r.em=t.em,r.config=t,r.endDrag=r.endDrag.bind(r),r.ppfx=t.pStylePrefix||"",r.listenTo(o,"destroy remove",r.remove),r.listenTo(o,"change",r.render),r}return ti(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(t){var n=this,r=n.config,o=n.model,i=n.em,a=o.get("onClick")||r.appendOnClick;if(i.trigger("block:click",o,t),a){if((0,e.isFunction)(a))return a(o,null==i?void 0:i.getEditor(),{event:t});var s,l,c=r.getSorter(),u=o.get("content"),d=i.getSelected();if(c.setDropContent(u),d)if(c.validTarget(d.getEl(),u).valid)s=d;else{var p=d.parent();p&&c.validTarget(p.getEl(),u).valid&&(s=p,l=p.components().indexOf(d)+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(e){var t=this,n=t.config,r=t.em,o=t.model,i=o.get("disable");if(0===e.button&&n.getSorter&&!this.el.draggable&&!i){r.refreshCanvas();var a=n.getSorter();a.__currentBlock=o,a.setDragHelper(this.el,e),a.setDropContent(this.model.get("content")),a.startSort(this.el),(0,me.on)(document,"mouseup",this.endDrag)}},r.prototype.handleDragStart=function(e){this.__getModule().__startDrag(this.model,e)},r.prototype.handleDrag=function(e){this.__getModule().__drag(e)},r.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},r.prototype.endDrag=function(){(0,me.S1)(document,"mouseup",this.endDrag);var e=this.config.getSorter();e.moved=0,e.endMove()},r.prototype.render=function(){var e,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||"",d="".concat(a,"block"),p=r&&r.t("blockManager.labels.".concat(s.id))||s.get("label"),f=s.get("render"),h=s.get("media"),g=l?"".concat(d,"--disable"):"".concat(a,"four-color-h");i.attr(c),o.className="".concat(u," ").concat(d," ").concat(a,"one-bg ").concat(g).trim(),o.innerHTML="\n ".concat(h?'<div class="'.concat(d,'__media">').concat(h,"</div>"):"",'\n <div class="').concat(d,'-label">').concat(p,"</div>\n "),o.title=c.title||(null===(e=o.textContent)||void 0===e?void 0:e.trim()),o.setAttribute("draggable","".concat(!(!(0,t.hasDnd)(r)||l)));var m=f&&f({el:o,model:s,className:d,prefix:a});return m&&(o.innerHTML=m),this},r}(l.G7);const ri=ni;var oi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ii=function(e){function t(t,n,r){var o=e.call(this,t)||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(t,e),t.prototype.events=function(){return{"click [data-title]":"toggle"}},t.prototype.template=function(e){var t,r,o=e.pfx,i=e.label,a=e.catName;return n(si||(t=['\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(t,"raw",{value:r}):t.raw=r,si=t),o,o,i,o,a)},t.prototype.attributes=function(){return this.model.get("attributes")||{}},t.prototype.updateVisibility=function(){this.model.get("open")?this.open():this.close()},t.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getTypeEl().style.display=""},t.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().style.display="none"},t.prototype.toggle=function(){var e=this.model;e.set("open",!e.get("open"))},t.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},t.prototype.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},t.prototype.append=function(e){this.getTypeEl().appendChild(e)},t.prototype.render=function(){var e=this,t=e.em,n=e.el,r=e.$el,o=e.model,i=e.pfx,a=e.catName,s=t.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},t}(l.G7);const ai=ii;var si,li=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ci=function(){return ci=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ci.apply(this,arguments)},ui=function(t){function n(n,r){var o=t.call(this,n)||this;o.renderedCategories=new Map,(0,e.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,t),n.prototype.__getModule=function(){return this.em.Blocks},n.prototype.updateConfig=function(e){void 0===e&&(e={}),this.config=ci(ci({},this.config),e)},n.prototype.getSorter=function(){var e=this.em;if(e){if(!this.sorter){var t=e.Utils,n=e.Canvas;this.sorter=new t.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:e,canvasRelative:1})}return this.sorter}},n.prototype.onDrag=function(e){this.em.stopDefault(),this.__getModule().__startDrag(this.sorter.__currentBlock,e)},n.prototype.onMove=function(e){this.__getModule().__drag(e)},n.prototype.onDrop=function(e){this.em.runDefault(),this.__getModule().__endDrag({component:e}),delete this.sorter.__currentBlock},n.prototype.addTo=function(e){this.add(e)},n.prototype.add=function(e,t){var n=this.config,r=this.renderedCategories,o=e.get("attributes"),i=new ri({model:e,attributes:o},n).render().el,a=e.parent.initCategory(e);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))}t?t.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(e){var t=this.getBlocksEl();t&&t.appendChild(e)},n.prototype.render=function(){var e=this,t=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(t){return e.add(t,n)})),this.append(n);var r="".concat(this.blockContClass,"s ").concat(t,"one-bg ").concat(t,"two-color");return this.$el.addClass(r),this.rendered=!0,this},n}(l.G7);const di=ui;var pi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fi=function(){return fi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fi.apply(this,arguments)},hi=function(t){function n(n){var r,o=t.call(this,n,"BlockManager",new Qo((null===(r=n.config.blockManager)||void 0===r?void 0:r.blocks)||[],{em:n}),ei,Yo)||this;return o.events=ei,o.Block=Zo,o.Blocks=Qo,o.Category=Et,o.Categories=Dt,o.storageKey="",o.blocks=o.all,o.blocksVisible=new Qo(o.blocks.models,{em:n}),o.categories=new Dt,o.blocks.on("add",(function(e){return o.blocksVisible.add(e)})),o.blocks.on("remove",(function(e){return o.blocksVisible.remove(e)})),o.blocks.on("reset",(function(e){return o.blocksVisible.reset(e.models)})),o.__onAllEvent=(0,e.debounce)((function(){return o.__trgCustom()}),0),o}return pi(n,t),n.prototype.__trgCustom=function(){this.em.trigger(this.events.custom,this.__customData())},n.prototype.__customData=function(){var e=this,t=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:t.container,dragStart:function(t,n){return e.startDrag(t,n)},drag:function(t){return e.__drag(t)},dragStop:function(t){return e.endDrag(t)}}},n.prototype.__startDrag=function(e,t){var n=this,r=n.em,o=n.events,i=n.blocks,a=e.getContent?e.getContent():e;this._dragBlock=e,r.set({dragResult:null,dragContent:a}),[r,i].map((function(n){return n.trigger(o.dragStart,e,t)}))},n.prototype.__drag=function(e){var t=this,n=t.em,r=t.events,o=t.blocks,i=this._dragBlock;[n,o].map((function(t){return t.trigger(r.drag,i,e)}))},n.prototype.__endDrag=function(t){void 0===t&&(t={});var n=this,r=n.em,o=n.events,i=n.blocks,a=this._dragBlock,s=t.component||r.get("dragResult");if(delete this._dragBlock,s&&a){var l="activeOnRender",c=s.get&&s.get(l),u=a.get("activate")||c,d=a.get("select"),p=(0,e.isArray)(s)?s[0]:s;(d||u&&!1!==d)&&r.setSelected(p),u&&(p.trigger("active"),c&&p.unset(l)),a.get("resetId")&&p.onAll((function(e){return e.resetId()}))}r.set({dragResult:null,dragContent:null}),a&&[r,i].map((function(e){return e.trigger(o.dragEnd,s,a)}))},n.prototype.__getFrameViews=function(){return this.em.Canvas.getFrames().map((function(e){return e.view})).filter(Boolean)},n.prototype.__behaviour=function(e){return void 0===e&&(e={}),this._bhv=fi(fi({},this._bhv||{}),e)},n.prototype.__getBehaviour=function(){return this._bhv||{}},n.prototype.startDrag=function(e,t){this.__startDrag(e,t),this.__getFrameViews().forEach((function(e){var t;return null===(t=e.droppable)||void 0===t?void 0:t.startCustom()}))},n.prototype.endDrag=function(e){this.__getFrameViews().forEach((function(t){var n;return null===(n=t.droppable)||void 0===n?void 0:n.endCustom(e)})),this.__endDrag()},n.prototype.postRender=function(){var e=this,t=e.categories,n=e.config,r=e.em,o=this.blocksVisible;this.blocksView=new di({collection:o,categories:t},fi(fi({},n),{em:r})),this.__appendTo(o.models),this.__trgCustom()},n.prototype.add=function(e,t,n){void 0===n&&(n={});var r=t||{};return r.id=e,this.blocks.add(r,n)},n.prototype.get=function(e){return this.blocks.get(e)},n.prototype.getAll=function(){return this.blocks},n.prototype.getAllVisible=function(){return this.blocksVisible},n.prototype.remove=function(e,t){return void 0===t&&(t={}),this.__remove(e,t)},n.prototype.getCategories=function(){return this.categories},n.prototype.getContainer=function(){var e;return null===(e=this.blocksView)||void 0===e?void 0:e.el},n.prototype.getDragBlock=function(){return this._dragBlock},n.prototype.getBlocksByCategory=function(e){return Ot(e||this.getAll().models)},n.prototype.render=function(e,t){void 0===t&&(t={});var n=this,r=n.categories,o=n.config,i=n.em,a=e||this.getAll().models;if(t.external){var s=new Qo(a,{em:i});return new di({collection:s,categories:r},fi(fi({em:i},o),t)).render().el}return this.blocksView&&(this.blocksView.updateConfig(t),this.blocksView.collection.reset(a),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=!0)),this.getContainer()},n.prototype.destroy=function(){var e,t=[this.blocks,this.blocksVisible,this.categories];t.map((function(e){return e.stopListening()})),t.map((function(e){return e.reset()})),null===(e=this.blocksView)||void 0===e||e.remove()},n}(m);const gi=hi;const mi={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 vi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vi(t,e),t.prototype.defaults=function(){return{name:"",label:""}},t.prototype.getName=function(){return this.get("name")},t.prototype.getLabel=function(){return this.get("label")||this.getName()},t}(l.Hn);const bi=yi;yi.prototype.idAttribute="name";var wi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xi="contentEditable",Ci=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this,r=t.config||{};return n.config=r,n.module=t.module,n.coll=t.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(t,e),t.prototype.template=function(){var e,t,r=this,o=r.pfx,i=r.model,a=r.config,s=i.get("label")||"";return n(_i||(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 "],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 "],Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,_i=e),o,o,o,s,o,o,a.iconTagRemove)},t.prototype.events=function(){return{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"}},t.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},t.prototype.startEditTag=function(){var e=this.em,t=this.getInputEl();t[xi]="true",t.focus(),null==e||e.setEditing(!0)},t.prototype.endEditTag=function(){var e=this.model,t=this.em,n=this.getInputEl(),r=n.textContent||"",o=null==t?void 0:t.Selectors;n[xi]="false",null==t||t.setEditing(!1),o&&o.rename(e,r)!==e&&(n.innerText=e.getLabel())},t.prototype.changeStatus=function(){var e=this.model;e.set("active",!e.getActive())},t.prototype.removeTag=function(){this.module.removeSelected(this.model)},t.prototype.updateStatus=function(){var e=this,t=e.model,n=e.$el,r=e.config,o=r.iconTagOn,i=r.iconTagOff,a=n.find("[data-tag-status]");t.get("active")?(a.html(o),n.removeClass("opac50")):(a.html(i),n.addClass("opac50"))},t.prototype.render=function(){var e=this,t=e.pfx,n=e.ppfx,r=e.$el,o=e.model,i="".concat(t,"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},t}(l.G7);const Si=Ci;var _i,Ei=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ki=function(t){function r(n){void 0===n&&(n={});var r=t.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,e.debounce)(r.componentChanged.bind(r),0),r.checkSync=(0,e.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,e.debounce)((function(){return r.renderStates()}),0)),r.delegateEvents(),r}return Ei(r,t),r.prototype.template=function(e){var t=e.labelInfo,r=e.labelHead,o=e.iconSync,i=e.iconAdd,a=e.pfx,s=e.ppfx;return n(Pi||(Pi=Oi([' <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,t,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 e,t=this.em,n=this.getTarget(),r=t.Css,o=this.getCommonSelectors({opts:{noDisabled:1}}),i=t.get("state"),a=t.getCurrentMedia(),s=[],l=r.get(o,i,a)||r.add(o,i,a);this.getTargets().forEach((function(t){var n=r.getIdRule(t.getId(),{state:i,mediaText:a});e=n.getStyle(),n.setStyle({}),s.push(n)})),e&&l.addStyle(e),t.trigger("component:toggled"),t.trigger("component:sync-style",{component:n,selectors:o,mediaText:a,rule:l,ruleComponents:s,state:i})},r.prototype.tagRemoved=function(e){this.updateStateVis()},r.prototype.addNew=function(e){this.addToClasses(e)},r.prototype.startNewTag=function(){var e,t;null===(e=this.$addBtn)||void 0===e||e.css({display:"none"}),null===(t=this.$input)||void 0===t||t.show().focus()},r.prototype.endNewTag=function(){var e,t;null===(e=this.$addBtn)||void 0===e||e.css({display:""}),null===(t=this.$input)||void 0===t||t.hide().val("")},r.prototype.onInputKeyUp=function(e){var t;13===e.keyCode?(e.preventDefault(),this.addNewTag(null===(t=this.$input)||void 0===t?void 0:t.val())):27===e.keyCode&&this.endNewTag()},r.prototype.checkStates=function(){var e=this.em.getState(),t=this.getStates();t&&t.val(e)},r.prototype.componentChanged=function(e){var t=(void 0===e?{}:e).targets;this.updateSelection(t)},r.prototype.updateSelection=function(t){var n=t||this.getTargets(),r=[];return(n=(0,e.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(e){var t=void 0===e?{}:e,n=t.targets,r=t.opts,o=void 0===r?{}:r,i=n||this.getTargets();return this.module.__getCommonSelectors(i,o)},r.prototype._commonSelectors=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this.module).__common.apply(e,t)},r.prototype.checkSync=function(){var t,n=this,r=n.$btnSyncEl,o=n.config,i=n.collection,a=this.getTarget();if(a&&o.componentFirst&&i.length){var s=a.getStyle();t=!(0,e.isEmpty)(s)}r&&r[t?"show":"hide"]()},r.prototype.getTarget=function(){return this.target.getSelected()},r.prototype.getTargets=function(){return this.target.getSelectedAll()},r.prototype.updateStateVis=function(e){var t=this.em,n=t&&t.getConfig().avoidInlineStyle,r=this.collection.length||n?"":"none";this.getStatesC().css("display",r),this.updateSelector(e)},r.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},r.prototype.updateSelector=function(t){var n=this,r=this.el.querySelector("[data-selected]"),o=[],i=t||this.getTargets();(i=(0,e.isArray)(i)?i:[i]).forEach((function(e){return o.push(n.__getName(e))})),r&&(r.innerHTML=o.join(", ")),this.checkStates()},r.prototype.__getName=function(t){var r,o=this,i=o.pfx,a=o.config,s=o.em,l=a.selectedName,c=a.componentFirst;if((0,e.isString)(t))r=n(Mi||(Mi=Oi(['<span class="','sel-gen">',"</span>"],['<span class="','sel-gen">',"</span>"])),i,t);else{var u=null==t?void 0:t.getSelectors();if(!u)return"";var d=u.getStyleable(),p=s.get("state"),f=t.getId?n(Ai||(Ai=Oi(['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"],['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"])),i,t.getName(),i,t.getId()):"";r=(r=this.collection.getFullString(d))?n(Di||(Di=Oi(['<span class="','sel-rule">',"</span>"],['<span class="','sel-rule">',"</span>"])),i,r):t.get("selectorsAdd")||f,r=c&&f?f:r,r+=p?n(Ni||(Ni=Oi(['<span class="','sel-state">:',"</span>"],['<span class="','sel-state">:',"</span>"])),i,p):"",r=l?l({result:r,state:p,target:t}):r}return r&&'<span class="'.concat(i,'sel">').concat(r,"</span>")},r.prototype.stateChanged=function(e){var t=this.em,n=e.target.value;t.set("state",n)},r.prototype.addNewTag=function(e){var t=e.trim();t&&(this.module.addSelected({label:t}),this.endNewTag())},r.prototype.addToClasses=function(e,t){var n=t,r=this.getClasses(),o=new Si({model:e,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 e=this,t=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return e.addToClasses(n,t)})),n.append(t)},r.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},r.prototype.getStates=function(){if(!this.$states){var e=this.$el.find("[data-states]");this.$states=e[0]&&e}return this.$states},r.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},r.prototype.renderStates=function(){var e=this.module,t=this.em,n=t.t("selectorManager.emptyState"),r=e.getStates().map((function(e){var n=t.t("selectorManager.states.".concat(e.id))||e.getLabel()||e.id;return'<option value="'.concat(e.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 e=this,t=e.em,n=e.pfx,r=e.ppfx,o=e.config,i=e.$el,a=e.el,s=o.render,l={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:t.t("selectorManager.label"),labelInfo:t.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 Pi,Mi,Ai,Di,Ni,Ri=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ji=function(){return ji=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ji.apply(this,arguments)},Ii=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Li=function(t){return(0,e.isString)(t)&&"#"==t[0]},Fi=function(t){return(0,e.isString)(t)&&"."==t[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},Yi=function(n){function r(t){var r=n.call(this,t,"SelectorManager",new Ct([]),Gi,mi,{skipListen:!0})||this;r.Selector=yt,r.Selectors=Ct,r.storageKey="",(0,e.bindAll)(r,"__updateSelectedByComponents");var o=r.config,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),r.all=new Ct(o.selectors),r.selected=new Ct([],{em:t,config:o}),r.states=new l.FE(o.states.map((function(e){return new bi(e)})),{model:bi}),r.model=new l.Hn({cFirst:o.componentFirst,_undo:!0}),r.__update=(0,e.debounce)((function(){return r.__trgCustom()}),0),r.__initListen({collections:[r.states,r.selected],propagate:[{entity:r.states,event:r.events.state}]}),t.on("change:state",(function(e,n){return t.trigger(qi,n)})),r.model.on("change:cFirst",(function(e,n){return t.trigger("selector:type",n)})),t.on("component:toggled component:update:classes",r.__updateSelectedByComponents);return r.model.listenTo(t,"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(e){this.em.trigger(this.events.custom,this.__customData(e))},r.prototype.getAll=function(e){return void 0===e&&(e={}),this.all?e.array?Ii([],this.all.models,!0):this.all:[]},r.prototype.__customData=function(e){return void 0===e&&(e={}),this.__ctn=this.__ctn||e.container,{states:this.getStates(),selected:this.getSelected(),container:this.__ctn}},r.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},r.prototype.select=function(e,n){void 0===n&&(n={});var r=Array.isArray(e)?e:[e],o=this.em.Styles.select(r,n);this.selected.reset(this.__getCommonSelectors(o));var i=this.selectorTags,a=o.filter((function(e){return e})).map((function(e){return(0,t.isComponent)(e)||(0,t.isRule)(e)&&!e.get("selectorsAdd")?e:e.getSelectorsString()}));return i&&i.componentChanged({targets:a}),this},r.prototype.addSelector=function(t,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=ji({},n);(0,e.isObject)(t)?o=t:o.name=t,Li(o.name)?(o.name=o.name.substr(1),o.type=yt.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 yt?o:new yt(o,ji(ji({},r),{config:a,em:l}));return s.add(u,r)}return c},r.prototype.getSelector=function(e,t){return void 0===t&&(t=yt.TYPE_CLASS),Li(e)?(e=e.substr(1),t=yt.TYPE_ID):Fi(e)&&(e=e.substr(1)),this.all.where({name:e,type:t})[0]},r.prototype.add=function(t,n){var r=this;void 0===n&&(n={});var o=(0,e.isString)(t)?{}:n;return(0,e.isArray)(t)?t.map((function(e){return r.addSelector(e,n,o)})):this.addSelector(t,n,o)},r.prototype.addClass=function(t){var n=this,r=[];return(0,e.isString)(t)&&(t=t.trim().split(" ")),t.forEach((function(e){return r.push(n.addSelector(e))})),r},r.prototype.get=function(t,n){var r=this;if((0,e.isArray)(t)){var o=[];return t.map((function(e){return r.getSelector(e)})).filter(Boolean).forEach((function(e){return o.indexOf(e)<0&&o.push(e)})),o}return this.getSelector(t,n)},r.prototype.remove=function(e,t){return this.__remove(e,t)},r.prototype.rename=function(e,t,n){var r=this.escapeName(t);return this.get(r)||e.set({name:r,label:t},n)},r.prototype.setState=function(e){return this.em.setState(e),this},r.prototype.getState=function(){return this.em.getState()},r.prototype.getStates=function(){return Ii([],this.states.models,!0)},r.prototype.setStates=function(e,t){return this.states.reset(e.map((function(e){return new bi(e)})),t)},r.prototype.getSelected=function(){return this.__getCommon()},r.prototype.getSelectedAll=function(){return Ii([],this.selected.models,!0)},r.prototype.addSelected=function(e){var t=this.add(e);this.em.getSelectedAll().forEach((function(e){e.getSelectors().add(t)}))},r.prototype.removeSelected=function(e){this.em.getSelectedAll().forEach((function(t){!e.get("protected")&&t&&t.getSelectors().remove(e)}))},r.prototype.duplicateSelected=function(e,t){var n=this;void 0===t&&(t={});var r=this.em,o=this.getSelected();if(!(o.indexOf(e)<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(e)){var i=t.suffix||" copy",a=e.getLabel(),s=n.addSelector("".concat(a).concat(i)),l=o.indexOf(e);o.remove(e),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(e){this.getConfig().componentFirst=e,this.model.set({cFirst:e})},r.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},r.prototype.escapeName=function(e){var t=this.getConfig().escapeName;return t?t(e):yt.escapeName(e)},r.prototype.render=function(e){var t=this.selectorTags,n=this.getConfig(),r=null==t?void 0:t.el;return this.selected.reset(e),this.selectorTags=new Ti({el:r,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},r.prototype.destroy=function(){var e=this.selectorTags;this.model.stopListening(),this.__update.cancel(),this.__destroy(),null==e||e.remove(),this.selectorTags=void 0},r.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},r.prototype.__getCommonSelectors=function(e,t){void 0===t&&(t={});var n=e.map((function(e){return e.getSelectors&&e.getSelectors().getValid(t)})).filter(Boolean);return this.__common.apply(this,n)},r.prototype.__common=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length?1===t.length?t[0]:2===t.length?t[0].filter((function(e){return t[1].indexOf(e)>=0})):t.slice(1).reduce((function(t,n){return e.__common(t,n)}),t[0]):[]},r.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},r}(m);const Ki=Yi;const Zi={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 Xi,Ji=5,Qi=6,ea=7,ta=11,na=12,ra=13,oa=14,ia=15,aa=((Xi={})[4]="media",Xi[Ji]="font-face",Xi[Qi]="page",Xi[ea]="keyframes",Xi[ta]="counter-style",Xi[na]="supports",Xi[ra]="document",Xi[oa]="font-feature-values",Xi[ia]="viewport",Xi),sa=(0,e.keys)(aa),la=[Ji,Qi,ta,ia],ca=sa.filter((function(e){return la.indexOf(Number(e))<0})).map((function(e){return aa[e]})).concat(["container","layer"]),ua=la.map((function(e){return aa[e]})),da=function(e){void 0===e&&(e="");for(var t=[],n=[],r=e.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 t.push(a)}return{result:n,add:t}},pa=function(e){for(var t=e.style,n={},r=0,o=t.length;r<o;r++){var i=t[r],a=t.getPropertyValue(i),s=t.getPropertyPriority(i);n[i]="".concat(a).concat(s?" !".concat(s):"")}return n},fa=function(e){return(e.conditionText||e.media&&e.media.mediaText||e.name||e.selectorText||"").trim()},ha=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var r={},o=e.length,i=e[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&&(e[o-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=e,r.style=t,r},ga=function(e){var t=e.cssText,n=void 0===t?"":t;return ca.find((function(e){return 0===n.indexOf("@".concat(e))}))},ma=function(e){for(var t=[],n=e.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||"",d=la.indexOf(a)>=0;if(d)s=!0,l=aa[a],c=fa(i);else if(sa.indexOf("".concat(a))>=0||!a&&ga(i)){var p=ma(i),f=aa[a]||ga(i);c=fa(i);for(var h=0,g=p.length;h<g;h++){var m=p[h];c&&(m.mediaText=c),m.atRuleType=f}t=t.concat(p)}if(u||d){for(var v=pa(i),y=da(u),b=y.add,w=y.result,x=void 0,C=0,S=w.length;C<S;C++){var _=ha(w[C],v,{atRule:aa[a]});t.push(_),x=_}if(b.length){var E=b.join(", ");if(x)x.selectorsAdd=E;else{_={selectors:[],selectorsAdd:E,style:v};s&&(_.singleAtRule=s),l&&(_.atRuleType=l),c&&(_.mediaText=c),t.push(_)}}}}return t};const va=function(t,n){return void 0===n&&(n={}),{parse:function(e){var r=this,o=[],i=n.parserCss,a=null==t?void 0:t.Editor,s=i?i(e,a):function(e){var t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t);var n=t.sheet;return document.head.removeChild(t),n?ma(n):[]}(e);return s.forEach((function(e){return o=o.concat(r.checkNode(e))})),null==t||t.trigger("parse:css",{input:e,output:o,nodes:s}),o},checkNode:function(t){var n=t.selectors,r=t.style,o=[t];if((0,e.isString)(n)){var i=[],a=t,s=da(n),l=s.result,c=s.add.join(", "),u={atRule:a.atRule,mediaText:a.params};if(l.length?l.forEach((function(e){i.push(ha(e,r,u))})):i.push(ha([],r,u)),c)i[i.length-1].selectorsAdd=c;o=i}return o}}};var ya=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ba=function(e){function t(t){var n=e.call(this,t,"Parser",Zi)||this,r=n.config;return n.parserCss=va(t,r),n.parserHtml=tt(t,r),n}return ya(t,e),t.prototype.parseHtml=function(e,t){void 0===t&&(t={});var n=this.em,r=this.parserHtml;return r.compTypes=n.Components.getTypes()||{},r.parse(e,this.parserCss,t)},t.prototype.parseCss=function(e){return this.parserCss.parse(e)},t.prototype.destroy=function(){},t}(g);const wa=ba;const xa={id:"gjs-",type:"local",autosave:!0,autoload:!0,stepsBeforeSave:1,recovery:!1,onStore:function(e){return e},onLoad:function(e){return e},options:{local:{key:"gjsProject",checkLocal:!0},remote:{headers:{},urlStore:"",urlLoad:"",contentTypeJson:!0,fetchOptions:"",credentials:"include",onStore:function(e){return e},onLoad:function(e){return e}}}};var Ca=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Sa=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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 _a=function(){function e(){}return e.prototype.store=function(e,t){return void 0===t&&(t={}),Ca(this,void 0,void 0,(function(){return Sa(this,(function(n){return this.hasLocal(t,!0)&&localStorage.setItem(t.key,JSON.stringify(e)),[2,e]}))}))},e.prototype.load=function(e){return void 0===e&&(e={}),Ca(this,void 0,void 0,(function(){var t;return Sa(this,(function(n){return t={},this.hasLocal(e,!0)&&(t=JSON.parse(localStorage.getItem(e.key)||"{}")),[2,t]}))}))},e.prototype.hasLocal=function(e,n){if(void 0===e&&(e={}),e.checkLocal&&(!(0,t.hasWin)()||!localStorage)){if(n)throw new Error("localStorage not available");return!1}return!0},e}();function Ea(e){return Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ea(e)}const Oa=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))};const ka=function(e){return new this((function(t,n){if(!e||void 0===e.length)return n(new TypeError(Ea(e)+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,n){if(n&&("object"===Ea(n)||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(t){i(e,t)}),(function(n){r[e]={status:"rejected",reason:n},0==--o&&t(r)}))}r[e]={status:"fulfilled",value:n},0==--o&&t(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))};function Ta(e,t){this.name="AggregateError",this.errors=e,this.message=t||""}Ta.prototype=Error.prototype;const Pa=function(e){var t=this;return new t((function(n,r){if(!e||void 0===e.length)return r(new TypeError("Promise.any accepts an array"));var o=Array.prototype.slice.call(e);if(0===o.length)return r();for(var i=[],a=0;a<o.length;a++)try{t.resolve(o[a]).then(n).catch((function(e){i.push(e),i.length===o.length&&r(new Ta(i,"All promises were rejected"))}))}catch(e){r(e)}}))};var Ma=setTimeout;function Aa(e){return Boolean(e&&void 0!==e.length)}function Da(){}function Na(e){if(!(this instanceof Na))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Va(e,this)}function Ra(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Na._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void Ia(t.promise,e)}ja(t.promise,r)}else(1===e._state?ja:Ia)(t.promise,e._value)}))):e._deferreds.push(t)}function ja(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===Ea(t)||"function"==typeof t)){var n=t.then;if(t instanceof Na)return e._state=3,e._value=t,void La(e);if("function"==typeof n)return void Va((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,La(e)}catch(t){Ia(e,t)}var r,o}function Ia(e,t){e._state=2,e._value=t,La(e)}function La(e){2===e._state&&0===e._deferreds.length&&Na._immediateFn((function(){e._handled||Na._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)Ra(e,e._deferreds[t]);e._deferreds=null}function Fa(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Va(e,t){var n=!1;try{e((function(e){n||(n=!0,ja(t,e))}),(function(e){n||(n=!0,Ia(t,e))}))}catch(e){if(n)return;n=!0,Ia(t,e)}}Na.prototype.catch=function(e){return this.then(null,e)},Na.prototype.then=function(e,t){var n=new this.constructor(Da);return Ra(this,new Fa(e,t,n)),n},Na.prototype.finally=Oa,Na.all=function(e){return new Na((function(t,n){if(!Aa(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"===Ea(a)||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){i(e,t)}),n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])}))},Na.any=Pa,Na.allSettled=ka,Na.resolve=function(e){return e&&"object"===Ea(e)&&e.constructor===Na?e:new Na((function(t){t(e)}))},Na.reject=function(e){return new Na((function(t,n){n(e)}))},Na.race=function(e){return new Na((function(t,n){if(!Aa(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)Na.resolve(e[r]).then(t,n)}))},Na._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Ma(e,0)},Na._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const Ba=Na;(0,t.hasWin)()&&(window.Promise=window.Promise||Ba);const za="function"==typeof fetch?fetch.bind():function(e,t){return new Ba((function(n,r){var o=new XMLHttpRequest;for(var i in o.open(t.method||"get",e),o.withCredentials="include"==t.credentials,t.headers||{})o.setRequestHeader(i,t.headers[i]);o.onload=function(e){return n({status:o.status,statusText:o.statusText,text:function(){return Ba.resolve(o.responseText)}})},o.onerror=r,o.upload&&t.onProgress&&(o.upload.onprogress=t.onProgress),t.body?o.send(t.body):o.send()}))};var Ha=function(){return Ha=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ha.apply(this,arguments)},$a=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Wa=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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 t(){}return t.prototype.store=function(e,t){return void 0===t&&(t={}),$a(this,void 0,void 0,(function(){return Wa(this,(function(n){switch(n.label){case 0:return[4,this.request(t.urlStore,this.__props(t,e),t)];case 1:return[2,n.sent()]}}))}))},t.prototype.load=function(e){return void 0===e&&(e={}),$a(this,void 0,void 0,(function(){return Wa(this,(function(t){switch(t.label){case 0:return[4,this.request(e.urlLoad,this.__props(e),e)];case 1:return[2,t.sent()]}}))}))},t.prototype.request=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),za(t,n).then((function(e){var t=e.text();return 1==(e.status/200|0)?t:t.then(Promise.reject)})).then((function(t){var n=t&&(0,e.isString)(t);return r.contentTypeJson&&n?JSON.parse(t):t}))},t.prototype.__props=function(t,n){void 0===t&&(t={});var r,o=t.contentTypeJson,i=t.headers||{},a=t.fetchOptions||{},s="X-Requested-With",l="Content-Type";if((0,e.isUndefined)(i[s])&&(i[s]="XMLHttpRequest"),(0,e.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:t.credentials,headers:i,body:r};return Ha(Ha({},u),(0,e.isFunction)(a)?a(u):a)},t}();const qa=Ua;var Ga;!function(e){e.start="storage:start",e.startStore="storage:start:store",e.startLoad="storage:start:load",e.load="storage:load",e.store="storage:store",e.after="storage:after",e.afterStore="storage:after:store",e.afterLoad="storage:after:load",e.end="storage:end",e.endStore="storage:end:store",e.endLoad="storage:end:load",e.error="storage:error",e.errorStore="storage:error:store",e.errorLoad="storage:error:load"}(Ga||(Ga={}));const Ya=Ga;var Ka=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Za=function(){return Za=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Za.apply(this,arguments)},Xa=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Ja=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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",es="remote",ts=function(t){function n(e){var n=t.call(this,e,"StorageManager",xa)||this;n.storages={},n.events=Ya;var r=n.config;return r._disable&&(r.type=void 0),n.storages={},n.add(Qa,new _a),n.add(es,new qa),n.setCurrent(r.type),n}return Ka(n,t),n.prototype.isAutosave=function(){return!!this.config.autosave},n.prototype.setAutosave=function(e){return this.config.autosave=!!e,this},n.prototype.getStepsBeforeSave=function(){return this.config.stepsBeforeSave},n.prototype.setStepsBeforeSave=function(e){return this.config.stepsBeforeSave=e,this},n.prototype.add=function(e,t){return this.storages[e]=t,this},n.prototype.get=function(e){return this.storages[e]},n.prototype.getStorages=function(){return this.storages},n.prototype.getCurrent=function(){return this.config.currentStorage},n.prototype.setCurrent=function(e){return this.getConfig().currentStorage=e,this},n.prototype.getCurrentStorage=function(){return this.get(this.getCurrent())},n.prototype.getStorageOptions=function(e){return this.getCurrentOptions(e)},n.prototype.store=function(e,t){return void 0===t&&(t={}),Xa(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=Za(Za({},this.getCurrentOptions()),t),o=this.getRecoveryStorage(),i=this.getCurrentOptions(Qa),s.label=1;case 1:return s.trys.push([1,5,,9]),[4,this.__exec(n,r,e)];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,e)]:[3,7];case 6:return s.sent(),[3,8];case 7:throw a;case 8:return[3,9];case 9:return[2,e]}}))}))},n.prototype.load=function(t){return void 0===t&&(t={}),Xa(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=Za(Za({},this.getCurrentOptions()),t),(o=this.getRecoveryStorage())?[4,this.__exec(o,this.getCurrentOptions(Qa))]:[3,5];case 1:if(a=s.sent(),(0,e.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 t=this.em,n=this.getRecovery();return new Promise((function(r,o){(0,e.isFunction)(n)?n(r,o,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t("storageManager.recover"))?r(null):o()}))},n.prototype.getRecovery=function(){return this.config.recovery},n.prototype.getRecoveryStorage=function(){return this.getRecovery()&&this.getCurrent()===es&&this.get(Qa)},n.prototype.__exec=function(e,t,n){var r;return Xa(this,void 0,void 0,(function(){var o,i,a,s,l,c,u,d,p,f,h,g,m;return Ja(this,(function(v){switch(v.label){case 0:if(o=n?"store":"load",i=this.getConfig(),a=i.onStore,s=i.onLoad,this.onStart(o,n),!e)return[2,n||{}];v.label=1;case 1:return v.trys.push([1,14,,15]),c=null===(r=this.em)||void 0===r?void 0:r.getEditor(),u=void 0,n?(p=a)?[4,a(n,c)]:[3,3]:[3,7];case 2:p=v.sent(),v.label=3;case 3:return d=p||n,(f=t.onStore)?[4,t.onStore(d,c)]:[3,5];case 4:f=v.sent(),v.label=5;case 5:return d=f||d,[4,e.store(d,t)];case 6:return u=v.sent(),l=n,[3,13];case 7:return[4,e.load(t)];case 8:return u=v.sent(),l=this.__clearKeys(u),(h=t.onLoad)?[4,t.onLoad(l,c)]:[3,10];case 9:h=v.sent(),v.label=10;case 10:return l=h||l,(g=s)?[4,s(l,c)]:[3,12];case 11:g=v.sent(),v.label=12;case 12:l=g||l,v.label=13;case 13:return this.onAfter(o,l,u),this.onEnd(o,l,u),[3,15];case 14:throw m=v.sent(),this.onError(o,m),m;case 15:return[2,l]}}))}))},n.prototype.__clearKeys=function(e){void 0===e&&(e={});var t=this.getConfig(),n=new RegExp("^".concat(t.id)),r={};for(var o in e){r[o.replace(n,"")]=e[o]}return r},n.prototype.getCurrentOptions=function(e){var t=this.getConfig(),n=e||this.getCurrent();return t.options[n]||{}},n.prototype.onStart=function(e,t){var n=this.em;if(n){var r="load"===e?Ya.startLoad:Ya.startStore;n.trigger(Ya.start,e,t),n.trigger(r,t)}},n.prototype.onAfter=function(e,t,n){var r=this.em;if(r){var o="load"===e?Ya.afterLoad:Ya.afterStore;r.trigger(Ya.after),r.trigger(o,t,n);var i="load"===e?Ya.load:Ya.store;r.trigger(i,t,n)}},n.prototype.onEnd=function(e,t,n){var r=this.em;if(r){var o="load"===e?Ya.endLoad:Ya.endStore;r.trigger(Ya.end,e,t,n),r.trigger(o,t,n)}},n.prototype.onError=function(e,t){var n=this.em;if(n){var r="load"===e?Ya.errorLoad:Ya.errorStore;n.trigger(Ya.error,t,e),n.trigger(r,t),this.onEnd(e,t)}},n.prototype.canAutoload=function(){return!!this.getCurrentStorage()&&!!this.config.autoload},n.prototype.destroy=function(){this.storages={}},n}(g);const ns=ts;const rs={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}],custom:!1};var os=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},is.apply(this,arguments)},as=function(n){function r(e){void 0===e&&(e={});var t=n.call(this,e)||this;t.events={},t.appendInput=!0;var r=e.config,o=void 0===r?{}:r,i=t,a=i.model,s=i.eventCapture,l=a.target,c=a.attributes.type;return t.config=o,t.em=o.em,t.pfx=o.stylePrefix||"",t.ppfx=o.pStylePrefix||"",t.target=l,t.className=t.pfx+"trait",t.clsField="".concat(t.ppfx,"field ").concat(t.ppfx,"field-").concat(c),[["change:value",t.onValueChange],["remove",t.removeView]].forEach((function(e){var n=e[0],r=e[1];a.off(n,r),t.listenTo(a,n,r)})),a.view=t,t.listenTo(a,"change:label",t.render),t.listenTo(a,"change:placeholder",t.rerender),t.events={},s.forEach((function(e){return t.events[e]="onChange"})),t.delegateEvents(),t.init(),t}return os(r,n),r.prototype.attributes=function(){return this.model.get("attributes")||{}},r.prototype.templateLabel=function(e){var t=this.ppfx,n=this.getLabel();return'<div class="'.concat(t,'label" title="').concat(n,'">').concat(n,"</div>")},r.prototype.templateInput=function(e){var t=this.clsField;return'<div class="'.concat(t,'" 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(e){},r.prototype.onUpdate=function(e){},r.prototype.onEvent=function(e){},r.prototype.onChange=function(t){var n=this.getInputElem();n&&!(0,e.isUndefined)(n.value)&&this.model.set("value",n.value),this.onEvent(is(is({},this.getClbOpts()),{event:t}))},r.prototype.getValueForTarget=function(){return this.model.get("value")},r.prototype.setInputValue=function(e){var t=this.getInputElem();t&&(t.value=e)},r.prototype.onValueChange=function(e,t,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(e.get("value")),this.postUpdate();else{var r=this.getValueForTarget();e.setTargetValue(r,n)}},r.prototype.renderLabel=function(){var e=this.$el,t=this.target,n=this.getLabel(),r=this.templateLabel(t);this.createLabel&&(r=this.createLabel({label:n,component:t,trait:this})||""),e.find("[data-label]").append(r)},r.prototype.getLabel=function(){var e=this.em,n=this.model.attributes,r=n.label,o=n.name;return e.t("traitManager.traits.labels.".concat(o))||(0,t.capitalize)(r||o).replace(/-/g," ")},r.prototype.getComponent=function(){return this.target},r.prototype.getInputEl=function(){if(!this.$input){var t=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(),d=(0,a.default)('<input type="'.concat(s,'">')),p=t.t("traitManager.traits.attributes.".concat(o))||{};d.attr(is({placeholder:i},p)),(0,e.isUndefined)(u)||(r.set({value:u},{silent:!0}),d.prop("value",u)),l&&d.prop("min",l),c&&d.prop("max",c),this.$input=d}return this.$input.get(0)},r.prototype.getInputElem=function(){var e=this.input,t=this.$input;return e||t&&t.get&&t.get(0)||this.getElInput()},r.prototype.getModelValue=function(){return this.model.getValue()},r.prototype.getElInput=function(){return this.elInput},r.prototype.renderField=function(){var t=this,n=t.$el,r=t.appendInput,o=t.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,e.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 e=this.model.attributes.label;return!this.noLabel&&!1!==e},r.prototype.rerender=function(){delete this.model.el,this.render()},r.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},r.prototype.render=function(){var t=this,n=t.$el,r=t.pfx,o=t.ppfx,i=t.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,e.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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ls(t,e),t.prototype.templateInput=function(){return""},t.prototype.onChange=function(){this.handleClick()},t.prototype.handleClick=function(){this.model.runCommand()},t.prototype.renderLabel=function(){this.model.get("label")&&ss.prototype.renderLabel.apply(this)},t.prototype.getInputEl=function(){var e=this.model,t=this.ppfx,n=e.props(),r=n.labelButton,o=n.text,i=n.full,a=r||o,s="".concat(t,"btn");return'<button type="button" class="'.concat(s,"-prim").concat(i?" ".concat(s,"--full"):"",'">').concat(a,"</button>")},t}(ss);const us=cs;cs.prototype.eventCapture=["click button"];var ds=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ps=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.appendInput=!1,e}return ds(n,t),n.prototype.templateInput=function(){var e=this.ppfx,t=this.clsField;return'<label class="'.concat(t,'" data-input>\n <i class="').concat(e,'chk-icon"></i>\n </label>')},n.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},n.prototype.setInputValue=function(e){var t=this.getInputElem();t&&(t.checked=!!e)},n.prototype.getInputEl=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=!this.$input,o=ss.prototype.getInputEl.apply(this,t);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,e.isUndefined)(c)||a!==c||(i=!1),o.checked=i}return o},n}(ss);var fs=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hs=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this,r=t.ppfx||"";return n.opts=t,n.ppfx=r,n.em=t.target||{},!t.onChange&&n.listenTo(n.model,"change:value",n.handleModelChange),n}return fs(t,e),t.prototype.template=function(){return'<span class="'.concat(this.holderClass(),'"></span>')},t.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},t.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},t.prototype.elementUpdated=function(){this.model.trigger("el:change")},t.prototype.setValue=function(e,t){var n=this.model,r=e||n.get("defaults"),o=this.getInputEl();o&&(o.value=r)},t.prototype.handleModelChange=function(e,t,n){this.setValue(t,n)},t.prototype.handleChange=function(e){e.stopPropagation();var t=this.getInputEl().value;this.__onInputChange(t),this.elementUpdated()},t.prototype.__onInputChange=function(e){this.model.set({value:e},{fromInput:1})},t.prototype.getInputEl=function(){if(!this.inputEl){var e=this.model,t=this.opts.type||"text",n=e.get("placeholder")||e.get("defaults")||e.get("default")||"";this.inputEl=(0,a.default)('<input type="'.concat(t,'" placeholder="').concat(n,'">'))}return this.inputEl.get(0)},t.prototype.render=function(){this.inputEl=null;var e=this.$el;return e.addClass(this.inputClass()),e.html(this.template()),e.find(".".concat(this.holderClass())).append(this.getInputEl()),this},t}(l.G7);const gs=hs;hs.prototype.events={change:"handleChange"};var ms=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vs=function(){return vs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vs.apply(this,arguments)};a.default&&function(e,n){if((0,t.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 e(e,t){return!!~(""+e).indexOf(t)}var t=document.createElement("div").style;return t.cssText="background-color:rgba(0,0,0,.5)",e(t.backgroundColor,"rgba")||e(t.backgroundColor,"hsla")}(),s=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),l=function(){var e="";if(i)for(var t=1;t<=6;t++)e+="<div class='sp-"+t+"'></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>",e,"</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";e.fn.spectrum=function(t,n){if("string"==typeof t){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=o[e(this).data(c)];if(n){var a=n[t];if(!a)throw new Error("Spectrum: no such method: '"+t+"'");"get"==t?r=n.get():"container"==t?r=n.container:"option"==t?r=n.option.apply(n,i):"destroy"==t?(n.destroy(),e(this).removeData(c)):a.apply(n,i)}})),r}return this.spectrum("destroy").each((function(){var n=O(this,e.extend({},t,e(this).data()));e(this).data(c,n.id)}))},e.fn.spectrum.load=!0,e.fn.spectrum.loadOpts={},e.fn.spectrum.draggable=M,e.fn.spectrum.defaults=r,e.fn.spectrum.inputTypeColorSupport=function t(){if(void 0===t._cachedResult){var n=e("<input type='color'/>")[0];t._cachedResult="color"===n.type&&""!==n.value}return t._cachedResult},e.spectrum={},e.spectrum.localization={},e.spectrum.palettes={},e.fn.spectrum.processNativeColorInputs=function(){var t=e("input[type=color]");t.length&&!A()&&t.spectrum({preferredFormat:"hex6"})};var u=/^[\s,#]+/,d=/\s+$/,p=0,f=Math,h=f.round,g=f.min,m=f.max,v=f.random,y=function(e,t){if(t=t||{},(e=e||"")instanceof y)return e;if(!(this instanceof y))return new y(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(u,"").replace(d,"").toLowerCase();var t,n=!1;if(C[e])e=C[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=_.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=_.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=_.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=_.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=_.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=_.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=_.hex8.exec(e))return{a:te(t[1]),r:J(t[2]),g:J(t[3]),b:J(t[4]),format:n?"name":"hex8"};if(t=_.hex6.exec(e))return{r:J(t[1]),g:J(t[2]),b:J(t[3]),format:n?"name":"hex"};if(t=_.hex3.exec(e))return{r:J(t[1]+""+t[1]),g:J(t[2]+""+t[2]),b:J(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==typeof e&&(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")?(t=function(e,t,n){return{r:255*Z(e,255),g:255*Z(t,255),b:255*Z(n,255)}}(e.r,e.g,e.b),r=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")?(e.s=ee(e.s),e.v=ee(e.v),t=function(e,t,n){e=6*Z(e,360),t=Z(t,100),n=Z(n,100);var r=f.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6,c=[n,a,i,i,s,n][l],u=[s,n,n,a,i,i][l],d=[i,i,s,n,n,a][l];return{r:255*c,g:255*u,b:255*d}}(e.h,e.s,e.v),r=!0,o="hsv"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")&&(e.s=ee(e.s),e.l=ee(e.l),t=function(e,t,n){var r,o,i;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Z(e,360),t=Z(t,100),n=Z(n,100),0===t)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,e.s,e.l),r=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=K(n),{ok:r,format:e.format||o,r:g(255,m(t.r,0)),g:g(255,m(t.g,0)),b:g(255,m(t.b,0)),a:n}}(e);this._originalInput=e,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=t.format||n.format,this._gradientType=t.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=p++};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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},setAlpha:function(e){return this._a=K(e),this._roundA=h(100*this._a)/100,this},toHsv:function(){var e=N(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=N(this._r,this._g,this._b),t=h(360*e.h),n=h(100*e.s),r=h(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=D(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=D(this._r,this._g,this._b),t=h(360*e.h),n=h(100*e.s),r=h(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return R(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(){return j(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*Z(this._r,255))+"%",g:h(100*Z(this._g,255))+"%",b:h(100*Z(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+h(100*Z(this._r,255))+"%, "+h(100*Z(this._g,255))+"%, "+h(100*Z(this._b,255))+"%)":"rgba("+h(100*Z(this._r,255))+"%, "+h(100*Z(this._g,255))+"%, "+h(100*Z(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[R(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+j(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";e&&(n=y(e).toHex8String());return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));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(L,arguments)},greyscale:function(){return this._applyModification(F,arguments)},spin:function(){return this._applyModification(H,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(G,arguments)},complement:function(){return this._applyCombination($,arguments)},monochromatic:function(){return this._applyCombination(Y,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(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:ee(e[r]));e=n}return y(e,t)},y.equals=function(e,t){return!(!e||!t)&&y(e).toRgbString()==y(t).toRgbString()},y.random=function(){return y.fromRatio({r:v(),g:v(),b:v()})},y.mix=function(e,t,n){n=0===n?0:n||50;var r,o=y(e).toRgb(),i=y(t).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(e,t){var n=y(e),r=y(t),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(e,t){var n=y.readability(e,t);return n.brightness>125&&n.color>500},y.mostReadable=function(e,t){for(var n=null,r=0,o=!1,i=0;i<t.length;i++){var a=y.readability(e,t[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(t[i]))}return n};var b,w,x,C=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"},S=y.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(C),_=(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,e((function(){e.fn.spectrum.load&&e.fn.spectrum.processNativeColorInputs()}))}function E(t,n,r,o){for(var i=[],s=0;s<t.length;s++){var l=t[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 d=c.toString(o.preferredFormat||"rgb"),p=a?"background-color:"+c.toRgbString():"filter:"+c.toFilter();i.push('<span title="'+d+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+p+';"></span></span>')}else{i.push(e("<div />").append(e('<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 O(t,c){var u=function(t,n){var o=e.extend({},r,t);return o.callbacks={move:P(o.move,n),change:P(o.change,n),show:P(o.show,n),hide:P(o.hide,n),beforeShow:P(o.beforeShow,n)},o}(c,t),d=u.flat,p=u.showSelectionPalette,f=u.localStorageKey,h=u.theme,g=u.callbacks,m=function(e,t,n){var r;return function(){var o=this,i=arguments,a=function(){r=null,e.apply(o,i)};n&&clearTimeout(r),!n&&r||(r=setTimeout(a,t))}}(ze,10),v=!1,b=!1,w=!0,x=0,C=0,S=0,_=0,O=0,k=0,D=0,N=0,R=0,j=0,I=1,L=[],F=[],V={},B=u.selectionPalette.slice(0),z=u.maxSelectionSize,H="sp-dragging",$=null,W=t.ownerDocument;W.body;var U=e(t),q=!1,G=e(l,W).addClass(h),Y=G.find(".sp-picker-container"),K=G.find(".sp-color"),Z=G.find(".sp-dragger"),X=G.find(".sp-hue"),J=G.find(".sp-slider"),Q=G.find(".sp-alpha-inner"),ee=G.find(".sp-alpha"),te=G.find(".sp-alpha-handle"),ne=G.find(".sp-input"),re=G.find(".sp-palette"),oe=G.find(".sp-initial"),ie=G.find(".sp-cancel"),ae=G.find(".sp-clear"),se=G.find(".sp-choose"),le=G.find(".sp-palette-toggle"),ce=U.is("input"),ue=ce&&"color"===U.attr("type")&&A(),de=ce&&!d,pe=de?e(s).addClass(h).addClass(u.className).addClass(u.replacerClassName):e([]),fe=de?pe:U,he=pe.find(".sp-preview-inner"),ge=u.color||ce&&U.val(),me=!1,ve=u.preferredFormat,ye=!u.showButtons||u.clickoutFiresChange,be=!ge,we=u.allowEmpty&&!ue;function xe(){if(u.showPaletteOnly&&(u.showPalette=!0),le.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),u.palette){L=u.palette.slice(0),F=e.isArray(L[0])?L:[L],V={};for(var t=0;t<F.length;t++)for(var n=0;n<F[t].length;n++){var r=y(F[t][n]).toRgbString();V[r]=!0}}G.toggleClass("sp-flat",d),G.toggleClass("sp-input-disabled",!u.showInput),G.toggleClass("sp-alpha-enabled",u.showAlpha),G.toggleClass("sp-clear-enabled",we),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),ze()}function Ce(){if(f&&window.localStorage){try{var t=window.localStorage[f].split(",#");t.length>1&&(delete window.localStorage[f],e.each(t,(function(e,t){Se(t)})))}catch(e){}try{B=window.localStorage[f].split(";")}catch(e){}}}function Se(t){if(p){var n=y(t).toRgbString();if(!V[n]&&-1===e.inArray(n,B))for(B.push(n);B.length>z;)B.shift();if(f&&window.localStorage)try{window.localStorage[f]=B.join(";")}catch(e){}}}function _e(){var t=Ie(),n=e.map(F,(function(e,n){return E(e,t,"sp-palette-row sp-palette-row-"+n,u)}));Ce(),B&&n.push(E(function(){var e=[];if(u.showPalette)for(var t=0;t<B.length;t++){var n=y(B[t]).toRgbString();V[n]||e.push(B[t])}return e.reverse().slice(0,u.maxSelectionSize)}(),t,"sp-palette-row sp-palette-row-selection",u)),re.html(n.join(""))}function Ee(){if(u.showInitial){var e=me,t=Ie();oe.html(E([e,t],t,"sp-palette-row-initial",u))}}function Oe(){(C<=0||x<=0||_<=0)&&ze(),b=!0,G.addClass(H),$=null,U.trigger("dragstart.spectrum",[Ie()])}function ke(){b=!1,G.removeClass(H),U.trigger("dragstop.spectrum",[Ie()])}function Te(){var e=ne.val();if(null!==e&&""!==e||!we){var t=y(e);t.isValid()?(je(t),Be(!0)):ne.addClass("sp-validation-error")}else je(null),Be(!0)}function Pe(){v?Ne():Me()}function Me(){var t=e.Event("beforeShow.spectrum");if(v)ze();else if(U.trigger("beforeShow.spectrum",[Ie()]),!1!==g.beforeShow(Ie())&&!t.isDefaultPrevented()){!function(){for(var e=0;e<o.length;e++)o[e]&&o[e].hide()}(),v=!0;var n=e(W);n.bind("keydown.spectrum",Ae),n.bind("click.spectrum",De),e(window).bind("resize.spectrum",m),pe.addClass("sp-active"),G.removeClass("sp-hidden"),ze(),Fe(),me=Ie(),Ee(),g.show(me),U.trigger("show.spectrum",[me])}}function Ae(e){27===e.keyCode&&Ne()}function De(e){2!=e.button&&(b||(ye?Be(!0):Re(),Ne()))}function Ne(){v&&!d&&(v=!1,e(W).unbind("keydown.spectrum",Ae),e(W).unbind("click.spectrum",De),e(window).unbind("resize.spectrum",m),pe.removeClass("sp-active"),G.addClass("sp-hidden"),g.hide(Ie()),U.trigger("hide.spectrum",[Ie()]))}function Re(){je(me,!0)}function je(e,t){var n,r;y.equals(e,Ie())?Fe():(!e&&we?be=!0:(be=!1,w=!e,r=(n=y(e)).toHsv(),N=r.h%360/360,R=r.s,j=r.v,I=r.a),Fe(),n&&n.isValid()&&!t&&(ve=u.preferredFormat||n.getFormat()))}function Ie(e){return e=e||{},we&&be?null:y.fromRatio({h:N,s:R,v:j,a:Math.round(100*I)/100},{format:e.format||ve})}function Le(){Fe(),g.move(Ie()),U.trigger("move.spectrum",[Ie()])}function Fe(){ne.removeClass("sp-validation-error"),Ve();var e=y.fromRatio({h:N,s:1,v:1});K.css("background-color",e.toHexString());var t=ve;I<1&&(0!==I||"name"!==t)&&("hex"!==t&&"hex3"!==t&&"hex6"!==t&&"name"!==t||(t="rgb"));var n=Ie({format:t}),r="";if(he.removeClass("sp-clear-display"),he.css("background-color","transparent"),!n&&we)he.addClass("sp-clear-display");else{var o=n.toHexString(),s=n.toRgbString();if(a||1===n.alpha?he.css("background-color",s):(he.css("background-color","transparent"),he.css("filter",n.toFilter())),u.showAlpha){var l=n.toRgb();l.a=0;var c=y(l).toRgbString(),d="linear-gradient(left, "+c+", "+o+")";i?Q.css("filter",y(c).toFilter({gradientType:1},o)):(Q.css("background","-webkit-"+d),Q.css("background","-moz-"+d),Q.css("background","-ms-"+d),Q.css("background","linear-gradient(to right, "+c+", "+o+")"))}r=n.toString(t)}u.showInput&&ne.val(r),u.showPalette&&_e(),Ee()}function Ve(){var e=R,t=j;if(we&&be)te.hide(),J.hide(),Z.hide();else{te.show(),J.show(),Z.show();var n=e*x,r=C-t*C;n=Math.max(-S,Math.min(x-S,n-S)),r=Math.max(-S,Math.min(C-S,r-S)),Z.css({top:r+"px",left:n+"px"});var o=I*O;te.css({left:o-k/2+"px"});var i=N*_;J.css({top:i-D+"px"})}}function Be(e){var t=Ie(),n="",r=!!w||!y.equals(t,me);t&&(n=t.toString(ve),!v&&Se(t)),ce&&U.val(n),e&&r&&(g.change(t),U.trigger("change",[t]))}function ze(){v&&(x=K.width(),C=K.height(),S=Z.height(),X.width(),_=X.height(),D=J.height(),O=ee.width(),k=te.width(),d||(G.css("position","absolute"),u.offset?G.offset(u.offset):G.offset(function(e,t){var n=t[0],r=e[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,fe))),Ve(),u.showPalette&&_e(),U.trigger("reflow.spectrum"))}function He(){Ne(),q=!0,U.attr("disabled",!0),fe.addClass("sp-disabled")}!function(){if(i&&G.find("*:not(input)").attr("unselectable","on"),xe(),de&&U.after(pe).hide(),we||ae.hide(),d)U.after(G).hide();else{var t="parent"===u.appendTo?U.parent():e(u.appendTo);1!==t.length&&(t=e("body")),t.append(G)}function n(t){return t.data&&t.data.ignore?(je(e(t.target).closest(".sp-thumb-el").data("color")),Le()):(je(e(t.target).closest(".sp-thumb-el").data("color")),Le(),u.hideAfterPaletteSelect&&(Be(!0),Ne())),!1}Ce(),fe.bind("click.spectrum touchstart.spectrum",(function(t){q||Pe(),t.stopPropagation(),e(t.target).is("input")||t.preventDefault()})),(U.is(":disabled")||!0===u.disabled)&&He(),G.click(T),ne.change(Te),ne.bind("paste",(function(){setTimeout(Te,1)})),ne.keydown((function(e){13==e.keyCode&&Te()})),ie.text(u.cancelText),ie.bind("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),Re(),Ne()})),ae.attr("title",u.clearText),ae.bind("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),be=!0,Le(),d&&Be(!0)})),se.text(u.chooseText),se.bind("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),i&&ne.is(":focus")&&ne.trigger("change"),ne.hasClass("sp-validation-error")||(Be(!0),Ne())})),le.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),le.bind("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),u.showPaletteOnly=!u.showPaletteOnly,u.showPaletteOnly||d||G.css("left","-="+(Y.outerWidth(!0)+5)),xe()})),M(ee,(function(e,t,n){I=e/O,be=!1,n.shiftKey&&(I=Math.round(10*I)/10),Le()}),Oe,ke),M(X,(function(e,t){N=parseFloat(t/_),be=!1,u.showAlpha||(I=1),Le()}),Oe,ke),M(K,(function(e,t,n){if(n.shiftKey){if(!$){var r=R*x,o=C-j*C,i=Math.abs(e-r)>Math.abs(t-o);$=i?"x":"y"}}else $=null;var a=!$||"y"===$;(!$||"x"===$)&&(R=parseFloat(e/x)),a&&(j=parseFloat((C-t)/C)),be=!1,u.showAlpha||(I=1),Le()}),Oe,ke),ge?(je(ge),Fe(),ve=u.preferredFormat||y(ge).getFormat(),Se(ge)):Fe(),d&&Me();var r=i?"mousedown.spectrum":"click.spectrum touchstart.spectrum";re.delegate(".sp-thumb-el",r,n),oe.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},n)}();var $e={show:Me,hide:Ne,toggle:Pe,reflow:ze,option:function(t,r){return t===n?e.extend({},u):r===n?u[t]:(u[t]=r,"preferredFormat"===t&&(ve=u.preferredFormat),void xe())},enable:function(){q=!1,U.attr("disabled",!1),fe.removeClass("sp-disabled")},disable:He,offset:function(e){u.offset=e,ze()},set:function(e){je(e),Be()},get:Ie,destroy:function(){U.show(),fe.unbind("click.spectrum touchstart.spectrum"),G.remove(),pe.remove(),o[$e.id]=null},container:G};return $e.id=o.push($e)-1,$e}function k(){}function T(e){e.stopPropagation()}function P(e,t){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}function M(t,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,l={},c=0,u=0,d="ontouchstart"in window,p={};function f(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function h(e){if(s){if(i&&a.documentMode<9&&!e.button)return g();var r=e&&e.touches&&e.touches[0],o=r&&r.pageX||e.pageX,p=r&&r.pageY||e.pageY,h=Math.max(0,Math.min(o-l.left,u)),m=Math.max(0,Math.min(p-l.top,c));d&&f(e),n.apply(t,[h,m,e])}}function g(){s&&(e(a).unbind(p),e(a.body).removeClass("sp-dragging"),setTimeout((function(){o.apply(t,arguments)}),0)),s=!1}p.selectstart=f,p.dragstart=f,p["touchmove mousemove"]=h,p["touchend mouseup"]=g,e(t).bind("touchstart mousedown",(function(n){(n.which?3==n.which:2==n.button)||s||!1!==r.apply(t,arguments)&&(s=!0,c=e(t).height(),u=e(t).width(),l=e(t).offset(),e(a).bind(p),e(a.body).addClass("sp-dragging"),h(n),f(n))}))}function A(){return e.fn.spectrum.inputTypeColorSupport()}function D(e,t,n){e=Z(e,255),t=Z(t,255),n=Z(n,255);var r,o,i=m(e,t,n),a=g(e,t,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 e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:o,l:s}}function N(e,t,n){e=Z(e,255),t=Z(t,255),n=Z(n,255);var r,o,i=m(e,t,n),a=g(e,t,n),s=i,l=i-a;if(o=0===i?0:l/i,i==a)r=0;else{switch(i){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:o,v:s}}function R(e,t,n,r){var o=[Q(h(e).toString(16)),Q(h(t).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 j(e,t,n,r){var o;return[Q((o=r,Math.round(255*parseFloat(o)).toString(16))),Q(h(e).toString(16)),Q(h(t).toString(16)),Q(h(n).toString(16))].join("")}function I(e,t){t=0===t?0:t||10;var n=y(e).toHsl();return n.s-=t/100,n.s=X(n.s),y(n)}function L(e,t){t=0===t?0:t||10;var n=y(e).toHsl();return n.s+=t/100,n.s=X(n.s),y(n)}function F(e){return y(e).desaturate(100)}function V(e,t){t=0===t?0:t||10;var n=y(e).toHsl();return n.l+=t/100,n.l=X(n.l),y(n)}function B(e,t){t=0===t?0:t||10;var n=y(e).toRgb();return n.r=m(0,g(255,n.r-h(-t/100*255))),n.g=m(0,g(255,n.g-h(-t/100*255))),n.b=m(0,g(255,n.b-h(-t/100*255))),y(n)}function z(e,t){t=0===t?0:t||10;var n=y(e).toHsl();return n.l-=t/100,n.l=X(n.l),y(n)}function H(e,t){var n=y(e).toHsl(),r=(h(n.h)+t)%360;return n.h=r<0?360+r:r,y(n)}function $(e){var t=y(e).toHsl();return t.h=(t.h+180)%360,y(t)}function W(e){var t=y(e).toHsl(),n=t.h;return[y(e),y({h:(n+120)%360,s:t.s,l:t.l}),y({h:(n+240)%360,s:t.s,l:t.l})]}function U(e){var t=y(e).toHsl(),n=t.h;return[y(e),y({h:(n+90)%360,s:t.s,l:t.l}),y({h:(n+180)%360,s:t.s,l:t.l}),y({h:(n+270)%360,s:t.s,l:t.l})]}function q(e){var t=y(e).toHsl(),n=t.h;return[y(e),y({h:(n+72)%360,s:t.s,l:t.l}),y({h:(n+216)%360,s:t.s,l:t.l})]}function G(e,t,n){t=t||6,n=n||30;var r=y(e).toHsl(),o=360/n,i=[y(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(y(r));return i}function Y(e,t){t=t||6;for(var n=y(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(y({h:r,s:o,v:i})),i=(i+s)%1;return a}function K(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Z(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=g(t,m(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),f.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function X(e){return g(1,m(0,e))}function J(e){return parseInt(e,16)}function Q(e){return 1==e.length?"0"+e:""+e}function ee(e){return e<=1&&(e=100*e+"%"),e}function te(e){return J(e)/255}}(a.default);var ys=function(e){var t="name"===e.getFormat()&&e.toName(),n=1==e.getAlpha()?e.toHexString():e.toRgbString();return t||n.replace(/ /g,"")},bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return ms(n,t),n.prototype.template=function(){var e=this.ppfx;return'\n <div class="'.concat(this.holderClass(),'"></div>\n <div class="').concat(e,'field-colorp">\n <div class="').concat(e,'field-colorp-c" data-colorp-c>\n <div class="').concat(e,'checker-bg"></div>\n </div>\n </div>\n ')},n.prototype.inputClass=function(){var e=this.ppfx;return"".concat(e,"field ").concat(e,"field-color")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.remove=function(){return t.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},n.prototype.handleChange=function(t){t.stopPropagation();var n=t.target.value;(0,e.isUndefined)(n)||this.__onInputChange(n)},n.prototype.__onInputChange=function(e){var t=this.model,n=this.opts.onChange,r=e,o=this.getColorEl();if(o){o.spectrum("set",r);var i=o.spectrum("get"),a=r&&ys(i);a&&(r=a)}n?n(r):t.set({value:r},{fromInput:1})},n.prototype.setValue=function(t,n){void 0===n&&(n={});var r=this.model,o=(0,e.isUndefined)(n.def)?r.get("defaults"):n.def,i=(0,e.isUndefined)(t)?(0,e.isUndefined)(o)?"":o:t,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 e=this;if(!this.colorEl){var t=this,n=t.em,r=t.model,o=t.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 d,p=!1;this.$el.find("[data-colorp-c]").append(l);var f=function(e,t){void 0===t&&(t=!0),s?s(e,!t):(t&&r.setValueFromInput(0,!1),r.setValueFromInput(e,t))};l.spectrum(vs(vs(vs({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(t){var n=ys(t);e.movedColor=n,c.backgroundColor=n,f(n,!1)},change:function(t){p=!0;var n=ys(t);c.backgroundColor=n,f(n),e.noneColor=!1},show:function(t){p=!1,e.movedColor="",d=s?r.getValue({noDefault:!0}):ys(t)},hide:function(){p||!d&&!s||(e.noneColor&&(d=""),c.backgroundColor=d,l.spectrum("set",d),f(d,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",(function(){e.movedColor&&f(e.movedColor),p=!0,e.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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Cs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xs(t,e),t.prototype.templateInput=function(){return""},t.prototype.getInputEl=function(){if(!this.input){var e=this.model,t=this.getModelValue(),n=new ws({model:e,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}).render();n.setValue(t,{fromTarget:1}),this.input=n.el}return this.input},t}(ss);var Ss=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_s=function(t){function n(n){void 0===n&&(n={});var r=t.call(this,n)||this;return(0,e.bindAll)(r,"moveIncrement","upIncrement"),r.doc=document,r.listenTo(r.model,"change:unit",r.handleModelChange),r}return Ss(n,t),n.prototype.template=function(){var e=this.ppfx;return'\n <span class="'.concat(e,'input-holder"></span>\n <span class="').concat(e,'field-units"></span>\n <div class="').concat(e,'field-arrows" data-arrows>\n <div class="').concat(e,'field-arrow-u" data-arrow-up></div>\n <div class="').concat(e,'field-arrow-d" data-arrow-down></div>\n </div>\n ')},n.prototype.inputClass=function(){var e=this.ppfx;return this.opts.contClass||"".concat(e,"field ").concat(e,"field-integer")},n.prototype.setValue=function(e,t){var n=t||{},r=this.validateInputValue(e,{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(e){e.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},n.prototype.handleUnitChange=function(e){e.stopPropagation();var t=this.getUnitEl().value;this.model.set("unit",t),this.elementUpdated()},n.prototype.handleKeyDown=function(e){"ArrowUp"===e.key&&(e.preventDefault(),this.upArrowClick()),"ArrowDown"===e.key&&(e.preventDefault(),this.downArrowClick())},n.prototype.elementUpdated=function(){this.model.trigger("el:change")},n.prototype.handleModelChange=function(){var e=this.model;this.getInputEl().value=e.get("value");var t=this.getUnitEl();t&&(t.value=e.get("unit")||"")},n.prototype.getUnitEl=function(){if(!this.unitEl){var e=this.model,t=e.get("units")||[];if(t.length){var n=['<option value="" disabled hidden>-</option>'];t.forEach((function(t){var r=t==e.get("unit")?"selected":"";n.push("<option ".concat(r,">").concat(t,"</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 e=this.model,t=e.get("step"),n=parseFloat(e.get("value"));this.setValue(this.normalizeValue(n+t)),this.elementUpdated()},n.prototype.downArrowClick=function(){var e=this.model,t=e.get("step"),n=parseFloat(e.get("value"));this.setValue(this.normalizeValue(n-t)),this.elementUpdated()},n.prototype.downIncrement=function(e){e.preventDefault(),this.moved=!1;var t=this.model.get("value")||0;t=this.normalizeValue(t),this.current={y:e.pageY,val:t},(0,me.on)(this.doc,"mousemove",this.moveIncrement),(0,me.on)(this.doc,"mouseup",this.upIncrement)},n.prototype.moveIncrement=function(e){this.moved=!0;var t=this.model,n=t.get("step"),r=this.current,o=this.normalizeValue(r.val+(r.y-e.pageY)*n),i=this.validateInputValue(o),a=i.value,s=i.unit;return this.prValue=a,t.set({value:a,unit:s},{avoidStore:1}),!1},n.prototype.upIncrement=function(){var e=this.model,t=e.get("step");if((0,me.S1)(this.doc,"mouseup",this.upIncrement),(0,me.S1)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-t;e.set("value",n,{avoidStore:1}).set("value",n+t),this.elementUpdated()}},n.prototype.normalizeValue=function(e,t){void 0===t&&(t=0);var n=this.model.get("step"),r=0;if(isNaN(e))return t;if(e=parseFloat(e),Math.floor(e)!==e){var o=n.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(e.toFixed(r)):e},n.prototype.validateInputValue=function(t,n){void 0===n&&(n={});var r=0,o=n||{},i=this.model,a=(0,e.isUndefined)(t)?"":t,s=n.units||i.get("units")||[],l=i.get("unit")||s.length&&s[0]||"",c=(0,e.isUndefined)(n.max)?i.get("max"):n.max,u=(0,e.isUndefined)(n.min)?i.get("min"):n.min,d=!!i.get("limitlessMax"),p=!!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 m=g.replace(a,"");(0,e.indexOf)(s,m)>=0&&(l=m)}}}return d||(0,e.isUndefined)(c)||""===c||(a=a>c?c:a),p||(0,e.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 e=this.getUnitEl();return e&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(e),this},n}(gs);const Es=_s;_s.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 Os=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Os(n,t),n.prototype.getValueForTarget=function(){var t=this.model,n=t.attributes,r=n.value,o=n.unit;return(0,e.isUndefined)(r)||""===r?t.get("default"):r+o},n.prototype.getInputEl=function(){if(!this.input){var e=this.ppfx,t=this.model,n=this.getModelValue(),r=new Es({contClass:"".concat(e,"field-int"),type:"number",model:t,ppfx:e});r.render(),this.$input=r.inputEl,this.$unit=r.unitEl,t.set("value",n,{fromTarget:!0}),this.$input.val(n),this.input=r.el}return this.input},n}(ss);const Ts=ks;var Ps=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ms=function(t){function n(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.rerender),n}return Ps(n,t),n.prototype.templateInput=function(){var e=this.ppfx,t=this.clsField;return'<div class="'.concat(t,'">\n <div data-input></div>\n <div class="').concat(e,'sel-arrow">\n <div class="').concat(e,'d-s-arrow"></div>\n </div>\n </div>')},n.prototype.getInputEl=function(){if(!this.$input){var t=this.model,n=this.em,r=t.get("name"),o=t.get("options")||[],i=[],s="<select>";o.forEach((function(t){var o,a,l,c="";(0,e.isString)(t)?(o=t,a=t):(o=t.name||t.label||t.value,a="".concat((0,e.isUndefined)(t.value)?t.id:t.value).replace(/"/g,"""),c+=(l=t.style?t.style.replace(/"/g,"""):"")?' 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=t.getTargetValue(),c=i.indexOf(l)>=0?l:t.get("default");!(0,e.isUndefined)(c)&&this.$input.val(c)}return this.$input.get(0)},n}(ss);const As=Ms;var Ds=B(330),Ns=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rs="data-categories",js="data-no-categories",Is=function(e){function t(t,n){var r=e.call(this,t)||this;r.reuseView=!0,r.renderedCategories=new Map,r.itemsView=n;var o=t.config||{};r.config=o;var i=t.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 $t([],{em:i}),r.listenTo(i,"component:toggled",r.updatedCollection),r.updatedCollection(),r}return Ns(t,e),t.prototype.updatedCollection=function(){var e=this.ppfx,t=this.em,n=t.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=(null==n?void 0:n.traits)||new $t([],{em:t}),this.render()},t.prototype.add=function(e,t){var n=this.config,r=this.renderedCategories,o=this.itemView,i=e.get(this.itemType);this.itemsView&&this.itemsView[i]&&(o=this.itemsView[i]);var a=new o({config:n,model:e,attributes:e.get("attributes")}).render().el,s=e.parent.initCategory(e);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))}t?t.appendChild(a):this.append(a)},t.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(Rs,"]"))),this.catsEl},t.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(js,"]"))),this.traitsEl},t.prototype.append=function(e){var t=this.getTraitsEl();null==t||t.appendChild(e)},t.prototype.render=function(){var e=this,t=this,n=t.el,r=t.ppfx,o=t.catsClass,i=t.traitContClass,a=t.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(js,"></div>\n "),this.collection.forEach((function(t){return e.add(t,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},t}(Ds.Z);const Ls=Is;Is.prototype.itemView=ss;var Fs=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vs=function(t){function n(n){var r=t.call(this,n,"TraitManager",rs)||this;r.TraitsView=Ls,r.events=Nt,r.state=new l.Hn({traits:[]}),r.types={text:ss,number:Ts,select:As,checkbox:ps,color:Cs,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,e.bindAll)(r,"__onSelect");var u=(0,e.debounce)((function(){return r.__upSel()}),0),d=(0,e.debounce)((function(){return r.__onUp()}),0);return i.listenTo(n,"component:toggled",u),i.listenTo(n,s.value,d),i.on("change:traits",r.__onSelect),r.debounced=[u,d],r}return Fs(n,t),n.prototype.select=function(e){var t=(null==e?void 0:e.getTraits())||[];this.state.set({component:e,traits:t}),this.__trgCustom()},n.prototype.getCategories=function(){var e,t=this.getComponent();return function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],(null===(e=null==t?void 0:t.traits.categories)||void 0===e?void 0:e.models)||[],!0)},n.prototype.getTraits=function(){return this.getCurrent()},n.prototype.getTraitsByCategory=function(e){return Ot(e||this.getTraits())},n.prototype.getComponent=function(){return this.state.attributes.component},n.prototype.addType=function(e,t){var n=this.getType("text");this.types[e]=n.extend(t)},n.prototype.getType=function(e){return this.getTypes()[e]},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 e=this.view,t=this.em;return e=new Ls({el:null==e?void 0:e.el,collection:[],editor:t,config:this.getConfig()},this.getTypes()),this.view=e,e.el},n.prototype.postRender=function(){this.__appendTo()},n.prototype.__onSelect=function(){var e=this,t=e.em,n=e.events,r=e.state.attributes,o=r.component,i=r.traits;t.trigger(n.select,{component:o,traits:i})},n.prototype.__trgCustom=function(e){void 0===e&&(e={});var t=this,n=t.em,r=t.events,o=t.__ctn;this.__ctn=o||e.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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$s=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;n.items=[],n.opt=t;var r=t.config||{};n.config=r,n.parentView=t.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),t.parent&&n.$el.data("model",t.parent),n}return Hs(t,e),t.prototype.removeChildren=function(e){var t=e.viewLayer;t&&(t.remove(),delete e.viewLayer)},t.prototype.addTo=function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},t.prototype.addToCollection=function(e,t,n){var r=this,o=r.parentView,i=r.opt,a=r.config,s=i.ItemView,l=i.opened,c=i.module,u=t||null,d=new s({ItemView:s,level:i.level,model:e,parentView:o,config:a,sorter:i.sorter,opened:l,module:c}),p=d.render().el;if(u)u.appendChild(p);else if(void 0!==n){var f="before";this.$el.children().length==n&&(n--,f="after"),n<0?this.$el.append(p):this.$el.children().eq(n)[f](p)}else this.$el.append(p);return this.items.push(d),p},t.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.G7.prototype.remove.apply(this,e),this.items.map((function(e){return e.remove()})),this},t.prototype.render=function(){var e=this,t=document.createDocumentFragment(),n=this.el;return n.innerHTML="",this.collection.each((function(n){return e.addToCollection(n,t)})),n.appendChild(t),n.className=this.className,this},t}(l.G7);const Ws=$s;var Us=B(790);const qs={stylePrefix:"com-",defaults:{},strict:!0};var Gs=B(713),Ys=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ks=function(){return Ks=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ks.apply(this,arguments)},Zs=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Xs=[["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(e){return function(t){return e.trigger("".concat(Kt,":start"),t)}},el=function(e){return function(t){return e.trigger(Kt,t)}},tl=function(e,t,n){return void 0===n&&(n={}),function(r,o,i){t.forEach((function(e){return e.set("status",e.get("selectable")?"selected":"")})),e.setSelected(t),t[0].emitUpdate(),e.trigger("".concat(Kt,":end"),i),setTimeout((function(){return e.runDefault(Js)})),(n.altMode||i.cancelled)&&e.set("_cmpDrag",1)}},nl=function(t){function n(n){var r=t.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(e){var t=o.defaults[e];t.id&&r.add(t.id,t)})),a["tlb-delete"]={run:function(e){return e.runCommand("core:component-delete")}},a["tlb-clone"]={run:function(e){e.runCommand("core:copy"),e.runCommand("core:paste",{action:"clone-component"})}},a["tlb-move"]={run:function(t,n,r){var o;void 0===r&&(r={});var i=t.getModel(),a=r.event,s=r.target,l=(s?[s]:Zs([],t.getSelectedAll(),!0)).map((function(e){var t,n;return(null===(n=null===(t=e.delegate)||void 0===t?void 0:t.move)||void 0===n?void 0:n.call(t,e))||e})).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 d=c.get("dmode")||i.get("dmode"),p=function(){return i.stopDefault(Js)},f=(0,e.includes)(["absolute","translate"],d);l.forEach((function(e){return e.trigger("disable",{fromMove:!0})})),u?setTimeout(p,0):p();var h=Qs(i),g=el(i),m=tl(i,l,{altMode:f});if(f)t.runCommand("core:component-drag",{guidesInfo:1,mode:d,target:c,onStart:h,onDrag:g,onEnd:m,event:a});else{u&&a.dataTransfer.setDragImage(null===(o=c.view)||void 0===o?void 0:o.el,0,0);var v=t.Commands.get("move-comp");v.onStart=h,v.onDrag=g,v.onEndMoveFromModel=m,v.initSorterFromModels(l)}l.filter((function(e){return e.get("selectable")})).forEach((function(e){return e.set("status","freezed-selected")}))}},a["core:undo"]=function(e){return e.UndoManager.undo()},a["core:redo"]=function(e){return e.UndoManager.redo()},Xs.forEach((function(e){var t=e[2],r=B(828)("./".concat(e[1])).default,o="core:".concat(e[0]);a[o]=r,t&&(a[t]=r,["run","stop"].forEach((function(e){n.on("".concat(e,":").concat(t),(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return n.trigger.apply(n,Zs(["".concat(e,":").concat(o)],t,!1))}))})))})),o.model=n.Canvas,a)r.add(s,a[s]);return r}return Ys(n,t),n.prototype.add=function(t,n){var r=(0,e.isFunction)(n)?{run:n}:n;return r.stop||(r.noStop=!0),delete r.initialize,r.id=t,this.commands[t]=Us.default.extend(r),this},n.prototype.get=function(t){var n=this.commands[t];return(0,e.isFunction)(n)?(n=new n(this.config),this.commands[t]=n):n||this.em.logWarning("'".concat(t,"' command not found")),n},n.prototype.extend=function(e,t){void 0===t&&(t={});var n=this.get(e);if(n){var r=Ks(Ks({},n.constructor.prototype),t);this.add(e,r);var o=Xs.filter((function(t){return"core:".concat(t[0])===e&&t[2]}))[0];o&&this.add(o[2],r)}return this},n.prototype.has=function(e){return!!this.commands[e]},n.prototype.getAll=function(){return this.commands},n.prototype.run=function(e,t){return void 0===t&&(t={}),this.runCommand(this.get(e),t)},n.prototype.stop=function(e,t){return void 0===t&&(t={}),this.stopCommand(this.get(e),t)},n.prototype.isActive=function(e){return this.getActive().hasOwnProperty(e)},n.prototype.getActive=function(){return this.active},n.prototype.runCommand=function(e,t){var n;if(void 0===t&&(t={}),e&&e.run){var r=this.em,o=this.config,i=e.id,a=r.Editor;this.isActive(i)&&!t.force&&o.strict||(n=a&&e.callRun(a,t),i&&e.stop&&!e.noStop&&!t.abort&&(this.active[i]=n))}return n},n.prototype.stopCommand=function(e,t){var n;if(void 0===t&&(t={}),e&&e.run){var r=this.em,o=this.config,i=e.id,a=r.Editor;(this.isActive(i)||t.force||!o.strict)&&(i&&delete this.active[i],n=e.callStop(a,t))}return n},n.prototype.create=function(e){return e.stop||(e.noStop=!0),new(Us.default.extend(e))(this.config)},n.prototype.__onRun=function(e,t){var n=this.em,r=this.events;n.on("".concat(r.runCommand).concat(e),t)},n.prototype.__onStop=function(e,t){var n=this.em,r=this.events;n.on("".concat(r.stopCommand).concat(e),t)},n.prototype.destroy=function(){this.defaultCommands={},this.commands={},this.active={}},n}(g);const rl=nl;var ol=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),il="contentEditable",al=function(t){function n(n){var r=t.call(this,n)||this;(0,e.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,t),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(e){var t=this,n=t.pfx,r=t.ppfx,o=t.config,i=t.clsNoEdit,a=t.module,s=t.opt,l=t.em,c=o.hidable,u=a.getComponents(e).length,d=u?"":this.clsNoChild,p="".concat(this.clsTitle," ").concat(d),f="".concat(this.clsTitleC),h="".concat(this.inputNameCls," ").concat(i," ").concat(r,"no-app"),g=s.level||0,m="".concat(10*g,"px"),v=e.getName(),y=e.getIcon(),b="".concat(n,"layer"),w=(null==l?void 0:l.getConfig()).icons,x=w.move,C=w.eye,S=w.eyeOff,_=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(C,'</i>\n <i class="').concat(n,'layer-vis-off">').concat(S,"</i>\n </i>"):"",'\n <div class="').concat(f,'">\n <div class="').concat(p,'" style="padding-left: ').concat(m,'">\n <div class="').concat(n,'layer-title-inn" title="').concat(v,'">\n <i class="').concat(this.clsCaret,'" data-toggle-open>').concat(_,"</i>\n ").concat(y?'<span class="'.concat(b,'__icon">').concat(y,"</span>"):"",'\n <span class="').concat(h,'" data-name>').concat(v,'</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 e=this,t=this.model,n=this.config.onInit,r=t.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 e.listenTo(t,n[0],n[1])})),this.$el.data("model",t),this.$el.data("collection",r),t.viewLayer=this,n.bind(this)({component:t,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 e=this,t=e.pfx,n=e.model,r=e.module,o="".concat(t,"layer-hidden"),i=!r.isVisible(n)?"addClass":"removeClass";this.$el[i](o),this.getVisibilityEl()[i]("".concat(t,"layer-off"))},n.prototype.toggleVisibility=function(e){null==e||e.stopImmediatePropagation();var t=this.module,n=this.model;t.setVisible(n,!t.isVisible(n))},n.prototype.handleEdit=function(e){null==e||e.stopPropagation();var t=this,n=t.em,r=t.$el,o=t.clsNoEdit,i=t.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(e){e.stopPropagation(),((0,me.kl)(e)||(0,me.r$)(e))&&this.handleEditEnd(e)},n.prototype.handleEditEnd=function(e){null==e||e.stopPropagation();var t=this,n=t.em,r=t.$el,o=t.clsNoEdit,i=t.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(e,t){var n=t.propName;this.model.set(n,e)},n.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},n.prototype.updateOpening=function(){var e=this,t=e.$el,n=e.model,r=e.pfx,o="open",i="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(t.addClass(o),a.addClass(i)):(t.removeClass(o),a.removeClass(i))},n.prototype.toggleOpening=function(e){var t=this.model,n=this.module;null==e||e.stopImmediatePropagation(),t.get("components").length&&n.setOpen(t,!n.isOpen(t))},n.prototype.handleSelect=function(e){null==e||e.stopPropagation();var t=this.module,n=this.model;t.setLayerData(n,{selected:!0},{event:e})},n.prototype.handleHover=function(e){null==e||e.stopPropagation();var t=this.module,n=this.model;t.setLayerData(n,{hovered:!0})},n.prototype.handleHoverOut=function(e){null==e||e.stopPropagation();var t=this.module,n=this.model;t.setLayerData(n,{hovered:!1})},n.prototype.startSort=function(e){var t,n,r;e.stopPropagation();var o=this,i=o.em,a=o.sorter,s=o.model;if((!e.button||0===e.button)&&a){var l=(null===(n=null===(t=s.delegate)||void 0===t?void 0:t.move)||void 0===n?void 0:n.call(t,s))||s;a.onStart=Qs(i),a.onMoveClb=el(i),a.onEndMove=tl(i,[l]);var c=(null===(r=l.viewLayer)||void 0===r?void 0:r.el)||e.target;a.startSort(c)}},n.prototype.updateStatus=function(){jr.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 e=this,t=e.model,n=e.clsNoChild,r=e.module,o=r.getComponents(t).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(t,!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(t){var n,r=(0,e.isString)(t)?null===(n=this.em.getWrapper())||void 0===n?void 0:n.find(t)[0]:t;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 e;null===(e=this.items)||void 0===e||e.remove()},n.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.G7.prototype.remove.apply(this,e),this.__clearItems(),this},n.prototype.render=function(){var e=this,t=e.model,n=e.config,r=e.pfx,o=e.ppfx,i=e.opt,a=e.sorter;this.__clearItems();var s=i.opened,l=i.module,c=i.ItemView,u=!l.__isLayerable(t),d=this.$el.empty(),p=i.level+1;delete this.inputName,this.items=new Ws({ItemView:c,collection:t.get("components"),config:n,sorter:a,opened:s,parentView:this,parent:t,level:p,module:l});var f=this.items.render().$el;return n.showWrapper||1!==p?(d.html(this.template(t)),d.find(".".concat(this.clsChildren)).append(f)):d.append(f),t.get("draggable")&&n.sortable||d.children(".".concat(this.clsMove)).remove(),!l.isVisible(t)&&(this.className+=" ".concat(r,"hide")),u&&(this.className+=" ".concat(o,"hidden")),d.attr("class",this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.__render(),this._rendered=!0,this},n.prototype.__render=function(){var e=this,t=e.model,n=e.config,r={component:t,el:e.el};n.onRender.bind(this)(r),this.em.trigger("layer:render",r)},n}(l.G7);const sl=al;var ll=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cl=function(){return cl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cl.apply(this,arguments)},ul="layer",dl="".concat(ul,":"),pl="".concat(dl,"root"),fl="".concat(dl,"component"),hl="".concat(dl,"custom"),gl={all:ul,root:pl,component:fl,custom:hl},ml={mediaText:""},vl=["open","status","locked","custom-name","components","classes"].map((function(e){return"component:update:".concat(e)})).join(" "),yl=function(n){function r(t){var r=n.call(this,t,"LayerManager",zs)||this;return r.events=gl,(0,e.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 e=this,t=this,n=t.em,r=t.config,o=t.model;o.listenTo(n,"component:selected",this.componentChanged),o.on("change:root",this.__onRootChange),o.listenTo(n,vl,this.__onComponent),this.componentChanged(),o.listenToOnce(n,"load",(function(){e.setRoot(r.root),e.__appendTo()}))},r.prototype.setRoot=function(n){var r=this.em.getWrapper(),o=(0,t.isComponent)(n)?n:r;return n&&(0,e.isString)(n)&&(0,t.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(e){var t=this;return e.components().filter((function(e){return t.__isLayerable(e)}))},r.prototype.setOpen=function(e,t){e.set("open",t)},r.prototype.isOpen=function(e){return!!e.get("open")},r.prototype.setVisible=function(e,t){var n="__prev-display",r=e.getStyle(ml),o=r.display;if(t){var i=e.get(n);delete r.display,i&&(r.display=i,e.unset(n))}else o&&e.set(n,o),r.display="none";e.setStyle(r,ml),this.updateLayer(e),this.em.trigger("component:toggled")},r.prototype.isVisible=function(e){return!function(e){return void 0===e&&(e={}),0===(e.display||"").trim().indexOf("none")}(e.getStyle(ml))},r.prototype.setLocked=function(e,t){e.set("locked",t)},r.prototype.isLocked=function(e){return!!e.get("locked")},r.prototype.setName=function(e,t){e.set("custom-name",t)},r.prototype.getName=function(e){return e.getName()},r.prototype.getLayerData=function(e){var t=e.get("status");return{name:e.getName(),open:this.isOpen(e),selected:"selected"===t,hovered:"hovered"===t,visible:this.isVisible(e),locked:this.isLocked(e),components:this.getComponents(e)}},r.prototype.setLayerData=function(e,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,d=n.locked,p=n.name,f=cl({fromLayers:!0},r);if((0,t.isDef)(s)&&this.setOpen(e,s),(0,t.isDef)(l))if(l){i.setSelected(e,f);var h=a.scrollCanvas;h&&(null===(o=e.views)||void 0===o||o.forEach((function(e){return e.scrollIntoView(h)})))}else i.removeSelected(e,f);(0,t.isDef)(c)&&a.showHover&&(c?i.setHovered(e,f):i.setHovered(null,f)),(0,t.isDef)(u)&&u!==this.isVisible(e)&&this.setVisible(e,u),(0,t.isDef)(d)&&this.setLocked(e,d),(0,t.isDef)(p)&&this.setName(e,p)},r.prototype.componentChanged=function(e,t){var n;if(void 0===t&&(t={}),!t.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 e,t,n=this.config,r=this.model,o=sl.extend(n.extend);return this.view=new o({el:null===(e=this.view)||void 0===e?void 0:e.el,ItemView:o,level:0,config:n,opened:r.get("opened"),model:this.getRoot(),module:this}),null===(t=this.view)||void 0===t?void 0:t.render().el},r.prototype.destroy=function(){var e;null===(e=this.view)||void 0===e||e.remove()},r.prototype.__onRootChange=function(){var e,t=this.getRoot();null===(e=this.view)||void 0===e||e.setRoot(t),this.em.trigger(pl,t),this.__trgCustom()},r.prototype.__onComponent=function(e){this.updateLayer(e)},r.prototype.__isLayerable=function(e){var t=e.get("tagName");return(!this.config.hideTextnode||!e.isInstanceOf("textnode")&&"br"!==t)&&e.get("layerable")},r.prototype.__trgCustom=function(e){var t=this,n=t.__ctn,r=t.em,o=t.events;this.__ctn=n||(null==e?void 0:e.container),r.trigger(o.custom,{container:this.__ctn,root:this.getRoot()})},r.prototype.updateLayer=function(e,t){this.em.trigger(fl,e,t)},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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return xl(n,t),n.getDefaults=function(){return(0,e.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 Sl=Cl;Cl.prototype.idAttribute="src";var _l=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),El=function(){return El=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},El.apply(this,arguments)};const Ol=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _l(t,e),t.prototype.defaults=function(){return El(El({},Sl.getDefaults()),{type:"image",unitDim:"px",height:0,width:0})},t}(Sl);var kl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tl=function(t){function n(e){var n=t.call(this,e)||this;n.options=e,n.collection=e.collection;var r=e.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(e),n}return kl(n,t),n.prototype.__getBhv=function(){var e=this.em,t=null==e?void 0:e.Assets;return(null==t?void 0:t.__getBehaviour())||{}},n.prototype.template=function(e,t){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 ⨯\n </div>\n ')},n.prototype.updateTarget=function(t){t&&t.set&&(t.set("attributes",(0,e.clone)(t.get("attributes"))),t.set("src",this.model.get("src")))},n.prototype.getPreview=function(){return""},n.prototype.getInfo=function(){return""},n.prototype.render=function(){var e=this.el;return e.innerHTML=this.template(this,this.model),e.className=this.className,this},n}(l.G7);const Pl=Tl;var Ml=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Al=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Dl=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return Ml(r,t),r.prototype.getPreview=function(){var e=this,t=e.pfx,r=e.ppfx,o=e.model.get("src");return n(Rl||(Rl=Al(['\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 '])),t,o,t,r)},r.prototype.getInfo=function(){var e=this.pfx,t=this.model,r=t.get("name"),o=t.get("width"),i=t.get("height"),a=t.get("unitDim"),s=o&&i?"".concat(o,"x").concat(i).concat(a):"";return r=r||t.getFilename(),n(jl||(jl=Al(['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "],['\n <div class="','name">','</div>\n <div class="','dimensions">',"</div>\n "])),e,r,e,s)},r.prototype.init=function(e){var t=this.pfx;this.className+=" ".concat(t,"asset-image")},r.prototype.onClick=function(){var t=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,e.isFunction)(r)?r(t,!1):(0,e.isFunction)(o)?o(t):this.updateTarget(i.target)},r.prototype.onDblClick=function(){var t=this.em,n=this.model,r=this.__getBhv().select,o=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;(0,e.isFunction)(r)?r(n,!0):(0,e.isFunction)(o)?o(n):(this.updateTarget(a),null==t||t.Modal.close()),(0,e.isFunction)(s)&&s(n)},r.prototype.onRemove=function(e){e.stopImmediatePropagation(),this.model.collection.remove(this.model)},r}(Pl);const Nl=Dl;var Rl,jl;Dl.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var Il=function(){return Il=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Il.apply(this,arguments)},Ll={types:[],initialize:function(e,t){var n=this;void 0===t&&(t={});var r=t.em;this.em=r,this.opts=t,this.model=function(e,t){var o,i,a;if(void 0===e&&(e={}),void 0===t&&(t={}),e&&e.type){var s=n.getBaseType();o=(a=n.getType(e.type))?a.model:s.model,i=a?a.view:s.view}else{var l=n.recognizeType(e);o=(a=l.type).model,i=a.view,e=l.attributes}var c=new o(e,Il(Il({},t),{em:r}));return c.typeView=i,c};var o=this.init&&this.init.bind(this);o&&o()},recognizeType:function(e){for(var t=this.getTypes(),n=0;n<t.length;n++){var r=t[n],o=r.isType(e);if(o="boolean"==typeof o&&o?{type:r.id}:o)return{type:r,attributes:o}}return{type:this.getBaseType(),attributes:e}},getBaseType:function(){var e=this.getTypes();return e[e.length-1]},getTypes:function(){return this.types},getType:function(e){for(var t=this.getTypes(),n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}},addType:function(t,n){var r=this.getType(t),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,e.isFunction)(s)?s:i.extend(s||{}),c=c instanceof l.G7||(0,e.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=t,n.model=s,n.view=c,n.isType=u||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(n))}};const Fl=Ll;var Vl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vl(t,e),t}(l.FE.extend(Fl));const zl=Bl;var Hl;Bl.prototype.types=[{id:"image",model:Ol,view:Nl,isType:function(e){return"string"==typeof e?{type:"image",src:e}:e}}],function(e){e.add="asset:add",e.remove="asset:remove",e.removeBefore="asset:remove:before",e.update="asset:update",e.open="asset:open",e.close="asset:close",e.uploadStart="asset:upload:start",e.uploadEnd="asset:upload:end",e.uploadError="asset:upload:error",e.uploadResponse="asset:upload:response",e.custom="asset:custom",e.all="asset"}(Hl||(Hl={}));const $l=Hl;var Wl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ul=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;n.options=t,n.config=t.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(t,e),t.prototype.template=function(e){var t=e.pfx,n=e.ppfx,r=e.em,o="";return this.config.showUrlInput&&(o='\n <form class="'.concat(t,'add-asset">\n <div class="').concat(n,"field ").concat(t,'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(t,'assets-cont">\n <div class="').concat(t,'assets-header">\n ').concat(o,'\n </div>\n <div class="').concat(t,'assets" data-el="assets"></div>\n <div style="clear:both"></div>\n </div>\n ')},t.prototype.handleSubmit=function(e){e.preventDefault();var t=this.getAddInput(),n=t&&t.value.trim(),r=this.config.handleAdd;if(n){t.value="";var o=this.getAssetsEl();o&&(o.scrollTop=0),r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},t.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},t.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},t.prototype.removedAsset=function(e){this.collection.length||this.toggleNoAssets()},t.prototype.addToAsset=function(e){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(e)},t.prototype.addAsset=function(e,t){void 0===t&&(t=null);var n=t,r=this.collection,o=this.config,i=new e.typeView({model:e,collection:r,config:o}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},t.prototype.toggleNoAssets=function(e){void 0===e&&(e=!1);var t=this.$el.find(".".concat(this.pfx,"assets"));if(e)t.empty();else{var n=this.config.noAssets;n&&t.append(n)}},t.prototype.deselectAll=function(){var e=this.pfx;this.$el.find(".".concat(e,"highlight")).removeClass("".concat(e,"highlight"))},t.prototype.renderAssets=function(){var e=this,t=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each((function(n){return e.addAsset(n,t)})),n.append(t)},t.prototype.render=function(){var e=this.options.fu.render().el;return this.$el.empty(),this.$el.append(e).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},t}(l.G7);const ql=Ul;Ul.prototype.events={submit:"handleSubmit"};var Gl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yl=function(e){function t(n){void 0===n&&(n={});var r=e.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=t.embedAsBase64),r.delegateEvents(),r}return Gl(t,e),t.prototype.template=function(e){var t,r,o=e.pfx,i=e.title,a=e.uploadId,s=e.disabled,l=e.multiUpload;return n(Zl||(t=['\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(t,"raw",{value:r}):t.raw=r,Zl=t),o,i,a,s?"disabled":"",l?"multiple":"")},t.prototype.events=function(){return{"change [data-input]":"uploadFile"}},t.prototype.onUploadStart=function(){var e=this.module;null==e||e.__propEv(e.events.uploadStart)},t.prototype.onUploadEnd=function(e){var t=this.$el,n=this.module;null==n||n.__propEv(n.events.uploadEnd,e);var r=t.find("input");r&&r.val("")},t.prototype.onUploadError=function(e){var t=this.module;console.error(e),this.onUploadEnd(e),null==t||t.__propEv(t.events.uploadError,e)},t.prototype.onUploadResponse=function(e,t){var n,r=this,o=r.module,i=r.config,a=r.target;try{n="string"==typeof e?JSON.parse(e):e}catch(t){n=e}null==o||o.__propEv(o.events.uploadResponse,n),i.autoAdd&&a&&a.add(n.data,{at:0}),this.onUploadEnd(e),null==t||t(n)},t.prototype.uploadFile=function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.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 d=0;d<r.length;d++)a.append("".concat(o.uploadName).concat(o.multiUploadSuffix),r[d]);else r.length&&a.append(o.uploadName,r[0]);var p=o.upload,f=o.headers,h="X-Requested-With";if(void 0===f[h]&&(f[h]="XMLHttpRequest"),p){this.onUploadStart();var g={method:"post",credentials:o.credentials||"include",headers:f,body:a},m=(null==c?void 0:c(g))||g;return(l?l(p,m):za(p,m).then((function(e){return 1==(e.status/200|0)?e.text():e.text().then((function(e){return Promise.reject(e)}))}))).then((function(e){return n.onUploadResponse(e,t)})).catch((function(e){return n.onUploadError(e)}))}}},t.prototype.initDrop=function(){var e=this;if(!this.uploadForm){this.uploadForm=this.$el.find("form").get(0);var t=this.uploadForm;"draggable"in t&&(this.uploadForm.ondragover=function(){return t.className=e.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return t.className="",!1},this.uploadForm.ondrop=function(n){t.className="",n.preventDefault(),e.uploadFile(n)})}},t.prototype.initDropzone=function(e){var t=this,n=0,r=this.config,o=e.model,i=e.el,a=o.Editor,s=o.Canvas.getBody(),l=this.ppfx,c="".concat(l,"dropzone-active"),u="".concat(l,"dropzone"),d=function(){i.className=i.className.replace(c,"").trim(),n=0},p=function(){return n||(i.className+=" ".concat(c),n=1),!1},f=function(){return d(),!1},h=function(e){if(d(),e.preventDefault(),e.stopPropagation(),t.uploadFile(e),r.openAssetsOnDrop&&a){var n=a.getSelected();a.runCommand("open-assets",{target:n,onSelect:function(){a.Modal.close(),a.AssetManager.setTarget(null)}})}return!1};e.$el.append('<div class="'.concat(u,'">').concat(r.dropzoneContent,"</div>")),d(),"draggable"in i&&[i,s].forEach((function(e){e.ondragover=p,e.ondragleave=f,e.ondrop=h}))},t.prototype.render=function(){var e=this,t=e.$el,n=e.pfx,r=e.em;return t.html(this.template({title:r&&r.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),t.attr("class",n+"file-uploader"),this},t.embedAsBase64=function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.target.files,o={data:[]};if(FileReader){for(var i=[],a=/^(.+)\/(.+)$/,s=function(e){var t=new Promise((function(t,n){var r=new FileReader;r.addEventListener("load",(function(o){var i,s=e.name,l=a.exec(e.type);if("image"===(i=l?l[1]:e.type)){var c={src:r.result,name:s,type:i,height:0,width:0},u=new Image;u.addEventListener("error",(function(e){n(e)})),u.addEventListener("load",(function(){c.height=u.height,c.width=u.width,t(c)})),u.src=c.src}else t(i?{src:r.result,name:s,type:i}:r.result)})),r.addEventListener("error",(function(e){n(e)})),r.addEventListener("abort",(function(e){n("Aborted")})),r.readAsDataURL(e)}));i.push(t)},l=0,c=r;l<c.length;l++){s(c[l])}return Promise.all(i).then((function(e){o.data=e,n.onUploadResponse(o,t)}),(function(e){n.onUploadError(e)}))}this.onUploadError(new Error("Unsupported platform, FileReader is not defined"))},t}(l.G7);const Kl=Yl;var Zl,Xl=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jl=function(){return Jl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Jl.apply(this,arguments)},Ql=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},ec="open-assets",tc=function(t){function n(n){var r=t.call(this,n,"AssetManager",new zl([],n),$l,wl)||this;r.storageKey="assets",r.Asset=Sl,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(e){return r.getAllVisible().add(e)})),i.on("remove",(function(e){return r.getAllVisible().remove(e)})),r.__onAllEvent=(0,e.debounce)((function(){return r.__trgCustom()}),0),r}return Xl(n,t),n.prototype.open=function(e){void 0===e&&(e={}),this.em.Commands.run(ec,Jl({types:["image"],select:function(){}},e))},n.prototype.close=function(){this.em.Commands.stop(ec)},n.prototype.isOpen=function(){var e=this.em.Commands;return!!(null==e?void 0:e.isActive(ec))},n.prototype.add=function(e,t){return void 0===t&&(t={}),void 0===t.at&&(t.at=0),this.all.add(e,t)},n.prototype.get=function(e){return this.all.where({src:e})[0]||null},n.prototype.getAll=function(){return this.all},n.prototype.getAllVisible=function(){return this.assetsVis},n.prototype.remove=function(e,t){return this.__remove(e,t)},n.prototype.store=function(){return this.getProjectData()},n.prototype.load=function(e){return this.loadProjectData(e)},n.prototype.getContainer=function(){var e;return this.__getBehaviour().container||(null===(e=this.am)||void 0===e?void 0:e.el)},n.prototype.getAssetsEl=function(){var e;return null===(e=this.am)||void 0===e?void 0:e.el.querySelector("[data-el=assets]")},n.prototype.render=function(e){if(!this.getConfig().custom){var t=e||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(t),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(e,t){this.getAll().addType(e,t)},n.prototype.getType=function(e){return this.getAll().getType(e)},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 Kl(this.__viewParams())),this.fu},n.prototype.onLoad=function(){var e=this;this.getAll().reset(this.config.assets);var t=this.em,n=this.events;t.Commands.__onRun(ec,(function(){return e.__propEv(n.open)})),t.Commands.__onStop(ec,(function(){return e.__propEv(n.close)}))},n.prototype.postRender=function(e){var t;this.config.dropzone&&(null===(t=this.fu)||void 0===t||t.initDropzone(e))},n.prototype.setTarget=function(e){this.assetsVis.target=e},n.prototype.onSelect=function(e){this.assetsVis.onSelect=e},n.prototype.onClick=function(e){this.config.onClick=e},n.prototype.onDblClick=function(e){this.config.onDblClick=e},n.prototype.__propEv=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];(t=this.em).trigger.apply(t,Ql([e],r,!1)),(n=this.getAll()).trigger.apply(n,Ql([e],r,!1))},n.prototype.__trgCustom=function(){var e=this.__getBehaviour(),t=this.getConfig().custom;(e.container||t.open)&&this.em.trigger(this.events.custom,this.__customData())},n.prototype.__customData=function(){var t=this,n=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:n.types||[],container:n.container,close:function(){return t.close()},remove:function(e,n){return t.remove(e,n)},select:function(r,o){var i=t.add(r);(0,e.isFunction)(n.select)&&n.select(i,o)},options:n.options||{}}},n.prototype.__behaviour=function(e){return void 0===e&&(e={}),this._bhv=Jl(Jl({},this._bhv||{}),e)},n.prototype.__getBehaviour=function(e){return this._bhv||{}},n.prototype.destroy=function(){var e,t;this.all.stopListening(),this.all.reset(),this.assetsVis.stopListening(),this.assetsVis.reset(),null===(e=this.fu)||void 0===e||e.remove(),null===(t=this.am)||void 0===t||t.remove(),this._bhv={}},n}(m);const nc=tc;var rc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oc=function(t){function n(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,o=n.em,i={};r.em=o,e.frames||(i.component=e.component,i.styles=e.styles,["component","styles"].map((function(e){return r.unset(e)})));var a=e.frames||[i],s=new re(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,t),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(e){return this.set({name:e})},n.prototype.getAllFrames=function(){return this.getFrames().models||[]},n.prototype.getMainFrame=function(){return this.getFrames().at(0)},n.prototype.getMainComponent=function(){var e=this.getMainFrame();return null==e?void 0:e.getComponent()},n.prototype.toJSON=function(t){void 0===t&&(t={});var n=l.Hn.prototype.toJSON.call(this,t),r=(0,e.result)(this,"defaults");return(0,e.forEach)(n,(function(e,t){0===t.indexOf("_")&&delete n[t]})),(0,e.forEach)(r,(function(e,t){n[t]===e&&delete n[t]})),n},n}(l.Hn);const ic=oc;var ac=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sc=function(){return sc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sc.apply(this,arguments)},lc=function(e){function t(t,n){var r=e.call(this,t)||this;return r.on("reset",r.onReset),r.on("remove",r.onRemove),r.model=function(e,t){return void 0===t&&(t={}),new ic(e,sc(sc({},t),{em:n}))},r}return ac(t,e),t.prototype.onReset=function(e,t){var n,r=this;null===(n=null==t?void 0:t.previousModels)||void 0===n||n.map((function(e){return r.onRemove(e)}))},t.prototype.onRemove=function(e){null==e||e.onRemove()},t}(l.FE);const cc=lc;var uc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dc="change:selected",pc="main",fc=function(n){function r(t){var r=n.call(this,t,"PageManager",new cc([],t),W)||this;r.events=W,r.storageKey="pages",(0,e.bindAll)(r,"_onPageChange");var o=new y.Z({_undo:!0});return r.model=o,r.pages.on("reset",(function(e){return e.at(0)&&r.select(e.at(0))})),r.pages.on("all",r.__onChange,r),o.on(dc,r._onPageChange),r}return uc(r,n),Object.defineProperty(r.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),r.prototype.getAll=function(){return function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],this.all.models,!0)},r.prototype.__onChange=function(e,t,n,r){var o=this.em,i=this.events,a=r||n;o.trigger(i.all,{event:e,page:t,options:a})},r.prototype.onLoad=function(){var e,t=this,n=t.pages,r=t.config,o=t.em,i={silent:!0},a=(null===(e=r.pages)||void 0===e?void 0:e.map((function(e){return new ic(e,{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(e,t,n){var r=this.em,o=this.events,i=r.Layers,a=t.getMainComponent();i&&a&&i.setRoot(a),r.trigger(o.select,t,e.previous("selected")),this.__onChange(dc,t,n)},r.prototype.postLoad=function(){var e=this,t=e.em,n=e.model,r=e.pages,o=t.UndoManager;o.add(n),o.add(r),r.on("add remove reset change",(function(e,n,r){return t.changesUp(r||n)}))},r.prototype.add=function(e,t){var n=this;void 0===t&&(t={});var r=this.em,o=this.events;e.id=e.id||this._createId();var i=function(){var r=n.pages.add(new ic(e,{em:n.em,config:n.config}),t);return t.select&&n.select(r),r};return!t.silent&&r.trigger(o.addBefore,e,i,t),t.abort?void 0:i()},r.prototype.remove=function(t,n){var r=this;void 0===n&&(n={});var o=this.em,i=this.events,a=(0,e.isString)(t)?this.get(t):t,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(e){return this.pages.filter((function(t){return t.get(t.idAttribute)===e}))[0]},r.prototype.getMain=function(){var e=this.pages;return e.filter((function(e){return e.get("type")===pc}))[0]||e.at(0)},r.prototype.getAllWrappers=function(){var t=this.getAll();return(0,e.unique)((0,e.flatten)(t.map((function(e){return e.getAllFrames().map((function(e){return e.getComponent()}))}))))},r.prototype.select=function(t,n){void 0===n&&(n={});var r=this,o=r.em,i=r.model,a=r.events,s=(0,e.isString)(t)?this.get(t):t;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 e=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),["selected","model"].map((function(t){return e[t]=0}))},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(e){var t=this.loadProjectData(e,{all:this.pages,reset:!0});return this.pages.forEach((function(e){return e.getFrames().initRefs()})),t},r.prototype._initPage=function(){return this.get(this.config.selected)||this.getMain()},r.prototype._createId=function(){var e,n=this.getAll().length+16,r=this.getAllMap();do{e=(0,t.createId)(n)}while(r[e]);return e},r}(m);const hc=fc;var gc={placeholder:"eg. Text here"};const mc={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:gc,alt:gc,title:gc,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(e){e.add="i18n:add",e.update="i18n:update",e.locale="i18n:locale"}(vc||(vc={}));const yc=vc;var bc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wc=function(n){function r(e){var t=n.call(this,e,"I18n",mc)||this;t.events=yc;var r=t.config.messagesAdd;return r&&t.addMessages(r),t.config.detectLocale&&(t.config.locale=t._localLang()),t}return bc(r,n),r.prototype.setLocale=function(e){var t=this,n=t.em,r=t.config,o=t.events;return n.trigger(o.locale,{value:e,valuePrev:r.locale}),r.locale=e,this},r.prototype.getLocale=function(){return this.config.locale},r.prototype.getMessages=function(e,t){void 0===t&&(t={});var n=this.config.messages;return e&&!n[e]&&this._debug("'".concat(e,"' i18n lang not found"),t),e?n[e]:n},r.prototype.setMessages=function(e){var t=this,n=t.em,r=t.config,o=t.events;return r.messages=e,n.trigger(o.update,e),this},r.prototype.addMessages=function(e){var n=this,r=n.em,o=n.events,i=n.config.messages;return r.trigger(o.add,e),this.setMessages((0,t.deepMerge)(i,e)),this},r.prototype.t=function(t,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(t,i,n);return s||(s=this._getMsg(t,a,n)),!s&&this._debug("'".concat(t,"' i18n key not found in '").concat(i,"' lang"),n),s=s&&(0,e.isString)(s)?this._addParams(s,o):s},r.prototype._localLang=function(){var e=(0,t.hasWin)()&&window.navigator||{},n=e.language||e.userLanguage;return n?n.split("-")[0]:"en"},r.prototype._addParams=function(e,t){var n=new RegExp("{([\\w\\d-]*)}","g");return e.replace(n,(function(e,n){return t[n]||""})).trim()},r.prototype._getMsg=function(t,n,r){void 0===r&&(r={});var o=this.getMessages(n,r);if(o){var i=o[t];return!i&&t.indexOf(".")>0&&(i=t.split(".").reduce((function(t,n){if(!(0,e.isUndefined)(t))return t[n]}),o)),i}},r.prototype._debug=function(e,t){void 0===t&&(t={});var n=this.em,r=this.config;(t.debug||r.debug)&&n&&n.logWarning(e)},r.prototype.destroy=function(){},r}(g);const xc=wc;var Cc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sc=function(){return Sc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Sc.apply(this,arguments)},_c=function(){},Ec={id:"sorter-target",type:se.q.Target},Oc=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Cc(r,n),r.prototype.initialize=function(t){void 0===t&&(t={}),this.opt=t||{},(0,e.bindAll)(this,"startSort","onMove","endMove","rollback","updateOffset","moveDragHelper");var n=t||{};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||_c,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,e.result)(this,"scale")||1},r.prototype.getContainerEl=function(e){if(e&&(this.el=e),!this.el){var t=this.opt.container;this.el="string"==typeof t?document.querySelector(t):t,this.$el=(0,a.default)(this.el)}return this.el},r.prototype.getDocuments=function(e){var t=this.em,n=e?e.ownerDocument:null==t?void 0:t.Canvas.getBody().ownerDocument,r=[document];return n&&r.push(n),r},r.prototype.updateOffset=function(){var e,t=(null===(e=this.em)||void 0===e?void 0:e.get("canvasOffset"))||{};this.offTop=t.top,this.offLeft=t.left},r.prototype.setDropContent=function(e){delete this.dropModel,this.dropContent=e},r.prototype.updateTextViewCursorPosition=function(e){var t=this.em;if(t){var n=t.Canvas,r=n.getDocument(),o=null;if(r.caretRangeFromPoint){var i=(0,me.VB)(e);o=r.caretRangeFromPoint(i.clientX,i.clientY)}else e.rangeParent&&(o=r.createRange()).setStart(e.rangeParent,e.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(e,t){if(e){var n=e.getEl();n.contentEditable!=t&&(n.contentEditable=t)}},r.prototype.toggleSortCursor=function(e){var t=this.em,n=null==t?void 0:t.Canvas;n&&(e?n.startAutoscroll():n.stopAutoscroll())},r.prototype.setDragHelper=function(e,t){for(var n=t||"",r=e.cloneNode(!0),o=e.getBoundingClientRect(),i=getComputedStyle(e),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(e){var t=e.target.ownerDocument;if(this.dragHelper&&t){var n=e.pageY,r=e.pageX,o=0,i=0,a=(t.defaultView||t.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=e.clientY,r=e.clientX}s.top=n+o+"px",s.left=r+i+"px"}},r.prototype.matches=function(e,n){return t.matches.call(e,n)},r.prototype.closest=function(e,t){if(e)for(var n=e.parentNode;n&&1===n.nodeType;){if(this.matches(n,t))return n;n=n.parentNode}},r.prototype.offset=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},r.prototype.createPlaceholder=function(){var e=this.pfx,t=document.createElement("div"),n=document.createElement("div");return t.className=e+"placeholder",t.style.display="none",t.style.pointerEvents="none",n.className=e+"placeholder-int",t.appendChild(n),t},r.prototype.startSort=function(e,t){var n,r;void 0===t&&(t={});var o,i=this,a=i.em,s=i.itemSel,l=i.containerSel,c=i.plh,u=this.getContainerEl(t.container),d=this.getDocuments(e);delete this.dropModel,delete this.target,delete this.prevTarget,this.moved=!1,e&&!this.matches(e,"".concat(s,", ").concat(l))&&(e=this.closest(e,s)),this.sourceEl=e,c||(this.plh=this.createPlaceholder(),u.appendChild(this.plh)),e&&((null==(o=this.getSourceModel(e))?void 0:o.set)&&o.set("status","freezed"),this.srcModel=o),(0,me.on)(u,"mousemove dragover",this.onMove),(0,me.on)(d,"mouseup dragend touchend",this.endMove),(0,me.on)(d,"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",e,o)},r.prototype.getTargetModel=function(e){var t=e||this.target;return(0,a.default)(t).data("model")},r.prototype.getSourceModel=function(e,t){var n=this,r=void 0===t?{}:t,o=r.target,i=r.avoidChildren,s=void 0===i?1:i,l=this.em,c=this.sourceEl,u=e||c,d=this.dropModel,p=this.dropContent,f=function(e){return e&&o&&e.opt&&e.opt.avoidChildren&&n.isTextableActive(e,o)};if(p&&l){if(f(d)&&(d=void 0),!d){var h=l.Components.getComponents(),g={avoidChildren:s,avoidStore:1,avoidUpdateStyle:1},m=h.add(p,Sc(Sc({},g),{temporary:!0}));if(d=(d=h.remove(m,g))instanceof Array?d[0]:d,this.dropModel=d,f(d))return this.getSourceModel(u,{target:o,avoidChildren:0})}return d}return u&&(0,a.default)(u).data("model")},r.prototype.selectTargetModel=function(e,t){if(!(e instanceof l.FE||t&&t===e)){var n=this.targetModel;if(n&&n!==this.srcModel&&n.set("status",""),null==e?void 0:e.set){var r=this.em.Canvas;[se.q.Select,se.q.Hover,se.q.Spacing].forEach((function(e){return r.removeSpots({type:e})})),r.addSpot(Sc(Sc({},Ec),{component:e})),e.set("status","selected-parent"),this.targetModel=e}}},r.prototype.onMove=function(t){var n=t,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 d=t.pageY-this.elT+this.el.scrollTop,p=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&o){var f=o.Canvas.getMouseRelativeCanvas(t,{noScroll:1});p=f.x,d=f.y}this.rX=p,this.rY=d,this.eventMove=t;var h=this.getSourceModel(),g=l?l({sorter:this,event:t}):t.target,m=this.dimsFromTarget(g,p,d),v=this.target,y=v&&this.getTargetModel(v);if(this.selectTargetModel(y,h),y||(s.style.display="none"),v){this.lastDims=m;var b=this.findPosition(m,p,d);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,m,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,e.isFunction)(i)&&i({event:t,target:h,parent:y,index:b.index+("after"==b.method?1:0)}),o&&o.trigger("sorter:drag",{target:v,targetModel:y,sourceModel:h,dims:m,pos:b,x:p,y:d})}},r.prototype.isTextableActive=function(e,t){var n;return(null===(n=null==e?void 0:e.get)||void 0===n?void 0:n.call(e,"textable"))&&(null==t?void 0:t.isInstanceOf("text"))},r.prototype.disableTextable=function(){var e=this.activeTextModel;null==e||e.getView().disableEditing(),this.setContentEditable(e,!1)},r.prototype.isInFlow=function(e,t){if(!e)return!1;t=t||document.body;var n=e;return n.offsetHeight,!!this.styleInFlow(n,t)},r.prototype.styleInFlow=function(e,t){if(!(0,me.BM)(e)){var n=e.style||{},r=(0,a.default)(e),o=t&&(0,a.default)(t);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(e.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(t,n){var r=this.getTargetModel(t),o=this.getSourceModel(n,{target:r}),i={valid:!0,src:n=o&&o.view&&o.view.el,srcModel:o,trg:t=r&&r.view&&r.view.el,trgModel:r,draggable:!1,droppable:!1,dragInfo:"",dropInfo:""};if(!n||!t)return i.valid=!1,i;var a=o.get("draggable");if((0,e.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,e.isString)(a)?this.matches(t,a):a,i.draggable=a;var c=r.get("droppable");if((0,e.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,e.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(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0);var r=this.em,o=[];if(!e)return o;if(this.matches(e,"".concat(this.itemSel,", ").concat(this.containerSel))||(e=this.closest(e,this.itemSel)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),!e)return o;if(this.prevTarget&&this.prevTarget!=e&&delete this.prevTarget,!this.prevTarget){this.targetP=this.closest(e,this.containerSel);var i=this.validTarget(e);if(r&&r.trigger("sorter:drag:validation",i),!i.valid&&this.targetP)return this.dimsFromTarget(this.targetP,t,n);this.prevTarget=e,this.prevTargetDim=this.getDim(e),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(e)}if(this.prevTarget==e&&(o=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,t,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(e){var t,n=e,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){t=this.closest(n,i);var s=this.validTarget(n);if(o&&o.trigger("sorter:drag:validation",s),!s.valid&&t)return this.getTargetFromEl(t);this.targetPrev=n}return this.nearElBorders(n)&&(t=this.closest(n,i))&&this.validTarget(t).valid&&(n=t),n},r.prototype.nearElBorders=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument.body,r=this.getCurrentPos(),o=r.x,i=r.y,a=t.top+n.scrollTop,s=t.left+n.scrollLeft,l=t.width,c=t.height;if(i<a+10||i>a+c-10||o<s+10||o>s+l-10)return 1},r.prototype.getCurrentPos=function(){var e=this.eventMove;return{x:(null==e?void 0:e.pageX)||0,y:(null==e?void 0:e.pageY)||0}},r.prototype.getDim=function(e){var t,n,r,o,i=this.em,a=this.canvasRelative,s=null==i?void 0:i.Canvas,l=s?s.getElementOffsets(e):{};if(a&&i){var c=s.getElementPos(e,{noScroll:1});t=c.top,n=c.left,r=c.height,o=c.width}else{var u=this.offset(e);t=this.relative?e.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?e.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=e.offsetHeight,o=e.offsetWidth}return{top:t,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,e.each)(n.children,(function(e,i){var s=e,l=(0,t.getModel)(s,a.default),c=l&&l.index?l.index():i;if((0,me.BM)(s)||r.matches(s,r.itemSel)){var u,d=r.getDim(s),p=r.direction;u="v"==p||"h"!=p&&r.isInFlow(s,n),d.dir=u,d.el=s,d.indexEl=c,o.push(d)}})),o},r.prototype.nearBorders=function(e,t,n){var r=!1,o=this.borderOffset,i=t||0,a=n||0,s=e.top,l=e.left,c=e.height,u=e.width;return(s+o>a||a>s+c-o||l+o>i||i>l+u-o)&&(r=!0),r},r.prototype.findPosition=function(e,t,n){for(var r,o={index:0,indexEl:0,method:"before"},i=0,a=0,s=0,l=0,c=0,u=0,d=0,p=e.length;d<p;d++){var f=(r=e[d]).top,h=r.left,g=r.height,m=r.width;if(u=f+g,l=h+m/2,c=f+g/2,!(a&&h>a||s&&c>=s||i&&h+m<i))if(o.index=d,o.indexEl=r.indexEl,r.dir){if(n<c){o.method="before";break}o.method="after"}else n<u&&(s=u),t<l?(a=l,o.method="before"):(i=l,o.method="after")}return o},r.prototype.movePlaceholder=function(e,t,n,r){var o=0,i=0,a="",s="",l="px",c=n.method,u=t[n.index];if(e.classList.remove("vertical"),e.classList.add("horizontal"),u){var d=u.top,p=u.left,f=u.height,h=u.width;u.dir?(a=h+l,s="auto",o="before"==c?d-0:d+f-0,i=p):(a="auto",s=f-0+l,o=d+0,i="before"==c?p-0:p+h-0,e.classList.remove("horizontal"),e.classList.add("vertical"))}else{if(!this.nested)return void(e.style.display="none");if(r){var g=r.offsets||{},m=g.paddingTop||5,v=g.paddingLeft||5,y=g.borderTopWidth||0,b=g.borderLeftWidth||0,w=b+(g.borderRightWidth||0);o=r.top+m+y,i=r.left+v+b,a=parseInt("".concat(r.width))-2*v-w+l,s="auto"}}e.style.top=o+l,e.style.left=i+l,a&&(e.style.width=a),s&&(e.style.height=s)},r.prototype.parents=function(e){return e?[e].concat(this.parents(e.parent())):[]},r.prototype.sort=function(e,t){var n=e.parents.filter((function(e){return t.parents.includes(e)}))[0];if(!n)return t.model.index()-e.model.index();var r=e.parents[e.parents.indexOf(n)-1];return t.parents[t.parents.indexOf(n)-1].index()-r.index()},r.prototype.endMove=function(){var t,n,r=this,o=this.sourceEl,i=[],a=this.getDocuments(),s=this.getContainerEl(),l=this.onEndMove,c=this.onEnd,u=this.target,d=this.lastPos;if((0,me.S1)(s,"mousemove dragover",this.onMove),(0,me.S1)(a,"mouseup dragend touchend",this.endMove),(0,me.S1)(a,"keydown",this.rollback),this.plh.style.display="none",o&&(n=this.getSourceModel()),this.moved&&u){var p=this.toMove,f=(0,e.isArray)(p)?p:p?[p]:[o],h=0;1===f.length?i.push(this.move(u,f[0],d)):f.map((function(e){return{model:e,parents:r.parents(e)}})).sort(this.sort).forEach((function(e){var t=e.model,n=t.index(),o=t.parent().getEl();i.push(r.move(u,t,Sc(Sc({},d),{indexEl:d.indexEl-h,index:d.index-h}))),o===u&&n<=d.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===(t=this.em)||void 0===t||t.Canvas.removeSpots(Ec),delete this.toMove,delete this.eventMove,delete this.dropModel,(0,e.isFunction)(l)){var m={target:n,parent:n&&n.parent(),index:n&&n.index()};i.length?i.forEach((function(e){return l(e,r,m)})):l(null,this,Sc(Sc({},m),{cancelled:1}))}(0,e.isFunction)(c)&&c({sorter:this})},r.prototype.move=function(n,r,o){var i,s,c=this.em,u=this.dropContent,d=(0,t.getElement)(r),p=[],f="after"===o.method?o.indexEl+1:o.indexEl,h=this.validTarget(n,d),g=(0,a.default)(n).data("collection"),m=h.trgModel,v=h.srcModel,y=h.draggable,b=m instanceof l.FE?1:h.droppable;if(g&&b&&y){var w={at:f,action:"move-component"},x=this.isTextableActive(v,m);if(u)i=(0,e.isFunction)(u)?u():u,w.avoidUpdateStyle=!0,w.action="add-component";else{var C=v.collection.indexOf(v),S=g===v.collection;(!S||!(C===f||C===f-1)||x)&&(i=v.collection.remove(v,{temporary:!0}),S&&f>C&&(w.at=f-1))}i&&(x?(delete w.at,s=m.getView().insertComponent(i,w)):s=g.add(i,w)),delete this.dropContent,delete this.prevTarget}else if(c){var _=h.dropInfo||(null==m?void 0:m.get("droppable")),E=h.dragInfo||(null==v?void 0:v.get("draggable"));!g&&p.push("Target collection not found"),!b&&_&&p.push("Target is not droppable, accepts [".concat(_,"]")),!y&&E&&p.push("Component not draggable, acceptable by [".concat(E,"]")),c.logWarning("Invalid target position",{errors:p,model:v,context:"sorter",target:m})}return null==c||c.trigger("sorter:drag:end",{targetCollection:g,modelToDrop:i,warns:p,validResult:h,dst:n,srcEl:d}),s},r.prototype.rollback=function(e){(0,me.S1)(this.getDocuments(),"keydown",this.rollback),27==(e.which||e.keyCode)&&(this.moved=!1,this.endMove())},r}(l.G7);const kc=Oc;var Tc=function(){return Tc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Tc.apply(this,arguments)},Pc=function(){function n(t){void 0===t&&(t={}),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=Tc({},this.defOpts),this.setOptions(t),(0,e.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop")}return n.prototype.getConfig=function(){return this.opts},n.prototype.setOptions=function(e,t){void 0===e&&(e={}),this.opts=Tc(Tc({},t?this.defOpts:this.opts),e),this.setup()},n.prototype.setup=function(){var e=this.opts,t=e.prefix||"",n=e.appendTo||document.body,r=this.container;for(r||((r=document.createElement("div")).className="".concat(t,"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(t){return o[t]=e[t]?function(e,t){void 0===t&&(t={});var n=t.prefix||"",r=document.createElement("i");return r.className=n+"resizer-h "+n+"resizer-h-"+e,r.setAttribute("data-"+n+"handler",e),r}(t,e):null})),o){var a=o[i];a&&r.appendChild(a)}this.handlers=o,this.mousePosFetcher=e.mousePosFetcher,this.updateTarget=e.updateTarget,this.posFetcher=e.posFetcher,this.onStart=e.onStart,this.onMove=e.onMove,this.onEnd=e.onEnd,this.onUpdateContainer=e.onUpdateContainer},n.prototype.toggleFrames=function(t){if(this.opts.silentFrames){var n=document.querySelectorAll("iframe");(0,e.each)(n,(function(e){return e.style.pointerEvents=t?"none":""}))}},n.prototype.isHandler=function(e){var t=this.handlers;for(var n in t)if(t[n]===e)return!0;return!1},n.prototype.getFocusedEl=function(){return this.el},n.prototype.getParentEl=function(){var e;return null===(e=this.el)||void 0===e?void 0:e.parentElement},n.prototype.getDocumentEl=function(){return[this.el.ownerDocument,document]},n.prototype.getElementPos=function(e,t){void 0===t&&(t={});var n=this.posFetcher;return n?n(e,t):function(e,t){var n=t||window,r=e.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}}(e)},n.prototype.focus=function(e){e&&e===this.el||(this.el=e,this.updateContainer({forceShow:!0}),(0,me.on)(this.getDocumentEl(),"pointerdown",this.handleMouseDown))},n.prototype.blur=function(){this.container.style.display="none",this.el&&((0,me.S1)(this.getDocumentEl(),"pointerdown",this.handleMouseDown),delete this.el)},n.prototype.start=function(t){var n=t;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 d=this.getDocumentEl();this.docs=d,(0,me.on)(d,"pointermove",this.move),(0,me.on)(d,"keydown",this.handleKeyDown),(0,me.on)(d,"pointerup",this.stop),(0,e.isFunction)(this.onStart)&&this.onStart(n,{docs:d,config:i,el:r,resizer:this}),this.toggleFrames(!0),this.move(n)}},n.prototype.move=function(e){var t=e,n=this.onMove,r=this.mousePosFetcher,o=r?r(t):{x:t.clientX,y:t.clientY};this.currentPos=o,this.delta={x:o.x-this.startPos.x,y:o.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(!1),n&&n(t)},n.prototype.stop=function(t){var n=this.el,r=this.opts,o=this.docs||this.getDocumentEl();(0,me.S1)(o,"pointermove",this.move),(0,me.S1)(o,"keydown",this.handleKeyDown),(0,me.S1)(o,"pointerup",this.stop),this.updateRect(!0),this.toggleFrames(),(0,e.isFunction)(this.onEnd)&&this.onEnd(t,{docs:o,config:r,el:n,resizer:this}),delete this.docs},n.prototype.updateRect=function(t){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,e.isFunction)(i))i(n,o,{store:t,selectedHandler:a,resizer:this,config:r});else{var d=n.style;d[c]=o.w+l,d[u]=o.h+s}this.updateContainer()},n.prototype.updateContainer=function(e){var t;void 0===e&&(e={});var n=this,r=n.opts,o=n.container,i=n.el,a=o.style;!r.avoidContainerUpdate&&i&&e.forceShow&&(a.display="block"),null===(t=this.onUpdateContainer)||void 0===t||t.call(this,{el:o,resizer:this,opts:Tc(Tc({},r),e)})},n.prototype.getSelectedHandler=function(){var e=this.handlers;if(this.selectedHandler)for(var t in e)if(e[t]===this.selectedHandler)return t},n.prototype.handleKeyDown=function(e){27===e.keyCode&&(this.rectDim=this.startDim,this.stop(e))},n.prototype.handleMouseDown=function(e){var t=e.target;this.isHandler(t)?(this.selectedHandler=t,this.start(e)):t!==this.el&&(delete this.selectedHandler,this.blur())},n.prototype.calc=function(e){var n,r=this.opts||{},o=r.step,i=this.startDim,a=r.minDim,s=r.maxDim,l=e.delta.x,c=e.delta.y,u=this.parentDim.w,d=this.parentDim.h,p=this.opts.unitWidth,f=this.opts.unitHeight,h="%"===p?i.w/100*u:i.w,g="%"===f?i.h/100*d:i.h,m={t:i.t,l:i.l,w:h,h:g};if(e){var v=e.handlerAttr;~v.indexOf("r")&&(n="%"===p?(0,t.normalizeFloat)((h+l*o)/u*100,.01):(0,t.normalizeFloat)(h+l*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),m.w=n),~v.indexOf("b")&&(n="%"===f?(0,t.normalizeFloat)((g+c*o)/d*100,.01):(0,t.normalizeFloat)(g+c*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),m.h=n),~v.indexOf("l")&&(n="%"===p?(0,t.normalizeFloat)((h-l*o)/u*100,.01):(0,t.normalizeFloat)(h-l*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),m.w=n),~v.indexOf("t")&&(n="%"===f?(0,t.normalizeFloat)((g-c*o)/d*100,.01):(0,t.normalizeFloat)(g-c*o,o),n=Math.max(a,n),s&&(n=Math.min(s,n)),m.h=n);var y=r.ratioDefault?!e.keys.shift:e.keys.shift;if(v.indexOf("c")<0&&y){var b=i.w/i.h;m.w/m.h>b?m.h=Math.round(m.w/b):m.w=Math.round(m.h*b)}for(var w in~v.indexOf("l")&&(m.l+=i.w-m.w),~v.indexOf("t")&&(m.t+=i.h-m.h),m){var x=w;m[x]=parseInt("".concat(m[x]),10)}return m}},n}();const Mc=Pc;var Ac=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dc=function(){return Dc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Dc.apply(this,arguments)};const Nc=function(e){function n(n){var r=e.call(this,n,"Utils")||this;return r.Sorter=kc,r.Resizer=Mc,r.Dragger=Re.Z,r.helpers=Dc({},t),r}return Ac(n,e),n.prototype.destroy=function(){},n}(g);var Rc,jc={},Ic={16:!1,18:!1,17:!1,91:!1},Lc="all",Fc={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},Vc={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},Bc=function(e){return Vc[e]||e.toUpperCase().charCodeAt(0)},zc=[];for(Rc=1;Rc<20;Rc++)Vc["f"+Rc]=111+Rc;function Hc(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function $c(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Wc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function Uc(e){for(Rc in Ic)Ic[Rc]=e[Wc[Rc]]}function qc(e){var t,n=e.keyCode,r=Hc(zc,n);if(r>=0&&zc.splice(r,1),93!=n&&224!=n||(n=91),n in Ic)for(t in Ic[n]=!1,Fc)Fc[t]==n&&(Yc[t]=!1)}function Gc(){for(Rc in Ic)Ic[Rc]=!1;for(Rc in Fc)Yc[Rc]=!1}function Yc(e,t,n){var r,o;r=Zc(e),void 0===n&&(n=t,t="all");for(var i=0;i<r.length;i++)o=[],(e=r[i].split("+")).length>1&&(o=Xc(e),e=[e[e.length-1]]),e=e[0],(e=Bc(e))in jc||(jc[e]=[]),jc[e].push({shortcut:r[i],scope:t,method:n,key:r[i],mods:o})}for(Rc in Fc)Yc[Rc]=!1;function Kc(){return Lc||"all"}function Zc(e){var t;return""==(t=(e=e.replace(/\s/g,"")).split(","))[t.length-1]&&(t[t.length-2]+=","),t}function Xc(e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=Fc[t[n]];return t}function Jc(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,(function(){n(window.event)}))}Yc.setScope=function(e){Lc=e||"all"},Yc.getScope=Kc,Yc.deleteScope=function(e){var t,n,r;for(t in jc)for(n=jc[t],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++},Yc.filter=function(e){var t=(e.target||e.srcElement).tagName;return!("INPUT"==t||"SELECT"==t||"TEXTAREA"==t)},Yc.isPressed=function(e){return"string"==typeof e&&(e=Bc(e)),-1!=Hc(zc,e)},Yc.getPressedKeyCodes=function(){return zc.slice(0)},Yc.unbind=function(e,t){var n,r,o,i,a,s=[];for(n=Zc(e),i=0;i<n.length;i++){if((r=n[i].split("+")).length>1&&(s=Xc(r)),e=r[r.length-1],e=Bc(e),void 0===t&&(t=Kc()),!jc[e])return;for(o=0;o<jc[e].length;o++)(a=jc[e][o]).scope===t&&$c(a.mods,s)&&(jc[e][o]={})}},Yc.handlers=jc,Yc.init=function(e){Jc(e.document,"keydown",(function(e){!function(e){var t,n,r,o,i,a;if(t=e.keyCode,-1==Hc(zc,t)&&zc.push(t),93!=t&&224!=t||(t=91),t in Ic)for(r in Ic[t]=!0,Fc)Fc[r]==t&&(Yc[r]=!0);else if(Uc(e),Yc.filter.call(this,e)&&t in jc)for(a=Kc(),o=0;o<jc[t].length;o++)if((n=jc[t][o]).scope==a||"all"==n.scope){for(r in i=n.mods.length>0,Ic)(!Ic[r]&&Hc(n.mods,+r)>-1||Ic[r]&&-1==Hc(n.mods,+r))&&(i=!1);(0!=n.mods.length||Ic[16]||Ic[18]||Ic[17]||Ic[91])&&!i||!1===n.method(e,n)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}(e)})),Jc(e.document,"keyup",qc),Jc(e,"focus",Gc)};const Qc=Yc;const eu={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 e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nu=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};(0,t.hasWin)()&&Qc.init(window);var ru=function(t){function n(e){var n=t.call(this,e,"Keymaps",eu)||this;return n.keymaster=Qc,n.keymaps={},n}return tu(n,t),n.prototype.onLoad=function(){var e=this.config.defaults;for(var t in e){var n=e[t];this.add(t,n.keys,n.handler,n.opts||{})}},n.prototype.add=function(t,n,r,o){void 0===o&&(o={});var i=this.em,a=i.Commands,s=i.getEditor(),l=i.Canvas,c={id:t,keys:n,handler:r};return this.keymaps[t]&&this.remove(t),this.keymaps[t]=c,Qc(n,(function(n,c){var u={event:n,h:c},d=(0,e.isString)(r)?a.get(r):r;if(!i.isEditing()&&!s.Canvas.isInputFocused()||o.force){o.prevent&&l.getCanvasView().preventDefault(n),(0,e.isFunction)(d)?d(s,0,u):a.runCommand(d,u);var p=[t,c.shortcut,n];i.trigger.apply(i,nu(["keymap:emit"],p,!1)),i.trigger.apply(i,nu(["keymap:emit:".concat(t)],p,!1))}}),void 0),i.trigger("keymap:add",c),c},n.prototype.get=function(e){return this.keymaps[e]},n.prototype.getAll=function(){return this.keymaps},n.prototype.remove=function(e){var t=this.em,n=this.get(e);if(n)return delete this.keymaps[e],n.keys.split(", ").forEach((function(e){Qc.unbind(e.trim())})),null==t||t.trigger("keymap:remove",n),n},n.prototype.removeAll=function(){var e=this;return Object.keys(this.keymaps).forEach((function(t){return e.remove(t)})),Qc.handlers={},this},n.prototype.destroy=function(){this.removeAll(),this.keymaps={}},n}(g);const ou=ru;const iu={stylePrefix:"mdl-",title:"",content:"",backdrop:!0,custom:!1,extend:{}};var au=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const su=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return au(t,e),t.prototype.defaults=function(){return{title:"",content:"",attributes:{},open:!1}},t.prototype.open=function(){this.set("open",!0)},t.prototype.close=function(){this.set("open",!1)},t}(y.Z);var lu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cu=function(){return cu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cu.apply(this,arguments)},uu=function(e){function t(t){var n=e.call(this,t)||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 lu(t,e),t.prototype.template=function(e){var t=e.pfx,n=e.ppfx,r=e.content,o=e.title;return'<div class="'.concat(t,"dialog ").concat(n,"one-bg ").concat(n,'two-color">\n <div class="').concat(t,'header">\n <div class="').concat(t,'title">').concat(o,'</div>\n <div class="').concat(t,'btn-close" data-close-modal>⨯</div>\n </div>\n <div class="').concat(t,'content">\n <div id="').concat(t,'c">').concat(r,'</div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div class="').concat(t,'collector" style="display: none"></div>')},t.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},t.prototype.onClick=function(e){this.config.backdrop&&e.target===this.el&&this.hide()},t.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},t.prototype.getContent=function(){var e=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(e,"content #").concat(e,"c"))),this.$content},t.prototype.getTitle=function(e){return void 0===e&&(e={}),this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),e.$?this.$title:this.$title.get(0)},t.prototype.updateContent=function(){var e=this.getContent(),t=e.children(),n=this.getCollector(),r=this.model.get("content");t.length&&n.append(t),e.empty().append(r)},t.prototype.updateTitle=function(){var e=this.getTitle({$:!0});e&&e.empty().append(this.model.get("title"))},t.prototype.updateOpen=function(){this.el.style.display=this.model.get("open")?"":"none"},t.prototype.hide=function(){this.model.close()},t.prototype.show=function(){this.model.open()},t.prototype.updateAttr=function(e){var t=this,n=t.pfx,r=t.$el,o=t.el,i=[].slice.call(o.attributes).map((function(e){return e.name}));r.removeAttr(i.join(" ")),r.attr(cu(cu({},e||{}),{class:"".concat(n,"container ").concat(e&&e.class||"").trim()}))},t.prototype.render=function(){var e=this.$el,t=this.model.toJSON();return t.pfx=this.pfx,t.ppfx=this.ppfx,e.html(this.template(t)),this.updateAttr(),this.updateOpen(),this},t}(ge);const du=uu;var pu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fu=function(t){function n(n){var r=t.call(this,n,"Modal",iu)||this;return r.model=new su(r),r.model.on("change:open",(function(e,t){n.trigger("modal:".concat(t?"open":"close"))})),r.model.on("change",(0,e.debounce)((function(){var t=r._evData(),o=r.config.custom;(0,e.isFunction)(o)&&o(t),n.trigger("modal",t)}),0)),r}return pu(n,t),n.prototype._evData=function(){var t=this,n=this.getTitle(),r=this.getContent(),o=this.model.attributes;return{open:o.open,attributes:o.attributes,title:(0,e.isString)(n)?(0,me.rw)(n):n,content:(0,e.isString)(r)?(0,me.rw)(r):r.get?r.get(0):r,close:function(){t.close()}}},n.prototype.postRender=function(e){var t=e.model.config.el||e.el,n=this.render();n&&(null==t||t.appendChild(n))},n.prototype.open=function(e){void 0===e&&(e={});var t=e.attributes||{};return e.title&&this.setTitle(e.title),e.content&&this.setContent(e.content),this.model.set("attributes",t),this.model.open(),this.modal&&this.modal.updateAttr(t),this},n.prototype.close=function(){return this.model.close(),this},n.prototype.onceClose=function(e){return this.em.once("modal:close",e),this},n.prototype.onceOpen=function(e){return this.em.once("modal:open",e),this},n.prototype.isOpen=function(){return!!this.model.get("open")},n.prototype.setTitle=function(e){return this.model.set("title",e),this},n.prototype.getTitle=function(){return this.model.get("title")},n.prototype.setContent=function(e){return this.model.set("content"," "),this.model.set("content",e),this},n.prototype.getContent=function(){return this.model.get("content")},n.prototype.getContentEl=function(){var e;return null===(e=this.modal)||void 0===e?void 0:e.getContent().get(0)},n.prototype.getModel=function(){return this.model},n.prototype.render=function(){var e;if(!this.config.custom){var t=du.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new t({el:n,model:this.model,config:this.config}),null===(e=this.modal)||void 0===e?void 0:e.render().el}},n.prototype.destroy=function(){var e;null===(e=this.modal)||void 0===e||e.remove()},n}(g);const hu=fu;var gu="sw-visibility",mu="export-template",vu="open-sm",yu="open-tm",bu="open-layers",wu="open-blocks",xu="fullscreen",Cu="preview";const Su={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:gu,className:"fa fa-square-o",command:"core:component-outline",context:gu,attributes:{title:"View components"}},{id:Cu,className:"fa fa-eye",command:Cu,context:Cu,attributes:{title:"Preview"}},{id:xu,className:"fa fa-arrows-alt",command:xu,context:xu,attributes:{title:"Fullscreen"}},{id:mu,className:"fa fa-code",command:mu,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:yu,className:"fa fa-cog",command:yu,togglable:!1,attributes:{title:"Settings"}},{id:bu,className:"fa fa-bars",command:bu,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:wu,className:"fa fa-th-large",command:wu,togglable:!1,attributes:{title:"Open Blocks"}}]}]};var _u=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Eu=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.get("buttons").length&&r.set("buttons",new Tu(r.module,r.get("buttons"))),r}return _u(t,e),t.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(t.prototype,"className",{get:function(){return this.get("className")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"command",{get:function(){return this.get("command")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this.get("active")},set:function(e){this.set("active",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"togglable",{get:function(){return this.get("togglable")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runDefaultCommand",{get:function(){return this.get("runDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stopDefaultCommand",{get:function(){return this.get("stopDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disable",{get:function(){return this.get("disable")},enumerable:!1,configurable:!0}),t}(y.Z);var Ou=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(e){function t(t,n){return e.call(this,t,n,Eu)||this}return Ou(t,e),t.prototype.deactivateAllExceptOne=function(e,t){this.forEach((function(n,r){n!==e&&(n.set("active",!1),t&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(e,t))}))},t.prototype.deactivateAll=function(e,t){var n=e||"";this.forEach((function(e){e.get("context")==n&&e!==t&&e.set("active",!1,{fromCollection:!0})}))},t.prototype.disableAllButtons=function(e){var t=e||"";this.forEach((function(e,n){e.get("context")==t&&e.set("disable",!0)}))},t.prototype.disableAllButtonsExceptOne=function(e,t){this.forEach((function(n,r){n!==e&&(n.set("disable",!0),t&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(e,t))}))},t}(G);const Tu=ku;ku.prototype.model=Eu;var Pu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Mu=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.get("buttons")||[];return r.buttons=new Tu(t,o),r}return Pu(t,e),t.prototype.defaults=function(){return{id:"",content:"",visible:!0,buttons:[],attributes:{}}},Object.defineProperty(t.prototype,"buttons",{get:function(){return this.get("buttons")},set:function(e){this.set("buttons",e)},enumerable:!1,configurable:!0}),t}(y.Z);var Au=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Du=function(e){function t(t,n){return e.call(this,t,n,Mu)||this}return Au(t,e),t}(G);const Nu=Du;Du.prototype.model=Mu;var Ru=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ju=function(){return ju=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ju.apply(this,arguments)},Iu=function(t){function n(n){var r=t.call(this,n)||this,o=r,i=o.model,a=o.em,s=o.pfx,l=o.ppfx,c=i.className,u=i.attributes,d=u.command,p=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,e.isString)(d)&&p){var f={fromListen:!0};r.listenTo(a,"run:".concat(d),(function(){return i.set("active",!0,f)})),r.listenTo(a,"stop:".concat(d),(function(){return i.set("active",!1,f)}))}return a&&a.get&&(r.commands=a.get("Commands")),r}return Ru(n,t),n.prototype.tagName=function(){return this.model.get("tagName")},n.prototype.events=function(){return{click:"clicked"}},n.prototype.updateClassName=function(){var e=this.model,t=this.pfx,n=e.className,r=e.get("attributes").class,o="".concat(r||""," ").concat(t,"btn ").concat(n||"");this.$el.attr("class",o.trim())},n.prototype.updateAttributes=function(){var e=this,t=e.em,n=e.model,r=e.$el,o=n.get("attributes")||{},i=t&&t.t&&t.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(t,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,d=r.fromListen,p=a.get("context"),f=a.get("options"),h=a.command,g={};h&&(s&&(0,e.isString)(h)?g=s.get(h)||{}:(0,e.isFunction)(h)?g=s.create({run:h}):null!==h&&(0,e.isObject)(h)&&(g=s.create(h)),a.active?(!u&&(null===(o=a.collection)||void 0===o||o.deactivateAll(p,a)),a.set("active",!0,{silent:!0}).trigger("checkActive"),!d&&s.runCommand(g,ju(ju({},f),{sender:a})),g.noStop&&a.set("active",!1)):(l.removeClass(c),!d&&s.stopCommand(g,ju(ju({},f),{sender:a,force:1}))))},n.prototype.updateDisable=function(){var e=this.disableCls,t=this.model.disable;this.$el[t?"addClass":"removeClass"](e)},n.prototype.checkActive=function(){var e=this,t=e.model,n=e.$el,r=e.activeCls;t.active?n.addClass(r):n.removeClass(r)},n.prototype.clicked=function(){var e=this.model;e.get("bntsVis")||e.disable||!e.command||this.toggleActive()},n.prototype.toggleActive=function(){var e=this.model,t=this.em,n=e.active,r=e.togglable;n&&!r||(e.active=!n,n?e.runDefaultCommand&&t.runDefault():e.stopDefaultCommand&&t.stopDefault())},n.prototype.render=function(){var e=this.model,t=e.get("label"),n=this.$el;return!e.get("el")&&n.empty(),this.updateAttributes(),t&&n.append(t),this.checkActive(),this.updateDisable(),this},n}(ge);const Lu=Iu;var Fu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Vu=function(t){function n(e){var n=t.call(this,{collection:e})||this;return n.listenTo(n.collection,"add",n.addTo),n.listenTo(n.collection,"reset remove",n.render),n.className=n.pfx+"buttons",n}return Fu(n,t),n.prototype.addTo=function(e){this.addToCollection(e)},n.prototype.addToCollection=function(e,t){var n=t||null,r=e.get("el"),o=new Lu({el:r,model:e}).render().el;return n?n.appendChild(o):this.$el.append(o),o},n.prototype.render=function(){var t=this,n=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(e){return t.addToCollection(e,n)})),this.$el.append(n),this.$el.attr("class",(0,e.result)(this,"className")),this},n}(ge);var Bu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zu=function(){return zu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zu.apply(this,arguments)},Hu=function(e){function t(t){var n=e.call(this,{model:t,el:t.get("el")})||this;return n.className=n.pfx+"panel",n.id=n.pfx+t.get("id"),n.listenTo(t,"change:appendContent",n.appendContent),n.listenTo(t,"change:content",n.updateContent),n.listenTo(t,"change:visible",n.toggleVisible),t.view=n,n}return Bu(t,e),t.prototype.appendContent=function(){this.$el.append(this.model.get("appendContent"))},t.prototype.updateContent=function(){this.$el.html(this.model.get("content"))},t.prototype.toggleVisible=function(){this.model.get("visible")?this.$el.removeClass("".concat(this.ppfx,"hidden")):this.$el.addClass("".concat(this.ppfx,"hidden"))},t.prototype.attributes=function(){return this.model.get("attributes")},t.prototype.initResize=function(){var e=this.em,t=null==e?void 0:e.Editor,n=this.model.get("resizable");if(t&&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 t.Utils.Resizer(zu({tc:i,cr:a,bc:s,cl:l,tl:!1,tr:!1,bl:!1,br:!1,appendTo:this.el,silentFrames:!0,avoidContainerUpdate:!0,prefix:t.getConfig().stylePrefix,onEnd:function(){e.Canvas.refresh({all:!0})},posFetcher:function(e,t){var n=t.target,r=e.style,o=u.getConfig(),i=o.keyWidth,a=o.keyHeight,s=e.getBoundingClientRect(),l="container"==n,c=r[i],d=r[a];return{left:0,top:0,width:c&&!l?parseFloat(c):s.width,height:d&&!l?parseFloat(d):s.height}}},n&&"boolean"!=typeof n?n:{}));u.blur=function(){},u.focus(this.el)}},t.prototype.render=function(){var e=this.model.buttons,t=this.$el,n=this.ppfx,r="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");if(t.addClass(r),this.toggleVisible(),e.length){var o=new Vu(e);t.append(o.render().el)}return t.append(this.model.get("content")),this},t}(ge);const $u=Hu;var Wu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Uu=function(e){function t(t){var n=e.call(this,{collection:t})||this;return n.listenTo(t,"add",n.addTo),n.listenTo(t,"reset",n.render),n.listenTo(t,"remove",n.onRemove),n.className=n.pfx+"panels",n}return Wu(t,e),t.prototype.onRemove=function(e){var t=e.view;t&&t.remove()},t.prototype.addTo=function(e){this.addToCollection(e)},t.prototype.addToCollection=function(e,t){var n=t||null,r=e.get("el"),o=new $u(e),i=o.render().el,a=e.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},t.prototype.render=function(){var e=this,t=this.$el,n=document.createDocumentFragment();return t.empty(),this.collection.each((function(t){return e.addToCollection(t,n)})),t.append(n),t.attr("class",this.className),this},t}(ge);var qu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gu=function(e){function t(t){var n=e.call(this,t,"Panels",Su)||this;for(var r in n.panels=new Nu(n,n.config.defaults),Su)r in n.config||(n.config[r]=Su[r]);return n}return qu(t,e),t.prototype.getPanels=function(){return this.panels},t.prototype.getPanelsEl=function(){var e;return null===(e=this.PanelsViewObj)||void 0===e?void 0:e.el},t.prototype.addPanel=function(e){return this.panels.add(e)},t.prototype.removePanel=function(e){return this.panels.remove(e)},t.prototype.getPanel=function(e){var t=this.panels.where({id:e});return t.length?t[0]:null},t.prototype.addButton=function(e,t){var n=this.getPanel(e);return n?n.buttons.add(t):null},t.prototype.removeButton=function(e,t){var n=this.getPanel(e);return n&&n.buttons.remove(t)},t.prototype.getButton=function(e,t){var n=this.getPanel(e);if(n){var r=n.buttons.where({id:t});return r.length?r[0]:null}return null},t.prototype.render=function(){var e;return null===(e=this.PanelsViewObj)||void 0===e||e.remove(),this.PanelsViewObj=new Uu(this.panels),this.PanelsViewObj.render().el},t.prototype.active=function(){this.getPanels().each((function(e){e.buttons.each((function(e){e.get("active")&&e.trigger("updateActive")}))}))},t.prototype.disableButtons=function(){this.getPanels().each((function(e){e.buttons.each((function(e){e.get("disable")&&e.trigger("change:disable")}))}))},t.prototype.destroy=function(){this.panels.reset(),this.panels.stopListening(),this.PanelsViewObj&&this.PanelsViewObj.remove()},t}(g);const Yu=Gu;const Ku={stylePrefix:"cm-",optsCodeViewer:{}};var Zu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Xu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Zu(t,e),t.prototype.build=function(e,t){void 0===t&&(t={});var n=t.em,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["em"]);if(t.cleanId&&n){var o=n.Css.getAll().toJSON().map((function(e){var t=e.selectors,n=t&&1===t.length&&t.models[0];return n&&n.isId()&&n.get("name")})).filter(Boolean);r.attributes||(r.attributes=function(e,t){var n=t.id;return n&&"i"===n[0]&&!e.get("script")&&!e.get("attributes").id&&o.indexOf(n)<0&&delete t.id,t})}return e.toHTML(r)},t}(l.Hn);var Ju=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Ju(n,t),n.prototype.build=function(t){var n=this,r=t.toJSON();return this.beforeEach(r),(0,e.each)(r,(function(e,t){var o=r[t];if(o instanceof l.Hn)r[t]=n.build(o);else if(o instanceof l.FE){var i=o;r[t]=[],i.length&&i.forEach((function(e,o){r[t][o]=n.build(e)}))}})),r},n.prototype.beforeEach=function(e){delete e.status},n}(l.Hn);const ed=Qu;var td=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function nd(e){var t;return 0===((null===(t=e.toString().match(/\{([\s\S]*)\}/m))||void 0===t?void 0:t[1])||"").replace(/^\s*\/\/.*$/gm,"").trim().length}var rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return td(n,t),n.prototype.mapModel=function(t){var n,r=this,o="",i=t.get("script-export")||t.get("script"),a=t.get("type"),s=t.get("components"),l=t.getId();if(i){var c=t.get("attributes");c=(0,e.extend)({},c,{id:l}),t.set("attributes",c,{silent:!0});var u=t.getScriptString(i),d=t.get("script-props");if(t.get("scriptUpdated")&&!d)this.mapJs[a+"-"+l]={ids:[l],code:u};else{var p=void 0,f=this.mapJs[a];if(d&&(p=t.__getScriptProps()),f)f.ids.push(l),p&&(f.props[l]=p);else{var h={ids:[l],code:u};p&&(h.props=((n={})[l]=p,n)),this.mapJs[a]=h}}}return s.forEach((function(e){o+=r.mapModel(e)})),o},n.prototype.build=function(e){this.mapJs={},this.mapModel(e);var t="";for(var n in this.mapJs){var r=this.mapJs[n];if(r.code)if(r.props){if(nd(r.code))continue;t+="\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(", #");t+="\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 t},n}(l.Hn);const od=rd;var id,ad=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sd=function(){return sd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sd.apply(this,arguments)};(0,t.hasWin)()&&(id=B(631),B(531),B(629),B(210));var ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return ad(n,t),n.prototype.defaults=function(){return{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0,autoFormat:!0}},n.prototype.init=function(t){return(0,e.bindAll)(this,"onChange"),this.editor=id.fromTextArea(t,sd({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=t,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(e){return this.element=e,this},n.prototype.refresh=function(){return this.getEditor().refresh(),this},n.prototype.focus=function(){return this.getEditor().focus(),this},n.prototype.getContent=function(){var e=this.getEditor();return e&&e.getValue()},n.prototype.setContent=function(e,t){var n=this;void 0===t&&(t={});var r=this.editor;if(r){r.setValue(e);var o=this.get("autoFormat");r.autoFormatRange&&(!0===o||Array.isArray(o)&&o.includes(this.get("codeName")))&&(id.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),id.commands.goDocStart(r)),!t.noRefresh&&setTimeout((function(){return n.refresh()}))}},n}(l.Hn);const cd=ld;ld.prototype.CodeMirror=id;var ud=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ud(t,e),t.prototype.template=function(e){var t,r,o=e.pfx,i=e.codeName,a=e.label;return n(fd||(t=['\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(t,"raw",{value:r}):t.raw=r,fd=t),o,o,i,o,a,o)},t.prototype.initialize=function(e){this.config=e.config||{},this.pfx=this.config.stylePrefix},t.prototype.render=function(){var e,t,n=this,r=n.model,o=n.pfx,i=n.$el,a=r.toJSON(),s=r.get("input")||(null===(t=(e=r).getElement)||void 0===t?void 0:t.call(e));return a.pfx=o,i.html(this.template(a)),i.attr("class","".concat(o,"editor-c")),i.find("#".concat(o,"code")).append(s),this},t}(l.G7);const pd=dd;var fd,hd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gd=function(){return gd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gd.apply(this,arguments)},md=function(t){function n(e){var n=t.call(this,e,"CodeManager",Ku)||this;n.EditorView=pd;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 jo,json:new ed,js:new od},n.defViewers={CodeMirror:new cd},n.loadDefaultGenerators().loadDefaultViewers(),n}return hd(n,t),n.prototype.addGenerator=function(e,t){return this.generators[e]=t,this},n.prototype.getGenerator=function(e){return this.generators[e]},n.prototype.getGenerators=function(){return this.generators},n.prototype.addViewer=function(e,t){return this.viewers[e]=t,this},n.prototype.getViewer=function(e){return this.viewers[e]},n.prototype.getViewers=function(){return this.viewers},n.prototype.createViewer=function(t){void 0===t&&(t={});var n=(0,e.isUndefined)(t.type)?"CodeMirror":t.type,r=this.getViewer(n)&&this.getViewer(n).clone(),o=document.createElement("div"),i=document.createElement("textarea");return o.appendChild(i),r.set(gd(gd({},this.config.optsCodeViewer),t)),r.init(i),r.setElement(o),r},n.prototype.updateViewer=function(e,t){e.setContent(t)},n.prototype.getCode=function(e,t,n){void 0===n&&(n={}),n.em=this.em;var r=this.getGenerator(t);return r?r.build(e,n):""},n.prototype.loadDefaultGenerators=function(){for(var e in this.defGenerators)this.addGenerator(e,this.defGenerators[e]);return this},n.prototype.loadDefaultViewers=function(){for(var e in this.defViewers)this.addViewer(e,this.defViewers[e]);return this},n.prototype.destroy=function(){},n}(g);const vd=md;var yd=B(410),bd=B.n(yd);const wd={maximumStackLength:500,trackSelection:!0};var xd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cd=function(){return Cd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Cd.apply(this,arguments)},Sd=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},_d=function(e){return e.avoidStore||e.noUndo},Ed=function(e){return Object.keys(e.changedAttributes())},Od=function(t){function n(n){var r=t.call(this,n,"UndoManager",wd)||this;r.config._disable&&(r.config.maximumStackLength=0);var o=!0;return r.um=new(bd())(Cd({track:!0,register:[]},r.config)),r.um.changeUndoType("change",{condition:function(t){var n=t.get("_undo");if(n){var r=t.get("_undoexc");if((0,e.isArray)(r)&&Ed(t).some((function(e){return r.indexOf(e)>=0})))return!1;if((0,e.isBoolean)(n))return!0;if((0,e.isArray)(n)&&Ed(t).some((function(e){return n.indexOf(e)>=0})))return!0}return!1},on:function(t,n,r){var i=this;!this.beforeCache&&(this.beforeCache=t.previousAttributes());var a=r||n||{};if(a.noUndo&&setTimeout((function(){i.beforeCache=null})),!_d(a)){var s=t.toJSON({fromUndo:o}),l={object:t,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,e.isEmpty)(s))return l}}}),r.um.changeUndoType("add",{on:function(e,t,n){if(void 0===n&&(n={}),!_d(n)&&r.isRegistered(t))return{object:t,before:void 0,after:e,options:Cd(Cd({},n),{fromUndo:o})}}}),r.um.changeUndoType("remove",{on:function(e,t,n){if(void 0===n&&(n={}),!_d(n)&&r.isRegistered(t))return{object:t,before:e,after:void 0,options:Cd(Cd({},n),{fromUndo:o})}}}),r.um.changeUndoType("reset",{undo:function(e,t){e.reset(t,{fromUndo:o})},redo:function(e,t,n){e.reset(n,{fromUndo:o})},on:function(e,t){if(void 0===t&&(t={}),!_d(t)&&r.isRegistered(e))return{object:e,before:t.previousModels,after:Sd([],e.models,!0),options:Cd(Cd({},t),{fromUndo:o})}}}),r.um.on("undo redo",(function(){n.getSelectedAll().map((function(e){return e.trigger("rerender:layer")}))})),["undo","redo"].forEach((function(e){return r.um.on(e,(function(){return n.trigger(e)}))})),r}return xd(n,t),n.prototype.postLoad=function(){var e=this.config,t=this.em;e.trackSelection&&t&&this.add(t.get("selected"))},n.prototype.add=function(e){return this.um.register(e),this},n.prototype.remove=function(e){return this.um.unregister(e),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(e){void 0===e&&(e=!0);var t=this.em,n=this.um;return!t.isEditing()&&n.undo(e),this},n.prototype.undoAll=function(){return this.um.undoAll(),this},n.prototype.redo=function(e){void 0===e&&(e=!0);var t=this.em,n=this.um;return!t.isEditing()&&n.redo(e),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(e){return!!this.getInstance().objectRegistry.isRegistered(e)},n.prototype.getStack=function(){return this.um.stack},n.prototype.getStackGroup=function(){var e=[],t=[];return this.getStack().forEach((function(n){var r=n.get("magicFusionIndex");t.indexOf(r)<0&&(t.push(r),e.push(n))})),e},n.prototype.skip=function(e){var t=!!this.um.isTracking();t&&this.stop(),e(),t&&this.start()},n.prototype.getGroupedStack=function(){var t={},n=this.getStack();return n.forEach((function(e,n){var r=e.get("magicFusionIndex"),o=function(e,t){var n=e.attributes,r=n.type,o=n.after,i=n.before,a=n.object,s=n.options;return{index:t,type:r,after:o,before:i,object:a,options:void 0===s?{}:s}}(e,n);t[r]?t[r].push(o):t[r]=[o]})),Object.keys(t).map((function(n){var r=t[n];return{index:r[r.length-1].index,actions:r,labels:(0,e.unique)(r.reduce((function(e,t){var n,r=null===(n=t.options)||void 0===n?void 0:n.action;return r&&e.push(r),e}),[]))}}))},n.prototype.goToGroup=function(t){var n=this;if(t){var r=this.getPointer(),o=t.index-r;(0,e.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 kd=Od;const Td={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1};var Pd,Md=function(){return Md=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Md.apply(this,arguments)};!function(e){e[e.ACTIVE=1]="ACTIVE",e[e.INACTIVE=0]="INACTIVE",e[e.DISABLED=-1]="DISABLED"}(Pd||(Pd={}));var Ad="_rte",Dd=1,Nd=0,Rd=-1,jd=function(e,t){void 0===t&&(t="A");var n=e.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)==t||(null==a?void 0:a.nodeName)==t},Id="data-selectme",Ld={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(e){return e.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(e){return e.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(e){return e.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<s>S</s>",attributes:{title:"Strike-through"},result:function(e){return e.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(e){return e&&e.selection()&&jd(e)?Dd:Nd},result:function(e){jd(e)?e.exec("unlink"):e.insertHTML('<a href="" '.concat(Id,">").concat(e.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(e){return(null==e?void 0:e.selection())&&jd(e,"SPAN")?Rd:Nd},result:function(e){!jd(e,"SPAN")&&e.insertHTML("<span ".concat(Id,">").concat(e.selection(),"</span>"),{select:!0})}}},Fd=function(){function n(t,n,r){var o=this;if(void 0===r&&(r={}),this.em=t,this.settings=r,n[Ad])return n[Ad];n[Ad]=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(t){var n=t;return(0,e.isString)(t)?n=Md({},Ld[t]):Ld[t.name]&&(n=Md(Md({},Ld[t.name]),t)),n})),a=i.length?i:Object.keys(Ld).map((function(e){return Ld[e]}));r.classes=Md({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(e){return o.addAction(e)}))}return r.styleWithCSS&&this.exec("styleWithCSS"),this}return n.prototype.isCustom=function(e){var t=e||this.em.RichTextEditor;return!(!(null==t?void 0:t.config.custom)&&!(null==t?void 0:t.customRte))},n.prototype.destroy=function(){},n.prototype.setEl=function(e){this.el=e,this.doc=e.ownerDocument},n.prototype.updateActiveActions=function(){var e=this,t=this.getActions();t.forEach((function(t){var n=t.update,r=t.btn,o=e.classes,i=o.active,a=o.inactive,s=o.disabled,l=t.state,c=t.name,u=e.doc,d=Pd.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 p=l(e,u);if(d=p,r)switch(p){case Dd:r.className+=" ".concat(i);break;case Nd:r.className+=" ".concat(a);break;case Rd:r.className+=" ".concat(s)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(r&&(r.className+=" ".concat(i)),d=Pd.ACTIVE);t.currentState=d,null==n||n(e,t)})),t.length&&this.em.RichTextEditor.__dbdTrgCustom()},n.prototype.enable=function(e){return this.enabled?this:this.__toggleEffects(!0,e)},n.prototype.disable=function(){return this.__toggleEffects(!1)},n.prototype.__toggleEffects=function(e,t){void 0===e&&(e=!1),void 0===t&&(t={});var n=e?me.on:me.S1,r=this.el,o=this.doc,i=this.actionbarEl();if(i&&(i.style.display=e?"":"none"),r.contentEditable="".concat(!!e),n(r,"mouseup keyup",this.updateActiveActions),n(o,"keydown",this.__onKeydown),n(o,"paste",this.__onPaste),this.enabled=e,e){var a=t.event;if(this.syncActions(),this.updateActiveActions(),a){var s=null;if(o.caretRangeFromPoint){var l=(0,me.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(e){var t=this.em,n=t.RichTextEditor.getConfig().onKeydown;if(n)return n({ev:e,rte:this,editor:t.getEditor()});var r=this.doc;"Enter"!==e.key||["insertOrderedList","insertUnorderedList"].some((function(e){return r.queryCommandState(e)}))||(r.execCommand("insertLineBreak"),e.preventDefault())},n.prototype.__onPaste=function(e){var t=this.em,n=t.RichTextEditor.getConfig().onPaste;if(n)return n({ev:e,rte:this,editor:t.getEditor()});var r=e.clipboardData,o=r.getData("text"),i=r.getData("text/html");if(o&&!i){e.preventDefault();var a=o.replace(/(?:\r\n|\r|\n)/g,"<br/>");this.doc.execCommand("insertHTML",!1,a)}},n.prototype.syncActions=function(){var e=this;this.getActions().forEach((function(t){if(e.actionbar&&(!t.state||t.state&&t.state(e,e.doc)>=0)){var n=t.event||"click",r=t.btn;r&&(r["on".concat(n)]=function(){t.result(e,t),e.updateActiveActions()})}}))},n.prototype.addAction=function(e,t){void 0===t&&(t={});var n=t.sync,r=this.actionbarEl();if(r){var o=e.icon,i=e.attributes,a=void 0===i?{}:i,s=document.createElement("span");for(var l in s.className=this.classes.button,e.btn=s,a)s.setAttribute(l,a[l]);"string"==typeof o?s.innerHTML=o:s.appendChild(o),r.appendChild(s)}n&&(this.actions.push(e),this.syncActions())},n.prototype.getActions=function(){return this.actions},n.prototype.selection=function(){return this.doc.getSelection()},n.prototype.exec=function(e,t){this.doc.execCommand(e,!1,t)},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,t.getComponentModel)(l)||a.getSelected(),d=s.createElement("div"),p=c.getRangeAt(0);p.deleteContents(),(0,e.isString)(n)?d.innerHTML=n:n&&d.appendChild(n),Array.prototype.slice.call(d.childNodes).forEach((function(e){p.insertNode(e)})),c.removeAllRanges(),c.addRange(p),l.focus(),o&&u&&(u.once("rte:disable",(function(){var e=u.find("[".concat(Id,"]"))[0];e&&(a.setSelected(e),e.removeAttributes(Id))})),u.trigger("disable"))}},n}();const Vd=Fd;var Bd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zd=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Hd=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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])}}},$d="".concat(pe.refresh," frame:scroll component:update"),Wd={enable:"rte:enable",disable:"rte:disable",custom:"rte:custom"},Ud=function(n){function r(t){var r=n.call(this,t,"RichTextEditor",Td)||this;r.events=Wd;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,e.debounce)((function(){return r.__trgCustom()}),0),r}return Bd(r,n),r.prototype.onLoad=function(){if((0,t.hasWin)()){var e=this.config,n=e.pStylePrefix,r=e.custom,o=(0,me.ut)("div",{class:(0,me.cx)("".concat(n,"rte-toolbar"),!r&&"".concat(n,"one-bg ").concat(n,"rte-toolbar-ui"))});this.toolbar=o,this.initRte((0,me.ut)("div")),(0,me.on)(o,"mousedown",(function(e){return e.stopPropagation()}))}},r.prototype.__trgCustom=function(){var e=this,t=e.model,n=e.em,r=e.events;n.trigger(r.custom,{enabled:!!t.get("currentView"),container:this.getToolbarEl(),actions:this.getAll()})},r.prototype.destroy=function(){var e,t,n;null===(e=this.globalRte)||void 0===e||e.destroy(),null===(n=null===(t=this.customRte)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t),this.model.stopListening().clear({silent:!0}),this.__dbdTrgCustom.cancel(),(0,me.L_)(this.toolbar)},r.prototype.postRender=function(e){var t=e.model.get("Canvas");this.toolbar.style.pointerEvents="all",this.hideToolbar(),t.getToolsEl().appendChild(this.toolbar)},r.prototype.initRte=function(e){var t=this.globalRte,n=this,r=n.em,o=n.pfx,i=n.actionbar,a=n.config,s=this.actions||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],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 t?(t.em=r,t.setEl(e)):(t=new Vd(r,e,{classes:l,actions:s,actionbar:i,actionbarContainer:this.toolbar,module:this}),this.globalRte=t),t.actionbar&&(this.actionbar=t.actionbar),t.actions&&(this.actions=t.actions),t},r.prototype.add=function(e,t){var n;void 0===t&&(t={}),t.name=e,null===(n=this.globalRte)||void 0===n||n.addAction(t,{sync:!0})},r.prototype.get=function(e){var t,n;return null===(t=this.globalRte)||void 0===t||t.getActions().forEach((function(t){t.name==e&&(n=t)})),n},r.prototype.getAll=function(){var e;return(null===(e=this.globalRte)||void 0===e?void 0:e.getActions())||[]},r.prototype.remove=function(e){var t,n=this.getAll(),r=this.get(e);if(r){var o=r.btn,i=n.indexOf(r);null===(t=null==o?void 0:o.parentNode)||void 0===t||t.removeChild(o),n.splice(i,1)}return r},r.prototype.run=function(t){var n=this.globalRte,r=(0,e.isString)(t)?this.get(t):t;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,t.isDef)(r)&&(i[n]=(0,e.isString)(r)?r:(r||0)+"px")}))},r.prototype.enable=function(e,t,n){return void 0===n&&(n={}),zd(this,void 0,void 0,(function(){var r,o,i,a,s;return Hd(this,(function(l){switch(l.label){case 0:return this.lastEl=e.el,o=(r=this).customRte,i=r.em,a=e.getChildrenContainer(),this.toolbar.style.display="",[4,o?o.enable(a,t):this.initRte(a).enable(n)];case 1:return s=l.sent(),i&&(setTimeout(this.updatePosition.bind(this),0),i.off($d,this.updatePosition,this),i.on($d,this.updatePosition,this),i.trigger("rte:enable",e,s)),this.model.set({currentView:e}),[2,s]}}))}))},r.prototype.getContent=function(t,n){return zd(this,void 0,void 0,(function(){var r;return Hd(this,(function(o){switch(o.label){case 0:return(r=this.customRte)&&n&&(0,e.isFunction)(r.getContent)?[4,r.getContent(t.el,n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,t.getChildrenContainer().innerHTML]}}))}))},r.prototype.hideToolbar=function(){var e=this.toolbar.style,t="-1000px";e.top=t,e.left=t,e.display="none"},r.prototype.disable=function(e,t,n){void 0===n&&(n={});var r=this.em,o=this.customRte,i=e.getChildrenContainer();o?o.disable(i,t):t&&t.disable(),this.hideToolbar(),r&&(r.off($d,this.updatePosition,this),!n.fromMove&&r.trigger("rte:disable",e,t)),this.model.unset("currentView")},r}(g);const qd=Ud,Gd={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 Yd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kd=function(){return Kd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Kd.apply(this,arguments)},Zd=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Xd=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Yd(r,n),r.getDefaults=function(){return(0,e.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(e,n){void 0===e&&(e={}),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,t.capitalize)(a).replace(/-/g," ")),this.on("change",this.__upTargets),r.callInit(this,e,n)},r.prototype.__getParentProp=function(){var e,t;return null===(t=null===(e=this.collection)||void 0===e?void 0:e.opts)||void 0===t?void 0:t.parentProp},r.prototype.__upTargets=function(t,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(),d=(0,e.keys)(u).reduce((function(e,t){return e[t]=o.previous(t),e}),{}),p=Zd(Zd([],(0,e.keys)(this.__getClearProps()),!0),["__p"],!1),f=(0,e.keys)(u),h=!n.__up&&!c&&(s||p.some((function(e){return f.indexOf(e)>=0}))),g=this.get("onChange"),m={property:this,from:d,to:u,value:l,opts:n};i.__trgEv(i.events.propertyUpdate,m),g&&g(m),h&&this.__upTargetsStyle(((r={})[a]=l,r),n)},r.prototype.__upTargetsStyle=function(e,t){var n,r=null===(n=this.em)||void 0===n?void 0:n.get("StyleManager");null==r||r.addStyleTargets(Kd(Kd({},e),{__p:!!t.avoidStore}),t)},r.prototype._up=function(e,t){void 0===t&&(t={}),t.noTarget&&(t.__up=!0);var n=t.partial,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["partial"]);return e.__p=!(!r.avoidStore&&!n),this.set(e,Kd(Kd({},r),{avoidStore:e.__p}))},r.prototype.up=function(e,t){void 0===t&&(t={}),this.set(e,Kd(Kd({},t),{__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(e){var t;void 0===e&&(e={});var n=e.locale,r=void 0===n||n,o=this.getId(),i=this.get("name")||this.get("label");return r&&(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.properties.".concat(o)))||i},r.prototype.getValue=function(e){void 0===e&&(e={});var t=e.noDefault,n=this.get("value");return this.hasValue()||t?n:this.getDefaultValue()},r.prototype.hasValue=function(t){void 0===t&&(t={});var n=t.noParent&&this.getParentTarget(),r=this.get("value");return!(0,e.isUndefined)(r)&&""!==r&&!n},r.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},r.prototype.getStyle=function(e){var n;void 0===e&&(e={});var r=this.getName();return(n={})[e.camelCase?(0,t.camelCase)(r):r]=this.__getFullValue(e),n},r.prototype.getDefaultValue=function(){var t=this.get("default");return"".concat((0,e.isUndefined)(t)?this.get("defaults"):t)},r.prototype.upValue=function(e,t){void 0===t&&(t={});var n=null===e||""===e?this.__getClearProps():this.__parseValue(e,t);return this._up(n,t)},r.prototype.isVisible=function(){return!!this.get("visible")},r.prototype.clear=function(e){return void 0===e&&(e={}),this._up(this.__getClearProps(),Kd(Kd({},e),{__clear:!0})),this},r.prototype.canClear=function(){var e=this.getParent();return e?e.__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(e,t){return this.parseValue(e,t)},r.prototype.__getClearProps=function(){return{value:""}},r.prototype.setValue=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={});var r=this.parseValue(e),o=!t;!o&&this.set({value:void 0},{avoidStore:o,silent:!0}),this.set(r,Kd({avoidStore:o},n))},r.prototype.setValueFromInput=function(e,t,n){void 0===n&&(n={}),this.setValue(e,t,Kd(Kd({},n),{fromInput:1}))},r.prototype.parseValue=function(t,n){void 0===n&&(n={});var r={value:t},o="!important",i=this.get("functionName")||"";if((0,e.isString)(t)&&-1!==t.indexOf(o)&&(r.value=t.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 d=parseFloat(r.value);r.unit=r.value.replace(d,""),r.value=d}return r},r.prototype.__getFullValue=function(e){var t=(void 0===e?{}:e).withDefault;return!this.hasValue()&&t?this.getDefaultValue():this.getFullValue()},r.prototype.getFullValue=function(t,n){void 0===n&&(n={});var r=this.get("functionName"),o=this.getDefaultValue(),i=(0,e.isUndefined)(t)?this.get("value"):t,a=!(0,e.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(e){this.up({parentTarget:e})},r.prototype.getParentTarget=function(){return this.get("parentTarget")||null},r.prototype.__parseFn=function(e){void 0===e&&(e="");var t=e.indexOf("(")+1,n=e.lastIndexOf(")");return{name:e.substring(0,t-1).trim(),value:String.prototype.substring.apply(e,[t,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"),d=this.get("requiresParent"),p=a.get("unstylable"),f=a.get("stylable-require"),h=a.get("stylable");if((0,e.isArray)(h)&&(h=h.indexOf(l)>=0),(0,e.isArray)(p)&&(h=p.indexOf(l)<0),c&&(h=!r||f&&(f.indexOf(s)>=0||f.indexOf(l)>=0)),i&&u){var g=(0,e.keys)(u);i.forEach((function(t){t.getProperties().forEach((function(t){if((0,e.includes)(g,t.id)){var n=u[t.id];h=h&&(0,e.includes)(n,t.get("value"))}}))}))}if(d){var m=o&&o.parent(),v=m&&m.getEl();if(v){var y=(0,t.hasWin)()?window.getComputedStyle(v):{};(0,e.each)(d,(function(t,n){h=h&&y[n]&&(0,e.includes)(t,y[n])}))}else h=!1}return!!h},r}(l.Hn);const Jd=Xd;Xd.callParentInit=function(e,t,n,r){void 0===r&&(r={}),e.prototype.initialize.apply(t,[n,Kd(Kd({},r),{skipInit:1})])},Xd.callInit=function(e,t,n){void 0===n&&(n={}),!n.skipInit&&e.init(t,n)};var Qd=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ep=function(){return ep=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ep.apply(this,arguments)},tp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Qd(n,e),n.prototype.defaults=function(){return{values:{}}},n.prototype.initialize=function(){var e=this.collection;this.prop=null==e?void 0:e.prop},n.prototype.getId=function(){return this.cid},n.prototype.getIndex=function(){var e=this.collection;return e?e.indexOf(this):-1},n.prototype.getValues=function(e){void 0===e&&(e={});var n=this.get("values");return e.camelCase?Object.keys(n).reduce((function(e,r){return e[(0,t.camelCase)(r)]=n[r],e}),{}):n},n.prototype.getLabel=function(){var e;return null===(e=this.prop)||void 0===e?void 0:e.getLayerLabel(this)},n.prototype.isSelected=function(){var e;return(null===(e=this.prop)||void 0===e?void 0:e.getSelectedLayer())===this},n.prototype.select=function(){var e;return null===(e=this.prop)||void 0===e?void 0:e.selectLayer(this)},n.prototype.remove=function(){var e;return null===(e=this.prop)||void 0===e?void 0:e.removeLayer(this)},n.prototype.move=function(e){var t;return null===(t=this.prop)||void 0===t?void 0:t.moveLayer(this,e)},n.prototype.getStylePreview=function(e){var t;return void 0===e&&(e={}),null===(t=this.prop)||void 0===t?void 0:t.getStylePreview(this,e)},n.prototype.hasPreview=function(){var e;return!!(null===(e=this.prop)||void 0===e?void 0:e.get("preview"))},n.prototype.upValues=function(e){return void 0===e&&(e={}),this.set("values",ep(ep({},this.getValues()),e))},n}(l.Hn);const np=tp;var rp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),op=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return rp(t,e),t.prototype.initialize=function(e,t){void 0===t&&(t={}),this.prop=t.prop},t}(l.FE);const ip=op;op.prototype.model=np;var ap=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=function(){return sp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sp.apply(this,arguments)},lp=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},cp=function(e){return"integer"===e||"number"===e},up=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return ap(r,n),r.prototype.defaults=function(){return sp(sp({},Jd.getDefaults()),{detached:!1,properties:[],separator:" ",join:null,fromStyle:null,toStyle:null,full:!0})},r.prototype.initialize=function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Jd.callParentInit(Jd,this,e,t);var n=this.em,r=new xf(this.get("properties")||[],{em:n,parentProp:this});this.set("properties",r,{silent:!0}),this.listenTo(r,"change",this.__upProperties),Jd.callInit(this,e,t)},Object.defineProperty(r.prototype,"properties",{get:function(){return this.get("properties")||[]},enumerable:!1,configurable:!0}),r.prototype.getProperties=function(){return lp([],this.get("properties").models,!0)},r.prototype.getProperty=function(e){return this.properties.filter((function(t){return t.getId()===e||t.getName()===e}))[0]},r.prototype.getPropertyAt=function(e){return this.get("properties").at(e)},r.prototype.isDetached=function(){return!!this.get("detached")},r.prototype.getValues=function(e){var t=(void 0===e?{}:e).byName;return this.getProperties().reduce((function(e,n){return e[t?n.getName():n.getId()]="".concat(n.__getFullValue()),e}),{})},r.prototype.getSeparator=function(){return this.getSplitSeparator()},r.prototype.getJoin=function(){return this.__getJoin()},r.prototype.getStyleFromProps=function(e){var n;void 0===e&&(e={});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(e){return e.__getFullValue({withDefault:1})})).filter(Boolean).join(o);(n={})[r]=l,s=n}return this.isDetached()?s[r]="":(s[r]=s[r]||"",s=sp(sp({},s),this.getProperties().reduce((function(e,t){return e[t.getName()]="",e}),{}))),e.camelCase?Object.keys(s).reduce((function(e,n){return e[(0,t.camelCase)(n)]=s[n],e}),{}):s},r.prototype.getSplitSeparator=function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},r.prototype.__upProperties=function(e,t){if(void 0===t&&(t={}),!t.__up&&!t.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,t);this.__upTargetsStyleProps(t,e)}},r.prototype.__upTargetsStyleProps=function(e,t){var n;void 0===e&&(e={});var r=this.getStyleFromProps();if(this.isDetached()&&t){var o=t.getName();(n={})[o]=r[o],r=n}this.__upTargetsStyle(r,e)},r.prototype._up=function(e,t){return void 0===t&&(t={}),this.__setProperties(this.__getSplitValue(e.value),t),Jd.prototype._up.call(this,e,t),this},r.prototype.getStyle=function(e){return this.getStyleFromProps(e)},r.prototype.__getFullValue=function(e){if(void 0===e&&(e={}),this.isDetached()||e.__clear)return"";var t=this.getStyleFromProps()[this.getName()]||"";return it(t)},r.prototype.__getJoin=function(){var t=this.get("join");return(0,e.isString)(t)?t:this.get("separator")},r.prototype.__styleHasProps=function(t){void 0===t&&(t={});var n=this.getName(),r=this.getProperties().map((function(e){return e.getName()}));return lp([n],r,!0).some((function(n){return!(0,e.isUndefined)(t[n])&&""!==t[n]}))},r.prototype.__splitValue=function(e,t){return it(e).split(t).map((function(e){return e.trim()})).filter(Boolean)},r.prototype.__splitStyleName=function(e,t,n){return this.__splitValue(e[t]||"",n)},r.prototype.__getSplitValue=function(t,n){void 0===t&&(t="");var r=(void 0===n?{}:n).byName,o=this.getProperties(),i=4===o.length&&o.every((function(e){return cp(e.getType())})),a=this.__splitValue(t,this.getSplitSeparator()),s={};return o.forEach((function(t,n){var o=a[n],l=(0,e.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?t.getName():t.getId();s[u]=l||""})),s},r.prototype.__getPropsFromStyle=function(t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),!this.__styleHasProps(t))return null;var r=n.byName,o=this.getName(),i=this.getProperties(),a=this.getSplitSeparator(),s=this.get("fromStyle"),l=s?s(t,{property:this,name:o,separator:a}):{};return s||(l=this.__getSplitValue(t[o]||"",{byName:r}),i.forEach((function(n){var o=t[n.getName()],i=r?n.getName():n.getId();(0,e.isUndefined)(o)||""===o||(l[i]=o)}))),l},r.prototype.__setProperties=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),this.getProperties().forEach((function(e){var r=t[e.getId()];e.__getFullValue()!==r&&e.upValue(r,n)}));var r=(0,e.keys)(t).map((function(e){return t[e]})).join(" ");this.set("value",r,{silent:!0})},r.prototype.clear=function(){var e=this;return this.getProperties().map((function(t){return t.clear({__clearIn:!e.isDetached()})})),Jd.prototype.clear.call(this),this},r.prototype.hasValue=function(e){return this.getProperties().some((function(t){return t.hasValue(e)}))},r.prototype.getFullValue=function(){return this.__getFullValue()},r.prototype.__canClearProp=function(e){return this.isDetached()&&e.hasValue({noParent:!0})},r}(Jd);const dp=up;var pp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fp=function(){return fp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fp.apply(this,arguments)},hp=/,(?![^\(]*\))/,gp=/\s(?![^(]*\))/,mp=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return pp(r,n),r.prototype.defaults=function(){return fp(fp({},dp.getDefaults()),{layers:[],emptyValue:"unset",layerSeparator:", ",layerJoin:"",prepend:0,preview:!1,layerLabel:null,selectedLayer:null})},r.prototype.initialize=function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),dp.callParentInit(dp,this,e,t);var n=this.get("layers"),r=new ip(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),dp.callInit(this,e,t)},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(e){return void 0===e&&(e=0),this.layers.at(e)||void 0},r.prototype.getSelectedLayer=function(){var e=this.get("selectedLayer");return e&&e.getIndex()>=0?e:void 0},r.prototype.selectLayer=function(e){return this.set("selectedLayer",e,{__select:!0})},r.prototype.selectLayerAt=function(e){void 0===e&&(e=0);var t=this.getLayer(e);return t&&this.selectLayer(t)},r.prototype.moveLayer=function(t,n){void 0===n&&(n=0);var r=this.layers,o=t?t.getIndex():-1;o>=0&&(0,e.isNumber)(n)&&n>=0&&n<r.length&&o!==n&&(this.removeLayer(t),r.add(t,{at:n}))},r.prototype.addLayer=function(t,n){void 0===t&&(t={}),void 0===n&&(n={});var r={};return this.getProperties().forEach((function(n){var o=n.getId(),i=t[o];r[o]=(0,e.isUndefined)(i)?n.getDefaultValue():i})),this.layers.push({values:r},n)},r.prototype.removeLayer=function(e){return this.layers.remove(e)},r.prototype.removeLayerAt=function(e){void 0===e&&(e=0);var t=this.getLayer(e);return t?this.removeLayer(t):null},r.prototype.getLayerLabel=function(e){var t="";if(e){var n=this.get("layerLabel"),r=e.getValues(),o=e.getIndex();if(n)t=n(e,{index:o,values:r,property:this});else{var i=[];this.getProperties().map((function(e){i.push(r[e.getId()])})),t=i.filter(Boolean).join(" ")}}return t},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 d=this.getProperties().map((function(t){var n=t.getName(),o=u[t.getId()],i=(0,e.isUndefined)(o)?t.getDefaultValue():o;if(r.number&&cp(t.getType())){var a=t.parseValue(o,r.number);i="".concat(a.value).concat(a.unit)}return{name:n,value:i}}));i=this.isDetached()?d.reduce((function(e,t){return e[t.name]=t.value,e}),{}):((o={})[this.getName()]=d.map((function(e){return e.value})).join(a),o)}return r.camelCase?Object.keys(i).reduce((function(e,n){return e[(0,t.camelCase)(n)]=i[n],e}),{}):i},r.prototype.getStylePreview=function(e,t){void 0===t&&(t={});var n={};return this.get("preview")&&(n=this.getStyleFromLayer(e,t)),n},r.prototype.getLayerSeparator=function(){var t=this.get("layerSeparator");return(0,e.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t},r.prototype.hasEmptyValue=function(){return!this.hasLayers()&&!!this.attributes.isEmptyValue},r.prototype.__upProperties=function(e,t){var n;void 0===t&&(t={});var r=this.getSelectedLayer();r&&(r.upValues(((n={})[e.getId()]=e.__getFullValue(),n)),t.__up||this.__upTargetsStyleProps(t))},r.prototype.__upLayers=function(e,t,n){this.__upTargetsStyleProps(n||t)},r.prototype.__upTargets=function(e,t){if(void 0===t&&(t={}),!t.__select)return Jd.prototype.__upTargets.call(this,e,t)},r.prototype.__upTargetsStyleProps=function(e){void 0===e&&(e={}),this.__upTargetsStyle(this.getStyleFromLayers(e),e)},r.prototype.__upTargetsStyle=function(e,t){return Jd.prototype.__upTargetsStyle.call(this,e,t)},r.prototype.__upSelected=function(e,t){var n=(void 0===e?{}:e).noEvent;void 0===t&&(t={});var r=this.em.Styles,o=this.getSelectedLayer(),i=null==o?void 0:o.getValues();i&&this.getProperties().forEach((function(e){var n,r=null!==(n=i[e.getId()])&&void 0!==n?n:"";e.__getFullValue()!==r&&e.upValue(r,fp(fp({},t),{__up:!0}))})),!n&&r.__trgEv(r.events.layerSelect,{property:this})},r.prototype._up=function(e,t){void 0===t&&(t={});var n=e.__layers,r=void 0===n?[]:n,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["__layers"]);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},t),Jd.prototype._up.call(this,o,t),this},r.prototype.__setLayers=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var n=this.layers,r=e.map((function(e){return{values:e}}));n.length===r.length?r.map((function(e,t){var r;return null===(r=n.at(t))||void 0===r?void 0:r.upValues(e.values)})):n.reset(r),this.set({isEmptyValue:!!t.isEmptyValue}),this.__upSelected({noEvent:!0})},r.prototype.__parseValue=function(e){var t=this,n=this.parseValue(e);return n.__layers=e.split(hp).map((function(e){return e.trim()})).map((function(e){return t.__parseLayer(e)})).filter(Boolean),n},r.prototype.__parseLayer=function(t){var n=this.get("parseLayer"),r=t.split(gp),o=this.getProperties();return n?n({value:t,values:r}):o.reduce((function(t,n,o){var i=r[o];return t[n.getId()]=(0,e.isUndefined)(i)?n.getDefaultValue():i,t}),{})},r.prototype.__getLayersFromStyle=function(t){var n=this;if(void 0===t&&(t={}),!this.__styleHasProps(t))return null;if(this.isEmptyValueStyle(t))return[];var r=this.getName(),o=this.getProperties(),i=this.getLayerSeparator(),a=this.attributes.fromStyle,s=a?a(t,{property:this,name:r,separatorLayers:i}):[];if(!a){var l=this.__splitStyleName(t,r,i).map((function(e){return e.split(n.getSplitSeparator())})).map((function(t){var n={};return o.forEach((function(r,o){var i=t[o];n[r.getId()]=(0,e.isUndefined)(i)?r.getDefaultValue():i})),n}));o.forEach((function(e){var r=e.getId();n.__splitStyleName(t,e.getName(),i).map((function(t){var n;return(n={})[r]=t||e.getDefaultValue(),n})).forEach((function(e,t){l[t]=l[t]?fp(fp({},l[t]),e):e}))})),s=l}return(0,e.isArray)(s)?s:[s]},r.prototype.getStyle=function(e){return void 0===e&&(e={}),this.getStyleFromLayers(e)},r.prototype.getStyleFromLayers=function(t){var n=this;void 0===t&&(t={});var r={},o=this.getName(),i=this.getLayers(),a=this.getProperties();if(i.map((function(e){return n.getStyleFromLayer(e,t)})).forEach((function(t){(0,e.keys)(t).map((function(e){r[e]||(r[e]=[]),r[e].push(t[e])}))})),(0,e.keys)(r).map((function(e){r[e]=r[e].join(n.__getJoinLayers())})),this.isDetached())r[o]="",!i.length&&a.map((function(e){r[e.getName()]=""}));else{var s=a.reduce((function(e,t){return e[t.getName()]="",e}),{});r[o]=r[o]||"",r=fp(fp({},r),s)}return fp(fp({},r),t.__clear?{}:this.getEmptyValueStyle())},r.prototype.isEmptyValueStyle=function(t){void 0===t&&(t={});var n=this.getEmptyValueStyle({force:!0}),r=(0,e.keys)(n);return!!r.length&&r.every((function(e){return n[e]===t[e]}))},r.prototype.getEmptyValueStyle=function(t){void 0===t&&(t={});var n=this.attributes.emptyValue;if(!n||this.hasLayers()&&!t.force)return{};var r=this.getName(),o=this.getProperties(),i=(0,e.isString)(n)?n:n({property:this});if((0,e.isString)(i)){var a={};return this.isDetached()?o.map((function(e){a[e.getName()]=i})):a[r]=i,a}return i},r.prototype.__getJoinLayers=function(){var t=this.get("layerJoin"),n=this.get("layerSeparator");return t||((0,e.isString)(n)?n:t)},r.prototype.__getFullValue=function(){if(this.get("detached"))return"";var e=this.getStyleFromLayers();return it(e[this.getName()])},r.prototype.hasValue=function(e){void 0===e&&(e={});var t=e.noParent&&this.getParentTarget();return(this.hasLayers()||this.hasEmptyValue())&&!t},r.prototype.clear=function(e){return void 0===e&&(e={}),this.layers.reset(),this.__upTargetsStyleProps(fp(fp({},e),{__clear:!0})),Jd.prototype.clear.call(this),this},r.prototype.__canClearProp=function(){return!1},r.prototype.__getLayers=function(){return this.layers},r}(dp);const vp=mp;var yp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bp=function(){return bp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bp.apply(this,arguments)},wp="data-clear-style",xp=function(n){function r(t){void 0===t&&(t={});var r=n.call(this,t)||this;(0,e.bindAll)(r,"__change","__updateStyle");var o=t.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,e.debounce)(r.onValueChange.bind(r),10),r.updateStatus=(0,e.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 yp(r,n),r.prototype.events=function(){var e;return(e={change:"inputValueChanged"})["click [".concat(wp,"]")]="clear",e},r.prototype.template=function(e){var t=this.pfx,n=this.ppfx;return'\n <div class="'.concat(t,'label" data-sm-label></div>\n <div class="').concat(n,'fields" data-sm-fields></div>\n ')},r.prototype.templateLabel=function(e){var t=this.pfx,n=this.em,r=e.parent,o=e.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(t,"icon ").concat(a,'" title="').concat(l,'">\n ').concat(e.getLabel(),"\n </span>\n ").concat(r?"":'<div class="'.concat(t,'clear" style="display: none" ').concat(wp,">").concat(u,"</div>"),"\n ")},r.prototype.templateInput=function(e){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(e.getDefaultValue(),'"/>\n </div>\n ')},r.prototype.remove=function(){var e=this;return l.G7.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach((function(t){return e[t]=null})),this.__destroyFn(this._getClbOpts()),this},r.prototype.updateStatus=function(){var e,t=this,n=t.model,r=t.pfx,o=t.ppfx,i=t.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===(e=this.parent)||void 0===e||e.updateStatus()},r.prototype.clear=function(e){e&&e.stopPropagation(),this.model.clear()},r.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(wp,"]"))),this.clearEl},r.prototype.inputValueChanged=function(e){e&&e.stopPropagation(),this.emit||this.model.upValue(e.target.value)},r.prototype.onValueChange=function(e,t,n){this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},r.prototype.setValue=function(t){var n=this.model,r=(0,e.isUndefined)(t)||""===t?n.getDefaultValue():t;if(this.update)return this.__update(r);this.__setValueInput(r)},r.prototype.__setValueInput=function(e){var t=this.getInputEl();t&&(t.value=e)},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 e=this.unset&&this.unset.bind(this);e&&e(this._getClbOpts())},r.prototype.__update=function(e){var t=this.update&&this.update.bind(this);t&&t(bp(bp({},this._getClbOpts()),{value:e}))},r.prototype.__change=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.emit&&this.emit.bind(this);n&&n.apply(void 0,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([this._getClbOpts()],e,!1))},r.prototype.__updateStyle=function(e,n){void 0===n&&(n={});var r=n.complete,o=n.partial;!function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}}(n,["complete","partial"]);var i=this.model,a=!1!==r&&!0!==o;(0,t.isObject)(e)?i.__upTargetsStyle(e,{avoidStore:!a}):i.upValue(e,{partial:!a})},r.prototype._getClbOpts=function(){var e=this,t=e.model;return{el:e.el,createdEl:e.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}},r.prototype.render=function(){this.clearCached();var e=this,t=e.pfx,n=e.model,r=e.el,o=e.$el,i=n.getName(),a=n.getType(),s=n.get("className")||"",l="".concat(t,"property"),c="number"===a?"".concat(t).concat(a," ").concat(t,"integer"):"".concat(t).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 d=this.onRender&&this.onRender.bind(this);return d&&d(),this.setValue(n.getValue()),this},r.prototype.onRender=function(){},r}(l.G7);const Cp=xp;var Sp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_p=function(e){function t(t){var n=e.call(this,t)||this;n.config=t.config||{},n.pfx=n.config.stylePrefix||"",n.properties=[],n.parent=t.parent;var r=n.collection;return n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.render),n}return Sp(t,e),t.prototype.addTo=function(e,t,n){this.add(e,null,n)},t.prototype.add=function(e,t,n){void 0===n&&(n={});var r=this.parent,o=this.config,i=t||this.el,a=new e.typeView({model:e,config:o});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),(0,me.$Q)(i,s,n.at)},t.prototype.remove=function(){return l.G7.prototype.remove.apply(this,arguments),this.clearItems(),this},t.prototype.clearItems=function(){this.properties.forEach((function(e){return e.remove()})),this.properties=[]},t.prototype.render=function(){var e=this,t=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(t){return e.add(t,r)})),t.empty(),t.append(r),t.attr("class","".concat(n,"properties")),this},t}(l.G7);const Ep=_p;var Op=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kp=function(){return kp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kp.apply(this,arguments)},Tp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Op(t,e),t.prototype.templateInput=function(){var e=this.pfx;return'\n <div class="'.concat(e,"field ").concat(e,'composite">\n <span id="').concat(e,'input-holder"></span>\n </div>\n ')},t.prototype.remove=function(){var e;return null===(e=this.props)||void 0===e||e.remove(),Cp.prototype.remove.apply(this,arguments),this},t.prototype.onValueChange=function(){},t.prototype.onRender=function(){var e=this.pfx,t=this.model,n=t.get("properties");if(n.length&&!this.props){var r=t.isDetached(),o=new Ep({config:kp(kp({},this.config),{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});o.render(),this.$el.find("#".concat(e,"input-holder")).append(o.el),this.props=o}},t.prototype.clearCached=function(){Cp.prototype.clearCached.apply(this,arguments),delete this.props},t}(Cp);const Pp=Tp;var Mp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ap=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Mp(n,t),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 e=this,t=e.pfx,n=e.ppfx,r=e.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(t,'label-wrp">\n <div id="').concat(t,'move" class="').concat(n,'no-touch-actions" data-move-layer>\n ').concat(a,'\n </div>\n <div id="').concat(t,'label" data-label></div>\n <div id="').concat(t,'preview-box" class="').concat(t,'layer-preview" style="display: none" data-preview-box>\n <div id="').concat(t,'preview" class="').concat(t,'layer-preview-cnt" data-preview></div>\n </div>\n <div id="').concat(t,'close-layer" class="').concat(t,'btn-close" data-close-layer>\n ').concat(i,'\n </div>\n </div>\n <div id="').concat(t,'inputs" data-properties></div>\n ')},n.prototype.initialize=function(e){void 0===e&&(e={});var t=this.model,n=e.config||{};this.em=n.em,this.config=n,this.sorter=e.sorter,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.propertyView=e.propertyView;var r=this.propertyView.model;this.listenTo(t,"destroy remove",this.remove),this.listenTo(t,"change:values",this.updateLabel),this.listenTo(r,"change:selectedLayer",this.updateVisibility),t.view=this,t.set({droppable:0,draggable:1}),this.$el.data("model",t)},n.prototype.initSorter=function(){var e;null===(e=this.sorter)||void 0===e||e.startSort(this.el)},n.prototype.removeItem=function(e){e&&e.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 t=this.model,n=t.getLabel();if(this.getLabelEl().innerHTML=n,t.hasPreview()){var r=this.getPreviewEl(),o=t.getStylePreview({number:{min:-3,max:3}}),i=(0,e.keys)(o).map((function(e){return"".concat(e,":").concat(o[e])})).join(";");r.setAttribute("style",i)}},n.prototype.updateVisibility=function(){var e,t=this,n=t.pfx,r=t.model,o=t.propertyView,i=this.getPropertiesWrapper(),a=r.isSelected();i.style.display=a?"":"none",this.$el[a?"addClass":"removeClass"]("".concat(n,"active")),a&&i.appendChild(null===(e=o.props)||void 0===e?void 0:e.el)},n.prototype.render=function(){var e=this,t=e.el,n=e.pfx,r=e.model;return t.innerHTML=this.template(),t.className="".concat(n,"layer"),r.hasPreview()&&(t.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},n}(l.G7);const Dp=Ap;var Np=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rp=function(e){function t(t){var n=e.call(this,t)||this,r=n.collection,o=t.config||{},i=o.em,a=o.stylePrefix||"",s=o.pStylePrefix||"";n.config=o,n.pfx=a,n.ppfx=s,n.propertyView=t.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 Np(t,e),t.prototype.addTo=function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},t.prototype.addToCollection=function(e,t,n){var r=t||null,o=this,i=o.propertyView,a=o.config,s=o.sorter,l=o.$el,c=new Dp({model:e,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 d="before";l.children().length===n&&(n--,d="after"),n<0?l.append(u):l.children().eq(n)[d](u)}else l.append(u);return u},t.prototype.reset=function(e,t){this.clearItems(),this.render()},t.prototype.remove=function(){return this.clearItems(),l.G7.prototype.remove.apply(this,arguments),this},t.prototype.clearItems=function(){this.items.forEach((function(e){return e.remove()})),this.items=[]},t.prototype.render=function(){var e=this,t=this.$el,n=this.sorter,r=document.createDocumentFragment();return t.empty(),this.collection.forEach((function(t){return e.addToCollection(t,r)})),t.append(r),t.attr("class",this.className),n&&(n.plh=null),this},t}(l.G7);const jp=Rp;var Ip=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lp=function(){return Lp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lp.apply(this,arguments)},Fp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ip(t,e),t.prototype.events=function(){return Lp(Lp({},Pp.prototype.events()),{"click [data-add-layer]":"addLayer",change:""})},t.prototype.templateInput=function(){var e=this.pfx,t=this.em,n=null==t?void 0:t.getConfig().icons,r=(null==n?void 0:n.plus)||"+";return'\n <div class="'.concat(e,"field ").concat(e,'stack">\n <button type="button" id="').concat(e,'add" data-add-layer>\n ').concat(r,"\n </button>\n <div data-layers-wrapper></div>\n </div>\n ")},t.prototype.init=function(){var e=this.model;this.listenTo(e.layers,"change reset",this.updateStatus),this.listenTo(e,"change:isEmptyValue",this.updateStatus)},t.prototype.addLayer=function(){this.model.addLayer({},{at:0})},t.prototype.setValue=function(){},t.prototype.remove=function(){var e;return null===(e=this.layersView)||void 0===e||e.remove(),Pp.prototype.remove.apply(this,arguments),this},t.prototype.clearCached=function(){Pp.prototype.clearCached.apply(this,arguments),delete this.layersView},t.prototype.onRender=function(){var e=this,t=e.model,n=e.el,r=e.config,o=t.get("properties");if(o.length&&!this.props){var i=new Ep({config:Lp(Lp({},r),{highlightComputed:!1,highlightChanged:!1}),collection:o,parent:this});i.render();var a=new jp({collection:t.layers,config:r,propertyView:this});a.render(),n.querySelector("[data-layers-wrapper]").appendChild(a.el),this.props=i,this.layersView=a}},t}(Pp);const Vp=Fp;var Bp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zp=function(){return zp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zp.apply(this,arguments)},Hp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return Bp(n,t),n.prototype.events=function(){return zp(zp({},Cp.prototype.events()),{"click [data-clear-asset]":"clear","click [data-open-assets]":"openAssetManager"})},n.prototype.templateInput=function(){var e,t=this.pfx,n=this.em,r=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,o=null==r?void 0:r.close;return'\n <div class="'.concat(t,"field ").concat(t,"file\">\n <div id='").concat(t,"input-holder'>\n <div class=\"").concat(t,'btn-c">\n <button class="').concat(t,'btn" id="').concat(t,'images" type="button" 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(t,'preview-box" class="').concat(t,'preview-file" data-preview-box>\n <div id="').concat(t,'preview-file" class="').concat(t,'preview-file-cnt" data-preview></div>\n <div id="').concat(t,'close" class="').concat(t,'preview-file-close" data-clear-asset>').concat(o,"</div>\n </div>\n </div>\n ")},n.prototype.__setValueInput=function(e){var t=this.model,n=this.el,r=t.getDefaultValue(),o=n.querySelector("[data-preview-box]"),i=n.querySelector("[data-preview]");o.style.display=e&&e!==r?"":"none",i.style.backgroundImage=e||t.getDefaultValue()},n.prototype.openAssetManager=function(){var t,n=this,r=null===(t=this.em)||void 0===t?void 0:t.Assets;null==r||r.open({select:function(t,o){var i=(0,e.isString)(t)?t:t.get("src");n.model.upValue(i,{partial:!o}),o&&r.close()},types:["image"],accept:"image/*"})},n}(Cp);const $p=Hp;var Wp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Up=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wp(t,e),t.prototype.templateInput=function(e){return""},t.prototype.init=function(){var e=this.model;this.listenTo(e,"change:unit",this.onValueChange),this.listenTo(e,"change:units",this.render)},t.prototype.setValue=function(e){},t.prototype.onRender=function(){var e=this,t=e.ppfx,n=e.model,r=e.el;if(!this.inputInst){var o=n.input;o.ppfx=t,o.render(),r.querySelector(".".concat(t,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}},t.prototype.clearCached=function(){Cp.prototype.clearCached.apply(this,arguments),this.inputInst=null},t}(Cp);const qp=Up;var Gp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gp(t,e),t.prototype.setValue=function(e){var t;null===(t=this.inputInst)||void 0===t||t.setValue(e,{fromTarget:1,def:this.model.getDefaultValue()})},t.prototype.remove=function(){var e=this;qp.prototype.remove.apply(this,arguments);var t=this.inputInst;return t&&t.remove&&t.remove(),["inputInst","$color"].forEach((function(t){return e[t]=null})),this},t.prototype.__handleChange=function(e,t){this.model.upValue(e,{partial:t})},t.prototype.onRender=function(){var e;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var t=this,n=t.ppfx,r=t.model,o=t.em,i=t.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===(e=a.inputEl)||void 0===e?void 0:e.get(0),this.inputInst=a}},t}(qp);const Kp=Yp;var Zp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xp=function(){return Xp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Xp.apply(this,arguments)},Jp=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Qp=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return Zp(r,n),r.prototype.defaults=function(){return Xp(Xp({},Jd.getDefaults()),{options:[],full:0})},r.prototype.getOptions=function(){var e=this.attributes,t=e.options,n=e.list;return(t&&t.length?t:n)||[]},r.prototype.getOption=function(e){var n=this,r=(0,t.isDef)(e)?e:this.getValue();return this.getOptions().filter((function(e){return n.getOptionId(e)===r}))[0]||null},r.prototype.setOptions=function(e){return void 0===e&&(e=[]),this.set("options",e),this},r.prototype.addOption=function(e){if(e){var t=this.getOptions();this.setOptions(Jp(Jp([],t,!0),[e],!1))}return this},r.prototype.getOptionId=function(e){return(0,t.isDef)(e.id)?e.id:e.value},r.prototype.getOptionLabel=function(t,n){var r;void 0===n&&(n={});var o=n.locale,i=void 0===o||o,a=((0,e.isString)(t)?this.getOption(t):t)||{},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 e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Jd.prototype.initialize.apply(this,e),this.listenTo(this,"change:options",this.__onOptionChange)},r.prototype.__onOptionChange=function(){this.set("list",this.get("options"))},r}(Jd);const ef=Qp;var tf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nf=function(e){function t(t){var n=e.call(this,t)||this;return n.listenTo(n.model,"change:options",n.updateOptions),n}return tf(t,e),t.prototype.templateInput=function(){var e=this.pfx,t=this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'select">\n <span id="').concat(e,'input-holder"></span>\n <div class="').concat(t,'sel-arrow">\n <div class="').concat(t,'d-s-arrow"></div>\n </div>\n </div>\n ')},t.prototype.updateOptions=function(){delete this.input,this.onRender()},t.prototype.onRender=function(){var e=this.pfx,t=this.model,n=t.getOptions();if(!this.input){var r=[];n.forEach((function(e){var n=t.getOptionId(e),o=t.getOptionLabel(n),i=e.style?e.style.replace(/"/g,"""):"",a=i?'style="'.concat(i,'"'):"",s=n.replace(/"/g,""");r.push('<option value="'.concat(s,'" ').concat(a,">").concat(o,"</option>"))}));var o=this.el.querySelector("#".concat(e,"input-holder"));o.innerHTML="<select>".concat(r.join(""),"</select>"),this.input=o.firstChild}},t.prototype.__setValueInput=function(e){var t=this.model,n=this.getInputEl(),r=t.getOptions()[0],o=r?t.getOptionId(r):"";n&&(n.value=e||o)},t}(Cp);const rf=nf;var of=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),af=function(){return af=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},af.apply(this,arguments)};const sf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return of(t,e),t.prototype.defaults=function(){return af(af({},ef.getDefaults()),{full:1})},t}(ef);var lf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lf(t,e),t.prototype.templateInput=function(){var e=this.ppfx;return'<div class="'.concat(e,"field ").concat(e,'field-radio"></div>')},t.prototype.onRender=function(){var e=this.pfx,t=this.ppfx,n=this.model,r="".concat(t,"radio-item-label"),o=n.getName(),i=n.getOptions(),a="".concat(e,"radio ").concat(e,"radio-").concat(o),s=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(e,"icon ").concat(r):"",u=n.getOptionId(i),d="".concat(o,"-").concat(u,"-").concat(s),p=c?"":n.getOptionLabel(u),f=i.title?'title="'.concat(i.title,'"'):"",h=n.getValue()===u?"checked":"";l.push('\n <div class="'.concat(t,'radio-item">\n <input type="radio" class="').concat(a,'" id="').concat(d,'" name="').concat(o,"-").concat(s,'" value="').concat(u,'" ').concat(h,'/>\n <label class="').concat(c||r,'" ').concat(f,' for="').concat(d,'">').concat(p,"</label>\n </div>\n "))}));var c=this.el.querySelector(".".concat(t,"field"));c.innerHTML='<div class="'.concat(t,'radio-items">').concat(l.join(""),"</div>"),this.input=c.firstChild}},t.prototype.__setValueInput=function(e){var t,n=this.model,r=e||n.getDefaultValue(),o=null===(t=this.getInputEl())||void 0===t?void 0:t.querySelector('[value="'.concat(r,'"]'));o&&(o.checked=!0)},t}(rf);const uf=cf;var df=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pf=function(){return pf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pf.apply(this,arguments)},ff=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return df(r,n),r.prototype.defaults=function(){return pf(pf({},Jd.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(e,t){return void 0===t&&(t={}),this._up({unit:e},t)},r.prototype.initialize=function(e,n){void 0===e&&(e={}),void 0===n&&(n={}),Jd.callParentInit(Jd,this,e,n);var r=this.get("unit"),o=this.getUnits();this.input=(0,t.hasWin)()?new Es({model:this}):void 0,o.length&&!r&&this.set("unit",o[0],{silent:!0}),Jd.callInit(this,e,n)},r.prototype.__getClearProps=function(){return pf(pf({},Jd.prototype.__getClearProps()),{unit:""})},r.prototype.parseValue=function(e,t){void 0===t&&(t={});var n=Jd.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,pf({deepCheck:1},t)),o=r.value,i=r.unit;return n.value=o,n.unit=i,n},r.prototype.getFullValue=function(){var t=this.get("value"),n=this.get("unit"),r=(0,e.isUndefined)(t)?"":"".concat(t),o=!(0,e.isUndefined)(n)&&r?n:"",i="".concat(r).concat(o);return Jd.prototype.getFullValue.apply(this,[i])},r}(Jd);const hf=ff;var gf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mf=function(){return mf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mf.apply(this,arguments)};const vf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gf(t,e),t.prototype.defaults=function(){return mf(mf({},hf.getDefaults()),{showInput:1})},t}(hf);var yf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bf=function(){return bf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bf.apply(this,arguments)};const wf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yf(t,e),t.prototype.events=function(){return bf(bf({},qp.prototype.events()),{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},t.prototype.templateInput=function(e){var t=this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'field-range">\n <input type="range" min="').concat(e.get("min"),'" max="').concat(e.get("max"),'" step="').concat(e.get("step"),'"/>\n </div>\n ')},t.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},t.prototype.inputValueChanged=function(e){e.stopPropagation(),this.model.upValue(this.getSliderEl().value)},t.prototype.inputValueChangedSoft=function(e){e.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},t.prototype.setValue=function(e){var t=this.model,n=t.parseValue(e);this.getSliderEl().value=""===e?t.getDefaultValue():parseFloat(n.value),qp.prototype.setValue.apply(this,arguments)},t.prototype.onRender=function(){qp.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},t.prototype.clearCached=function(){qp.prototype.clearCached.apply(this,arguments),delete this.slider},t}(qp);const xf=l.FE.extend(Fl).extend({extendViewApi:1,init:function(){var e=this.opts,t=this.em,n=e.module||(null==t?void 0:t.get("StyleManager"));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:"stack",model:vp,view:Vp,isType:function(e){if(e&&"stack"==e.type)return e}},{id:"composite",model:dp,view:Pp,isType:function(e){if(e&&"composite"==e.type)return e}},{id:"file",model:Jd,view:$p,isType:function(e){if(e&&"file"==e.type)return e}},{id:"color",model:Jd,view:Kp,isType:function(e){if(e&&"color"==e.type)return e}},{id:"select",model:ef,view:rf,isType:function(e){if(e&&"select"==e.type)return e}},{id:"radio",model:sf,view:uf,isType:function(e){if(e&&"radio"==e.type)return e}},{id:"slider",model:vf,view:wf,isType:function(e){if(e&&"slider"==e.type)return e}},{id:"integer",model:hf,view:qp,isType:function(e){if(e&&"integer"==e.type)return e}},{id:"number",model:hf,view:qp,isType:function(e){if(e&&"number"==e.type)return e}},{id:"base",model:Jd,view:Cp,isType:function(e){return e.type="base",e}}]});var Cf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sf=function(){return Sf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Sf.apply(this,arguments)},_f=function(t){function n(n,r){void 0===r&&(r={});var o=t.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(t){return(0,e.isString)(t)?o.buildProperties(t)[0]:t})).filter(Boolean)).map((function(e){return o.checkExtend(e)}));var u=new xf(c,{em:i});return u.sector=o,o.set("properties",u),o}return Cf(n,t),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 e,t=this.getId();return(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.sectors.".concat(t)))||this.get("name")},n.prototype.setName=function(e){return this.set("name",e)},n.prototype.isOpen=function(){return!!this.get("open")},n.prototype.setOpen=function(e){return this.set("open",e)},n.prototype.isVisible=function(){return!!this.get("visible")},n.prototype.getProperties=function(e){void 0===e&&(e={});var t=this.properties,n=t.models?function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],t.models,!0):t;return n.filter((function(t){var n=!0;(e.withValue&&(n=t.hasValue({noParent:!0})),e.withParentValue)&&(n=!t.hasValue({noParent:!0})&&t.hasValue());return n}))},n.prototype.getProperty=function(e){return this.getProperties().filter((function(t){return t.get("id")===e}))[0]||void 0},n.prototype.addProperty=function(e,t){return this.properties.add(this.checkExtend(e),t)},n.prototype.extendProperties=function(t,n,r){void 0===r&&(r=!1);for(var o=t.length,i=n||this.get("properties"),a=this.get("extendBuilded"),s=[],l=0,c=i.length;l<c;l++){for(var u=i[l],d=0,p=0;p<o;p++){var f=t[p];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)),t[p]=a?(0,e.extend)(f,u):u,s[p]=t[p],d=1}}d||(t.push(u),s.push(u))}return r?s.filter((function(e){return e})):t},n.prototype.checkExtend=function(t){var n=((0,e.isString)(t)?{extend:t}:t)||{},r=n.extend,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["extend"]);return r?Sf(Sf({},this.buildProperties([r])[0]||{}),o):t},n.prototype.buildProperties=function(e){var t,n=e||[];if(!n.length)return[];var r=null===(t=this.em)||void 0===t?void 0:t.Styles.builtIn;return null==r?void 0:r.build(n)},n}(l.Hn);const Ef=_f;var Of=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kf=function(){return kf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kf.apply(this,arguments)};const Tf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Of(t,e),t.prototype.initialize=function(e,t){void 0===t&&(t={});var n=t.module,r=t.em;this.em=r,this.module=n,this.listenTo(this,"reset",this.onReset)},t.prototype.model=function(e,t){void 0===t&&(t={});var n=t.collection.em;return new Ef(e,kf(kf({},t),{em:n}))},t.prototype.onReset=function(e,t){void 0===t&&(t={}),(t.previousModels||[]).forEach((function(e){return e.get("properties").reset()}))},t}(l.FE);var Pf=function(){return Pf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pf.apply(this,arguments)},Mf=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Af=function(e){return e.map((function(e){return{id:e}}))},Df=function(){function t(){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 e=", sans-serif",t=["flex-start","flex-end","center"],n=Mf(Mf([],t,!0),["baseline","stretch"],!1);this.optsBgSize=Af(["auto","cover","contain"]),this.optsBgAttach=Af(["scroll","fixed","local"]),this.optsBgRepeat=Af(["repeat","repeat-x","repeat-y","no-repeat"]),this.optsWrap=Af(["nowrap","wrap","wrap-reverse"]),this.optsOverflow=Af(["visible","hidden","scroll","auto"]),this.optsDir=Af(["row","row-reverse","column","column-reverse"]),this.opstDisplay=Af(["block","inline","inline-block","flex","none"]),this.optsTransitFn=Af(["linear","ease","ease-in","ease-out","ease-in-out"]),this.optsCursor=Af(["auto","pointer","copy","crosshair","grab","grabbing","help","move","text"]),this.optsFloat=Af(["none","left","right"]),this.optsPos=Af(["static","relative","absolute","fixed"]),this.optsTextAlign=Af(["left","center","right","justify"]),this.optsFlexAlign=Af(n),this.optsJustCont=Af(Mf(Mf([],t,!0),["space-between","space-around","space-evenly"],!1)),this.optsAlignCont=Af(Mf(Mf([],t,!0),["space-between","space-around","stretch"],!1)),this.optsAlignSelf=Af(Mf(["auto"],n,!0)),this.optsTransitProp=Af(["all","width","height","background-color","transform","box-shadow","opacity"]),this.optsBorderStyle=Af(["none","solid","dotted","dashed","double","groove","ridge","inset","outset"]),this.optsBgPos=Af(["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"]),this.optsWeight=[{id:"100",label:"Thin"},{id:"200",label:"Extra-Light"},{id:"300",label:"Light"},{id:"400",label:"Normal"},{id:"500",label:"Medium"},{id:"600",label:"Semi-Bold"},{id:"700",label:"Bold"},{id:"800",label:"Extra-Bold"},{id:"900",label:"Ultra-Bold"}],this.optsShadowType=[{id:"",label:"Outside"},{id:"inset",label:"Inside"}],this.optsFonts=["Arial, Helvetica"+e,"Arial Black, Gadget"+e,"Brush Script MT"+e,"Comic Sans MS, cursive"+e,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+e,"Impact, Charcoal"+e,"Lucida Sans Unicode, Lucida Grande"+e,"Tahoma, Geneva"+e,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+e,"Verdana, Geneva"+e].map((function(e){return{id:e,label:e.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 t.prototype.__sub=function(t){var n=this;return function(){return t.map((function(t){if((0,e.isString)(t))return n.get(t);var r=t.extend,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["extend"]);return Pf(Pf({},n.get(r)),o)}))}},t.prototype.init=function(){var e=this,t=this,n=t.fixedValues,r=t.requireFlex,o=t.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(e,t){var n=t.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(e,t){var n=t.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(e,t){var n=t.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(e,t){var n=t.property,r=e[t.name]||"",o=n.getLayerSeparator();return r?r.split(o).map((function(e){var t=n.__parseFn(e);return{"transform-type":t.name,"transform-value":t.value}})):[]},toStyle:function(e,t){var n;return(n={})[t.name]="".concat(e["transform-type"],"(").concat(e["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(e){var t=e.property;if(e.to.value){var n=t.getOption(),r=Pf({},n.propValue||{}),o=t.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(t){var n=t[0],r=t[1],o=t[2];e.add(n,r||{},{from:o})})),this},t.prototype.add=function(t,n,r){void 0===n&&(n={}),void 0===r&&(r={});var o=r.from||"",i=this.props[o||t]||{},a=Pf(Pf(Pf({},i),{property:t}),n);return a.properties&&(0,e.isFunction)(a.properties)&&(a.properties=a.properties()),this.props[t]=a,a},t.prototype.get=function(e){return this.props[e]},t.prototype.build=function(t){var n=this,r=[];return((0,e.isString)(t)?[t]:t).forEach((function(e){r.push(n.get(e)||{property:e})})),r},t}();const Nf=Df;var Rf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jf=function(e){function t(t){var n=e.call(this,t)||this,r=t.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 Rf(t,e),t.prototype.template=function(e){var t,r,o,i=e.pfx,a=e.label,s=null===(t=this.em)||void 0===t?void 0:t.getConfig().icons,l=(null==s?void 0:s.caret)||"",c="".concat(i,"sector-");return n(Lf||(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,Lf=r),c,c,l,c,a)},t.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},t.prototype.updateOpen=function(){var e=this,t=e.$el,n=e.model,r=e.pfx,o=n.isOpen();t[o?"addClass":"removeClass"]("".concat(r,"open")),this.getPropertiesEl().style.display=o?"":"none"},t.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},t.prototype.getPropertiesEl=function(){var e=this.$el,t=this.pfx;return e.find(".".concat(t,"properties")).get(0)},t.prototype.toggle=function(){var e=this.model;e.setOpen(!e.get("open"))},t.prototype.renderProperties=function(){var e=this.model,t=this.config,n=e.get("properties");if(n){var r=new Ep({collection:n,config:t});this.$el.append(r.render().el)}},t.prototype.render=function(){var e=this,t=e.pfx,n=e.model,r=e.$el,o=n.getId(),i=n.getName();return r.html(this.template({pfx:t,label:i})),this.renderProperties(),r.attr("class","".concat(t,"sector ").concat(t,"sector__").concat(o," no-select")),this.updateOpen(),this},t}(l.G7);const If=jf;var Lf,Ff=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vf=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this,r=t.module,o=t.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 Ff(t,e),t.prototype.remove=function(){var e=this;return l.G7.prototype.remove.apply(this,arguments),["config","module","em"].forEach((function(t){return e[t]={}})),this},t.prototype.addTo=function(e,t,n){void 0===n&&(n={}),this.addToCollection(e,null,n)},t.prototype.addToCollection=function(e,t,n){void 0===n&&(n={});var r=this.config,o=this.el,i=t||o,a=new If({model:e,config:r}).render().el;return(0,me.$Q)(i,a,n.at),a},t.prototype.render=function(){var e=this,t=this,n=t.$el,r=t.pfx,o=t.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each((function(t){return e.addToCollection(t,i)})),n.append(i),n.addClass("".concat(r,"sectors ").concat(o,"one-bg ").concat(o,"two-color")),this},t}(l.G7);const Bf=Vf;var zf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hf=function(){return Hf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Hf.apply(this,arguments)},$f=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Wf="style",Uf="".concat(Wf,":"),qf="".concat(Uf,"sector"),Gf="".concat(qf,":add"),Yf="".concat(qf,":remove"),Kf="".concat(qf,":update"),Zf="".concat(Uf,"property"),Xf="".concat(Zf,":add"),Jf="".concat(Zf,":remove"),Qf="".concat(Zf,":update"),eh="".concat(Uf,"layer:select"),th="".concat(Uf,"target"),nh="".concat(Uf,"custom"),rh=function(e){return e||0===e},oh={all:Wf,sectorAdd:Gf,sectorRemove:Yf,sectorUpdate:Kf,propertyAdd:Xf,propertyRemove:Jf,propertyUpdate:Qf,layerSelect:eh,target:th,custom:nh},ih=function(n){function r(t){var r=n.call(this,t,"StyleManager",new Tf([],{em:t}),oh,Gd)||this;r.Sector=Ef,r.storageKey="",(0,e.bindAll)(r,"__clearStateTarget");var o=r.config,i=o.pStylePrefix;i&&(o.stylePrefix=i+o.stylePrefix),r.builtIn=new Nf,r.properties=new xf([],{em:t,module:r}),r.sectors=r.all;var a=new l.Hn({targets:[]});r.model=a;r.upAll=(0,e.debounce)((function(){return r.__upSel()}),0),a.listenTo(t,"component:toggled component:update:classes change:state change:device frame:resized selector:type",r.upAll),a.listenTo(t,"component:toggled",r.__clearStateTarget);var s=(0,e.debounce)((function(){r.__upProps(),r.__trgCustom()}),0);a.listenTo(t,"styleable:change undo redo",s);var c=(0,e.debounce)((function(){return r.__trgCustom()}),0);return a.listenTo(t,"".concat(eh," ").concat(th),c),a.on("change:lastTarget",(function(){return t.trigger(th,r.getSelected())})),r}return zf(r,n),r.prototype.__upSel=function(){this.select(this.em.getSelectedAll())},r.prototype.__trgCustom=function(e){void 0===e&&(e={}),this.__ctn=this.__ctn||e.container,this.em.trigger(this.events.custom,{container:this.__ctn})},r.prototype.__trgEv=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(t=this.em).trigger.apply(t,$f([e],n,!1))},r.prototype.__clearStateTarget=function(){var e=this,t=this.em,n=this.__getStateTarget();n&&(null==t||t.skip((function(){t.Css.remove(n),e.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(e,t,n){void 0===n&&(n={});var r=this.getSector(e);return r||(t.id=e,r=this.sectors.add(t,n)),r},r.prototype.getSector=function(e,t){void 0===t&&(t={});var n=this.sectors.where({id:e})[0];return!n&&t.warn&&this._logNoSector(e),n||null},r.prototype.getSectors=function(e){void 0===e&&(e={});var t=this.sectors,n=t&&t.models?e.array?$f([],t.models,!0):t:[];return e.visible?n.filter((function(e){return e.isVisible()})):n},r.prototype.removeSector=function(e){return this.getSectors().remove(this.getSector(e,{warn:!0}))},r.prototype.addProperty=function(e,t,n){void 0===n&&(n={});var r,o=this.getSector(e,{warn:!0});return o&&(r=o.addProperty(t,n)),r},r.prototype.getProperty=function(e,t){var n,r=this.getSector(e,{warn:!0});return r&&(n=r.properties.filter((function(e){return e.get("property")===t||e.get("id")===t}))[0]),n},r.prototype.getProperties=function(e){var t,n=this.getSector(e,{warn:!0});return n&&(t=n.properties),t},r.prototype.removeProperty=function(e,t){var n=this.getProperties(e);return n?n.remove(this.getProperty(e,t)):null},r.prototype.select=function(n,r){var o=this;void 0===r&&(r={});var i=this.em,a=(0,e.isArray)(n)?n:[n],s=r.stylable,l=i.Css,c=[];a.filter(Boolean).forEach((function(t){var n=t;if((0,e.isString)(t)){var r=l.getRule(t)||l.setRule(t);!(0,e.isUndefined)(s)&&r.set({stylable:s}),n=r}c.push(n)}));var u=r.component||c.filter((function(e){return(0,t.isComponent)(e)})).reverse()[0];c=c.map((function(e){return o.getModelToStyle(e)}));var d=i.getState(),p=c.slice().reverse()[0],f=this.getParentRules(p,{state:d,component:u}),h=this.__getStateTarget();return i.skip((function(){var e;if(d&&(null===(e=null==p?void 0:p.getState)||void 0===e?void 0:e.call(p))){var t=p.getStyle();h?h.setStyle(t):h=l.getAll().add({selectors:"gjs-selected",style:t,shallow:!0,important:!0})}else h&&(l.remove(h),h=void 0)})),this.model.set({targets:c,lastTarget:p,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(e,t){this.getSelectedAll().map((function(n){return n.addStyle(e,t)}));var n=this.getSelected();n&&this.__emitCmpStyleUpdate(e);var r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),t))},r.prototype.getBuiltIn=function(e){return this.builtIn.get(e)},r.prototype.getBuiltInAll=function(){return this.builtIn.props},r.prototype.addBuiltIn=function(e,t){return this.builtIn.add(e,t)},r.prototype.getModelToStyle=function(e,t){void 0===t&&(t={});var n=this.em,r=t.skipAdd;if(n&&(null==e?void 0:e.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=e.get("classes").getStyleable(),d=u.length,p=!l.componentFirst||t.useClasses,f={noCount:1},h={state:c,addOpts:f};i.skip((function(){var t;if(d&&p){var i=n.getCurrentMedia();(t=a.get(u,c,i))||r||(t=a.add(u,c,i,{},f))}else if(o.avoidInlineStyle){var s=e.getId();!(t=a.getIdRule(s,h))&&!r&&(t=a.setIdRule(s,{},h)),e.is("wrapper")&&t.set("wrapper",1,f)}t&&(e=t)}))}return e},r.prototype.getParentRules=function(t,n){var r=void 0===n?{}:n,o=r.state,i=r.component,a=this.em,s=[];if(a&&t){var l=i,c=a.Css,u=a.CodeManager.getGenerator("css"),d=t.toHTML?t:t.getComponent(),p={array:!0},f=[],h=[],g=[],m=function(e){return e.length?c.getRules().filter((function(t){var n=t.getSelectors().map((function(e){return e.getFullName()}));return!!n.length&&n.every((function(t){return e.indexOf(t)>=0}))})):[]};d?(f=c.getRules("#".concat(d.getId())),g=(h=l?m(l.getSelectors().getFullName(p)):[]).concat(f)):(f=l?c.getRules("#".concat(l.getId())):[],h=m(t.getSelectors().getFullName(p)),g=f.concat(h));var v=g.filter((function(t){return(0,e.isUndefined)(o)?1:t.get("state")===o})).sort(u.sortRules).reverse();s=v.slice(v.indexOf(t)+1)}return s},r.prototype.addType=function(e,t){this.properties.addType(e,t)},r.prototype.getType=function(e){return this.properties.getType(e)},r.prototype.getTypes=function(){return this.properties.getTypes()},r.prototype.createType=function(e,t){var n=void 0===t?{}:t,r=n.model,o=void 0===r?{}:r,i=n.view,a=void 0===i?{}:i,s=this.config,l=this.getType(e);if(l)return new l.view(Hf({model:new l.model(o),config:s},a))},r.prototype.render=function(){var e=this,t=e.config,n=e.em,r=e.SectView,o=r&&r.el;return this.SectView=new Bf({el:o,em:n,config:t,module:this,collection:this.sectors}),this.SectView.render().el},r.prototype._logNoSector=function(e){var t=this.em;t&&t.logWarning("'".concat(e,"' sector not found"))},r.prototype.__emitCmpStyleUpdate=function(e,t){void 0===t&&(t={});var n=this.em;if(!e.__p){var r=this.getSelectedAll(),o=t.components||n.getSelectedAll(),i=Array.isArray(o)?o:[o],a=Hf({},e);delete a.__p,i.forEach((function(e){return!r.includes(e)&&e.__onStyleChange(a)}))}},r.prototype.__upProps=function(e){var t=this;void 0===e&&(e={});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(e){return{target:e,style:e.getStyle()}}));r.map((function(n){n.getProperties().map((function(n){t.__upProp(n,a,s,e)}))})),r.forEach((function(e){var t=e.getProperties();t.forEach((function(e){var t=e.__checkVisibility({target:n,component:o,sectors:r});e.set("visible",t)}));var i=t.some((function(e){return e.isVisible()}));e.set("visible",i)}))}},r.prototype.__upProp=function(e,t,n,r){var o=this,i=e.getName(),a=t[i],s=rh(a),l="stack"===e.getType(),c="composite"===e.getType(),u=Hf(Hf({},r),{__up:!0}),d=!c&&!l,p=e,f=e,h=l?p.__getLayersFromStyle(t):[],g=c?f.__getPropsFromStyle(t):{},m=s?a:null,v=null;if(l&&null===h||c&&null===g){var y=l?"__getLayersFromStyle":"__getPropsFromStyle";if(w=n.filter((function(e){return null!==p[y](e.style)}))[0]){m=w.style[i],v=w.target;var b=p[y](w.style);l?h=b:g=b}}else if(!s){var w;m=null,(w=n.filter((function(e){return rh(e.style[i])}))[0])&&(m=w.style[i],v=w.target)}if(e.__setParentTarget(v),d&&e.__getFullValue()!==m&&e.upValue(m,u),l&&p.__setLayers(h||[],{isEmptyValue:p.isEmptyValueStyle(t)}),c){var x=f.getProperties();if(f.isDetached()){var C=f.__getPropsFromStyle(t,{byName:!0})||{},S=n.map((function(e){return Hf(Hf({},e),{style:f.__getPropsFromStyle(e.style,{byName:!0})||{}})}));x.map((function(e){return o.__upProp(e,C,S,r)}))}else f.__setProperties(g||{},u),f.getProperties().map((function(e){return e.__setParentTarget(v)}))}},r.prototype.destroy=function(){var e;[this.properties,this.sectors].forEach((function(e){e.reset(),e.stopListening()})),null===(e=this.SectView)||void 0===e||e.remove(),this.model.stopListening(),this.upAll.cancel()},r}(m);const ah=ih;var sh=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lh=function(){return lh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lh.apply(this,arguments)},ch=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},uh=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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 dh=[Nc,xc,ou,kd,ns,H,wa,ah,Ki,hu,vd,Yu,qd,Bs,bl,Ke,rl,gi],ph=[nc,Go,hc,Mo];!function(t){var n=t.$;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 e=this.get(0);return e&&e.focus(),this},r.bind=function(e,t){return this.on(e,t)},r.unbind=function(t,n){if((0,e.isObject)(t)){for(var r in t)t.hasOwnProperty(r)&&this.off(r,t[r]);return this}return this.off(t,n)},r.click=function(e){return e?this.on("click",e):this.trigger("click")},r.change=function(e){return e?this.on("change",e):this.trigger("change")},r.keydown=function(e){return e?this.on("keydown",e):this.trigger("keydown")},r.delegate=function(e,t,n,r){return r||(r=n),this.on(t,e,(function(e){e.data=n,r(e)}))},r.scrollLeft=function(){var e=this.get(0),t=(e=9==e.nodeType?e.defaultView:e)instanceof Window?e:null;return t?t.pageXOffset:e.scrollLeft||0},r.scrollTop=function(){var e=this.get(0),t=(e=9==e.nodeType?e.defaultView:e)instanceof Window?e:null;return t?t.pageYOffset:e.scrollTop||0};var o=n.prototype.offset;r.offset=function(e){var t,n;return e&&(t=e.top,n=e.left),void 0!==t&&this.css("top","".concat(t,"px")),void 0!==n&&this.css("left","".concat(n,"px")),o.call(this)},n.map=function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n};var i=Array.prototype.indexOf;n.inArray=function(e,t,n){return null==t?-1:i.call(t,e,n)},n.Event=function(e,t){if(!(this instanceof n.Event))return new n.Event(e,t);this.type=e,this.isDefaultPrevented=function(){return!1}}}}({$:a.default});var fh={debug:console.log,info:console.info,warning:console.warn,error:console.error},hh=function(n){function r(t){void 0===t&&(t={});var r=n.call(this)||this;r.__skip=!1,r.defaultRunning=!1,r.destroyed=!1,r._config=t;var o=r.config;r.set("Config",t),r.set("modules",[]),r.set("toLoad",[]),r.set("storables",[]),r.set("selected",new d),r.set("dmode",o.dragMode);var i=o.el,a=o.log,s=!0===a?(0,e.keys)(fh):(0,e.isArray)(a)?a:[];return(0,e.bindAll)(r,"initBaseColorPicker"),i&&o.fromElement&&(o.components=i.innerHTML),r.attrsOrig=i?(0,e.toArray)(i.attributes).reduce((function(e,t){return e[t.nodeName]=t.nodeValue,e}),{}):"",o.components&&!o.pageManager&&(o.pageManager={pages:[{component:o.components}]}),dh.forEach((function(e){return r.loadModule(e)})),ph.forEach((function(e){return r.loadStorableModule(e)})),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(e){return r.listenLog(e)})),[{from:"change:selectedComponent",to:"component:toggled"}].forEach((function(e){var t=e.from,n=e.to;r.listenTo(r,t,(function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];r.trigger.apply(r,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([n],e,!1)),r.logWarning("The event '".concat(t,"' is deprecated, replace it with '").concat(n,"'"))}))})),r}return sh(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(e){this.listenTo(this,"log:".concat(e),fh[e])},Object.defineProperty(r.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),r.prototype.getConfig=function(t){var n=this.config;return(0,e.isUndefined)(t)?n:n[t]},r.prototype.loadOnStart=function(){var e=this,t=this.config,n=t.projectData,o=t.headless,i=this.Storage;this.toLoad.reverse().forEach((function(e){return e.onLoad()}));var a=function(){e.modules.forEach((function(t){return t.postLoad&&t.postLoad(e)})),e.set("readyLoad",1)};o?(n&&this.loadData(n),a()):this._storageTimeout=setTimeout((function(){return ch(e,void 0,void 0,(function(){var e;return uh(this,(function(t){switch(t.label){case 0:return n?(this.loadData(n),[3,5]):[3,1];case 1:if(!(null==i?void 0:i.canAutoload()))return[3,5];t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.load()];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),this.logError(e),[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(e,t,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(e){return r.logError(e)}))},r.prototype.loadModule=function(e){var t=new e(this);return this.set(t.name,t),t.onLoad&&this.toLoad.push(t),this.modules.push(t),t},r.prototype.loadStorableModule=function(e){var t=this.loadModule(e);return this.storables.push(t),t},r.prototype.init=function(e,t){void 0===t&&(t={}),this.destroyed&&(this.initialize(t),this.destroyed=!1),this.set("Editor",e)},r.prototype.getEditor=function(){return this.get("Editor")},r.prototype.handleUpdates=function(e,t,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 e=r.getDirtyCount()||0;n.unset;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["unset"]);r.set("changesCount",e+1,t)}),0))},r.prototype.changesUp=function(e){this.handleUpdates(0,0,e)},r.prototype.componentHovered=function(e,t,n){var r=this.previous("componentHovered");r&&this.trigger("component:unhovered",r,n),t&&this.trigger("component:hovered",t,n)},r.prototype.getSelected=function(){return this.selected.lastComponent()},r.prototype.getSelectedAll=function(){return this.selected.allComponents()},r.prototype.setSelected=function(t,n){var r=this;void 0===n&&(n={});var o=n.event,i=o&&(o.ctrlKey||o.metaKey),a=(o||{}).shiftKey,s=((0,e.isArray)(t)?t:[t]).map((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.delegate)||void 0===t?void 0:t.select)||void 0===n?void 0:n.call(t,e))||e})).filter(Boolean),l=this.getSelectedAll(),c=this.getConfig().multipleSelection,u=(0,e.isArray)(t);!u&&t||this.removeSelected(l.filter((function(t){return!(0,e.contains)(s,t)}))),s.forEach((function(t){if(t&&(r.trigger("component:select:before",t,n),!t.get("selectable")||n.abort)){if(!n.useValid)return;for(var o=t.parent();o&&!o.get("selectable");)o=o.parent();t=o}if(i&&c)return r.toggleSelected(t);if(a&&c){r.clearSelection(r.Canvas.getWindow());var s,d,p=t.collection,f=t.index();if(r.getSelectedAll().forEach((function(t){var n=t.collection,r=t.index();n===p&&(r<f?s=(0,e.isUndefined)(s)?r:Math.max(s,r):r>f&&(d=(0,e.isUndefined)(d)?r:Math.min(d,r)))})),!(0,e.isUndefined)(s))for(;s!==f;)r.addSelected(p.at(s)),s++;if(!(0,e.isUndefined)(d))for(;d!==f;)r.addSelected(p.at(d)),d--;return r.addSelected(t)}!u&&r.removeSelected(l.filter((function(e){return e!==t}))),r.addSelected(t,n)}))},r.prototype.addSelected=function(t,n){var r=this;void 0===n&&(n={}),((0,e.isArray)(t)?t:[t]).forEach((function(t){var o=r.selected;t&&t.get("selectable")&&!t.parents().some((function(e){return o.hasComponent(e)}))&&(n.forceChange&&r.removeSelected(t,n),o.allComponents().filter((function(n){return(0,e.contains)(n.parents(),t)})).forEach((function(e){return r.removeSelected(e,n)})),o.addComponent(t,n),r.trigger("component:select",t,n),r.Canvas.addSpot({type:se.q.Select,component:t}))}))},r.prototype.removeSelected=function(t,n){var r=this;void 0===n&&(n={}),this.selected.removeComponent(t,n),((0,e.isArray)(t)?t:[t]).forEach((function(e){return r.Canvas.removeSpots({type:se.q.Select,component:e})}))},r.prototype.toggleSelected=function(t,n){var r=this;void 0===n&&(n={}),((0,e.isArray)(t)?t:[t]).forEach((function(e){r.selected.hasComponent(e)?r.removeSelected(e,n):r.addSelected(e,n)}))},r.prototype.setHovered=function(e,t){var n=this;void 0===t&&(t={});var r=function(e,t){var r=n,o=r.config,i=r.Canvas,a=n.getHovered(),s=n.getSelectedAll(),l=se.q.Hover,c=se.q.Spacing;n.set("componentHovered",e||null,t),a&&(i.removeSpots({type:l,component:a}),i.removeSpots({type:c,component:a})),e&&(i.addSpot({type:l,component:e}),s.includes(e)&&!o.showOffsetsSelected||i.addSpot({type:c,component:e}))};if(!e)return r();var o="component:hover";if(t.forceChange&&r(),this.trigger("".concat(o,":before"),e,t),!e.get("hoverable")){if(!t.useValid||t.abort)return;for(var i=e.parent();i&&!i.get("hoverable");)i=i.parent();e=i}t.abort||(r(e,t),this.trigger(o,e,t))},r.prototype.getHovered=function(){return this.get("componentHovered")},r.prototype.setComponents=function(e,t){return void 0===t&&(t={}),this.Components.setComponents(e,t)},r.prototype.getComponents=function(){var e=this.Components,t=this.CodeManager;if(e&&t){var n=e.getComponents();return t.getCode(n,"json")}},r.prototype.setStyle=function(e,t){void 0===t&&(t={});var n=this.Css;return n.clear(t),n.getAll().add(e,t),this},r.prototype.addStyle=function(t,n){void 0===n&&(n={});var r=this.getStyle().add(t,n);return(0,e.isArray)(r)?r:[r]},r.prototype.getStyle=function(){return this.Css.getAll()},r.prototype.setState=function(e){return this.set("state",e),this},r.prototype.getState=function(){return this.get("state")||""},r.prototype.getHtml=function(e){void 0===e&&(e={});var t=this.config,n=t.optsHtml,r=t.jsInHtml?this.getJs(e):"",o=e.component||this.Components.getComponent(),i=o?this.CodeManager.getCode(o,"html",lh(lh({},n),e)):"";return i+=r?"<script>".concat(r,"<\/script>"):""},r.prototype.getCss=function(t){void 0===t&&(t={});var n=this.config,r=n.optsCss,o=t.avoidProtected,i=(0,e.isUndefined)(t.keepUnusedStyles)?n.keepUnusedStyles:t.keepUnusedStyles,a=this.Css,s=t.component||this.Components.getComponent(),l=o?"":n.protectedCss,c=s&&this.CodeManager.getCode(s,"css",lh(lh({cssc:a,keepUnusedStyles:i},r),t));return s?t.json?c:l+c:""},r.prototype.getJs=function(e){void 0===e&&(e={});var t=e.component||this.Components.getWrapper();return t?this.CodeManager.getCode(t,"js").trim():""},r.prototype.store=function(e){return ch(this,void 0,void 0,(function(){var t;return uh(this,(function(n){switch(n.label){case 0:return t=this.storeData(),[4,this.Storage.store(t,e)];case 1:return n.sent(),this.clearDirtyCount(),[2,t]}}))}))},r.prototype.load=function(e,n){return void 0===n&&(n={}),ch(this,void 0,void 0,(function(){var r;return uh(this,(function(o){switch(o.label){case 0:return[4,this.Storage.load(e)];case 1:return r=o.sent(),this.loadData(r),[4,(0,t.wait)()];case 2:return o.sent(),n.clear&&(this.UndoManager.clear(),this.clearDirtyCount()),[2,r]}}))}))},r.prototype.storeData=function(){var e={},t=this.getEditing();return t&&t.trigger("sync:content",{noCount:!0}),this.storables.forEach((function(t){e=lh(lh({},e),t.store(1))})),JSON.parse(JSON.stringify(e))},r.prototype.loadData=function(e){return void 0===e&&(e={}),(0,t.isEmptyObj)(e)||(this.storables.forEach((function(e){return e.clear()})),this.storables.forEach((function(t){return t.load(e)}))),e},r.prototype.getDeviceModel=function(){var e=this.get("device");return this.Devices.get(e)},r.prototype.runDefault=function(e){void 0===e&&(e={});var t=this.get("Commands").get(this.config.defaultCommand);t&&!this.defaultRunning&&(t.stop(this,this,e),t.run(this,this,e),this.defaultRunning=!0)},r.prototype.stopDefault=function(e){void 0===e&&(e={});var t=this.get("Commands").get(this.config.defaultCommand);t&&this.defaultRunning&&(t.stop(this,this,e),this.defaultRunning=!1)},r.prototype.refreshCanvas=function(e){void 0===e&&(e={}),this.Canvas.refresh({spots:e.tools})},r.prototype.clearSelection=function(e){var t;null===(t=(e||window).getSelection())||void 0===t||t.removeAllRanges()},r.prototype.getCurrentMedia=function(){var e=this.config,t=this.getDeviceModel(),n=e.mediaCondition,r=e.devicePreviewMode,o=t&&t.get("widthMedia");return t&&o&&!r?"(".concat(n,": ").concat(o,")"):""},r.prototype.getWrapper=function(){return this.Components.getWrapper()},r.prototype.setCurrentFrame=function(e){return this.set("currentFrame",e)},r.prototype.getCurrentFrame=function(){return this.get("currentFrame")},r.prototype.getCurrentFrameModel=function(){var e;return null===(e=this.getCurrentFrame()||{})||void 0===e?void 0:e.model},r.prototype.getIcon=function(e){return(this.config.icons||{})[e]||""},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(e){return this.set("dmode",e)},r.prototype.getDragMode=function(e){return(null==e?void 0:e.getDragMode())||this.get("dmode")||""},r.prototype.t=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.get("I18n");return null==n?void 0:n.t.apply(n,e)},r.prototype.inAbsoluteMode=function(e){return"absolute"===this.getDragMode(e)},r.prototype.destroyAll=function(){var e=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(e){return e.destroy()})),r&&r.remove(),this.clear({silent:!0}),this.destroyed=!0,["_config","view","_previousAttributes","_events","_listeners"].forEach((function(t){return e[t]={}})),s.splice(s.indexOf(o),1),(0,t.hasWin)()&&(0,a.default)(n.el).empty().attr(this.attrsOrig)},r.prototype.getEditing=function(){var e=this.get("editing");return e&&e.model||void 0},r.prototype.setEditing=function(e){return this.set("editing",e),this},r.prototype.isEditing=function(){return!!this.get("editing")},r.prototype.log=function(e,t){void 0===t&&(t={});var n=t.ns,r=t.level,o=void 0===r?"debug":r;if(this.trigger("log",e,t),o&&this.trigger("log:".concat(o),e,t),n){var i="log-".concat(n);this.trigger(i,e,t),o&&this.trigger("".concat(i,":").concat(o),e,t)}},r.prototype.logInfo=function(e,t){this.log(e,lh(lh({},t),{level:"info"}))},r.prototype.logWarning=function(e,t){this.log(e,lh(lh({},t),{level:"warning"}))},r.prototype.logError=function(e,t){this.log(e,lh(lh({},t),{level:"error"}))},r.prototype.initBaseColorPicker=function(e,t){void 0===t&&(t={});var n=this.config,r=n.colorPicker,o=void 0===r?{}:r,i=n.el,s=n.stylePrefix;return(0,a.default)(e).spectrum(lh(lh({containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:i||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},t),o))},r.prototype.skip=function(e){this.__skip=!0;var t=this.UndoManager;t?t.skip(e):e(),this.__skip=!1},r.prototype.data=function(t,n,r){var o="_gjs-data";if(t[o]||(t[o]={}),(0,e.isUndefined)(r))return t[o][n];t[o][n]=r},r}(l.Hn);const gh=hh;var mh=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vh=function(e){function n(t){var n=e.call(this,{model:t})||this,r=t.attributes,o=r.Panels,i=r.UndoManager;return t.view=n,t.once("change:ready",(function(){o.active(),o.disableButtons(),i.clear(),setTimeout((function(){t.trigger("load",t.get("Editor")),t.clearDirtyCount()}))})),n}return mh(n,e),n.prototype.render=function(){var e=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,d=["".concat(u,"editor")];!l.customUI&&d.push("".concat(u,"one-bg ").concat(u,"two-color"));var p=(0,a.default)(l.el||"body ".concat(l.container));l.cssIcons&&(0,t.appendStyles)(l.cssIcons,{unique:!0,prepand:!0}),n.empty(),l.width&&p.css("width",l.width),l.height&&p.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",d.join(" ")),p.addClass("".concat(u,"editor-cont")).empty().append(n),c.forEach((function(t){return t.postRender&&t.postRender(e)})),this},n}(l.G7);const yh=vh;var bh=function(){return bh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bh.apply(this,arguments)},wh=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},xh=function(e,t){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=t.call(e,a)}catch(e){s=[6,e],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])}}},Ch=function(){function e(e,t){var o;void 0===e&&(e={}),void 0===t&&(t={}),this.html=n,this.config=bh(bh(bh({},r),e),{pStylePrefix:null!==(o=e.stylePrefix)&&void 0!==o?o:r.stylePrefix}),this.em=new gh(this.config),this.$=t.$,this.em.init(this),this.editor=this.em}return Object.defineProperty(e.prototype,"Config",{get:function(){return this.em.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"I18n",{get:function(){return this.em.I18n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Utils",{get:function(){return this.em.Utils},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Commands",{get:function(){return this.em.Commands},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Keymaps",{get:function(){return this.em.Keymaps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Modal",{get:function(){return this.em.Modal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Panels",{get:function(){return this.em.Panels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Canvas",{get:function(){return this.em.Canvas},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Parser",{get:function(){return this.em.Parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CodeManager",{get:function(){return this.em.CodeManager},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"UndoManager",{get:function(){return this.em.UndoManager},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RichTextEditor",{get:function(){return this.em.RichTextEditor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Pages",{get:function(){return this.em.Pages},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Components",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DomComponents",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Layers",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LayerManager",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Css",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CssComposer",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Storage",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StorageManager",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Assets",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AssetManager",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Blocks",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BlockManager",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Traits",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TraitManager",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Selectors",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SelectorManager",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Styles",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StyleManager",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Devices",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DeviceManager",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"EditorModel",{get:function(){return this.em},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(e){return this.em.getConfig(e)},e.prototype.getHtml=function(e){return this.em.getHtml(e)},e.prototype.getCss=function(e){return this.em.getCss(e)},e.prototype.getJs=function(e){return this.em.getJs(e)},e.prototype.getComponents=function(){return this.Components.getComponents()},e.prototype.getWrapper=function(){return this.Components.getWrapper()},e.prototype.setComponents=function(e,t){return void 0===t&&(t={}),this.em.setComponents(e,t),this},e.prototype.addComponents=function(e,t){return this.getWrapper().append(e,t)},e.prototype.getStyle=function(){return this.em.Css.getAll()},e.prototype.setStyle=function(e,t){return void 0===t&&(t={}),this.em.setStyle(e,t),this},e.prototype.addStyle=function(e,t){return void 0===t&&(t={}),this.em.addStyle(e,t)},e.prototype.getSelected=function(){return this.em.getSelected()},e.prototype.getSelectedAll=function(){return this.em.getSelectedAll()},e.prototype.getSelectedToStyle=function(){var e=this.em.getSelected();if(e)return this.StyleManager.getModelToStyle(e)},e.prototype.select=function(e,t){return this.em.setSelected(e,t),this},e.prototype.selectAdd=function(e){return this.em.addSelected(e),this},e.prototype.selectRemove=function(e){return this.em.removeSelected(e),this},e.prototype.selectToggle=function(e){return this.em.toggleSelected(e),this},e.prototype.getEditing=function(){return this.em.getEditing()},e.prototype.setDevice=function(e){return this.em.set("device",e),this},e.prototype.getDevice=function(){return this.em.get("device")},e.prototype.runCommand=function(e,t){return void 0===t&&(t={}),this.Commands.run(e,t)},e.prototype.stopCommand=function(e,t){return void 0===t&&(t={}),this.Commands.stop(e,t)},e.prototype.store=function(e){return wh(this,void 0,void 0,(function(){return xh(this,(function(t){switch(t.label){case 0:return[4,this.em.store(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.load=function(e,t){return void 0===t&&(t={}),wh(this,void 0,void 0,(function(){return xh(this,(function(n){switch(n.label){case 0:return[4,this.em.load(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.getProjectData=function(){return this.em.storeData()},e.prototype.loadProjectData=function(e){return this.em.loadData(e)},e.prototype.storeData=function(){return this.em.storeData()},e.prototype.loadData=function(e){return this.em.loadData(e)},e.prototype.getContainer=function(){return this.config.el},e.prototype.getDirtyCount=function(){return this.em.getDirtyCount()},e.prototype.clearDirtyCount=function(){return this.em.clearDirtyCount()},e.prototype.refresh=function(e){this.em.refreshCanvas(e)},e.prototype.setCustomRte=function(e){this.RichTextEditor.customRte=e},e.prototype.setCustomParserCss=function(e){return this.Parser.getConfig().parserCss=e,this},e.prototype.setDragMode=function(e){return this.em.setDragMode(e),this},e.prototype.log=function(e,t){return void 0===t&&(t={}),this.em.log(e,t),this},e.prototype.t=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this.em).t.apply(e,t)},e.prototype.on=function(e,t){return this.em.on(e,t),this},e.prototype.once=function(e,t){return this.em.once(e,t),this},e.prototype.off=function(e,t){return this.em.off(e,t),this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return this.em.trigger.apply(this.em,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e],t,!0)),this},e.prototype.destroy=function(){this.em&&(this.em.destroyAll(),this.editorView=void 0)},e.prototype.getEl=function(){var e;return null===(e=this.editorView)||void 0===e?void 0:e.el},e.prototype.getModel=function(){return this.em},e.prototype.render=function(){var e;return null===(e=this.editorView)||void 0===e||e.remove(),this.editorView=new yh(this.em),this.editorView.render().el},e.prototype.onReady=function(e){this.em.get("ready")?e(this):this.em.on("load",e)},e}();const Sh=Ch;var _h=function(n,r){return(0,e.isString)(n)?function(e,n){var r=n.get(e);if(!r){var o=(0,t.getGlobal)()[e];r=(null==o?void 0:o.default)||o}return r}(n,r):(null==n?void 0:n.default)||n},Eh=function(e,t){e.getModel().logWarning("Plugin ".concat(t," not found"),{context:"plugins",plugin:t})};const Oh=function(){function e(){this.plugins={}}return e.prototype.add=function(e,t){var n=this.get(e);return n||(this.plugins[e]=t,t)},e.prototype.get=function(e){return this.plugins[e]},e.prototype.getAll=function(){return this.plugins},e}();var kh=function(){return kh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kh.apply(this,arguments)};!function(){if((0,t.hasWin)()&&function(){for(var e,t=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(e=n[r][1].exec(t))break}return!!e}()){var e=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(t){return t||(t=""),e.apply(document.implementation,[t])}}}();var Th=new Oh,Ph=[],Mh=function(e,t){var n=_h(e,Th);return function(r){n?n(r,t||{}):Eh(r,e)}},Ah={$:a.default,editors:Ph,plugins:Th,usePlugin:Mh,version:"0.21.10",init:function(t){void 0===t&&(t={});var n=t.headless,r=t.container;if(!r&&!n)throw new Error("'container' is required");var o=kh(kh({autorender:!0,plugins:[],pluginsOpts:{}},t),{grapesjs:this,el:n?void 0:(0,e.isElement)(r)?r:document.querySelector(r)}),i=new Sh(o,{$:a.default}),s=i.getModel();return o.plugins.forEach((function(e){var t=_h(e,Th),n=o.pluginsOpts[e]||{};t?t(i,n):Eh(i,e)})),s.loadOnStart(),o.autorender&&!n&&i.render(),Ph.push(i),i}};const Dh=Ah})();var H=z.ZP,$="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function U(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var q,G={exports:{}};
|
|
11
|
-
/*! grapesjs-tui-image-editor - 1.0.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,q=()=>(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};const o=function(e,t){void 0===t&&(t={});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"]},t),i=o.script,a=o.style,s=o.height,l=o.width,c=o.hideHeader,u=o.onApply,d=o.upload,p=o.addToAssets,f=o.commandId,h="undefined"!=typeof window,g=function(){var e;return o.constructor||h&&(null===(e=window.tui)||void 0===e?void 0:e.ImageEditor)},m=g();if(!m&&(null==i?void 0:i.length)&&h){var v=document.head,y=Array.isArray(i)?r([],i,!0):[i],b=Array.isArray(a)?r([],a,!0):[a],w=function(e){if(e.length){var t=document.createElement("link");t.href=e.shift(),t.rel="stylesheet",v.appendChild(t),w(e)}},x=function(e){if(e.length){var t=document.createElement("script");t.src=e.shift(),t.onerror=t.onload=x.bind(null,e),v.appendChild(t)}else m=g()};w(b),x(y)}o.toolbarIcon&&e.Components.addType("image",{extendFn:["initToolbar"],model:{initToolbar:function(){var e=this.get("toolbar");(null==e?void 0:e.some((function(e){return e.command===f})))||(null==e||e.unshift({command:f,label:o.toolbarIcon}),this.set("toolbar",e))}}});var C={level:"error",ns:f};e.Commands.add(f,{imageEditor:null,run:function(e,t,n){var r=this;if(void 0===n&&(n={}),!m)return e.log("TOAST UI Image editor not found",C),e.stopCommand(f);var i=n.target||e.getSelected();if(!i)return e.log("Target not available",C),e.stopCommand(f);var a=this.createContent(),s=o.labelImageEditor,l=a.children[1];e.Modal.open({title:s,content:a}).onceClose((function(){return e.stopCommand(f)}));var c=this.getEditorConfig(i.get("src"));this.imageEditor=new m(a.children[0],c),e.getModel().setEditing(!0),l.onclick=function(){return r.applyChanges(i)},o.onApplyButton(l)},stop:function(e){var t;null===(t=this.imageEditor)||void 0===t||t.destroy(),e.getModel().setEditing(!1)},getEditorConfig:function(e){var t=n({},o.config);return t.includeUI||(t.includeUI={}),t.includeUI=n(n({theme:{}},t.includeUI),{loadImage:{path:e,name:"1"},uiSize:{height:s,width:l}}),c&&(t.includeUI.theme["header.display"]="none"),t},createContent:function(){var e=document.createElement("div");return e.style.position="relative",e.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 "),e},applyChanges:function(e){var t=this,n=this.imageEditor;u?u(n,e):"CROPPER"===n.getDrawingMode()?n.crop(n.getCropzoneRect()).then((function(){t.uploadImage(n,e)})):this.uploadImage(n,e)},uploadImage:function(t,n){var r=this,o=e.Assets,i=t.toDataURL();if(d){var a=this.dataUrlToBlob(i);o.FileUploader().uploadFile({dataTransfer:{files:[a]}},(function(e){var t=e&&e.data&&e.data[0],o=t&&("string"==typeof t?t:t.src);o&&r.applyToTarget(o,n)}))}else p&&o.add({src:i,name:(n.get("src")||"").split("/").pop()}),this.applyToTarget(i,n)},applyToTarget:function(t,n){n.set("src",t),e.Modal.close()},dataUrlToBlob:function(e){for(var t=e.split(","),n=window.atob(t[1]),r=t[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 t})();var Y=W(G.exports=q());let K;const Z=new Uint8Array(16);function X(){if(!K&&(K="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!K))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K(Z)}const J=[];for(let e=0;e<256;++e)J.push((e+256).toString(16).slice(1));var Q={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ee(e,t,n){if(Q.randomUUID&&!t&&!e)return Q.randomUUID();const r=(e=e||{}).random||(e.rng||X)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]}(r)}var te={appendTo:"#styles-container",custom:!0,sectors:[]},ne={appendTo:"#styles-container",componentFirst:!0},re={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}]}]},oe=["https://code.jquery.com/jquery-3.5.1.slim.min.js"],ie=["https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Alegreya:ital,wght@0,400..900;1,400..900&family=Anton&family=Assistant&family=Bebas+Neue&family=Cinzel:wght@400..900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Fauna+One&family=IBM+Plex+Sans&family=Inter&family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Manrope:wght@200..800&family=Merriweather&family=Merienda&family=Open+Sans&family=Oswald:wght@200..700&family=Pacifico&family=Patrick+Hand&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:ital,wght@0,200..900;1,200..900&family=Proza+Libre:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&family=PT+Sans+Narrow:wght@400;700&family=Quicksand:wght@300..700&family=Raleway:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Satisfy&family=Source+Sans+Pro:ital,wght@0,200..900;1,200..900&family=Work+Sans:ital,wght@0,100..900;1,100..900&family=Black+Han+Sans&display=swap","https://fonts.cdnfonts.com/css/source-sans-pro"],ae="form-builder",se="landing-page-builder",le="popup-builder",ce="fullpage-builder",ue={Top:"removeTopPadding",Bottom:"removeBottomPadding",Vertical:"removeVerticalPadding"},de="50%",pe={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"},fe=[{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="copy"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M352 528L128 528C119.2 528 112 520.8 112 512L112 288C112 279.2 119.2 272 128 272L176 272L176 224L128 224C92.7 224 64 252.7 64 288L64 512C64 547.3 92.7 576 128 576L352 576C387.3 576 416 547.3 416 512L416 464L368 464L368 512C368 520.8 360.8 528 352 528zM288 368C279.2 368 272 360.8 272 352L272 128C272 119.2 279.2 112 288 112L512 112C520.8 112 528 119.2 528 128L528 352C528 360.8 520.8 368 512 368L288 368zM224 352C224 387.3 252.7 416 288 416L512 416C547.3 416 576 387.3 576 352L576 128C576 92.7 547.3 64 512 64L288 64C252.7 64 224 92.7 224 128L224 352z"/></svg></div>',command:"tlb-copy"},{label:'\n <div title="paste" class="tlb-paste-btn">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 24 24"\n style="fill:none !important;stroke:currentColor !important;"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n aria-hidden="true"\n >\n <rect\n width="8"\n height="4"\n x="8"\n y="2"\n rx="1"\n ry="1"\n style="fill:none !important;"\n ></rect>\n\n <path\n d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"\n style="fill:none !important;"\n ></path>\n </svg>\n </div>',command:"tlb-paste"},{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"},{label:'<div title="select parent"><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"></path></svg></div>',command:"tlb-select-parent"}],he=[{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="copy" class="tlb-copy-btn"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H9.18C9.6,1.84 10.7,1 12,1C13.3,1 14.4,1.84 14.82,3H19M11,14H8V16H11V19H13V16H16V14H13V11H11V14M12,3A1,1 0 0,0 11,4A1,1 0 0,0 12,5A1,1 0 0,0 13,4A1,1 0 0,0 12,3Z"></path></svg></div>',command:"tlb-copy"},{label:'<div title="paste" class="tlb-paste-btn"><svg viewBox="0 0 24 24"><path fill="currentColor" d="M11,13H5V11H11V8L15,12L11,16V13M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3Z"></path></svg></div>',command:"tlb-paste"},{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"},{label:'<div title="select parent"><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"></path></svg></div>',command:"tlb-select-parent"}],ge=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],me=[0,15,30,45],ve='<svg\nwidth="85"\nheight="85"\nviewBox="0 0 20 20"\nfill="none"\nxmlns="http://www.w3.org/2000/svg"\ndata-gjs-selectable=false data-gjs-editable=false\n>\n<path\n d="M5 9V13.6837C5 14.4121 5.55927 15 6.25228 15H13.7477C14.4407 15 15 14.4121 15 13.6837V9.10224"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M7.97255 7.66667C7.97255 8.40496 7.0677 9 5.95303 9C5.55961 9 5.19898 8.92837 4.89081 8.80165C4.21545 8.52617 3.88104 7.87052 4.03841 7.25344L4.41871 5.7438C4.52362 5.31405 5.08751 5 5.74976 5H14.2475C14.9032 5 15.4671 5.31405 15.5786 5.7438L15.9589 7.23691C15.9589 7.24242 15.9654 7.24793 15.9589 7.24793C16.1228 7.86501 15.7884 8.52066 15.1065 8.79614C14.7983 8.92287 14.4311 8.99449 14.0442 8.99449C12.923 8.99449 12.0247 8.39945 12.0247 7.66116"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M12 8C12 8.55372 11.1039 9 10 9C8.88961 9 8 8.55372 8 8"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M8 8V5"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M12 8V5"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n</svg>',ye=function(e,t){return function(n){var r;n.Components.addType("body",{model:{defaults:{traits:[]}}}),n.Components.addType("custom-button",{model:_({defaults:_({"script-export":function(e){try{var t=this;if(t.style.cursor="pointer","fullpage-builder"===(null==e?void 0:e.page_type))t.onclick=function(n){if(n.preventDefault(),"close"===e.redirect_to&&window.everbeeLoadStep&&window.everbeeLoadStep(e.redirect_to,""),"url"!==e.redirect_to){if("step"===e.redirect_to){var r=t.getAttribute("data-target-page")||e.step_url;r&&window.everbeeLoadStep&&window.everbeeLoadStep("step",r)}}else e.page_url&&(window.location.href=e.page_url)};else{var n=function(e){var t,n;e.preventDefault();var r=(null===(t=e.target)||void 0===t||null===(t=t.attributes)||void 0===t||null===(t=t.href)||void 0===t?void 0:t.value)||"",o=null===(n=e.target)||void 0===n||null===(n=n.attributes)||void 0===n?void 0:n.blankPage;r&&(o?window.open(r,"_blank"):window.location.href=r)};t.removeEventListener("click",n),t.addEventListener("click",n)}}catch(e){console.warn("Failed to execute subscribe- button script",e)}},text:"Custom Button",toolbar:fe,traits:j(e===ce?[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button",removePadding:ue.Vertical},{type:"select",name:"redirect_to",label:"Action",changeProp:!0,options:[{value:"url",name:"Redirect to URL"},{value:"close",name:"Close Pop up"},{value:"step",name:"Go to step"}],tabType:"button",removePadding:ue.Vertical,visible:!0},{type:"select",name:"step",label:"Next Step",labelAsOption:"Choose a step",changeProp:!0,options:[],tabType:"button",visible:!1,removePadding:ue.Top},{type:"text",label:"Enter page url",name:"page_url",changeProp:!0,tabType:"button",removePadding:ue.Top}]:[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button",removePadding:ue.Top},{type:"text",name:"href",label:"Link",placeholder:"Enter URL",tabType:"button",removePadding:ue.Bottom},{type:"checkbox-item",name:"blankPage",label:"Open link on a new tab",tabType:"button"}])},e===ce?{redirect_to:"",step:"",page_type:"fullpage-builder",step_url:"",success_page_url:null===(r=n.getConfig().componentOptions)||void 0===r?void 0:r.success_page_url,"script-props":["page_url","step_url","redirect_to","page_type"]}:{page_type:e,"script-props":["page_type"]}),init:function(){var t=this;if(e===ce){var r,o=null==this||null===(r=this.getAttributes())||void 0===r?void 0:r.href,i=this.getAttributes();if(this.get("redirect_to")||("close"===i.redirect_to?this.set("redirect_to","close"):this.set("redirect_to","step")),(this.get("page_url")&&!this.get("redirect_to")||o)&&(o&&this.set("page_url",o),this.set("redirect_to","url")),this.updateStepOptions(),this.__onRedirectToChange(),!n)return;n.on("load",(function(){var e;t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),null!==(e=t.getAttributes())&&void 0!==e&&e["data-target-page"]&&t.set("step",""),t.__onRedirectToChange(),t.get("step")&&t.__onStepChange()})),n.on("page:remove",(function(e){t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),t.__onRedirectToChange()})),n.on("storage:end:load",(function(){var e;t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),null!==(e=t.getAttributes())&&void 0!==e&&e["data-target-page"]&&t.set("step",""),t.__onRedirectToChange(),t.get("step")&&t.__onStepChange()})),n.on("page:add",(function(){(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),t.__onRedirectToChange(),t.updateStepOptions()}))}var a=this.components(),s=1===a.length&&a.models[0],l=s&&s.is("textnode")&&s.get("content")||"",c=l||this.get("text");this.set("text",c.trim()),this.on("change:text",this.__onTextChange),c!==l&&this.__onTextChange(),this.on("change:redirect_to",this.__onRedirectToChange),this.on("change:step",this.__onStepChange),e===ce&&(this.get("step")&&this.__onStepChange(),this.__onRedirectToChange())},__onTextChange:function(){this.components(this.get("text"))}},e===ce?{__onRedirectToChange:function(){var e,t=this.get("redirect_to"),n=this.getTrait("page_url"),r=this.getTrait("step");if(n.set({disabled:!0,visible:!1}),r.set({visible:!1}),"url"===t&&(n.set({disabled:!1,visible:!0}),this.set("step",""),this.set("step_url","")),"close"===t&&(n.set({disabled:!0,visible:!1}),this.set("page_url",""),this.set("step",""),this.set("step_url","")),"step"===t)if(r.set({visible:!0}),n.set({disabled:!0,visible:!1}),this.set("page_url",""),this.get("step"))this.__onStepChange();else{var o,i,a=null===(o=this.em)||void 0===o?void 0:o.get("Editor");if(!a)return;var s=a.Pages;if(!s)return;var l=s.getAll()||[];if(!l.length)return;var c=null===(i=this.getAttributes())||void 0===i?void 0:i["data-target-page"];if(c){var u,d=l.find((function(e){var t,n;return null===(t=e.id||(null===(n=e.getId)||void 0===n?void 0:n.call(e)))||void 0===t?void 0:t.includes(c)}));if(d)return this.set("step",d.id||(null===(u=d.getId)||void 0===u?void 0:u.call(d))),void this.__onStepChange()}var p,f=s.getSelected(),h=l.findIndex((function(e){var t,n;return e.id===(null==f?void 0:f.id)||(null===(t=e.getId)||void 0===t?void 0:t.call(e))===(null==f||null===(n=f.getId)||void 0===n?void 0:n.call(f))})),g=h>=0&&h+1<l.length?l[h+1]:null;if(g)this.set("step",null==g?void 0:g.id);else this.set("step",null===(p=l[h])||void 0===p?void 0:p.id)}var m=null===(e=this.em)||void 0===e?void 0:e.get("Editor");null==m||m.TraitManager.render()},__onStepChange:function(){var e,t=null===(e=this.em)||void 0===e?void 0:e.get("Editor");if(t){var n=t.Pages.get(this.get("step"));if(n){var r=n.getId()||"";this.set("step_url",r)}}},updateStepOptions:function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.get("Editor");if(n){var r=this.getTrait("step");if(r){var o=n.Pages.getAll();if(o&&o.length){var i=(t.current||[]).filter((function(e){var t;return!(null!=e&&null!==(t=e.value)&&void 0!==t&&t.includes("floating-button"))})).map((function(e){return{value:e.value,name:e.label||e.labelName}}));i.length&&(r.set("options",i),n.TraitManager.render())}}}}}:{})}),n.Components.addType("image",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("video",{model:{defaults:{provider:"yt"}}}),n.Components.addType("link",{model:{defaults:{toolbar:fe,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"}],visible:!0}]}}}),n.Components.addType("text",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("divider",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("two-column",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("three-column",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("custom-shopLogo",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("default",{model:{defaults:{traits:[]}}})}},be=function(e){var t=e.editor;return t.getSelected()&&t.getSelected().getStyle()};function we(e,t){var n=new Image;n.crossOrigin="Anonymous",n.onload=function(){return t(!0,n)},n.onerror=function(){return t(!1)},n.src=e}var xe=function(e){var t=[];return null==e||e.Pages.getAll().map((function(n){var r=n.getMainComponent();t.push({id:n.id,name:n.name,styles:e.getCss({component:r}),component:e.getHtml({component:r})})})),t};function Ce(e,t){if("object"===k(e)&&null!==e&&"object"===k(t)&&null!==t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;var n=e.slice().sort(),r=t.slice().sort();return n.every((function(e,t){return Ce(n[t],r[t])}))}var o=Object.keys(e),i=Object.keys(t);return o.length===i.length&&(o.sort(),i.sort(),o.every((function(n,r){return n===i[r]&&Ce(e[n],t[n])})))}return e===t}function Se(e){var t;if(!(null==e?void 0:e.getElementById("gjs-placeholder-overlay"))&&e){var n=null==e?void 0:e.createElement("div");n.id="gjs-placeholder-overlay",n.style.cssText="\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-family: sans-serif;\n font-size: 14px;\n color: #19191A;\n opacity: 0.8;\n pointer-events: none;\n z-index: 10;\n margin : 40px;\n border: 1px dashed #CCCCCC;\n border-radius: 16px;\n background-color: #FAFAFA;\n ",n.innerHTML='\n <div style="text-align:center;">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="width:1.5rem;">\n <path d="M6.23077 8.30769H2.07692C1.52609 8.30769 0.997815 8.08887 0.608317 7.69937C0.218818 7.30988 0 6.7816 0 6.23077V2.07692C0 1.52609 0.218818 0.997815 0.608317 0.608317C0.997815 0.218818 1.52609 0 2.07692 0H6.23077C6.7816 0 7.30988 0.218818 7.69937 0.608317C8.08887 0.997815 8.30769 1.52609 8.30769 2.07692V6.23077C8.30769 6.7816 8.08887 7.30988 7.69937 7.69937C7.30988 8.08887 6.7816 8.30769 6.23077 8.30769ZM2.07692 1.38462C1.89331 1.38462 1.71722 1.45755 1.58739 1.58739C1.45755 1.71722 1.38462 1.89331 1.38462 2.07692V6.23077C1.38462 6.41438 1.45755 6.59047 1.58739 6.7203C1.71722 6.85014 1.89331 6.92308 2.07692 6.92308H6.23077C6.41438 6.92308 6.59047 6.85014 6.7203 6.7203C6.85014 6.59047 6.92308 6.41438 6.92308 6.23077V2.07692C6.92308 1.89331 6.85014 1.71722 6.7203 1.58739C6.59047 1.45755 6.41438 1.38462 6.23077 1.38462H2.07692Z" fill="#505152" />\n <path d="M15.9232 8.30769H11.7693C11.2185 8.30769 10.6902 8.08887 10.3007 7.69937C9.9112 7.30988 9.69238 6.7816 9.69238 6.23077V2.07692C9.69238 1.52609 9.9112 0.997815 10.3007 0.608317C10.6902 0.218818 11.2185 0 11.7693 0H15.9232C16.474 0 17.0023 0.218818 17.3918 0.608317C17.7813 0.997815 18.0001 1.52609 18.0001 2.07692V6.23077C18.0001 6.7816 17.7813 7.30988 17.3918 7.69937C17.0023 8.08887 16.474 8.30769 15.9232 8.30769ZM11.7693 1.38462C11.5857 1.38462 11.4096 1.45755 11.2798 1.58739C11.1499 1.71722 11.077 1.89331 11.077 2.07692V6.23077C11.077 6.41438 11.1499 6.59047 11.2798 6.7203C11.4096 6.85014 11.5857 6.92308 11.7693 6.92308H15.9232C16.1068 6.92308 16.2829 6.85014 16.4127 6.7203C16.5425 6.59047 16.6155 6.41438 16.6155 6.23077V2.07692C16.6155 1.89331 16.5425 1.71722 16.4127 1.58739C16.2829 1.45755 16.1068 1.38462 15.9232 1.38462H11.7693Z" fill="#505152" />\n <path d="M6.23077 18.0001H2.07692C1.52609 18.0001 0.997815 17.7813 0.608317 17.3918C0.218818 17.0023 0 16.474 0 15.9232V11.7693C0 11.2185 0.218818 10.6902 0.608317 10.3007C0.997815 9.9112 1.52609 9.69238 2.07692 9.69238H6.23077C6.7816 9.69238 7.30988 9.9112 7.69937 10.3007C8.08887 10.6902 8.30769 11.2185 8.30769 11.7693V15.9232C8.30769 16.474 8.08887 17.0023 7.69937 17.3918C7.30988 17.7813 6.7816 18.0001 6.23077 18.0001ZM2.07692 11.077C1.89331 11.077 1.71722 11.1499 1.58739 11.2798C1.45755 11.4096 1.38462 11.5857 1.38462 11.7693V15.9232C1.38462 16.1068 1.45755 16.2829 1.58739 16.4127C1.71722 16.5425 1.89331 16.6155 2.07692 16.6155H6.23077C6.41438 16.6155 6.59047 16.5425 6.7203 16.4127C6.85014 16.2829 6.92308 16.1068 6.92308 15.9232V11.7693C6.92308 11.5857 6.85014 11.4096 6.7203 11.2798C6.59047 11.1499 6.41438 11.077 6.23077 11.077H2.07692Z" fill="#505152" />\n <path d="M13.8462 18.0001C13.0247 18.0001 12.2216 17.7565 11.5385 17.3C10.8554 16.8436 10.323 16.1949 10.0086 15.4358C9.69418 14.6768 9.61192 13.8416 9.7722 13.0359C9.93248 12.2301 10.3281 11.4899 10.909 10.909C11.4899 10.3281 12.2301 9.93248 13.0359 9.7722C13.8416 9.61192 14.6768 9.69418 15.4358 10.0086C16.1949 10.323 16.8436 10.8554 17.3 11.5385C17.7565 12.2216 18.0001 13.0247 18.0001 13.8462C17.999 14.9476 17.561 16.0035 16.7822 16.7822C16.0035 17.561 14.9476 17.999 13.8462 18.0001ZM13.8462 11.077C13.2985 11.077 12.7631 11.2394 12.3077 11.5437C11.8523 11.848 11.4974 12.2805 11.2878 12.7865C11.0782 13.2925 11.0234 13.8493 11.1302 14.3865C11.2371 14.9237 11.5008 15.4171 11.8881 15.8044C12.2754 16.1917 12.7688 16.4554 13.306 16.5623C13.8432 16.6691 14.4 16.6143 14.906 16.4047C15.412 16.1951 15.8445 15.8401 16.1488 15.3847C16.453 14.9293 16.6155 14.3939 16.6155 13.8462C16.6155 13.1118 16.3237 12.4074 15.8044 11.8881C15.285 11.3688 14.5807 11.077 13.8462 11.077Z" fill="#505152" />\n </svg>\n <div style="color:black;">Drop content blocks from the sidebar here</div>\n </div>\n ',null==e||null===(t=e.body)||void 0===t||t.appendChild(n)}}var _e=function(e){var t=null==e?void 0:e.getSelected(),n=null==e?void 0:e.CssComposer,r=null==t?void 0:t.getClasses(),o={};return null==r||r.forEach((function(e){var t=null==n?void 0:n.getRule(".".concat(e));t&&Object.assign(o,t.getStyle())})),_(_({},o),null==t?void 0:t.getStyle())},Ee=function(e,t,n,r){var o;if(e&&t&&null!=r&&null!==(o=r.attributes)&&void 0!==o&&o.changeProp){var i=null==n?void 0:n.CssComposer,a=t.get(e);if(a&&(a=a.toString().replace(/\s*!important\s*$/i,"").trim()))return a;try{var s=null==t?void 0:t.getClasses(),l={};null==s||s.forEach((function(e){var t=null==i?void 0:i.getRule(".".concat(e));t&&Object.assign(l,t.getStyle())}));var c={},u="function"==typeof t.getId?t.getId():t.get("id");if(u&&i){var d="function"==typeof i.getIdRule?i.getIdRule(u):i.getRule("#".concat(u));d&&(c=d.getStyle()||{})}var p=_(_(_({},c),l),null==t?void 0:t.getStyle()),f=p[e];if(!f&&"border-color"===e&&p.border){var h=p.border.match(/(?:rgba?\([^)]+\)|#[0-9A-Fa-f]{3,8})/);h&&(f=h[0])}if(f)return f=f.toString().replace(/\s*!important\s*$/i,"").trim()}catch(e){}return""}return r.getValue()||""},Oe=function(e,t,n,r,o,i,a,s,l,c){var u=H.init(_({container:"#editor",blockManager:{appendTo:"#blocks"},selectorManager:ne,panels:re,canvas:{styles:ie,scripts:oe},plugins:[ye(r,c),Y],pluginsOpts:M({gjsBlockBasic:{}},Y,{config:{includeUI:{menu:["crop","flip","rotate","draw","shape","icon","text","mask","filter"]}},toolbarIcon:"",addToAssets:!0,onApply:function(e,t){var r=e.toDataURL();m(r,t,n)}}),styleManager:te,traitManager:{custom:!0}},e));null!=t&&t.customRemoteConfig&&u.Storage.add("remote",t.customRemoteConfig);var d=function(e,t){try{var n,r;if(e._duplicationInProgress)return;var o=null==e||null===(n=e.getWrapper)||void 0===n?void 0:n.call(e),i=null==o||null===(r=o.getStyle)||void 0===r?void 0:r.call(o);if(!i||0===Object.keys(i).length){var a,s=(null==t?void 0:t.global_background_color)||"";null==o||null===(a=o.setStyle)||void 0===a||a.call(o,{padding:"0px",background:s})}}catch(e){}};u.on("load",(function(){var t,n,r,c,p,f,h,g,m,v,y,b,w,x,C,S,_,E,O,k,T,P,M,A;Se(),o({shape:(null==e||null===(t=e.componentOptions)||void 0===t||null===(t=t.desktop_teaser_default)||void 0===t?void 0:t.shape)||"Rectangle",style:"Rounded"===(null==e||null===(n=e.componentOptions)||void 0===n||null===(n=n.desktop_teaser_default)||void 0===n?void 0:n.shape)?"circle":(null==e||null===(r=e.componentOptions)||void 0===r||null===(r=r.desktop_teaser_default)||void 0===r?void 0:r.shape)||"Rectangle",layout:(null==e||null===(c=e.componentOptions)||void 0===c||null===(c=c.desktop_teaser_default)||void 0===c?void 0:c.size)||"medium",layoutPosition:(null==e||null===(p=e.componentOptions)||void 0===p||null===(p=p.desktop_teaser_default)||void 0===p?void 0:p.position)||"bottom-left",showCloseButton:null!==(f=null==e||null===(h=e.componentOptions)||void 0===h||null===(h=h.desktop_teaser_default)||void 0===h?void 0:h.closeButton)&&void 0!==f&&f,text:(null==e||null===(g=e.componentOptions)||void 0===g||null===(g=g.desktop_teaser_default)||void 0===g?void 0:g.label)||"Get 10% OFF",textColor:(null==e||null===(m=e.componentOptions)||void 0===m||null===(m=m.desktop_teaser_default)||void 0===m?void 0:m.labelColor)||"#000000",backgroundColor:(null==e||null===(v=e.componentOptions)||void 0===v||null===(v=v.desktop_teaser_default)||void 0===v?void 0:v.backgroundColor)||"#f59e0b"}),i({text:(null==e||null===(y=e.componentOptions)||void 0===y||null===(y=y.mobile_teaser_default)||void 0===y?void 0:y.label)||"Subscribe",shape:(null==e||null===(b=e.componentOptions)||void 0===b||null===(b=b.desktop_teaser_default)||void 0===b?void 0:b.shape)||"rectangle",style:"Rounded"===(null==e||null===(w=e.componentOptions)||void 0===w||null===(w=w.desktop_teaser_default)||void 0===w?void 0:w.shape)?"circle":(null==e||null===(x=e.componentOptions)||void 0===x||null===(x=x.desktop_teaser_default)||void 0===x?void 0:x.shape)||"rectangle",layout:(null==e||null===(C=e.componentOptions)||void 0===C||null===(C=C.desktop_teaser_default)||void 0===C?void 0:C.size)||"medium",layoutPosition:(null==e||null===(S=e.componentOptions)||void 0===S||null===(S=S.desktop_teaser_default)||void 0===S?void 0:S.position)||"bottom-left",showCloseButton:null!==(_=null==e||null===(E=e.componentOptions)||void 0===E||null===(E=E.desktop_teaser_default)||void 0===E?void 0:E.closeButton)&&void 0!==_&&_,textColor:(null==e||null===(O=e.componentOptions)||void 0===O||null===(O=O.desktop_teaser_default)||void 0===O?void 0:O.labelColor)||"#000000",backgroundColor:(null==e||null===(k=e.componentOptions)||void 0===k||null===(k=k.desktop_teaser_default)||void 0===k?void 0:k.backgroundColor)||"#f59e0b"}),a(null!==(T=null==e||null===(P=e.componentOptions)||void 0===P||null===(P=P.desktop_teaser_default)||void 0===P?void 0:P.enable)&&void 0!==T&&T),s(null===(M=null==e||null===(A=e.componentOptions)||void 0===A||null===(A=A.mobile_teaser_default)||void 0===A?void 0:A.showOnMobile)||void 0===M||M),d(u,l)})),u.on("device:select",(function(){var e=u.getSelected();e&&(u.select(null),requestAnimationFrame((function(){u.select(e)})))})),u.on("component:add",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),u.on("component:remove",(function(){setTimeout((function(){var e=u.getWrapper(),t=u.Canvas.getDocument(),n=u.getSelected();0===e.components().length&&!n&&t&&Se(t)}),0)})),u.on("canvas:frame:load",(function(){!function(e){var t,n=e.getWrapper(),r=null===(t=e.Canvas)||void 0===t?void 0:t.getDocument();if(r){var o=null==r?void 0:r.getElementById("gjs-placeholder-overlay");o&&o.remove(),n.components().length||Se(r)}}(u)})),u.on("component:selected",(function(e){var t;if("wrapper"!==(null==e||null===(t=e.get)||void 0===t?void 0:t.call(e,"type"))||"fullpage-builder"===r){var n=u.Canvas.getDocument(),o=null==n?void 0:n.getElementById("gjs-placeholder-overlay");o&&o.remove()}else u.select(null)})),u.on("component:deselected",(function(){var e=u.getWrapper(),t=u.Canvas.getDocument();!u.getSelected()&&t&&0===e.components().length&&Se(t)})),u.on("block:drag:start",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),u.on("block:drag:stop",(function(){setTimeout((function(){var e=u.getWrapper(),t=u.Canvas.getDocument(),n=u.getSelected();0===e.components().length&&!n&&t&&Se(t)}),0)})),u.on("component:drag:start",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),null==u||u.Commands.add("image-editor",{run:function(e,t){var n,r,o=null==e?void 0:e.getSelected();o&&"image"===(null===(n=o.attributes)||void 0===n?void 0:n.type)&&(o.attributes=_(_({},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()}),e.runCommand("tui-image-editor"))}}),null==u||u.Commands.add("go-to-previous-panel",{run:function(e,t){if(null==e?void 0:e.getSelected()){e.select(null);var n=e.getWrapper(),r=e.Canvas.getDocument();r&&0===n.components().length&&Se(r)}}}),null==u||u.Commands.add("tlb-select-parent",{run:function(e,t){var n=e.getSelected&&e.getSelected();if(n){var r=n.parent&&n.parent();r&&e.select(r)}}});var p=function e(t){var n=t.getAttributes(),r={};n["data-eleid"]&&(r["data-eleid"]="el-"+ee()),n.id&&(r.id="el-"+ee()),Object.keys(r).length>0&&t.addAttributes(r),t.components().each((function(t){return e(t)}))};u._regenerateEleids=p;var f=function(e){var t=e.getSelected();if(t&&"wrapper"!==t.get("type")){e._componentClipboard=t.clone();var n=document.getElementById("editor");n&&n.setAttribute("data-has-clipboard","true")}},h=function(e){if(e._componentClipboard){var t=e._componentClipboard.clone();if("wrapper"!==t.get("type")){p(t);var n=e.getSelected();if(n){if("wrapper"===n.get("type"))return void n.append(t);var r=n.parent();if(!r)return;var o=r.components(),i=o.indexOf(n);o.add(t,{at:i+1})}else e.getWrapper().append(t)}}};u.Commands.add("tlb-clone",{run:function(e){var t=e.getSelected();if(t&&"wrapper"!==t.get("type")){var n=t.clone();p(n);var r=t.parent();if(r){var o=r.components(),i=o.indexOf(t);o.add(n,{at:i+1})}}}}),u.Commands.add("tlb-copy",{run:function(e){f(e)}}),u.Commands.add("tlb-paste",{run:function(e){h(e)}}),u.Commands.add("core:copy",{run:function(e){f(e)}}),u.Commands.add("core:paste",{run:function(e){h(e)}});var g=function(e,t){if(null!=u&&u.getSelected().is("image")&&(u.getSelected().set({src:e,width:"30%"}),u.Modal.close(),u.getSelected())){u.select(null);var n=u.getWrapper(),r=u.Canvas.getDocument();r&&0===n.components().length&&Se(r)}t()},m=function(e,t,n){var r=function(e){for(var t=e.match(/data:([^;]+);base64/)[1].split("/")[1],n=atob(e.split(",")[1]),r=e.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],t,{type:r,lastModified:Date.now()})}(e);n&&n(r,g)};return u.on("page:select",(function(e,t){d(u,l)})),u};var ke={black:"#000",white:"#fff"};var Te={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 Pe={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 Me={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 Ae={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 De={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 Ne={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 Re={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 je(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Ie=Object.freeze({__proto__:null,default:je}),Le="$$material";function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(this,arguments)}function Ve(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function Be(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var ze=/^((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|disableRemotePlayback|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)-.*))$/,He=Be((function(e){return ze.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var $e=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if("production"!==process.env.NODE_ENV){var n=64===e.charCodeAt(0)&&105===e.charCodeAt(1);n&&this._alreadyInsertedOrderInsensitiveRule&&console.error("You're attempting to insert the following rule:\n"+e+"\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(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(t){"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(e)||console.error('There was a problem inserting the following rule: "'+e+'"',t)}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0,"production"!==process.env.NODE_ENV&&(this._alreadyInsertedOrderInsensitiveRule=!1)},e}(),We="-ms-",Ue="-moz-",qe="-webkit-",Ge="comm",Ye="rule",Ke="decl",Ze="@keyframes",Xe=Math.abs,Je=String.fromCharCode,Qe=Object.assign;function et(e){return e.trim()}function tt(e,t,n){return e.replace(t,n)}function nt(e,t,n){return e.indexOf(t,n)}function rt(e,t){return 0|e.charCodeAt(t)}function ot(e,t,n){return e.slice(t,n)}function it(e){return e.length}function at(e){return e.length}function st(e,t){return t.push(e),e}var lt=1,ct=1,ut=0,dt=0,pt=0,ft="";function ht(e,t,n,r,o,i,a,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:lt,column:ct,length:a,return:"",siblings:s}}function gt(e,t){return Qe(ht("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function mt(){return pt=dt<ut?rt(ft,dt++):0,ct++,10===pt&&(ct=1,lt++),pt}function vt(){return rt(ft,dt)}function yt(){return dt}function bt(e,t){return ot(ft,e,t)}function wt(e){switch(e){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 xt(e){return lt=ct=1,ut=it(ft=e),dt=0,[]}function Ct(e){return ft="",e}function St(e){return et(bt(dt-1,Ot(91===e?e+2:40===e?e+1:e)))}function _t(e){for(;(pt=vt())&&pt<33;)mt();return wt(e)>2||wt(pt)>3?"":" "}function Et(e,t){for(;--t&&mt()&&!(pt<48||pt>102||pt>57&&pt<65||pt>70&&pt<97););return bt(e,yt()+(t<6&&32==vt()&&32==mt()))}function Ot(e){for(;mt();)switch(pt){case e:return dt;case 34:case 39:34!==e&&39!==e&&Ot(pt);break;case 40:41===e&&Ot(e);break;case 92:mt()}return dt}function kt(e,t){for(;mt()&&e+pt!==57&&(e+pt!==84||47!==vt()););return"/*"+bt(t,dt-1)+"*"+Je(47===e?e:mt())}function Tt(e){for(;!wt(vt());)mt();return bt(e,dt)}function Pt(e){return Ct(Mt("",null,null,null,[""],e=xt(e),0,[0],e))}function Mt(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,p=0,f=0,h=0,g=1,m=1,v=1,y=0,b="",w=o,x=i,C=r,S=b;m;)switch(h=y,y=mt()){case 40:if(108!=h&&58==rt(S,d-1)){-1!=nt(S+=tt(St(y),"&","&\f"),"&\f",Xe(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:S+=St(y);break;case 9:case 10:case 13:case 32:S+=_t(h);break;case 92:S+=Et(yt()-1,7);continue;case 47:switch(vt()){case 42:case 47:st(Dt(kt(mt(),yt()),t,n,l),l);break;default:S+="/"}break;case 123*g:s[c++]=it(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(S=tt(S,/\f/g,"")),f>0&&it(S)-d&&st(f>32?Nt(S+";",r,n,d-1,l):Nt(tt(S," ","")+";",r,n,d-2,l),l);break;case 59:S+=";";default:if(st(C=At(S,t,n,c,u,o,s,b,w=[],x=[],d,i),i),123===y)if(0===u)Mt(S,t,C,C,w,i,d,s,x);else switch(99===p&&110===rt(S,3)?100:p){case 100:case 108:case 109:case 115:Mt(e,C,C,r&&st(At(e,C,C,0,0,o,s,b,o,w=[],d,x),x),o,x,d,s,r?w:x);break;default:Mt(S,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=S="",d=a;break;case 58:d=1+it(S),f=h;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==(pt=dt>0?rt(ft,--dt):0,ct--,10===pt&&(ct=1,lt--),pt))continue;switch(S+=Je(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(it(S)-1)*v,v=1;break;case 64:45===vt()&&(S+=St(mt())),p=vt(),u=d=it(b=S+=Tt(yt())),y++;break;case 45:45===h&&2==it(S)&&(g=0)}}return i}function At(e,t,n,r,o,i,a,s,l,c,u,d){for(var p=o-1,f=0===o?i:[""],h=at(f),g=0,m=0,v=0;g<r;++g)for(var y=0,b=ot(e,p+1,p=Xe(m=a[g])),w=e;y<h;++y)(w=et(m>0?f[y]+" "+b:tt(b,/&\f/g,f[y])))&&(l[v++]=w);return ht(e,t,n,0===o?Ye:s,l,c,u,d)}function Dt(e,t,n,r){return ht(e,t,n,Ge,Je(pt),ot(e,2,-2),0,r)}function Nt(e,t,n,r,o){return ht(e,t,n,Ke,ot(e,0,r),ot(e,r+1,-1),r,o)}function Rt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function jt(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ke:return e.return=e.return||e.value;case Ge:return"";case Ze:return e.return=e.value+"{"+Rt(e.children,r)+"}";case Ye:if(!it(e.value=e.props.join(",")))return""}return it(n=Rt(e.children,r))?e.return=e.value+"{"+n+"}":""}function It(e){var t=at(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}var Lt=function(e,t,n){for(var r=0,o=0;r=o,o=vt(),38===r&&12===o&&(t[n]=1),!wt(o);)mt();return bt(e,dt)},Ft=function(e,t){return Ct(function(e,t){var n=-1,r=44;do{switch(wt(r)){case 0:38===r&&12===vt()&&(t[n]=1),e[n]+=Lt(dt-1,t,n);break;case 2:e[n]+=St(r);break;case 4:if(44===r){e[++n]=58===vt()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Je(r)}}while(r=mt());return e}(xt(e),t))},Vt=new WeakMap,Bt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Vt.get(n))&&!r){Vt.set(e,!0);for(var o=[],i=Ft(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},zt=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},Ht=function(e){return"comm"===e.type&&e.children.indexOf("emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason")>-1},$t=function(e){return 105===e.type.charCodeAt(1)&&64===e.type.charCodeAt(0)},Wt=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},Ut=function(e,t,n){$t(e)&&(e.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."),Wt(e)):function(e,t){for(var n=e-1;n>=0;n--)if(!$t(t[n]))return!0;return!1}(t,n)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Wt(e)))};function qt(e,t){switch(function(e,t){return 45^rt(e,0)?(((t<<2^rt(e,0))<<2^rt(e,1))<<2^rt(e,2))<<2^rt(e,3):0}(e,t)){case 5103:return qe+"print-"+e+e;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 qe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return qe+e+Ue+e+We+e+e;case 6828:case 4268:return qe+e+We+e+e;case 6165:return qe+e+We+"flex-"+e+e;case 5187:return qe+e+tt(e,/(\w+).+(:[^]+)/,qe+"box-$1$2"+We+"flex-$1$2")+e;case 5443:return qe+e+We+"flex-item-"+tt(e,/flex-|-self/,"")+e;case 4675:return qe+e+We+"flex-line-pack"+tt(e,/align-content|flex-|-self/,"")+e;case 5548:return qe+e+We+tt(e,"shrink","negative")+e;case 5292:return qe+e+We+tt(e,"basis","preferred-size")+e;case 6060:return qe+"box-"+tt(e,"-grow","")+qe+e+We+tt(e,"grow","positive")+e;case 4554:return qe+tt(e,/([^-])(transform)/g,"$1"+qe+"$2")+e;case 6187:return tt(tt(tt(e,/(zoom-|grab)/,qe+"$1"),/(image-set)/,qe+"$1"),e,"")+e;case 5495:case 3959:return tt(e,/(image-set\([^]*)/,qe+"$1$`$1");case 4968:return tt(tt(e,/(.+:)(flex-)?(.*)/,qe+"box-pack:$3"+We+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qe+e+e;case 4095:case 3583:case 4068:case 2532:return tt(e,/(.+)-inline(.+)/,qe+"$1$2")+e;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(it(e)-1-t>6)switch(rt(e,t+1)){case 109:if(45!==rt(e,t+4))break;case 102:return tt(e,/(.+:)(.+)-([^]+)/,"$1"+qe+"$2-$3$1"+Ue+(108==rt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~nt(e,"stretch")?qt(tt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==rt(e,t+1))break;case 6444:switch(rt(e,it(e)-3-(~nt(e,"!important")&&10))){case 107:return tt(e,":",":"+qe)+e;case 101:return tt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+qe+(45===rt(e,14)?"inline-":"")+"box$3$1"+qe+"$2$3$1"+We+"$2box$3")+e}break;case 5936:switch(rt(e,t+11)){case 114:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return qe+e+We+e+e}return e}var Gt,Yt="undefined"!=typeof document,Kt=Yt?void 0:function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}}((function(){return Be((function(){var e={};return function(t){return e[t]}}))})),Zt=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ke:e.return=qt(e.value,e.length);break;case Ze:return Rt([gt(e,{value:tt(e.value,"@","@"+qe)})],r);case Ye:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rt([gt(e,{props:[tt(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Rt([gt(e,{props:[tt(t,/:(plac\w+)/,":"+qe+"input-$1")]}),gt(e,{props:[tt(t,/:(plac\w+)/,":-moz-$1")]}),gt(e,{props:[tt(t,/:(plac\w+)/,We+"input-$1")]})],r)}return""}))}}],Xt=function(e){var t=e.key;if("production"!==process.env.NODE_ENV&&!t)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(Yt&&"css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||Zt;if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(t))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+t+'" was passed');var o,i,a={},s=[];Yt&&(o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)})));var l,c=[Bt,zt];if("production"!==process.env.NODE_ENV&&c.push(function(e){return function(t,n,r){if("rule"===t.type&&!e.compat){var o=t.value.match(/(:first|:nth|:nth-last)-child/g);if(o){for(var i=t.parent?t.parent.children:r,a=i.length-1;a>=0;a--){var s=i[a];if(s.line<t.line)break;if(s.column<t.column){if(Ht(s))return;break}}o.forEach((function(e){console.error('The pseudo class "'+e+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+e.split("-child")[0]+'-of-type".')}))}}}}({get compat(){return v.compat}}),Ut),Yt){var u,d=[jt,"production"!==process.env.NODE_ENV?function(e){e.root||(e.return?u.insert(e.return):e.value&&e.type!==Ge&&u.insert(e.value+"{}"))}:(l=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&l(e)})],p=It(c.concat(r,d));i=function(e,t,n,r){u=n,"production"!==process.env.NODE_ENV&&void 0!==t.map&&(u={insert:function(e){n.insert(e+t.map)}}),function(e){Rt(Pt(e),p)}(e?e+"{"+t.styles+"}":t.styles),r&&(v.inserted[t.name]=!0)}}else{var f=[jt],h=It(c.concat(r,f)),g=Kt(r)(t),m=function(e,t){var n=t.name;return void 0===g[n]&&(g[n]=function(e){return Rt(Pt(e),h)}(e?e+"{"+t.styles+"}":t.styles)),g[n]};i=function(e,t,n,r){var o=t.name,i=m(e,t);return void 0===v.compat?(r&&(v.inserted[o]=!0),"development"===process.env.NODE_ENV&&void 0!==t.map?i+t.map:i):r?void(v.inserted[o]=i):i}}var v={key:t,sheet:new $e({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:i};return v.sheet.hydrate(s),v},Jt={exports:{}},Qt={};var en,tn={};
|
|
11
|
+
/*! grapesjs-tui-image-editor - 1.0.2 */"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,q=()=>(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};const o=function(e,t){void 0===t&&(t={});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"]},t),i=o.script,a=o.style,s=o.height,l=o.width,c=o.hideHeader,u=o.onApply,d=o.upload,p=o.addToAssets,f=o.commandId,h="undefined"!=typeof window,g=function(){var e;return o.constructor||h&&(null===(e=window.tui)||void 0===e?void 0:e.ImageEditor)},m=g();if(!m&&(null==i?void 0:i.length)&&h){var v=document.head,y=Array.isArray(i)?r([],i,!0):[i],b=Array.isArray(a)?r([],a,!0):[a],w=function(e){if(e.length){var t=document.createElement("link");t.href=e.shift(),t.rel="stylesheet",v.appendChild(t),w(e)}},x=function(e){if(e.length){var t=document.createElement("script");t.src=e.shift(),t.onerror=t.onload=x.bind(null,e),v.appendChild(t)}else m=g()};w(b),x(y)}o.toolbarIcon&&e.Components.addType("image",{extendFn:["initToolbar"],model:{initToolbar:function(){var e=this.get("toolbar");(null==e?void 0:e.some((function(e){return e.command===f})))||(null==e||e.unshift({command:f,label:o.toolbarIcon}),this.set("toolbar",e))}}});var C={level:"error",ns:f};e.Commands.add(f,{imageEditor:null,run:function(e,t,n){var r=this;if(void 0===n&&(n={}),!m)return e.log("TOAST UI Image editor not found",C),e.stopCommand(f);var i=n.target||e.getSelected();if(!i)return e.log("Target not available",C),e.stopCommand(f);var a=this.createContent(),s=o.labelImageEditor,l=a.children[1];e.Modal.open({title:s,content:a}).onceClose((function(){return e.stopCommand(f)}));var c=this.getEditorConfig(i.get("src"));this.imageEditor=new m(a.children[0],c),e.getModel().setEditing(!0),l.onclick=function(){return r.applyChanges(i)},o.onApplyButton(l)},stop:function(e){var t;null===(t=this.imageEditor)||void 0===t||t.destroy(),e.getModel().setEditing(!1)},getEditorConfig:function(e){var t=n({},o.config);return t.includeUI||(t.includeUI={}),t.includeUI=n(n({theme:{}},t.includeUI),{loadImage:{path:e,name:"1"},uiSize:{height:s,width:l}}),c&&(t.includeUI.theme["header.display"]="none"),t},createContent:function(){var e=document.createElement("div");return e.style.position="relative",e.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 "),e},applyChanges:function(e){var t=this,n=this.imageEditor;u?u(n,e):"CROPPER"===n.getDrawingMode()?n.crop(n.getCropzoneRect()).then((function(){t.uploadImage(n,e)})):this.uploadImage(n,e)},uploadImage:function(t,n){var r=this,o=e.Assets,i=t.toDataURL();if(d){var a=this.dataUrlToBlob(i);o.FileUploader().uploadFile({dataTransfer:{files:[a]}},(function(e){var t=e&&e.data&&e.data[0],o=t&&("string"==typeof t?t:t.src);o&&r.applyToTarget(o,n)}))}else p&&o.add({src:i,name:(n.get("src")||"").split("/").pop()}),this.applyToTarget(i,n)},applyToTarget:function(t,n){n.set("src",t),e.Modal.close()},dataUrlToBlob:function(e){for(var t=e.split(","),n=window.atob(t[1]),r=t[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 t})();var Y=W(G.exports=q());let K;const Z=new Uint8Array(16);function X(){if(!K&&(K="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!K))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K(Z)}const J=[];for(let e=0;e<256;++e)J.push((e+256).toString(16).slice(1));var Q={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ee(e,t,n){if(Q.randomUUID&&!t&&!e)return Q.randomUUID();const r=(e=e||{}).random||(e.rng||X)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]}(r)}var te={appendTo:"#styles-container",custom:!0,sectors:[]},ne={appendTo:"#styles-container",componentFirst:!0},re={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}]}]},oe=["https://code.jquery.com/jquery-3.5.1.slim.min.js"],ie=["https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Alegreya:ital,wght@0,400..900;1,400..900&family=Anton&family=Assistant&family=Bebas+Neue&family=Cinzel:wght@400..900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Fauna+One&family=IBM+Plex+Sans&family=Inter&family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Manrope:wght@200..800&family=Merriweather&family=Merienda&family=Open+Sans&family=Oswald:wght@200..700&family=Pacifico&family=Patrick+Hand&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:ital,wght@0,200..900;1,200..900&family=Proza+Libre:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&family=PT+Sans+Narrow:wght@400;700&family=Quicksand:wght@300..700&family=Raleway:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Satisfy&family=Source+Sans+Pro:ital,wght@0,200..900;1,200..900&family=Work+Sans:ital,wght@0,100..900;1,100..900&family=Black+Han+Sans&display=swap","https://fonts.cdnfonts.com/css/source-sans-pro"],ae="form-builder",se="landing-page-builder",le="popup-builder",ce="fullpage-builder",ue={Top:"removeTopPadding",Bottom:"removeBottomPadding",Vertical:"removeVerticalPadding"},de="50%",pe={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"},fe=[{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="copy"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M352 528L128 528C119.2 528 112 520.8 112 512L112 288C112 279.2 119.2 272 128 272L176 272L176 224L128 224C92.7 224 64 252.7 64 288L64 512C64 547.3 92.7 576 128 576L352 576C387.3 576 416 547.3 416 512L416 464L368 464L368 512C368 520.8 360.8 528 352 528zM288 368C279.2 368 272 360.8 272 352L272 128C272 119.2 279.2 112 288 112L512 112C520.8 112 528 119.2 528 128L528 352C528 360.8 520.8 368 512 368L288 368zM224 352C224 387.3 252.7 416 288 416L512 416C547.3 416 576 387.3 576 352L576 128C576 92.7 547.3 64 512 64L288 64C252.7 64 224 92.7 224 128L224 352z"/></svg></div>',command:"tlb-copy"},{label:'\n <div title="paste" class="tlb-paste-btn">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 24 24"\n style="fill:none !important;stroke:currentColor !important;"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n aria-hidden="true"\n >\n <rect\n width="8"\n height="4"\n x="8"\n y="2"\n rx="1"\n ry="1"\n style="fill:none !important;"\n ></rect>\n\n <path\n d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"\n style="fill:none !important;"\n ></path>\n </svg>\n </div>',command:"tlb-paste"},{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"},{label:'<div title="select parent"><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"></path></svg></div>',command:"tlb-select-parent"}],he=[{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="copy"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M352 528L128 528C119.2 528 112 520.8 112 512L112 288C112 279.2 119.2 272 128 272L176 272L176 224L128 224C92.7 224 64 252.7 64 288L64 512C64 547.3 92.7 576 128 576L352 576C387.3 576 416 547.3 416 512L416 464L368 464L368 512C368 520.8 360.8 528 352 528zM288 368C279.2 368 272 360.8 272 352L272 128C272 119.2 279.2 112 288 112L512 112C520.8 112 528 119.2 528 128L528 352C528 360.8 520.8 368 512 368L288 368zM224 352C224 387.3 252.7 416 288 416L512 416C547.3 416 576 387.3 576 352L576 128C576 92.7 547.3 64 512 64L288 64C252.7 64 224 92.7 224 128L224 352z"/></svg></div>',command:"tlb-copy"},{label:'<div title="paste" class="tlb-paste-btn">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 24 24"\n style="fill:none !important;stroke:currentColor !important;"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n aria-hidden="true"\n >\n <rect\n width="8"\n height="4"\n x="8"\n y="2"\n rx="1"\n ry="1"\n style="fill:none !important;"\n ></rect>\n\n <path\n d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"\n style="fill:none !important;"\n ></path>\n </svg>\n </div>',command:"tlb-paste"},{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"},{label:'<div title="select parent"><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"></path></svg></div>',command:"tlb-select-parent"}],ge=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],me=[0,15,30,45],ve='<svg\nwidth="85"\nheight="85"\nviewBox="0 0 20 20"\nfill="none"\nxmlns="http://www.w3.org/2000/svg"\ndata-gjs-selectable=false data-gjs-editable=false\n>\n<path\n d="M5 9V13.6837C5 14.4121 5.55927 15 6.25228 15H13.7477C14.4407 15 15 14.4121 15 13.6837V9.10224"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M7.97255 7.66667C7.97255 8.40496 7.0677 9 5.95303 9C5.55961 9 5.19898 8.92837 4.89081 8.80165C4.21545 8.52617 3.88104 7.87052 4.03841 7.25344L4.41871 5.7438C4.52362 5.31405 5.08751 5 5.74976 5H14.2475C14.9032 5 15.4671 5.31405 15.5786 5.7438L15.9589 7.23691C15.9589 7.24242 15.9654 7.24793 15.9589 7.24793C16.1228 7.86501 15.7884 8.52066 15.1065 8.79614C14.7983 8.92287 14.4311 8.99449 14.0442 8.99449C12.923 8.99449 12.0247 8.39945 12.0247 7.66116"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M12 8C12 8.55372 11.1039 9 10 9C8.88961 9 8 8.55372 8 8"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M8 8V5"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n<path\n d="M12 8V5"\n stroke="#19191A"\n stroke-width="1.4"\n stroke-linecap="round"\n stroke-linejoin="round"\n/>\n</svg>',ye=function(e,t){return function(n){var r;n.Components.addType("body",{model:{defaults:{traits:[]}}}),n.Components.addType("custom-button",{model:_({defaults:_({"script-export":function(e){try{var t=this;if(t.style.cursor="pointer","fullpage-builder"===(null==e?void 0:e.page_type))t.onclick=function(n){if(n.preventDefault(),"close"===e.redirect_to&&window.everbeeLoadStep&&window.everbeeLoadStep(e.redirect_to,""),"url"!==e.redirect_to){if("step"===e.redirect_to){var r=t.getAttribute("data-target-page")||e.step_url;r&&window.everbeeLoadStep&&window.everbeeLoadStep("step",r)}}else e.page_url&&(window.location.href=e.page_url)};else{var n=function(e){var t,n;e.preventDefault();var r=(null===(t=e.target)||void 0===t||null===(t=t.attributes)||void 0===t||null===(t=t.href)||void 0===t?void 0:t.value)||"",o=null===(n=e.target)||void 0===n||null===(n=n.attributes)||void 0===n?void 0:n.blankPage;r&&(o?window.open(r,"_blank"):window.location.href=r)};t.removeEventListener("click",n),t.addEventListener("click",n)}}catch(e){console.warn("Failed to execute subscribe- button script",e)}},text:"Custom Button",toolbar:fe,traits:j(e===ce?[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button",removePadding:ue.Vertical},{type:"select",name:"redirect_to",label:"Action",changeProp:!0,options:[{value:"url",name:"Redirect to URL"},{value:"close",name:"Close Pop up"},{value:"step",name:"Go to step"}],tabType:"button",removePadding:ue.Vertical,visible:!0},{type:"select",name:"step",label:"Next Step",labelAsOption:"Choose a step",changeProp:!0,options:[],tabType:"button",visible:!1,removePadding:ue.Top},{type:"text",label:"Enter page url",name:"page_url",changeProp:!0,tabType:"button",removePadding:ue.Top}]:[{type:"text",name:"text",label:"Text",changeProp:!0,tabType:"button",removePadding:ue.Top},{type:"text",name:"href",label:"Link",placeholder:"Enter URL",tabType:"button",removePadding:ue.Bottom},{type:"checkbox-item",name:"blankPage",label:"Open link on a new tab",tabType:"button"}])},e===ce?{redirect_to:"",step:"",page_type:"fullpage-builder",step_url:"",success_page_url:null===(r=n.getConfig().componentOptions)||void 0===r?void 0:r.success_page_url,"script-props":["page_url","step_url","redirect_to","page_type"]}:{page_type:e,"script-props":["page_type"]}),init:function(){var t=this;if(e===ce){var r,o=null==this||null===(r=this.getAttributes())||void 0===r?void 0:r.href,i=this.getAttributes();if(this.get("redirect_to")||("close"===i.redirect_to?this.set("redirect_to","close"):this.set("redirect_to","step")),(this.get("page_url")&&!this.get("redirect_to")||o)&&(o&&this.set("page_url",o),this.set("redirect_to","url")),this.updateStepOptions(),this.__onRedirectToChange(),!n)return;n.on("load",(function(){var e;t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),null!==(e=t.getAttributes())&&void 0!==e&&e["data-target-page"]&&t.set("step",""),t.__onRedirectToChange(),t.get("step")&&t.__onStepChange()})),n.on("page:remove",(function(e){t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),t.__onRedirectToChange()})),n.on("storage:end:load",(function(){var e;t.updateStepOptions(),(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),null!==(e=t.getAttributes())&&void 0!==e&&e["data-target-page"]&&t.set("step",""),t.__onRedirectToChange(),t.get("step")&&t.__onStepChange()})),n.on("page:add",(function(){(t.get("page_url")&&!t.get("redirect_to")||o)&&(o&&t.set("page_url",o),t.set("redirect_to","url")),t.get("redirect_to")||("close"===i.redirect_to?t.set("redirect_to","close"):t.set("redirect_to","step")),t.__onRedirectToChange(),t.updateStepOptions()}))}var a=this.components(),s=1===a.length&&a.models[0],l=s&&s.is("textnode")&&s.get("content")||"",c=l||this.get("text");this.set("text",c.trim()),this.on("change:text",this.__onTextChange),c!==l&&this.__onTextChange(),this.on("change:redirect_to",this.__onRedirectToChange),this.on("change:step",this.__onStepChange),e===ce&&(this.get("step")&&this.__onStepChange(),this.__onRedirectToChange())},__onTextChange:function(){this.components(this.get("text"))}},e===ce?{__onRedirectToChange:function(){var e,t=this.get("redirect_to"),n=this.getTrait("page_url"),r=this.getTrait("step");if(n.set({disabled:!0,visible:!1}),r.set({visible:!1}),"url"===t&&(n.set({disabled:!1,visible:!0}),this.set("step",""),this.set("step_url","")),"close"===t&&(n.set({disabled:!0,visible:!1}),this.set("page_url",""),this.set("step",""),this.set("step_url","")),"step"===t)if(r.set({visible:!0}),n.set({disabled:!0,visible:!1}),this.set("page_url",""),this.get("step"))this.__onStepChange();else{var o,i,a=null===(o=this.em)||void 0===o?void 0:o.get("Editor");if(!a)return;var s=a.Pages;if(!s)return;var l=s.getAll()||[];if(!l.length)return;var c=null===(i=this.getAttributes())||void 0===i?void 0:i["data-target-page"];if(c){var u,d=l.find((function(e){var t,n;return null===(t=e.id||(null===(n=e.getId)||void 0===n?void 0:n.call(e)))||void 0===t?void 0:t.includes(c)}));if(d)return this.set("step",d.id||(null===(u=d.getId)||void 0===u?void 0:u.call(d))),void this.__onStepChange()}var p,f=s.getSelected(),h=l.findIndex((function(e){var t,n;return e.id===(null==f?void 0:f.id)||(null===(t=e.getId)||void 0===t?void 0:t.call(e))===(null==f||null===(n=f.getId)||void 0===n?void 0:n.call(f))})),g=h>=0&&h+1<l.length?l[h+1]:null;if(g)this.set("step",null==g?void 0:g.id);else this.set("step",null===(p=l[h])||void 0===p?void 0:p.id)}var m=null===(e=this.em)||void 0===e?void 0:e.get("Editor");null==m||m.TraitManager.render()},__onStepChange:function(){var e,t=null===(e=this.em)||void 0===e?void 0:e.get("Editor");if(t){var n=t.Pages.get(this.get("step"));if(n){var r=n.getId()||"";this.set("step_url",r)}}},updateStepOptions:function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.get("Editor");if(n){var r=this.getTrait("step");if(r){var o=n.Pages.getAll();if(o&&o.length){var i=(t.current||[]).filter((function(e){var t;return!(null!=e&&null!==(t=e.value)&&void 0!==t&&t.includes("floating-button"))})).map((function(e){return{value:e.value,name:e.label||e.labelName}}));i.length&&(r.set("options",i),n.TraitManager.render())}}}}}:{})}),n.Components.addType("image",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("video",{model:{defaults:{provider:"yt"}}}),n.Components.addType("link",{model:{defaults:{toolbar:fe,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"}],visible:!0}]}}}),n.Components.addType("text",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("divider",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("two-column",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("three-column",{model:{defaults:{toolbar:fe,droppable:!1,traits:[]}}}),n.Components.addType("custom-shopLogo",{model:{defaults:{toolbar:fe,traits:[]}}}),n.Components.addType("default",{model:{defaults:{traits:[]}}})}},be=function(e){var t=e.editor;return t.getSelected()&&t.getSelected().getStyle()};function we(e,t){var n=new Image;n.crossOrigin="Anonymous",n.onload=function(){return t(!0,n)},n.onerror=function(){return t(!1)},n.src=e}var xe=function(e){var t=[];return null==e||e.Pages.getAll().map((function(n){var r=n.getMainComponent();t.push({id:n.id,name:n.name,styles:e.getCss({component:r}),component:e.getHtml({component:r})})})),t};function Ce(e,t){if("object"===k(e)&&null!==e&&"object"===k(t)&&null!==t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;var n=e.slice().sort(),r=t.slice().sort();return n.every((function(e,t){return Ce(n[t],r[t])}))}var o=Object.keys(e),i=Object.keys(t);return o.length===i.length&&(o.sort(),i.sort(),o.every((function(n,r){return n===i[r]&&Ce(e[n],t[n])})))}return e===t}function Se(e){var t;if(!(null==e?void 0:e.getElementById("gjs-placeholder-overlay"))&&e){var n=null==e?void 0:e.createElement("div");n.id="gjs-placeholder-overlay",n.style.cssText="\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-family: sans-serif;\n font-size: 14px;\n color: #19191A;\n opacity: 0.8;\n pointer-events: none;\n z-index: 10;\n margin : 40px;\n border: 1px dashed #CCCCCC;\n border-radius: 16px;\n background-color: #FAFAFA;\n ",n.innerHTML='\n <div style="text-align:center;">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="width:1.5rem;">\n <path d="M6.23077 8.30769H2.07692C1.52609 8.30769 0.997815 8.08887 0.608317 7.69937C0.218818 7.30988 0 6.7816 0 6.23077V2.07692C0 1.52609 0.218818 0.997815 0.608317 0.608317C0.997815 0.218818 1.52609 0 2.07692 0H6.23077C6.7816 0 7.30988 0.218818 7.69937 0.608317C8.08887 0.997815 8.30769 1.52609 8.30769 2.07692V6.23077C8.30769 6.7816 8.08887 7.30988 7.69937 7.69937C7.30988 8.08887 6.7816 8.30769 6.23077 8.30769ZM2.07692 1.38462C1.89331 1.38462 1.71722 1.45755 1.58739 1.58739C1.45755 1.71722 1.38462 1.89331 1.38462 2.07692V6.23077C1.38462 6.41438 1.45755 6.59047 1.58739 6.7203C1.71722 6.85014 1.89331 6.92308 2.07692 6.92308H6.23077C6.41438 6.92308 6.59047 6.85014 6.7203 6.7203C6.85014 6.59047 6.92308 6.41438 6.92308 6.23077V2.07692C6.92308 1.89331 6.85014 1.71722 6.7203 1.58739C6.59047 1.45755 6.41438 1.38462 6.23077 1.38462H2.07692Z" fill="#505152" />\n <path d="M15.9232 8.30769H11.7693C11.2185 8.30769 10.6902 8.08887 10.3007 7.69937C9.9112 7.30988 9.69238 6.7816 9.69238 6.23077V2.07692C9.69238 1.52609 9.9112 0.997815 10.3007 0.608317C10.6902 0.218818 11.2185 0 11.7693 0H15.9232C16.474 0 17.0023 0.218818 17.3918 0.608317C17.7813 0.997815 18.0001 1.52609 18.0001 2.07692V6.23077C18.0001 6.7816 17.7813 7.30988 17.3918 7.69937C17.0023 8.08887 16.474 8.30769 15.9232 8.30769ZM11.7693 1.38462C11.5857 1.38462 11.4096 1.45755 11.2798 1.58739C11.1499 1.71722 11.077 1.89331 11.077 2.07692V6.23077C11.077 6.41438 11.1499 6.59047 11.2798 6.7203C11.4096 6.85014 11.5857 6.92308 11.7693 6.92308H15.9232C16.1068 6.92308 16.2829 6.85014 16.4127 6.7203C16.5425 6.59047 16.6155 6.41438 16.6155 6.23077V2.07692C16.6155 1.89331 16.5425 1.71722 16.4127 1.58739C16.2829 1.45755 16.1068 1.38462 15.9232 1.38462H11.7693Z" fill="#505152" />\n <path d="M6.23077 18.0001H2.07692C1.52609 18.0001 0.997815 17.7813 0.608317 17.3918C0.218818 17.0023 0 16.474 0 15.9232V11.7693C0 11.2185 0.218818 10.6902 0.608317 10.3007C0.997815 9.9112 1.52609 9.69238 2.07692 9.69238H6.23077C6.7816 9.69238 7.30988 9.9112 7.69937 10.3007C8.08887 10.6902 8.30769 11.2185 8.30769 11.7693V15.9232C8.30769 16.474 8.08887 17.0023 7.69937 17.3918C7.30988 17.7813 6.7816 18.0001 6.23077 18.0001ZM2.07692 11.077C1.89331 11.077 1.71722 11.1499 1.58739 11.2798C1.45755 11.4096 1.38462 11.5857 1.38462 11.7693V15.9232C1.38462 16.1068 1.45755 16.2829 1.58739 16.4127C1.71722 16.5425 1.89331 16.6155 2.07692 16.6155H6.23077C6.41438 16.6155 6.59047 16.5425 6.7203 16.4127C6.85014 16.2829 6.92308 16.1068 6.92308 15.9232V11.7693C6.92308 11.5857 6.85014 11.4096 6.7203 11.2798C6.59047 11.1499 6.41438 11.077 6.23077 11.077H2.07692Z" fill="#505152" />\n <path d="M13.8462 18.0001C13.0247 18.0001 12.2216 17.7565 11.5385 17.3C10.8554 16.8436 10.323 16.1949 10.0086 15.4358C9.69418 14.6768 9.61192 13.8416 9.7722 13.0359C9.93248 12.2301 10.3281 11.4899 10.909 10.909C11.4899 10.3281 12.2301 9.93248 13.0359 9.7722C13.8416 9.61192 14.6768 9.69418 15.4358 10.0086C16.1949 10.323 16.8436 10.8554 17.3 11.5385C17.7565 12.2216 18.0001 13.0247 18.0001 13.8462C17.999 14.9476 17.561 16.0035 16.7822 16.7822C16.0035 17.561 14.9476 17.999 13.8462 18.0001ZM13.8462 11.077C13.2985 11.077 12.7631 11.2394 12.3077 11.5437C11.8523 11.848 11.4974 12.2805 11.2878 12.7865C11.0782 13.2925 11.0234 13.8493 11.1302 14.3865C11.2371 14.9237 11.5008 15.4171 11.8881 15.8044C12.2754 16.1917 12.7688 16.4554 13.306 16.5623C13.8432 16.6691 14.4 16.6143 14.906 16.4047C15.412 16.1951 15.8445 15.8401 16.1488 15.3847C16.453 14.9293 16.6155 14.3939 16.6155 13.8462C16.6155 13.1118 16.3237 12.4074 15.8044 11.8881C15.285 11.3688 14.5807 11.077 13.8462 11.077Z" fill="#505152" />\n </svg>\n <div style="color:black;">Drop content blocks from the sidebar here</div>\n </div>\n ',null==e||null===(t=e.body)||void 0===t||t.appendChild(n)}}var _e=function(e){var t=null==e?void 0:e.getSelected(),n=null==e?void 0:e.CssComposer,r=null==t?void 0:t.getClasses(),o={};return null==r||r.forEach((function(e){var t=null==n?void 0:n.getRule(".".concat(e));t&&Object.assign(o,t.getStyle())})),_(_({},o),null==t?void 0:t.getStyle())},Ee=function(e,t,n,r){var o;if(e&&t&&null!=r&&null!==(o=r.attributes)&&void 0!==o&&o.changeProp){var i=null==n?void 0:n.CssComposer,a=t.get(e);if(a&&(a=a.toString().replace(/\s*!important\s*$/i,"").trim()))return a;try{var s=null==t?void 0:t.getClasses(),l={};null==s||s.forEach((function(e){var t=null==i?void 0:i.getRule(".".concat(e));t&&Object.assign(l,t.getStyle())}));var c={},u="function"==typeof t.getId?t.getId():t.get("id");if(u&&i){var d="function"==typeof i.getIdRule?i.getIdRule(u):i.getRule("#".concat(u));d&&(c=d.getStyle()||{})}var p=_(_(_({},c),l),null==t?void 0:t.getStyle()),f=p[e];if(!f&&"border-color"===e&&p.border){var h=p.border.match(/(?:rgba?\([^)]+\)|#[0-9A-Fa-f]{3,8})/);h&&(f=h[0])}if(f)return f=f.toString().replace(/\s*!important\s*$/i,"").trim()}catch(e){}return""}return r.getValue()||""},Oe=function(e,t,n,r,o,i,a,s,l,c){var u=H.init(_({container:"#editor",blockManager:{appendTo:"#blocks"},selectorManager:ne,panels:re,canvas:{styles:ie,scripts:oe},plugins:[ye(r,c),Y],pluginsOpts:M({gjsBlockBasic:{}},Y,{config:{includeUI:{menu:["crop","flip","rotate","draw","shape","icon","text","mask","filter"]}},toolbarIcon:"",addToAssets:!0,onApply:function(e,t){var r=e.toDataURL();m(r,t,n)}}),styleManager:te,traitManager:{custom:!0}},e));null!=t&&t.customRemoteConfig&&u.Storage.add("remote",t.customRemoteConfig);var d=function(e,t){try{var n,r;if(e._duplicationInProgress)return;var o=null==e||null===(n=e.getWrapper)||void 0===n?void 0:n.call(e),i=null==o||null===(r=o.getStyle)||void 0===r?void 0:r.call(o);if(!i||0===Object.keys(i).length){var a,s=(null==t?void 0:t.global_background_color)||"";null==o||null===(a=o.setStyle)||void 0===a||a.call(o,{padding:"0px",background:s})}}catch(e){}};u.on("load",(function(){var t,n,r,c,p,f,h,g,m,v,y,b,w,x,C,S,_,E,O,k,T,P,M,A;Se(),o({shape:(null==e||null===(t=e.componentOptions)||void 0===t||null===(t=t.desktop_teaser_default)||void 0===t?void 0:t.shape)||"Rectangle",style:"Rounded"===(null==e||null===(n=e.componentOptions)||void 0===n||null===(n=n.desktop_teaser_default)||void 0===n?void 0:n.shape)?"circle":(null==e||null===(r=e.componentOptions)||void 0===r||null===(r=r.desktop_teaser_default)||void 0===r?void 0:r.shape)||"Rectangle",layout:(null==e||null===(c=e.componentOptions)||void 0===c||null===(c=c.desktop_teaser_default)||void 0===c?void 0:c.size)||"medium",layoutPosition:(null==e||null===(p=e.componentOptions)||void 0===p||null===(p=p.desktop_teaser_default)||void 0===p?void 0:p.position)||"bottom-left",showCloseButton:null!==(f=null==e||null===(h=e.componentOptions)||void 0===h||null===(h=h.desktop_teaser_default)||void 0===h?void 0:h.closeButton)&&void 0!==f&&f,text:(null==e||null===(g=e.componentOptions)||void 0===g||null===(g=g.desktop_teaser_default)||void 0===g?void 0:g.label)||"Get 10% OFF",textColor:(null==e||null===(m=e.componentOptions)||void 0===m||null===(m=m.desktop_teaser_default)||void 0===m?void 0:m.labelColor)||"#000000",backgroundColor:(null==e||null===(v=e.componentOptions)||void 0===v||null===(v=v.desktop_teaser_default)||void 0===v?void 0:v.backgroundColor)||"#f59e0b"}),i({text:(null==e||null===(y=e.componentOptions)||void 0===y||null===(y=y.mobile_teaser_default)||void 0===y?void 0:y.label)||"Subscribe",shape:(null==e||null===(b=e.componentOptions)||void 0===b||null===(b=b.desktop_teaser_default)||void 0===b?void 0:b.shape)||"rectangle",style:"Rounded"===(null==e||null===(w=e.componentOptions)||void 0===w||null===(w=w.desktop_teaser_default)||void 0===w?void 0:w.shape)?"circle":(null==e||null===(x=e.componentOptions)||void 0===x||null===(x=x.desktop_teaser_default)||void 0===x?void 0:x.shape)||"rectangle",layout:(null==e||null===(C=e.componentOptions)||void 0===C||null===(C=C.desktop_teaser_default)||void 0===C?void 0:C.size)||"medium",layoutPosition:(null==e||null===(S=e.componentOptions)||void 0===S||null===(S=S.desktop_teaser_default)||void 0===S?void 0:S.position)||"bottom-left",showCloseButton:null!==(_=null==e||null===(E=e.componentOptions)||void 0===E||null===(E=E.desktop_teaser_default)||void 0===E?void 0:E.closeButton)&&void 0!==_&&_,textColor:(null==e||null===(O=e.componentOptions)||void 0===O||null===(O=O.desktop_teaser_default)||void 0===O?void 0:O.labelColor)||"#000000",backgroundColor:(null==e||null===(k=e.componentOptions)||void 0===k||null===(k=k.desktop_teaser_default)||void 0===k?void 0:k.backgroundColor)||"#f59e0b"}),a(null!==(T=null==e||null===(P=e.componentOptions)||void 0===P||null===(P=P.desktop_teaser_default)||void 0===P?void 0:P.enable)&&void 0!==T&&T),s(null===(M=null==e||null===(A=e.componentOptions)||void 0===A||null===(A=A.mobile_teaser_default)||void 0===A?void 0:A.showOnMobile)||void 0===M||M),d(u,l)})),u.on("device:select",(function(){var e=u.getSelected();e&&(u.select(null),requestAnimationFrame((function(){u.select(e)})))})),u.on("component:add",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),u.on("component:remove",(function(){setTimeout((function(){var e=u.getWrapper(),t=u.Canvas.getDocument(),n=u.getSelected();0===e.components().length&&!n&&t&&Se(t)}),0)})),u.on("canvas:frame:load",(function(){!function(e){var t,n=e.getWrapper(),r=null===(t=e.Canvas)||void 0===t?void 0:t.getDocument();if(r){var o=null==r?void 0:r.getElementById("gjs-placeholder-overlay");o&&o.remove(),n.components().length||Se(r)}}(u)})),u.on("component:selected",(function(e){var t;if("wrapper"!==(null==e||null===(t=e.get)||void 0===t?void 0:t.call(e,"type"))||"fullpage-builder"===r){var n=u.Canvas.getDocument(),o=null==n?void 0:n.getElementById("gjs-placeholder-overlay");o&&o.remove()}else u.select(null)})),u.on("component:deselected",(function(){var e=u.getWrapper(),t=u.Canvas.getDocument();!u.getSelected()&&t&&0===e.components().length&&Se(t)})),u.on("block:drag:start",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),u.on("block:drag:stop",(function(){setTimeout((function(){var e=u.getWrapper(),t=u.Canvas.getDocument(),n=u.getSelected();0===e.components().length&&!n&&t&&Se(t)}),0)})),u.on("component:drag:start",(function(){var e=u.Canvas.getDocument(),t=null==e?void 0:e.getElementById("gjs-placeholder-overlay");t&&t.remove()})),null==u||u.Commands.add("image-editor",{run:function(e,t){var n,r,o=null==e?void 0:e.getSelected();o&&"image"===(null===(n=o.attributes)||void 0===n?void 0:n.type)&&(o.attributes=_(_({},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()}),e.runCommand("tui-image-editor"))}}),null==u||u.Commands.add("go-to-previous-panel",{run:function(e,t){if(null==e?void 0:e.getSelected()){e.select(null);var n=e.getWrapper(),r=e.Canvas.getDocument();r&&0===n.components().length&&Se(r)}}}),null==u||u.Commands.add("tlb-select-parent",{run:function(e,t){var n=e.getSelected&&e.getSelected();if(n){var r=n.parent&&n.parent();r&&e.select(r)}}});var p=function e(t){var n=t.getAttributes(),r={};n["data-eleid"]&&(r["data-eleid"]="el-"+ee()),n.id&&(r.id="el-"+ee()),Object.keys(r).length>0&&t.addAttributes(r),t.components().each((function(t){return e(t)}))};u._regenerateEleids=p;var f=function(e){var t=e.getSelected();if(t&&"wrapper"!==t.get("type")){e._componentClipboard=t.clone();var n=document.getElementById("editor");n&&n.setAttribute("data-has-clipboard","true")}},h=function(e){if(e._componentClipboard){var t=e._componentClipboard.clone();if("wrapper"!==t.get("type")){p(t);var n=e.getSelected();if(n){if("wrapper"===n.get("type"))return void n.append(t);var r=n.parent();if(!r)return;var o=r.components(),i=o.indexOf(n);o.add(t,{at:i+1})}else e.getWrapper().append(t)}}};u.Commands.add("tlb-clone",{run:function(e){var t=e.getSelected();if(t&&"wrapper"!==t.get("type")){var n=t.clone();p(n);var r=t.parent();if(r){var o=r.components(),i=o.indexOf(t);o.add(n,{at:i+1})}}}}),u.Commands.add("tlb-copy",{run:function(e){f(e)}}),u.Commands.add("tlb-paste",{run:function(e){h(e)}}),u.Commands.add("core:copy",{run:function(e){f(e)}}),u.Commands.add("core:paste",{run:function(e){h(e)}});var g=function(e,t){if(null!=u&&u.getSelected().is("image")&&(u.getSelected().set({src:e,width:"30%"}),u.Modal.close(),u.getSelected())){u.select(null);var n=u.getWrapper(),r=u.Canvas.getDocument();r&&0===n.components().length&&Se(r)}t()},m=function(e,t,n){var r=function(e){for(var t=e.match(/data:([^;]+);base64/)[1].split("/")[1],n=atob(e.split(",")[1]),r=e.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],t,{type:r,lastModified:Date.now()})}(e);n&&n(r,g)};return u.on("page:select",(function(e,t){d(u,l)})),u};var ke={black:"#000",white:"#fff"};var Te={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 Pe={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 Me={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 Ae={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 De={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 Ne={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 Re={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 je(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Ie=Object.freeze({__proto__:null,default:je}),Le="$$material";function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fe.apply(this,arguments)}function Ve(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function Be(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var ze=/^((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|disableRemotePlayback|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)-.*))$/,He=Be((function(e){return ze.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var $e=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if("production"!==process.env.NODE_ENV){var n=64===e.charCodeAt(0)&&105===e.charCodeAt(1);n&&this._alreadyInsertedOrderInsensitiveRule&&console.error("You're attempting to insert the following rule:\n"+e+"\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(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(t){"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(e)||console.error('There was a problem inserting the following rule: "'+e+'"',t)}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0,"production"!==process.env.NODE_ENV&&(this._alreadyInsertedOrderInsensitiveRule=!1)},e}(),We="-ms-",Ue="-moz-",qe="-webkit-",Ge="comm",Ye="rule",Ke="decl",Ze="@keyframes",Xe=Math.abs,Je=String.fromCharCode,Qe=Object.assign;function et(e){return e.trim()}function tt(e,t,n){return e.replace(t,n)}function nt(e,t,n){return e.indexOf(t,n)}function rt(e,t){return 0|e.charCodeAt(t)}function ot(e,t,n){return e.slice(t,n)}function it(e){return e.length}function at(e){return e.length}function st(e,t){return t.push(e),e}var lt=1,ct=1,ut=0,dt=0,pt=0,ft="";function ht(e,t,n,r,o,i,a,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:lt,column:ct,length:a,return:"",siblings:s}}function gt(e,t){return Qe(ht("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function mt(){return pt=dt<ut?rt(ft,dt++):0,ct++,10===pt&&(ct=1,lt++),pt}function vt(){return rt(ft,dt)}function yt(){return dt}function bt(e,t){return ot(ft,e,t)}function wt(e){switch(e){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 xt(e){return lt=ct=1,ut=it(ft=e),dt=0,[]}function Ct(e){return ft="",e}function St(e){return et(bt(dt-1,Ot(91===e?e+2:40===e?e+1:e)))}function _t(e){for(;(pt=vt())&&pt<33;)mt();return wt(e)>2||wt(pt)>3?"":" "}function Et(e,t){for(;--t&&mt()&&!(pt<48||pt>102||pt>57&&pt<65||pt>70&&pt<97););return bt(e,yt()+(t<6&&32==vt()&&32==mt()))}function Ot(e){for(;mt();)switch(pt){case e:return dt;case 34:case 39:34!==e&&39!==e&&Ot(pt);break;case 40:41===e&&Ot(e);break;case 92:mt()}return dt}function kt(e,t){for(;mt()&&e+pt!==57&&(e+pt!==84||47!==vt()););return"/*"+bt(t,dt-1)+"*"+Je(47===e?e:mt())}function Tt(e){for(;!wt(vt());)mt();return bt(e,dt)}function Pt(e){return Ct(Mt("",null,null,null,[""],e=xt(e),0,[0],e))}function Mt(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,p=0,f=0,h=0,g=1,m=1,v=1,y=0,b="",w=o,x=i,C=r,S=b;m;)switch(h=y,y=mt()){case 40:if(108!=h&&58==rt(S,d-1)){-1!=nt(S+=tt(St(y),"&","&\f"),"&\f",Xe(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:S+=St(y);break;case 9:case 10:case 13:case 32:S+=_t(h);break;case 92:S+=Et(yt()-1,7);continue;case 47:switch(vt()){case 42:case 47:st(Dt(kt(mt(),yt()),t,n,l),l);break;default:S+="/"}break;case 123*g:s[c++]=it(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(S=tt(S,/\f/g,"")),f>0&&it(S)-d&&st(f>32?Nt(S+";",r,n,d-1,l):Nt(tt(S," ","")+";",r,n,d-2,l),l);break;case 59:S+=";";default:if(st(C=At(S,t,n,c,u,o,s,b,w=[],x=[],d,i),i),123===y)if(0===u)Mt(S,t,C,C,w,i,d,s,x);else switch(99===p&&110===rt(S,3)?100:p){case 100:case 108:case 109:case 115:Mt(e,C,C,r&&st(At(e,C,C,0,0,o,s,b,o,w=[],d,x),x),o,x,d,s,r?w:x);break;default:Mt(S,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=S="",d=a;break;case 58:d=1+it(S),f=h;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==(pt=dt>0?rt(ft,--dt):0,ct--,10===pt&&(ct=1,lt--),pt))continue;switch(S+=Je(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(it(S)-1)*v,v=1;break;case 64:45===vt()&&(S+=St(mt())),p=vt(),u=d=it(b=S+=Tt(yt())),y++;break;case 45:45===h&&2==it(S)&&(g=0)}}return i}function At(e,t,n,r,o,i,a,s,l,c,u,d){for(var p=o-1,f=0===o?i:[""],h=at(f),g=0,m=0,v=0;g<r;++g)for(var y=0,b=ot(e,p+1,p=Xe(m=a[g])),w=e;y<h;++y)(w=et(m>0?f[y]+" "+b:tt(b,/&\f/g,f[y])))&&(l[v++]=w);return ht(e,t,n,0===o?Ye:s,l,c,u,d)}function Dt(e,t,n,r){return ht(e,t,n,Ge,Je(pt),ot(e,2,-2),0,r)}function Nt(e,t,n,r,o){return ht(e,t,n,Ke,ot(e,0,r),ot(e,r+1,-1),r,o)}function Rt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function jt(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ke:return e.return=e.return||e.value;case Ge:return"";case Ze:return e.return=e.value+"{"+Rt(e.children,r)+"}";case Ye:if(!it(e.value=e.props.join(",")))return""}return it(n=Rt(e.children,r))?e.return=e.value+"{"+n+"}":""}function It(e){var t=at(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}var Lt=function(e,t,n){for(var r=0,o=0;r=o,o=vt(),38===r&&12===o&&(t[n]=1),!wt(o);)mt();return bt(e,dt)},Ft=function(e,t){return Ct(function(e,t){var n=-1,r=44;do{switch(wt(r)){case 0:38===r&&12===vt()&&(t[n]=1),e[n]+=Lt(dt-1,t,n);break;case 2:e[n]+=St(r);break;case 4:if(44===r){e[++n]=58===vt()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Je(r)}}while(r=mt());return e}(xt(e),t))},Vt=new WeakMap,Bt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Vt.get(n))&&!r){Vt.set(e,!0);for(var o=[],i=Ft(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},zt=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},Ht=function(e){return"comm"===e.type&&e.children.indexOf("emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason")>-1},$t=function(e){return 105===e.type.charCodeAt(1)&&64===e.type.charCodeAt(0)},Wt=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},Ut=function(e,t,n){$t(e)&&(e.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."),Wt(e)):function(e,t){for(var n=e-1;n>=0;n--)if(!$t(t[n]))return!0;return!1}(t,n)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Wt(e)))};function qt(e,t){switch(function(e,t){return 45^rt(e,0)?(((t<<2^rt(e,0))<<2^rt(e,1))<<2^rt(e,2))<<2^rt(e,3):0}(e,t)){case 5103:return qe+"print-"+e+e;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 qe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return qe+e+Ue+e+We+e+e;case 6828:case 4268:return qe+e+We+e+e;case 6165:return qe+e+We+"flex-"+e+e;case 5187:return qe+e+tt(e,/(\w+).+(:[^]+)/,qe+"box-$1$2"+We+"flex-$1$2")+e;case 5443:return qe+e+We+"flex-item-"+tt(e,/flex-|-self/,"")+e;case 4675:return qe+e+We+"flex-line-pack"+tt(e,/align-content|flex-|-self/,"")+e;case 5548:return qe+e+We+tt(e,"shrink","negative")+e;case 5292:return qe+e+We+tt(e,"basis","preferred-size")+e;case 6060:return qe+"box-"+tt(e,"-grow","")+qe+e+We+tt(e,"grow","positive")+e;case 4554:return qe+tt(e,/([^-])(transform)/g,"$1"+qe+"$2")+e;case 6187:return tt(tt(tt(e,/(zoom-|grab)/,qe+"$1"),/(image-set)/,qe+"$1"),e,"")+e;case 5495:case 3959:return tt(e,/(image-set\([^]*)/,qe+"$1$`$1");case 4968:return tt(tt(e,/(.+:)(flex-)?(.*)/,qe+"box-pack:$3"+We+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qe+e+e;case 4095:case 3583:case 4068:case 2532:return tt(e,/(.+)-inline(.+)/,qe+"$1$2")+e;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(it(e)-1-t>6)switch(rt(e,t+1)){case 109:if(45!==rt(e,t+4))break;case 102:return tt(e,/(.+:)(.+)-([^]+)/,"$1"+qe+"$2-$3$1"+Ue+(108==rt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~nt(e,"stretch")?qt(tt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==rt(e,t+1))break;case 6444:switch(rt(e,it(e)-3-(~nt(e,"!important")&&10))){case 107:return tt(e,":",":"+qe)+e;case 101:return tt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+qe+(45===rt(e,14)?"inline-":"")+"box$3$1"+qe+"$2$3$1"+We+"$2box$3")+e}break;case 5936:switch(rt(e,t+11)){case 114:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qe+e+We+tt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return qe+e+We+e+e}return e}var Gt,Yt="undefined"!=typeof document,Kt=Yt?void 0:function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}}((function(){return Be((function(){var e={};return function(t){return e[t]}}))})),Zt=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ke:e.return=qt(e.value,e.length);break;case Ze:return Rt([gt(e,{value:tt(e.value,"@","@"+qe)})],r);case Ye:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rt([gt(e,{props:[tt(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Rt([gt(e,{props:[tt(t,/:(plac\w+)/,":"+qe+"input-$1")]}),gt(e,{props:[tt(t,/:(plac\w+)/,":-moz-$1")]}),gt(e,{props:[tt(t,/:(plac\w+)/,We+"input-$1")]})],r)}return""}))}}],Xt=function(e){var t=e.key;if("production"!==process.env.NODE_ENV&&!t)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(Yt&&"css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||Zt;if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(t))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+t+'" was passed');var o,i,a={},s=[];Yt&&(o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)})));var l,c=[Bt,zt];if("production"!==process.env.NODE_ENV&&c.push(function(e){return function(t,n,r){if("rule"===t.type&&!e.compat){var o=t.value.match(/(:first|:nth|:nth-last)-child/g);if(o){for(var i=t.parent?t.parent.children:r,a=i.length-1;a>=0;a--){var s=i[a];if(s.line<t.line)break;if(s.column<t.column){if(Ht(s))return;break}}o.forEach((function(e){console.error('The pseudo class "'+e+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+e.split("-child")[0]+'-of-type".')}))}}}}({get compat(){return v.compat}}),Ut),Yt){var u,d=[jt,"production"!==process.env.NODE_ENV?function(e){e.root||(e.return?u.insert(e.return):e.value&&e.type!==Ge&&u.insert(e.value+"{}"))}:(l=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&l(e)})],p=It(c.concat(r,d));i=function(e,t,n,r){u=n,"production"!==process.env.NODE_ENV&&void 0!==t.map&&(u={insert:function(e){n.insert(e+t.map)}}),function(e){Rt(Pt(e),p)}(e?e+"{"+t.styles+"}":t.styles),r&&(v.inserted[t.name]=!0)}}else{var f=[jt],h=It(c.concat(r,f)),g=Kt(r)(t),m=function(e,t){var n=t.name;return void 0===g[n]&&(g[n]=function(e){return Rt(Pt(e),h)}(e?e+"{"+t.styles+"}":t.styles)),g[n]};i=function(e,t,n,r){var o=t.name,i=m(e,t);return void 0===v.compat?(r&&(v.inserted[o]=!0),"development"===process.env.NODE_ENV&&void 0!==t.map?i+t.map:i):r?void(v.inserted[o]=i):i}}var v={key:t,sheet:new $e({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:i};return v.sheet.hydrate(s),v},Jt={exports:{}},Qt={};var en,tn={};
|
|
12
12
|
/** @license React v16.13.1
|
|
13
13
|
* react-is.development.js
|
|
14
14
|
*
|